예제 #1
0
 /// <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;
 }
예제 #2
0
 /// <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)
 {
 }
예제 #3
0
 /// <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();
 }
예제 #4
0
        /// <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();
        }
예제 #5
0
 /// <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));
 }