Beispiel #1
0
        /// <summary>
        /// Parses the custom mods.
        /// </summary>
        /// <param name="reader">The reader.</param>
        /// <returns></returns>
        public static CustomMod[] ParseCustomMods(SignatureReader reader)
        {
            List <CustomMod> mods = new List <CustomMod>();

            while (reader.Index != reader.Length)
            {
                CilElementType type = (CilElementType)reader.PeekByte();
                if (type != CilElementType.Optional && type != CilElementType.Required)
                {
                    break;
                }

                reader.SkipByte();

                Token modType = reader.ReadEncodedTypeDefOrRef();
                mods.Add(new CustomMod((CustomModType)(type - CilElementType.Required + 1), modType));
            }

            return(mods.ToArray());
        }
Beispiel #2
0
        /// <summary>
        /// Parses the class signature.
        /// </summary>
        /// <param name="reader">The reader.</param>
        /// <returns></returns>
        private static TypeSigType ParseClassSignature(SignatureReader reader)
        {
            Token token = reader.ReadEncodedTypeDefOrRef();

            return(new ClassSigType(token));
        }
Beispiel #3
0
        /// <summary>
        /// Parses the custom mods.
        /// </summary>
        /// <param name="reader">The reader.</param>
        /// <returns></returns>
        public static CustomMod[] ParseCustomMods(SignatureReader reader)
        {
            List<CustomMod> mods = new List<CustomMod>();
            while (reader.Index != reader.Length)
            {
                CilElementType type = (CilElementType)reader.PeekByte();
                if (type != CilElementType.Optional && type != CilElementType.Required)
                    break;

                reader.SkipByte();

                Token modType = reader.ReadEncodedTypeDefOrRef();
                mods.Add(new CustomMod((CustomModType)(type - CilElementType.Required + 1), modType));
            }

            return mods.ToArray();
        }
Beispiel #4
0
 /// <summary>
 /// Parses the type of the value.
 /// </summary>
 /// <param name="reader">The reader.</param>
 /// <returns></returns>
 private static TypeSigType ParseValueType(SignatureReader reader)
 {
     Token token = reader.ReadEncodedTypeDefOrRef();
     return new ValueTypeSigType(token);
 }