Assign() public method

Assigns the properties of src to the receiver.
public Assign ( IClone src ) : void
src IClone
return void
Exemplo n.º 1
0
        /// <summary>
        /// Clones the receiver and assigns the result to clonee.
        /// <returns></returns>
        public IClone Clone()
        {
            //create a new instance of the object
            ClonableObjClass obj = new ClonableObjClass();

            //assign the properties of the new object with the current object's properties.
            //according to each 'Ref' property, the user need to decide whether to use deep cloning
            //or shallow cloning.
            obj.Assign(this);

            return((IClone)obj);
        }
    /// <summary>
    /// Clones the receiver and assigns the result to clonee.
    /// <returns></returns>
    public IClone Clone()
    {
      //create a new instance of the object
      ClonableObjClass obj = new ClonableObjClass();
      //assign the properties of the new object with the current object's properties.
      //according to each 'Ref' property, the user need to decide whether to use deep cloning
      //or shallow cloning. 
      obj.Assign(this);

      return (IClone)obj;
    }