Demo Final

This commit is contained in:
2026-03-08 09:08:23 -04:00
parent 127183c5a2
commit 64cee1fbea
3 changed files with 212 additions and 3 deletions

View File

@@ -0,0 +1,53 @@
Imports ORPublicApiRefCore
Public Module modOHCommon
<ThreadStatic> Private _rstData As List(Of KeyValuePair(Of String, DTRecordSet))
Public Property rs(ByVal uniqueIdent As String) As DTRecordSet
Get
Return rstData(uniqueIdent)
End Get
Set(value As DTRecordSet)
rstData(uniqueIdent) = value
End Set
End Property
Public Property rstData(ByVal uniqueIdent As String) As DTRecordSet
Get
Dim localRs As List(Of KeyValuePair(Of String, DTRecordSet))
If _rstData Is Nothing Then
_rstData = New List(Of KeyValuePair(Of String, DTRecordSet))
End If
localRs = _rstData
For Each kvp As KeyValuePair(Of String, DTRecordSet) In localRs
If kvp.Key = uniqueIdent Then
Return kvp.Value
End If
Next kvp
'Throw New Exception("rstData(" & uniqueIdent & ") could not be found")
Return Nothing
End Get
Set(ByVal value As DTRecordSet)
Dim localRs As List(Of KeyValuePair(Of String, DTRecordSet))
If _rstData Is Nothing Then
_rstData = New List(Of KeyValuePair(Of String, DTRecordSet))
End If
localRs = _rstData
'remove from list if exists, then replace
For Each kvp As KeyValuePair(Of String, DTRecordSet) In localRs
If kvp.Key = uniqueIdent Then
localRs.Remove(kvp)
Exit For
End If
Next kvp
Dim wrapKVP As New KeyValuePair(Of String, DTRecordSet)(uniqueIdent, value)
localRs.Add(wrapKVP)
End Set
End Property
End Module