794 lines
23 KiB
VB.net

Imports System.ComponentModel
Imports System.Resources
Module ClassControlProperties
' ++++++ LOCALIZE PROPERTIES ++++++
Private Function Lookup(key As String)
Try
Return My.Resources.ControlProperties.ResourceManager.GetString(key)
Catch ex As Exception
Return key
End Try
End Function
Public Class LocalizedDescriptionAttribute
Inherits DescriptionAttribute
Public Sub New(key As String)
MyBase.New(Lookup(key))
End Sub
End Class
Public Class LocalizedCategoryAttribute
Inherits CategoryAttribute
Public Sub New(key As String)
MyBase.New(Lookup(key))
End Sub
End Class
' +++++ END LOCALIZE PROPERTIES +++++
' +++++ ABSTRACT CLASSES +++++
Public MustInherit Class BaseProperties
Private _id As Integer
Private _type As String
Private _size As Size
Private _location As Point
Private _name As String
Private _hint As String
Private _visible As Boolean
Private _tree_view As Boolean
<LocalizedCategoryAttribute("category_other")>
<LocalizedDescriptionAttribute("desc_tree_view")>
Public Property TreeView() As Boolean
Get
Return _tree_view
End Get
Set(value As Boolean)
_tree_view = value
End Set
End Property
<LocalizedCategoryAttribute("category_info")>
<LocalizedDescriptionAttribute("desc_id")>
<ReadOnlyAttribute(True)>
Public Property ID() As Integer
Get
Return _id
End Get
Set(value As Integer)
_id = value
End Set
End Property
<LocalizedCategoryAttribute("category_info")>
<LocalizedDescriptionAttribute("desc_type")>
<ReadOnlyAttribute(True)>
Public Property ControlType() As String
Get
Return _type
End Get
Set(value As String)
_type = value
End Set
End Property
<LocalizedCategoryAttribute("category_view")>
<LocalizedDescriptionAttribute("desc_hint")>
Public Property Hint() As String
Get
Return _hint
End Get
Set(value As String)
_hint = value
End Set
End Property
<LocalizedCategoryAttribute("category_view")>
<LocalizedDescriptionAttribute("desc_visible")>
Public Property Visible() As Boolean
Get
Return _visible
End Get
Set(value As Boolean)
_visible = value
End Set
End Property
<LocalizedCategoryAttribute("category_view")>
<LocalizedDescriptionAttribute("desc_size")>
Public Property Size() As Size
Get
Return _size
End Get
Set(value As Size)
_size = value
End Set
End Property
<LocalizedCategoryAttribute("category_view")>
<LocalizedDescriptionAttribute("desc_location")>
Public Property Location() As Point
Get
Return _location
End Get
Set(value As Point)
_location = value
End Set
End Property
<LocalizedCategoryAttribute("category_view")>
<LocalizedDescriptionAttribute("desc_name")>
Public Property Name() As String
Get
Return _name
End Get
Set(value As String)
_name = value
End Set
End Property
End Class
Public MustInherit Class CommonProperties
Inherits BaseProperties
Private _id As Integer
' ViewConfigurations
Private _size As Size
Private _location As Point
Private _name As String = ""
Private _column_title = ""
' Database Configurations
Private _sql_command As String = ""
Private _sql_command_2 As String = "" 'EnabledWhen
' Font Configurations
Private _font As Font
Private _font_color As Color
<LocalizedCategoryAttribute("category_view")>
<LocalizedDescriptionAttribute("desc_col_title")>
Public Property ColumnTitle() As String
Get
Return _column_title
End Get
Set(value As String)
_column_title = value
End Set
End Property
<LocalizedCategoryAttribute("category_database")>
<LocalizedDescriptionAttribute("desc_sqlcommand")>
Public Property SQLCommand() As SQLValue
Get
Return New SQLValue(_sql_command)
End Get
Set(value As SQLValue)
_sql_command = value.Value
End Set
End Property
<LocalizedCategoryAttribute("category_database")>
<LocalizedDescriptionAttribute("desc_enabledwhen")>
Public Property EnabledWhen() As SQLValue
Get
Return New SQLValue(_sql_command_2)
End Get
Set(value As SQLValue)
_sql_command_2 = value.Value
End Set
End Property
<LocalizedCategoryAttribute("category_font")>
<LocalizedDescriptionAttribute("desc_fontstyle")>
Public Property Font() As Font
Get
Return _font
End Get
Set(value As Font)
_font = value
End Set
End Property
<LocalizedCategoryAttribute("category_font")>
<LocalizedDescriptionAttribute("desc_fontcolor")>
Public Property FontColor() As Color
Get
Return _font_color
End Get
Set(value As Color)
_font_color = value
End Set
End Property
End Class
Public MustInherit Class InputControlProperties
Inherits CommonProperties
Private _default_Value As String
Private _tab_index As Integer
Private _tab_stop As Boolean
Private _show_column As Boolean
' Other Configurations
Private _required As Boolean = False
Private _read_only As Boolean = False
<LocalizedCategoryAttribute("category_other")>
<LocalizedDescriptionAttribute("desc_required")>
Public Property IsRequired() As Boolean
Get
Return _required
End Get
Set(value As Boolean)
_required = value
End Set
End Property
<LocalizedCategoryAttribute("category_other")>
<LocalizedDescriptionAttribute("desc_readonly")>
Public Property IsReadOnly() As Boolean
Get
Return _read_only
End Get
Set(value As Boolean)
_read_only = value
End Set
End Property
<LocalizedCategoryAttribute("category_other")>
<LocalizedDescriptionAttribute("desc_tabindex")>
Public Property TabIndex() As Integer
Get
Return _tab_index
End Get
Set(value As Integer)
_tab_index = value
End Set
End Property
<LocalizedCategoryAttribute("category_other")>
<LocalizedDescriptionAttribute("desc_tabstop")>
Public Property TabStop() As Boolean
Get
Return _tab_stop
End Get
Set(value As Boolean)
_tab_stop = value
End Set
End Property
<LocalizedCategoryAttribute("category_other")>
<LocalizedDescriptionAttribute("desc_defaultvalue")>
<DefaultValue("")>
Public Property DefaultValue() As String
Get
Return _default_Value
End Get
Set(value As String)
_default_Value = value
End Set
End Property
<LocalizedCategoryAttribute("category_view")>
<LocalizedDescriptionAttribute("desc_showcolumn")>
Public Property ShowColumn() As Boolean
Get
Return _show_column
End Get
Set(value As Boolean)
_show_column = value
End Set
End Property
End Class
' +++++ CONTROL CLASSES +++++
Public Class LabelProperties
Inherits CommonProperties
Private _caption As String = ""
<Browsable(False)>
<LocalizedCategoryAttribute("category_view")>
<LocalizedDescriptionAttribute("desc_col_title")>
Public Overloads Property ColumnTitle() As String
Get
Return ""
End Get
Set(value As String)
'_column_title = value
End Set
End Property
<Browsable(False)>
<LocalizedCategoryAttribute("category_other")>
<LocalizedDescriptionAttribute("desc_tree_view")>
Public Overloads Property TreeView() As Boolean
Get
Return False
End Get
Set(value As Boolean)
'_tree_view = value
End Set
End Property
<LocalizedCategoryAttribute("category_view")>
<LocalizedDescriptionAttribute("desc_caption")>
Public Property Caption() As String
Get
Return _caption
End Get
Set(value As String)
_caption = value
End Set
End Property
End Class
Public Class LineProperties
Inherits CommonProperties
<Browsable(False)>
<LocalizedCategoryAttribute("category_view")>
<LocalizedDescriptionAttribute("desc_col_title")>
Public Overloads Property ColumnTitle() As String
Get
Return ""
End Get
Set(value As String)
'_column_title = value
End Set
End Property
<Browsable(False)>
<LocalizedCategoryAttribute("category_other")>
<LocalizedDescriptionAttribute("desc_tree_view")>
Public Overloads Property TreeView() As Boolean
Get
Return False
End Get
Set(value As Boolean)
'_tree_view = value
End Set
End Property
End Class
Public Class TextBoxProperties
Inherits InputControlProperties
Private _multiline As Boolean
Private _autosuggest As Boolean
Private _format As String
<LocalizedCategoryAttribute("category_view")>
<LocalizedDescriptionAttribute("desc_format")>
Public Property Format() As EnumFormatOptions
Get
Return _format
End Get
Set(value As EnumFormatOptions)
_format = value
End Set
End Property
<LocalizedCategoryAttribute("category_view")>
<LocalizedDescriptionAttribute("desc_multiline")>
Public Property Multiline() As Boolean
Get
Return _multiline
End Get
Set(value As Boolean)
_multiline = value
End Set
End Property
<LocalizedCategoryAttribute("category_view")>
<LocalizedDescription("desc_autosuggest")>
Public Property AutoSuggest() As Boolean
Get
Return _autosuggest
End Get
Set(value As Boolean)
_autosuggest = value
End Set
End Property
End Class
Public Class ComboBoxProperties
Inherits InputControlProperties
Private _master_data_id As Integer
Private _static_list As String
Private _format As EnumFormatOptions
Private _select_only As Boolean
<LocalizedCategoryAttribute("category_other")>
<LocalizedDescriptionAttribute("desc_select_only")>
Public Property IsSelectOnly() As Boolean
Get
Return _select_only
End Get
Set(value As Boolean)
_select_only = value
End Set
End Property
<LocalizedCategoryAttribute("category_view")>
<LocalizedDescriptionAttribute("desc_format")>
Public Property Format() As EnumFormatOptions
Get
Return _format
End Get
Set(value As EnumFormatOptions)
_format = value
End Set
End Property
<LocalizedCategoryAttribute("category_other")>
<LocalizedDescriptionAttribute("desc_masterdataid")>
Public Property MasterDataId() As Integer
Get
Return _master_data_id
End Get
Set(value As Integer)
_master_data_id = value
End Set
End Property
<LocalizedCategoryAttribute("category_data")>
<LocalizedDescriptionAttribute("desc_staticlist")>
Public Property StaticList() As StaticListValue
Get
Return New StaticListValue(_static_list)
End Get
Set(value As StaticListValue)
_static_list = value.Value
End Set
End Property
End Class
Public Class DateTimePickerProperties
Inherits InputControlProperties
Private _default_value As EnumDateTimePickerDefaultValueOptions = EnumDateTimePickerDefaultValueOptions.Empty
<LocalizedCategoryAttribute("category_other")>
<LocalizedDescriptionAttribute("desc_defaultvalue")>
Public Overloads Property DefaultValue() As EnumDateTimePickerDefaultValueOptions
Get
Return _default_value
End Get
Set(value As EnumDateTimePickerDefaultValueOptions)
_default_value = value
End Set
End Property
End Class
Public Class CheckBoxProperties
Inherits InputControlProperties
Private _caption As String = ""
Private _default_value As Boolean = False
<Browsable(False)>
Public Overloads Property TreeView() As Boolean
Get
Return False
End Get
Set(value As Boolean)
'noop
End Set
End Property
<LocalizedCategoryAttribute("category_view")>
<LocalizedDescriptionAttribute("desc_caption")>
Public Property Caption() As String
Get
Return _caption
End Get
Set(value As String)
_caption = value
End Set
End Property
<LocalizedCategoryAttribute("category_other")>
<LocalizedDescriptionAttribute("desc_defaultvalue")>
<DefaultValue(False)>
Public Overloads Property DefaultValue As Boolean
Get
Return _default_value
End Get
Set(value As Boolean)
_default_value = value
End Set
End Property
End Class
Public Class RadioButtonProperties
Inherits InputControlProperties
Private _caption As String = ""
Private _default_value As Boolean = False
<Browsable(False)>
Public Overloads Property TreeView() As Boolean
Get
Return False
End Get
Set(value As Boolean)
'noop
End Set
End Property
<LocalizedCategoryAttribute("category_view")>
<LocalizedDescriptionAttribute("desc_caption")>
Public Property Caption() As String
Get
Return _caption
End Get
Set(value As String)
_caption = value
End Set
End Property
<LocalizedCategoryAttribute("category_other")>
<LocalizedDescriptionAttribute("desc_defaultvalue")>
<DefaultValue(False)>
Public Overloads Property DefaultValue As Boolean
Get
Return _default_value
End Get
Set(value As Boolean)
_default_value = value
End Set
End Property
End Class
Public Class DataGridViewProperties
Inherits CommonProperties
Private _show_column As Boolean
Private _required As Boolean
Private _read_only As Boolean
Private _tree_view As Boolean
<LocalizedCategoryAttribute("category_view")>
<LocalizedDescriptionAttribute("desc_showcolumn")>
Public Property ShowColumn() As Boolean
Get
Return _show_column
End Get
Set(value As Boolean)
_show_column = value
End Set
End Property
<LocalizedCategoryAttribute("category_other")>
<LocalizedDescriptionAttribute("desc_required")>
Public Property IsRequired() As Boolean
Get
Return _required
End Get
Set(value As Boolean)
_required = value
End Set
End Property
<LocalizedCategoryAttribute("category_other")>
<LocalizedDescriptionAttribute("desc_readonly")>
Public Property IsReadOnly() As Boolean
Get
Return _read_only
End Get
Set(value As Boolean)
_read_only = value
End Set
End Property
End Class
Public Class PictureBoxProperties
Inherits CommonProperties
Private _required As Boolean
Private _read_only As Boolean
<LocalizedCategoryAttribute("category_other")>
<LocalizedDescriptionAttribute("desc_required")>
Public Property IsRequired() As Boolean
Get
Return _required
End Get
Set(value As Boolean)
_required = value
End Set
End Property
<LocalizedCategoryAttribute("category_other")>
<LocalizedDescriptionAttribute("desc_readonly")>
Public Property IsReadOnly() As Boolean
Get
Return _read_only
End Get
Set(value As Boolean)
_read_only = value
End Set
End Property
End Class
Public Class GroupBoxProperties
Inherits CommonProperties
Private _caption As String = ""
Private _back_color As Color
<Browsable(False)>
Public Overloads Property TreeView() As Boolean
Get
Return False
End Get
Set(value As Boolean)
'noop
End Set
End Property
<LocalizedCategoryAttribute("category_view")>
<LocalizedDescriptionAttribute("desc_caption")>
Public Property Caption() As String
Get
Return _caption
End Get
Set(value As String)
_caption = value
End Set
End Property
<LocalizedCategoryAttribute("category_view")>
<LocalizedDescriptionAttribute("desc_backcolor")>
Public Property BackColor() As Color
Get
Return _back_color
End Get
Set(value As Color)
_back_color = value
End Set
End Property
End Class
' +++++ FUNCTION CLASSES +++++
Public Class FunctionAddAppointmentProperties
Inherits BaseProperties
Private _caption As String
Private _subject As String
Private _subject2 As String
Private _from_date As String
Private _from_time As String
Private _to_date As String
Private _to_time As String
Private _place As String
Private _description As String
<LocalizedCategoryAttribute("category_view")>
<LocalizedDescriptionAttribute("desc_caption")>
Public Property Caption() As String
Get
Return _caption
End Get
Set(value As String)
_caption = value
End Set
End Property
<LocalizedCategoryAttribute("category_appointment")>
<LocalizedDescriptionAttribute("desc_subject")>
Public Property Subject() As String
Get
Return _subject
End Get
Set(value As String)
_subject = value
End Set
End Property
<LocalizedCategoryAttribute("category_appointment")>
<LocalizedDescriptionAttribute("desc_subject2")>
Public Property Subject2() As String
Get
Return _subject2
End Get
Set(value As String)
_subject2 = value
End Set
End Property
<LocalizedCategoryAttribute("category_appointment")>
<LocalizedDescriptionAttribute("desc_place")>
Public Property Place() As String
Get
Return _place
End Get
Set(value As String)
_place = value
End Set
End Property
<LocalizedCategoryAttribute("category_appointment")>
<LocalizedDescriptionAttribute("desc_description")>
Public Property Description() As String
Get
Return _description
End Get
Set(value As String)
_description = value
End Set
End Property
<LocalizedCategoryAttribute("category_date")>
<LocalizedDescriptionAttribute("desc_fromdate")>
Public Property FromDate() As String
Get
Return _from_date
End Get
Set(value As String)
_from_date = value
End Set
End Property
<LocalizedCategoryAttribute("category_date")>
<LocalizedDescriptionAttribute("desc_todate")>
Public Property ToDate() As String
Get
Return _to_date
End Get
Set(value As String)
_to_date = value
End Set
End Property
End Class
Public Class FunctionAddFormDataProperties
Inherits BaseProperties
Private _caption As String
Private _form_id As Integer
Private _screen_id As Integer
<LocalizedCategoryAttribute("category_view")>
<LocalizedDescriptionAttribute("desc_caption")>
Public Property Caption() As String
Get
Return _caption
End Get
Set(value As String)
_caption = value
End Set
End Property
<LocalizedCategoryAttribute("category_form")>
<LocalizedDescriptionAttribute("desc_formid")>
Public Property FormID() As Integer
Get
Return _form_id
End Get
Set(value As Integer)
_form_id = value
End Set
End Property
<LocalizedCategoryAttribute("category_form")>
<LocalizedDescriptionAttribute("desc_screenid")>
Public Property ScreenID() As Integer
Get
Return _screen_id
End Get
Set(value As Integer)
_screen_id = value
End Set
End Property
End Class
End Module