Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

Delegate.Clone Method

Creates a shallow copy of the delegate.

Namespace:  System
Assembly:  mscorlib (in mscorlib.dll)

public virtual Object Clone()

Return Value

Type: System.Object
A shallow copy of the delegate.

Implements

ICloneable.Clone()

The clone has the same Type, target, method, and invocation list as the original delegate.

A shallow copy creates a new instance of the same type as the original object, and then copies the nonstatic fields of the original object. 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 reference is copied but the referred object is not; therefore, the reference in the original object and the reference in the clone point to the same object. In contrast, a deep copy of an object duplicates everything directly or indirectly referenced by the fields in the object.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

XNA Framework

Supported in: 3.0, 2.0, 1.0

Show:
© 2015 Microsoft