示例#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)))))));
     }
 }
        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);
        }
示例#4
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)));
        }
示例#5
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);
            }
        }
示例#6
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[]))));
            }
        }
示例#7
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))));
            }
        }