Interface IRadCloneable
Provides notifications during reflection-based cloning and field copying operations.
Inherited Members
Namespace: Telerik.WinControls
Assembly: Telerik.WinControls.dll
Syntax
public interface IRadCloneable : ICloneable
Remarks
IRadCloneable extends the standard System.ICloneable interface to provide additional notifications during reflection-based operations performed by ReflectionHelper. This allows objects to perform custom initialization or cleanup logic during cloning processes.
Classes implementing this interface can:
- React to field copying completion with OnFieldsCopied()
- Perform final initialization with OnCloneComplete()
- Handle custom logic that requires awareness of the cloning process
This interface is particularly useful for objects that need to reinitialize calculated properties, establish new event handlers, or perform other setup tasks after being cloned.
Methods
OnCloneComplete()
Called after a complete cloning operation has finished, including field copying and any intermediate notifications.
Declaration
void OnCloneComplete()
Remarks
This method is invoked by Clone<T>(T) as the final step in the cloning process, after all fields have been copied and OnFieldsCopied() has been called. Implementing classes can use this notification to:
- Perform final initialization that requires all fields to be set
- Establish connections or relationships with other objects
- Execute validation logic on the complete cloned state
- Initialize transient state that shouldn't be copied
This is the last method called during the clone operation, making it ideal for final setup tasks.
OnFieldsCopied()
Called after fields have been copied to this object during a reflection-based field copying operation.
Declaration
void OnFieldsCopied()
Remarks
This method is invoked by CopyFields<T>(T, T) after all compatible fields have been copied from a source object. Implementing classes can use this notification to:
- Update calculated or derived properties
- Reinitialize collections or event handlers
- Perform validation or consistency checks
- Execute any logic that depends on the complete field state
This method is called before OnCloneComplete() in clone operations, allowing for staged initialization logic.