C# Class SupportClass, csharp-ldap

Contains conversion support elements such as classes, interfaces and static methods.
Datei anzeigen Open project: EventStore/csharp-ldap Class Usage Examples

Public Methods

Method Description
CreateNewInstance ( System classType ) : Object

Creates an instance of a received Type.

EqualsSupport ( System source, System target ) : bool

Determines whether two Collections instances are equals.

FormatDateTime ( System format, System date ) : string

Gets the DateTimeFormat instance and date instance to obtain the date with the format passed

GetCharsFromString ( string sourceString, int sourceStart, int sourceEnd, char &destinationArray, int destinationStart ) : void

Copies an array of chars obtained from a String into a specified array of chars

GetFileStream ( string FileName, bool Append ) : FileStream

Creates an output file stream to write to the file with the specified name.

HashtableRemove ( System hashtable, System key ) : Object

Removes the element with the specified key from a Hashtable instance.

Identity ( double literal ) : double

This method returns the literal value received

Identity ( float literal ) : float

This method returns the literal value received

Identity ( long literal ) : long

This method returns the literal value received

PutElement ( System collection, System key, System newValue ) : Object

Adds a new key-and-value pair into the hash table

ReverseStack ( System collection ) : System.Collections.IEnumerator

Reverses the Stack Collection received.

SetSize ( System arrayList, int newSize ) : void

Sets the size of the ArrayList. If the new size is greater than the current capacity, then new null items are added to the end of the ArrayList. If the new size is lower than the current size, then all elements after the new size are discarded

StackPush ( System stack, System element ) : Object

Adds an element to the top end of a Stack instance.

ToByteArray ( object tempObjectArray ) : byte[]

Converts a array of object-type instances to a byte-type array.

ToByteArray ( string sourceString ) : byte[]

Converts a string to an array of bytes

ToCharArray ( byte byteArray ) : char[]

Converts an array of bytes to an array of chars

VectorRemoveElement ( System arrayList, System element ) : System.Boolean

Removes the first occurrence of an specific object from an ArrayList instance.

WriteStackTrace ( System throwable, System stream ) : void

Writes the exception stack trace to the received stream

Private Methods

Method Description
Identity ( ulong literal ) : ulong
ReadInput ( System sourceStream, sbyte &target, int start, int count ) : Int32
ToByteArray ( sbyte sbyteArray ) : byte[]
ToCharArray ( sbyte sByteArray ) : char[]
ToSByteArray ( byte byteArray ) : sbyte[]

Method Details

CreateNewInstance() public static method

Creates an instance of a received Type.
public static CreateNewInstance ( System classType ) : Object
classType System The Type of the new class instance to return.
return System.Object

EqualsSupport() public static method

Determines whether two Collections instances are equals.
public static EqualsSupport ( System source, System target ) : bool
source System The first Collections to compare.
target System The second Collections to compare.
return bool

FormatDateTime() public static method

Gets the DateTimeFormat instance and date instance to obtain the date with the format passed
public static FormatDateTime ( System format, System date ) : string
format System The DateTimeFormat to obtain the time and date pattern
date System The date instance used to get the date
return string

GetCharsFromString() public static method

Copies an array of chars obtained from a String into a specified array of chars
public static GetCharsFromString ( string sourceString, int sourceStart, int sourceEnd, char &destinationArray, int destinationStart ) : void
sourceString string The String to get the chars from
sourceStart int Position of the String to start getting the chars
sourceEnd int Position of the String to end getting the chars
destinationArray char Array to return the chars
destinationStart int Position of the destination array of chars to start storing the chars
return void

GetFileStream() public static method

Creates an output file stream to write to the file with the specified name.
public static GetFileStream ( string FileName, bool Append ) : FileStream
FileName string Name of the file to write.
Append bool True in order to write to the end of the file, false otherwise.
return System.IO.FileStream

HashtableRemove() public static method

Removes the element with the specified key from a Hashtable instance.
public static HashtableRemove ( System hashtable, System key ) : Object
hashtable System The Hashtable instance
key System The key of the element to remove
return System.Object

Identity() public static method

This method returns the literal value received
public static Identity ( double literal ) : double
literal double The literal to return
return double

Identity() public static method

This method returns the literal value received
public static Identity ( float literal ) : float
literal float The literal to return
return float

Identity() public static method

This method returns the literal value received
public static Identity ( long literal ) : long
literal long The literal to return
return long

PutElement() public static method

Adds a new key-and-value pair into the hash table
public static PutElement ( System collection, System key, System newValue ) : Object
collection System The collection to work with
key System Key used to obtain the value
newValue System Value asociated with the key
return System.Object

ReverseStack() public static method

Reverses the Stack Collection received.
public static ReverseStack ( System collection ) : System.Collections.IEnumerator
collection System The collection to reverse.
return System.Collections.IEnumerator

SetSize() public static method

Sets the size of the ArrayList. If the new size is greater than the current capacity, then new null items are added to the end of the ArrayList. If the new size is lower than the current size, then all elements after the new size are discarded
public static SetSize ( System arrayList, int newSize ) : void
arrayList System The ArrayList to be changed
newSize int The new ArrayList size
return void

StackPush() public static method

Adds an element to the top end of a Stack instance.
public static StackPush ( System stack, System element ) : Object
stack System The Stack instance
element System The element to add
return System.Object

ToByteArray() public static method

Converts a array of object-type instances to a byte-type array.
public static ToByteArray ( object tempObjectArray ) : byte[]
tempObjectArray object Array to convert.
return byte[]

ToByteArray() public static method

Converts a string to an array of bytes
public static ToByteArray ( string sourceString ) : byte[]
sourceString string The string to be converted
return byte[]

ToCharArray() public static method

Converts an array of bytes to an array of chars
public static ToCharArray ( byte byteArray ) : char[]
byteArray byte The array of bytes to convert
return char[]

VectorRemoveElement() public static method

Removes the first occurrence of an specific object from an ArrayList instance.
public static VectorRemoveElement ( System arrayList, System element ) : System.Boolean
arrayList System The ArrayList instance
element System The element to remove
return System.Boolean

WriteStackTrace() public static method

Writes the exception stack trace to the received stream
public static WriteStackTrace ( System throwable, System stream ) : void
throwable System Exception to obtain information from
stream System Output sream used to write to
return void