Class ObjectExtensions
Inheritance
System.Object
ObjectExtensions
Assembly: ISynergy.Framework.Core.dll
Syntax
public static class ObjectExtensions : object
Methods
View Source
AddressOf<T>(T)
Retrieves the memory address of a generic value type.
Declaration
public static IntPtr AddressOf<T>(this T t)
Parameters
| Type |
Name |
Description |
| T |
t |
The object those address needs to be retrieved.
|
Returns
| Type |
Description |
| System.IntPtr |
|
Type Parameters
| Name |
Description |
| T |
The type of the object whose address needs to be retrieved.
|
View Source
Clone<T>(T)
Perform a deep Copy of the object.
Declaration
public static T Clone<T>(this T source)
Parameters
| Type |
Name |
Description |
| T |
source |
The object instance to copy.
|
Returns
| Type |
Description |
| T |
The copied object.
|
Type Parameters
| Name |
Description |
| T |
The type of object being copied.
|
View Source
HasMethod(Object, String)
Checks whether an object implements a method with the given name.
Declaration
public static bool HasMethod(this object obj, string methodName)
Parameters
| Type |
Name |
Description |
| System.Object |
obj |
|
| System.String |
methodName |
|
Returns
| Type |
Description |
| System.Boolean |
|
View Source
IsGreaterThan<T>(T, Object)
Determines whether a > b.
Declaration
public static bool IsGreaterThan<T>(this T a, object b)
where T : IComparable
Parameters
| Type |
Name |
Description |
| T |
a |
|
| System.Object |
b |
|
Returns
| Type |
Description |
| System.Boolean |
|
Type Parameters
View Source
IsGreaterThanOrEqual<T>(T, Object)
Determines whether a >= b.
Declaration
public static bool IsGreaterThanOrEqual<T>(this T a, object b)
where T : IComparable
Parameters
| Type |
Name |
Description |
| T |
a |
|
| System.Object |
b |
|
Returns
| Type |
Description |
| System.Boolean |
|
Type Parameters
View Source
IsLessThan<T>(T, Object)
Determines whether a < b.
Declaration
public static bool IsLessThan<T>(this T a, object b)
where T : IComparable
Parameters
| Type |
Name |
Description |
| T |
a |
|
| System.Object |
b |
|
Returns
| Type |
Description |
| System.Boolean |
|
Type Parameters
View Source
IsLessThanOrEqual<T>(T, Object)
Determines whether a <= b.
Declaration
public static bool IsLessThanOrEqual<T>(this T a, object b)
where T : IComparable
Parameters
| Type |
Name |
Description |
| T |
a |
|
| System.Object |
b |
|
Returns
| Type |
Description |
| System.Boolean |
|
Type Parameters
View Source
IsNullableType<T>(T)
Checks if object is of a nullable type.
Declaration
public static bool IsNullableType<T>(this T self)
where T : Type
Parameters
| Type |
Name |
Description |
| T |
self |
The self.
|
Returns
| Type |
Description |
| System.Boolean |
true if [is nullable type] [the specified self]; otherwise, false.
|
Type Parameters
View Source
To(Object, Type)
Converts an object into another type, irrespective of whether
the conversion can be done at compile time or not. This can be
used to convert generic types to numeric types during runtime.
Declaration
public static object To(this object value, Type type)
Parameters
| Type |
Name |
Description |
| System.Object |
value |
The value to be converted.
|
| Type |
type |
The type that the value should be converted to.
|
Returns
| Type |
Description |
| System.Object |
The result of the conversion.
|
View Source
To<T>(Object)
Converts an object into another type, irrespective of whether
the conversion can be done at compile time or not. This can be
used to convert generic types to numeric types during runtime.
Declaration
public static T To<T>(this object value)
Parameters
| Type |
Name |
Description |
| System.Object |
value |
The value to be converted.
|
Returns
| Type |
Description |
| T |
The result of the conversion.
|
Type Parameters
| Name |
Description |
| T |
The destination type.
|
View Source
ToByteArray<T>(T)
Serializes (converts) a structure to a byte array.
Declaration
public static byte[] ToByteArray<T>(this T value)
where T : struct
Parameters
| Type |
Name |
Description |
| T |
value |
The structure to be serialized.
|
Returns
| Type |
Description |
| System.Byte[] |
The byte array containing the serialized structure.
|
Type Parameters