C# Class Amanda.Extensions

A collection of extensions methods used in the BuisnesLogic namespace
ファイルを表示 Open project: MichaelAz/Amanda

Public Methods

Method Description
AsString ( this s ) : string

An abstraction over reading a string from a stream

AsString ( this s, Encoding encoding ) : string

An abstraction over reading a string from a stream

AsString ( this s, Encoding encoding, bool detectEncodingFromByteOrderMarks ) : string

An abstraction over reading a string from a stream

AsString ( this s, Encoding encoding, bool detectEncodingFromByteOrderMarks, int bufferSize ) : string

An abstraction over reading a string from a stream

AsString ( this s, bool detectEncodingFromByteOrderMarks ) : string

An abstraction over reading a string from a stream

Default ( this t ) : dynamic

Returns the default value for a type, much like the default keyword

Deserialize ( this jss, string s, Type t ) : object

An extension method that allows the Nancy JavaScriptSerializer to generically deserialize JSON to a type given at runtime

IsBasic ( this t ) : bool

Checks whether a type is a "basic" type as per the C# specification or a nullable version thereof

Method Details

AsString() public static method

An abstraction over reading a string from a stream
public static AsString ( this s ) : string
s this The stream to read from
return string

AsString() public static method

An abstraction over reading a string from a stream
public static AsString ( this s, Encoding encoding ) : string
s this The stream to read from
encoding System.Text.Encoding The encoding used to read the string
return string

AsString() public static method

An abstraction over reading a string from a stream
public static AsString ( this s, Encoding encoding, bool detectEncodingFromByteOrderMarks ) : string
s this The stream to read from
encoding System.Text.Encoding The encoding used to read the string
detectEncodingFromByteOrderMarks bool A boolean indicating whether the /// metod should attempt to detect the encoding from the byte order marks
return string

AsString() public static method

An abstraction over reading a string from a stream
public static AsString ( this s, Encoding encoding, bool detectEncodingFromByteOrderMarks, int bufferSize ) : string
s this The stream to read from
encoding System.Text.Encoding The encoding used to read the string
detectEncodingFromByteOrderMarks bool A boolean indicating whether the /// metod should attempt to detect the encoding from the byte order marks
bufferSize int The size of the buffer used in reading the string
return string

AsString() public static method

An abstraction over reading a string from a stream
public static AsString ( this s, bool detectEncodingFromByteOrderMarks ) : string
s this The stream to read from
detectEncodingFromByteOrderMarks bool A boolean indicating whether the /// metod should attempt to detect the encoding from the byte order marks
return string

Default() public static method

Returns the default value for a type, much like the default keyword
public static Default ( this t ) : dynamic
t this The type to get a default value for
return dynamic

Deserialize() public static method

An extension method that allows the Nancy JavaScriptSerializer to generically deserialize JSON to a type given at runtime
public static Deserialize ( this jss, string s, Type t ) : object
jss this The JavaScriptSerializer which preforms the conversion
s string The JSON string to deserialize
t System.Type The type to deserialzie to
return object

IsBasic() public static method

Checks whether a type is a "basic" type as per the C# specification or a nullable version thereof
public static IsBasic ( this t ) : bool
t this The type to check
return bool