C# Class Spring.Objects.Factory.Config.VariableAccessor

Provides methods for type-safe accessing IVariableSources.
Afficher le fichier Open project: spring-projects/spring-net Class Usage Examples

Méthodes publiques

Méthode Description
GetBoolean ( string name, bool defaultValue ) : bool

Returns a bool that contains the value of the specified variable.

GetBoolean ( string name, bool defaultValue, bool throwOnInvalidValue ) : bool

Returns a bool that contains the value of the specified variable.

GetByte ( string name, byte defaultValue ) : byte

Returns a byte that contains the value of the specified variable.

GetByte ( string name, byte defaultValue, bool throwOnInvalidValue ) : byte

Returns a byte that contains the value of the specified variable.

GetChar ( string name, char defaultValue ) : char

Returns a char that contains the value of the specified variable.

GetChar ( string name, char defaultValue, bool throwOnInvalidValue ) : char

Returns a char that contains the value of the specified variable.

GetDateTime ( string name, string format, System.DateTime defaultValue ) : System.DateTime

Returns a DateTime that contains the value of the specified variable.

GetDateTime ( string name, string format, System.DateTime defaultValue, bool throwOnInvalidValue ) : System.DateTime

Returns a DateTime that contains the value of the specified variable.

GetDecimal ( string name, decimal defaultValue ) : decimal

Returns a decimal that contains the value of the specified variable.

GetDecimal ( string name, decimal defaultValue, bool throwOnInvalidValue ) : decimal

Returns a decimal that contains the value of the specified variable.

GetDouble ( string name, double defaultValue ) : double

Returns a double that contains the value of the specified variable.

GetDouble ( string name, double defaultValue, bool throwOnInvalidValue ) : double

Returns a double that contains the value of the specified variable.

GetEnum ( string name, Enum defaultValue ) : Enum

Returns an Enum of defaultValue's type that contains the value of the specified variable.

GetEnum ( string name, Enum defaultValue, bool throwOnInvalidValue ) : Enum

Returns an Enum of defaultValue's type that contains the value of the specified variable.

GetFloat ( string name, float defaultValue ) : float

Returns a float that contains the value of the specified variable.

GetFloat ( string name, float defaultValue, bool throwOnInvalidValue ) : float

Returns a float that contains the value of the specified variable.

GetGuid ( string name, System.Guid defaultValue ) : System.Guid

Returns a Guid that contains the value of the specified variable.

GetGuid ( string name, System.Guid defaultValue, bool throwOnInvalidValue ) : System.Guid

Returns a Guid that contains the value of the specified variable.

GetInt16 ( string name, short defaultValue ) : short

Returns a short that contains the value of the specified variable.

GetInt16 ( string name, short defaultValue, bool throwOnInvalidValue ) : short

Returns a short that contains the value of the specified variable.

GetInt32 ( string name, int defaultValue ) : int

Returns a int that contains the value of the specified variable.

GetInt32 ( string name, int defaultValue, bool throwOnInvalidValue ) : int

Returns a int that contains the value of the specified variable.

GetInt64 ( string name, long defaultValue ) : long

Returns a long that contains the value of the specified variable.

GetInt64 ( string name, long defaultValue, bool throwOnInvalidValue ) : long

Returns a long that contains the value of the specified variable.

GetString ( string name, string defaultValue ) : string

Returns a string that contains the value of the specified variable.

VariableAccessor ( IVariableSource variableSource ) : System

Initialize a new instance of an VariableAccessor

Private Methods

Méthode Description
GetUInt16 ( string name, ushort defaultValue ) : ushort
GetUInt16 ( string name, ushort defaultValue, bool throwOnInvalidValue ) : ushort
GetUInt32 ( string name, uint defaultValue ) : uint
GetUInt32 ( string name, uint defaultValue, bool throwOnInvalidValue ) : uint
GetUInt64 ( string name, ulong defaultValue ) : ulong
GetUInt64 ( string name, ulong defaultValue, bool throwOnInvalidValue ) : ulong

Method Details

GetBoolean() public méthode

Returns a bool that contains the value of the specified variable.
public GetBoolean ( string name, bool defaultValue ) : bool
name string The name of the variable to be read.
defaultValue bool The value to be returned if returns null.
Résultat bool

GetBoolean() public méthode

Returns a bool that contains the value of the specified variable.
public GetBoolean ( string name, bool defaultValue, bool throwOnInvalidValue ) : bool
name string The name of the variable to be read.
defaultValue bool The value to be returned if returns null.
throwOnInvalidValue bool /// If false, suppresses exceptions if the result /// of cannot be parsed /// and returns instead.
Résultat bool

GetByte() public méthode

Returns a byte that contains the value of the specified variable.
public GetByte ( string name, byte defaultValue ) : byte
name string The name of the variable to be read.
defaultValue byte The value to be returned if returns null.
Résultat byte

GetByte() public méthode

Returns a byte that contains the value of the specified variable.
public GetByte ( string name, byte defaultValue, bool throwOnInvalidValue ) : byte
name string The name of the variable to be read.
defaultValue byte The value to be returned if returns null.
throwOnInvalidValue bool /// If false, suppresses exceptions if the result /// of cannot be parsed /// and returns instead.
Résultat byte

GetChar() public méthode

Returns a char that contains the value of the specified variable.
public GetChar ( string name, char defaultValue ) : char
name string The name of the variable to be read.
defaultValue char The value to be returned if returns null.
Résultat char

GetChar() public méthode

Returns a char that contains the value of the specified variable.
public GetChar ( string name, char defaultValue, bool throwOnInvalidValue ) : char
name string The name of the variable to be read.
defaultValue char The value to be returned if returns null.
throwOnInvalidValue bool /// If false, suppresses exceptions if the result /// of cannot be parsed /// and returns instead.
Résultat char

GetDateTime() public méthode

Returns a DateTime that contains the value of the specified variable.
public GetDateTime ( string name, string format, System.DateTime defaultValue ) : System.DateTime
name string The name of the variable to be read.
format string The expected format of the variable's value
defaultValue System.DateTime The value to be returned if returns null.
Résultat System.DateTime

GetDateTime() public méthode

Returns a DateTime that contains the value of the specified variable.
public GetDateTime ( string name, string format, System.DateTime defaultValue, bool throwOnInvalidValue ) : System.DateTime
name string The name of the variable to be read.
format string The expected format of the variable's value
defaultValue System.DateTime The value to be returned if returns null.
throwOnInvalidValue bool /// If false, suppresses exceptions if the result /// of cannot be parsed /// and returns instead.
Résultat System.DateTime

GetDecimal() public méthode

Returns a decimal that contains the value of the specified variable.
public GetDecimal ( string name, decimal defaultValue ) : decimal
name string The name of the variable to be read.
defaultValue decimal The value to be returned if returns null.
Résultat decimal

GetDecimal() public méthode

Returns a decimal that contains the value of the specified variable.
public GetDecimal ( string name, decimal defaultValue, bool throwOnInvalidValue ) : decimal
name string The name of the variable to be read.
defaultValue decimal The value to be returned if returns null.
throwOnInvalidValue bool /// If false, suppresses exceptions if the result /// of cannot be parsed /// and returns instead.
Résultat decimal

GetDouble() public méthode

Returns a double that contains the value of the specified variable.
public GetDouble ( string name, double defaultValue ) : double
name string The name of the variable to be read.
defaultValue double The value to be returned if returns null.
Résultat double

GetDouble() public méthode

Returns a double that contains the value of the specified variable.
public GetDouble ( string name, double defaultValue, bool throwOnInvalidValue ) : double
name string The name of the variable to be read.
defaultValue double The value to be returned if returns null.
throwOnInvalidValue bool /// If false, suppresses exceptions if the result /// of cannot be parsed /// and returns instead.
Résultat double

GetEnum() public méthode

Returns an Enum of defaultValue's type that contains the value of the specified variable.
public GetEnum ( string name, Enum defaultValue ) : Enum
name string The name of the variable to be read.
defaultValue System.Enum The value to be returned if returns null.
Résultat System.Enum

GetEnum() public méthode

Returns an Enum of defaultValue's type that contains the value of the specified variable.
public GetEnum ( string name, Enum defaultValue, bool throwOnInvalidValue ) : Enum
name string The name of the variable to be read.
defaultValue System.Enum The value to be returned if returns null.
throwOnInvalidValue bool /// If false, suppresses exceptions if the result /// of cannot be parsed /// and returns instead.
Résultat System.Enum

GetFloat() public méthode

Returns a float that contains the value of the specified variable.
public GetFloat ( string name, float defaultValue ) : float
name string The name of the variable to be read.
defaultValue float The value to be returned if returns null.
Résultat float

GetFloat() public méthode

Returns a float that contains the value of the specified variable.
public GetFloat ( string name, float defaultValue, bool throwOnInvalidValue ) : float
name string The name of the variable to be read.
defaultValue float The value to be returned if returns null.
throwOnInvalidValue bool /// If false, suppresses exceptions if the result /// of cannot be parsed /// and returns instead.
Résultat float

GetGuid() public méthode

Returns a Guid that contains the value of the specified variable.
public GetGuid ( string name, System.Guid defaultValue ) : System.Guid
name string The name of the variable to be read.
defaultValue System.Guid The value to be returned if returns null.
Résultat System.Guid

GetGuid() public méthode

Returns a Guid that contains the value of the specified variable.
public GetGuid ( string name, System.Guid defaultValue, bool throwOnInvalidValue ) : System.Guid
name string The name of the variable to be read.
defaultValue System.Guid The value to be returned if returns null.
throwOnInvalidValue bool /// If false, suppresses exceptions if the result /// of cannot be parsed /// and returns instead.
Résultat System.Guid

GetInt16() public méthode

Returns a short that contains the value of the specified variable.
public GetInt16 ( string name, short defaultValue ) : short
name string The name of the variable to be read.
defaultValue short The value to be returned if returns null.
Résultat short

GetInt16() public méthode

Returns a short that contains the value of the specified variable.
public GetInt16 ( string name, short defaultValue, bool throwOnInvalidValue ) : short
name string The name of the variable to be read.
defaultValue short The value to be returned if returns null.
throwOnInvalidValue bool /// If false, suppresses exceptions if the result /// of cannot be parsed /// and returns instead.
Résultat short

GetInt32() public méthode

Returns a int that contains the value of the specified variable.
public GetInt32 ( string name, int defaultValue ) : int
name string The name of the variable to be read.
defaultValue int The value to be returned if returns null.
Résultat int

GetInt32() public méthode

Returns a int that contains the value of the specified variable.
public GetInt32 ( string name, int defaultValue, bool throwOnInvalidValue ) : int
name string The name of the variable to be read.
defaultValue int The value to be returned if returns null.
throwOnInvalidValue bool /// If false, suppresses exceptions if the result /// of cannot be parsed /// and returns instead.
Résultat int

GetInt64() public méthode

Returns a long that contains the value of the specified variable.
public GetInt64 ( string name, long defaultValue ) : long
name string The name of the variable to be read.
defaultValue long The value to be returned if returns null.
Résultat long

GetInt64() public méthode

Returns a long that contains the value of the specified variable.
public GetInt64 ( string name, long defaultValue, bool throwOnInvalidValue ) : long
name string The name of the variable to be read.
defaultValue long The value to be returned if returns null.
throwOnInvalidValue bool /// If false, suppresses exceptions if the result /// of cannot be parsed /// and returns instead.
Résultat long

GetString() public méthode

Returns a string that contains the value of the specified variable.
public GetString ( string name, string defaultValue ) : string
name string The name of the variable to be read.
defaultValue string The value to be returned if returns or .
Résultat string

VariableAccessor() public méthode

Initialize a new instance of an VariableAccessor
public VariableAccessor ( IVariableSource variableSource ) : System
variableSource IVariableSource The underlying to read values from.
Résultat System