1 // ================================================================================================
3 // Wikipedia翻訳支援ツール主画面クラスソース</summary>
5 // <copyright file="MainForm.cs" company="honeplusのメモ帳">
6 // Copyright (C) 2012 Honeplus. All rights reserved.</copyright>
9 // ================================================================================================
11 namespace Honememo.Wptscs
14 using System.Collections.Generic;
15 using System.ComponentModel;
21 using System.Threading;
22 using System.Windows.Forms;
23 using Honememo.Utilities;
24 using Honememo.Wptscs.Logics;
25 using Honememo.Wptscs.Models;
26 using Honememo.Wptscs.Properties;
27 using Honememo.Wptscs.Utilities;
28 using Honememo.Wptscs.Websites;
31 /// Wikipedia翻訳支援ツール主画面のクラスです。
33 public partial class MainForm : Form
38 /// 現在読み込んでいるアプリケーションの設定。
40 private Config config;
45 private Translator translator;
50 private int logLength;
57 /// コンストラクタ。初期化メソッド呼び出しのみ。
61 // Windows フォーム デザイナで生成されたコード
62 this.InitializeComponent();
67 #region フォームの各イベントのメソッド
72 /// <param name="sender">イベント発生オブジェクト。</param>
73 /// <param name="e">発生したイベント。</param>
74 private void MainForm_Load(object sender, EventArgs e)
77 Control.CheckForIllegalCrossThreadCalls = false;
79 // 表示言語選択メニュー、設定選択メニューの初期設定
80 this.InitializeDropDownButtonLanguage();
81 this.InitializeDropDownButtonConfig();
83 // 設定ファイルの読み込みと関連項目の初期設定
84 this.InitializeByConfig();
87 this.textBoxSaveDirectory.Text = Settings.Default.SaveDirectory;
91 /// フォームクローズ時の処理。処理状態を保存。
93 /// <param name="sender">イベント発生オブジェクト。</param>
94 /// <param name="e">発生したイベント。</param>
95 private void MainForm_FormClosed(object sender, FormClosedEventArgs e)
97 // 現在の出力先フォルダ、翻訳元/先言語、
98 // また更新されていれば表示言語や設定ファイルの選択を保存
100 Settings.Default.Save();
105 #region 翻訳元/先言語グループのイベントのメソッド
108 /// 翻訳元コンボボックス変更時の処理。
110 /// <param name="sender">イベント発生オブジェクト。</param>
111 /// <param name="e">発生したイベント。</param>
112 private void ComboBoxSource_SelectedIndexChanged(object sender, EventArgs e)
115 Website site = this.config.GetWebsite(this.comboBoxSource.Text);
116 this.SetLanguageNameLabel(this.labelSource, site);
119 this.linkLabelSourceURL.Text = "http://";
122 this.linkLabelSourceURL.Text = site.Location;
127 /// リンクラベルのリンククリック時の処理。
129 /// <param name="sender">イベント発生オブジェクト。</param>
130 /// <param name="e">発生したイベント。</param>
131 private void LinkLabelSourceURL_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
134 System.Diagnostics.Process.Start(((LinkLabel)sender).Text);
138 /// 翻訳先コンボボックス変更時の処理。
140 /// <param name="sender">イベント発生オブジェクト。</param>
141 /// <param name="e">発生したイベント。</param>
142 private void ComboBoxTarget_SelectedIndexChanged(object sender, EventArgs e)
145 this.SetLanguageNameLabel(this.labelTarget, this.config.GetWebsite(this.comboBoxTarget.Text));
151 /// <param name="sender">イベント発生オブジェクト。</param>
152 /// <param name="e">発生したイベント。</param>
153 private void ButtonConfig_Click(object sender, EventArgs e)
159 using (ConfigForm form = new ConfigForm(this.config))
164 // 戻ってきたら設定ファイルを再読み込みして表示を更新
165 // ※ キャンセル時もインスタンスは更新されてしまうので
166 this.InitializeByConfig();
169 #region イベント実装支援用メソッド
172 /// 翻訳元/先言語コンボボックスの初期化処理。
174 private void InitializeComboBox()
177 this.comboBoxSource.Items.Clear();
178 this.comboBoxTarget.Items.Clear();
180 // 設定ファイルに存在する全言語を選択肢として登録する
181 foreach (Website site in this.config.Websites)
183 this.comboBoxSource.Items.Add(site.Language.Code);
184 this.comboBoxTarget.Items.Add(site.Language.Code);
188 this.comboBoxSource.SelectedItem = Settings.Default.LastSelectedSource;
189 this.comboBoxTarget.SelectedItem = Settings.Default.LastSelectedTarget;
192 // ※ 項目が存在する場合は↑で自動的に呼ばれるが、無い場合は呼ばれないため
193 this.ComboBoxSource_SelectedIndexChanged(this.comboBoxSource, new EventArgs());
194 this.ComboBoxTarget_SelectedIndexChanged(this.comboBoxTarget, new EventArgs());
198 /// ウェブサイトの言語の表示名ラベルの表示を設定する。
200 /// <param name="label">言語の表示名用ラベル。</param>
201 /// <param name="site">選択されている言語のウェブサイト。</param>
202 private void SetLanguageNameLabel(Label label, Website site)
205 label.Text = String.Empty;
211 // ウェブサイトが空でない場合、その言語の、ユーザーが使用している言語での表示名を表示
212 // (日本語環境だったら日本語を、英語環境だったら英語を)
213 Language.LanguageName name;
214 if (site.Language.Names.TryGetValue(
215 Thread.CurrentThread.CurrentUICulture.TwoLetterISOLanguageName,
218 label.Text = name.Name;
226 #region フォルダの選択グループのイベントのメソッド
231 /// <param name="sender">イベント発生オブジェクト。</param>
232 /// <param name="e">発生したイベント。</param>
233 private void ButtonSaveDirectory_Click(object sender, EventArgs e)
235 // フォルダ名が入力されている場合、それを初期位置に設定
236 if (!String.IsNullOrEmpty(this.textBoxSaveDirectory.Text))
238 this.folderBrowserDialogSaveDirectory.SelectedPath = this.textBoxSaveDirectory.Text;
242 if (this.folderBrowserDialogSaveDirectory.ShowDialog() == System.Windows.Forms.DialogResult.OK)
244 // フォルダが選択された場合、フォルダ名に選択されたフォルダを設定
245 this.textBoxSaveDirectory.Text = this.folderBrowserDialogSaveDirectory.SelectedPath;
250 /// 出力先テキストボックスフォーカス喪失時の処理。
252 /// <param name="sender">イベント発生オブジェクト。</param>
253 /// <param name="e">発生したイベント。</param>
254 private void TextBoxSaveDirectory_Leave(object sender, EventArgs e)
257 this.textBoxSaveDirectory.Text = this.textBoxSaveDirectory.Text.Trim();
262 #region 記事を指定して実行グループのイベントのメソッド
267 /// <param name="sender">イベント発生オブジェクト。</param>
268 /// <param name="e">発生したイベント。</param>
269 private void ButtonRun_Click(object sender, EventArgs e)
272 if (String.IsNullOrWhiteSpace(this.comboBoxSource.Text))
274 FormUtils.WarningDialog(Resources.WarningMessageNotSelectedSource);
275 this.comboBoxSource.Focus();
278 else if (String.IsNullOrWhiteSpace(this.comboBoxTarget.Text))
280 FormUtils.WarningDialog(Resources.WarningMessageNotSelectedTarget);
281 this.comboBoxTarget.Focus();
284 else if (!String.IsNullOrWhiteSpace(this.comboBoxSource.Text)
285 && this.comboBoxSource.Text == this.comboBoxTarget.Text)
287 FormUtils.WarningDialog(Resources.WarningMessageEqualsSourceAndTarget);
288 this.comboBoxTarget.Focus();
291 else if (String.IsNullOrWhiteSpace(this.textBoxSaveDirectory.Text))
293 FormUtils.WarningDialog(Resources.WarningMessageEmptySaveDirectory);
294 this.textBoxSaveDirectory.Focus();
297 else if (!Directory.Exists(this.textBoxSaveDirectory.Text))
299 FormUtils.WarningDialog(Resources.WarningMessageIgnoreSaveDirectory);
300 this.textBoxSaveDirectory.Focus();
303 else if (String.IsNullOrWhiteSpace(this.textBoxArticle.Text))
305 FormUtils.WarningDialog(Resources.WarningMessageEmptyArticle);
306 this.textBoxArticle.Focus();
311 this.LockOperation();
314 this.backgroundWorkerRun.RunWorkerAsync();
320 /// <param name="sender">イベント発生オブジェクト。</param>
321 /// <param name="e">発生したイベント。</param>
322 private void ButtonStop_Click(object sender, EventArgs e)
325 this.buttonStop.Enabled = false;
326 if (this.backgroundWorkerRun.IsBusy == true)
328 System.Diagnostics.Debug.WriteLine("MainForm.-Stop_Click > 処理中断");
329 this.backgroundWorkerRun.CancelAsync();
330 if (this.translator != null)
332 this.translator.CancellationPending = true;
338 /// 実行ボタン バックグラウンド処理(スレッド)。
340 /// <param name="sender">イベント発生オブジェクト。</param>
341 /// <param name="e">発生したイベント。</param>
342 private void BackgroundWorkerRun_DoWork(object sender, DoWorkEventArgs e)
346 // 初期化と開始メッセージ、別スレッドになるので表示言語も再度設定
347 Program.LoadSelectedCulture();
348 this.textBoxLog.Clear();
350 this.textBoxLog.AppendText(String.Format(Resources.LogMessageStart, FormUtils.ApplicationName(), DateTime.Now));
352 // 翻訳支援処理ロジックのオブジェクトを生成
353 this.translator = Translator.Create(this.config, this.comboBoxSource.Text, this.comboBoxTarget.Text);
355 // ログ・処理状態更新通知を受け取るためのイベント登録
357 this.translator.LogUpdate += new EventHandler(this.GetLogUpdate);
358 this.translator.StatusUpdate += new EventHandler(this.GetStatusUpdate);
359 this.Invoke((MethodInvoker)delegate { this.timerStatusStopwatch.Start(); });
365 this.translator.Run(this.textBoxArticle.Text.Trim());
367 catch (ApplicationException)
369 // 中止要求で停止した場合、その旨イベントに格納する
370 e.Cancel = this.backgroundWorkerRun.CancellationPending;
376 this.Invoke((MethodInvoker)delegate { this.timerStatusStopwatch.Stop(); });
379 // 実行結果から、ログと変換後テキストをファイル出力
380 this.WriteResult(success);
382 catch (WebException ex)
384 // 想定外の通信エラー(↓とまとめてもよいが、こちらはサーバーの状況などで発生しやすいので)
385 this.textBoxLog.AppendText(Environment.NewLine + String.Format(Resources.ErrorMessageConnectionFailed, ex.Message) + Environment.NewLine);
386 if (ex.Response != null)
388 // 出せるならエラーとなったURLも出力
389 this.textBoxLog.AppendText(Resources.RightArrow + " " + String.Format(Resources.LogMessageErrorURL, ex.Response.ResponseUri) + Environment.NewLine);
395 this.textBoxLog.AppendText(Environment.NewLine + String.Format(Resources.ErrorMessageDevelopmentError, ex.Message, ex.StackTrace) + Environment.NewLine);
400 /// 実行ボタン バックグラウンド処理(終了時)。
402 /// <param name="sender">イベント発生オブジェクト。</param>
403 /// <param name="e">発生したイベント。</param>
404 private void BackgroundWorkerRun_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
407 // ※ 微妙に時間がかかるので、ステータスバーに通知
410 this.toolStripStatusLabelStatus.Text = Resources.StatusCacheUpdating;
417 this.toolStripStatusLabelStatus.Text = String.Empty;
422 FormUtils.WarningDialog(
423 Resources.WarningMessageCacheSaveFailed,
431 #region イベント実装支援用メソッド
436 private void LockOperation()
439 this.groupBoxTransfer.Enabled = false;
440 this.groupBoxSaveDirectory.Enabled = false;
441 this.textBoxArticle.Enabled = false;
442 this.buttonRun.Enabled = false;
443 this.toolStripDropDownButtonLanguage.Enabled = false;
444 this.toolStripDropDownButtonConfig.Enabled = false;
447 this.buttonStop.Enabled = true;
453 private void Release()
456 this.buttonStop.Enabled = false;
459 this.groupBoxTransfer.Enabled = true;
460 this.groupBoxSaveDirectory.Enabled = true;
461 this.textBoxArticle.Enabled = true;
462 this.buttonRun.Enabled = true;
463 this.toolStripDropDownButtonLanguage.Enabled = true;
464 this.toolStripDropDownButtonConfig.Enabled = true;
468 /// 翻訳支援処理のログ・変換後テキストをファイル出力。
470 /// <param name="success">翻訳支援処理が成功した場合<c>true</c>。</param>
471 private void WriteResult(bool success)
473 // 若干時間がかかるのでステータスバーに通知
474 this.toolStripStatusLabelStatus.Text = Resources.StatusFileWriting;
480 this.MakeFileName(out fileName, out logName, this.textBoxArticle.Text.Trim(), this.textBoxSaveDirectory.Text);
484 // 翻訳支援処理成功時は変換後テキストを出力
487 File.WriteAllText(Path.Combine(this.textBoxSaveDirectory.Text, fileName), this.translator.Text);
488 this.textBoxLog.AppendText(String.Format(Resources.LogMessageEnd, fileName, logName));
492 this.textBoxLog.AppendText(String.Format(Resources.LogMessageFileSaveFailed, Path.Combine(this.textBoxSaveDirectory.Text, fileName), ex.Message));
493 this.textBoxLog.AppendText(String.Format(Resources.LogMessageStop, logName));
498 this.textBoxLog.AppendText(String.Format(Resources.LogMessageStop, logName));
504 File.WriteAllText(Path.Combine(this.textBoxSaveDirectory.Text, logName), this.textBoxLog.Text);
508 this.textBoxLog.AppendText(String.Format(Resources.LogMessageFileSaveFailed, Path.Combine(this.textBoxSaveDirectory.Text, logName), ex.Message));
514 this.toolStripStatusLabelStatus.Text = String.Empty;
519 /// 渡された文字列から.txtと.logの重複していないファイル名を作成。
521 /// <param name="fileName">出力結果ファイル名。</param>
522 /// <param name="logName">出力ログファイル名。</param>
523 /// <param name="text">出力する結果テキスト。</param>
524 /// <param name="dir">出力先ディレクトリ。</param>
525 /// <returns><c>true</c> 出力成功</returns>
526 private bool MakeFileName(out string fileName, out string logName, string text, string dir)
528 // 出力先フォルダに存在しないファイル名(の拡張子より前)を作成
529 // ※渡されたWikipedia等の記事名にファイル名に使えない文字が含まれている場合、_ に置き換える
530 // また、ファイル名が重複している場合、xx[0].txtのように連番を付ける
531 string fileNameBase = FormUtils.ReplaceInvalidFileNameChars(text);
532 fileName = fileNameBase + ".txt";
533 logName = fileNameBase + ".log";
534 bool success = false;
535 for (int i = 0; i < 100000; i++)
537 // ※ 100000まで試して空きが見つからないことは無いはず、もし見つからなかったら最後のを上書き
538 if (!File.Exists(Path.Combine(dir, fileName))
539 && !File.Exists(Path.Combine(dir, logName)))
545 fileName = fileNameBase + "[" + i + "]" + ".txt";
546 logName = fileNameBase + "[" + i + "]" + ".log";
554 /// 翻訳支援処理クラスのログ更新イベント用。
556 /// <param name="sender">イベント発生オブジェクト。</param>
557 /// <param name="e">発生したイベント。</param>
558 private void GetLogUpdate(object sender, EventArgs e)
560 // 前回以降に追加されたログをテキストボックスに出力
561 int length = this.translator.Log.Length;
562 if (length > this.logLength)
564 this.textBoxLog.AppendText(this.translator.Log.Substring(this.logLength, length - this.logLength));
567 this.logLength = length;
571 /// 翻訳支援処理クラスの処理状態更新イベント用。
573 /// <param name="sender">イベント発生オブジェクト。</param>
574 /// <param name="e">発生したイベント。</param>
575 private void GetStatusUpdate(object sender, EventArgs e)
578 this.toolStripStatusLabelStatus.Text = this.translator.Status;
585 #region ステータスバーのイベントのメソッド
588 /// ステータスバー処理時間更新タイマー処理。
590 /// <param name="sender">イベント発生オブジェクト。</param>
591 /// <param name="e">発生したイベント。</param>
592 private void TimerStatusStopwatch_Tick(object sender, EventArgs e)
595 this.toolStripStatusLabelStopwatch.Text = String.Format(Resources.ElapsedTime, this.translator.Stopwatch.Elapsed);
599 /// 表示言語選択メニュー日本語クリック時の処理。
601 /// <param name="sender">イベント発生オブジェクト。</param>
602 /// <param name="e">発生したイベント。</param>
603 private void ToolStripMenuItemJapanese_Click(object sender, EventArgs e)
606 this.ChangeCultureAndRestart("ja-JP");
610 /// 表示言語選択メニュー英語(US)クリック時の処理。
612 /// <param name="sender">イベント発生オブジェクト。</param>
613 /// <param name="e">発生したイベント。</param>
614 private void ToolStripMenuItemEnglishUS_Click(object sender, EventArgs e)
616 // 表示言語を英語(US)に設定し再起動する
617 this.ChangeCultureAndRestart("en-US");
621 /// 表示言語選択メニュー英語(GB)クリック時の処理。
623 /// <param name="sender">イベント発生オブジェクト。</param>
624 /// <param name="e">発生したイベント。</param>
625 private void ToolStripMenuItemEnglishGB_Click(object sender, EventArgs e)
627 // 表示言語を英語(GB)に設定し再起動する
628 this.ChangeCultureAndRestart("en-GB");
632 /// 表示言語選択メニュー自動クリック時の処理。
634 /// <param name="sender">イベント発生オブジェクト。</param>
635 /// <param name="e">発生したイベント。</param>
636 private void ToolStripMenuItemAuto_Click(object sender, EventArgs e)
639 this.ChangeCultureAndRestart(String.Empty);
643 /// 設定選択メニュークリック時の処理。
645 /// <param name="sender">イベント発生オブジェクト。</param>
646 /// <param name="e">発生したイベント。</param>
647 private void ToolStripMenuItemConfig_Click(object sender, EventArgs e)
649 // メニュー項目を一旦全て未選択状態に更新
650 foreach (ToolStripMenuItem i in this.toolStripDropDownButtonConfig.DropDownItems)
656 // メニュー項目名から設定ファイル名を作成、再読み込みする
657 ToolStripMenuItem item = (ToolStripMenuItem)sender;
658 Settings.Default.LastSelectedConfiguration = item.Text;
660 this.InitializeByConfig();
664 /// 設定選択メニュー追加クリック時の処理。
666 /// <param name="sender">イベント発生オブジェクト。</param>
667 /// <param name="e">発生したイベント。</param>
668 private void ToolStripMenuItemNew_Click(object sender, EventArgs e)
670 // 重複チェック用の登録済みの設定一覧を用意
671 IList<string> configNames = new List<string>();
672 foreach (ToolStripMenuItem item in this.toolStripDropDownButtonConfig.DropDownItems)
674 if (item != this.toolStripMenuItemNew)
676 configNames.Add(item.Text);
680 // 設定追加用ダイアログで言語コードを入力
681 using (AddConfigDialog form = new AddConfigDialog(configNames))
683 if (form.ShowDialog() == DialogResult.OK)
685 // 設定選択メニューに新しい設定を追加。
686 // 設定ファイルが作成されているため、それを読み込みなおす。
687 this.ToolStripMenuItemConfig_Click(
688 this.AddToolStripDropDownButtonConfigItem(form.ConfigName),
694 #region イベント実装支援用メソッド
697 /// 表示言語選択メニューの初期化処理。
699 private void InitializeDropDownButtonLanguage()
702 ToolStripMenuItem item;
703 switch (Settings.Default.LastSelectedLanguage)
706 item = this.toolStripMenuItemEnglishUS;
709 item = this.toolStripMenuItemEnglishGB;
712 item = this.toolStripMenuItemJapanese;
715 item = this.toolStripMenuItemAuto;
719 // 選択中の項目をチェック状態&押下不能とする
721 item.Enabled = false;
722 if (item != this.toolStripMenuItemAuto)
724 // 自動以外の場合、ステータスバーの表示も更新
725 this.toolStripDropDownButtonLanguage.Text = item.Text;
730 /// 設定ファイル選択メニューの初期化処理。
732 private void InitializeDropDownButtonConfig()
734 // exeまたはユーザーフォルダにある設定ファイルをメニュー項目としてリストアップ
735 foreach (string file in FormUtils.GetFilesAtUserAppData(
736 "*" + Settings.Default.ConfigurationExtension,
737 Settings.Default.ConfigurationCompatible))
741 // 関係ないXMLファイルを除外するため、読み込めるフォーマットかをチェック
743 Config.GetInstance(file);
745 // 問題なければファイル名を見出しにメニューに追加
746 this.AddToolStripDropDownButtonConfigItem(Path.GetFileNameWithoutExtension(file));
750 System.Diagnostics.Debug.WriteLine(
751 "MainForm.InitializeDropDownButtonConfig : " + ex.Message);
757 /// 設定選択メニューに新しい設定を追加する。
759 /// <param name="name">設定名。</param>
760 /// <returns>追加したメニュー。</returns>
761 /// <remarks>追加メニューがあるのでその後ろに登録する。</remarks>
762 private ToolStripMenuItem AddToolStripDropDownButtonConfigItem(string name)
765 ToolStripMenuItem item = new ToolStripMenuItem();
767 item.Click += new EventHandler(this.ToolStripMenuItemConfig_Click);
768 this.toolStripDropDownButtonConfig.DropDownItems.Insert(
769 this.toolStripDropDownButtonConfig.DropDownItems.Count - 1,
775 /// アプリケーションの現在の表示言語を変更、再起動する。
777 /// <param name="name">変更先カルチャ名。</param>
778 /// <remarks>このメソッドを呼び出すとアプリケーションが一旦終了します。</remarks>
779 private void ChangeCultureAndRestart(string name)
781 // 現在の画面表示と表示言語設定を保存した後、アプリケーションを再起動
783 Settings.Default.LastSelectedLanguage = name;
784 Settings.Default.Save();
785 Application.Restart();
799 /// 読み込みに失敗した場合、空の設定を登録し、操作の大半をロックする。
800 /// (設定変更メニューから正しい設定に変更されることを期待。)
802 private void InitializeByConfig()
806 if (this.config == null)
808 // 読み込みに失敗した場合、空の設定を作成(設定値には適当な値を設定)
809 // 設定選択メニューの表示を更新し、画面をほぼ操作不可に変更
810 this.config = new Config();
811 this.groupBoxTransfer.Enabled = false;
812 this.groupBoxSaveDirectory.Enabled = false;
813 this.groupBoxRun.Enabled = false;
814 this.toolStripDropDownButtonConfig.Text = Resources.DropDownConfigLoadConfigFailed;
818 // 設定選択メニューの表示を更新し、画面を操作可能な状態に戻す
819 this.groupBoxTransfer.Enabled = true;
820 this.groupBoxSaveDirectory.Enabled = true;
821 this.groupBoxRun.Enabled = true;
822 this.toolStripDropDownButtonConfig.Text = Path.GetFileNameWithoutExtension(this.config.File);
823 foreach (ToolStripMenuItem item in this.toolStripDropDownButtonConfig.DropDownItems)
825 // 読み込んだ設定を選択中(チェック状態&押下不能)に更新
826 if (item != this.toolStripMenuItemNew
827 && item.Text == this.toolStripDropDownButtonConfig.Text)
830 item.Enabled = false;
835 // コンボボックスを読み込んだ設定で初期化
836 this.InitializeComboBox();
842 private void LoadConfig()
845 // ※ 微妙に時間がかかるので、ステータスバーに通知
846 string file = Settings.Default.LastSelectedConfiguration + Settings.Default.ConfigurationExtension;
849 this.toolStripStatusLabelStatus.Text = Resources.StatusConfigReading;
852 this.config = Config.GetInstance(file);
856 this.toolStripStatusLabelStatus.Text = String.Empty;
859 catch (FileNotFoundException ex)
861 // 設定ファイルが見つからない場合、エラーメッセージを表示
862 System.Diagnostics.Debug.WriteLine(
863 "MainForm.LoadConfig > 設定ファイル読み込み失敗 : " + ex.Message);
864 FormUtils.ErrorDialog(Resources.ErrorMessageConfigNotFound, file);
868 // その他の例外(権限が無いとかファイルが壊れているとか)
869 System.Diagnostics.Debug.WriteLine(
870 "MainForm.LoadConfig > 設定ファイル読み込み時エラー : " + ex.ToString());
871 FormUtils.ErrorDialog(Resources.ErrorMessageConfigLordFailed, ex.Message);
876 /// 現在の出力先フォルダ、翻訳元/先言語をアプリケーション設定に反映。
878 /// <remarks>表示言語や設定ファイルの選択については必要な場合のみ別途実施。</remarks>
879 private void SetSettings()
881 Settings.Default.SaveDirectory = this.textBoxSaveDirectory.Text;
882 Settings.Default.LastSelectedSource = this.comboBoxSource.Text;
883 Settings.Default.LastSelectedTarget = this.comboBoxTarget.Text;