Example #1
0
        /// <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);
        }