public static MakeCopyOf ( object x ) : object | ||
x | object | |
return | object |
public static object MakeCopyOf(object x)
{
if (x is ICloneable)
{
// Return a deep copy of the object
return ((ICloneable)x).Clone();
}
else
throw new System.NotSupportedException("Object Does Not Implement the ICloneable Interface.");
}
#endregion