C# 클래스 NetFx.StringlyTyped.Stringly

Utilities for rendering .NET types as C# type names, with support for generics, nested types, type name simplification via "using" scopes, etc.
파일 보기 프로젝트 열기: netfx/extensions 1 사용 예제들

공개 메소드들

메소드 설명
BeginScope ( ) : IStringlyScope

Creates a new stringly scope, which can be used to register types that will be used as strings, so that safe code imports can be determined and type names can be shortened to the safest form.

The scope takes into account all type names in use, and determines what namespaces can be safely removed from certain type names without introducing ambiguities.

ToTypeFullName ( this type ) : string

Gets the C# name for the type, including proper rendering of generics, using full names of types.

For example, for a generic enumerable of boolean, which has a full name of System.Collections.Generic.IEnumerable`1[[System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], this method returns System.Collections.Generic.IEnumerable<System.Boolean>.

ToTypeName ( this type ) : string

Gets the C# name for the type, including proper rendering of generics, using the simple name of types.

For example, for a generic enumerable of boolean, which has a full name of System.Collections.Generic.IEnumerable`1[[System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], this method returns IEnumerable<Boolean>.

비공개 메소드들

메소드 설명
GetTypeFullName ( Type type ) : string
ToTypeFullName ( this type, Queue genericArguments ) : string
ToTypeName ( this type, Queue genericArguments ) : string

메소드 상세

BeginScope() 공개 정적인 메소드

Creates a new stringly scope, which can be used to register types that will be used as strings, so that safe code imports can be determined and type names can be shortened to the safest form.
The scope takes into account all type names in use, and determines what namespaces can be safely removed from certain type names without introducing ambiguities.
public static BeginScope ( ) : IStringlyScope
리턴 IStringlyScope

ToTypeFullName() 공개 정적인 메소드

Gets the C# name for the type, including proper rendering of generics, using full names of types.
For example, for a generic enumerable of boolean, which has a full name of System.Collections.Generic.IEnumerable`1[[System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], this method returns System.Collections.Generic.IEnumerable<System.Boolean>.
public static ToTypeFullName ( this type ) : string
type this The type to convert to a C# full type name.
리턴 string

ToTypeName() 공개 정적인 메소드

Gets the C# name for the type, including proper rendering of generics, using the simple name of types.
For example, for a generic enumerable of boolean, which has a full name of System.Collections.Generic.IEnumerable`1[[System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], this method returns IEnumerable<Boolean>.
public static ToTypeName ( this type ) : string
type this The type to convert to a simple C# type name.
리턴 string