コード例 #1
0
            public Base_IEnumerator(CLRSharp_Instance inst)
            {
                ThreadContext activeContext = ThreadContext.activeContext;

                this.inst = inst;
                string[] methodNames = this.inst.type.GetMethodNames();
                string[] array       = methodNames;
                for (int i = 0; i < array.Length; i++)
                {
                    string text = array[i];
                    bool   flag = text.Contains("MoveNext");
                    if (flag)
                    {
                        this._MoveNext = this.inst.type.GetMethod(text, MethodParamList.constEmpty());
                    }
                    bool flag2 = text.Contains(".get_Current");
                    if (flag2)
                    {
                        this._get_Current = this.inst.type.GetMethod(text, MethodParamList.constEmpty());
                    }
                    bool flag3 = text.Contains(".Reset");
                    if (flag3)
                    {
                        this._Reset = this.inst.type.GetMethod(text, MethodParamList.constEmpty());
                    }
                }
            }
コード例 #2
0
ファイル: Yield.cs プロジェクト: pikaqiufk/Client
            public Base_IEnumerator(CLRSharp_Instance inst)
            {
                var context = ThreadContext.activeContext;

                this.inst = inst;
                var ms = this.inst.type.GetMethodNames();
                {
                    var __array1       = ms;
                    var __arrayLength1 = __array1.Length;
                    for (int __i1 = 0; __i1 < __arrayLength1; ++__i1)
                    {
                        var name = (string)__array1[__i1];
                        {
                            if (name.Contains("MoveNext"))
                            {
                                _MoveNext = this.inst.type.GetMethod(name, MethodParamList.constEmpty());
                            }
                            if (name.Contains(".get_Current"))
                            {
                                _get_Current = this.inst.type.GetMethod(name, MethodParamList.constEmpty());
                            }
                            if (name.Contains(".Reset"))
                            {
                                _Reset = this.inst.type.GetMethod(name, MethodParamList.constEmpty());
                            }
                        }
                    }
                }
            }
コード例 #3
0
ファイル: Yield.cs プロジェクト: pikaqiufk/Client
 public void Dispose()
 {
     var    context = ThreadContext.activeContext;
     var    _type   = context.environment.GetType(typeof(IDisposable));
     var    _method = this.inst.type.GetMethod("Dispose", MethodParamList.constEmpty());
     object obj     = _method.Invoke(context, inst, null);
 }
コード例 #4
0
ファイル: Yield.cs プロジェクト: zhangf911/LSharp
            public Base_IEnumerator(CLRSharp_Instance inst)
            {
                var context = ThreadContext.activeContext;

                this.inst = inst;
                var ms = this.inst.type.GetMethodNames();

                foreach (string name in ms)
                {
                    if (name.Contains("MoveNext"))
                    {
                        _MoveNext = this.inst.type.GetMethod(name, MethodParamList.constEmpty());
                    }
                    if (name.Contains(".get_Current"))
                    {
                        _get_Current = this.inst.type.GetMethod(name, MethodParamList.constEmpty());
                    }
                    if (name.Contains(".Reset"))
                    {
                        _Reset = this.inst.type.GetMethod(name, MethodParamList.constEmpty());
                    }
                }
            }
コード例 #5
0
            public IEnumerator GetEnumerator()
            {
                ThreadContext activeContext = ThreadContext.activeContext;
                ICLRType      type          = activeContext.environment.GetType(typeof(IEnumerable));
                IMethod       method        = this.inst.type.GetMethod(type.FullName + ".GetEnumerator", MethodParamList.constEmpty());
                object        obj           = method.Invoke(activeContext, this.inst, null);

                return(obj as IEnumerator);
            }
コード例 #6
0
ファイル: Yield.cs プロジェクト: zhangf911/LSharp
            public IEnumerator GetEnumerator()
            {
                var    context = ThreadContext.activeContext;
                var    _type   = context.environment.GetType(typeof(IEnumerable));
                var    _method = this.inst.type.GetMethod(_type.FullName + "." + "GetEnumerator", MethodParamList.constEmpty());
                object obj     = _method.Invoke(context, inst, null);

                return(obj as IEnumerator);
            }
コード例 #7
0
ファイル: Yield.cs プロジェクト: adan830/Egametang
            public IEnumerator GetEnumerator()
            {
                var context = ThreadContext.activeContext;
                var _type   = context.environment.GetType(typeof(IEnumerable));
                var _method = this.inst.type.GetMethod(_type.FullName + "." + "GetEnumerator", MethodParamList.constEmpty());
                var obj     = _method.Invoke(context, inst, null) as CLRSharp_Instance;

                return(context.environment.GetCrossBind(typeof(IEnumerator)).CreateBind(obj) as IEnumerator);
            }
コード例 #8
0
 public void Dispose()
 {
     ThreadContext activeContext = ThreadContext.activeContext;
     ICLRType      type          = activeContext.environment.GetType(typeof(IDisposable));
     IMethod       method        = this.inst.type.GetMethod(type.FullName + ".Dispose", MethodParamList.constEmpty());
     object        obj           = method.Invoke(activeContext, this.inst, null);
 }