private void SetChildrenSorting(SortingDefinition sortingDefinition) { switch (sortingDefinition) { case SortingDefinition.AlphabeticalDescending: Children.Sort(x => x.DisplayName); break; case SortingDefinition.AlphabeticalAscending: Children.SortDescending(x => x.DisplayName); break; case SortingDefinition.StatusAscending: Children.Sort(x => x.BuildStatus); break; case SortingDefinition.StatusDescending: Children.SortDescending(x => x.BuildStatus); break; case SortingDefinition.DateAscending: Children.Sort(x => x.QueueTime); break; case SortingDefinition.DateDescending: Children.SortDescending(x => x.QueueTime); break; } }
public static IconType ToIconType(this SortingDefinition sortingDefinition) { switch (sortingDefinition) { case SortingDefinition.AlphabeticalDescending: return(IconType.AlphabeticalDescending); case SortingDefinition.AlphabeticalAscending: return(IconType.AlphabeticalAscending); case SortingDefinition.StatusAscending: return(IconType.StatusAscending); case SortingDefinition.StatusDescending: return(IconType.StatusDescending); case SortingDefinition.DateDescending: return(IconType.DateDescending); case SortingDefinition.DateAscending: return(IconType.DateAscending); default: return(IconType.None); } }
public IEnumerable <T> GetAll <T>(int skip, int take, bool lastOnTop = true) where T : DataItem { var sortDirection = lastOnTop ? OrderByDirection.Descending : OrderByDirection.Ascending; var sort = new SortingDefinition("CreatedAt", sortDirection); return(this.App.WorkWith().Data <T>().Get().SetSorting(sort).Skip(skip).Take(take).ExecuteSync()); }
public IEnumerable <Route> GetRoutesByCompany(Guid companyId, int skip, int take, bool lastOnTop = true) { var sortDirection = lastOnTop ? OrderByDirection.Descending : OrderByDirection.Ascending; var sort = new SortingDefinition("CreatedAt", sortDirection); return(this.App.WorkWith().Data <Route>().Get() .Where(r => r.CompanyID == companyId).SetSorting(sort).Skip(skip).Take(take).ExecuteSync()); }
public IEnumerable <Task> GetTasksByOwner(Guid ownerId, int skip, int take, bool lastOnTop = true) { var sortDirection = lastOnTop ? OrderByDirection.Descending : OrderByDirection.Ascending; var sort = new SortingDefinition("CreatedAt", sortDirection); return(this.App.WorkWith().Data <Task>().Get() .Where(t => t.Owner == ownerId).SetSorting(sort).Skip(skip).Take(take).ExecuteSync()); }
public void SetSorting(SortingDefinition newSorting) { if (newSorting == _currentSortingDefinition) { return; } _currentSortingDefinition = newSorting; SetChildrenSorting(_currentSortingDefinition); }
public SortingDefinitionViewModel(GroupDefinition forDefinition, SortingDefinition sortingDefinition) { ForDefinition = forDefinition; SortingDefinition = sortingDefinition; }