OSDN Git Service

ecd889feebc88efdae1d181fb8de3f8abf0b5cf0
[kybernetes/Kybernetes.git] / main / Program.cs
1 using System;\r
2 using System.Collections.Generic;\r
3 using System.Linq;\r
4 using System.Windows.Forms;\r
5 using com.andoutomo.kybernetes.view;\r
6 using com.andoutomo.kybernetes.data.accessor;\r
7 using com.andoutomo.kybernetes.control;\r
8 using System.Reflection;\r
9 \r
10 namespace WindowsFormsApplication1\r
11 {\r
12     static class Program\r
13     {\r
14         /// <summary>\r
15         /// アプリケーションのメイン エントリ ポイントです。\r
16         /// </summary>\r
17         [STAThread]\r
18         static void Main()\r
19         {\r
20             KybernetesLogger.Log.debug("------------run version " + AppInfoContainer.VersionNo + "----------------");\r
21 \r
22             Application.EnableVisualStyles();\r
23             Application.SetCompatibleTextRenderingDefault(false);\r
24             setAppInfoContainer();\r
25 \r
26 \r
27             KybernetesLogger.CurrentLogMode = SettingDataAccessor.getObject.getLogMode();\r
28             //KybernetesLogger.CurrentLogMode = LogMode.Error;\r
29             BaseForm form = new BaseForm();\r
30 \r
31             Application.Run(CmdDispatcher.getDispatcher(form).getForm());\r
32 \r
33         }\r
34         static void setAppInfoContainer()\r
35         {\r
36             //AssemblyTitleの取得\r
37             AssemblyTitleAttribute asmttl = (System.Reflection.AssemblyTitleAttribute)\r
38                 Attribute.GetCustomAttribute(Assembly.GetExecutingAssembly(), typeof(AssemblyTitleAttribute));\r
39             AppInfoContainer.Title = asmttl.Title;\r
40             //AssemblyDescriptionの取得\r
41             AssemblyDescriptionAttribute asmdc = (System.Reflection.AssemblyDescriptionAttribute)\r
42                 Attribute.GetCustomAttribute(Assembly.GetExecutingAssembly(), typeof(AssemblyDescriptionAttribute));\r
43             AppInfoContainer.Description = asmdc.Description;\r
44             //AssemblyCopyrightの取得\r
45             AssemblyCopyrightAttribute asmcpy = (System.Reflection.AssemblyCopyrightAttribute)\r
46                 Attribute.GetCustomAttribute(Assembly.GetExecutingAssembly(), typeof(AssemblyCopyrightAttribute));\r
47             AppInfoContainer.CopyRight = asmcpy.Copyright;\r
48             //自分自身のAssemblyを取得\r
49             System.Version ver = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;\r
50             AppInfoContainer.VersionNo = ver.ToString();\r
51         }\r
52     }\r
53 \r
54 }\r