Ejemplo n.º 1
0
        internal static DataManager CreateNew()
        {
            Data data = new Data();

            //Ein paar Anweisungen für die App erstellen.
            var task1 = new Task(0, Guid.NewGuid().ToString(), Localization.Strings.DataNewCreatedTask1, data.User.UserId, DateTime.Now - TimeSpan.FromDays(1),
                DateTime.Today - TimeSpan.FromDays(1), false, DateTime.Now);
            var task2 = new Task(0, Guid.NewGuid().ToString(),
                Localization.Strings.DataNewCreatedTask2,
                data.User.UserId, DateTime.Now,
                DateTime.Today, false, DateTime.Now);
            var task3 = new Task(0, Guid.NewGuid().ToString(),
                Localization.Strings.DataNewCreatedTask3,
                data.User.UserId, DateTime.Now,
                DateTime.Today.AddDays(1), false, DateTime.Now);

            data.TaskAssignedToRelationship.Add(new TaskAssignedTo() { Score = 200, IsDone = false, PersonUserId = data.User.UserId, TaskId = task1.TaskId });
            data.TaskAssignedToRelationship.Add(new TaskAssignedTo() { Score = 100, IsDone = false, PersonUserId = data.User.UserId, TaskId = task2.TaskId });
            data.TaskAssignedToRelationship.Add(new TaskAssignedTo() { Score = 50, IsDone = false, PersonUserId = data.User.UserId, TaskId = task3.TaskId });
            data.Tasks.Add(task1);
            data.Tasks.Add(task2);
            data.Tasks.Add(task3);

            return new DataManager(data);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Konstruktor.
        /// </summary>
        /// <param name="user">Der User der App.</param>
        private DataManager(Data data)
        {
            this.data = data;
            this.data.TaskAssignedToRelationship.CollectionChanged += TaskAssignedToRelationship_CollectionChanged;
            this.data.PropertyChanged += data_PropertyChanged;
            foreach (TaskAssignedTo item in this.data.TaskAssignedToRelationship)
                item.PropertyChanged += OnTaskAssignedToChanged;

            this.LogInTask = this.AuthenticateSilent();
        }