Example #1
0
        private void _clientItemDatabase_TupleAdded(object sender, TKey key, TValue copiedElement)
        {
            if (Settings.SearchEngine.SubsetCondition != null)
            {
                if (!Settings.SearchEngine.SubsetCondition(copiedElement))
                {
                    return;
                }
            }

            if (!_listView.Items.Contains(copiedElement))
            {
                if (_listView.ItemsSource != null)
                {
                    SearchEngine.AddTuple(copiedElement);

                    if (_isCurrentTabSelected())
                    {
                        this.Dispatch(p => _listView.SelectedItem = copiedElement);
                    }

                    if (Settings.SearchEngine.SetupImageDataGetter != null)
                    {
                        Settings.SearchEngine.SetupImageDataGetter(copiedElement);
                    }
                }
            }
        }
Example #2
0
        protected void _addedItem(ReadableTuple <int> tupleParent, int dkey, ReadableTuple <int> dvalue, bool executed)
        {
            RangeObservableCollection <ReadableTuple <int> > result = (RangeObservableCollection <ReadableTuple <int> >)_lv.ItemsSource;

            if (executed)
            {
                Dictionary <int, ReadableTuple <int> > dico = (Dictionary <int, ReadableTuple <int> >)tupleParent.GetRawValue(1);
                SearchEngine.AddTuple((ReadableTuple <TKey>)(object) dico[dkey]);
            }
            else
            {
                result.Remove(result.FirstOrDefault(p => p.Key == dkey));
            }

            ((RangeObservableCollection <ReadableTuple <int> >)_lv.ItemsSource).Update();
        }