Esempio n. 1
0
        private CustomRecurrenceTask GetRecurrence(IGanttTask task, int index)
        {
            CustomRecurrenceTask taskToReturn = null;
            var recurrenceTask = task as CustomRecurrenceTask;

            if (recurrenceTask != null && recurrenceTask.RecurrenceRule != null)
            {
                var start = new DateTime(recurrenceTask.RecurrenceRule.Start.Ticks + index * recurrenceTask.RecurrenceRule.Interval.Ticks);
                var end   = start + (recurrenceTask.End - recurrenceTask.Start);

                taskToReturn = new CustomRecurrenceTask(start, end, "recurrence " + (index + 1).ToString());
            }
            return(taskToReturn);
        }
        private CustomRecurrenceTask GetRecurrence(IGanttTask task, int index)
        {
            CustomRecurrenceTask taskToReturn = null;
            var recurrenceTask = task as CustomRecurrenceTask;

            if (recurrenceTask != null && recurrenceTask.RecurrenceRule != null)
            {
                var start = new DateTime(recurrenceTask.RecurrenceRule.Start.Ticks + index * recurrenceTask.RecurrenceRule.Interval.Ticks);
                var end = start + (recurrenceTask.End - recurrenceTask.Start);

                taskToReturn = new CustomRecurrenceTask(start, end, "recurrence " + (index + 1).ToString());
            }
            return taskToReturn;
        }
Esempio n. 3
0
        private ObservableCollection <GanttTask> GetTasks()
        {
            var collection    = new ObservableCollection <GanttTask>();
            var today         = DateTime.Today.AddHours(8);
            var interval      = new TimeSpan(8, 0, 0);
            var recurringTask = new CustomRecurrenceTask(today.AddHours(-5), today.AddHours(-1), "Task with 3 recurrences")
            {
                RecurrenceRule = new RecurrenceRule(today.AddHours(-5), interval, 3)
            };

            collection.Add(recurringTask);
            var normalTask = new GanttTask(today.AddHours(8), today.AddHours(13), "Task Without Recurrence");

            normalTask.Children.Add(new GanttTask(today.AddHours(9), today.AddHours(12), "Child Task"));
            collection.Add(normalTask);

            return(collection);
        }
Esempio n. 4
0
        private ObservableCollection<GanttTask> GetTasks()
        {
            var collection = new ObservableCollection<GanttTask>();
            var today = DateTime.Today.AddHours(8);
            var interval = new TimeSpan(8, 0, 0);
            var recurringTask = new CustomRecurrenceTask(today.AddHours(-5), today.AddHours(-1), "Task with 3 recurrences")
            {
                RecurrenceRule = new RecurrenceRule(today.AddHours(-5), interval, 3)
            };
            collection.Add(recurringTask);
            var normalTask = new GanttTask(today.AddHours(8), today.AddHours(13), "Task Without Recurrence");
            normalTask.Children.Add(new GanttTask(today.AddHours(9), today.AddHours(12), "Child Task"));
            collection.Add(normalTask);

            return collection;
        }