add lookupgrid2, try to fuck around with that dataset of DOOM

This commit is contained in:
Jonathan Jenne
2019-04-24 16:21:21 +02:00
parent 2fcec8d2b6
commit 041916262f
9 changed files with 213 additions and 167 deletions

View File

@@ -58,13 +58,49 @@ Module ModuleFinalIndexProperties
<[ReadOnly](True)>
Public Property VectorIndex As Boolean
<Category("Index")>
<PropertyAttributesProvider("VectorIndexBooleanProvider")>
Public Property AllowAddNewValues As Boolean
<Category("Index")>
<PropertyAttributesProvider("VectorIndexBooleanProvider")>
Public Property PreventDuplicates As Boolean
' Eigenschaften für die Liste der Indicies
<Browsable(False)>
Public Property Indicies As List(Of String)
<Browsable(False)>
Public Property IndiciesType As List(Of Integer)
Public Sub MaybeSetReadOnly(attrs As PropertyAttributes)
Public Sub VectorIndexBooleanProvider(attrs As PropertyAttributes)
MaybeSetReadOnlyIfNotVectorIndex(attrs)
End Sub
Public Sub IndexTypeBooleanProvider(attrs As PropertyAttributes)
MaybeSetBrowsable(attrs, {ClassFinalIndex.INDEX_TYPE_BOOLEAN, ClassFinalIndex.INDEX_TYPE_VECTOR_BOOLEAN})
MaybeSetReadOnlyIfSQLHasNoValue(attrs)
End Sub
Public Sub IndexTypeStringProvider(attrs As PropertyAttributes)
MaybeSetBrowsable(attrs, {ClassFinalIndex.INDEX_TYPE_STRING, ClassFinalIndex.INDEX_TYPE_VECTOR_STRING})
MaybeSetReadOnlyIfSQLHasNoValue(attrs)
End Sub
Public Sub IndexTypeFloatProvider(attrs As PropertyAttributes)
MaybeSetBrowsable(attrs, {ClassFinalIndex.INDEX_TYPE_FLOAT})
MaybeSetReadOnlyIfSQLHasNoValue(attrs)
End Sub
Public Sub IndexTypeIntegerProvider(attrs As PropertyAttributes)
MaybeSetBrowsable(attrs, {ClassFinalIndex.INDEX_TYPE_INTEGER, ClassFinalIndex.INDEX_TYPE_VECTOR_INTEGER_64})
MaybeSetReadOnlyIfSQLHasNoValue(attrs)
End Sub
Public Sub IndexTypeDateProvider(attrs As PropertyAttributes)
MaybeSetBrowsable(attrs, {ClassFinalIndex.INDEX_TYPE_DATE, ClassFinalIndex.INDEX_TYPE_VECTOR_DATE})
MaybeSetReadOnlyIfSQLHasNoValue(attrs)
End Sub
Public Sub MaybeSetReadOnlyIfSQLHasNoValue(attrs As PropertyAttributes)
Dim hasSQLValue As Boolean = (SQLCommand.Value <> String.Empty)
If hasSQLValue Then
@@ -74,6 +110,35 @@ Module ModuleFinalIndexProperties
End If
End Sub
Public Sub MaybeSetReadOnlyIfNotVectorIndex(attrs As PropertyAttributes)
' Get index (position in array) for selected index (windream)
Dim oIndex As Integer = Indicies.IndexOf(IndexName)
If oIndex < 0 Then
attrs.IsReadOnly = True
Exit Sub
End If
' get type of windream index
Dim oType As Integer = IndiciesType.Item(oIndex)
Dim oVectoryTypes = {
ClassFinalIndex.INDEX_TYPE_VECTOR_DATE,
ClassFinalIndex.INDEX_TYPE_VECTOR_BOOLEAN,
ClassFinalIndex.INDEX_TYPE_VECTOR_INTEGER_64,
ClassFinalIndex.INDEX_TYPE_VECTOR_INTEGER,
ClassFinalIndex.INDEX_TYPE_VECTOR_STRING,
ClassFinalIndex.INDEX_TYPE_VECTOR_CURRENCY,
ClassFinalIndex.INDEX_TYPE_VECTOR_FLOAT,
ClassFinalIndex.INDEX_TYPE_VECTOR_DATETIME
}
' if type of index is not a vector, set attribute to read only
If oVectoryTypes.Contains(oType) Then
attrs.IsReadOnly = False
Else
attrs.IsReadOnly = True
End If
End Sub
Public Sub MaybeSetBrowsable(attrs As PropertyAttributes, indexType As Integer())
Dim i As Integer = Indicies.IndexOf(IndexName)
@@ -92,29 +157,6 @@ Module ModuleFinalIndexProperties
End If
End Sub
Public Sub IndexTypeBooleanProvider(attrs As PropertyAttributes)
MaybeSetBrowsable(attrs, {ClassFinalIndex.INDEX_TYPE_BOOLEAN, ClassFinalIndex.INDEX_TYPE_VECTOR_BOOLEAN})
MaybeSetReadOnly(attrs)
End Sub
Public Sub IndexTypeStringProvider(attrs As PropertyAttributes)
MaybeSetBrowsable(attrs, {ClassFinalIndex.INDEX_TYPE_STRING, ClassFinalIndex.INDEX_TYPE_VECTOR_STRING})
MaybeSetReadOnly(attrs)
End Sub
Public Sub IndexTypeFloatProvider(attrs As PropertyAttributes)
MaybeSetBrowsable(attrs, {ClassFinalIndex.INDEX_TYPE_FLOAT})
MaybeSetReadOnly(attrs)
End Sub
Public Sub IndexTypeIntegerProvider(attrs As PropertyAttributes)
MaybeSetBrowsable(attrs, {ClassFinalIndex.INDEX_TYPE_INTEGER, ClassFinalIndex.INDEX_TYPE_VECTOR_INTEGER})
MaybeSetReadOnly(attrs)
End Sub
Public Sub IndexTypeDateProvider(attrs As PropertyAttributes)
MaybeSetBrowsable(attrs, {ClassFinalIndex.INDEX_TYPE_DATE, ClassFinalIndex.INDEX_TYPE_VECTOR_DATE})
MaybeSetReadOnly(attrs)
End Sub
End Class
End Module