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)); }
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); } }
private Pen GetPen(TimelineSection section, TimelineSectionComponents component) { return(new Pen(GetForeColor(section, component), TimelineThickness)); }