protected override HandleCloned(AbstractCloneable clone) { //Clone is of the current type. ConcreteCloneable obj = (ConcreteCloneable)clone; //Here you have a superficial copy of "this". You can do wathever //specific task you need to do. //e.g.: obj.SomeReferencedPropertie = this.SomeReferencedPropertie.Clone(); }
protected override HandleCloned(AbstractCloneable clone) { //Get whathever magic a base class could have implemented. base.HandleCloned(clone); //Clone is of the current type. ConcreteCloneable obj = (ConcreteCloneable)clone; //Here you have a superficial copy of "this". You can do whathever //specific task you need to do. //e.g.: obj.SomeReferencedProperty = this.SomeReferencedProperty.Clone(); }
protected virtual HandleCloned(AbstractCloneable clone) { //Nothing particular in the base class, but maybe useful for children. //Not abstract so children may not implement this if they don't need to. }
protected AbstractCloneable(AbstractCloneable d) { BaseValue = d.BaseValue; }