示例#1
0
    public static global::Array <string> instanceFields(global::System.Type c)
    {
        global::System.Type    c1  = ((global::System.Type)(c));
        global::Array <string> ret = new global::Array <string>(new string[] {});

        global::haxe.lang.Null <global::System.Reflection.BindingFlags> initial = new global::haxe.lang.Null <global::System.Reflection.BindingFlags>(global::System.Reflection.BindingFlags.Public, true);
        global::System.Reflection.BindingFlags this1 = ((!(initial.hasValue)) ? (default(global::System.Reflection.BindingFlags)) : ((initial).@value));
        global::haxe.lang.Null <global::System.Reflection.BindingFlags> initial1 = new global::haxe.lang.Null <global::System.Reflection.BindingFlags>(((global::System.Reflection.BindingFlags)((((global::System.Reflection.BindingFlags)(this1)) | ((global::System.Reflection.BindingFlags)(global::System.Reflection.BindingFlags.Instance))))), true);
        global::System.Reflection.BindingFlags this2 = ((!(initial1.hasValue)) ? (default(global::System.Reflection.BindingFlags)) : ((initial1).@value));
        global::haxe.lang.Null <global::System.Reflection.BindingFlags> initial2 = new global::haxe.lang.Null <global::System.Reflection.BindingFlags>(((global::System.Reflection.BindingFlags)((((global::System.Reflection.BindingFlags)(this2)) | ((global::System.Reflection.BindingFlags)(global::System.Reflection.BindingFlags.FlattenHierarchy))))), true);
        global::System.Reflection.BindingFlags this3 = ((!(initial2.hasValue)) ? (default(global::System.Reflection.BindingFlags)) : ((initial2).@value));
        global::System.Reflection.FieldInfo[]  mis   = c1.GetFields(((global::System.Reflection.BindingFlags)(this3)));
        {
            int _g  = 0;
            int _g1 = (mis as global::System.Array).Length;
            while ((_g < _g1))
            {
                int i = _g++;
                global::System.Reflection.FieldInfo i1 = ((global::System.Reflection.FieldInfo)(mis[i]));
                ret.push((i1 as global::System.Reflection.MemberInfo).Name);
            }
        }

        return(ret);
    }
示例#2
0
文件: Class.cs 项目: g-pechorin/xmlvm
        public virtual global::System.Object getFields()
        {
//XMLVM_BEGIN_WRAPPER[java.lang.Class: java.lang.reflect.Field[] getFields()]
            org.xmlvm._nTIB     tib        = (org.xmlvm._nTIB) this._ftib;
            global::System.Type nativeType = tib.getNativeType();
            global::System.Reflection.BindingFlags bindingFlags
                = global::System.Reflection.BindingFlags.Static
                  | global::System.Reflection.BindingFlags.Instance
                  | global::System.Reflection.BindingFlags.Public
                  | global::System.Reflection.BindingFlags.NonPublic;
            global::System.Reflection.FieldInfo[] fieldInfos
                = nativeType.GetFields(bindingFlags);
            java.lang.reflect.Field[] jFields = new java.lang.reflect.Field[fieldInfos.Length];
            for (int i = 0; i < fieldInfos.Length; i++)
            {
                global::System.Reflection.FieldInfo fieldInfo = fieldInfos[i];
                java.lang.reflect.Field             jField
                    = org.xmlvm._nMemberInfoAdapter <global::System.Reflection.FieldInfo,
                                                     java.lang.reflect.Field._nImpl> .getJavaClient(fieldInfo);

                jFields[i] = jField;
            }
            return(new org.xmlvm._nArrayAdapter <object>(jFields));

            throw new org.xmlvm._nNotYetImplementedException("native/wrapper method not yet implemented");
//XMLVM_END_WRAPPER[java.lang.Class: java.lang.reflect.Field[] getFields()]
        }
示例#3
0
 // Token: 0x060005D1 RID: 1489 RVA: 0x0001C49C File Offset: 0x0001A69C
 public static T CopyComponent <T>(T original, global::UnityEngine.GameObject destination) where T : global::UnityEngine.Component
 {
     global::System.Type                   type      = original.GetType();
     global::UnityEngine.Component         component = destination.AddComponent(type);
     global::System.Reflection.FieldInfo[] fields    = type.GetFields();
     foreach (global::System.Reflection.FieldInfo fieldInfo in fields)
     {
         fieldInfo.SetValue(component, fieldInfo.GetValue(original));
     }
     return(component as T);
 }
        // Token: 0x060005FE RID: 1534 RVA: 0x0001D298 File Offset: 0x0001B498
        public static T CopyComponentFrom <T>(this global::UnityEngine.GameObject destination, T original) where T : global::UnityEngine.Component
        {
            global::System.Type type = original.GetType();
            T t = destination.AddComponent(type) as T;

            global::System.Reflection.FieldInfo[] fields = type.GetFields(20);
            foreach (global::System.Reflection.FieldInfo fieldInfo in fields)
            {
                fieldInfo.SetValue(t, fieldInfo.GetValue(original));
            }
            return(t);
        }
        // Token: 0x060005FD RID: 1533 RVA: 0x0001D230 File Offset: 0x0001B430
        public static U CopyComponentFrom <T, U>(this global::UnityEngine.GameObject destination, T original) where T : global::UnityEngine.Component where U : T
        {
            global::System.Type typeFromHandle = typeof(T);
            U u = destination.AddComponent <U>();

            global::System.Reflection.FieldInfo[] fields = typeFromHandle.GetFields(20);
            foreach (global::System.Reflection.FieldInfo fieldInfo in fields)
            {
                fieldInfo.SetValue(u, fieldInfo.GetValue(original));
            }
            return(u);
        }
示例#6
0
        private static FieldInfo FindField(global::System.Type type, string name, BindingFlags flags)
        {
            if (type == null)
            {
                throw new ArgumentNullException("type");
            }
            if (name == null)
            {
                throw new ArgumentNullException("name");
            }
            FieldInfo field = type.GetField(name, flags);

            if (field != null)
            {
                return(field);
            }
            return(type.GetFields(flags).FirstOrDefault <FieldInfo>(f => f.Name.Equals(name, StringComparison.OrdinalIgnoreCase)));
        }
示例#7
0
        public static global::haxe.root.Array <object> instanceFields(global::System.Type c)
        {
            global::System.Type c1 = ((global::System.Type)(c));
            global::haxe.root.Array <object>       ret   = new global::haxe.root.Array <object>(new object[] {});
            global::System.Reflection.BindingFlags this1 = global::System.Reflection.BindingFlags.Public;
            global::System.Reflection.BindingFlags this2 = ((global::System.Reflection.BindingFlags)((((global::System.Reflection.BindingFlags)(this1)) | ((global::System.Reflection.BindingFlags)(global::System.Reflection.BindingFlags.Instance)))));
            global::System.Reflection.BindingFlags this3 = ((global::System.Reflection.BindingFlags)((((global::System.Reflection.BindingFlags)(this2)) | ((global::System.Reflection.BindingFlags)(global::System.Reflection.BindingFlags.FlattenHierarchy)))));
            global::System.Reflection.FieldInfo[]  mis   = c1.GetFields(((global::System.Reflection.BindingFlags)(this3)));
            {
                int _g1 = 0;
                int _g  = (mis as global::System.Array).Length;
                while ((_g1 < _g))
                {
                    int i = _g1++;
                    global::System.Reflection.FieldInfo i1 = mis[i];
                    ret.push((i1 as global::System.Reflection.MemberInfo).Name);
                }
            }

            return(ret);
        }
示例#8
0
        public static global::haxe.root.Array instanceFields(global::System.Type c)
        {
                        #line 101 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\Reflect.hx"
            global::System.Type     c1  = ((global::System.Type)(c));
            global::haxe.root.Array ret = new global::haxe.root.Array(new object[] {});
                        #line 103 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\Reflect.hx"
            object initial = global::System.Reflection.BindingFlags.Public;
                        #line 103 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\Reflect.hx"
            global::System.Reflection.BindingFlags this1 = (((initial == default(object))) ? (default(global::System.Reflection.BindingFlags)) : (((global::System.Reflection.BindingFlags)(initial))));
                        #line 103 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\Reflect.hx"
            object initial1 = ((global::System.Reflection.BindingFlags)((((global::System.Reflection.BindingFlags)(this1)) | ((global::System.Reflection.BindingFlags)(global::System.Reflection.BindingFlags.Instance)))));
                        #line 103 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\Reflect.hx"
            global::System.Reflection.BindingFlags this2 = (((initial1 == default(object))) ? (default(global::System.Reflection.BindingFlags)) : (((global::System.Reflection.BindingFlags)(initial1))));
                        #line 103 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\Reflect.hx"
            object initial2 = ((global::System.Reflection.BindingFlags)((((global::System.Reflection.BindingFlags)(this2)) | ((global::System.Reflection.BindingFlags)(global::System.Reflection.BindingFlags.FlattenHierarchy)))));
                        #line 103 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\Reflect.hx"
            global::System.Reflection.BindingFlags this3 = (((initial2 == default(object))) ? (default(global::System.Reflection.BindingFlags)) : (((global::System.Reflection.BindingFlags)(initial2))));
                        #line 103 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\Reflect.hx"
            global::System.Reflection.FieldInfo[] mis = c1.GetFields(((global::System.Reflection.BindingFlags)(this3)));
            {
                                #line 104 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\Reflect.hx"
                int _g = 0;
                                #line 104 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\Reflect.hx"
                int _g1 = (mis as global::System.Array).Length;
                                #line 104 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\Reflect.hx"
                while ((_g < _g1))
                {
                                        #line 104 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\Reflect.hx"
                    int i = _g++;
                    global::System.Reflection.FieldInfo i1 = ((global::System.Reflection.FieldInfo)(mis[i]));
                                        #line 106 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\Reflect.hx"
                    ret.push((i1 as global::System.Reflection.MemberInfo).Name);
                }
            }

                        #line 108 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\Reflect.hx"
            return(ret);
        }
示例#9
0
 // Token: 0x0600048B RID: 1163 RVA: 0x000175E8 File Offset: 0x000157E8
 public static global::System.Collections.Generic.IEnumerable <global::System.Reflection.FieldInfo> ExtractCommands(global::System.Type type)
 {
     return(global::System.Linq.Enumerable.Where <global::System.Reflection.FieldInfo>(type.GetFields(88), (global::System.Reflection.FieldInfo field) => global::VRGIN.Controls.Speech.DictionaryReader.IsVoiceCommandType(field.FieldType)));
 }
示例#10
0
        public static object Cast(global::System.Type type, object src)
        {
            var obj = global::System.Activator.CreateInstance(type);

            var fields = type.GetFields();

            if (type == typeof(BigInteger))
            {
                var num = ((Lux.VM.StackItem)src).GetBigInteger();
                return(num);
            }

            var str = (Lux.VM.Types.Struct)src;

            int    index = 0;
            object box   = obj;

            foreach (var field in fields)
            {
                var item = str[index];

                object val;

                if (item is Lux.VM.Types.ByteArray)
                {
                    val = item.GetByteArray();
                }
                else
                if (item is Lux.VM.Types.Integer)
                {
                    val = item.GetBigInteger();
                }
                else
                if (item is Lux.VM.Types.Boolean)
                {
                    val = item.GetBoolean();
                }
                else
                if (item is Lux.VM.Types.Struct && ((Lux.VM.Types.Struct)item).Count == 0)
                {
                    val = new BigInteger(0);
                }
                else
                if (item is Lux.VM.Types.Array)
                {
                    var array       = (Lux.VM.Types.Array)item;
                    var arrayType   = field.FieldType;
                    var elementType = arrayType.GetElementType();

                    var dest = global::System.Array.CreateInstance(elementType, array.Count);
                    for (int i = 0; i < array.Count; i++)
                    {
                        var arrayItem = Cast(elementType, array[i]);
                        dest.SetValue(arrayItem, i);
                    }
                    val = dest;
                }
                else
                {
                    throw new global::System.NotImplementedException();
                }

                field.SetValue(box, val);
                index++;
            }

            return(box);
        }