Back to Devexpress

TimeScaleFixedInterval Class

corelibraries-devexpress-dot-xtrascheduler-2eee4826.md

latest3.2 KB
Original Source

TimeScaleFixedInterval Class

Serves as a base for the classes for which TimeScaleFixedInterval.Value is a fixed time interval.

Namespace : DevExpress.XtraScheduler

Assembly : DevExpress.XtraScheduler.v25.2.Core.dll

NuGet Package : DevExpress.Scheduler.Core

Declaration

csharp
public class TimeScaleFixedInterval :
    TimeScale
vb
Public Class TimeScaleFixedInterval
    Inherits TimeScale

Remarks

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:

csharp
public class MyTwoHourTimeScale : TimeScaleFixedInterval
{
    // Fields
    private const bool defaultEnabled = true;
    // Methods
    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
    ' Fields
    Private Const defaultEnabled As Boolean = True
    ' Methods
    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

Implements

IIdProvider

Inheritance

Object UserInterfaceObject TimeScale TimeScaleFixedInterval TimeScale15Minutes

TimeScaleDay

TimeScaleHour

TimeScaleWeek

TimeScaleWorkDay

TimeScaleWorkHour

See Also

TimeScaleFixedInterval Members

DevExpress.XtraScheduler Namespace