private void tagButton_Click(object sender, EventArgs e) { var location = PointToScreen(tagButton.Location); using (var dialog = new TagPickerDialog( location.X + tagButton.Bounds.Location.X - tagButton.Width, location.Y + tagButton.Bounds.Location.Y)) { if (dialog.ShowDialog(this) == DialogResult.OK) { var glyph = dialog.GetGlyph(); if (glyph != null) { tagButton.Text = null; tagButton.Image = glyph; } else { tagButton.Text = "?"; } TagSymbol = dialog.Symbol; } } }
private void RestoreSettings() { var provider = new SettingsProvider(); var settings = provider.GetCollection("outline"); if (settings != null) { numberingBox.Checked = settings.Get <bool>("addNumbering"); if (numberingBox.Checked) { alphaRadio.Checked = settings.Get <bool>("alphaNumbering"); numRadio.Checked = settings.Get <bool>("numericNumbering"); } cleanBox.Checked = settings.Get <bool>("cleanupNumbering"); indentBox.Checked = settings.Get <bool>("indent"); indentTagBox.Checked = settings.Get <bool>("indentTagged"); if (indentTagBox.Checked) { removeTagsBox.Checked = settings.Get <bool>("removeTags"); TagSymbol = settings.Get <int>("tagSymbol"); if (TagSymbol > 0) { using (var dialog = new TagPickerDialog(0, 0)) { var glyph = dialog.GetGlyph(TagSymbol); if (glyph != null) { tagButton.Text = null; tagButton.Image = glyph; } } } } } }