public UndoableRleCollectionSetValueHistoryItem(IDocumentModel documentModel, RleCollection <T> collection, int index, T value) : base(documentModel.MainPart) { this.collection = collection; this.newValue = value; this.index = index; }
public UndoableRleCollectionRemoveRangeHistoryItem(IDocumentModel documentModel, RleCollection <T> collection, int index, int count) : base(documentModel.MainPart) { this.collection = collection; this.index = index; this.count = count; }
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; }
public UndoableRleCollectionSetRangeValueHistoryItem(IDocumentModel documentModel, RleCollection <T> collection, int startIndex, int endIndex, T value) : base(documentModel.MainPart) { this.collection = collection; this.startIndex = startIndex; this.endIndex = endIndex; this.newValue = value; }
public IndexEnumerator(RleCollection <T> collection, int startIndex, int endIndex, Predicate <T> match) { this.collection = collection; this.startIndex = startIndex; this.endIndex = endIndex; this.match = match; reversed = startIndex > endIndex; Reset(); }
public IRleCollection <T> GetRange(int startIndex, int endIndex) { CheckRangeIndexes(startIndex, endIndex); RleCollection <T> result = new RleCollection <T>(endIndex - startIndex + 1); result.ImmutableValues = this.ImmutableValues; int itemIndex = GetItemIndex(startIndex); RleItem <T> sourceItem = items[itemIndex]; while (sourceItem != null && sourceItem.StartIndex <= endIndex) { RleItem <T> item = new RleItem <T>(sourceItem.Value, Math.Max(sourceItem.StartIndex, startIndex) - startIndex, Math.Min(sourceItem.EndIndex, endIndex) - startIndex); result.items.Add(item); itemIndex++; sourceItem = itemIndex < items.Count ? items[itemIndex] : null; } return(result); }
public UndoableRleCollection(IDocumentModelPart documentModelPart, int length, T defaultValue) { this.documentModelPart = documentModelPart; this.innerCollection = new RleCollection <T>(length, defaultValue); }
public void Dispose() { collection = null; }