コード例 #1
0
        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));
            }
        }
コード例 #2
0
        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));
            }
        }