static StackObject *AssignFromStack_Test_0(ref object o, ILIntepreter __intp, StackObject *ptr_of_this_method, IList <object> __mStack)
 {
     ILRuntime.Runtime.Enviorment.AppDomain  __domain = __intp.AppDomain;
     ILRuntimeTest.TestFramework.TestCLREnum @Test    = (ILRuntimeTest.TestFramework.TestCLREnum) typeof(ILRuntimeTest.TestFramework.TestCLREnum).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
     ILRuntimeTest.TestFramework.TestCLREnumClass.Test = @Test;
     return(ptr_of_this_method);
 }
Пример #2
0
        static void DelegateTest18Sub(ILRuntimeTest.TestFramework.TestCLREnum e)
        {
            switch (e)
            {
            case ILRuntimeTest.TestFramework.TestCLREnum.Test1:
                Console.WriteLine("Test1");
                break;

            case ILRuntimeTest.TestFramework.TestCLREnum.Test2:
                Console.WriteLine("Test2");
                break;

            case ILRuntimeTest.TestFramework.TestCLREnum.Test3:
                Console.WriteLine("Test3");
                break;

            default:
                throw new Exception("Should not be here");
            }
        }
Пример #3
0
 public static void TestCLREnumRef(out uint key, out ILRuntimeTest.TestFramework.TestCLREnum tag)
 {
     key = 2;
     tag = ILRuntimeTest.TestFramework.TestCLREnum.Test2;
 }
        static StackObject *TestCLREnumRef_0(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            ILRuntimeTest.TestFramework.TestCLREnum @tag = (ILRuntimeTest.TestFramework.TestCLREnum)__intp.RetriveInt32(ptr_of_this_method, __mStack);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            System.UInt32 @key = (System.UInt32)__intp.RetriveInt32(ptr_of_this_method, __mStack);


            ILRuntimeTest.TestFramework.TestCLREnumClass.TestCLREnumRef(out @key, out @tag);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            switch (ptr_of_this_method->ObjectType)
            {
            case ObjectTypes.StackObjectReference:
            {
                var ___dst = ILIntepreter.ResolveReference(ptr_of_this_method);
                ___dst->ObjectType = ObjectTypes.Integer;
                ___dst->Value      = (int)@tag;
            }
            break;

            case ObjectTypes.FieldReference:
            {
                var ___obj = __mStack[ptr_of_this_method->Value];
                if (___obj is ILTypeInstance)
                {
                    ((ILTypeInstance)___obj)[ptr_of_this_method->ValueLow] = @tag;
                }
                else
                {
                    var ___type = __domain.GetType(___obj.GetType()) as CLRType;
                    ___type.SetFieldValue(ptr_of_this_method->ValueLow, ref ___obj, @tag);
                }
            }
            break;

            case ObjectTypes.StaticFieldReference:
            {
                var ___type = __domain.GetType(ptr_of_this_method->Value);
                if (___type is ILType)
                {
                    ((ILType)___type).StaticInstance[ptr_of_this_method->ValueLow] = @tag;
                }
                else
                {
                    ((CLRType)___type).SetStaticFieldValue(ptr_of_this_method->ValueLow, @tag);
                }
            }
            break;

            case ObjectTypes.ArrayReference:
            {
                var instance_of_arrayReference = __mStack[ptr_of_this_method->Value] as ILRuntimeTest.TestFramework.TestCLREnum[];
                instance_of_arrayReference[ptr_of_this_method->ValueLow] = @tag;
            }
            break;
            }

            __intp.Free(ptr_of_this_method);
            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            switch (ptr_of_this_method->ObjectType)
            {
            case ObjectTypes.StackObjectReference:
            {
                var ___dst = ILIntepreter.ResolveReference(ptr_of_this_method);
                ___dst->ObjectType = ObjectTypes.Integer;
                ___dst->Value      = (int)@key;
            }
            break;

            case ObjectTypes.FieldReference:
            {
                var ___obj = __mStack[ptr_of_this_method->Value];
                if (___obj is ILTypeInstance)
                {
                    ((ILTypeInstance)___obj)[ptr_of_this_method->ValueLow] = @key;
                }
                else
                {
                    var ___type = __domain.GetType(___obj.GetType()) as CLRType;
                    ___type.SetFieldValue(ptr_of_this_method->ValueLow, ref ___obj, @key);
                }
            }
            break;

            case ObjectTypes.StaticFieldReference:
            {
                var ___type = __domain.GetType(ptr_of_this_method->Value);
                if (___type is ILType)
                {
                    ((ILType)___type).StaticInstance[ptr_of_this_method->ValueLow] = @key;
                }
                else
                {
                    ((CLRType)___type).SetStaticFieldValue(ptr_of_this_method->ValueLow, @key);
                }
            }
            break;

            case ObjectTypes.ArrayReference:
            {
                var instance_of_arrayReference = __mStack[ptr_of_this_method->Value] as System.UInt32[];
                instance_of_arrayReference[ptr_of_this_method->ValueLow] = @key;
            }
            break;
            }

            __intp.Free(ptr_of_this_method);
            return(__ret);
        }