Beispiel #1
0
                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);
                }
Beispiel #2
0
            public SubscriptionWithoutLock(AbstractTableDataSource <TItem, TData> source, ITableDataSink sink)
            {
                _source = source;
                _sink   = sink;

                Register();
                ReportInitialData();
            }
Beispiel #3
0
 public AggregatedEntriesSource(
     AbstractTableDataSource <TItem, TData> tableSource,
     AbstractTableEntriesSource <TItem> primary
     )
 {
     _tableSource = tableSource;
     _sources     = new EntriesSourceCollections(primary);
 }
Beispiel #4
0
                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);
                }
Beispiel #5
0
 public AggregatedEntriesSource(IThreadingContext threadingContext, AbstractTableDataSource <TItem, TData> tableSource, AbstractTableEntriesSource <TItem> primary)
 {
     _threadingContext = threadingContext;
     _tableSource      = tableSource;
     _sources          = new EntriesSourceCollections(primary);
 }