Beispiel #1
0
 public void UpdateTask(DayOfWeek day, List <CalendarTask> list)
 {
     BindingOperations.AccessCollection(_Task[(int)day], () =>
     {
         var v = _Task[(int)day];
         v.Copy(list);
     }, true);
 }
Beispiel #2
0
 public void UpdateParameters(Dictionary <int, int> value)
 {
     BindingOperations.AccessCollection(Parameters, () =>
     {
         Parameters.Populate(value.Keys.Max() + 1);
         foreach (KeyValuePair <int, int> item in value)
         {
             Parameters[item.Key] = item.Value;
         }
     }, true);
 }
            public DayCollection(string _name, ObservableCollection <CalendarTask> t)
            {
                Name  = _name;
                Tasks = t;

                D = (o) =>
                {
                    BindingOperations.AccessCollection(Tasks, () =>
                    {
                        Tasks.Remove(o);
                    }, true);
                };
            }
Beispiel #4
0
        /// <summary>
        /// What should be changed to get the same values
        /// </summary>
        /// <param name="to">To change</param>
        /// <returns></returns>
        public Dictionary <DayOfWeek, List <CalendarTask> > DiffTask(DataManager to)
        {
            var result = new Dictionary <DayOfWeek, List <CalendarTask> >();

            for (int i = 0; i < Task.Count; ++i)
            {
                BindingOperations.AccessCollection(Task[i], () =>
                {
                    BindingOperations.AccessCollection(to.Task[i], () =>
                    {
                        if (!Task[i].SequenceEqual(to.Task[i]))
                        {
                            result[(DayOfWeek)i] = Task[i].ToList();
                        }
                    }, false);
                }, false);
            }


            return(result);
        }
Beispiel #5
0
        /// <summary>
        /// What should be changed to get the same values
        /// </summary>
        /// <param name="to">To change</param>
        /// <returns></returns>
        public Dictionary <int, int> DiffParameters(DataManager to)
        {
            var result = new Dictionary <int, int>();

            BindingOperations.AccessCollection(Parameters, () =>
            {
                BindingOperations.AccessCollection(to.Parameters, () =>
                {
                    for (int i = 0; i < Parameters.Count; ++i)
                    {
                        var c = Parameters[i];
                        if (i >= to.Parameters.Count || c != to.Parameters[i])
                        {
                            result[i] = c;
                        }
                    }
                }, false);
            }, false);

            return(result);
        }