This commit is contained in:
SchreiberM
2015-12-14 17:19:29 +01:00
4 changed files with 72 additions and 0 deletions

View File

@@ -772,6 +772,8 @@ Public Class ClassControlBuilder
control.Parent = _master_panel
control.DropDownStyle = ComboBoxStyle.DropDown
control.FormattingEnabled = True
control.AutoCompleteMode = AutoCompleteMode.Append
control.AutoCompleteSource = AutoCompleteSource.ListItems
If (Not _designMode And read_only) Then
control.Enabled = Not read_only

View File

@@ -0,0 +1,68 @@
Public Class ClassControlValueCache
Private Shared Property Cache As New Dictionary(Of String, Dictionary(Of String, DataTable))
Public Shared Function LoadFromCache(formId As Integer, controlId As Integer) As DataTable
Dim dict As Dictionary(Of String, DataTable) = GetCachedFormDict(formId.ToString())
If IsNothing(dict) Then
Return Nothing
Else
Dim dt As DataTable = GetCachedControlDict(dict, controlId.ToString())
If IsNothing(dt) Then
Return Nothing
Else
Return dt
End If
End If
End Function
Public Shared Function SaveToCache(formId As Integer, controlId As Integer, dt As DataTable) As DataTable
Dim dict As Dictionary(Of String, DataTable) = GetCachedFormDict(formId.ToString())
If IsNothing(dict) Then
dict = SetCachedFormDict(formId.ToString(), New Dictionary(Of String, DataTable))
End If
SetCachedControlDict(dict, controlId.ToString(), dt)
Return dt
End Function
Private Shared Function GetCachedFormDict(formId As Integer) As Dictionary(Of String, DataTable)
If Cache.ContainsKey(formId.ToString()) Then
Return Cache.Item(formId.ToString())
Else
Return Nothing
End If
End Function
Private Shared Function SetCachedFormDict(formId As Integer, dict As Dictionary(Of String, DataTable)) As Dictionary(Of String, DataTable)
Cache.Item(formId.ToString()) = dict
Return dict
End Function
Private Shared Function GetCachedControlDict(dict As Dictionary(Of String, DataTable), controlId As Integer) As DataTable
If dict.ContainsKey(controlId.ToString()) Then
Return dict.Item(controlId.ToString())
Else
Return Nothing
End If
End Function
Private Shared Function SetCachedControlDict(dict As Dictionary(Of String, DataTable), controlId As Integer, dt As DataTable) As DataTable
dict.Item(controlId.ToString()) = dt
Return dt
End Function
End Class

View File

@@ -241,6 +241,7 @@
<Import Include="System.Threading.Tasks" />
</ItemGroup>
<ItemGroup>
<Compile Include="ClassControlValueCache.vb" />
<Compile Include="ClassControlValuesConverter.vb" />
<Compile Include="ClassLicence.vb" />
<Compile Include="frmAbout.designer.vb">

View File

@@ -1022,6 +1022,7 @@ Public Class frmForm_Constructor_Main_2
NEW_RECORD_ID = 0
If Not RECORD_CHANGED Then
Update_Status_Label(True, "KEINE Änderungen an Datensatz.")
Me.Cursor = Cursors.Default
Exit Sub
End If
End If