protected SystemDefinedView(IWorkbook workbook, ISystemView view) : base(workbook, view) { this.view = view; this.Ready(); }
public void AddSystemView(ISystemView view) { if (view.Id == 0) { view.Id = viewId++; } this.views.Add(view); }
public void RemoveSystemView(ISystemView view) { if (view == null) { throw new ArgumentNullException(nameof(view)); } this.Delete(view); this.views.Remove(view); }
public static ISystemView BuildView(IWorkbook workbook, ISystemView view) { if (workbook == null) { throw new ArgumentNullException("workbook"); } if (view == null) { throw new ArgumentNullException("view"); } switch (view.ViewKind) { case ViewKind.Today: return(new ViewToday(workbook, view)); case ViewKind.Week: return(new ViewWeek(workbook, view)); case ViewKind.All: return(new ViewAll(workbook, view)); case ViewKind.Completed: return(new ViewCompleted(workbook, view)); case ViewKind.Starred: return(new ViewStarred(workbook, view)); case ViewKind.NoDate: return(new ViewNoDate(workbook, view)); case ViewKind.Tomorrow: return(new ViewTomorrow(workbook, view)); case ViewKind.Reminder: return(new ViewReminder(workbook, view)); case ViewKind.Late: return(new ViewLate(workbook, view)); case ViewKind.StartDate: return(new ViewStartDate(workbook, view)); case ViewKind.NonCompleted: return(new ViewNonCompleted(workbook, view)); case ViewKind.ToSync: return(new ViewToSync(workbook, view)); default: throw new ArgumentOutOfRangeException(nameof(view)); } }
public void LoadViews() { foreach (var view in this.databaseContext.Views.OrderBy(f => f.Order)) { if (!this.views.Any(v => v.ViewKind == view.ViewKind)) { ISystemView systemView = ViewFactory.BuildView(this, view); systemView.PropertyChanged += this.OnFolderPropertyChanged; this.views.Add(systemView); } } }
public EditViewViewModel(ISystemView view, IWorkbook workbook, INavigationService navigationService, IMessageBoxService messageBoxService, IPlatformService platformService) : base(workbook, navigationService, messageBoxService, platformService) { if (view == null) { throw new ArgumentNullException(nameof(view)); } this.view = view; this.IsAscending = view.GroupAscending; this.TaskGroup = view.TaskGroup; }
public void AddSystemView(ISystemView view) { if (view == null) { throw new ArgumentNullException(nameof(view)); } var target = this.views.FirstOrDefault(t => t.ViewKind == view.ViewKind); if (target != null) { return; } this.objectTracker.EnsureIsTracked(view); this.connection.Insert(view); this.views.Add(view); }
public ViewStarred(IWorkbook workbook, ISystemView view) : base(workbook, view) { }
public void RemoveSystemView(ISystemView view) { this.views.Remove(view); }
public ViewReminder(IWorkbook workbook, ISystemView view) : base(workbook, view) { }
public ViewWeek(IWorkbook workbook, ISystemView view) : base(workbook, view) { }
public ViewTomorrow(IWorkbook workbook, ISystemView view) : base(workbook, view) { }
public ViewLate(IWorkbook workbook, ISystemView view) : base(workbook, view) { }
public void AddView(ISystemView view) { this.databaseContext.AddSystemView(view); this.databaseContext.SendChanges(); }
public ViewCompleted(IWorkbook workbook, ISystemView view) : base(workbook, view) { }
public FolderItemViewModel(IWorkbook workbook, IAbstractFolder folder) { if (workbook == null) { throw new ArgumentNullException(nameof(workbook)); } if (folder == null) { throw new ArgumentNullException(nameof(folder)); } this.workbook = workbook; this.settings = workbook.Settings; this.settings.KeyChanged += this.OnSettingsKeyChanged; this.folder = folder; this.setTargetGroupCommand = new RelayCommand <string>(taskGroup => this.SelectedTaskGroup = TaskGroupConverter.FromName(taskGroup)); this.contextualCommand = new RelayCommand(this.ContextualCommandExecute); this.showFutureStartDates = this.workbook.Settings.GetValue <bool>(CoreSettings.ShowFutureStartDates); this.isDatesGrouped = this.workbook.Settings.GetValue <bool>(CoreSettings.UseGroupedDates); this.hideCompletedTasks = this.workbook.Settings.GetValue <CompletedTaskMode>(CoreSettings.CompletedTasksMode) == CompletedTaskMode.Hide; ISystemView view = this.folder as ISystemView; if (view != null) { this.viewKind = view.ViewKind; } else if (this.folder is ViewSearch) { this.viewKind = ViewKind.Search; } else { this.viewKind = ViewKind.None; } this.trackedTasks = new List <ITask>(); this.folder.TaskAdded += (s, e) => this.AddTask(e.Item); this.folder.TaskRemoved += (s, e) => this.RemoveTask(e.Item); this.folder.PropertyChanged += (s, e) => { if (e.PropertyName == "Name") { this.RaisePropertyChanged("Name"); } else if (e.PropertyName == "TaskCount" && this.folder.HasCustomCommand) { this.RaisePropertyChanged("HasContextualCommand"); } }; this.folder.GroupingChanged += (s, e) => { this.smartCollection.GroupBuilder = GroupBuilderFactory.GetGroupBuilder(this.folder, this.settings); this.RaisePropertyChanged("DisplayFolder"); this.RaisePropertyChanged("DisplayDue"); }; // the last parameter is a function which returns the folder associated with a task // when we group by folder, it's the folder of the task // otherwise (most of the time), it's the folder of this ViewModel this.smartCollection = new SmartCollection <ITask>( this.folder.Tasks, GroupBuilderFactory.GetGroupBuilder(this.folder, this.workbook.Settings), this.TaskFilter, this, task => this.folder); foreach (var task in this.folder.Tasks) { this.StartTrackingTask(task); } }
public void AddSystemView(ISystemView view) { this.views.Add(view); }
public ViewToSync(IWorkbook workbook, ISystemView view) : base(workbook, view) { }