OSDN Git Service

AppliStation-GUI,インストール除外リストの設定を設定ダイアログに追加
[applistation/AppliStation.git] / AppliStation / AppliStation.Util / ToolStripPetitLauncherMenuItem.cs
index 7366b06..f8c5097 100644 (file)
@@ -50,10 +50,6 @@ namespace AppliStation.Util
                                thread = null;\r
                        }\r
                        \r
                                thread = null;\r
                        }\r
                        \r
-                       try {\r
-                               DropDownItems.Clear();\r
-                       } catch (NullReferenceException) {\r
-                       }\r
                        if (Directory.Exists(baseFolderPath)) {\r
                                thread = new Thread(new ThreadStart(buildItems));\r
                                thread.Start();\r
                        if (Directory.Exists(baseFolderPath)) {\r
                                thread = new Thread(new ThreadStart(buildItems));\r
                                thread.Start();\r
@@ -112,6 +108,8 @@ Debug.Assert(! itemtext.Contains(".."), string.Format("{2} -- base:{0}, dirname:
                        \r
                private void buildItems()\r
                {\r
                        \r
                private void buildItems()\r
                {\r
+                       DropDownItems.Clear();\r
+                       \r
                        try {\r
                                string folderPath = Path.GetFullPath(baseFolderPath);\r
                                ToolStripSeparator sep = new ToolStripSeparator();\r
                        try {\r
                                string folderPath = Path.GetFullPath(baseFolderPath);\r
                                ToolStripSeparator sep = new ToolStripSeparator();\r
@@ -146,10 +144,10 @@ Debug.Assert(! itemtext.Contains(".."), string.Format("{2} -- base:{0}, dirname:
                /// </summary>\r
                /// <param name="folderPath"></param>\r
                /// <returns></returns>\r
                /// </summary>\r
                /// <param name="folderPath"></param>\r
                /// <returns></returns>\r
-               public static ToolStripMenuItem CreateMenuItemForFolder(string folderPath)\r
+               private static ToolStripMenuItem CreateMenuItemForFolder(string folderPath)\r
                {\r
                        ToolStripMenuItem item = CreateMenuItemForFile(folderPath, "フォルダーを開く(&O)");\r
                {\r
                        ToolStripMenuItem item = CreateMenuItemForFile(folderPath, "フォルダーを開く(&O)");\r
-                       item.Image = GUIUtils.GetShellIconForFolder().ToBitmap();\r
+                       item.Image = GUIUtils.ShellIconForFolder.ToBitmap();\r
                        item.ShowShortcutKeys = true;\r
                        return item;\r
                }\r
                        item.ShowShortcutKeys = true;\r
                        return item;\r
                }\r
@@ -159,7 +157,7 @@ Debug.Assert(! itemtext.Contains(".."), string.Format("{2} -- base:{0}, dirname:
                /// </summary>\r
                /// <param name="filePath">ファイルパス</param>\r
                /// <returns>生成されたメニューアイテム</returns>\r
                /// </summary>\r
                /// <param name="filePath">ファイルパス</param>\r
                /// <returns>生成されたメニューアイテム</returns>\r
-               public static ToolStripMenuItem CreateMenuItemForFile(string filePath, string text)\r
+               private static ToolStripMenuItem CreateMenuItemForFile(string filePath, string text)\r
                {\r
                        ToolStripMenuItem item = new ToolStripMenuItem();\r
                        \r
                {\r
                        ToolStripMenuItem item = new ToolStripMenuItem();\r
                        \r
@@ -173,7 +171,7 @@ Debug.Assert(! itemtext.Contains(".."), string.Format("{2} -- base:{0}, dirname:
                                \r
                                StringBuilder sb = new StringBuilder();\r
                                sb.AppendFormat("場所: {0}", Path.GetDirectoryName(filePath));\r
                                \r
                                StringBuilder sb = new StringBuilder();\r
                                sb.AppendFormat("場所: {0}", Path.GetDirectoryName(filePath));\r
-                               try {\r
+                               if (File.Exists(filePath)) {\r
                                        FileVersionInfo vInfo = FileVersionInfo.GetVersionInfo(filePath);\r
                                        \r
                                        if (! string.IsNullOrEmpty(vInfo.FileDescription))\r
                                        FileVersionInfo vInfo = FileVersionInfo.GetVersionInfo(filePath);\r
                                        \r
                                        if (! string.IsNullOrEmpty(vInfo.FileDescription))\r
@@ -182,7 +180,7 @@ Debug.Assert(! itemtext.Contains(".."), string.Format("{2} -- base:{0}, dirname:
                                                sb.AppendFormat("\r\n会社: {0}", vInfo.CompanyName);\r
                                        if (! string.IsNullOrEmpty(vInfo.FileVersion))\r
                                                sb.AppendFormat("\r\nファイルバージョン: {0}", vInfo.FileVersion);\r
                                                sb.AppendFormat("\r\n会社: {0}", vInfo.CompanyName);\r
                                        if (! string.IsNullOrEmpty(vInfo.FileVersion))\r
                                                sb.AppendFormat("\r\nファイルバージョン: {0}", vInfo.FileVersion);\r
-                               } catch (Exception) {}\r
+                               }\r
                                item.ToolTipText = sb.ToString();\r
                        } else {\r
                                item.ToolTipText = filePath;\r
                                item.ToolTipText = sb.ToString();\r
                        } else {\r
                                item.ToolTipText = filePath;\r
@@ -214,7 +212,7 @@ Debug.Assert(! itemtext.Contains(".."), string.Format("{2} -- base:{0}, dirname:
                /// </summary>\r
                /// <param name="folderPath">カレントフォルダー及びパスに追加されるフォルダー</param>\r
                /// <returns>生成されたメニューアイテム</returns>\r
                /// </summary>\r
                /// <param name="folderPath">カレントフォルダー及びパスに追加されるフォルダー</param>\r
                /// <returns>生成されたメニューアイテム</returns>\r
-               public static ToolStripMenuItem CreateMenuItemForCmdAt(string folderPath)\r
+               private static ToolStripMenuItem CreateMenuItemForCmdAt(string folderPath)\r
                {\r
                        string cmdPath = Environment.GetEnvironmentVariable("comspec");\r
                        if (string.IsNullOrEmpty(cmdPath) || (!File.Exists(cmdPath)))\r
                {\r
                        string cmdPath = Environment.GetEnvironmentVariable("comspec");\r
                        if (string.IsNullOrEmpty(cmdPath) || (!File.Exists(cmdPath)))\r