/// <summary> /// Adds the given types to the scope of used types. /// </summary> public static void AddTypes(this IStringlyScope scope, IEnumerable <Type> types) { foreach (var type in types) { scope.AddType(type); } }
/// <summary> /// Adds all the exported (public) types in the given assembly to the scope of used types. /// </summary> public static void AddTypes(this IStringlyScope scope, Assembly assembly) { foreach (var type in assembly.GetExportedTypes()) { scope.AddType(type); } }
/// <summary> /// Gets the safe shortened name of a type that can be used in a given context, /// considering the already determined <see cref="IStringlyScope.SafeImports"/>, /// such as in code generation. /// </summary> public static string GetTypeName(this IStringlyScope scope, Type type) { return(scope.GetTypeName(SafeGenericTypeName(type))); }
/// <summary> /// Adds the given type to the scope of used types. /// </summary> public static void AddType(this IStringlyScope scope, Type type) { scope.AddType(SafeGenericTypeName(type)); }