Provide a default implementation of IClone
- Inheritance:
- object object
- Derived:
-
Bars
Clone Service
- Implements:
-
IClone
Service
Constructors
CloneServiceBase()
Initializes a new instance of the Clone
Methods
CanCloneAvaloniaPropertyValue(AvaloniaObject, AvaloniaProperty)
Tests if the value of an Avalonia.AvaloniaProperty can be cloned.
Parameter | Type | Description |
---|---|---|
source | AvaloniaObject | The source object. |
property | AvaloniaProperty | The property to be tested. |
Returns
- bool:
true
if the value can be cloned; otherwisefalse
to skip cloning the value.
CreateClone(object?)
Returns a clone of the original object.
Parameter | Type | Description |
---|---|---|
original | object | The original object to be cloned. |
Returns
- object:
A clone of the original object when possible. Otherwise,
null
or the original object is returned (depending on settings).
CreateClone(object?, CloneOptions)
Returns a clone of the original object.
Parameter | Type | Description |
---|---|---|
original | object | The original object to be cloned. |
options | Clone |
The options to use when cloning. |
Returns
- object:
A clone of the original object when possible. Otherwise,
null
or the original object is returned (depending on settings).
CreateCloneCore(object?, CloneOptions?, Type?)
Performs the core logic of cloning an object.
Parameter | Type | Description |
---|---|---|
original | object | The original object to be cloned. |
options | Clone |
The options to use when cloning. When not specified, default options will be used. |
defaultType | Type | Optionally defines the default type of object to be created when not specified by |
Returns
- object:
A clone of the original object when possible. Otherwise,
null
or the original object is returned (depending on settings).
CreateClone<T>(object?)
Returns a clone of the original object.
- Type Parameters:
-
T
-The type of the cloned object.
Parameter | Type | Description |
---|---|---|
original | object | The original object to be cloned. |
Returns
- T:
A clone of the original object when possible. Otherwise,
null
or the original object is returned (depending on settings).
CreateClone<T>(object?, CloneOptions)
Returns a clone of the original object.
- Type Parameters:
-
T
-The type of the cloned object.
Parameter | Type | Description |
---|---|---|
original | object | The original object to be cloned. |
options | Clone |
The options to use when cloning. |
Returns
- T:
A clone of the original object when possible. Otherwise,
null
or the original object is returned (depending on settings).
CreateInstance(object?, CloneOptions?, Type?)
Creates the base instance of an object which is the clone of another object.
Parameter | Type | Description |
---|---|---|
original | object | The original object to be cloned. |
options | Clone |
The options to use when cloning. |
defaultType | Type | Optionally defines the default type of object to be created when not specified by |
Returns
- object:
A new instance of an object if available; otherwise
null
if an instance could not be created.
GetAvaloniaProperties(AvaloniaObject)
Returns an enumerable of any Avalonia.AvaloniaProperty instances defined for a given object.
Parameter | Type | Description |
---|---|---|
source | AvaloniaObject | The source object. |
Returns
- IEnumerable<AvaloniaProperty>:
An IEnumerable<T>.
See Also
GetProperties(object)
Returns an enumerable of any Property
IsPropertyExplicitlyAssigned(AvaloniaObject, AvaloniaProperty)
Tests if the value of an Avalonia.AvaloniaProperty has been explicitly assigned a value on a given object.
Parameter | Type | Description |
---|---|---|
source | AvaloniaObject | The source object to examine. |
property | AvaloniaProperty | The property to test. |
Returns
- bool:
true
if the property value has been explicitly assigned; otherwise,false
.
IsTransferableProperty(object, PropertyDescriptor)
Tests if a Property
Parameter | Type | Description |
---|---|---|
source | object | The source object. |
property | Property |
The property to examine. |
Returns
- bool:
true
if the property can be transferred; otherwisefalse
if it cannot be transferred.
IsTransferableProperty(object, object, AvaloniaProperty)
Tests if an Avalonia.AvaloniaProperty supports transfer.
Parameter | Type | Description |
---|---|---|
source | object | The source object. |
target | object | The target object. |
property | AvaloniaProperty | The property to examine. |
Returns
- bool:
true
if the property can be transferred; otherwisefalse
if it cannot be transferred.
ResolveTargetAvaloniaProperty(AvaloniaObject, AvaloniaObject, AvaloniaProperty)
Returns the Avalonia.AvaloniaProperty of the target
which should receive the
value of a Avalonia.AvaloniaProperty on the source
.
Parameter | Type | Description |
---|---|---|
source | AvaloniaObject | The source object. |
target | AvaloniaObject | The target object. |
sourceProperty | AvaloniaProperty | The property on the source. |
Returns
- AvaloniaProperty:
The Avalonia.AvaloniaProperty to be used by the
target
; otherwisenull
if a target property is unavailable.
ResolveTargetProperty(object, object, PropertyDescriptor)
Returns the Propertytarget
which should receive the
value of a Propertysource
.
Parameter | Type | Description |
---|---|---|
source | object | The source object. |
target | object | The target object. |
sourceProperty | Property |
The property on the source. |
Returns
- Property
Descriptor : The Property
Descriptor to be used by thetarget
; otherwisenull
if a target property is unavailable.
TransferAvaloniaProperty(AvaloniaObject, AvaloniaObject, AvaloniaProperty, AvaloniaProperty?)
Transfers the value of a Avalonia.AvaloniaProperty on the source to a Avalonia.AvaloniaProperty on the target.
Parameter | Type | Description |
---|---|---|
source | AvaloniaObject | The source object. |
target | AvaloniaObject | The target object. |
sourceProperty | AvaloniaProperty | The property on the source. |
targetProperty | AvaloniaProperty | The property on the target. |
TransferProperty(object, object, PropertyDescriptor?, PropertyDescriptor?)
Transfers the value of a property from the source to the target.
Parameter | Type | Description |
---|---|---|
source | object | The source object. |
target | object | The target object. |
sourcePropertyDescriptor | Property |
The Property |
targetPropertyDescriptor | Property |
The Property |
Inherited Members
-
object.
Get Type() -
object.
Memberwise Clone() -
object.
To String() -
object.
Equals(object) -
object.
Equals(object, object) -
object.
Reference Equals(object, object) -
object.
Get Hash Code()