/// <summary> /// アラートメールのスレッドを閉じる /// </summary> private void StopAlertMailTask() { // アラートメールを修了する if (this.alertMailTask != null) { this.alertMailTask.Stop(); // 表示メッセージ this.toolStripStatusLabel.Text = Properties.Resources.noticeAlertMailTaskEnd; } this.alertMailTask = null; }
/// <summary> /// アラートメールのスレッドを実行する /// </summary> /// <param name="starAddress"></param> private void StartAlertMailTask(long starAddress) { if (this.alertMailTask == null || (this.alertMailTask != null && this.alertMailTask.IsReading == false)) { // TODO:Threadごとにローカル設定が必要があるため、"en"が効かない // 表示メッセージ this.toolStripStatusLabel.Text = Properties.Resources.noticeAlertMailTaskStart; // ステータスバーへのデリゲート Action <string> act = new Action <string>((msg) => { this.toolStripStatusLabel.Text = msg; }); this.alertMailTask = new AlertMailTask(this.setting.MailPatterns, this.setting.smtpSetting); this.alertMailTask.Start(this.file, starAddress, this.getPriorityEncoding(), act); } }