Пример #1
0
        private Color GetForeColor(TimelineSection section, TimelineSectionComponents component)
        {
            bool isActivelyHighlighted   = section.MouseOver == component;
            bool isInActivelyHighlighted = !isActivelyHighlighted && section.MouseOver != TimelineSectionComponents.None;

            IThemed componentItem = section;

            if (component == TimelineSectionComponents.StartSeparator)
            {
                componentItem = section.Start;
            }
            else if (component == TimelineSectionComponents.EndSeparator)
            {
                componentItem = section.End;
            }

            return(GetForeColor(componentItem, isActivelyHighlighted, isInActivelyHighlighted));
        }
Пример #2
0
        private void DrawSeparator(PaintEventArgs e, TimelineSection section, TimelineSectionComponents component)
        {
            Rectangle bounds;
            bool      isMajor;

            switch (component)
            {
            case TimelineSectionComponents.StartSeparator:
                bounds  = GetStartBounds(section);
                isMajor = IsMajorTickline(section.Start);
                break;

            case TimelineSectionComponents.EndSeparator:
                if (!section.End.IsVisible)
                {
                    return;
                }
                bounds  = GetEndBounds(section);
                isMajor = IsMajorTickline(section.End);
                break;

            default:
                throw new NotImplementedException();
            }

            if (isMajor)
            {
                e.Graphics.FillRectangle(new SolidBrush(GetForeColor(section, component)), bounds);
                e.Graphics.DrawRectangle(new Pen(GetEdgeColor(section, component), 1), bounds);
            }
            else
            {
                e.Graphics.FillRectangle(new SolidBrush(GetForeColor(section, component)), bounds);
                e.Graphics.DrawRectangle(new Pen(GetEdgeColor(section, component), 1), bounds);
            }
        }
Пример #3
0
 private Pen GetPen(TimelineSection section, TimelineSectionComponents component)
 {
     return(new Pen(GetForeColor(section, component), TimelineThickness));
 }