コード例 #1
0
 public virtual void CopyFrom(ICustomCloning other)
 {
     if (other is Addresses)
     {
         var o as Addresses;
         //Do your copy from o.
     }
 }
コード例 #2
0
 public virtual void CopyFrom(ICustomCloning other){
     if(other is Addresses){
         var o as Addresses;
         //Do your copy from o.
     }
     else if(other is Customer)
     //var o = (other as Customer). Addresses;
     //Do your copy from o
 }
コード例 #3
0
 public virtual void CopyFrom(ICustomCloning other){
    if(other is Customer)
    {
        var o = other as Customer;
        //copy values from o. 
        //this.Name = o.Name;
    }
    //else if(other is Addresses)
    //this.Addresses.CopyFrom(other);
 }