OSDN Git Service

AppliStation-All,826b1b613118e370d33ec78c21e052a5733291d3 の修正漏れ(レジストリのキーのタイプが想定しているのと...
authorttp <ttp@users.sourceforge.jp>
Sun, 9 May 2010 04:45:36 +0000 (13:45 +0900)
committerttp <ttp@users.sourceforge.jp>
Sun, 9 May 2010 04:45:36 +0000 (13:45 +0900)
AppliStation/AppliStation.PackageInfo/PackageInfoForm.cs
all-get/Main.cs
na-get-lib/NaGet.Packages.Install/UninstallInformation.cs
na-get-lib/NaGet.Packages/PackageListsManager.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
index 7a286a4..2a4fe5c 100644 (file)
@@ -212,7 +212,7 @@ namespace AllGet
                                \r
                                installations = new Installation[downloadList.Count];\r
                                for (int i = 0; i < installations.Length; i++) {\r
-                                       installations[i] = new Installation((Package) downloadList[i]);\r
+                                       installations[i] = new Installation(downloadList[i]);\r
                                }\r
                        }\r
                        \r
@@ -277,7 +277,7 @@ namespace AllGet
                                \r
                                installations = new Installation[downloadList.Count];\r
                                for (int i = 0; i < installations.Length; i++) {\r
-                                       installations[i] = new Installation((Package) downloadList[i]);\r
+                                       installations[i] = new Installation(downloadList[i]);\r
                                        \r
                                        installations[i].Silent = silent; // サイレントインストールのフラグの設定\r
                                        \r
index eec7d00..d6c9adc 100644 (file)
@@ -147,13 +147,11 @@ namespace NaGet.Packages.Install
                                uninstInfo.IsSystemComponent = ((int) regKey.GetValue("SystemComponent", 0)) > 0;\r
                        } catch (InvalidCastException) {}\r
                        uninstInfo.IsOSPatch = (regKey.GetValue("ParentKeyName", null) as string) == "OperatingSystem";\r
-                       try {\r
-                               uninstInfo.InstallDateString = regKey.GetValue("InstallDate", null) as string;\r
-                       } catch (ArgumentException) {}\r
+                       uninstInfo.InstallDateString = regKey.GetValue("InstallDate", null) as string;\r
                        uninstInfo.InstallLocation = regKey.GetValue("InstallLocation", null) as string;\r
                        try {\r
                                uninstInfo.EstimatedSize = (int) regKey.GetValue("EstimatedSize", 0);\r
-                       } catch (ArgumentException) {}\r
+                       } catch (InvalidCastException) {}\r
                        \r
                        PrefixWithSlowInfoCache(ref uninstInfo, regKey);\r
                        \r
index 880d3e7..70435c1 100644 (file)
@@ -160,7 +160,7 @@ namespace NaGet.Packages
                                                \r
                                                // 補完したパッケージ情報への差し替え\r
                                                UninstallInformation pkgUninstInfo = pkg.UninstallInfo;\r
-                                               NaGet.Utils.FieldCopy((Package) log.Package, ref pkg);\r
+                                               NaGet.Utils.FieldCopy<Package,InstalledPackage>(log.Package, ref pkg);\r
                                                pkg.UninstallInfo = pkgUninstInfo;\r
                                                if (pkg.UninstallInfo.InstallDate == null) { // インストール日時の補完\r
                                                        pkg.UninstallInfo.InstallDate = log.Date;\r