//----------------------- private void bnOpen_Click(object sender, EventArgs e) { // present the palette selector to the user. DialogResult result = _brushPaletteSelectionDlg.ShowDialog(); if (result != DialogResult.OK || _brushPaletteSelectionDlg.Selection == null) { return; } // select the new palette. Palette = _brushPaletteSelectionDlg.Selection; // save the fact that the user selected this palette. Bootstrap.Settings settings = Bootstrap.Settings.Get(); if (settings != null) { string paletteName = ""; if (Palette != null) { paletteName = Palette.Name; } settings.SetUserSetting("selectedbrushpalette", paletteName); settings.Save(); } }
//----------------------- void thumbnailSelector_SelectionChanged(object sender, EventArgs e) { if (!_loadingSettings) { // save the brush selection (if we're not currently loading settings). Bootstrap.Settings settings = Bootstrap.Settings.Get(); if (settings != null) { Bootstrap.Brush selection = this.Selection; string brush = ""; if (selection != null) { brush = selection.Name; } settings.SetUserSetting("selectedbrush", brush); settings.Save(); } } // notify others that the selection has changed. if (SelectionChanged != null) { SelectionChanged(sender, e); } // close the "edit brush" popup. popupEditBrush.Close(); }