Adapting the styles
Each of the elements created has "Style" objects as a sub-member, containing all the properties that can also be seen in the corresponding properties window in Visual Studio. The color and the number of digits, for example, can be set in the style classes of a channel.
private void ChangeChannelSettings(Channel channel)
{
DigitalStyle digitalStyle = channel.SubMember.OfType<ChannelStyle>().Last().SubMember.OfType<DigitalStyle>().Last();
digitalStyle.BackgroundColor = Color.LightGray;
digitalStyle.Precision = 5;
}
Overview of the various style hierarchies. The subordinate classes are always located in the SubMember lists of the superordinate class.
Chart
- ChartStyle (general style properties for a chart)
Channel
- ChannelStyle (general style properties of a channel)
- DigitalStyle (contains special settings for the digital chart)