OSDN Git Service

AppliStation-GUI,インストール除外リストの設定を設定ダイアログに追加
[applistation/AppliStation.git] / AppliStation / AppliStation.Util / ToolStripPetitLauncherMenuItem.cs
index be9e074..f8c5097 100644 (file)
@@ -19,7 +19,7 @@ namespace AppliStation.Util
                private Form invokerForm;\r
                \r
                /// <summary>\r
-               /// 親フォルダ\r
+               /// 親フォルダ\r
                /// </summary>\r
                [ReadOnly(true)]\r
                public string BaseFolderPath {\r
@@ -50,10 +50,6 @@ namespace AppliStation.Util
                                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
@@ -112,6 +108,8 @@ Debug.Assert(! itemtext.Contains(".."), string.Format("{2} -- base:{0}, dirname:
                        \r
                private void buildItems()\r
                {\r
+                       DropDownItems.Clear();\r
+                       \r
                        try {\r
                                string folderPath = Path.GetFullPath(baseFolderPath);\r
                                ToolStripSeparator sep = new ToolStripSeparator();\r
@@ -142,14 +140,14 @@ Debug.Assert(! itemtext.Contains(".."), string.Format("{2} -- base:{0}, dirname:
                #endregion\r
                \r
                /// <summary>\r
-               /// 与えられたフォルダを開くメニューアイテムを生成する\r
+               /// ä¸\8eã\81\88ã\82\89ã\82\8cã\81\9fã\83\95ã\82©ã\83«ã\83\80ã\83¼ã\82\92é\96\8bã\81\8fã\83¡ã\83\8bã\83¥ã\83¼ã\82¢ã\82¤ã\83\86ã\83 ã\82\92ç\94\9fæ\88\90ã\81\99ã\82\8b\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
-                       item.Image = GUIUtils.GetShellIconForFolder().ToBitmap();\r
+                       ToolStripMenuItem item = CreateMenuItemForFile(folderPath, "ã\83\95ã\82©ã\83«ã\83\80ã\83¼ã\82\92é\96\8bã\81\8f(&O)");\r
+                       item.Image = GUIUtils.ShellIconForFolder.ToBitmap();\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
-               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
@@ -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
-                               try {\r
+                               if (File.Exists(filePath)) {\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
-                               } catch (Exception) {}\r
+                               }\r
                                item.ToolTipText = sb.ToString();\r
                        } else {\r
                                item.ToolTipText = filePath;\r
@@ -210,11 +208,11 @@ Debug.Assert(! itemtext.Contains(".."), string.Format("{2} -- base:{0}, dirname:
                }\r
                \r
                /// <summary>\r
-               /// 与えられたフォルダのところでコマンドプロンプトを開く。\r
+               /// ä¸\8eã\81\88ã\82\89ã\82\8cã\81\9fã\83\95ã\82©ã\83«ã\83\80ã\83¼ã\81®ã\81¨ã\81\93ã\82\8dã\81§ã\82³ã\83\9eã\83³ã\83\89ã\83\97ã\83­ã\83³ã\83\97ã\83\88ã\82\92é\96\8bã\81\8fã\80\82\r
                /// </summary>\r
-               /// <param name="folderPath">カレントフォルダ及びパスに追加されるフォルダ</param>\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