Example #1
0
        private static int ToInt327(global::System.IntPtr @__envp, global::net.sf.jni4net.utils.JniLocalHandle @__obj, global::net.sf.jni4net.utils.JniLocalHandle provider)
        {
            // (Lsystem/IFormatProvider;)I
            // (LSystem/IFormatProvider;)I
            global::net.sf.jni4net.jni.JNIEnv @__env = global::net.sf.jni4net.jni.JNIEnv.Wrap(@__envp);
            int @__return = default(int);

            try {
                global::System.IConvertible @__real = global::net.sf.jni4net.utils.Convertor.FullJ2C <global::System.IConvertible>(@__env, @__obj);
                @__return = ((int)(@__real.ToInt32(global::net.sf.jni4net.utils.Convertor.FullJ2C <global::System.IFormatProvider>(@__env, provider))));
            }catch (global::System.Exception __ex) { @__env.ThrowExisting(__ex); }
            return(@__return);
        }
Example #2
0
    public static global::ValueType @typeof(object v)
    {
                #line 257 "/opt/haxe/std/cs/_std/Type.hx"
        if ((v == null))
        {
                        #line 258 "/opt/haxe/std/cs/_std/Type.hx"
            return(global::ValueType.TNull);
        }

                #line 260 "/opt/haxe/std/cs/_std/Type.hx"
        global::System.Type t = (v as global::System.Type);
        if (!(global::System.Object.ReferenceEquals(((object)(t)), default(object))))
        {
                        #line 263 "/opt/haxe/std/cs/_std/Type.hx"
            return(global::ValueType.TObject);
        }

                #line 266 "/opt/haxe/std/cs/_std/Type.hx"
        t = ((global::System.Type)(v.GetType()));
        if (t.IsEnum)
        {
                        #line 268 "/opt/haxe/std/cs/_std/Type.hx"
            return(global::ValueType.TEnum(((global::System.Type)(t))));
        }

                #line 269 "/opt/haxe/std/cs/_std/Type.hx"
        if ((v is global::haxe.lang.Enum))
        {
                        #line 270 "/opt/haxe/std/cs/_std/Type.hx"
            return(global::ValueType.TEnum(((global::System.Type)(t.BaseType))));
        }

                #line 271 "/opt/haxe/std/cs/_std/Type.hx"
        if (t.IsValueType)
        {
                        #line 272 "/opt/haxe/std/cs/_std/Type.hx"
            global::System.IConvertible vc = (((object)(v)) as global::System.IConvertible);
            if ((vc != null))
            {
                                #line 274 "/opt/haxe/std/cs/_std/Type.hx"
                switch (vc.GetTypeCode())
                {
                case global::System.TypeCode.Boolean:
                {
                                                #line 276 "/opt/haxe/std/cs/_std/Type.hx"
                    return(global::ValueType.TBool);
                }


                case global::System.TypeCode.Int32:
                {
                                                #line 284 "/opt/haxe/std/cs/_std/Type.hx"
                    return(global::ValueType.TInt);
                }


                case global::System.TypeCode.Double:
                {
                                                #line 278 "/opt/haxe/std/cs/_std/Type.hx"
                    double d = vc.ToDouble(default(global::System.IFormatProvider));
                    if ((((d >= global::System.Int32.MinValue) && (d <= global::System.Int32.MaxValue)) && (d == vc.ToInt32(default(global::System.IFormatProvider)))))
                    {
                                                        #line 280 "/opt/haxe/std/cs/_std/Type.hx"
                        return(global::ValueType.TInt);
                    }
                    else
                    {
                                                        #line 282 "/opt/haxe/std/cs/_std/Type.hx"
                        return(global::ValueType.TFloat);
                    }
                }


                default:
                {
                                                #line 286 "/opt/haxe/std/cs/_std/Type.hx"
                    return(global::ValueType.TClass(((global::System.Type)(t))));
                }
                }
            }
            else
            {
                                #line 289 "/opt/haxe/std/cs/_std/Type.hx"
                return(global::ValueType.TClass(((global::System.Type)(t))));
            }
        }

                #line 293 "/opt/haxe/std/cs/_std/Type.hx"
        if ((v is global::haxe.lang.IHxObject))
        {
                        #line 294 "/opt/haxe/std/cs/_std/Type.hx"
            if ((v is global::haxe.lang.DynamicObject))
            {
                                #line 295 "/opt/haxe/std/cs/_std/Type.hx"
                return(global::ValueType.TObject);
            }

                        #line 296 "/opt/haxe/std/cs/_std/Type.hx"
            return(global::ValueType.TClass(((global::System.Type)(t))));
        }
        else if ((v is global::haxe.lang.Function))
        {
                        #line 298 "/opt/haxe/std/cs/_std/Type.hx"
            return(global::ValueType.TFunction);
        }
        else
        {
                        #line 300 "/opt/haxe/std/cs/_std/Type.hx"
            return(global::ValueType.TClass(((global::System.Type)(t))));
        }
    }
Example #3
0
    public static global::ValueType @typeof(object v)
    {
        if ((v == null))
        {
            return(global::ValueType.TNull);
        }

        global::System.Type t = ((global::System.Type)((v as global::System.Type)));
        if (!(global::haxe.lang.Runtime.typeEq(t, null)))
        {
            return(global::ValueType.TObject);
        }

        t = ((global::System.Type)(v.GetType()));
        if ((t.IsEnum || (v is global::haxe.lang.Enum)))
        {
            return(global::ValueType.TEnum(((global::System.Type)(t))));
        }

        if (t.IsValueType)
        {
            global::System.IConvertible vc = ((global::System.IConvertible)(v));
            if ((vc != null))
            {
                global::System.TypeCode _g = vc.GetTypeCode();
                switch (_g)
                {
                case global::System.TypeCode.Boolean:
                {
                    return(global::ValueType.TBool);
                }


                case global::System.TypeCode.Int32:
                {
                    return(global::ValueType.TInt);
                }


                case global::System.TypeCode.Double:
                {
                    double d = vc.ToDouble(default(global::System.IFormatProvider));
                    if ((((d >= global::System.Int32.MinValue) && (d <= global::System.Int32.MaxValue)) && (d == vc.ToInt32(default(global::System.IFormatProvider)))))
                    {
                        return(global::ValueType.TInt);
                    }
                    else
                    {
                        return(global::ValueType.TFloat);
                    }
                }


                default:
                {
                    return(global::ValueType.TClass(((global::System.Type)(t))));
                }
                }
            }
            else
            {
                return(global::ValueType.TClass(((global::System.Type)(t))));
            }
        }

        if ((v is global::haxe.lang.IHxObject))
        {
            if ((v is global::haxe.lang.DynamicObject))
            {
                return(global::ValueType.TObject);
            }
            else if ((v is global::haxe.lang.Enum))
            {
                return(global::ValueType.TEnum(((global::System.Type)(t))));
            }

            return(global::ValueType.TClass(((global::System.Type)(t))));
        }
        else if ((v is global::haxe.lang.Function))
        {
            return(global::ValueType.TFunction);
        }
        else
        {
            return(global::ValueType.TClass(((global::System.Type)(t))));
        }
    }
Example #4
0
        public static bool eq(object v1, object v2)
        {
            if (global::System.Object.ReferenceEquals(((object)(v1)), ((object)(v2))))
            {
                return(true);
            }

            if ((global::System.Object.ReferenceEquals(((object)(v1)), default(object)) || global::System.Object.ReferenceEquals(((object)(v2)), default(object))))
            {
                return(false);
            }

            global::System.IConvertible v1c = ((global::System.IConvertible)((v1 as global::System.IConvertible)));
            if ((v1c != null))
            {
                global::System.IConvertible v2c = ((global::System.IConvertible)((v2 as global::System.IConvertible)));
                if ((v2c == null))
                {
                    return(false);
                }

                global::System.TypeCode t1 = v1c.GetTypeCode();
                global::System.TypeCode t2 = v2c.GetTypeCode();
                if ((t1 == t2))
                {
                    return(global::System.Object.Equals(((object)(v1c)), ((object)(v2c))));
                }

                if (((t1 == global::System.TypeCode.String) || (t2 == global::System.TypeCode.String)))
                {
                    return(false);
                }

                switch (t1)
                {
                case global::System.TypeCode.Int64:
                {
                    switch (t2)
                    {
                    case global::System.TypeCode.Int64:
                    case global::System.TypeCode.UInt64:
                    case global::System.TypeCode.Single:
                    case global::System.TypeCode.Double:
                    case global::System.TypeCode.DateTime:
                    {
                        return(((long)(v1c.ToInt64(default(global::System.IFormatProvider)))) == ((long)(v2c.ToInt64(default(global::System.IFormatProvider)))));
                    }


                    case global::System.TypeCode.Decimal:
                    {
                        return(v1c.ToDecimal(default(global::System.IFormatProvider)).Equals(v2c.ToDecimal(default(global::System.IFormatProvider))));
                    }


                    default:
                    {
                        return(((long)(v1c.ToInt64(default(global::System.IFormatProvider)))) == ((long)(v2c.ToInt64(default(global::System.IFormatProvider)))));
                    }
                    }
                }


                case global::System.TypeCode.Single:
                case global::System.TypeCode.Double:
                {
                    switch (t2)
                    {
                    case global::System.TypeCode.Int64:
                    {
                        return(((long)(v1c.ToInt64(default(global::System.IFormatProvider)))) == ((long)(v2c.ToInt64(default(global::System.IFormatProvider)))));
                    }


                    case global::System.TypeCode.Single:
                    case global::System.TypeCode.Double:
                    {
                        return(v1c.ToDouble(default(global::System.IFormatProvider)) == v2c.ToDouble(default(global::System.IFormatProvider)));
                    }


                    case global::System.TypeCode.Decimal:
                    {
                        return(v1c.ToDecimal(default(global::System.IFormatProvider)).Equals(v2c.ToDecimal(default(global::System.IFormatProvider))));
                    }


                    case global::System.TypeCode.UInt64:
                    case global::System.TypeCode.DateTime:
                    {
                        return(v1c.ToUInt64(default(global::System.IFormatProvider)) == v2c.ToUInt64(default(global::System.IFormatProvider)));
                    }


                    default:
                    {
                        return(v1c.ToDouble(default(global::System.IFormatProvider)) == v2c.ToDouble(default(global::System.IFormatProvider)));
                    }
                    }
                }


                case global::System.TypeCode.Decimal:
                {
                    return(v1c.ToDecimal(default(global::System.IFormatProvider)).Equals(v2c.ToDecimal(default(global::System.IFormatProvider))));
                }


                case global::System.TypeCode.UInt64:
                case global::System.TypeCode.DateTime:
                {
                    switch (t2)
                    {
                    case global::System.TypeCode.Int64:
                    {
                        return(((long)(v1c.ToInt64(default(global::System.IFormatProvider)))) == ((long)(v2c.ToInt64(default(global::System.IFormatProvider)))));
                    }


                    case global::System.TypeCode.UInt64:
                    case global::System.TypeCode.Single:
                    case global::System.TypeCode.Double:
                    case global::System.TypeCode.DateTime:
                    {
                        return(v1c.ToUInt64(default(global::System.IFormatProvider)) == v2c.ToUInt64(default(global::System.IFormatProvider)));
                    }


                    case global::System.TypeCode.Decimal:
                    {
                        return(v1c.ToDecimal(default(global::System.IFormatProvider)).Equals(v2c.ToDecimal(default(global::System.IFormatProvider))));
                    }


                    default:
                    {
                        return(v1c.ToUInt64(default(global::System.IFormatProvider)) == v2c.ToUInt64(default(global::System.IFormatProvider)));
                    }
                    }
                }


                default:
                {
                    switch (t2)
                    {
                    case global::System.TypeCode.Int64:
                    {
                        return(((long)(v1c.ToInt64(default(global::System.IFormatProvider)))) == ((long)(v2c.ToInt64(default(global::System.IFormatProvider)))));
                    }


                    case global::System.TypeCode.Single:
                    case global::System.TypeCode.Double:
                    {
                        return(v1c.ToDouble(default(global::System.IFormatProvider)) == v2c.ToDouble(default(global::System.IFormatProvider)));
                    }


                    case global::System.TypeCode.Decimal:
                    {
                        return(v1c.ToDecimal(default(global::System.IFormatProvider)).Equals(v2c.ToDecimal(default(global::System.IFormatProvider))));
                    }


                    case global::System.TypeCode.UInt64:
                    case global::System.TypeCode.DateTime:
                    {
                        return(v1c.ToUInt64(default(global::System.IFormatProvider)) == v2c.ToUInt64(default(global::System.IFormatProvider)));
                    }


                    default:
                    {
                        return(v1c.ToInt32(default(global::System.IFormatProvider)) == v2c.ToInt32(default(global::System.IFormatProvider)));
                    }
                    }
                }
                }
            }

            if ((((global::System.ValueType)((v1 as global::System.ValueType))) != null))
            {
                return(v1.Equals(v2));
            }
            else
            {
                global::System.Type v1t = ((global::System.Type)((v1 as global::System.Type)));
                if ((v1t != null))
                {
                    global::System.Type v2t = ((global::System.Type)((v2 as global::System.Type)));
                    if ((v2t != null))
                    {
                        return(global::haxe.lang.Runtime.typeEq(v1t, v2t));
                    }

                    return(false);
                }
            }

            return(false);
        }