public static void AddConstructor(this EngineInstance engine, ObjectInstance obj, Type type) { var info = type.GetConstructors().FirstOrDefault(m => m.GetCustomAttributes <DomConstructorAttribute>().Any()); if (info != null) { var name = type.GetOfficialName(); var constructor = new DomConstructorInstance(engine, info); obj.FastSetProperty(name, new PropertyDescriptor(constructor, false, true, false)); } }
public static void AddConstructor(this EngineInstance engine, ObjectInstance obj, Type type) { var info = type.GetConstructors().FirstOrDefault(m => m.GetCustomAttributes<DomConstructorAttribute>().Any()); if (info != null) { var name = type.GetOfficialName(); var constructor = new DomConstructorInstance(engine, info); obj.FastSetProperty(name, new PropertyDescriptor(constructor, false, true, false)); } }