コード例 #1
0
        private void Add_Click(object sender, RoutedEventArgs e)
        {
            var dlg = new FilterWindow(new Filter());

            dlg.Owner = this;
            if (!dlg.ShowDialog().GetValueOrDefault())
            {
                return;
            }

            bool added = App.Current.Settings.AddFilter(null, dlg.Filter);

            App.Current.Settings.SerializeToConfiguration();
            if (added)
            {
                _context.Filters.Add(dlg.Filter);
            }
        }
コード例 #2
0
        private void ModifyFilter(Filter filter)
        {
            if (filter == null)
            {
                return;
            }

            var dlg = new FilterWindow(filter.Clone());

            dlg.Owner = this;
            if (!dlg.ShowDialog().GetValueOrDefault())
            {
                return;
            }

            App.Current.Settings.AddFilter(filter, dlg.Filter);
            App.Current.Settings.SerializeToConfiguration();
        }