예제 #1
0
        private void BtnEdit_Click(object sender, RoutedEventArgs e)
        {
            CrawlingConfig config = (CrawlingConfig)DataContext;
            CrawlingRule   rule   = (CrawlingRule)((Control)sender).DataContext;
            CrawlingRule   clone  = CrawlingConfigurationSerializer.Clone(rule);

            if (CrawlingRuleEditor.StartEditing(Window.GetWindow(this), config, clone))
            {
                int index = config.Rules.IndexOf(rule);
                config.Rules[index] = clone;
            }
        }
예제 #2
0
        private void BtnAdd_Click(object sender, RoutedEventArgs e)
        {
            CrawlingConfig config = (CrawlingConfig)DataContext;
            CrawlingRule   rule   = new CrawlingRule
            {
                Guid         = Guid.NewGuid(),
                Name         = "New rule",
                Description  = "",
                TargetBucket = config.Buckets.FirstOrDefault()
            };

            if (CrawlingRuleEditor.StartEditing(Window.GetWindow(this), config, rule))
            {
                config.Rules.Add(rule);
            }
        }