Пример #1
0
        // Internals

        private void AddFilter(object o)
        {
            var l = o as ObservableCollection <string>;
            var s = new StringContainer();

            var  dialog = new AddFilterDialog(s);
            bool?res    = dialog.ShowDialog();

            if (!(res == null || !res.Value))
            {
                if (l != null && !(l.Contains(s.Value)))
                {
                    l.Add(s.Value);
                }
            }
        }
Пример #2
0
        private void AddFilter([NotNull] object sender, [NotNull] RoutedEventArgs e)
        {
            Debug.ArgumentNotNull(sender, nameof(sender));
            Debug.ArgumentNotNull(e, nameof(e));

            var dialog = new AddFilterDialog
            {
                DatabaseUri = DatabaseUri
            };

            if (!dialog.ShowDialog())
            {
                return;
            }

            var customFilter = new CustomRenderingSelectorFilter(dialog.FilterName ?? string.Empty, dialog.FilterText ?? string.Empty, dialog.RootPath ?? string.Empty);

            customFilter.SetRenderings(renderings);

            RenderingSelectorFilters.Add(customFilter);

            SaveFilters();
            RenderFilters(customFilter.Name);
        }