示例#1
0
 private static OperationBase TransformDeleteInsert(DeleteOperation remoteDelete, InsertOperation localInsert)
 {
     if (remoteDelete.Position < localInsert.Position)
     {
         return(remoteDelete);
     }
     else
     {
         return(remoteDelete.NewWithPosition(remoteDelete.Position + localInsert.Length));
     }
 }
示例#2
0
 private static OperationBase TransformDeleteDelete(DeleteOperation remoteDelete, DeleteOperation localDelete)
 {
     if (remoteDelete.Position < localDelete.Position)
     {
         return(remoteDelete);
     }
     else if (remoteDelete.Position > localDelete.Position)
     {
         return(remoteDelete.NewWithPosition(remoteDelete.Position - localDelete.Length));
     }
     else
     {
         return(new IdentityOperation(remoteDelete.UserId, remoteDelete.SequenceId));
     }
 }