X-Git-Url: http://git.sourceforge.jp/view?p=applistation%2FAppliStation.git;a=blobdiff_plain;f=AppliStation%2FAppliStation.Util%2FToolStripPetitLauncherMenuItem.cs;h=f8c50973826a38b00c688f6f8221af513229aaa4;hp=be9e074c36f1e80cc262e95b27d54d57513575d8;hb=5f97683021498f777ca0a733d7d3b2465d71b0f1;hpb=97737c700562db6e3f50dfdc80ebeaa1d1010922 diff --git a/AppliStation/AppliStation.Util/ToolStripPetitLauncherMenuItem.cs b/AppliStation/AppliStation.Util/ToolStripPetitLauncherMenuItem.cs index be9e074..f8c5097 100644 --- a/AppliStation/AppliStation.Util/ToolStripPetitLauncherMenuItem.cs +++ b/AppliStation/AppliStation.Util/ToolStripPetitLauncherMenuItem.cs @@ -19,7 +19,7 @@ namespace AppliStation.Util private Form invokerForm; /// - /// 親フォルダ + /// 親フォルダー /// [ReadOnly(true)] public string BaseFolderPath { @@ -50,10 +50,6 @@ namespace AppliStation.Util thread = null; } - try { - DropDownItems.Clear(); - } catch (NullReferenceException) { - } if (Directory.Exists(baseFolderPath)) { thread = new Thread(new ThreadStart(buildItems)); thread.Start(); @@ -112,6 +108,8 @@ Debug.Assert(! itemtext.Contains(".."), string.Format("{2} -- base:{0}, dirname: private void buildItems() { + DropDownItems.Clear(); + try { string folderPath = Path.GetFullPath(baseFolderPath); ToolStripSeparator sep = new ToolStripSeparator(); @@ -142,14 +140,14 @@ Debug.Assert(! itemtext.Contains(".."), string.Format("{2} -- base:{0}, dirname: #endregion /// - /// 与えられたフォルダを開くメニューアイテムを生成する + /// 与えられたフォルダーを開くメニューアイテムを生成する /// /// /// - public static ToolStripMenuItem CreateMenuItemForFolder(string folderPath) + private static ToolStripMenuItem CreateMenuItemForFolder(string folderPath) { - ToolStripMenuItem item = CreateMenuItemForFile(folderPath, "フォルダを開く(&O)"); - item.Image = GUIUtils.GetShellIconForFolder().ToBitmap(); + ToolStripMenuItem item = CreateMenuItemForFile(folderPath, "フォルダーを開く(&O)"); + item.Image = GUIUtils.ShellIconForFolder.ToBitmap(); item.ShowShortcutKeys = true; return item; } @@ -159,7 +157,7 @@ Debug.Assert(! itemtext.Contains(".."), string.Format("{2} -- base:{0}, dirname: /// /// ファイルパス /// 生成されたメニューアイテム - public static ToolStripMenuItem CreateMenuItemForFile(string filePath, string text) + private static ToolStripMenuItem CreateMenuItemForFile(string filePath, string text) { ToolStripMenuItem item = new ToolStripMenuItem(); @@ -173,7 +171,7 @@ Debug.Assert(! itemtext.Contains(".."), string.Format("{2} -- base:{0}, dirname: StringBuilder sb = new StringBuilder(); sb.AppendFormat("場所: {0}", Path.GetDirectoryName(filePath)); - try { + if (File.Exists(filePath)) { FileVersionInfo vInfo = FileVersionInfo.GetVersionInfo(filePath); if (! string.IsNullOrEmpty(vInfo.FileDescription)) @@ -182,7 +180,7 @@ Debug.Assert(! itemtext.Contains(".."), string.Format("{2} -- base:{0}, dirname: sb.AppendFormat("\r\n会社: {0}", vInfo.CompanyName); if (! string.IsNullOrEmpty(vInfo.FileVersion)) sb.AppendFormat("\r\nファイルバージョン: {0}", vInfo.FileVersion); - } catch (Exception) {} + } item.ToolTipText = sb.ToString(); } else { item.ToolTipText = filePath; @@ -210,11 +208,11 @@ Debug.Assert(! itemtext.Contains(".."), string.Format("{2} -- base:{0}, dirname: } /// - /// 与えられたフォルダのところでコマンドプロンプトを開く。 + /// 与えられたフォルダーのところでコマンドプロンプトを開く。 /// - /// カレントフォルダ及びパスに追加されるフォルダ + /// カレントフォルダー及びパスに追加されるフォルダー /// 生成されたメニューアイテム - public static ToolStripMenuItem CreateMenuItemForCmdAt(string folderPath) + private static ToolStripMenuItem CreateMenuItemForCmdAt(string folderPath) { string cmdPath = Environment.GetEnvironmentVariable("comspec"); if (string.IsNullOrEmpty(cmdPath) || (!File.Exists(cmdPath)))