Exemple #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));
     }
 }
Exemple #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));
     }
 }
Exemple #3
0
 private static OperationBase TransformInsertDelete(InsertOperation remoteInsert, DeleteOperation localDelete)
 {
     if (remoteInsert.Position <= localDelete.Position)
     {
         return(remoteInsert);
     }
     else
     {
         return(remoteInsert.NewWithPosition(remoteInsert.Position - localDelete.Length));
     }
 }