Ejemplo n.º 1
0
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                handler.Dispose();

                Children.CollectionChanged -= Children_CollectionChanged;
                Children.ForEach(x => x.Dispose());
                this.Remove();

                AutocompleteAll.InputEnded             -= Autocomplete_InputEnded;
                AutocompleteAny.InputEnded             -= Autocomplete_InputEnded;
                AutocompleteNot.InputEnded             -= Autocomplete_InputEnded;
                AutocompleteAll.CHiosChanged           -= Autocomplete_CHiosChanged;
                AutocompleteAny.CHiosChanged           -= Autocomplete_CHiosChanged;
                AutocompleteNot.CHiosChanged           -= Autocomplete_CHiosChanged;
                AutocompleteAll.Tags.CollectionChanged -= Tags_CollectionChanged;
                AutocompleteAny.Tags.CollectionChanged -= Tags_CollectionChanged;
                AutocompleteNot.Tags.CollectionChanged -= Tags_CollectionChanged;
                AutocompleteAll.PropertyChanged        -= Autocomplete_PropertyChanged;
                AutocompleteAny.PropertyChanged        -= Autocomplete_PropertyChanged;
                AutocompleteNot.PropertyChanged        -= Autocomplete_PropertyChanged;
                AutocompleteAll.Dispose();
                AutocompleteAny.Dispose();
                AutocompleteNot.Dispose();
                if (_categories != null)
                {
                    _categories.Clear();
                }
            }
            base.Dispose(disposing);
        }
Ejemplo n.º 2
0
        private void FillToOptions(SearchOptions options)
        {
            AutocompleteAll.CompleteTypings();
            AutocompleteAny.CompleteTypings();
            AutocompleteNot.CompleteTypings();

            options.CWordsAll = AutocompleteAll.GetCWords().ToList();
            options.CWordsAny = AutocompleteAny.GetCWords().ToList();
            options.CWordsNot = AutocompleteNot.GetCWords().ToList();

            options.MeasuresAll = AutocompleteAll.GetCHIOs().Where(x => x.HIO is MeasureOp).Select(x => x.HIO).Cast <MeasureOp>().ToList();
            options.MeasuresAny = AutocompleteAny.GetCHIOs().Where(x => x.HIO is MeasureOp).Select(x => x.HIO).Cast <MeasureOp>().ToList();

            options.Categories    = SelectedCategories.Select(cat => cat.category).ToList();
            options.MinAny        = MinAny;
            options.WithConf      = WithConfidence;
            options.GroupOperator = GroupOperator;
            options.SearchScope   = SearchScope;
        }
Ejemplo n.º 3
0
        private void FillFromOptions(SearchOptions options)
        {
            inFilling = true;
            // TODO automap
            GroupOperator  = options.GroupOperator;
            SearchScope    = options.SearchScope;
            MinAny         = options.MinAny;
            WithConfidence = options.WithConf;
            SelectCategory(options.Categories.ToArray());

            AutocompleteAll.ReplaceTagsWith(options.CWordsAll.Union <object>(options.MeasuresAll));
            AutocompleteAny.ReplaceTagsWith(options.CWordsAny.Union <object>(options.MeasuresAny));
            AutocompleteNot.ReplaceTagsWith(options.CWordsNot);

            foreach (var opt in options.Children)
            {
                AddChildQb(opt);
            }
            inFilling = false;
        }