コード例 #1
0
            public SubscriptionWithoutLock(AbstractTableDataSource <TArgs, TData> source, ITableDataSink sink)
            {
                _source = source;
                _sink   = sink;

                Register();
                ReportInitialData();
            }
コード例 #2
0
        protected AbstractTable(Workspace workspace, ITableManagerProvider provider, Guid tableIdentifier, AbstractTableDataSource <TArgs, TData> source)
        {
            _workspace        = workspace;
            _provider         = provider;
            this.TableManager = provider.GetTableManager(tableIdentifier);

            this.Source = source;

            AddInitialTableSource(workspace);
        }
コード例 #3
0
                public bool OnDataRemoved(object data, AbstractTableDataSource <TItem> 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);
                }
コード例 #4
0
                public void OnDataAddedOrChanged(object data, AbstractTableDataSource <TItem> 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);
                }
コード例 #5
0
 public AbstractTableEntriesFactory(AbstractTableDataSource <TData> source)
 {
     _source = source;
 }
コード例 #6
0
 public TableEntriesFactory(AbstractTableDataSource <TItem> tableSource, AbstractTableEntriesSource <TItem> entriesSource)
 {
     _tableSource    = tableSource;
     _entriesSources = new AggregatedEntriesSource(_tableSource, entriesSource);
 }
コード例 #7
0
 public AggregatedEntriesSource(AbstractTableDataSource <TItem> tableSource, AbstractTableEntriesSource <TItem> primary)
 {
     _tableSource = tableSource;
     _sources     = new EntriesSourceCollections(primary);
 }