/// <summary> /// Formが閉じられる時に発生するイベントメソッド /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void MainForm_FormClosing(object sender, FormClosingEventArgs e) { if (e.CloseReason == CloseReason.UserClosing) { e.Cancel = true; Hide(); return; } // フォームデータ保存 FormConfig formConfig = new FormConfig { excludeOwnerComment = excludeOwnerComment.Checked, No2AsNo1Comment = No2AsNo1Comment.Checked, ReplyCommentToggle = ReplyCommentToggle.Checked, ReplyCommentText = ReplyCommentTextBox.Text }; AppConfigIO.SaveFormData(_Host.DirectoryPathAppSetting, formConfig); // 履歴データ保存 AppConfigIO.SaveHistoryData(_Host.DirectoryPathAppSetting, _HistoryDataList); }
/// <summary> /// コンストラクタ /// </summary> /// <param name="host">プラグインホスト</param> public MainForm(IPluginHost host) { InitializeComponent(); _Host = host; // フォームデータ読み込み FormConfig formConfig = AppConfigIO.LoadFormData(_Host.DirectoryPathAppSetting); if (formConfig != null) { excludeOwnerComment.Checked = formConfig.excludeOwnerComment; No2AsNo1Comment.Checked = formConfig.No2AsNo1Comment; ReplyCommentToggle.Checked = formConfig.ReplyCommentToggle; ReplyCommentTextBox.Text = formConfig.ReplyCommentText; } // 履歴データ読み込み _HistoryDataList = AppConfigIO.LoadHistoryData(_Host.DirectoryPathAppSetting); HistoryView.DataSource = _HistoryDataList; // イベント設定 _Host.ReceivedComment += new ReceivedCommentEventHandler(_Host_ReceivedComment); }