OSDN Git Service

AppliStation,チケット #23338 AVGをアンインストールしようとするとエラーが発生してしまう 対策
[applistation/AppliStation.git] / AppliStation / PackageListView.cs
index 2d4b1b1..484ceeb 100644 (file)
@@ -165,7 +165,7 @@ namespace AppliStation
                        // ソフトリストの中身のパッケージ\r
                        if ((filteringType & PackageListViewPkgTypeFilter.NotInstalled) != 0) {\r
                                foreach (Package pkg in pkgListMan.AvailablePkgList.Search(keyword)) {\r
-                                       if (Installation.GetPreferInstallerIndex(pkg) >= 0) { // インストール可能\r
+                                       if (Installation.IsInstallablePackage(pkg)) { // インストール可能\r
                                                bool isInstalledAS = (pkgListMan.InstalledPkgList.GetPackageForName(pkg.Name) != null);\r
                                                bool isInstalledSys = (pkgListMan.SystemInstalledPkgList.GetPackageForName(pkg.Name) != null);\r
                                                \r
@@ -229,12 +229,26 @@ namespace AppliStation
                \r
                #region Sort関連\r
                \r
+               /// <summary>\r
+               /// 選択しているコラムを設定あるいは取得を行う。\r
+               /// </summary>\r
+               public ColumnHeader SortColumn {\r
+                       get {\r
+                               return sortComparer.Column;\r
+                       }\r
+                       set {\r
+                               sortColumn(value);\r
+                       }\r
+               }\r
+               \r
                protected void sortColumn(ColumnHeader column)\r
                {\r
-                       int columnIndex = column.Index;\r
+                       int columnIndex = (column != null)? column.Index : -1;\r
                        SortOrder order = SortOrder.None;\r
                        \r
-                       if (sortComparer.ColumnIndex == columnIndex) {\r
+                       if (columnIndex < 0) {\r
+                               sortComparer.Order = order = SortOrder.None;\r
+                       } else if (sortComparer.ColumnIndex == columnIndex) {\r
                                order = (sortComparer.Order == SortOrder.Ascending)? SortOrder.Descending : SortOrder.Ascending;\r
                                        \r
                                sortComparer.Order = order;\r