コード例 #1
0
    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();
    }
コード例 #2
0
    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();
    }
コード例 #3
0
 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.
 }
コード例 #4
0
 protected AbstractCloneable(AbstractCloneable d)
 {
     BaseValue = d.BaseValue;
 }