/// <summary> /// Parses the modifier. /// </summary> /// <param name="reader">The reader.</param> private void ParseModifier(SignatureReader reader) { CilElementType value = (CilElementType)reader.PeekByte(); if (value == CilElementType.Pinned) { Modifier = value; reader.SkipByte(); } }
/// <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()); }
private void ParseModifier(SignatureReader reader) { CilElementType value = (CilElementType)reader.PeekByte(); if (value == CilElementType.Pinned) { this.modifier = value; reader.SkipByte(); } }
/// <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(); }