32 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
			
		
		
	
	
			32 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
using System;
 | 
						||
using System.Collections.Generic;
 | 
						||
using System.Linq;
 | 
						||
using System.Runtime.Serialization;
 | 
						||
using System.Text;
 | 
						||
using System.Threading.Tasks;
 | 
						||
 | 
						||
namespace Future.Contract
 | 
						||
{
 | 
						||
    /// <summary>
 | 
						||
    /// 不是“指令”也不是“档案”的其它数据对象的基类
 | 
						||
    /// </summary>
 | 
						||
    [DataContract]
 | 
						||
    public class FutureObject : IFuture
 | 
						||
    {
 | 
						||
        /// <summary>
 | 
						||
        /// 深度拷贝对象:将当前对象序列化,再通过反序列化方式创建新对象,从而实现对象的深度拷贝
 | 
						||
        /// </summary>
 | 
						||
        /// <returns>拷贝出的新对象</returns>
 | 
						||
        public virtual IFuture Clone()
 | 
						||
        {
 | 
						||
            throw new NotImplementedException();
 | 
						||
        }
 | 
						||
        /// <summary>
 | 
						||
        /// 对象属性覆盖:用引用对象属性覆盖当前对象属性,对引用属性只会实现引用赋值,不做深拷贝
 | 
						||
        /// </summary>
 | 
						||
        /// <param name="refer">用于覆盖当前对象属性的源对象</param>
 | 
						||
        /// <returns>如果源对象类型不是当前对象或是其子类类型则直接覆盖失败,返回False</returns>
 | 
						||
        public virtual bool Cover(IFuture refer) => refer != null && refer.GetType().IsInstanceOfType(this);
 | 
						||
    }
 | 
						||
}
 |