public SettingsDialog(GasketSettings settings)
        {
            InitializeComponent();

            Settings = settings;
            SetDialogChildControlValues();
        }
Beispiel #2
0
        public MainWindow(UserSettings userSettings)
        {
            InitializeComponent();

            UserSettings   = userSettings;
            GasketSettings = new GasketSettings(UserSettings);
        }
 public SierpinskiGasket(GasketSettings settings)
 {
     Level           = settings.Levels;
     ForegroundColor = new SolidColorBrush(settings.BorderColor);
     BackgroundColor = new SolidColorBrush(settings.BackgroundColor);
     GasketFill      = new SolidColorBrush(settings.FillColor);
     LineWidth       = settings.LineWidth;
     Points          = settings.Points;
     Count           = 0;
 }
        private void OnSettingsOKClick(object sender, RoutedEventArgs e)
        {
            Color?borderColor     = BorderColorPicker.SelectedColor;
            Color?backgroundColor = BackgroundColorPicker.SelectedColor;
            Color?fillColor       = FillColorPicker.SelectedColor;

            double?lineWidth = (double)LineThicknessDecimalUpDown.Value;
            int?   levels    = (int)LevelsDecimalUpDown.Value;

            if (borderColor.HasValue && backgroundColor.HasValue &&
                fillColor.HasValue && lineWidth.HasValue && levels.HasValue)
            {
                Settings = new GasketSettings(levels.Value, borderColor.Value,
                                              fillColor.Value, backgroundColor.Value,
                                              lineWidth.Value, Settings.Points);

                DialogResult = true;
                Close();
            }
        }
Beispiel #5
0
        private void UpdateGasketSettings()
        {
            var settingsDialog = new SettingsDialog(GasketSettings)
            {
                Owner = this
            };

            bool?settingsChanaged = settingsDialog.ShowDialog();

            if (settingsChanaged.HasValue && settingsChanaged.Value == true)
            {
                GasketSettings = settingsDialog.Settings;
                DrawGasket();

                UserSettings = new UserSettings()
                {
                    Levels          = GasketSettings.Levels,
                    LineWidth       = GasketSettings.LineWidth,
                    BorderColor     = GasketSettings.BorderColor,
                    BackgroundColor = GasketSettings.BackgroundColor,
                    FillColor       = GasketSettings.FillColor
                };
            }
        }