示例#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);
                }
 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);
 }