public PackagesForSelectedPageResult2(IEnumerable <IPackage> packages, PackagesForSelectedPageQuery2 query)
 {
     this.Packages            = packages;
     this.TotalPackagesOnPage = packages.Count();
     this.TotalPackages       = query.TotalPackages;
     this.AllPackages         = query.AllPackages;
     this.Query = query;
 }
		public PackagesForSelectedPageResult2 (IEnumerable<IPackage> packages, PackagesForSelectedPageQuery2 query)
		{
			this.Packages = packages;
			this.TotalPackagesOnPage = packages.Count ();
			this.TotalPackages = query.TotalPackages;
			this.AllPackages = query.AllPackages;
			this.Query = query;
		}
Esempio n. 3
0
 IEnumerable <IPackage> GetFilteredPackagesBeforePagingResults(PackagesForSelectedPageQuery2 query)
 {
     if (query.AllPackages == null)
     {
         IQueryable <IPackage> packages = GetPackagesFromPackageSource(query.SearchCriteria);
         query.TotalPackages = packages.Count();
         query.AllPackages   = GetFilteredPackagesBeforePagingResults(packages);
     }
     return(query.AllPackages);
 }
Esempio n. 4
0
        void CreateReadPackagesTask()
        {
            var query = new PackagesForSelectedPageQuery2(this, allPackages, GetSearchCriteria());

            packagesForSelectedPageQuery = query;

            task = taskFactory.CreateTask(
                () => GetPackagesForSelectedPageResult(query),
                OnPackagesReadForSelectedPage);
        }
Esempio n. 5
0
 IEnumerable <IPackage> GetPackagesForSelectedPage(IEnumerable <IPackage> allPackages, PackagesForSelectedPageQuery2 query)
 {
     return(allPackages
            .Skip(query.Skip)
            .Take(query.Take));
 }
Esempio n. 6
0
        IEnumerable <IPackage> GetPackagesForSelectedPage(PackagesForSelectedPageQuery2 query)
        {
            IEnumerable <IPackage> filteredPackages = GetFilteredPackagesBeforePagingResults(query);

            return(GetPackagesForSelectedPage(filteredPackages, query));
        }
Esempio n. 7
0
        PackagesForSelectedPageResult2 GetPackagesForSelectedPageResult(PackagesForSelectedPageQuery2 query)
        {
            IEnumerable <IPackage> packages = GetPackagesForSelectedPage(query);

            return(new PackagesForSelectedPageResult2(packages, query));
        }