示例#1
0
 public static global::Array <string> getEnumConstructs(global::System.Type e)
 {
             #line 245 "/opt/haxe/std/cs/_std/Type.hx"
     global::System.Type t = (((object)(e)) as global::System.Type);
     global::haxe.lang.Null <global::System.Reflection.BindingFlags> initial = new global::haxe.lang.Null <global::System.Reflection.BindingFlags>(global::System.Reflection.BindingFlags.Static, 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)(this1)) | ((global::System.Reflection.BindingFlags)(global::System.Reflection.BindingFlags.NonPublic))), true);
     global::System.Reflection.BindingFlags this2 = ((!(initial1.hasValue)) ? (default(global::System.Reflection.BindingFlags)) : ((initial1).@value));
     global::System.Reflection.FieldInfo    f     = t.GetField(((string)("__hx_constructs")), ((global::System.Reflection.BindingFlags)(this2)));
             #line 247 "/opt/haxe/std/cs/_std/Type.hx"
     if ((f != null))
     {
                     #line 248 "/opt/haxe/std/cs/_std/Type.hx"
         global::System.Array values = ((global::System.Array)(f.GetValue(default(object))));
         string[]             copy   = new string[values.Length];
                     #line 250 "/opt/haxe/std/cs/_std/Type.hx"
         global::System.Array.Copy(((global::System.Array)(values)), ((global::System.Array)(copy)), ((int)(values.Length)));
         return(new global::Array <string>(((string[])(copy))));
     }
     else
     {
                     #line 253 "/opt/haxe/std/cs/_std/Type.hx"
         return(new global::Array <string>(((string[])(global::System.Enum.GetNames(((global::System.Type)(t)))))));
     }
 }
示例#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: 0x060005D9 RID: 1497 RVA: 0x0001CB20 File Offset: 0x0001AD20
        public static object GetPropertyOrField <T>(T obj, string name)
        {
            global::System.Reflection.PropertyInfo property = typeof(T).GetProperty(name, 52);
            global::System.Reflection.FieldInfo    field    = typeof(T).GetField(name, 52);
            bool   flag = property != null;
            object result;

            if (flag)
            {
                result = property.GetValue(obj, null);
            }
            else
            {
                bool flag2 = field != null;
                if (flag2)
                {
                    result = field.GetValue(obj);
                }
                else
                {
                    global::VRGIN.Core.VRLog.Warn("Prop/Field not found!", global::System.Array.Empty <object>());
                    result = null;
                }
            }
            return(result);
        }
示例#4
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);
    }
        public static global::System.Object getVisualStateProperty_50aaaf9819334ab9a5e132c1f664445d(global::System.Windows.DependencyObject finalTargetInstance)
        {
            global::System.Type finalTargetInstanceType             = finalTargetInstance.GetType();
            global::System.Type propertyDeclaringType               = finalTargetInstanceType.GetProperty("FontWeight").DeclaringType;
            global::System.Reflection.FieldInfo       propertyField = propertyDeclaringType.GetField("FontWeightProperty");
            global::System.Windows.DependencyProperty property      = (global::System.Windows.DependencyProperty)propertyField.GetValue(null);

            return(finalTargetInstance.GetVisualStateValue(property));
        }
        public static void setLocalVisualStateProperty_50aaaf9819334ab9a5e132c1f664445d(global::Windows.UI.Xaml.DependencyObject finalTargetInstance, object value)
        {
            global::System.Type finalTargetInstanceType = finalTargetInstance.GetType();
            global::System.Type propertyDeclaringType   = finalTargetInstanceType.GetProperty("FontWeight").DeclaringType;
            global::System.Reflection.FieldInfo        propertyField = propertyDeclaringType.GetField("FontWeightProperty");
            global::Windows.UI.Xaml.DependencyProperty property      = (global::Windows.UI.Xaml.DependencyProperty)propertyField.GetValue(null);

            (finalTargetInstance).SetLocalValue(property, value);
        }
示例#7
0
    // Token: 0x0600003F RID: 63 RVA: 0x0000301C File Offset: 0x0000121C
    public void ForceLast()
    {
        bool flag = global::SteamVR_Camera.values != null;

        if (flag)
        {
            foreach (object obj in global::SteamVR_Camera.values)
            {
                global::System.Collections.DictionaryEntry dictionaryEntry = (global::System.Collections.DictionaryEntry)obj;
                global::System.Reflection.FieldInfo        fieldInfo       = dictionaryEntry.Key as global::System.Reflection.FieldInfo;
                fieldInfo.SetValue(this, dictionaryEntry.Value);
            }
            global::SteamVR_Camera.values = null;
        }
        else
        {
            global::UnityEngine.Component[] components = base.GetComponents <global::UnityEngine.Component>();
            for (int i = 0; i < components.Length; i++)
            {
                global::SteamVR_Camera steamVR_Camera = components[i] as global::SteamVR_Camera;
                bool flag2 = steamVR_Camera != null && steamVR_Camera != this;
                if (flag2)
                {
                    bool flag3 = steamVR_Camera.flip != null;
                    if (flag3)
                    {
                        global::UnityEngine.Object.DestroyImmediate(steamVR_Camera.flip);
                    }
                    global::UnityEngine.Object.DestroyImmediate(steamVR_Camera);
                }
            }
            components = base.GetComponents <global::UnityEngine.Component>();
            bool flag4 = this != components[components.Length - 1] || this.flip == null;
            if (flag4)
            {
                bool flag5 = this.flip == null;
                if (flag5)
                {
                    this.flip = base.gameObject.AddComponent <global::SteamVR_CameraFlip>();
                }
                global::SteamVR_Camera.values = new global::System.Collections.Hashtable();
                global::System.Reflection.FieldInfo[] fields = base.GetType().GetFields(52);
                foreach (global::System.Reflection.FieldInfo fieldInfo2 in fields)
                {
                    bool flag6 = fieldInfo2.IsPublic || fieldInfo2.IsDefined(typeof(global::UnityEngine.SerializeField), true);
                    if (flag6)
                    {
                        global::SteamVR_Camera.values[fieldInfo2] = fieldInfo2.GetValue(this);
                    }
                }
                global::UnityEngine.GameObject gameObject = base.gameObject;
                global::UnityEngine.Object.DestroyImmediate(this);
                gameObject.AddComponent <global::SteamVR_Camera>().ForceLast();
            }
        }
    }
示例#8
0
 private static void SetValue5(global::System.IntPtr @__envp, global::net.sf.jni4net.utils.JniLocalHandle @__obj, global::net.sf.jni4net.utils.JniLocalHandle obj, global::net.sf.jni4net.utils.JniLocalHandle value)
 {
     // (Lsystem/Object;Lsystem/Object;)V
     // (LSystem/Object;LSystem/Object;)V
     global::net.sf.jni4net.jni.JNIEnv @__env = global::net.sf.jni4net.jni.JNIEnv.Wrap(@__envp);
     try {
         global::System.Reflection.FieldInfo @__real = global::net.sf.jni4net.utils.Convertor.StrongJp2C <global::System.Reflection.FieldInfo>(@__env, @__obj);
         ((global::System.Runtime.InteropServices._FieldInfo)(@__real)).SetValue(global::net.sf.jni4net.utils.Convertor.FullJ2C <object>(@__env, obj), global::net.sf.jni4net.utils.Convertor.FullJ2C <object>(@__env, value));
     }catch (global::System.Exception __ex) { @__env.ThrowExisting(__ex); }
 }
示例#9
0
 private static void SetValue2(global::System.IntPtr @__envp, global::net.sf.jni4net.utils.JniLocalHandle @__obj, global::net.sf.jni4net.utils.JniLocalHandle obj, global::net.sf.jni4net.utils.JniLocalHandle value, global::net.sf.jni4net.utils.JniLocalHandle invokeAttr, global::net.sf.jni4net.utils.JniLocalHandle binder, global::net.sf.jni4net.utils.JniLocalHandle culture)
 {
     // (Lsystem/Object;Lsystem/Object;Lsystem/reflection/BindingFlags;Lsystem/Object;Lsystem/Object;)V
     // (LSystem/Object;LSystem/Object;LSystem/Reflection/BindingFlags;LSystem/Reflection/Binder;LSystem/Globalization/CultureInfo;)V
     global::net.sf.jni4net.jni.JNIEnv @__env = global::net.sf.jni4net.jni.JNIEnv.Wrap(@__envp);
     try {
         global::System.Reflection.FieldInfo @__real = global::net.sf.jni4net.utils.Convertor.StrongJp2C <global::System.Reflection.FieldInfo>(@__env, @__obj);
         ((global::System.Runtime.InteropServices._FieldInfo)(@__real)).SetValue(global::net.sf.jni4net.utils.Convertor.FullJ2C <object>(@__env, obj), global::net.sf.jni4net.utils.Convertor.FullJ2C <object>(@__env, value), global::net.sf.jni4net.utils.Convertor.StrongJp2C <global::System.Reflection.BindingFlags>(@__env, invokeAttr), global::net.sf.jni4net.utils.Convertor.StrongJp2C <global::System.Reflection.Binder>(@__env, binder), global::net.sf.jni4net.utils.Convertor.StrongJp2C <global::System.Globalization.CultureInfo>(@__env, culture));
     }catch (global::System.Exception __ex) { @__env.ThrowExisting(__ex); }
 }
示例#10
0
 private static global::net.sf.jni4net.utils.JniHandle GetRawConstantValue22(global::System.IntPtr @__envp, global::net.sf.jni4net.utils.JniLocalHandle @__obj)
 {
     // ()Lsystem/Object;
     // ()LSystem/Object;
     global::net.sf.jni4net.jni.JNIEnv      @__env    = global::net.sf.jni4net.jni.JNIEnv.Wrap(@__envp);
     global::net.sf.jni4net.utils.JniHandle @__return = default(global::net.sf.jni4net.utils.JniHandle);
     try {
         global::System.Reflection.FieldInfo @__real = global::net.sf.jni4net.utils.Convertor.StrongJp2C <global::System.Reflection.FieldInfo>(@__env, @__obj);
         @__return = global::net.sf.jni4net.utils.Convertor.FullC2J <object>(@__env, @__real.GetRawConstantValue());
     }catch (global::System.Exception __ex) { @__env.ThrowExisting(__ex); }
     return(@__return);
 }
示例#11
0
 private static global::net.sf.jni4net.utils.JniHandle GetOptionalCustomModifiers21(global::System.IntPtr @__envp, global::net.sf.jni4net.utils.JniLocalHandle @__obj)
 {
     // ()[Lsystem/Type;
     // ()[LSystem/Type;
     global::net.sf.jni4net.jni.JNIEnv      @__env    = global::net.sf.jni4net.jni.JNIEnv.Wrap(@__envp);
     global::net.sf.jni4net.utils.JniHandle @__return = default(global::net.sf.jni4net.utils.JniHandle);
     try {
         global::System.Reflection.FieldInfo @__real = global::net.sf.jni4net.utils.Convertor.StrongJp2C <global::System.Reflection.FieldInfo>(@__env, @__obj);
         @__return = global::net.sf.jni4net.utils.Convertor.ArrayStrongC2Jp <global::System.Type[], global::System.Type>(@__env, @__real.GetOptionalCustomModifiers());
     }catch (global::System.Exception __ex) { @__env.ThrowExisting(__ex); }
     return(@__return);
 }
示例#12
0
 private static global::net.sf.jni4net.utils.JniHandle FieldType0(global::System.IntPtr @__envp, global::net.sf.jni4net.utils.JniLocalHandle @__obj)
 {
     // ()Lsystem/Type;
     // ()LSystem/Type;
     global::net.sf.jni4net.jni.JNIEnv      @__env    = global::net.sf.jni4net.jni.JNIEnv.Wrap(@__envp);
     global::net.sf.jni4net.utils.JniHandle @__return = default(global::net.sf.jni4net.utils.JniHandle);
     try {
         global::System.Reflection.FieldInfo @__real = global::net.sf.jni4net.utils.Convertor.StrongJp2C <global::System.Reflection.FieldInfo>(@__env, @__obj);
         @__return = global::net.sf.jni4net.utils.Convertor.StrongC2Jp <global::System.Type>(@__env, ((global::System.Runtime.InteropServices._FieldInfo)(@__real)).FieldType);
     }catch (global::System.Exception __ex) { @__env.ThrowExisting(__ex); }
     return(@__return);
 }
示例#13
0
 private static global::net.sf.jni4net.utils.JniHandle GetValue1(global::System.IntPtr @__envp, global::net.sf.jni4net.utils.JniLocalHandle @__obj, global::net.sf.jni4net.utils.JniLocalHandle obj)
 {
     // (Lsystem/Object;)Lsystem/Object;
     // (LSystem/Object;)LSystem/Object;
     global::net.sf.jni4net.jni.JNIEnv      @__env    = global::net.sf.jni4net.jni.JNIEnv.Wrap(@__envp);
     global::net.sf.jni4net.utils.JniHandle @__return = default(global::net.sf.jni4net.utils.JniHandle);
     try {
         global::System.Reflection.FieldInfo @__real = global::net.sf.jni4net.utils.Convertor.StrongJp2C <global::System.Reflection.FieldInfo>(@__env, @__obj);
         @__return = global::net.sf.jni4net.utils.Convertor.FullC2J <object>(@__env, ((global::System.Runtime.InteropServices._FieldInfo)(@__real)).GetValue(global::net.sf.jni4net.utils.Convertor.FullJ2C <object>(@__env, obj)));
     }catch (global::System.Exception __ex) { @__env.ThrowExisting(__ex); }
     return(@__return);
 }
示例#14
0
        private static bool IsSecurityTransparent25(global::System.IntPtr @__envp, global::net.sf.jni4net.utils.JniLocalHandle @__obj)
        {
            // ()Z
            // ()Z
            global::net.sf.jni4net.jni.JNIEnv @__env = global::net.sf.jni4net.jni.JNIEnv.Wrap(@__envp);
            bool @__return = default(bool);

            try {
                global::System.Reflection.FieldInfo @__real = global::net.sf.jni4net.utils.Convertor.StrongJp2C <global::System.Reflection.FieldInfo>(@__env, @__obj);
                @__return = ((bool)(@__real.IsSecurityTransparent));
            }catch (global::System.Exception __ex) { @__env.ThrowExisting(__ex); }
            return(@__return);
        }
示例#15
0
        private static bool IsPinvokeImpl17(global::System.IntPtr @__envp, global::net.sf.jni4net.utils.JniLocalHandle @__obj)
        {
            // ()Z
            // ()Z
            global::net.sf.jni4net.jni.JNIEnv @__env = global::net.sf.jni4net.jni.JNIEnv.Wrap(@__envp);
            bool @__return = default(bool);

            try {
                global::System.Reflection.FieldInfo @__real = global::net.sf.jni4net.utils.Convertor.StrongJp2C <global::System.Reflection.FieldInfo>(@__env, @__obj);
                @__return = ((bool)(((global::System.Runtime.InteropServices._FieldInfo)(@__real)).IsPinvokeImpl));
            }catch (global::System.Exception __ex) { @__env.ThrowExisting(__ex); }
            return(@__return);
        }
示例#16
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);
        }
示例#17
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);
        }
示例#18
0
        // Token: 0x060005D8 RID: 1496 RVA: 0x0001CA9C File Offset: 0x0001AC9C
        public static void SetPropertyOrField <T>(T obj, string name, object value)
        {
            global::System.Reflection.PropertyInfo property = typeof(T).GetProperty(name, 52);
            global::System.Reflection.FieldInfo    field    = typeof(T).GetField(name, 52);
            bool flag = property != null;

            if (flag)
            {
                property.SetValue(obj, value, null);
            }
            else
            {
                bool flag2 = field != null;
                if (flag2)
                {
                    field.SetValue(obj, value);
                }
                else
                {
                    global::VRGIN.Core.VRLog.Warn("Prop/Field not found!", global::System.Array.Empty <object>());
                }
            }
        }
示例#19
0
        public static global::haxe.root.Array getEnumConstructs(global::System.Type e)
        {
                        #line 245 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\Type.hx"
            global::System.Type t = ((global::System.Type)((((object)(e)) as global::System.Type)));
            object initial        = global::System.Reflection.BindingFlags.Static;
            global::System.Reflection.BindingFlags this1 = (((initial == default(object))) ? (default(global::System.Reflection.BindingFlags)) : (((global::System.Reflection.BindingFlags)(initial))));
            object initial1 = ((global::System.Reflection.BindingFlags)((((global::System.Reflection.BindingFlags)(this1)) | ((global::System.Reflection.BindingFlags)(global::System.Reflection.BindingFlags.NonPublic)))));
            global::System.Reflection.BindingFlags this2 = (((initial1 == default(object))) ? (default(global::System.Reflection.BindingFlags)) : (((global::System.Reflection.BindingFlags)(initial1))));
            global::System.Reflection.FieldInfo    f     = t.GetField(((string)("__hx_constructs")), ((global::System.Reflection.BindingFlags)(this2)));
                        #line 247 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\Type.hx"
            if ((f != null))
            {
                                #line 248 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\Type.hx"
                global::System.Array values = ((global::System.Array)(f.GetValue(default(object))));
                string[]             copy   = new string[values.Length];
                                #line 250 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\Type.hx"
                global::System.Array.Copy(((global::System.Array)(values)), ((global::System.Array)(copy)), ((int)(values.Length)));
                object[] ret = new object[(copy as global::System.Array).Length];
                {
                                        #line 251 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\Type.hx"
                    int _g = 0;
                                        #line 251 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\Type.hx"
                    int _g1 = (copy as global::System.Array).Length;
                                        #line 251 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\Type.hx"
                    while ((_g < _g1))
                    {
                                                #line 251 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\Type.hx"
                        int i = _g++;
                                                #line 251 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\Type.hx"
                        ret[i] = ((string)(copy[i]));
                    }
                }

                                #line 251 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\Type.hx"
                object[] dyn = ret;
                                #line 251 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\Type.hx"
                return(new global::haxe.root.Array(((object[])(dyn))));
            }
            else
            {
                                #line 253 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\Type.hx"
                string[] native = global::System.Enum.GetNames(((global::System.Type)(t)));
                                #line 253 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\Type.hx"
                object[] ret1 = new object[(native as global::System.Array).Length];
                                #line 253 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\Type.hx"
                {
                                        #line 253 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\Type.hx"
                    int _g2 = 0;
                                        #line 253 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\Type.hx"
                    int _g11 = (native as global::System.Array).Length;
                                        #line 253 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\Type.hx"
                    while ((_g2 < _g11))
                    {
                                                #line 253 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\Type.hx"
                        int i1 = _g2++;
                                                #line 253 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\Type.hx"
                        ret1[i1] = ((string)(native[i1]));
                    }
                }

                                #line 253 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\Type.hx"
                object[] dyn1 = ret1;
                                #line 253 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\Type.hx"
                return(new global::haxe.root.Array(((object[])(dyn1))));
            }
        }
示例#20
0
        /// <summary>
        /// Returns a friendly strign representation of this instruction
        /// </summary>
        /// <returns></returns>
        public string GetCode()
        {
            string result = "";

            result += GetExpandedOffset(offset) + " : " + "<b>" + code.ToString().ToUpperInvariant() + "</b>";
            if (operand != null)
            {
                switch (code.OperandType)
                {
                case OperandType.InlineField:
                    global::System.Reflection.FieldInfo fOperand = ((global::System.Reflection.FieldInfo)operand);
                    result += " " + Globals.ProcessSpecialTypes(fOperand.FieldType.ToString()) + " " +
                              Globals.ProcessSpecialTypes(fOperand.ReflectedType.ToString()) +
                              "::" + fOperand.Name + "";
                    break;

                case OperandType.InlineMethod:
                    try
                    {
                        global::System.Reflection.MethodInfo mOperand = (global::System.Reflection.MethodInfo)operand;
                        result += " ";
                        if (!mOperand.IsStatic)
                        {
                            result += "instance ";
                        }
                        result += Globals.ProcessSpecialTypes(mOperand.ReturnType.ToString()) +
                                  " " + Globals.ProcessSpecialTypes(mOperand.ReflectedType.ToString()) +
                                  "::" + mOperand.Name + "()";
                    }
                    catch
                    {
                        try
                        {
                            global::System.Reflection.ConstructorInfo mOperand = (global::System.Reflection.ConstructorInfo)operand;
                            result += " ";
                            if (!mOperand.IsStatic)
                            {
                                result += "instance ";
                            }
                            result += "void " +
                                      Globals.ProcessSpecialTypes(mOperand.ReflectedType.ToString()) +
                                      "::" + mOperand.Name + "()";
                        }
                        catch
                        {
                        }
                    }
                    break;

                case OperandType.ShortInlineBrTarget:
                case OperandType.InlineBrTarget:
                    result += " " + GetExpandedOffset((int)operand);
                    break;

                case OperandType.InlineType:
                    result += " " + Globals.ProcessSpecialTypes(operand.ToString());
                    break;

                case OperandType.InlineString:
                    if (operand.ToString() == "\r\n")
                    {
                        result += " \"\\r\\n\"";
                    }
                    else
                    {
                        result += " \"" + operand.ToString() + "\"";
                    }
                    break;

                case OperandType.ShortInlineVar:
                    result += " " + operand.ToString();
                    break;

                case OperandType.InlineI:
                case OperandType.InlineI8:
                case OperandType.InlineR:
                case OperandType.ShortInlineI:
                case OperandType.ShortInlineR:
                    result += " " + operand.ToString();
                    break;

                case OperandType.InlineTok:
                    if (operand is Type)
                    {
                        result += ((Type)operand).FullName;
                    }
                    else
                    {
                        result += "not supported";
                    }
                    break;

                default: result += "not supported"; break;
                }
            }
            return(result);
        }
示例#21
0
        public static object slowGetField(object obj, string field, bool throwErrors)
        {
            if ((obj == null))
            {
                if (throwErrors)
                {
                    throw new global::System.NullReferenceException(global::haxe.lang.Runtime.concat(global::haxe.lang.Runtime.concat("Cannot access field \'", field), "\' of null."));
                }
                else
                {
                    return(null);
                }
            }

            global::System.Type t = ((global::System.Type)((obj as global::System.Type)));
            global::System.Reflection.BindingFlags bf = default(global::System.Reflection.BindingFlags);
            if ((t == null))
            {
                string s = ((string)((obj as string)));
                if (!(string.Equals(s, null)))
                {
                    return(global::haxe.lang.StringRefl.handleGetField(s, field, throwErrors));
                }

                t  = ((global::System.Type)(obj.GetType()));
                bf = ((global::System.Reflection.BindingFlags)((((global::System.Reflection.BindingFlags)((((global::System.Reflection.BindingFlags)(global::System.Reflection.BindingFlags.Instance)) | ((global::System.Reflection.BindingFlags)(global::System.Reflection.BindingFlags.Public))))) | ((global::System.Reflection.BindingFlags)(global::System.Reflection.BindingFlags.FlattenHierarchy)))));
            }
            else
            {
                if (((t == ((global::System.Type)(typeof(string)))) && string.Equals(field, "fromCharCode")))
                {
                    return(new global::haxe.lang.Closure(typeof(global::haxe.lang.StringExt), field, 0));
                }

                obj = null;
                bf  = ((global::System.Reflection.BindingFlags)((((global::System.Reflection.BindingFlags)(global::System.Reflection.BindingFlags.Static)) | ((global::System.Reflection.BindingFlags)(global::System.Reflection.BindingFlags.Public)))));
            }

            global::System.Reflection.FieldInfo f = t.GetField(((string)(field)), ((global::System.Reflection.BindingFlags)(bf)));
            if ((f != null))
            {
                return(global::haxe.lang.Runtime.unbox(f.GetValue(((object)(obj)))));
            }
            else
            {
                global::System.Reflection.PropertyInfo prop = t.GetProperty(((string)(field)), ((global::System.Reflection.BindingFlags)(bf)));
                if ((prop == null))
                {
                    global::System.Reflection.MemberInfo[] m = t.GetMember(((string)(field)), ((global::System.Reflection.BindingFlags)(bf)));
                    if ((((m as global::System.Array).Length == 0) && ((string.Equals(field, "__get") || string.Equals(field, "__set")))))
                    {
                        m = t.GetMember(((string)(((string.Equals(field, "__get")) ? ("get_Item") : ("set_Item")))), ((global::System.Reflection.BindingFlags)(bf)));
                    }

                    if (((m as global::System.Array).Length > 0))
                    {
                        return(new global::haxe.lang.Closure((((obj != null)) ? (obj) : ((object)(t))), field, 0));
                    }
                    else
                    {
                        if (t.IsCOMObject)
                        {
                            try {
                                return(t.InvokeMember(((string)(field)), ((global::System.Reflection.BindingFlags)(global::System.Reflection.BindingFlags.GetProperty)), default(global::System.Reflection.Binder), ((object)(obj)), ((object[])(new object[0]))));
                            }
                            catch (global::System.Exception e) {
                                global::haxe.lang.Exceptions.exception = e;
                            }
                        }

                        if (throwErrors)
                        {
                            throw global::haxe.lang.HaxeException.wrap(global::haxe.lang.Runtime.concat(global::haxe.lang.Runtime.concat("Cannot access field \'", field), "\'."));
                        }
                        else
                        {
                            return(null);
                        }
                    }
                }

                return(global::haxe.lang.Runtime.unbox(prop.GetValue(((object)(obj)), default(object[]))));
            }
        }
示例#22
0
 // Token: 0x06000064 RID: 100 RVA: 0x00004460 File Offset: 0x00002660
 public void ReadConfig()
 {
     try
     {
         global::Valve.VR.HmdMatrix34_t pose = default(global::Valve.VR.HmdMatrix34_t);
         bool     flag  = false;
         object   obj   = this.config;
         string[] array = global::System.IO.File.ReadAllLines(this.configPath);
         foreach (string text in array)
         {
             string[] array3 = text.Split('=', 0);
             bool     flag2  = array3.Length == 2;
             if (flag2)
             {
                 string text2 = array3[0];
                 bool   flag3 = text2 == "m";
                 if (flag3)
                 {
                     string[] array4 = array3[1].Split(',', 0);
                     bool     flag4  = array4.Length == 12;
                     if (flag4)
                     {
                         pose.m0  = float.Parse(array4[0]);
                         pose.m1  = float.Parse(array4[1]);
                         pose.m2  = float.Parse(array4[2]);
                         pose.m3  = float.Parse(array4[3]);
                         pose.m4  = float.Parse(array4[4]);
                         pose.m5  = float.Parse(array4[5]);
                         pose.m6  = float.Parse(array4[6]);
                         pose.m7  = float.Parse(array4[7]);
                         pose.m8  = float.Parse(array4[8]);
                         pose.m9  = float.Parse(array4[9]);
                         pose.m10 = float.Parse(array4[10]);
                         pose.m11 = float.Parse(array4[11]);
                         flag     = true;
                     }
                 }
                 else
                 {
                     bool flag5 = text2 == "disableStandardAssets";
                     if (flag5)
                     {
                         global::System.Reflection.FieldInfo field = obj.GetType().GetField(text2);
                         bool flag6 = field != null;
                         if (flag6)
                         {
                             field.SetValue(obj, bool.Parse(array3[1]));
                         }
                     }
                     else
                     {
                         global::System.Reflection.FieldInfo field2 = obj.GetType().GetField(text2);
                         bool flag7 = field2 != null;
                         if (flag7)
                         {
                             field2.SetValue(obj, float.Parse(array3[1]));
                         }
                     }
                 }
             }
         }
         this.config = (global::SteamVR_ExternalCamera.Config)obj;
         bool flag8 = flag;
         if (flag8)
         {
             global::SteamVR_Utils.RigidTransform rigidTransform = new global::SteamVR_Utils.RigidTransform(pose);
             this.config.x = rigidTransform.pos.x;
             this.config.y = rigidTransform.pos.y;
             this.config.z = rigidTransform.pos.z;
             global::UnityEngine.Vector3 eulerAngles = rigidTransform.rot.eulerAngles;
             this.config.rx = eulerAngles.x;
             this.config.ry = eulerAngles.y;
             this.config.rz = eulerAngles.z;
         }
     }
     catch
     {
     }
 }
示例#23
0
        public static object slowSetField(object obj, string field, object @value)
        {
            if ((obj == null))
            {
                throw new global::System.NullReferenceException(global::haxe.lang.Runtime.concat(global::haxe.lang.Runtime.concat("Cannot access field \'", field), "\' of null."));
            }

            global::System.Type t = ((global::System.Type)((obj as global::System.Type)));
            global::System.Reflection.BindingFlags bf = default(global::System.Reflection.BindingFlags);
            if ((t == null))
            {
                t  = ((global::System.Type)(obj.GetType()));
                bf = ((global::System.Reflection.BindingFlags)((((global::System.Reflection.BindingFlags)((((global::System.Reflection.BindingFlags)(global::System.Reflection.BindingFlags.Instance)) | ((global::System.Reflection.BindingFlags)(global::System.Reflection.BindingFlags.Public))))) | ((global::System.Reflection.BindingFlags)(global::System.Reflection.BindingFlags.FlattenHierarchy)))));
            }
            else
            {
                obj = null;
                bf  = ((global::System.Reflection.BindingFlags)((((global::System.Reflection.BindingFlags)(global::System.Reflection.BindingFlags.Static)) | ((global::System.Reflection.BindingFlags)(global::System.Reflection.BindingFlags.Public)))));
            }

            global::System.Reflection.FieldInfo f = t.GetField(((string)(field)), ((global::System.Reflection.BindingFlags)(bf)));
            if ((f != null))
            {
                if ((f.FieldType as global::System.Reflection.MemberInfo).ToString().StartsWith("haxe.lang.Null"))
                {
                    @value = global::haxe.lang.Runtime.mkNullable(@value, f.FieldType);
                }

                if ((((@value != null) && global::System.Object.ReferenceEquals(((global::System.Type)(typeof(global::System.Double))), ((object)(@value.GetType())))) && !(global::System.Object.ReferenceEquals(((object)(t)), ((object)(f.FieldType))))))
                {
                    @value = ((global::System.IConvertible)((@value as global::System.IConvertible))).ToType(((global::System.Type)(f.FieldType)), default(global::System.IFormatProvider));
                }

                f.SetValue(((object)(obj)), ((object)(@value)));
                return(@value);
            }
            else
            {
                global::System.Reflection.PropertyInfo prop = t.GetProperty(((string)(field)), ((global::System.Reflection.BindingFlags)(bf)));
                if ((prop == null))
                {
                    if (t.IsCOMObject)
                    {
                        try {
                            return(t.InvokeMember(((string)(field)), ((global::System.Reflection.BindingFlags)(global::System.Reflection.BindingFlags.SetProperty)), default(global::System.Reflection.Binder), ((object)(obj)), ((object[])(new object[] { ((object)(@value)) }))));
                        }
                        catch (global::System.Exception e) {
                            global::haxe.lang.Exceptions.exception = e;
                        }
                    }

                    throw global::haxe.lang.HaxeException.wrap(global::haxe.lang.Runtime.concat(global::haxe.lang.Runtime.concat(global::haxe.lang.Runtime.concat("Field \'", field), "\' not found for writing from Class "), global::Std.@string(t)));
                }

                if ((prop.PropertyType as global::System.Reflection.MemberInfo).ToString().StartsWith("haxe.lang.Null"))
                {
                    @value = global::haxe.lang.Runtime.mkNullable(@value, prop.PropertyType);
                }

                if ((global::System.Object.ReferenceEquals(((global::System.Type)(typeof(global::System.Double))), ((object)(@value.GetType()))) && !(global::System.Object.ReferenceEquals(((object)(t)), ((object)(f.FieldType))))))
                {
                    @value = ((global::System.IConvertible)((@value as global::System.IConvertible))).ToType(((global::System.Type)(f.FieldType)), default(global::System.IFormatProvider));
                }

                prop.SetValue(((object)(obj)), ((object)(@value)), default(object[]));
                return(@value);
            }
        }