Ejemplo n.º 1
0
 public UndoableRleCollectionInsertRangeHistoryItem(IDocumentModel documentModel, RleCollection <T> collection, int index, IRleCollection <T> range, IRleCollectionValueConverter <T> valueConverter)
     : base(documentModel.MainPart)
 {
     this.collection     = collection;
     this.index          = index;
     this.newRange       = range;
     this.valueConverter = valueConverter;
 }
Ejemplo n.º 2
0
        public void Insert(int index, IRleCollection <T> range, IRleCollectionValueConverter <T> valueConverter)
        {
            Guard.ArgumentNotNull(range, "range");
            CheckIndexAndCount(index, range.Length);
            UndoableRleCollectionInsertRangeHistoryItem <T> historyItem = new UndoableRleCollectionInsertRangeHistoryItem <T>(DocumentModel, innerCollection, index, range, valueConverter);

            History.Add(historyItem);
            historyItem.Execute();
        }
Ejemplo n.º 3
0
        public void SetRange(int startIndex, IRleCollection <T> range, IRleCollectionValueConverter <T> valueConverter)
        {
            Guard.ArgumentNotNull(range, "range");
            CheckRangeIndexes(startIndex, startIndex + range.Length - 1);
            UndoableRleCollectionSetRangeHistoryItem <T> historyItem = new UndoableRleCollectionSetRangeHistoryItem <T>(DocumentModel, innerCollection, startIndex, range, valueConverter);

            History.Add(historyItem);
            historyItem.Execute();
        }
Ejemplo n.º 4
0
 public void Insert(int index, IRleCollection <T> range)
 {
     Insert(index, range, null);
 }
Ejemplo n.º 5
0
 public void SetRange(int startIndex, IRleCollection <T> range)
 {
     SetRange(startIndex, range, null);
 }
Ejemplo n.º 6
0
 public void Insert(int index, IRleCollection <T> range, IRleCollectionValueConverter <T> valueConverter)
 {
     Guard.ArgumentNotNull(range, "range");
     CheckIndexAndCount(index, range.Length);
     InsertRangeCore(index, range.Implementation.items, valueConverter);
 }
Ejemplo n.º 7
0
 public void SetRange(int startIndex, IRleCollection <T> range, IRleCollectionValueConverter <T> valueConverter)
 {
     Guard.ArgumentNotNull(range, "range");
     CheckRangeIndexes(startIndex, startIndex + range.Length - 1);
     SetRangeCore(startIndex, range.Implementation.items, valueConverter);
 }
Ejemplo n.º 8
0
 protected override void RedoCore()
 {
     savedRange = collection.GetRange(index, index + count - 1);
     collection.Remove(index, count);
 }
Ejemplo n.º 9
0
 protected override void UndoCore()
 {
     collection.Insert(index, savedRange);
     savedRange = null;
 }
Ejemplo n.º 10
0
 protected override void RedoCore()
 {
     savedRange = collection.GetRange(collection.Length - newRange.Length, collection.Length - 1);
     collection.Insert(index, newRange, valueConverter);
 }
Ejemplo n.º 11
0
 protected override void UndoCore()
 {
     collection.Remove(index, newRange.Length);
     collection.SetRange(collection.Length - newRange.Length, savedRange);
     savedRange = null;
 }
Ejemplo n.º 12
0
 protected override void RedoCore()
 {
     savedRange = collection.GetRange(collection.Length - count, collection.Length - 1);
     collection.Insert(index, count, newValue);
 }
Ejemplo n.º 13
0
 protected override void UndoCore()
 {
     collection.Remove(index, count);
     collection.SetRange(collection.Length - count, savedRange);
     savedRange = null;
 }
Ejemplo n.º 14
0
 protected override void RedoCore()
 {
     oldRange = collection.GetRange(startIndex, startIndex + newRange.Length - 1);
     collection.SetRange(startIndex, newRange, valueConverter);
 }
Ejemplo n.º 15
0
 protected override void UndoCore()
 {
     collection.SetRange(startIndex, oldRange);
     oldRange = null;
 }
Ejemplo n.º 16
0
 protected override void RedoCore()
 {
     oldRange = collection.GetRange(startIndex, endIndex);
     collection.SetRange(startIndex, endIndex, newValue);
 }