private void invisibleViewerButton_CheckedChanged(object sender, EventArgs e) { if (invisibleViewerButton.Checked) { // 非表示にする if (ReadSetting.Setting.MessageListRightList) { splitContainer1.Panel1Collapsed = true; } else { splitContainer1.Panel2Collapsed = true; } invisibleViewerButton.Image = icons.application_side_contract; browserViewButton.Visible = false; } else { // 表示する if (ReadSetting.Setting.MessageListRightList) { splitContainer1.Panel1Collapsed = false; } else { splitContainer1.Panel2Collapsed = false; } invisibleViewerButton.Image = icons.application_side_expand; browserViewButton.Visible = true; } ReadSetting.Setting.MessageListInvisibleViewer = invisibleViewerButton.Checked; ReadSetting.Save(); }
private void frmMessageViewer_FormClosing(object sender, FormClosingEventArgs e) { // 設定保存 ConfigData cd = ReadSetting.Setting; cd.MessageListTopMost = topMostButton.Checked; cd.MessageBoxPositionSize = new Rectangle(this.Location, this.Size); cd.MessageListLeftWidth = splitContainer1.SplitterDistance; cd.MessageListWindowOpacity = this.Opacity; ReadSetting.Setting = cd; ReadSetting.Save(); }
public frmMessageViewer() { InitializeComponent(); ReadSetting.Read(); this.Size = ReadSetting.Setting.MessageBoxPositionSize.Size; this.Location = ReadSetting.Setting.MessageBoxPositionSize.Location; this.invisibleViewerButton.Checked = ReadSetting.Setting.MessageListInvisibleViewer; this.splitContainer1.SplitterDistance = ReadSetting.Setting.MessageListLeftWidth; this.Opacity = ReadSetting.Setting.MessageListWindowOpacity; this.windowOpacityMenues(ReadSetting.Setting.MessageListWindowOpacity); messageViewerBox.StatusTextChanged += new EventHandler(messageViewerBox_StatusTextChanged); }
private void frmMessageViewer_FormClosing(object sender, FormClosingEventArgs e) { Program.WriteLog("frmMessageViewer_e.CloseReason == " + e.CloseReason.ToString()); Program.WriteLog("Program.SystemShutown == " + Program.SystemShutdown.ToString()); if ((Program.SystemShutdown) || ((e.CloseReason | CloseReason.FormOwnerClosing) == CloseReason.FormOwnerClosing) || ((e.CloseReason | CloseReason.WindowsShutDown) == CloseReason.WindowsShutDown)) { Program.WriteLog("メッセージ一覧閉じるよ!"); e.Cancel = false; } else if (!(Program.SystemShutdown) || ((e.CloseReason | CloseReason.UserClosing) == CloseReason.UserClosing) || ((e.CloseReason | CloseReason.None) == CloseReason.None)) { Program.WriteLog("メッセージ一覧閉じないよ!"); // ブラウザオブジェクトを空にしとく this.messageViewerBox.Navigate("about:blank"); // 設定保存 ConfigData cd = ReadSetting.Setting; cd.MessageListTopMost = topMostButton.Checked; cd.MessageBoxPositionSize = new Rectangle(this.Location, this.Size); cd.MessageListLeftWidth = splitContainer1.SplitterDistance; cd.MessageListWindowOpacity = this.Opacity; ReadSetting.Setting = cd; ReadSetting.Save(); checkSpamButton.Checked = false; e.Cancel = true; this.Hide(); // ガベージコレクション強制実行 GC.Collect(); #if DEBUG Console.WriteLine("メッセージ一覧クローズ時: " + GC.GetTotalMemory(false)); #endif } }
private void Save() { // 2番目 Account a = new Account { SetName = "既定", AccountName = scAccountBox.Text, Domain = scDomainBox.Text, Password = Password.Encrypt(scPassBox.Text, scAccountBox.Text) }; cd.Accounts.Add(a); // 3番目 cd.MailCheckInterval = (int)thIntervalBox.Value * 60 * 1000; // 4番目 cd.NewMailBalloonOrPopupNotify = true; cd.NewMailNotifyOperation = foBalloonCheck.Checked ? ConfigData.NewMailNotification.Balloon : ConfigData.NewMailNotification.Popup; // 5番目 cd.PlayNewMailSound = fiSoundUseCheck.Checked; cd.PlayDefaultNewMailSound = fiDefaultSoundCheck.Checked; cd.PlayNewMailSoundPath = fiSelectSoundPathBox.Text; ReadSetting.Setting = cd; ReadSetting.Save(); }
private void frmSetting_Load(object sender, EventArgs e) { // フォーム上に反映 s_config = ReadSetting.Read(); // アカウント foreach (Account a in s_config.Accounts) { accountListBox.Items.Add((string)a.SetName + " (" + a.AccountName + "@" + a.Domain + ")"); } // メールチェック mailMailCheckNumeric.Value = (decimal)s_config.MailCheckInterval / 1000 / 60; mailPowerResumedDelayNumeric.Value = (decimal)s_config.PowerResumedDelayTime / 1000; // プロキシ proxyUseProxyCheck.Checked = s_config.UseProxy; proxyUseIeProxyCheck.Checked = s_config.UseIeProxy; proxyUseSelectProxyCheck.Checked = s_config.UseIeProxy ? false : true; proxySelectProxyBox.Text = s_config.ProxyHostName; proxySelectPortNumeric.Value = (decimal)s_config.ProxyPort; // アクセス accessNoSslCheck.Checked = s_config.NoUseSsl; // サウンド soundUseNewMailSoundCheck.Checked = s_config.PlayNewMailSound; soundUseDefaultNewMailSoundCheck.Checked = s_config.PlayDefaultNewMailSound; soundUseSelectNewMailSoundCheck.Checked = s_config.PlayDefaultNewMailSound ? false : true; soundSelectSoundFileBox.Text = s_config.PlayNewMailSoundPath; // 新着通知 newNotifyBalloonCheck.Checked = s_config.NewMailBalloonOrPopupNotify; newRunApplicationCheck.Checked = s_config.NewMailBalloonOrPopupNotify ? false : true; newNotifySelectBox.SelectedIndex = (int)s_config.NewMailNotifyOperation; newNotifySelectBox.Enabled = Program.EnableBalloon; newNotifyClickBox.SelectedIndex = (int)s_config.BalloonClickOperation; newSelectRunApplicationFileBox.Text = s_config.RunApplicationPath; newSelectRunApplicationOptionBox.Text = s_config.RunApplicationOption; popupViewTimeBox.Value = s_config.PopupViewTime / 1000; notifyClickApplicationBox.Text = s_config.NotificationRunExecutiveFilePath; // 表示 balloonInvisibleErrorCheck.Checked = s_config.BalloonInvisibleError; // ブラウザ browserUseDefaultBrowserCheck.Checked = s_config.UseDefaultBrowser; browserUseSelectBrowserCheck.Checked = !s_config.UseDefaultBrowser; browserSelectFileBox.Text = s_config.UseBrowserPath; // メッセージ一覧 messageListFontSettingLabel.Text = string.Format(Properties.Resources.SettingMessageListFontInfo, s_config.MessageListFont.Name, s_config.MessageListFont.Size.ToString()); messageListFontDialog.Font = s_config.MessageListFont; titleColorPick.BackColor = s_config.MessageListTitleColor; senderColorPick.BackColor = s_config.MessageListSenderColor; summaryColorPick.BackColor = s_config.MessageListSummaryColor; nonSelectColorPick.BackColor = s_config.MessageListNonSelectColor; nonSelectOddColorPick.BackColor = s_config.MessageListNonSelectOddColor; selectColorPick.BackColor = s_config.MessageListSelectColor; messageListSenderFontSizeBox.Value = (decimal)s_config.MessageListSenderFontSize; messageListRightCheck.Checked = s_config.MessageListRightList; // メインコンソール hideConsoleCheck.Checked = s_config.HideConsole; // 通知領域設定 notifyDoubleClickBox.SelectedIndex = (int)s_config.NotifyDoubleClickOperation; disableAnimationCheck.Checked = s_config.DisableNotifyAnimation; // スタートアップ shortcutButtonSetting(); // チェックボックス関連の強制実行 proxyUseProxyCheck_CheckedChanged(null, null); proxyUseIeProxyCheck_CheckedChanged(null, null); accountListBox_SelectedIndexChanged(null, null); newNotifyClickBox_SelectedIndexChanged(null, null); soundUseDefaultNewMailSoundCheck_CheckedChanged(null, null); soundUseNewMailSoundCheck_CheckedChanged(null, null); // メッセージ一覧表示プレビューで、2項目目を選択した状態にしておく messageListPreviewBox.SelectedIndex = 1; // アカウント設定が0だったら、閉じれないようにしておく formCloseAdmit(); // フォーカスをタブに tabControl1.Focus(); }
private void okButton_Click(object sender, EventArgs e) { // アカウント設定がなければ警告する if (accountListBox.Items.Count == 0) { MessageBox.Show(Properties.Resources.SettingNoAccountError, Properties.Resources.SoftwareName, MessageBoxButtons.OK, MessageBoxIcon.Error); return; } // 設定を格納 // メールチェック s_config.MailCheckInterval = (int)mailMailCheckNumeric.Value * 1000 * 60; s_config.PowerResumedDelayTime = (int)mailPowerResumedDelayNumeric.Value * 1000; // プロキシ s_config.UseProxy = proxyUseProxyCheck.Checked; s_config.UseIeProxy = proxyUseIeProxyCheck.Checked; s_config.UseIeProxy = proxyUseSelectProxyCheck.Checked ? false : true; s_config.ProxyHostName = proxySelectProxyBox.Text; s_config.ProxyPort = (int)proxySelectPortNumeric.Value; // アクセス s_config.NoUseSsl = accessNoSslCheck.Checked; // サウンド s_config.PlayNewMailSound = soundUseNewMailSoundCheck.Checked; s_config.PlayDefaultNewMailSound = soundUseDefaultNewMailSoundCheck.Checked; s_config.PlayDefaultNewMailSound = soundUseSelectNewMailSoundCheck.Checked ? false : true; s_config.PlayNewMailSoundPath = soundSelectSoundFileBox.Text; // 新着通知 s_config.NewMailBalloonOrPopupNotify = newNotifyBalloonCheck.Checked; s_config.NewMailBalloonOrPopupNotify = newRunApplicationCheck.Checked ? false : true; s_config.NewMailNotifyOperation = (ConfigData.NewMailNotification)newNotifySelectBox.SelectedIndex; s_config.BalloonClickOperation = (ConfigData.BalloonClick)newNotifyClickBox.SelectedIndex; s_config.NotificationRunExecutiveFilePath = notifyClickApplicationBox.Text; s_config.RunApplicationPath = newSelectRunApplicationFileBox.Text; s_config.RunApplicationOption = newSelectRunApplicationOptionBox.Text; s_config.PopupViewTime = (int)popupViewTimeBox.Value * 1000; s_config.NotificationRunExecutiveFilePath = notifyClickApplicationBox.Text; // 表示 s_config.BalloonInvisibleError = balloonInvisibleErrorCheck.Checked; // ブラウザ s_config.UseDefaultBrowser = browserUseDefaultBrowserCheck.Checked; s_config.UseDefaultBrowser = browserUseSelectBrowserCheck.Checked ? false : true; s_config.UseBrowserPath = browserSelectFileBox.Text; // メッセージ一覧 s_config.MessageListTitleColor = titleColorPick.BackColor; s_config.MessageListSenderColor = senderColorPick.BackColor; s_config.MessageListSummaryColor = summaryColorPick.BackColor; s_config.MessageListNonSelectColor = nonSelectColorPick.BackColor; s_config.MessageListNonSelectOddColor = nonSelectOddColorPick.BackColor; s_config.MessageListSelectColor = selectColorPick.BackColor; s_config.MessageListSenderFontSize = (float)messageListSenderFontSizeBox.Value; s_config.MessageListRightList = messageListRightCheck.Checked; // メインコンソール s_config.HideConsole = hideConsoleCheck.Checked; // 通知領域 s_config.NotifyDoubleClickOperation = (ConfigData.NotifyDoubleClick)notifyDoubleClickBox.SelectedIndex; s_config.DisableNotifyAnimation = disableAnimationCheck.Checked; ReadSetting.Setting = s_config; // 設定を保存 ReadSetting.Save(); this.DialogResult = DialogResult.OK; this.Close(); }