Ejemplo n.º 1
0
 /// <summary>
 /// 关联方式.
 /// </summary>
 /// <param name="other"></param>
 /// <returns></returns>
 public bool On(MergeAble other)
 {
     // 首先数据转换.
     TestData otherTestData = other as TestData;
     // 对于 TestData 类,以 Code 为基准进行关联.
     return this.Code == otherTestData.Code;
 }
Ejemplo n.º 2
0
        /// <summary>
        /// 关联方式.
        /// </summary>
        /// <param name="other"></param>
        /// <returns></returns>
        public bool On(MergeAble other)
        {
            // 首先数据转换.
            TestData otherTestData = other as TestData;

            // 对于 TestData 类,以 Code 为基准进行关联.
            return(this.Code == otherTestData.Code);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// 匹配 更新
 /// </summary>
 /// <param name="newData"></param>
 /// <returns></returns>
 public MergeAble GetWhenMatchedResult(MergeAble newData)
 {
     // 首先克隆 旧数据.
     TestData result = this.MemberwiseClone() as TestData;
     // 数据转换.
     TestData newTestData = newData as TestData;
     // 仅仅 更新 Val
     result.Val = newTestData.Val;
     // 返回.
     return result;
 }
Ejemplo n.º 4
0
        /// <summary>
        /// 匹配 更新
        /// </summary>
        /// <param name="newData"></param>
        /// <returns></returns>
        public MergeAble GetWhenMatchedResult(MergeAble newData)
        {
            // 首先克隆 旧数据.
            TestData result = this.MemberwiseClone() as TestData;
            // 数据转换.
            TestData newTestData = newData as TestData;

            // 仅仅 更新 Val
            result.Val = newTestData.Val;
            // 返回.
            return(result);
        }