1 // ================================================================================================
3 // アプリケーション起動用クラスソース</summary>
5 // <copyright file="Program.cs" company="honeplusのメモ帳">
6 // Copyright (C) 2012 Honeplus. All rights reserved.</copyright>
9 // ================================================================================================
11 namespace Honememo.Wptscs
14 using System.Globalization;
15 using System.Threading;
16 using System.Windows.Forms;
17 using Honememo.Wptscs.Properties;
20 /// アプリケーション起動時に最初に呼ばれるクラスです。
22 internal static class Program
25 /// 設定ファイルから表示言語の設定を読み込む。
27 /// <remarks>特に表示言語が指定されていない場合は何もしない。</remarks>
28 public static void LoadSelectedCulture()
30 if (!String.IsNullOrWhiteSpace(Settings.Default.LastSelectedLanguage))
34 Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo(Settings.Default.LastSelectedLanguage);
35 Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo(Settings.Default.LastSelectedLanguage);
39 // 設定ファイルに手で不正な値が設定された場合など、万が一エラーになった場合デバッグログ
40 System.Diagnostics.Debug.WriteLine("Program.LoadSelectedCulture : " + ex.ToString());
46 /// アプリケーションのメイン エントリ ポイントです。
49 private static void Main()
51 // 初回実行時は古いバージョンの設定があればバージョンアップ
52 if (!Settings.Default.IsUpgraded)
54 // 現バージョンを上書きしてしまうため一度だけ実施
55 Settings.Default.Upgrade();
56 Settings.Default.IsUpgraded = true;
59 // 表示言語の設定が存在する場合、画面表示前にその設定を読み込み
60 Program.LoadSelectedCulture();
62 Application.EnableVisualStyles();
63 Application.SetCompatibleTextRenderingDefault(false);
64 Application.Run(new MainForm());