Beispiel #1
0
        private void CalculateMinimumEarliestStartDateTime()
        {
            int?minimumEarliestStartTime = DependentActivity.MinimumEarliestStartTime;

            if (minimumEarliestStartTime.HasValue)
            {
                m_MinimumEarliestStartDateTime = m_DateTimeCalculator.AddDays(ProjectStart, minimumEarliestStartTime.GetValueOrDefault());
            }
            else
            {
                m_MinimumEarliestStartDateTime = null;
            }
        }
        private GanttTask CreateGanttTask(
            DateTime projectStart,
            ActivityModel activity,
            SlackColorFormatLookup colorFormatLookup)
        {
            Color background = colorFormatLookup?.FindSlackColor(activity.TotalSlack) ?? Colors.DodgerBlue;

            return(new GanttTask
            {
                Start = m_DateTimeCalculator.AddDays(projectStart, activity.EarliestStartTime.Value),
                End = m_DateTimeCalculator.AddDays(projectStart, activity.EarliestFinishTime.Value),
                Name = activity.Name,
                BackgroundColor = new SolidColorBrush(background),
                ForegroundColor = new SolidColorBrush(ContrastConvert(background)),
                Radius = activity.Duration < 3 ? 0 : 5,
                TaskProgressVisibility = Visibility.Collapsed,
            });
        }
Beispiel #3
0
 public static string FormatScheduleOutput(int days, bool showDates, DateTime projectStart, IDateTimeCalculator dateTimeCalculator)
 {
     if (dateTimeCalculator == null)
     {
         throw new ArgumentNullException(nameof(dateTimeCalculator));
     }
     if (showDates)
     {
         return(dateTimeCalculator.AddDays(projectStart, days).ToString("d"));
     }
     return(days.ToString());
 }
Beispiel #4
0
        public static double CalculateChartTimeXValue(int input, bool showDates, DateTime projectStart, IDateTimeCalculator dateTimeCalculator)
        {
            if (dateTimeCalculator == null)
            {
                throw new ArgumentNullException(nameof(dateTimeCalculator));
            }
            double output = input;

            if (showDates)
            {
                output = DateTimeAxis.ToDouble(dateTimeCalculator.AddDays(projectStart, input));
            }
            return(output);
        }