Files
Future/Future.Contract/FutureObject.cs
2025-08-30 17:19:57 +08:00

32 lines
1.2 KiB
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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);
}
}