/// <summary> /// 画面に設定された値を指定された設定情報に反映します。 /// </summary> /// <param name="config">設定情報</param> private void Save(RectangleBalloonConfig config) { config.DisplayName = this.displayNameTextBox.Text; config.Enabled = this.enabledCheckBox.Checked; config.Width = (float)this.widthNumericUpDown.Value; config.Height = (float)this.heightNumericUpDown.Value; config.BackgroundColor = this.fillColorLabel.BackColor; config.BackgroundColor.A = (float)this.fillAlphaNumericUpDown.Value / 100.0f; config.BorderColor = this.borderColorLabel.BackColor; config.BorderColor.A = (float)this.borderAlphaNumericUpDown.Value / 100.0f; config.BorderSize = (int)this.borderSizeNumericUpDown.Value; config.FontName = this.fontNameComboBox.Text; config.FontSize = int.Parse(this.fontSizeComboBox.Text); config.FontColor = this.fontColorLabel.BackColor; }
/// <summary> /// 指定された設定情報を画面に反映します。 /// </summary> /// <param name="config">設定情報</param> private new void Load(RectangleBalloonConfig config) { this.displayNameTextBox.Text = config.DisplayName; this.enabledCheckBox.Checked = config.Enabled; this.widthNumericUpDown.Value = (decimal)config.Width; this.heightNumericUpDown.Value = (decimal)config.Height; this.fillColorLabel.BackColor = config.BackgroundColor; this.fillAlphaTrackBar.Value = (int)(config.BackgroundColor.Transparency * 100); this.fillAlphaNumericUpDown.Value = (decimal)(config.BackgroundColor.Transparency * 100); this.borderColorLabel.BackColor = config.BorderColor; this.borderAlphaTrackBar.Value = (int)(config.BorderColor.Transparency * 100); this.borderAlphaNumericUpDown.Value = (decimal)(config.BorderColor.Transparency * 100); this.borderSizeNumericUpDown.Value = (decimal)config.BorderSize; this.fontNameComboBox.Text = config.FontName; this.fontSizeComboBox.Text = config.FontSize.ToString(); this.fontColorLabel.BackColor = config.FontColor; }