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