AsyncIsNotParallel.MainWindow.AddTimeRectangle C# (CSharp) Метод

AddTimeRectangle() приватный Метод

add a rectangle that whose height & position represents the start and end time of an activity
private AddTimeRectangle ( double startTime, double endTime, Color color, int column ) : void
startTime double
endTime double
color Color
column int
Результат void
        private void AddTimeRectangle(double startTime, double endTime, Color color, int column)
        {
            const int columnWidth = 50;
            Debug.WriteLine("Adding Rect {0} {1} {2}", startTime, endTime, color);

            double left = column * (columnWidth * 2 / 3);
            double height = endTime - startTime;

            Rectangle r = new Rectangle()
            {
                Fill = new SolidColorBrush(color),
                Width = columnWidth,
                Height = height,
            };
            Canvas.SetLeft(r, left);
            Canvas.SetTop(r, startTime);

            theRootCanvas.Children.Add(r);

            if (theRootCanvas.Height < endTime)
            {
                theRootCanvas.Height = endTime;
            }
            if (theRootCanvas.Width < left + columnWidth)
            {
                theRootCanvas.Width = left + columnWidth;
            }
        }
    }