C# Class NetFx.StringlyTyped.StringlyScopeExtensions

Datei anzeigen Open project: netfx/extensions

Public Methods

Method Description
AddType ( this scope, Type type ) : void

Adds the given type to the scope of used types.

AddTypes ( this scope, Assembly assembly ) : void

Adds all the exported (public) types in the given assembly to the scope of used types.

AddTypes ( this scope, IEnumerable types ) : void

Adds the given types to the scope of used types.

GetTypeName ( this scope, Type type ) : string

Gets the safe shortened name of a type that can be used in a given context, considering the already determined IStringlyScope.SafeImports, such as in code generation.

Private Methods

Method Description
SafeGenericTypeName ( Type type ) : string

If the type is a generic type, renders all the T's with the generic type definition name. Otherwise, returns just the type full name.

Method Details

AddType() public static method

Adds the given type to the scope of used types.
public static AddType ( this scope, Type type ) : void
scope this
type System.Type
return void

AddTypes() public static method

Adds all the exported (public) types in the given assembly to the scope of used types.
public static AddTypes ( this scope, Assembly assembly ) : void
scope this
assembly System.Reflection.Assembly
return void

AddTypes() public static method

Adds the given types to the scope of used types.
public static AddTypes ( this scope, IEnumerable types ) : void
scope this
types IEnumerable
return void

GetTypeName() public static method

Gets the safe shortened name of a type that can be used in a given context, considering the already determined IStringlyScope.SafeImports, such as in code generation.
public static GetTypeName ( this scope, Type type ) : string
scope this
type System.Type
return string