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); }
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); }