Prepare Loading Control Properties in Property Grid, Preload Controls with Data in Workflow Form

This commit is contained in:
Jonathan Jenne
2019-03-26 16:17:40 +01:00
parent 2438528741
commit c1dc7fcc22
27 changed files with 263 additions and 1053 deletions

View File

@@ -1,70 +0,0 @@
Imports DigitalData.Controls.LookupGrid
Imports DigitalData.GUIs.ClientSuite.ClassControlUtils
Public Class ClassControlBuilder
#Region "State"
Private _DesignMode As Boolean
#End Region
#Region "Constants"
Private DEFAULT_SIZE As Size = New Size(200, 27)
Private DEFAULT_TEXT As String = "Unnamed Control"
#End Region
Public Sub New(DesignMode As Boolean)
_DesignMode = DesignMode
End Sub
Private Function GetRandomControlName(Name As String)
Return $"{Name}-{ClassUtils.ShortGUID()}"
End Function
Public Function CreateLabel() As Label
Dim Metadata As New ControlMetadata() With {
.Id = 4711,
.Type = ControlType.Label
}
Dim oLabel As New Label() With {
.Name = GetRandomControlName("Label"),
.Text = DEFAULT_TEXT,
.AutoSize = False,
.Size = DEFAULT_SIZE,
.Tag = Metadata
}
Return oLabel
End Function
Public Function CreateTextbox() As TextBox
Dim Metadata As New ControlMetadata() With {
.Id = 4711,
.Type = ControlType.TextBox
}
Dim oTextbox As New TextBox() With {
.Name = GetRandomControlName("Textbox"),
.Size = DEFAULT_SIZE,
.Tag = Metadata
}
Return oTextbox
End Function
Public Function CreateCombobox() As LookupControl
Dim Metadata As New ControlMetadata() With {
.Id = 4711,
.Type = ControlType.Combobox
}
Dim oCombobox As New LookupControl() With {
.Name = GetRandomControlName("Combobox"),
.Size = DEFAULT_SIZE,
.Tag = Metadata
}
Return oCombobox
End Function
End Class

View File

@@ -0,0 +1,4 @@
Public Class ClassControlMetadata
Public Id As Int64
Public Type As String
End Class

View File

@@ -1,14 +0,0 @@
Public Class ClassControlUtils
Public Enum ControlType
Label = 0
TextBox = 1
Combobox = 2
End Enum
Public Class ControlMetadata
Public Id As Integer
Public Type As ControlType
End Class
End Class

View File

@@ -1,6 +1,5 @@
Imports System.ComponentModel
Imports DigitalData.GUIs.ClientSuite.ClassControlLocalization
Imports DigitalData.GUIs.ClientSuite.ClassControlUtils
Namespace ControlProperties
Public MustInherit Class ClassBaseProperties
@@ -10,31 +9,9 @@ Namespace ControlProperties
<[ReadOnly](True)>
Public Property Id As Integer
<LocalizedCategory("category_info")>
<LocalizedDescription("desc_type")>
<[ReadOnly](True)>
Public Property Type As ControlType
<LocalizedCategory("category_view")>
<LocalizedDescription("desc_name")>
Public Property Name As String
<LocalizedCategory("category_view")>
<LocalizedDescription("desc_location")>
Public Property Location As Point
<LocalizedCategory("category_view")>
<LocalizedDescription("desc_size")>
Public Property Size As Size
<LocalizedCategory("category_view")>
<LocalizedDescription("desc_fontstyle")>
Public Property Font() As Font
<LocalizedCategory("category_view")>
<LocalizedDescription("desc_color")>
Public Property Color() As Color
End Class
End Namespace

View File

@@ -1,27 +0,0 @@
Imports DigitalData.GUIs.ClientSuite.ClassControlLocalization
Namespace ControlProperties
Public MustInherit Class ClassInputProperties
Inherits ClassBaseProperties
<LocalizedCategory("category_input")>
<LocalizedDescription("desc_required")>
Public Property IsRequired() As Boolean
<LocalizedCategory("category_input")>
<LocalizedDescription("desc_readonly")>
Public Property IsReadOnly() As Boolean
<LocalizedCategory("category_input")>
<LocalizedDescription("desc_defaultvalue")>
Public Property DefaultValue() As String
<LocalizedCategory("category_other")>
<LocalizedDescription("desc_tabindex")>
Public Property TabIndex() As Integer
<LocalizedCategory("category_other")>
<LocalizedDescription("desc_tabstop")>
Public Property TabStop() As Boolean
End Class
End Namespace

View File

@@ -1,20 +0,0 @@
Imports DigitalData.GUIs.ClientSuite.ClassControlLocalization
Namespace ControlProperties
Public Class ClassMultiInputProperties
Inherits ClassInputProperties
Private _static_list As String
<LocalizedDescription("desc_staticlist")>
<LocalizedCategory("category_data")>
Public Property StaticList As StaticList
Get
Return New StaticList(_static_list)
End Get
Set(value As StaticList)
_static_list = value?.Value
End Set
End Property
End Class
End Namespace

View File

@@ -1,6 +1,14 @@
Namespace ControlProperties
Imports System.ComponentModel
Imports DigitalData.GUIs.ClientSuite.ClassControlLocalization
Namespace ControlProperties
Public Class ClassComboboxProperties
Inherits ClassMultiInputProperties
Inherits ClassBaseProperties
<LocalizedCategory("category_view")>
<LocalizedDescription("desc_multiline")>
<DefaultValue("")>
Public Property Datasource As String
End Class
End Namespace

View File

@@ -1,14 +0,0 @@
Imports System.ComponentModel
Imports DigitalData.GUIs.ClientSuite.ClassControlLocalization
Namespace ControlProperties
Public Class ClassLabelProperties
Inherits ClassBaseProperties
<LocalizedCategory("category_view")>
<LocalizedDescription("desc_id")>
Public Property Caption As String
End Class
End Namespace

View File

@@ -1,13 +0,0 @@
Imports System.ComponentModel
Imports DigitalData.GUIs.ClientSuite.ClassControlLocalization
Namespace ControlProperties
Public Class ClassTextboxProperties
Inherits ClassInputProperties
<LocalizedCategory("category_view")>
<LocalizedDescription("desc_multiline")>
<DefaultValue(False)>
Public Property Multiline() As Boolean
End Class
End Namespace

View File

@@ -1,47 +0,0 @@
Partial Class ControlSnapPanel
Inherits Panel
<System.Diagnostics.DebuggerNonUserCode()> _
Public Sub New(ByVal container As System.ComponentModel.IContainer)
MyClass.New()
'Erforderlich für die Unterstützung des Windows.Forms-Klassenkompositions-Designers
If (container IsNot Nothing) Then
container.Add(Me)
End If
End Sub
<System.Diagnostics.DebuggerNonUserCode()> _
Public Sub New()
MyBase.New()
'Dieser Aufruf ist für den Komponenten-Designer erforderlich.
InitializeComponent()
End Sub
'Die Komponente überschreibt den Löschvorgang zum Bereinigen der Komponentenliste.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Wird vom Komponenten-Designer benötigt.
Private components As System.ComponentModel.IContainer
'Hinweis: Die folgende Prozedur ist für den Komponenten-Designer erforderlich.
'Das Bearbeiten ist mit dem Komponenten-Designer möglich.
'Das Bearbeiten mit dem Code-Editor ist nicht möglich.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
components = New System.ComponentModel.Container()
End Sub
End Class

View File

@@ -1,56 +0,0 @@
Public Class ControlSnapPanel
Inherits Panel
Private _ShowGrid As Boolean = True
Private _GridSize As Integer = 16
Private Property AutoScaleMode As AutoScaleMode
Public Property GridSize As Integer
Get
Return _GridSize
End Get
Set(value As Integer)
_GridSize = value
Refresh()
End Set
End Property
Public Property ShowGrid As Boolean
Get
Return _ShowGrid
End Get
Set(value As Boolean)
_ShowGrid = value
Refresh()
End Set
End Property
Protected Overrides Sub OnControlAdded(e As ControlEventArgs)
AddHandler e.Control.LocationChanged, AddressOf AlignToGrid
AddHandler e.Control.DragDrop, AddressOf AlignToGrid
MyBase.OnControlAdded(e)
End Sub
Protected Overrides Sub OnControlRemoved(e As ControlEventArgs)
RemoveHandler e.Control.LocationChanged, AddressOf AlignToGrid
RemoveHandler e.Control.DragDrop, AddressOf AlignToGrid
MyBase.OnControlRemoved(e)
End Sub
Protected Overrides Sub OnPaint(e As PaintEventArgs)
If _ShowGrid Then
ControlPaint.DrawGrid(e.Graphics, ClientRectangle, New Size(_GridSize, _GridSize), BackColor)
End If
MyBase.OnPaint(e)
End Sub
Private Sub AlignToGrid(sender As Object, e As EventArgs)
If _ShowGrid Then
Dim item As Control = CType(sender, Control)
Dim x As Integer = Math.Round(item.Left / _GridSize) * _GridSize
Dim y As Integer = Math.Round(item.Top / _GridSize) * _GridSize
item.Location = New Point(x, y)
End If
End Sub
End Class

View File

@@ -1,242 +0,0 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()>
Partial Class frmEntityDesigner
Inherits BaseRibbonForm
'Das Formular überschreibt den Löschvorgang, um die Komponentenliste zu bereinigen.
<System.Diagnostics.DebuggerNonUserCode()>
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Wird vom Windows Form-Designer benötigt.
Private components As System.ComponentModel.IContainer
'Hinweis: Die folgende Prozedur ist für den Windows Form-Designer erforderlich.
'Das Bearbeiten ist mit dem Windows Form-Designer möglich.
'Das Bearbeiten mit dem Code-Editor ist nicht möglich.
<System.Diagnostics.DebuggerStepThrough()>
Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container()
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmEntityDesigner))
Me.PanelMain = New DigitalData.GUIs.ClientSuite.ControlSnapPanel(Me.components)
Me.TabControlMain = New DevExpress.XtraTab.XtraTabControl()
Me.TabPageControls = New DevExpress.XtraTab.XtraTabPage()
Me.Label1 = New System.Windows.Forms.Label()
Me.btnCombobox = New System.Windows.Forms.Button()
Me.btnTextbox = New System.Windows.Forms.Button()
Me.btnLabel = New System.Windows.Forms.Button()
Me.TabPageProperties = New DevExpress.XtraTab.XtraTabPage()
Me.PropertyGridMain = New DevExpress.XtraVerticalGrid.PropertyGridControl()
Me.SplitContainerControlMain = New DevExpress.XtraEditors.SplitContainerControl()
Me.RibbonControl1 = New DevExpress.XtraBars.Ribbon.RibbonControl()
Me.BarButtonItem1 = New DevExpress.XtraBars.BarButtonItem()
Me.RibbonPageCategory1 = New DevExpress.XtraBars.Ribbon.RibbonPageCategory()
Me.RibbonPage3 = New DevExpress.XtraBars.Ribbon.RibbonPage()
Me.RibbonPageGroup3 = New DevExpress.XtraBars.Ribbon.RibbonPageGroup()
Me.RibbonStatusBar1 = New DevExpress.XtraBars.Ribbon.RibbonStatusBar()
Me.RibbonPage2 = New DevExpress.XtraBars.Ribbon.RibbonPage()
CType(Me.TabControlMain, System.ComponentModel.ISupportInitialize).BeginInit()
Me.TabControlMain.SuspendLayout()
Me.TabPageControls.SuspendLayout()
Me.TabPageProperties.SuspendLayout()
CType(Me.PropertyGridMain, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.SplitContainerControlMain, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SplitContainerControlMain.SuspendLayout()
CType(Me.RibbonControl1, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'PanelMain
'
Me.PanelMain.AllowDrop = True
Me.PanelMain.Dock = System.Windows.Forms.DockStyle.Fill
Me.PanelMain.GridSize = 8
Me.PanelMain.Location = New System.Drawing.Point(0, 0)
Me.PanelMain.Name = "PanelMain"
Me.PanelMain.ShowGrid = True
Me.PanelMain.Size = New System.Drawing.Size(808, 458)
Me.PanelMain.TabIndex = 0
'
'TabControlMain
'
Me.TabControlMain.Dock = System.Windows.Forms.DockStyle.Fill
Me.TabControlMain.Location = New System.Drawing.Point(0, 0)
Me.TabControlMain.Name = "TabControlMain"
Me.TabControlMain.SelectedTabPage = Me.TabPageControls
Me.TabControlMain.Size = New System.Drawing.Size(224, 458)
Me.TabControlMain.TabIndex = 0
Me.TabControlMain.TabPages.AddRange(New DevExpress.XtraTab.XtraTabPage() {Me.TabPageControls, Me.TabPageProperties})
'
'TabPageControls
'
Me.TabPageControls.Controls.Add(Me.Label1)
Me.TabPageControls.Controls.Add(Me.btnCombobox)
Me.TabPageControls.Controls.Add(Me.btnTextbox)
Me.TabPageControls.Controls.Add(Me.btnLabel)
Me.TabPageControls.Name = "TabPageControls"
Me.TabPageControls.Size = New System.Drawing.Size(222, 433)
Me.TabPageControls.Text = "Controls"
'
'Label1
'
Me.Label1.Dock = System.Windows.Forms.DockStyle.Top
Me.Label1.Location = New System.Drawing.Point(0, 0)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(222, 31)
Me.Label1.TabIndex = 2
Me.Label1.Text = "Ziehen Sie zum Erstellen einen Controll-Button auf das Panel"
'
'btnCombobox
'
Me.btnCombobox.Location = New System.Drawing.Point(3, 92)
Me.btnCombobox.Name = "btnCombobox"
Me.btnCombobox.Size = New System.Drawing.Size(216, 23)
Me.btnCombobox.TabIndex = 1
Me.btnCombobox.Text = "Combobox"
Me.btnCombobox.UseVisualStyleBackColor = True
'
'btnTextbox
'
Me.btnTextbox.Location = New System.Drawing.Point(3, 63)
Me.btnTextbox.Name = "btnTextbox"
Me.btnTextbox.Size = New System.Drawing.Size(216, 23)
Me.btnTextbox.TabIndex = 1
Me.btnTextbox.Text = "Textbox"
Me.btnTextbox.UseVisualStyleBackColor = True
'
'btnLabel
'
Me.btnLabel.Location = New System.Drawing.Point(3, 34)
Me.btnLabel.Name = "btnLabel"
Me.btnLabel.Size = New System.Drawing.Size(216, 23)
Me.btnLabel.TabIndex = 0
Me.btnLabel.Text = "Label"
Me.btnLabel.UseVisualStyleBackColor = True
'
'TabPageProperties
'
Me.TabPageProperties.Controls.Add(Me.PropertyGridMain)
Me.TabPageProperties.Name = "TabPageProperties"
Me.TabPageProperties.Size = New System.Drawing.Size(222, 258)
Me.TabPageProperties.Text = "Properties"
'
'PropertyGridMain
'
Me.PropertyGridMain.Dock = System.Windows.Forms.DockStyle.Fill
Me.PropertyGridMain.Location = New System.Drawing.Point(0, 0)
Me.PropertyGridMain.Name = "PropertyGridMain"
Me.PropertyGridMain.Size = New System.Drawing.Size(222, 258)
Me.PropertyGridMain.TabIndex = 0
'
'SplitContainerControlMain
'
Me.SplitContainerControlMain.Dock = System.Windows.Forms.DockStyle.Fill
Me.SplitContainerControlMain.FixedPanel = DevExpress.XtraEditors.SplitFixedPanel.Panel2
Me.SplitContainerControlMain.Location = New System.Drawing.Point(0, 146)
Me.SplitContainerControlMain.Name = "SplitContainerControlMain"
Me.SplitContainerControlMain.Panel1.Controls.Add(Me.PanelMain)
Me.SplitContainerControlMain.Panel1.Text = "Panel1"
Me.SplitContainerControlMain.Panel2.Controls.Add(Me.TabControlMain)
Me.SplitContainerControlMain.Panel2.Text = "Panel2"
Me.SplitContainerControlMain.Size = New System.Drawing.Size(1044, 458)
Me.SplitContainerControlMain.SplitterPosition = 224
Me.SplitContainerControlMain.TabIndex = 1
Me.SplitContainerControlMain.Text = "SplitContainerControl1"
'
'RibbonControl1
'
Me.RibbonControl1.ExpandCollapseItem.Id = 0
Me.RibbonControl1.Items.AddRange(New DevExpress.XtraBars.BarItem() {Me.RibbonControl1.ExpandCollapseItem, Me.BarButtonItem1})
Me.RibbonControl1.Location = New System.Drawing.Point(0, 0)
Me.RibbonControl1.MaxItemId = 2
Me.RibbonControl1.Name = "RibbonControl1"
Me.RibbonControl1.PageCategories.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPageCategory() {Me.RibbonPageCategory1})
Me.RibbonControl1.ShowApplicationButton = DevExpress.Utils.DefaultBoolean.[False]
Me.RibbonControl1.Size = New System.Drawing.Size(1044, 146)
Me.RibbonControl1.StatusBar = Me.RibbonStatusBar1
'
'BarButtonItem1
'
Me.BarButtonItem1.Caption = "Control Löschen"
Me.BarButtonItem1.Id = 1
Me.BarButtonItem1.ImageOptions.Image = CType(resources.GetObject("BarButtonItem1.ImageOptions.Image"), System.Drawing.Image)
Me.BarButtonItem1.ImageOptions.LargeImage = CType(resources.GetObject("BarButtonItem1.ImageOptions.LargeImage"), System.Drawing.Image)
Me.BarButtonItem1.Name = "BarButtonItem1"
'
'RibbonPageCategory1
'
Me.RibbonPageCategory1.Name = "RibbonPageCategory1"
Me.RibbonPageCategory1.Pages.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPage() {Me.RibbonPage3})
Me.RibbonPageCategory1.Text = "Entitäten Designer"
'
'RibbonPage3
'
Me.RibbonPage3.Groups.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPageGroup() {Me.RibbonPageGroup3})
Me.RibbonPage3.Name = "RibbonPage3"
Me.RibbonPage3.Text = "Aktionen"
'
'RibbonPageGroup3
'
Me.RibbonPageGroup3.ItemLinks.Add(Me.BarButtonItem1)
Me.RibbonPageGroup3.Name = "RibbonPageGroup3"
Me.RibbonPageGroup3.Text = "Aktionen"
'
'RibbonStatusBar1
'
Me.RibbonStatusBar1.Location = New System.Drawing.Point(0, 604)
Me.RibbonStatusBar1.Name = "RibbonStatusBar1"
Me.RibbonStatusBar1.Ribbon = Me.RibbonControl1
Me.RibbonStatusBar1.Size = New System.Drawing.Size(1044, 21)
'
'RibbonPage2
'
Me.RibbonPage2.Name = "RibbonPage2"
Me.RibbonPage2.Text = "RibbonPage2"
'
'frmEntityDesigner
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(1044, 625)
Me.Controls.Add(Me.SplitContainerControlMain)
Me.Controls.Add(Me.RibbonStatusBar1)
Me.Controls.Add(Me.RibbonControl1)
Me.Name = "frmEntityDesigner"
Me.Ribbon = Me.RibbonControl1
Me.StatusBar = Me.RibbonStatusBar1
Me.Text = "Entitäten Designer"
CType(Me.TabControlMain, System.ComponentModel.ISupportInitialize).EndInit()
Me.TabControlMain.ResumeLayout(False)
Me.TabPageControls.ResumeLayout(False)
Me.TabPageProperties.ResumeLayout(False)
CType(Me.PropertyGridMain, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.SplitContainerControlMain, System.ComponentModel.ISupportInitialize).EndInit()
Me.SplitContainerControlMain.ResumeLayout(False)
CType(Me.RibbonControl1, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents TabControlMain As DevExpress.XtraTab.XtraTabControl
Friend WithEvents TabPageProperties As DevExpress.XtraTab.XtraTabPage
Friend WithEvents PropertyGridMain As DevExpress.XtraVerticalGrid.PropertyGridControl
Friend WithEvents TabPageControls As DevExpress.XtraTab.XtraTabPage
Friend WithEvents PanelMain As ControlSnapPanel
Friend WithEvents btnTextbox As Button
Friend WithEvents btnLabel As Button
Friend WithEvents SplitContainerControlMain As DevExpress.XtraEditors.SplitContainerControl
Friend WithEvents btnCombobox As Button
Friend WithEvents Label1 As Label
Friend WithEvents RibbonControl1 As DevExpress.XtraBars.Ribbon.RibbonControl
Friend WithEvents RibbonStatusBar1 As DevExpress.XtraBars.Ribbon.RibbonStatusBar
Friend WithEvents RibbonPage2 As DevExpress.XtraBars.Ribbon.RibbonPage
Friend WithEvents RibbonPageCategory1 As DevExpress.XtraBars.Ribbon.RibbonPageCategory
Friend WithEvents RibbonPage3 As DevExpress.XtraBars.Ribbon.RibbonPage
Friend WithEvents RibbonPageGroup3 As DevExpress.XtraBars.Ribbon.RibbonPageGroup
Friend WithEvents BarButtonItem1 As DevExpress.XtraBars.BarButtonItem
End Class

View File

@@ -1,144 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="BarButtonItem1.ImageOptions.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAAjdEVYdFRpdGxlAENhbmNlbDtTdG9wO0V4aXQ7QmFy
cztSaWJib247TJaWsgAAAMJJREFUOE+Nk0sKAjEQRHM4YVZ6CS8gfhBGHK/pSRRXbRWkJOlOq4sHSf0Y
BlLMrNy3qzWYef4HZC/s8KzyCxi4+rAHmVvNsrOhcKqCSEfgqSz2Ms7OCCPQfPlIvQ2kIzgPy+QzUIN+
ZAFpmXQDBAE/0tKVSXcRCI5GQpkEgSDsP5sso2wQEByVRRjpLgj48gGEH9t2vpYbLx35WRbQhiM0+DBa
I5QFPD8yU5zAowppWSCjkSeYJHJk58MZyPIBTmZW3tJAnMwmSptiAAAAAElFTkSuQmCC
</value>
</data>
<data name="BarButtonItem1.ImageOptions.LargeImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAAjdEVYdFRpdGxlAENhbmNlbDtTdG9wO0V4aXQ7QmFy
cztSaWJib247TJaWsgAAAW5JREFUWEfFlk1KBDEUhGfmAg56JTcuHEGP4FFFFMVZz1VcxaomD57pek1e
hLj4FilSP9Dd0LtSyr8ixZlIcSZSnIkUL8+3f6LJOvhzixRr0BV4AXf13I3LuQev4OjzPVKEgeUfoIBv
kBpRM1hOLzM+gRyxEnDxALiaRiM7wpcbzNy3fb8OBi4+gTagd4Qq5/lBda0EgsvksRrboK0RqXIiRRiM
zIh0OZEiTJ6eEUPlRIowtmyNGC4nUoRZEY0YLidSRECEGuFJlRMpImSLaMRSDmRmhBQZsoF65jZgeTFV
ZoQUGRIQlRvLCJUZIUWEKKK3XWndI6SIgN5yPvPwE1XZLVKEubfc7gyPkCKMmXJjaIQUYSJR+Qn4Yk96
hBRhGCk3UiNWAi7uwVs1+oCeckONeAfdPyTX4Ksas+WW4UecwU3bQ1YCwWXCEVydKicuhyOYIcuJFC0I
8P/Qn7tosvK/5TOR4kykOBMpzqPsfgBphQ1j4i+mWAAAAABJRU5ErkJggg==
</value>
</data>
</root>

View File

@@ -1,258 +0,0 @@
Imports System.ComponentModel
Imports DevExpress.XtraEditors.Repository
Imports DevExpress.XtraVerticalGrid
Imports DigitalData.GUIs.ClientSuite.ClassControlUtils
Imports DigitalData.GUIs.ClientSuite.ControlProperties
Public Class frmEntityDesigner
Private _IsMouseDown As Boolean = False
Private _IsMouseMoving As Boolean = False
Private _BeginPosition As Point = Nothing
Private _EndPosition As Point = Nothing
Private _LastCursorPosition As Point = Nothing
Private _CurrentControl As Control = Nothing
Private _ControlBuilder As ClassControlBuilder = Nothing
Private _DragDropButtonList As New List(Of Button)
Private Sub frmEntityDesigner_Load(sender As Object, e As EventArgs) Handles Me.Load
' Assign Control Types to DragDrop Buttons
btnLabel.Tag = ControlType.Label
btnTextbox.Tag = ControlType.TextBox
btnCombobox.Tag = ControlType.Combobox
' Add Default Editors for certain datatypes in the PropertyGrid
Dim oColorEditor = New RepositoryItemColorEdit()
Dim oBooleanEditor = New RepositoryItemCheckEdit()
PropertyGridMain.DefaultEditors.Add(GetType(Color), oColorEditor)
PropertyGridMain.DefaultEditors.Add(GetType(Boolean), oBooleanEditor)
' Create the control builder
_ControlBuilder = New ClassControlBuilder(DesignMode:=True)
' Create a list of all DragDrop buttons
_DragDropButtonList.Add(btnLabel)
_DragDropButtonList.Add(btnTextbox)
_DragDropButtonList.Add(btnCombobox)
' Add EventHandlers for each button
For Each oButton As Button In _DragDropButtonList
AddHandler oButton.MouseDown, AddressOf DragDropButton_MouseDown
AddHandler oButton.MouseMove, AddressOf DragDropButton_MouseMove
Next
End Sub
#Region "Control Buttons Events"
Private Sub DragDropButton_MouseDown(sender As Object, e As MouseEventArgs)
_IsMouseDown = True
End Sub
Private Sub DragDropButton_MouseMove(sender As Button, e As MouseEventArgs)
If _IsMouseDown Then
Dim oButton = sender
Dim oType As ControlType = oButton.Tag
oButton.DoDragDrop(oType.ToString, DragDropEffects.Copy)
End If
End Sub
Private Sub SnapPanelMain_DragEnter(sender As Object, e As DragEventArgs) Handles PanelMain.DragEnter
If (e.Data.GetDataPresent(DataFormats.Text)) Then
e.Effect = DragDropEffects.Copy
Else
e.Effect = DragDropEffects.None
End If
End Sub
Private Sub SnapPanelMain_DragDrop(sender As Object, e As DragEventArgs) Handles PanelMain.DragDrop
Dim data As String = e.Data.GetData(DataFormats.Text)
Dim type = ClassUtils.ToEnum(Of ClassControlUtils.ControlType)(data)
HandleDragDrop(type)
End Sub
#End Region
#Region "Control Events"
Private Sub Control_MouseDown(sender As Control, e As MouseEventArgs)
If e.Button = MouseButtons.Left Then
_CurrentControl = sender
_BeginPosition = e.Location
' Set the mode flag to signal the MouseMove event handler that it
' needs to now calculate new positions for our control
_IsMouseMoving = True
End If
End Sub
Private Sub Control_MouseMove(sender As Object, e As MouseEventArgs)
If _CurrentControl Is Nothing Or Not _IsMouseMoving Then
Exit Sub
End If
Cursor = Cursors.Hand
Dim oCursorPosition As Point = PanelMain.PointToClient(Cursor.Position)
Dim oNewPosition As New Point(oCursorPosition.X - _BeginPosition.X, oCursorPosition.Y - _BeginPosition.Y)
' If control will be moved out the of bounds of the panel at TOP/LEFT side, exit.
If oNewPosition.X < 0 Or oNewPosition.Y < 0 Then
Exit Sub
End If
_CurrentControl.Location = oNewPosition
End Sub
Private Sub Control_MouseUp(sender As Object, e As MouseEventArgs)
If Not _IsMouseMoving Then
Exit Sub
End If
_IsMouseMoving = False
_EndPosition = e.Location
Cursor = Cursors.Default
End Sub
Private Sub Control_MouseClick(sender As Control, e As MouseEventArgs)
TabControlMain.SelectedTabPage = TabPageProperties
HandleLoadProperties(sender)
End Sub
Private Sub Control_MouseEnter(sender As Control, e As EventArgs)
Cursor = Cursors.Hand
End Sub
Private Sub Control_MouseLeave(sender As Control, e As EventArgs)
Cursor = Cursors.Default
End Sub
Private Sub SetEventHandlers(Control As Control)
AddHandler Control.MouseDown, AddressOf Control_MouseDown
AddHandler Control.MouseMove, AddressOf Control_MouseMove
AddHandler Control.MouseUp, AddressOf Control_MouseUp
AddHandler Control.MouseClick, AddressOf Control_MouseClick
AddHandler Control.MouseEnter, AddressOf Control_MouseEnter
AddHandler Control.MouseLeave, AddressOf Control_MouseLeave
End Sub
#End Region
Private Sub HandleLoadProperties(Control As Control)
Dim oMetadata As ControlMetadata = Control.Tag
Dim oType = oMetadata.Type
Dim oProps As ClassBaseProperties = Nothing
Select Case oType
Case ControlType.Label
oProps = New ClassLabelProperties With {
.Id = oMetadata.Id,
.Name = Control.Name,
.Type = oType,
.Location = Control.Location,
.Size = Control.Size,
.Font = Control.Font,
.Color = Control.ForeColor,
.Caption = Control.Text
}
Case ControlType.TextBox
oProps = New ClassTextboxProperties With {
.Id = oMetadata.Id,
.Name = Control.Name,
.Type = oType,
.Location = Control.Location,
.Size = Control.Size,
.Font = Control.Font,
.Color = ForeColor,
.IsReadOnly = False,
.IsRequired = False,
.Multiline = False,
.TabIndex = 0,
.TabStop = 1,
.DefaultValue = ""
}
Case ControlType.Combobox
oProps = New ClassComboboxProperties() With {
.Id = oMetadata.Id,
.Name = Control.Name,
.Type = oType,
.Location = Control.Location,
.Size = Control.Size,
.Font = Control.Font,
.Color = ForeColor,
.IsReadOnly = False,
.IsRequired = False,
.TabIndex = 0,
.TabStop = 1,
.DefaultValue = "",
.StaticList = New StaticList()
}
Case Else
Exit Sub
End Select
PropertyGridMain.SelectedObject = oProps
End Sub
Private Sub HandleDragDrop(type As ControlType)
Dim oCursorPosition As Point = PanelMain.PointToClient(Cursor.Position)
Dim oControl As Control = Nothing
Select Case type
Case ControlType.Label
oControl = _ControlBuilder.CreateLabel()
Case ControlType.TextBox
oControl = _ControlBuilder.CreateTextbox()
Case ControlType.Combobox
oControl = _ControlBuilder.CreateCombobox()
Case Else
MsgBox($"Unknown Control Type {type.ToString}")
Exit Sub
End Select
' Set Location to current cursor position
oControl.Location = oCursorPosition
' Attach Eventhandlers
SetEventHandlers(oControl)
' Add the control to the panel
PanelMain.Controls.Add(oControl)
End Sub
Private Sub PropertyGridMain_RowChanged(sender As Object, e As DevExpress.XtraVerticalGrid.Events.RowChangedEventArgs) Handles PropertyGridMain.RowChanged
If e.ChangeType <> RowChangeTypeEnum.Value Then
Exit Sub
End If
Dim oPropertyName As String = e.Properties.FieldName
Dim oPropertyValue = e.Properties.Value
Select Case oPropertyName
Case "Name"
_CurrentControl.Name = oPropertyValue
Case "Location"
_CurrentControl.Location = oPropertyValue
Case "X"
_CurrentControl.Location = New Point(oPropertyValue, _CurrentControl.Location.Y)
Case "Y"
_CurrentControl.Location = New Point(_CurrentControl.Location.X, oPropertyValue)
Case "Size"
_CurrentControl.Size = oPropertyValue
Case "Width"
_CurrentControl.Size = New Size(oPropertyValue, _CurrentControl.Height)
Case "Height"
_CurrentControl.Size = New Size(_CurrentControl.Width, oPropertyValue)
Case "Font"
_CurrentControl.Font = oPropertyValue
Case "Color"
_CurrentControl.ForeColor = oPropertyValue
Case "Caption"
If TypeOf _CurrentControl Is Label Then
_CurrentControl.Text = oPropertyValue
End If
End Select
End Sub
End Class

View File

@@ -36,7 +36,7 @@ Partial Class frmFormDesigner
Me.XtraTabControl1 = New DevExpress.XtraTab.XtraTabControl()
Me.XtraTabPageControls = New DevExpress.XtraTab.XtraTabPage()
Me.XtraTabPageProperties = New DevExpress.XtraTab.XtraTabPage()
Me.PropertyGridControl1 = New DevExpress.XtraVerticalGrid.PropertyGridControl()
Me.PropertyGridControlMain = New DevExpress.XtraVerticalGrid.PropertyGridControl()
Me.SplitContainerMain = New DevExpress.XtraEditors.SplitContainerControl()
CType(Me.RibbonControl, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.LayoutControlMain, System.ComponentModel.ISupportInitialize).BeginInit()
@@ -45,7 +45,7 @@ Partial Class frmFormDesigner
Me.XtraTabControl1.SuspendLayout()
Me.XtraTabPageControls.SuspendLayout()
Me.XtraTabPageProperties.SuspendLayout()
CType(Me.PropertyGridControl1, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.PropertyGridControlMain, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.SplitContainerMain, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SplitContainerMain.SuspendLayout()
Me.SuspendLayout()
@@ -188,18 +188,18 @@ Partial Class frmFormDesigner
'
'XtraTabPageProperties
'
Me.XtraTabPageProperties.Controls.Add(Me.PropertyGridControl1)
Me.XtraTabPageProperties.Controls.Add(Me.PropertyGridControlMain)
Me.XtraTabPageProperties.Name = "XtraTabPageProperties"
Me.XtraTabPageProperties.Size = New System.Drawing.Size(232, 337)
Me.XtraTabPageProperties.Text = "Eigenschaften"
'
'PropertyGridControl1
'
Me.PropertyGridControl1.Dock = System.Windows.Forms.DockStyle.Fill
Me.PropertyGridControl1.Location = New System.Drawing.Point(0, 0)
Me.PropertyGridControl1.Name = "PropertyGridControl1"
Me.PropertyGridControl1.Size = New System.Drawing.Size(232, 337)
Me.PropertyGridControl1.TabIndex = 0
Me.PropertyGridControlMain.Dock = System.Windows.Forms.DockStyle.Fill
Me.PropertyGridControlMain.Location = New System.Drawing.Point(0, 0)
Me.PropertyGridControlMain.Name = "PropertyGridControl1"
Me.PropertyGridControlMain.Size = New System.Drawing.Size(232, 337)
Me.PropertyGridControlMain.TabIndex = 0
'
'SplitContainerMain
'
@@ -235,7 +235,7 @@ Partial Class frmFormDesigner
Me.XtraTabControl1.ResumeLayout(False)
Me.XtraTabPageControls.ResumeLayout(False)
Me.XtraTabPageProperties.ResumeLayout(False)
CType(Me.PropertyGridControl1, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.PropertyGridControlMain, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.SplitContainerMain, System.ComponentModel.ISupportInitialize).EndInit()
Me.SplitContainerMain.ResumeLayout(False)
Me.ResumeLayout(False)
@@ -257,7 +257,7 @@ Partial Class frmFormDesigner
Friend WithEvents XtraTabControl1 As DevExpress.XtraTab.XtraTabControl
Friend WithEvents XtraTabPageControls As DevExpress.XtraTab.XtraTabPage
Friend WithEvents XtraTabPageProperties As DevExpress.XtraTab.XtraTabPage
Friend WithEvents PropertyGridControl1 As DevExpress.XtraVerticalGrid.PropertyGridControl
Friend WithEvents PropertyGridControlMain As DevExpress.XtraVerticalGrid.PropertyGridControl
Friend WithEvents SplitContainerMain As DevExpress.XtraEditors.SplitContainerControl
Friend WithEvents ToolboxItemCombobox As DevExpress.XtraToolbox.ToolboxItem
Friend WithEvents ToolboxItemCheckbox As DevExpress.XtraToolbox.ToolboxItem

View File

@@ -5,6 +5,7 @@ Imports DevExpress.XtraLayout.Customization
Imports DevExpress.XtraLayout.Dragging
Imports DevExpress.XtraLayout.HitInfo
Imports DigitalData.Controls.LookupGrid
Imports DigitalData.GUIs.ClientSuite.ControlProperties
Public Class frmFormDesigner
Private _FormId As Int64
@@ -45,7 +46,7 @@ Public Class frmFormDesigner
Dim oHitInfo As BaseLayoutItemHitInfo = LayoutControlMain.CalcHitInfo(oPosition)
Dim oLayoutControl As LayoutControlItem = DirectCast(_DragItem, LayoutControlItem)
Dim oControlName As String = oLayoutControl.Tag & ClassUtils.ShortGUID()
Dim oControl As Control = _ControlLoader.CreateLayoutControl(oLayoutControl.Tag, oControlName)
Dim oControl As Control = _ControlLoader.CreateLayoutControl(oLayoutControl.Tag, oControlName, 0)
If oLayoutControl IsNot Nothing Then
HideDragHelper()
@@ -104,11 +105,11 @@ Public Class frmFormDesigner
End Sub
Private Async Sub frmFormDesigner_Load(sender As Object, e As EventArgs) Handles MyBase.Load
_ControlLoader = New ClassControlLoader(My.LogConfig)
_ControlLoader = New ClassControlLoader(My.LogConfig, LayoutControlGroupMain)
Dim oTable = Await My.Common.Views.VWICM_FORM_CONTROL(_FormId)
_ControlLoader.LoadControls(oTable, LayoutControlGroupMain)
_ControlLoader.LoadControls(oTable)
End Sub
Private Function CreateLayoutControlItem(Id As String) As LayoutControlItem
@@ -117,5 +118,22 @@ Public Class frmFormDesigner
Private Sub LayoutControlMain_ItemSelectionChanged(sender As Object, e As EventArgs) Handles LayoutControlMain.ItemSelectionChanged
' TODO: Load Property Grid for selected item
Dim oLayoutItem As LayoutControlItem = DirectCast(sender, LayoutControlItem)
Dim oSelectedControl As BaseEdit = oLayoutItem.Control
Dim oMetadata As ClassControlMetadata = oSelectedControl.Tag
Select Case oSelectedControl.GetType
Case GetType(MemoEdit)
Case GetType(TextEdit)
Case GetType(LookupControl2)
PropertyGridControlMain.SelectedObject = New ClassComboboxProperties() With {
.Datasource = "TEST",
.Id = oMetadata.Id
}
End Select
End Sub
End Class