OSDN Git Service

AppliStation-All,826b1b613118e370d33ec78c21e052a5733291d3 の修正漏れ(レジストリのキーのタイプが想定しているのと...
[applistation/AppliStation.git] / AppliStation / AppliStation.PackageInfo / PackageInfoForm.cs
index 2b8fbad..670aad1 100644 (file)
@@ -34,12 +34,13 @@ namespace AppliStation.PackageInfo
                \r
                private void updateSelectedObject()\r
                {\r
-                       bool isInstalledPackage = pkg is InstalledPackage;\r
+                       InstalledPackage instPkg = pkg as InstalledPackage;\r
+                       bool isInstalledPackage = instPkg != null;\r
                        \r
                        iconLabel.Image = null;\r
                        iconLabel.Size = Size.Empty;\r
                        if (isInstalledPackage) {\r
-                               Icon icon = AppliStation.Util.GUIUtils.GetIconForPackage((InstalledPackage) pkg);\r
+                               Icon icon = AppliStation.Util.GUIUtils.GetIconForPackage(instPkg);\r
                                if (icon != null) {\r
                                        iconLabel.Image = icon.ToBitmap();\r
                                        iconLabel.Size = icon.Size;\r
@@ -51,7 +52,7 @@ namespace AppliStation.PackageInfo
                        summaryTextBox.Text = pkg.Summary;\r
                        \r
                        if (isInstalledPackage) {\r
-                               UninstallInformation uninstInfo = ((InstalledPackage) pkg).UninstallInfo;\r
+                               UninstallInformation uninstInfo = instPkg.UninstallInfo;\r
                                \r
                                string instPath = null;\r
                                if ((pkg.Type == InstallerType.ARCHIVE)\r
@@ -93,7 +94,7 @@ namespace AppliStation.PackageInfo
                        }\r
                        \r
                        tabControl1.TabPages.Clear();\r
-                       if (pkg is InstalledPackage && string.IsNullOrEmpty(pkg.Version)) {\r
+                       if (isInstalledPackage && string.IsNullOrEmpty(pkg.Version)) {\r
                                tabControl1.Visible = false;\r
                        } else {\r
                                tabControl1.Visible = true;\r