-
Notifications
You must be signed in to change notification settings - Fork 1
/
CustomTimeScale.vb
74 lines (66 loc) · 1.75 KB
/
CustomTimeScale.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
Imports System
Imports System.Collections.Generic
Imports System.Text
Imports DevExpress.XtraScheduler
Imports DevExpress.XtraScheduler.Native
Namespace TimelineTimeScales
Public Class MyTimeScaleWorkHours
Inherits TimeScaleHour
Public Sub New()
End Sub
Public Overrides Property DisplayName() As String
Get
Return "Custom Work Hours"
End Get
Set(ByVal value As String)
MyBase.DisplayName = value
End Set
End Property
Public Overrides Property MenuCaption() As String
Get
Return "Custom Work Hours"
End Get
Set(ByVal value As String)
MyBase.MenuCaption = value
End Set
End Property
Public Overrides Function FormatCaption(ByVal start As Date, ByVal [end] As Date) As String
If start.Hour <= 12 Then
Return start.Hour.ToString() & " AM"
Else
Return (start.Hour - 12).ToString() & " PM"
End If
End Function
Public Overrides Function IsDateVisible(ByVal [date] As Date) As Boolean
If [date].Hour >= 6 AndAlso [date].Hour <= 21 Then
Return Not ([date].Hour = 14)
Else
Return False
End If
End Function
End Class
Public Class MyTimeScaleWorkWeekDays
Inherits TimeScaleDay
Public Sub New()
End Sub
Public Overrides Property DisplayName() As String
Get
Return "Custom Week Days"
End Get
Set(ByVal value As String)
MyBase.DisplayName = value
End Set
End Property
Public Overrides Property MenuCaption() As String
Get
Return "Custom Week Days"
End Get
Set(ByVal value As String)
MyBase.MenuCaption = value
End Set
End Property
Public Overrides Function IsDateVisible(ByVal [date] As Date) As Boolean
Return Not ([date].DayOfWeek = DayOfWeek.Saturday OrElse [date].DayOfWeek = DayOfWeek.Sunday)
End Function
End Class
End Namespace