jj Designer Update
This commit is contained in:
@@ -1,14 +1,23 @@
|
||||
Imports System.ComponentModel
|
||||
Imports System.Drawing.Design
|
||||
Imports System.Globalization
|
||||
|
||||
Public Module ModuleControlProperties
|
||||
Private _id As Integer
|
||||
Private _name As String
|
||||
Private _location As Point
|
||||
Private _width As Integer
|
||||
Private _height As Integer
|
||||
Public Enum IndexTypes
|
||||
SimpleIndex = 0
|
||||
VectorIndex = 1
|
||||
End Enum
|
||||
|
||||
Public Class BaseProperties
|
||||
<ReadOnlyAttribute(True)>
|
||||
Private _id As Integer
|
||||
Private _name As String
|
||||
Private _location As Point
|
||||
Private _size As Size
|
||||
Private _font As Font
|
||||
Private _text_color As Color
|
||||
|
||||
<Category("Allgemein")>
|
||||
<[ReadOnly](True)>
|
||||
Public Property ID() As Integer
|
||||
Get
|
||||
Return _id
|
||||
@@ -18,6 +27,7 @@ Public Module ModuleControlProperties
|
||||
End Set
|
||||
End Property
|
||||
|
||||
<Category("Allgemein")>
|
||||
Public Property Name() As String
|
||||
Get
|
||||
Return _name
|
||||
@@ -27,6 +37,7 @@ Public Module ModuleControlProperties
|
||||
End Set
|
||||
End Property
|
||||
|
||||
<Category("Anzeige")>
|
||||
Public Property Location() As Point
|
||||
Get
|
||||
Return _location
|
||||
@@ -36,48 +47,183 @@ Public Module ModuleControlProperties
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property Width() As Integer
|
||||
<Category("Anzeige")>
|
||||
Public Property Size() As Size
|
||||
Get
|
||||
Return _width
|
||||
Return _size
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
_width = value
|
||||
Set(value As Size)
|
||||
_size = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property Height() As Integer
|
||||
<Category("Anzeige")>
|
||||
<TypeConverter(GetType(FontConverter))>
|
||||
Public Property Font As Font
|
||||
Get
|
||||
Return _height
|
||||
Return _font
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
_height = value
|
||||
Set(value As Font)
|
||||
_font = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
<Category("Anzeige")>
|
||||
Public Property TextColor As Color
|
||||
Get
|
||||
Return _text_color
|
||||
End Get
|
||||
Set(value As Color)
|
||||
_text_color = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Class FontConverter
|
||||
Inherits TypeConverter
|
||||
|
||||
Public Overrides Function ConvertTo(context As ITypeDescriptorContext, culture As CultureInfo, value As Object, destinationType As Type) As Object
|
||||
Dim font = DirectCast(value, Font)
|
||||
Return $"{font.Name}, {font.Size}"
|
||||
End Function
|
||||
End Class
|
||||
End Class
|
||||
|
||||
Public Class TextboxProperties
|
||||
Public Class InputProperties
|
||||
Inherits BaseProperties
|
||||
|
||||
Private _required As Boolean
|
||||
Private _read_only As Boolean
|
||||
Private _index_type As String
|
||||
Private _indicies As List(Of String)
|
||||
Private _index As String
|
||||
Private _sql_command As String
|
||||
|
||||
Public Property Required() As String
|
||||
Public Property Required() As Boolean
|
||||
Get
|
||||
Return _required
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
Set(ByVal value As Boolean)
|
||||
_required = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property [ReadOnly]() As String
|
||||
Public Property [ReadOnly]() As Boolean
|
||||
Get
|
||||
Return _read_only
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
Set(ByVal value As Boolean)
|
||||
_read_only = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
<Category("Indexierung")>
|
||||
Public Property IndexType() As IndexTypes
|
||||
Get
|
||||
Return _index_type
|
||||
End Get
|
||||
Set(ByVal value As IndexTypes)
|
||||
_index_type = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Diese Eigenschaft enthält die auswählbaren Indicies, die für das Control verfügbar sind. Wird nicht direkt angezeigt.
|
||||
''' </summary>
|
||||
<Browsable(False)>
|
||||
Public Property Indicies() As List(Of String)
|
||||
Get
|
||||
Return _indicies
|
||||
End Get
|
||||
Set(ByVal value As List(Of String))
|
||||
_indicies = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Diese Eigenschaft enthält des ausgewählten Index
|
||||
''' </summary>
|
||||
<Category("Indexierung")>
|
||||
<TypeConverter(GetType(IndexListConverter))>
|
||||
Public Property Index() As String
|
||||
Get
|
||||
Return _index
|
||||
End Get
|
||||
Set(value As String)
|
||||
_index = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
<Category("Daten")>
|
||||
Public Property SQLCommand() As SQLValue
|
||||
Get
|
||||
Return New SQLValue(NotNull(_sql_command, ""))
|
||||
End Get
|
||||
Set(ByVal value As SQLValue)
|
||||
_sql_command = value.Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Sorgt dafür, dass die Liste von Indicies aus dem gleichnamigen Feld ausgelesen wird
|
||||
''' </summary>
|
||||
Public Class IndexListConverter
|
||||
Inherits TypeConverter
|
||||
|
||||
Public Overrides Function GetStandardValuesSupported(context As ITypeDescriptorContext) As Boolean
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Public Overrides Function GetStandardValues(context As ITypeDescriptorContext) As StandardValuesCollection
|
||||
Dim indexList = DirectCast(context.Instance, InputProperties).Indicies
|
||||
Dim values As New StandardValuesCollection(indexList)
|
||||
Return values
|
||||
End Function
|
||||
|
||||
Public Overrides Function ConvertTo(context As ITypeDescriptorContext, culture As CultureInfo, value As Object, destinationType As Type) As Object
|
||||
If IsNothing(value) Then
|
||||
Return ""
|
||||
Else
|
||||
Return value.ToString()
|
||||
End If
|
||||
End Function
|
||||
End Class
|
||||
|
||||
Public Class SQLTypeConverter
|
||||
Inherits TypeConverter
|
||||
|
||||
Public Overrides Function ConvertTo(context As ITypeDescriptorContext, culture As Globalization.CultureInfo, value As Object, destinationType As Type) As Object
|
||||
'Return MyBase.ConvertTo(context, culture, value, destinationType)
|
||||
Dim sqlvalue As SQLValue = DirectCast(value, SQLValue)
|
||||
Return sqlvalue.Value
|
||||
End Function
|
||||
End Class
|
||||
|
||||
''' <summary>
|
||||
''' Hilfsklasse, die für das anzeigen und abspeichern von SQL-Befehlen verwendet wird
|
||||
''' </summary>
|
||||
<Editor(GetType(ClassSQLEditor), GetType(UITypeEditor))>
|
||||
<TypeConverter(GetType(SQLTypeConverter))>
|
||||
Public Class SQLValue
|
||||
Private _value As String
|
||||
|
||||
Public Sub New(value As String)
|
||||
Me.Value = value
|
||||
End Sub
|
||||
|
||||
Public Property Value As String
|
||||
Get
|
||||
Return _value
|
||||
End Get
|
||||
Set(value As String)
|
||||
_value = value
|
||||
End Set
|
||||
End Property
|
||||
End Class
|
||||
End Class
|
||||
|
||||
Public Class TextboxProperties
|
||||
Inherits InputProperties
|
||||
|
||||
End Class
|
||||
|
||||
Public Class LabelProperties
|
||||
@@ -85,6 +231,7 @@ Public Module ModuleControlProperties
|
||||
|
||||
Private _text As String
|
||||
|
||||
<Category("Allgemein")>
|
||||
Public Property Text() As String
|
||||
Get
|
||||
Return _text
|
||||
@@ -96,10 +243,11 @@ Public Module ModuleControlProperties
|
||||
End Class
|
||||
|
||||
Public Class CheckboxProperties
|
||||
Inherits BaseProperties
|
||||
Inherits InputProperties
|
||||
|
||||
Private _text As String
|
||||
|
||||
<Category("Allgemein")>
|
||||
Public Property Text() As String
|
||||
Get
|
||||
Return _text
|
||||
@@ -110,4 +258,72 @@ Public Module ModuleControlProperties
|
||||
End Property
|
||||
End Class
|
||||
|
||||
Public Class ComboboxProperties
|
||||
Inherits InputProperties
|
||||
|
||||
Private _text As String
|
||||
Private _choice_list As String
|
||||
Private _choice_lists As List(Of String)
|
||||
|
||||
<Category("Allgemein")>
|
||||
Public Property Text() As String
|
||||
Get
|
||||
Return _text
|
||||
End Get
|
||||
Set(value As String)
|
||||
_text = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
<Browsable(False)>
|
||||
Public Property ChoiceLists() As List(Of String)
|
||||
Get
|
||||
Return _choice_lists
|
||||
End Get
|
||||
Set(value As List(Of String))
|
||||
_choice_lists = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
<Category("Daten")>
|
||||
<TypeConverter(GetType(ChoiceListConverter))>
|
||||
Public Property ChoiceList() As String
|
||||
Get
|
||||
Return _choice_list
|
||||
End Get
|
||||
Set(value As String)
|
||||
_choice_list = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Class ChoiceListConverter
|
||||
Inherits TypeConverter
|
||||
|
||||
Public Overrides Function GetStandardValuesSupported(context As ITypeDescriptorContext) As Boolean
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Public Overrides Function GetStandardValues(context As ITypeDescriptorContext) As StandardValuesCollection
|
||||
Dim choiceListList = DirectCast(context.Instance, ComboboxProperties).ChoiceLists
|
||||
Dim values As New StandardValuesCollection(choiceListList)
|
||||
Return values
|
||||
End Function
|
||||
|
||||
Public Overrides Function ConvertTo(context As ITypeDescriptorContext, culture As CultureInfo, value As Object, destinationType As Type) As Object
|
||||
If IsNothing(value) Then
|
||||
Return ""
|
||||
Else
|
||||
Return value.ToString()
|
||||
End If
|
||||
End Function
|
||||
End Class
|
||||
End Class
|
||||
|
||||
Public Class DatepickerProperties
|
||||
Inherits InputProperties
|
||||
End Class
|
||||
|
||||
Public Class GridViewProperties
|
||||
Inherits InputProperties
|
||||
End Class
|
||||
End Module
|
||||
|
||||
Reference in New Issue
Block a user