Example #1
0
 FullNameCreator(bool isReflection, IFullNameCreatorHelper helper, StringBuilder sb)
 {
     this.sb = sb ?? new StringBuilder();
     this.isReflection = isReflection;
     this.helper = helper;
     this.genericArguments = null;
     this.recursionCounter = new RecursionCounter();
 }
		/// <summary>
		/// Returns the assembly qualified full name of a <see cref="IType"/>
		/// </summary>
		/// <param name="type">The <c>IType</c></param>
		/// <param name="helper">Helps print the name</param>
		/// <returns>The assembly qualified full name</returns>
		public static string AssemblyQualifiedName(IType type, IFullNameCreatorHelper helper) {
			var td = type as TypeDef;
			if (td != null)
				return AssemblyQualifiedName(td, helper);

			var tr = type as TypeRef;
			if (tr != null)
				return AssemblyQualifiedName(tr, helper);

			var ts = type as TypeSpec;
			if (ts != null)
				return AssemblyQualifiedName(ts, helper);

			var sig = type as TypeSig;
			if (sig != null)
				return AssemblyQualifiedName(sig, helper);

			var et = type as ExportedType;
			if (et != null)
				return AssemblyQualifiedName(et, helper);

			return string.Empty;
		}
Example #3
0
 /// <summary>
 /// Returns the full name of a <see cref="ExportedType"/>
 /// </summary>
 /// <param name="exportedType">The <c>ExportedType</c></param>
 /// <param name="isReflection">Set if output should be compatible with reflection</param>
 /// <param name="helper">Helps print the name</param>
 /// <param name="sb">String builder to use or null</param>
 /// <returns>The full name</returns>
 public static StringBuilder FullNameSB(ExportedType exportedType, bool isReflection, IFullNameCreatorHelper helper, StringBuilder sb)
 {
     var fnc = new FullNameCreator(isReflection, helper, sb);
     fnc.CreateFullName(exportedType);
     return fnc.sb ?? new StringBuilder();
 }
Example #4
0
 /// <summary>
 /// Returns the full name of a <see cref="TypeSig"/>
 /// </summary>
 /// <param name="typeSig">The type sig</param>
 /// <param name="isReflection">Set if output should be compatible with reflection</param>
 /// <param name="helper">Helps print the name</param>
 /// <param name="typeGenArgs">Type generic args or <c>null</c> if none</param>
 /// <param name="methodGenArgs">Method generic args or <c>null</c> if none</param>
 /// <param name="sb">String builder to use or null</param>
 /// <returns>The full name</returns>
 public static StringBuilder FullNameSB(TypeSig typeSig, bool isReflection, IFullNameCreatorHelper helper, IList<TypeSig> typeGenArgs, IList<TypeSig> methodGenArgs, StringBuilder sb)
 {
     var fnc = new FullNameCreator(isReflection, helper, sb);
     if (typeGenArgs != null || methodGenArgs != null)
         fnc.genericArguments = new GenericArguments();
     if (typeGenArgs != null)
         fnc.genericArguments.PushTypeArgs(typeGenArgs);
     if (methodGenArgs != null)
         fnc.genericArguments.PushMethodArgs(methodGenArgs);
     fnc.CreateFullName(typeSig);
     return fnc.sb ?? new StringBuilder();
 }
Example #5
0
 /// <summary>
 /// Returns the full name of a <see cref="TypeSpec"/>
 /// </summary>
 /// <param name="typeSpec">The <c>TypeSpec</c></param>
 /// <param name="isReflection">Set if output should be compatible with reflection</param>
 /// <param name="helper">Helps print the name</param>
 /// <param name="sb">String builder to use or null</param>
 /// <returns>The full name</returns>
 public static StringBuilder FullNameSB(TypeSpec typeSpec, bool isReflection, IFullNameCreatorHelper helper, StringBuilder sb)
 {
     var fnc = new FullNameCreator(isReflection, helper, sb);
     fnc.CreateFullName(typeSpec);
     return fnc.sb ?? new StringBuilder();
 }
Example #6
0
 /// <summary>
 /// Returns the assembly qualified full name of a <see cref="TypeRef"/>
 /// </summary>
 /// <param name="typeRef">The <c>TypeRef</c></param>
 /// <param name="helper">Helps print the name</param>
 /// <param name="sb">String builder to use or null</param>
 /// <returns>The assembly qualified full name</returns>
 public static string AssemblyQualifiedName(TypeRef typeRef, IFullNameCreatorHelper helper = null, StringBuilder sb = null)
 {
     return AssemblyQualifiedNameSB(typeRef, helper, sb).ToString();
 }
		/// <summary>
		/// Returns the full name of a <see cref="ExportedType"/>
		/// </summary>
		/// <param name="exportedType">The <c>ExportedType</c></param>
		/// <param name="isReflection">Set if output should be compatible with reflection</param>
		/// <param name="helper">Helps print the name</param>
		/// <returns>The full name</returns>
		public static string FullName(ExportedType exportedType, bool isReflection, IFullNameCreatorHelper helper) {
			var fnc = new FullNameCreator(isReflection, helper);
			fnc.CreateFullName(exportedType);
			return fnc.Result;
		}
		/// <summary>
		/// Returns the assembly qualified full name of a <see cref="TypeSig"/>
		/// </summary>
		/// <param name="typeSig">The <c>TypeSig</c></param>
		/// <param name="helper">Helps print the name</param>
		/// <returns>The assembly qualified full name</returns>
		public static string AssemblyQualifiedName(TypeSig typeSig, IFullNameCreatorHelper helper) {
			var fnc = new FullNameCreator(true, helper);
			fnc.CreateAssemblyQualifiedName(typeSig);
			return fnc.Result;
		}
		/// <summary>
		/// Returns the full name of a <see cref="TypeSig"/>
		/// </summary>
		/// <param name="typeSig">The type sig</param>
		/// <param name="isReflection">Set if output should be compatible with reflection</param>
		/// <param name="helper">Helps print the name</param>
		/// <returns>The full name</returns>
		public static string FullName(TypeSig typeSig, bool isReflection, IFullNameCreatorHelper helper) {
			return FullName(typeSig, isReflection, helper, null, null);
		}
Example #10
0
 /// <summary>
 /// Returns the full name of a <see cref="TypeDef"/>
 /// </summary>
 /// <param name="typeDef">The <c>TypeDef</c></param>
 /// <param name="isReflection">Set if output should be compatible with reflection</param>
 /// <param name="helper">Helps print the name</param>
 /// <returns>The full name</returns>
 public static string FullName(TypeDef typeDef, bool isReflection, IFullNameCreatorHelper helper)
 {
     return FullNameSB(typeDef, isReflection, helper, null).ToString();
 }
Example #11
0
 /// <summary>
 /// Returns the assembly qualified full name of a <see cref="ExportedType"/>
 /// </summary>
 /// <param name="exportedType">The <c>ExportedType</c></param>
 /// <param name="helper">Helps print the name</param>
 /// <param name="sb">String builder to use or null</param>
 /// <returns>The assembly qualified full name</returns>
 public static StringBuilder AssemblyQualifiedNameSB(ExportedType exportedType, IFullNameCreatorHelper helper, StringBuilder sb)
 {
     var fnc = new FullNameCreator(true, helper, sb);
     fnc.CreateAssemblyQualifiedName(exportedType);
     return fnc.sb ?? new StringBuilder();
 }
Example #12
0
 /// <summary>
 /// Returns the assembly qualified full name of a <see cref="TypeSig"/>
 /// </summary>
 /// <param name="typeSig">The <c>TypeSig</c></param>
 /// <param name="helper">Helps print the name</param>
 /// <param name="sb">String builder to use or null</param>
 /// <returns>The assembly qualified full name</returns>
 public static StringBuilder AssemblyQualifiedNameSB(TypeSig typeSig, IFullNameCreatorHelper helper, StringBuilder sb)
 {
     var fnc = new FullNameCreator(true, helper, sb);
     fnc.CreateAssemblyQualifiedName(typeSig);
     return fnc.sb ?? new StringBuilder();
 }
Example #13
0
        /// <summary>
        /// Returns the assembly qualified full name of a <see cref="IType"/>
        /// </summary>
        /// <param name="type">The <c>IType</c></param>
        /// <param name="helper">Helps print the name</param>
        /// <param name="sb">String builder to use or null</param>
        /// <returns>The assembly qualified full name</returns>
        public static StringBuilder AssemblyQualifiedNameSB(IType type, IFullNameCreatorHelper helper, StringBuilder sb)
        {
            var td = type as TypeDef;
            if (td != null)
                return AssemblyQualifiedNameSB(td, helper, sb);

            var tr = type as TypeRef;
            if (tr != null)
                return AssemblyQualifiedNameSB(tr, helper, sb);

            var ts = type as TypeSpec;
            if (ts != null)
                return AssemblyQualifiedNameSB(ts, helper, sb);

            var sig = type as TypeSig;
            if (sig != null)
                return AssemblyQualifiedNameSB(sig, helper, sb);

            var et = type as ExportedType;
            if (et != null)
                return AssemblyQualifiedNameSB(et, helper, sb);

            return sb ?? new StringBuilder();
        }
Example #14
0
 /// <summary>
 /// Returns the assembly qualified full name of a <see cref="ExportedType"/>
 /// </summary>
 /// <param name="exportedType">The <c>ExportedType</c></param>
 /// <param name="helper">Helps print the name</param>
 /// <param name="sb">String builder to use or null</param>
 /// <returns>The assembly qualified full name</returns>
 public static string AssemblyQualifiedName(ExportedType exportedType, IFullNameCreatorHelper helper, StringBuilder sb)
 {
     return AssemblyQualifiedNameSB(exportedType, helper, sb).ToString();
 }
Example #15
0
 /// <summary>
 /// Returns the assembly qualified full name of a <see cref="TypeSig"/>
 /// </summary>
 /// <param name="typeSig">The <c>TypeSig</c></param>
 /// <param name="helper">Helps print the name</param>
 /// <param name="sb">String builder to use or null</param>
 /// <returns>The assembly qualified full name</returns>
 public static string AssemblyQualifiedName(TypeSig typeSig, IFullNameCreatorHelper helper, StringBuilder sb)
 {
     return AssemblyQualifiedNameSB(typeSig, helper, sb).ToString();
 }
Example #16
0
 /// <summary>
 /// Returns the assembly qualified full name of a <see cref="IType"/>
 /// </summary>
 /// <param name="type">The <c>IType</c></param>
 /// <param name="helper">Helps print the name</param>
 /// <returns>The assembly qualified full name</returns>
 public static string AssemblyQualifiedName(IType type, IFullNameCreatorHelper helper)
 {
     return AssemblyQualifiedNameSB(type, helper, null).ToString();
 }
		/// <summary>
		/// Returns the full name of a <see cref="TypeSpec"/>
		/// </summary>
		/// <param name="typeSpec">The <c>TypeSpec</c></param>
		/// <param name="isReflection">Set if output should be compatible with reflection</param>
		/// <param name="helper">Helps print the name</param>
		/// <returns>The full name</returns>
		public static string FullName(TypeSpec typeSpec, bool isReflection, IFullNameCreatorHelper helper) {
			var fnc = new FullNameCreator(isReflection, helper);
			fnc.CreateFullName(typeSpec);
			return fnc.Result;
		}
Example #18
0
 /// <summary>
 /// Returns the full name of a <see cref="TypeSpec"/>
 /// </summary>
 /// <param name="typeSpec">The <c>TypeSpec</c></param>
 /// <param name="isReflection">Set if output should be compatible with reflection</param>
 /// <param name="helper">Helps print the name</param>
 /// <param name="sb">String builder to use or null</param>
 /// <returns>The full name</returns>
 public static string FullName(TypeSpec typeSpec, bool isReflection, IFullNameCreatorHelper helper, StringBuilder sb)
 {
     return FullNameSB(typeSpec, isReflection, helper, sb).ToString();
 }
		/// <summary>
		/// Returns the full name of a <see cref="TypeSig"/>
		/// </summary>
		/// <param name="typeSig">The type sig</param>
		/// <param name="isReflection">Set if output should be compatible with reflection</param>
		/// <param name="helper">Helps print the name</param>
		/// <param name="typeGenArgs">Type generic args or <c>null</c> if none</param>
		/// <param name="methodGenArgs">Method generic args or <c>null</c> if none</param>
		/// <returns>The full name</returns>
		public static string FullName(TypeSig typeSig, bool isReflection, IFullNameCreatorHelper helper, IList<TypeSig> typeGenArgs, IList<TypeSig> methodGenArgs) {
			var fnc = new FullNameCreator(isReflection, helper);
			if (typeGenArgs != null || methodGenArgs != null)
				fnc.genericArguments = new GenericArguments();
			if (typeGenArgs != null)
				fnc.genericArguments.PushTypeArgs(typeGenArgs);
			if (methodGenArgs != null)
				fnc.genericArguments.PushMethodArgs(methodGenArgs);
			fnc.CreateFullName(typeSig);
			return fnc.Result;
		}
Example #20
0
 /// <summary>
 /// Returns the full name of a <see cref="TypeSig"/>
 /// </summary>
 /// <param name="typeSig">The type sig</param>
 /// <param name="isReflection">Set if output should be compatible with reflection</param>
 /// <param name="helper">Helps print the name</param>
 /// <param name="typeGenArgs">Type generic args or <c>null</c> if none</param>
 /// <param name="methodGenArgs">Method generic args or <c>null</c> if none</param>
 /// <param name="sb">String builder to use or null</param>
 /// <returns>The full name</returns>
 public static string FullName(TypeSig typeSig, bool isReflection, IFullNameCreatorHelper helper, IList<TypeSig> typeGenArgs, IList<TypeSig> methodGenArgs, StringBuilder sb)
 {
     return FullNameSB(typeSig, isReflection, helper, typeGenArgs, methodGenArgs, sb).ToString();
 }
Example #21
0
 /// <summary>
 /// Returns the full name of a <see cref="ExportedType"/>
 /// </summary>
 /// <param name="exportedType">The <c>ExportedType</c></param>
 /// <param name="isReflection">Set if output should be compatible with reflection</param>
 /// <param name="helper">Helps print the name</param>
 /// <param name="sb">String builder to use or null</param>
 /// <returns>The full name</returns>
 public static string FullName(ExportedType exportedType, bool isReflection, IFullNameCreatorHelper helper, StringBuilder sb)
 {
     return FullNameSB(exportedType, isReflection, helper, sb).ToString();
 }
Example #22
0
 /// <summary>
 /// Returns the full name of a <see cref="IType"/>
 /// </summary>
 /// <param name="type">The <c>TypeRef</c></param>
 /// <param name="isReflection">Set if output should be compatible with reflection</param>
 /// <param name="helper">Helps print the name</param>
 /// <param name="sb">String builder to use or null</param>
 /// <returns>The full name</returns>
 public static StringBuilder FullNameSB(IType type, bool isReflection, IFullNameCreatorHelper helper, StringBuilder sb)
 {
     var td = type as TypeDef;
     if (td != null)
         return FullNameSB(td, isReflection, helper, sb);
     var tr = type as TypeRef;
     if (tr != null)
         return FullNameSB(tr, isReflection, helper, sb);
     var ts = type as TypeSpec;
     if (ts != null)
         return FullNameSB(ts, isReflection, helper, sb);
     var sig = type as TypeSig;
     if (sig != null)
         return FullNameSB(sig, isReflection, helper, null, null, sb);
     var et = type as ExportedType;
     if (et != null)
         return FullNameSB(et, isReflection, helper, sb);
     return sb ?? new StringBuilder();
 }
		/// <summary>
		/// Returns the assembly qualified full name of a <see cref="ExportedType"/>
		/// </summary>
		/// <param name="exportedType">The <c>ExportedType</c></param>
		/// <param name="helper">Helps print the name</param>
		/// <returns>The assembly qualified full name</returns>
		public static string AssemblyQualifiedName(ExportedType exportedType, IFullNameCreatorHelper helper) {
			var fnc = new FullNameCreator(true, helper);
			fnc.CreateAssemblyQualifiedName(exportedType);
			return fnc.Result;
		}
Example #24
0
 /// <summary>
 /// Returns the full name of a <see cref="TypeDef"/>
 /// </summary>
 /// <param name="typeDef">The <c>TypeDef</c></param>
 /// <param name="isReflection">Set if output should be compatible with reflection</param>
 /// <param name="helper">Helps print the name</param>
 /// <param name="sb">String builder to use or null</param>
 /// <returns>The full name</returns>
 public static string FullName(TypeDef typeDef, bool isReflection, IFullNameCreatorHelper helper = null, StringBuilder sb = null)
 {
     return FullNameSB(typeDef, isReflection, helper, sb).ToString();
 }