public void OnDataAddedOrChanged( TData data, AbstractTableDataSource <TItem, TData> tableSource ) { var key = tableSource.GetItemKey(data); if (_primary != null && _primary.Key.Equals(key)) { return; } if (_sources != null) { if (_sources.ContainsKey(key)) { return; } } EnsureSources(); var source = tableSource.CreateTableEntriesSource(data); _sources.Add(source.Key, source); }
public SubscriptionWithoutLock(AbstractTableDataSource <TItem, TData> source, ITableDataSink sink) { _source = source; _sink = sink; Register(); ReportInitialData(); }
public AggregatedEntriesSource( AbstractTableDataSource <TItem, TData> tableSource, AbstractTableEntriesSource <TItem> primary ) { _tableSource = tableSource; _sources = new EntriesSourceCollections(primary); }
public bool OnDataRemoved(TData data, AbstractTableDataSource <TItem, TData> tableSource) { var key = tableSource.GetItemKey(data); if (_primary != null && _primary.Key.Equals(key)) { return(true); } if (_sources != null) { _sources.Remove(key); return(_sources.Count == 0); } // they never reported to us before return(false); }
public AggregatedEntriesSource(IThreadingContext threadingContext, AbstractTableDataSource <TItem, TData> tableSource, AbstractTableEntriesSource <TItem> primary) { _threadingContext = threadingContext; _tableSource = tableSource; _sources = new EntriesSourceCollections(primary); }