Пример #1
0
        private void SelectColorButton(object sender, RoutedEventArgs e)
        {
            Filter       f = (sender as Button).DataContext as Filter;
            ColorControl c = new ColorControl();

            c.Show_Only_Color = true;
            if (f is BackgroundColorFilter)
            {
                BackgroundColorFilter b = f as BackgroundColorFilter;
                c.ColorPicker.SelectedColor = FieldPlanDocument.SDtoSM(b.color);
                if (c.ShowDialog() == true)
                {
                    b.color = FieldBlockViewer.SMtoSD(c.ColorPicker.SelectedColor);
                }
            }
            if (f is ReplaceFilter)
            {
                ReplaceFilter b = f as ReplaceFilter;
                if ((sender as Button).ToolTip.ToString() == "First Color")
                {
                    c.ColorPicker.SelectedColor = FieldPlanDocument.SDtoSM(b.source);
                    if (c.ShowDialog() == true)
                    {
                        b.source = FieldBlockViewer.SMtoSD(c.ColorPicker.SelectedColor);
                    }
                }
                else
                {
                    c.ColorPicker.SelectedColor = FieldPlanDocument.SDtoSM(b.target);
                    if (c.ShowDialog() == true)
                    {
                        b.target = FieldBlockViewer.SMtoSD(c.ColorPicker.SelectedColor);
                    }
                }
            }
            if (f is TintFilter)
            {
                TintFilter b = f as TintFilter;
                c.ColorPicker.SelectedColor = FieldPlanDocument.SDtoSM(b.color);
                if (c.ShowDialog() == true)
                {
                    b.color = FieldBlockViewer.SMtoSD(c.ColorPicker.SelectedColor);
                }
            }
            if (f is VignetteFilter)
            {
                VignetteFilter b = f as VignetteFilter;
                c.ColorPicker.SelectedColor = FieldPlanDocument.SDtoSM(b.color);
                if (c.ShowDialog() == true)
                {
                    b.color = FieldBlockViewer.SMtoSD(c.ColorPicker.SelectedColor);
                }
            }
            Redraw();
            OnPropertyChanged(null);
        }
Пример #2
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            if (basedoc.ColorList == null)
            {
                this.Title = "Edit Structure Protocol";
            }
            else
            {
                this.Title = "Edit Field Protocol";
            }
            fpd = new FieldPlanDocument(basedoc);

            this.DataContext = fpd;
        }
Пример #3
0
        private void SaveSettingsGlobal(object sender, RoutedEventArgs e)
        {
            FieldPlanDocument fpd = ((FieldPlanDocument)this.DataContext);

            Properties.Settings.Default.FieldPlanHideText       = fpd.hide_text;
            Properties.Settings.Default.FieldPlanForeColorMode  = fpd.fore_color_mode.ToString();
            Properties.Settings.Default.FieldPlanBackColorMode  = fpd.back_color_mode.ToString();
            Properties.Settings.Default.FieldPlanFixedBackColor = FieldPlanDocument.SMtoSD(fpd.fixed_back_color);
            Properties.Settings.Default.FieldPlanFixedForeColor = FieldPlanDocument.SMtoSD(fpd.fixed_fore_color);
            Properties.Settings.Default.FieldPlanFormatString   = fpd.text_format;
            Properties.Settings.Default.FieldPlanPropertyMode   = fpd.summary_selection.ToString();
            Properties.Settings.Default.FieldPlanRegex          = fpd.text_regex;
            Properties.Settings.Default.TemplateLength          = fpd.template_length;
            Properties.Settings.Default.Save();
        }
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     p = FieldPlanDocument.CalculateFieldplan(field, BlockSize);
     ReDraw();
     MaxRows.Content = p.colors.GetLength(0);
 }
Пример #5
0
        private void SaveXLSX(object sender, RoutedEventArgs e)
        {
            FieldPlanDocument d = this.DataContext as FieldPlanDocument;

            d.SaveXLSXDocument();
        }