Example #1
0
 public void SetAllChildrenVisibleByFilters(TimeEntryFilter timeEntryFilter, TreeItemSelectionFilter selectionFilter)
 {
     VisibleChildren = new ObservableCollection <ListItemModelBase>(Children.Where(x => x.CanPass(timeEntryFilter, selectionFilter)));
     foreach (var child in VisibleChildren)
     {
         child.SetAllChildrenVisibleByFilters(timeEntryFilter, selectionFilter);
     }
     Reload();
 }
Example #2
0
        public MainListViewModel(IDataService dataService, IUserRepository userRepository, TreeItemSelectionFilter selectionFilter)
        {
            TreeCommands.CustomerSelected.RegisterCommand(new DelegateCommand <TreeCustomerViewModel>(CustomerSelected));
            TreeCommands.CustomerDeselected.RegisterCommand(new DelegateCommand <TreeCustomerViewModel>(CustomerDeSelected));
            TreeCommands.ProjectSelected.RegisterCommand(new DelegateCommand <TreeProjectViewModel>(ProjectSelected));
            TreeCommands.ProjectDeSelected.RegisterCommand(new DelegateCommand <TreeProjectViewModel>(ProjectDeSelected));
            TreeCommands.TaskSelected.RegisterCommand(new DelegateCommand <TreeTaskViewModel>(TaskSelected));
            TreeCommands.TaskDeSelected.RegisterCommand(new DelegateCommand <TreeTaskViewModel>(TaskDeSelected));

            InternalCommands.UserFilterChanged.RegisterCommand(new DelegateCommand <TimeEntryFilter>(UserFilterChanged));
            InternalCommands.ItemSelected.RegisterCommand(new DelegateCommand <ListItemModelBase>(ItemSelected));

            InternalCommands.CustomerDeleteCompleted.RegisterCommand(new DelegateCommand <int?>(CustomerDeleteCompleted));
            InternalCommands.CustomerAddCompleted.RegisterCommand(new DelegateCommand <Customer>(CustomerAddCompleted));
            InternalCommands.CustomerEditCompleted.RegisterCommand(new DelegateCommand <Customer>(CustomerEditCompleted));

            InternalCommands.TaskEditCompleted.RegisterCommand(new DelegateCommand <Task>(TaskEditCompleted));
            InternalCommands.TaskAddCompleted.RegisterCommand(new DelegateCommand <Task>(TaskAddCompleted));
            InternalCommands.TaskDeleteCompleted.RegisterCommand(new DelegateCommand(TaskDeleteCompleted));

            InternalCommands.ProjectDeleteCompleted.RegisterCommand(new DelegateCommand(ProjectDeleteCompleted));
            InternalCommands.ProjectEditCompleted.RegisterCommand(new DelegateCommand <Project>(ProjectEditCompleted));
            InternalCommands.ProjectAddCompleted.RegisterCommand(new DelegateCommand <Project>(ProjectAddCompleted));

            InternalCommands.TimeEntryDeleteCompleted.RegisterCommand(new DelegateCommand(TimeEntryDeleteCompleted));
            InternalCommands.TimeEntryEditCompleted.RegisterCommand(new DelegateCommand <TimeEntry>(TimeEntryEditCompleted));

            InternalCommands.TimeEntryAddCompleted.RegisterCommand(new DelegateCommand <TimeEntry>(TimeEntryAddCompleted));

            ApplicationCommands.RefreshData.RegisterCommand(new DelegateCommand <object>(ExecuteRefresh));

            Customers = new ObservableCollection <ListCustomerViewModel>();

            _selectionFilter = selectionFilter;
            _dataService     = dataService;
            _userRepository  = userRepository;

            UpdateInvoiceTemplates();
        }
Example #3
0
 public override bool CanPass(Core.Model.TimeEntryFilter filter, TreeItemSelectionFilter selectionFilter)
 {
     return(selectionFilter.HasCustomer(Customer));
 }
Example #4
0
 public override bool CanPass(TimeEntryFilter filter, TreeItemSelectionFilter selectionFilter)
 {
     return(selectionFilter.HasTask(Task) &&
            !(filter != null && filter.HideEmptyTasks && !Task.TimeEntries.Any(filter.CanPassFilter)));
 }
 public override bool CanPass(TimeEntryFilter filter, TreeItemSelectionFilter selectionFilter)
 {
     return(filter == null || filter.CanPassFilter(TimeEntry));
 }
Example #6
0
 public override bool CanPass(Core.Model.TimeEntryFilter filter, TreeItemSelectionFilter selectionFilter)
 {
     return(selectionFilter.HasProject(Project) &&
            !(filter != null && filter.HideEmptyProjects && !Children.Any(x => x.CanPass(filter, selectionFilter))));
 }
Example #7
0
 public virtual bool CanPass(TimeEntryFilter filter, TreeItemSelectionFilter selectionFilter)
 {
     return(true);
 }