/// <summary>
		/// Parses a Reflection type name and creates a <see cref="TypeSig"/>
		/// </summary>
		/// <param name="ownerModule">Module that will own the returned <see cref="TypeSig"/> or <c>null</c></param>
		/// <param name="typeFullName">Full name of type</param>
		/// <param name="typeNameParserHelper">Helper class</param>
		/// <returns>A new <see cref="TypeSig"/> instance or <c>null</c> if parsing failed</returns>
		public static TypeSig ParseAsTypeSigReflection(ModuleDef ownerModule, string typeFullName, IAssemblyRefFinder typeNameParserHelper) {
			try {
				return ParseAsTypeSigReflectionThrow(ownerModule, typeFullName, typeNameParserHelper);
			}
			catch (TypeNameParserException) {
				return null;
			}
		}
		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="ownerModule">Module that will own the returned <see cref="IType"/> or <c>null</c></param>
		/// <param name="typeFullName">Full name of type</param>
		/// <param name="typeNameParserHelper">Helper class</param>
		protected TypeNameParser(ModuleDef ownerModule, string typeFullName, IAssemblyRefFinder typeNameParserHelper) {
			this.ownerModule = ownerModule;
			this.reader = new StringReader(typeFullName ?? string.Empty);
			this.typeNameParserHelper = typeNameParserHelper;
		}
Ejemplo n.º 3
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="ownerModule">Module that will own the returned <see cref="IType"/> or <c>null</c></param>
 /// <param name="typeFullName">Full name of type</param>
 /// <param name="typeNameParserHelper">Helper class</param>
 protected TypeNameParser(ModuleDef ownerModule, string typeFullName, IAssemblyRefFinder typeNameParserHelper)
     : this(ownerModule, typeFullName, typeNameParserHelper, new GenericParamContext())
 {
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="ownerModule">Module that will own the returned <see cref="IType"/> or <c>null</c></param>
 /// <param name="typeFullName">Full name of type</param>
 /// <param name="typeNameParserHelper">Helper class</param>
 /// <param name="gpContext">Generic parameter context</param>/// 
 protected TypeNameParser(ModuleDef ownerModule, string typeFullName, IAssemblyRefFinder typeNameParserHelper, GenericParamContext gpContext)
 {
     this.ownerModule = ownerModule;
     this.reader = new StringReader(typeFullName ?? string.Empty);
     this.typeNameParserHelper = typeNameParserHelper;
     this.gpContext = gpContext;
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Parses a Reflection type name and creates a <see cref="ITypeDefOrRef"/>
 /// </summary>
 /// <param name="ownerModule">Module that will own the returned <see cref="ITypeDefOrRef"/> or <c>null</c></param>
 /// <param name="typeFullName">Full name of type</param>
 /// <param name="typeNameParserHelper">Helper class</param>
 /// <returns>A new <see cref="ITypeDefOrRef"/> instance</returns>
 /// <exception cref="TypeNameParserException">If parsing failed</exception>
 public static ITypeDefOrRef ParseReflectionThrow(ModuleDef ownerModule, string typeFullName, IAssemblyRefFinder typeNameParserHelper)
 {
     return ParseReflectionThrow(ownerModule, typeFullName, typeNameParserHelper, new GenericParamContext());
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="ownerModule">Module that will own the returned <see cref="IType"/> or <c>null</c></param>
 /// <param name="typeFullName">Full name of type</param>
 /// <param name="typeNameParserHelper">Helper class</param>
 /// <param name="gpContext">Generic parameter context</param>
 public ReflectionTypeNameParser(ModuleDef ownerModule, string typeFullName, IAssemblyRefFinder typeNameParserHelper, GenericParamContext gpContext)
     : base(ownerModule, typeFullName, typeNameParserHelper, gpContext)
 {
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Parses a Reflection type name and creates a <see cref="TypeSig"/>
 /// </summary>
 /// <param name="ownerModule">Module that will own the returned <see cref="TypeSig"/> or <c>null</c></param>
 /// <param name="typeFullName">Full name of type</param>
 /// <param name="typeNameParserHelper">Helper class</param>
 /// <param name="gpContext">Generic parameter context</param>
 /// <returns>A new <see cref="TypeSig"/> instance</returns>
 /// <exception cref="TypeNameParserException">If parsing failed</exception>
 public static TypeSig ParseAsTypeSigReflectionThrow(ModuleDef ownerModule, string typeFullName, IAssemblyRefFinder typeNameParserHelper, GenericParamContext gpContext)
 {
     using (var parser = new ReflectionTypeNameParser(ownerModule, typeFullName, typeNameParserHelper, gpContext))
         return parser.ParseAsTypeSig();
 }
 /// <summary>
 /// Parses a Reflection type name and creates a <see cref="ITypeDefOrRef"/>
 /// </summary>
 /// <param name="ownerModule">Module that will own the returned <see cref="ITypeDefOrRef"/> or <c>null</c></param>
 /// <param name="typeFullName">Full name of type</param>
 /// <param name="typeNameParserHelper">Helper class</param>
 /// <returns>A new <see cref="ITypeDefOrRef"/> instance</returns>
 /// <exception cref="TypeNameParserException">If parsing failed</exception>
 public static ITypeDefOrRef ParseReflectionThrow(ModuleDef ownerModule, string typeFullName, IAssemblyRefFinder typeNameParserHelper) =>
 ParseReflectionThrow(ownerModule, typeFullName, typeNameParserHelper, new GenericParamContext());
Ejemplo n.º 9
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="ownerModule">Module that will own the returned <see cref="IType"/> or <c>null</c></param>
 /// <param name="typeFullName">Full name of type</param>
 /// <param name="typeNameParserHelper">Helper class</param>
 protected TypeNameParser(ModuleDef ownerModule, string typeFullName, IAssemblyRefFinder typeNameParserHelper)
     : this(ownerModule, typeFullName, typeNameParserHelper, new GenericParamContext())
 {
 }
Ejemplo n.º 10
0
 /// <summary>
 /// Parses a Reflection type name and creates a <see cref="TypeSig"/>
 /// </summary>
 /// <param name="ownerModule">Module that will own the returned <see cref="TypeSig"/> or <c>null</c></param>
 /// <param name="typeFullName">Full name of type</param>
 /// <param name="typeNameParserHelper">Helper class</param>
 /// <returns>A new <see cref="TypeSig"/> instance or <c>null</c> if parsing failed</returns>
 public static TypeSig ParseAsTypeSigReflection(ModuleDef ownerModule, string typeFullName, IAssemblyRefFinder typeNameParserHelper)
 {
     return ParseAsTypeSigReflection(ownerModule, typeFullName, typeNameParserHelper, new GenericParamContext());
 }
Ejemplo n.º 11
0
 /// <summary>
 /// Parses a Reflection type name and creates a <see cref="TypeSig"/>
 /// </summary>
 /// <param name="ownerModule">Module that will own the returned <see cref="TypeSig"/> or <c>null</c></param>
 /// <param name="typeFullName">Full name of type</param>
 /// <param name="typeNameParserHelper">Helper class</param>
 /// <param name="gpContext">Generic parameter context</param>
 /// <returns>A new <see cref="TypeSig"/> instance or <c>null</c> if parsing failed</returns>
 public static TypeSig ParseAsTypeSigReflection(ModuleDef ownerModule, string typeFullName, IAssemblyRefFinder typeNameParserHelper, GenericParamContext gpContext)
 {
     try {
         return(ParseAsTypeSigReflectionThrow(ownerModule, typeFullName, typeNameParserHelper, gpContext));
     }
     catch (TypeNameParserException) {
         return(null);
     }
 }
Ejemplo n.º 12
0
 /// <summary>
 /// Parses a Reflection type name and creates a <see cref="TypeSig"/>
 /// </summary>
 /// <param name="ownerModule">Module that will own the returned <see cref="TypeSig"/> or <c>null</c></param>
 /// <param name="typeFullName">Full name of type</param>
 /// <param name="typeNameParserHelper">Helper class</param>
 /// <returns>A new <see cref="TypeSig"/> instance or <c>null</c> if parsing failed</returns>
 public static TypeSig ParseAsTypeSigReflection(ModuleDef ownerModule, string typeFullName, IAssemblyRefFinder typeNameParserHelper) =>
 ParseAsTypeSigReflection(ownerModule, typeFullName, typeNameParserHelper, new GenericParamContext());
Ejemplo n.º 13
0
 /// <summary>
 /// Parses a Reflection type name and creates a <see cref="TypeSig"/>
 /// </summary>
 /// <param name="ownerModule">Module that will own the returned <see cref="TypeSig"/> or <c>null</c></param>
 /// <param name="typeFullName">Full name of type</param>
 /// <param name="typeNameParserHelper">Helper class</param>
 /// <param name="gpContext">Generic parameter context</param>
 /// <returns>A new <see cref="TypeSig"/> instance</returns>
 /// <exception cref="TypeNameParserException">If parsing failed</exception>
 public static TypeSig ParseAsTypeSigReflectionThrow(ModuleDef ownerModule, string typeFullName, IAssemblyRefFinder typeNameParserHelper, GenericParamContext gpContext)
 {
     using (var parser = new ReflectionTypeNameParser(ownerModule, typeFullName, typeNameParserHelper, gpContext))
         return(parser.ParseAsTypeSig());
 }
Ejemplo n.º 14
0
		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="ownerModule">Module that will own the returned <see cref="IType"/> or <c>null</c></param>
		/// <param name="typeFullName">Full name of type</param>
		/// <param name="typeNameParserHelper">Helper class</param>
		public ReflectionTypeNameParser(ModuleDef ownerModule, string typeFullName, IAssemblyRefFinder typeNameParserHelper)
			: base(ownerModule, typeFullName, typeNameParserHelper) {
		}
Ejemplo n.º 15
0
 /// <summary>
 /// Parses a Reflection type name and creates a <see cref="ITypeDefOrRef"/>
 /// </summary>
 /// <param name="ownerModule">Module that will own the returned <see cref="ITypeDefOrRef"/> or <c>null</c></param>
 /// <param name="typeFullName">Full name of type</param>
 /// <param name="typeNameParserHelper">Helper class</param>
 /// <param name="gpContext">Generic parameter context</param>
 /// <returns>A new <see cref="ITypeDefOrRef"/> instance or <c>null</c> if parsing failed</returns>
 public static ITypeDefOrRef ParseReflection(ModuleDef ownerModule, string typeFullName, IAssemblyRefFinder typeNameParserHelper, GenericParamContext gpContext)
 {
     try {
         return ParseReflectionThrow(ownerModule, typeFullName, typeNameParserHelper, gpContext);
     }
     catch (TypeNameParserException) {
         return null;
     }
 }
Ejemplo n.º 16
0
		/// <summary>
		/// Parses a Reflection type name and creates a <see cref="ITypeDefOrRef"/>
		/// </summary>
		/// <param name="ownerModule">Module that will own the returned <see cref="ITypeDefOrRef"/> or <c>null</c></param>
		/// <param name="typeFullName">Full name of type</param>
		/// <param name="typeNameParserHelper">Helper class</param>
		/// <returns>A new <see cref="ITypeDefOrRef"/> instance</returns>
		/// <exception cref="TypeNameParserException">If parsing failed</exception>
		public static ITypeDefOrRef ParseReflectionThrow(ModuleDef ownerModule, string typeFullName, IAssemblyRefFinder typeNameParserHelper) {
			using (var parser = new ReflectionTypeNameParser(ownerModule, typeFullName, typeNameParserHelper))
				return parser.Parse();
		}
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="ownerModule">Module that will own the returned <see cref="IType"/> or <c>null</c></param>
 /// <param name="typeFullName">Full name of type</param>
 /// <param name="typeNameParserHelper">Helper class</param>
 /// <param name="gpContext">Generic parameter context</param>
 public ReflectionTypeNameParser(ModuleDef ownerModule, string typeFullName, IAssemblyRefFinder typeNameParserHelper, GenericParamContext gpContext)
     : base(ownerModule, typeFullName, typeNameParserHelper, gpContext)
 {
 }