This repository has been archived by the owner on Jun 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ExampleUtils.vb
52 lines (44 loc) · 1.97 KB
/
ExampleUtils.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
Imports System
Imports System.Collections.Generic
Imports System.Text
Imports DevExpress.XtraScheduler
Namespace SchedulerFilterReminders
Public NotInheritable Class ExampleUtils
Private Sub New()
End Sub
Public Shared baseTime As Date = Date.Today.AddDays(-1)
Public Shared Users() As String = { "Peter Dolan", "Ryan Fischer", "Andrew Miller" }
Public Shared Sub GenerateSampleResources(ByVal storage As SchedulerStorage)
Dim resources As ResourceCollection = storage.Resources.Items
storage.BeginUpdate()
Try
For i As Integer = 0 To ExampleUtils.Users.Length - 1
Dim resource As Resource = storage.CreateResource(i + 1)
resource.Caption = ExampleUtils.Users(i)
resources.Add(resource)
Next i
Finally
storage.EndUpdate()
End Try
End Sub
Public Shared Sub GenerateSampleAppointments(ByVal storage As SchedulerStorage)
Dim appointments As AppointmentCollection = storage.Appointments.Items
storage.BeginUpdate()
Try
For i As Integer = 0 To ExampleUtils.Users.Length - 1
Dim appointment As Appointment = storage.CreateAppointment(AppointmentType.Normal)
appointment.Start = baseTime.AddHours((i + 1) * 2)
appointment.Duration = TimeSpan.FromHours(1)
appointment.Subject = ExampleUtils.Users(i) & "'s Appointment"
appointment.Location = "Office"
appointment.ResourceId = i + 1
appointment.HasReminder = True
appointment.Reminder.TimeBeforeStart = TimeSpan.FromMinutes(10)
appointments.Add(appointment)
Next i
Finally
storage.EndUpdate()
End Try
End Sub
End Class
End Namespace