public Filtering( INotifyCollectionChanged source, Expression <Func <TSourceItem, bool> > predicateExpression, int initialCapacity = 0) : this(predicateExpression, Utils.getCapacity(source), initialCapacity) { _source = source; }
public AnyComputing( IReadScalar <INotifyCollectionChanged> sourceScalar, Expression <Func <TSourceItem, bool> > predicateExpression) : this(predicateExpression, Utils.getCapacity(sourceScalar)) { _sourceScalar = sourceScalar; }
public StringsConcatenating( INotifyCollectionChanged source, string separator = "") : this(Utils.getCapacity(source)) { _source = source; _separator = separator; }
protected override void processSource() { if (_sourceReadAndSubscribed) { _source.CollectionChanged -= handleSourceCollectionChanged; if (_sourceAsINotifyPropertyChanged != null) { _sourceAsINotifyPropertyChanged.PropertyChanged -= ((ISourceIndexerPropertyTracker)this).HandleSourcePropertyChanged; _sourceAsINotifyPropertyChanged = null; } _sourceCopy = new List <TSourceItem>(Utils.getCapacity(_sourceScalar, _source)); _sourceReadAndSubscribed = false; } Utils.changeSource(ref _source, _sourceScalar, _downstreamConsumedComputings, _consumers, this, out _sourceAsList, true); if (_source != null && _isActive) { Utils.initializeFromHasChangeMarker( out _sourceAsIHasChangeMarker, _sourceAsList, ref _lastProcessedSourceChangeMarker, ref _sourceAsINotifyPropertyChanged, (ISourceIndexerPropertyTracker)this); _source.CollectionChanged += handleSourceCollectionChanged; _sourceReadAndSubscribed = true; } recalculateValue(true); }
public StringsConcatenating( IReadScalar <INotifyCollectionChanged> sourceScalar, string separator = "") : this(Utils.getCapacity(sourceScalar)) { _sourceScalar = sourceScalar; _separator = separator; }
public StringsConcatenating( INotifyCollectionChanged source, IReadScalar <string> separatorScalar) : this(Utils.getCapacity(source)) { _source = source; _separatorScalar = separatorScalar; }
public Filtering( IReadScalar <INotifyCollectionChanged> sourceScalar, Expression <Func <TSourceItem, bool> > predicateExpression, int initialCapacity = 0) : this(predicateExpression, Utils.getCapacity(sourceScalar), initialCapacity) { _sourceScalar = sourceScalar; }
public AnyComputing( INotifyCollectionChanged source, Expression <Func <TSourceItem, bool> > predicateExpression) : this(predicateExpression, Utils.getCapacity(source)) { _source = source; }
public MinimazingOrMaximazing( IReadScalar <INotifyCollectionChanged> sourceScalar, MinimazingOrMaximazingMode mode, IComparer <TSourceItem> comparer = null) : this(mode, Utils.getCapacity(sourceScalar)) { _sourceScalar = sourceScalar; _comparer = comparer; }
public MinimazingOrMaximazing( INotifyCollectionChanged source, MinimazingOrMaximazingMode mode, IComparer <TSourceItem> comparer = null) : this(mode, Utils.getCapacity(source)) { _source = source; _comparer = comparer; }
public Crossing( INotifyCollectionChanged outerSource, INotifyCollectionChanged innerSource) : base(Utils.getCapacity(outerSource) * Utils.getCapacity(innerSource)) { _outerSource = outerSource; _innerSource = innerSource; initializeFromSources(); }
private void processSource(bool replaceSource) { if (_sourceReadAndSubscribed) { _valueStringBuilder.Clear(); int capacity = _sourceScalar != null?Utils.getCapacity(_sourceScalar) : Utils.getCapacity(_source); _resultRangePositions = new RangePositions <RangePosition>(new List <RangePosition>(capacity * 2)); if (replaceSource) { Utils.unsubscribeSource( _source, ref _sourceAsINotifyPropertyChanged, this, handleSourceCollectionChanged); } _sourceReadAndSubscribed = false; } if (replaceSource) { Utils.replaceSource(ref _source, _sourceScalar, _downstreamConsumedComputings, _consumers, this, out _sourceAsList, true); } if (_isActive) { if (_source != null) { if (replaceSource) { Utils.subscribeSource( out _sourceAsIHasTickTackVersion, _sourceAsList, ref _lastProcessedSourceTickTackVersion, ref _sourceAsINotifyPropertyChanged, (ISourceIndexerPropertyTracker)this, _source, handleSourceCollectionChanged); } _sourceReadAndSubscribed = true; recalculateValue(); } else { setValue(string.Empty); } } else { setDefaultValue(); } }
public Casting( IReadScalar <INotifyCollectionChanged> sourceScalar) : base(Utils.getCapacity(sourceScalar)) { _sourceScalar = sourceScalar; _sourceScalarPropertyChangedEventHandler = handleSourceScalarValueChanged; _sourceScalarWeakPropertyChangedEventHandler = new WeakPropertyChangedEventHandler(_sourceScalarPropertyChangedEventHandler); _sourceScalar.PropertyChanged += _sourceScalarWeakPropertyChangedEventHandler.Handle; initializeFromSource(); }
public MinimazingOrMaximazing( IReadScalar <INotifyCollectionChanged> sourceScalar, MinimazingOrMaximazingMode mode, IReadScalar <IComparer <TSourceItem> > comparerScalar = null, TSourceItem defaultValue = default(TSourceItem)) : this(mode, Utils.getCapacity(sourceScalar)) { _sourceScalar = sourceScalar; _comparerScalar = comparerScalar; _defaultValue = defaultValue; }
public Crossing( INotifyCollectionChanged outerSource, IReadScalar <INotifyCollectionChanged> innerSourceScalar) : base(Utils.getCapacity(outerSource) * Utils.getCapacity(innerSourceScalar)) { _outerSource = outerSource; _innerSourceScalar = innerSourceScalar; initializeInnerSourceScalar(); initializeFromSources(); }
public Ordering( IReadScalar<INotifyCollectionChanged> sourceScalar, Expression<Func<TSourceItem, TOrderingValue>> orderingValueSelectorExpression, ListSortDirection sortDirection = ListSortDirection.Ascending, IComparer<TOrderingValue> comparer= null) : this(orderingValueSelectorExpression, Utils.getCapacity(sourceScalar)) { _sourceScalar = sourceScalar; _sortDirection = sortDirection; _comparer = comparer ?? Comparer<TOrderingValue>.Default; }
public Concatenating( INotifyCollectionChanged sources) : base(calculateCapacity(sources)) { int capacity = Utils.getCapacity(sources); _itemInfos = new List <ItemInfo>(capacity); _sourceRangePositions = new RangePositions <ItemInfo>(_itemInfos); _sources = sources; initializeFromSources(); }
public Crossing( IReadScalar <INotifyCollectionChanged> outerSourceScalar, INotifyCollectionChanged innerSource) : base(Utils.getCapacity(outerSourceScalar) * Utils.getCapacity(innerSource)) { _outerSourceScalar = outerSourceScalar; initializeOuterSourceScalar(); _innerSource = innerSource; initializeFromSources(); }
//public IOrdering<TSourceItem> Parent => null; //#endregion void IOrderingInternal <TSourceItem> .AddThenOrdering(IThenOrdering <TSourceItem> thenOrdering) { _thenOrderingsCount++; _thenOrderings = _thenOrderings ?? new List <IThenOrderingInternal <TSourceItem> >(4); _thenOrderings.Add((IThenOrderingInternal <TSourceItem>)thenOrdering); if (_thenOrderingsCount == 1) { _equalOrderingValueRangePositions = new RangePositions <RangePosition>( new List <RangePosition>( _sourceScalar != null ? Utils.getCapacity(_sourceScalar) : Utils.getCapacity(_source))); int equalOrderingValueItemsCount = 0; RangePosition rangePosition = null; int count = Count; for (int orderedIndex = 0; orderedIndex < count; orderedIndex++) { if (orderedIndex > 0) { int previousOrderedIndex = orderedIndex - 1; if (_comparer.Compare( getOrderingValue(_orderedItemInfos[orderedIndex].ItemInfo, this[orderedIndex]), getOrderingValue(_orderedItemInfos[previousOrderedIndex].ItemInfo, this[previousOrderedIndex])) == 0) { equalOrderingValueItemsCount++; _orderedItemInfos[orderedIndex].RangePosition = rangePosition; } else { // ReSharper disable once PossibleNullReferenceException rangePosition.Length = equalOrderingValueItemsCount; rangePosition = _equalOrderingValueRangePositions.Add(1); _orderedItemInfos[orderedIndex].RangePosition = rangePosition; equalOrderingValueItemsCount = 1; } } else { rangePosition = _equalOrderingValueRangePositions.Add(1); equalOrderingValueItemsCount = 1; _orderedItemInfos[orderedIndex].RangePosition = rangePosition; } } if (count > 0) { // ReSharper disable once PossibleNullReferenceException rangePosition.Length = equalOrderingValueItemsCount; } } }
public Filtering( IReadScalar <INotifyCollectionChanged> sourceScalar, Expression <Func <TSourceItem, bool> > predicateExpression, int capacity = 0) : this(predicateExpression, Utils.getCapacity(sourceScalar), capacity) { _sourceScalar = sourceScalar; _sourceScalarPropertyChangedEventHandler = handleSourceScalarValueChanged; _sourceScalarWeakPropertyChangedEventHandler = new WeakPropertyChangedEventHandler(_sourceScalarPropertyChangedEventHandler); _sourceScalar.PropertyChanged += _sourceScalarWeakPropertyChangedEventHandler.Handle; initializeFromSource(); }
public StringsConcatenating( IReadScalar <INotifyCollectionChanged> sourceScalar, string separator = "") : this(Utils.getCapacity(sourceScalar)) { _sourceScalar = sourceScalar; initializeSourceScalar(); _separator = separator; initializeSeparator(); initializeFromSource(); }
public StringsConcatenating( INotifyCollectionChanged source, IReadScalar <string> separatorScalar = null) : this(Utils.getCapacity(source)) { _source = source; _separatorScalar = separatorScalar; initializeSeparatorScalar(); initializeSeparator(); initializeFromSource(); }
public MinimazingOrMaximazing( INotifyCollectionChanged source, MinimazingOrMaximazingMode mode, IComparer <TSourceItem> comparer = null, TSourceItem defaultValue = default(TSourceItem)) : this(mode, Utils.getCapacity(source)) { _source = source; _comparer = comparer ?? Comparer <TSourceItem> .Default; _defaultValue = defaultValue; initializeFromSource(); }
public Concatenating( IReadScalar <INotifyCollectionChanged> sourcesScalar) : base(calculateCapacity(sourcesScalar.Value)) { int capacity = Utils.getCapacity(sourcesScalar); _itemInfos = new List <ItemInfo>(capacity); _sourceRangePositions = new RangePositions <ItemInfo>(_itemInfos); _sourcesScalar = sourcesScalar; _sourcesScalarPropertyChangedEventHandler = handleSourcesScalarValueChanged; _sourcesScalarWeakPropertyChangedEventHandler = new WeakPropertyChangedEventHandler(_sourcesScalarPropertyChangedEventHandler); _sourcesScalar.PropertyChanged += _sourcesScalarWeakPropertyChangedEventHandler.Handle; initializeFromSources(); }
protected override void initializeFromSource() { if (_sourceInitialized) { _valueStringBuilder.Clear(); int capacity = _sourceScalar != null?Utils.getCapacity(_sourceScalar) : Utils.getCapacity(_source); _resultRangePositions = new RangePositions <RangePosition>(new List <RangePosition>(capacity * 2)); _source.CollectionChanged -= handleSourceCollectionChanged; if (_sourceAsINotifyPropertyChanged != null) { _sourceAsINotifyPropertyChanged.PropertyChanged -= ((ISourceIndexerPropertyTracker)this).HandleSourcePropertyChanged; _sourceAsINotifyPropertyChanged = null; } _sourceInitialized = false; } Utils.changeSource(ref _source, _sourceScalar, _downstreamConsumedComputings, _consumers, this, ref _sourceAsList, true); if (_source != null && _isActive) { Utils.initializeFromHasChangeMarker( out _sourceAsIHasChangeMarker, _sourceAsList, ref _lastProcessedSourceChangeMarker, ref _sourceAsINotifyPropertyChanged, (ISourceIndexerPropertyTracker)this); _source.CollectionChanged += handleSourceCollectionChanged; _sourceInitialized = true; recalculateValue(); } else { _valueStringBuilder.Clear(); setValue(String.Empty); } }
private void processSource(bool replaceSource) { if (_sourceReadAndSubscribed) { if (replaceSource) { Utils.unsubscribeSource( _source, ref _sourceAsINotifyPropertyChanged, this, handleSourceCollectionChanged); } _sourceCopy = new List <TSourceItem>(Utils.getCapacity(_sourceScalar, _source)); _sourceReadAndSubscribed = false; } if (replaceSource) { Utils.replaceSource(ref _source, _sourceScalar, _downstreamConsumedComputings, _consumers, this, out _sourceAsList, true); } if (_source != null && _isActive) { if (replaceSource) { Utils.subscribeSource( out _sourceAsIHasTickTackVersion, _sourceAsList, ref _lastProcessedSourceTickTackVersion, ref _sourceAsINotifyPropertyChanged, (ISourceIndexerPropertyTracker)this, _source, handleSourceCollectionChanged); } _sourceReadAndSubscribed = true; } recalculateValue(true); }
public Casting( INotifyCollectionChanged source) : base(Utils.getCapacity(source)) { _source = source; _thisAsSourceCollectionChangeProcessor = this; }
public Casting( IReadScalar <INotifyCollectionChanged> sourceScalar) : base(Utils.getCapacity(sourceScalar)) { _sourceScalar = sourceScalar; _thisAsSourceCollectionChangeProcessor = this; }
public CollectionProcessingVoid( INotifyCollectionChanged source, Action <TSourceItem, CollectionProcessingVoid <TSourceItem> > newItemProcessor = null, Action <TSourceItem, CollectionProcessingVoid <TSourceItem> > oldItemProcessor = null, Action <TSourceItem, CollectionProcessingVoid <TSourceItem> > moveItemProcessor = null) : this(newItemProcessor, oldItemProcessor, moveItemProcessor, Utils.getCapacity(source)) { _source = source; _thisAsSourceCollectionChangeProcessor = this; }
public CollectionProcessingVoid( IReadScalar <INotifyCollectionChanged> sourceScalar, Action <TSourceItem, CollectionProcessingVoid <TSourceItem> > newItemProcessor = null, Action <TSourceItem, CollectionProcessingVoid <TSourceItem> > oldItemProcessor = null, Action <TSourceItem, CollectionProcessingVoid <TSourceItem> > moveItemProcessor = null) : this(newItemProcessor, oldItemProcessor, moveItemProcessor, Utils.getCapacity(sourceScalar)) { _sourceScalar = sourceScalar; _thisAsSourceCollectionChangeProcessor = this; }