-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathClasses.vb
105 lines (93 loc) · 3.14 KB
/
Classes.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
Imports System.Text
Imports HomeSeerAPI
Public Module Classes
<Serializable()> _
Public Class hsCollection
Inherits Dictionary(Of String, Object)
Dim KeyIndex As New Collection
Public Sub New()
MyBase.New()
End Sub
Protected Sub New(ByVal info As System.Runtime.Serialization.SerializationInfo, ByVal context As System.Runtime.Serialization.StreamingContext)
MyBase.New(info, context)
End Sub
Public Overloads Sub Add(value As Object, Key As String)
If Not MyBase.ContainsKey(Key) Then
MyBase.Add(Key, value)
KeyIndex.Add(Key, Key)
Else
MyBase.Item(Key) = value
End If
End Sub
Public Overloads Sub Remove(Key As String)
On Error Resume Next
MyBase.Remove(Key)
KeyIndex.Remove(Key)
End Sub
Public Overloads Sub Remove(Index As Integer)
MyBase.Remove(KeyIndex(Index))
KeyIndex.Remove(Index)
End Sub
Public Overloads ReadOnly Property Keys(ByVal index As Integer) As Object
Get
Dim i As Integer
Dim key As String = Nothing
For Each key In MyBase.Keys
If i = index Then
Exit For
Else
i += 1
End If
Next
Return key
End Get
End Property
Default Public Overloads Property Item(ByVal index As Integer) As Object
Get
Return MyBase.Item(KeyIndex(index))
End Get
Set(ByVal value As Object)
MyBase.Item(KeyIndex(index)) = value
End Set
End Property
Default Public Overloads Property Item(ByVal Key As String) As Object
Get
On Error Resume Next
Return MyBase.Item(Key)
End Get
Set(ByVal value As Object)
MyBase.Item(Key) = value
End Set
End Property
End Class
<Serializable()> _
Public Class action
Inherits hsCollection
Public Sub New()
MyBase.New()
End Sub
Protected Sub New(ByVal info As System.Runtime.Serialization.SerializationInfo, ByVal context As System.Runtime.Serialization.StreamingContext)
MyBase.New(info, context)
End Sub
End Class
<Serializable()>
Public Class trigger
Inherits hsCollection
Public IsCondition As Boolean = False
Public HasConditions As Boolean = False
Public Sub New()
MyBase.New()
End Sub
Protected Sub New(ByVal info As System.Runtime.Serialization.SerializationInfo, ByVal context As System.Runtime.Serialization.StreamingContext)
MyBase.New(info, context)
End Sub
End Class
Public Class TransmitQitem
Public Buf() As Byte
Public Count As Integer
Public RetryCount As Integer
Public Sub New()
RetryCount = 0
End Sub
End Class
End Module