コード例 #1
0
        // Token: 0x0600022F RID: 559 RVA: 0x0001F3A4 File Offset: 0x0001D5A4
        private MethodSig ResolveGenericArgs(MethodSig sig)
        {
            if (sig == null)
            {
                return(null);
            }
            if (!this.recursionCounter.Increment())
            {
                return(null);
            }
            MethodSig result = this.ResolveGenericArgs(new MethodSig(sig.GetCallingConvention()), sig);

            this.recursionCounter.Decrement();
            return(result);
        }
コード例 #2
0
        void Write(BinaryWriter writer, MethodSig sig)
        {
            writer.Write((byte)ObjectType.MethodSig);
            writer.Write((byte)(sig == null ? 0 : sig.GetCallingConvention()));
            Write(writer, sig.GetRetType());
            foreach (var p in sig.GetParams())
            {
                Write(writer, p);
            }
            writer.Write(sig.GetParamCount());
            bool hasParamsAfterSentinel = sig.GetParamsAfterSentinel() != null;

            writer.Write(hasParamsAfterSentinel);
            if (hasParamsAfterSentinel)
            {
                foreach (var p in sig.GetParamsAfterSentinel())
                {
                    Write(writer, p);
                }
            }
        }
コード例 #3
0
        void Hash(MethodSig sig)
        {
            if (sig == null)
            {
                return;
            }

            hasher.Hash((byte)sig.GetCallingConvention());
            Hash(sig.GetRetType());
            foreach (var p in sig.GetParams())
            {
                Hash(p);
            }
            hasher.Hash(sig.GetParamCount());
            if (sig.GetParamsAfterSentinel() != null)
            {
                foreach (var p in sig.GetParamsAfterSentinel())
                {
                    Hash(p);
                }
            }
        }
コード例 #4
0
        MethodSig create(MethodSig sig)
        {
            if (sig == null)
            {
                return(sig);
            }
            var newSig = new MethodSig(sig.GetCallingConvention());

            newSig.RetType = create2(sig.RetType);
            for (int i = 0; i < sig.Params.Count; i++)
            {
                newSig.Params.Add(create2(sig.Params[i]));
            }
            newSig.GenParamCount = sig.GenParamCount;
            if (sig.ParamsAfterSentinel != null)
            {
                newSig.ParamsAfterSentinel = new List <TypeSig>();
                for (int i = 0; i < sig.ParamsAfterSentinel.Count; i++)
                {
                    newSig.ParamsAfterSentinel.Add(create2(sig.ParamsAfterSentinel[i]));
                }
            }
            return(updated ? newSig : sig);
        }