You can inherit from this class to implement custom time scales with different fixed intervals. For more complex tasks, you should inherit from the TimeScale class.
In your descendant class, you have to modify the class constructor so it calls a base (TimeScaleFixedInterval) constructor with the desired fixed interval as a parameter.
For a two-hour time scale, it looks like this:
C# |
public class MyTwoHourTimeScale : TimeScaleFixedInterval
{
private const bool defaultEnabled = true;
public MyTwoHourTimeScale()
: base(TimeSpan.FromHours(2.0)){}
protected override string DefaultDisplayName
{ get{return "TwoHour Scale";}}
protected override string DefaultMenuCaption
{ get{return "TwoHour Scale";}}
}
|
VB |
Public Class MyTwoHourTimeScale
Inherits TimeScaleFixedInterval
Private Const defaultEnabled As Boolean = True
Public Sub New()
MyBase.New(TimeSpan.FromHours(2.0))
End Sub
Protected Overrides ReadOnly Property DefaultDisplayName() As String
Get
Return "TwoHour Scale"
End Get
End Property
Protected Overrides ReadOnly Property DefaultMenuCaption() As String
Get
Return "TwoHour Scale"
End Get
End Property
End Class
|