Class SerializableObjectCloneExtension
Reference Article http://www.codeproject.com/KB/tips/SerializedObjectCloner.aspx Provides a method for performing a deep copy of an object. Binary Serialization is used to perform the copy.
Namespace: Sartorius.SAF.Extensions
Assembly: Sartorius.SAF.dll
Syntax
public static class SerializableObjectCloneExtension
Methods
View SourceCloneArray<T>(T[])
Clones the array.
Declaration
public static T[] CloneArray<T>(this T[] source)
Parameters
| Type | Name | Description |
|---|---|---|
| T[] | source | The source. |
Returns
| Type | Description |
|---|---|
| T[] |
Type Parameters
| Name | Description |
|---|---|
| T |
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 or null. |
Type Parameters
| Name | Description |
|---|---|
| T | The type of object being copied. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | Throw a exception if the given reference is not serializable. |