CloneOptions Class
Defines options which define how an object is cloned.
public class CloneOptions
- Inheritance:
- object object
Constructors
CloneOptions()
Initializes an instance of the class.
public CloneOptions()
Properties
CloneType
Gets or sets the desired type of the cloned object if it is not the same as the source object.
public Type CloneType { get; set; }
Property Value
Remarks
The InstanceFactory, when defined and returning a non-null
instance, will supersede this option.
IgnoreCloneableObjects
Gets or sets if objects which natively supporting cloning (e.g., ICloneable) should be able to clone themselves.
public bool IgnoreCloneableObjects { get; set; }
Property Value
InstanceFactory
Gets or sets a function this is responsible for creating a new instance of the object, which will become the clone.
public Func<object> InstanceFactory { get; set; }
Property Value
- Func<object>:
A Func<TResult>, or
null
to use the default activation logic. The default value isnull
.
Remarks
If this factory method is undefined or returns null
, the default type activation logic will be used.
ReuseFreezables
Gets or sets if the original instance of a System.Windows.Freezable should be reused as a clone if it is already frozen or can be frozen.
public bool ReuseFreezables { get; set; }
Property Value
- bool:
true
to reuse the original freezable. The default value istrue
.
UseOriginalObjectWhenCloneUnavailable
Gets or sets if the original object should be returned for the clone when one could not otherwise be provided.
public bool UseOriginalObjectWhenCloneUnavailable { get; set; }
Property Value
- bool:
true
to allow the original object to be returned as a clone.false
to returnnull
when a clone is unavailable. The default value istrue
.