Util

Provides utility functions for the framework.

Namespace:
Inetdev
Type:
Class
Public:
Yes
Protected:
No
Sealed:
Yes
Abstract:
Yes
Inherits from:
System.Object

Methods

CopyStream

Copy the source stream into the target stream.

Signature:
public Void CopyStream(source, target)
Parameters
Name Type Summary
source Stream Source stream to copy from.
target Stream Target stream to copy to.

DateTimeToJavascriptTimespan

Converts a DateTime into a Javascript timespan.

Signature:
public Double DateTimeToJavascriptTimespan(datetime)
Returns

A Javascript timespan.

Parameters
Name Type Summary
datetime DateTime A DateTime to convert.

DateTimeToUnixTimespan

Converts a DateTime into a Unix timespan.

Signature:
public Double DateTimeToUnixTimespan(datetime)
Returns

A Unix timespan.

Parameters
Name Type Summary
datetime DateTime A DateTime to convert.

GetFQDN

Gets the full qualified domain name of the machine.

Signature:
public String GetFQDN()

GetType

Returns the Type for the specified full qualified type name.

Signature:
public Type GetType(fullQualifiedTypeName)
Returns

A Type corresponding to the received argument.

Remarks

This method uses reflection to load the type assembly for getting it's type.

Parameters
Name Type Summary
fullQualifiedTypeName String Full qualified type name string.
Exceptions
Type Summary
FrameworkException Thrown when the type could not be retrived.

JavascriptTimespanToDateTime

Converts a Javascript timespan to a DateTime.

Signature:
public DateTime JavascriptTimespanToDateTime(timespan)
Returns

A DateTime for the timespan.

Parameters
Name Type Summary
timespan Double A Javascript timespan.

ToBoolean

Convert into boolean a string boolean representation.

Signature:
public Boolean ToBoolean(boolean)
Returns

A boolean for the received string.

Remarks

This method accounts for empty or null, false, f or 0 as false everything else is true.

Parameters
Name Type Summary
boolean String String to convert to Boolean.

TryGetType

Tries to get the specified Type.

Signature:
public Type TryGetType(fullQualifiedTypeName)
Returns

A Type corresponding to the received argument or null if the type could not be loaded.

Remarks

This method uses reflection to load the type assembly for getting it's type.

Parameters
Name Type Summary
fullQualifiedTypeName String Full qualified type name string.

TryGetType

Try to get the type specified on fullQualifiedTypeName only if it is assignable from type .

Signature:
public Type TryGetType<T>(fullQualifiedTypeName)
Returns

A Type for the specified fullQualifiedTypeName.

Parameters
Name Type Summary
fullQualifiedTypeName String Full qualified type name.

TryGetTypeAndAssemblyNames

Parses a full qualified type name and assign the values of the type and assembly names to the specified variables.

Signature:
public Boolean TryGetTypeAndAssemblyNames(fullQualifiedTypeName, typeName, assemblyName)
Returns

true if the name could be parsed correctly, otherwise false.

Parameters
Name Type Summary
fullQualifiedTypeName String Full qualified type name.
typeName String@ Type name extracted from fullQualifiedTypeName.
assemblyName String@ Assembly name extracted from fullQualifiedTypeName.

UnixTimespanToDateTime

Converts the unix timespan to a DateTime.

Signature:
public DateTime UnixTimespanToDateTime(timespan)
Returns

A DateTime for the received timespan.

Parameters
Name Type Summary
timespan Double A Unix timespan.