예제 #1
0
        protected void BindPackageListGrid()
        {
            switch (this.CurrentViewMode)
            {
            case ViewMode.Installed:
                liInstalled.AddCssClass("active");
                liAvailable.RemoveCssClass("active");
                gPackageList.DataSource = InstalledPackages.Where(p => !p.Id.StartsWith(rockUpdatePackageIdPrefix) || p.Id != rockPackageId).ToList();
                break;

            case ViewMode.Available:
                liInstalled.RemoveCssClass("active");
                liAvailable.AddCssClass("active");
                gPackageList.DataSource = AvailablePackages.Where(p => !p.Id.StartsWith(rockUpdatePackageIdPrefix) || p.Id != rockPackageId).ToList();
                break;

            case ViewMode.Search:
                liInstalled.RemoveCssClass("active");
                liAvailable.RemoveCssClass("active");
                gPackageList.DataSource = NuGetService.GetLatestRemotePackages(txtSearch.Text, includeAllVersions: false).Where(p => !p.Id.StartsWith(rockUpdatePackageIdPrefix) || p.Id != rockPackageId).ToList();
                break;

            default:
                break;
            }

            gPackageList.DataBind();
        }