public KeysEditScript <TKey> Merge(KeysEditScript <TKey> other) { var resultCommonKeys = CommonKeys.Intersect(other.CommonKeys); var resultDeletedKeys = DeletedKeys.Union(other.DeletedKeys); var resultInsertedKeys = InsertedKeys.Union(other.InsertedKeys); return(new KeysEditScript <TKey>(resultCommonKeys, resultDeletedKeys, resultInsertedKeys)); }
public IEnumerator <DiffSegnment <TKey> > GetEnumerator() { var resultingSequence = CommonKeys.Select(key => new DiffSegnment <TKey>(EditOperation.Equl, key)).Concat( DeletedKeys.Select(key => new DiffSegnment <TKey>(EditOperation.Delete, key)) ).Concat( InsertedKeys.Select(key => new DiffSegnment <TKey>(EditOperation.Insert, key)) ); return(resultingSequence.GetEnumerator()); }