This repository has been archived by the owner on Sep 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Form1.vb
54 lines (46 loc) · 2.09 KB
/
Form1.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
Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Data
Imports System.Drawing
Imports System.Text
Imports System.Windows.Forms
Imports DevExpress.XtraScheduler
Imports DevExpress.XtraScheduler.Native
Imports System.Reflection
Imports System.Collections
Namespace WindowsApplication1
Partial Public Class Form1
Inherits Form
Public Sub New()
InitializeComponent()
End Sub
Private Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles button1.Click
End Sub
Private resources As New List(Of Integer)()
Private Sub schedulerControl1_AppointmentDrag(ByVal sender As Object, ByVal e As DevExpress.XtraScheduler.AppointmentDragEventArgs) Handles schedulerControl1.AppointmentDrag
If resources.Count <> 0 OrElse e.SourceAppointment.ResourceIds.Count > 1 Then
If resources.Count = 0 Then
For i As Integer = 0 To e.SourceAppointment.ResourceIds.Count - 1
resources.Add(Convert.ToInt32(e.SourceAppointment.ResourceIds(i)))
Next i
resources.Remove(Convert.ToInt32(e.HitResource.Id))
End If
Dim j As Integer = 0
Do While j < resources.Count
e.EditedAppointment.ResourceIds.Add(resources(j))
j += 1
Loop
End If
End Sub
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load
Dim res1 As Resource = Me.schedulerStorage1.CreateResource(1, "John")
Dim res2 As Resource = Me.schedulerStorage1.CreateResource(2, "Jane")
Dim res3 As Resource = Me.schedulerStorage1.CreateResource(3, "Bob")
Me.schedulerStorage1.Resources.AddRange(New Resource() { res1, res2, res3 })
End Sub
Private Sub schedulerControl1_DragDrop(ByVal sender As Object, ByVal e As DragEventArgs) Handles schedulerControl1.DragDrop
resources.Clear()
End Sub
End Class
End Namespace