/// <summary> /// Initializes a new instance of the <see cref="ApplicationModel"/> class. /// </summary> /// <param name="name"> /// The name. /// </param> /// <param name="factory"> /// The factory. /// </param> /// <param name="mediator"> /// The mediator. /// </param> /// <param name="type"> /// The type. /// </param> public ApplicationModel(string name, IDateVmFactory factory, IUserTaskMediator mediator, DateRepresentationType type) { this.Name = name; this.Factory = factory; this.TaskMediator = mediator; this.StartDateType = type; }
/// <summary> /// Initializes a new instance of the <see cref="MonthVm"/> class. /// </summary> /// <param name="dateInfo"> /// The date info. /// </param> /// <param name="factory"> /// The factory. /// </param> /// <param name="taskMediator"> /// The task mediator. /// </param> public MonthVm( DateInfoModel dateInfo, IDateVmFactory factory, IUserTaskMediator taskMediator) : base(dateInfo, factory, taskMediator) { }
/// <summary> /// Initializes a new instance of the <see cref="DateVm"/> class. /// </summary> /// <param name="dateInfo"> /// The date info. /// </param> /// <param name="factory"> /// The factory. /// </param> /// <param name="taskMediator"> /// The task mediator. /// </param> protected DateVm( DateInfoModel dateInfo, IDateVmFactory factory, IUserTaskMediator taskMediator) { this.dateInfo = dateInfo; this.taskMediator = taskMediator; this.factory = factory; this.UpdateTasks(); }
/// <summary> /// Initializes a new instance of the <see cref="TaskVm"/> class. /// </summary> /// <param name="mediator"> /// The mediator. /// </param> /// <param name="factory"> /// The factory. /// </param> /// <param name="dateInfo"> /// The date info. /// </param> /// <param name="task"> /// The task. /// </param> public TaskVm(IUserTaskMediator mediator, IDateVmFactory factory, DateInfoModel dateInfo, UserTaskModel task = null) { // sync the save possibility this.PropertyChanged += (sender, args) => { if (args.PropertyName != "CanSave" && args.PropertyName != "NewTask") { this.OnPropertyChanged("CanSave"); } }; this.OldTask = task ?? new UserTaskModel() { Date = DateTime.Now, EndDate = DateTime.Now }; this.taskMediator = mediator; this.factory = factory; this.dateInfo = dateInfo; this.NewTask = (UserTaskModel)this.OldTask.Clone(); }
/// <summary> /// The create. /// </summary> /// <param name="dateInfo"> /// The date info. /// </param> /// <param name="factory"> /// The factory. /// </param> /// <param name="mediator"> /// The task mediator. /// </param> /// <returns> /// The <see cref="DateVm"/>. /// </returns> public DateVm Create(DateInfoModel dateInfo, IDateVmFactory factory, IUserTaskMediator mediator) { return(this.GetOrCreate(dateInfo)); }