C# Class PRI.ProductivityExtensions.ReflectionExtensions.Typeable

Afficher le fichier Open project: peteraritchie/ProductivityExtensions

Méthodes publiques

Méthode Description
GetDefaultValue ( this typeToCreateValueFor, bool safeDefaults ) : object

Gets the default value for the type, e.g. 0 for int, empty guid for guid.

GetFullTypeName ( this type ) : string

Gets the full type name, of the format: Type.Fullname, assembly name. If the assembly is signed, the full assembly name is added, otherwise just the assembly name, not the version, public key token or culture.

Use this method if you need to store the type's full name in a string for re-instantiation later on with Activator.CreateInstance.

IsNetSystemType ( this type ) : bool

Determines whether the type specified is a system type of .NET. System types are types in mscorlib, assemblies which start with 'Microsoft.', 'System.' or the System assembly itself.

IsNullableValueType ( this toCheck ) : bool

Determines whether the type this method is called on is a nullable type of type Nullable(Of T)

Method Details

GetDefaultValue() public static méthode

Gets the default value for the type, e.g. 0 for int, empty guid for guid.
public static GetDefaultValue ( this typeToCreateValueFor, bool safeDefaults ) : object
typeToCreateValueFor this The type to create value for.
safeDefaults bool if set to true, the routine will return string.Empty for string and empty byte array for byte[], otherwise null
Résultat object

GetFullTypeName() public static méthode

Gets the full type name, of the format: Type.Fullname, assembly name. If the assembly is signed, the full assembly name is added, otherwise just the assembly name, not the version, public key token or culture.
Use this method if you need to store the type's full name in a string for re-instantiation later on with Activator.CreateInstance.
public static GetFullTypeName ( this type ) : string
type this The type of which the full name should be obtained.
Résultat string

IsNetSystemType() public static méthode

Determines whether the type specified is a system type of .NET. System types are types in mscorlib, assemblies which start with 'Microsoft.', 'System.' or the System assembly itself.
public static IsNetSystemType ( this type ) : bool
type this The type.
Résultat bool

IsNullableValueType() public static méthode

Determines whether the type this method is called on is a nullable type of type Nullable(Of T)
public static IsNullableValueType ( this toCheck ) : bool
toCheck this The type to check.
Résultat bool