Mono Class Library: System.Delegate Overview | Members

System.Delegate.Clone Method

Creates a copy of the current instance.

public virtual object Clone ()

Returns

A object that is a copy of the current instance.

Remarks

The Delegate.Clone method creates a new instance of the same type as the current instance and then copies the contents of each of the current instance's non-static fields.

Note: This method is implemented to support the ICloneable interface.

Operation
The returned object must have the exact same type and invocation list as the current instance.

The default implementation of the Delegate.Clone method creates a new instance, which is the exact same type as the current instance, and then copies the contents of each of the current instance's non-static fields. If the field is a value type, a bit-by-bit copy of the field is performed. If the field is a reference type, the object referenced by the field is not copied; instead, the returned object contains a copy of the reference. This behavior is identical to object.MemberwiseClone .

Note to Inheritors
Subclasses of Delegate should override Delegate.Clone to customize the way in which copies of the subclass are constructed.

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0