diff --git a/app/.vs/DD_PM_WINDREAM/DesignTimeBuild/.dtbcache b/app/.vs/DD_PM_WINDREAM/DesignTimeBuild/.dtbcache index 715c91b..671ed4a 100644 Binary files a/app/.vs/DD_PM_WINDREAM/DesignTimeBuild/.dtbcache and b/app/.vs/DD_PM_WINDREAM/DesignTimeBuild/.dtbcache differ diff --git a/app/DD_PM_WINDREAM/DD_PM_WINDREAM.vbproj b/app/DD_PM_WINDREAM/DD_PM_WINDREAM.vbproj index 21005b2..be85dc9 100644 --- a/app/DD_PM_WINDREAM/DD_PM_WINDREAM.vbproj +++ b/app/DD_PM_WINDREAM/DD_PM_WINDREAM.vbproj @@ -294,8 +294,31 @@ Form + + + + frmDatasourceEditor.vb + + + Form + + + frmStaticListEditor.vb + + + Form + + + + + + + + + + frmDocView.vb @@ -467,6 +490,15 @@ frmDesignerLayout.vb + + frmDatasourceEditor.vb + + + frmStaticListEditor.vb + + + frmStaticListEditor.vb + frmDocView.vb diff --git a/app/DD_PM_WINDREAM/frmDesignerLayout.Designer.vb b/app/DD_PM_WINDREAM/frmDesignerLayout.Designer.vb index 181f559..b8c7d6d 100644 --- a/app/DD_PM_WINDREAM/frmDesignerLayout.Designer.vb +++ b/app/DD_PM_WINDREAM/frmDesignerLayout.Designer.vb @@ -1,9 +1,9 @@ - _ + Partial Class frmDesignerLayout Inherits DevExpress.XtraBars.Ribbon.RibbonForm 'Das Formular überschreibt den Löschvorgang, um die Komponentenliste zu bereinigen. - _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) Try If disposing AndAlso components IsNot Nothing Then @@ -20,7 +20,7 @@ Partial Class frmDesignerLayout '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. - _ + Private Sub InitializeComponent() Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmDesignerLayout)) Me.RibbonControl1 = New DevExpress.XtraBars.Ribbon.RibbonControl() @@ -33,9 +33,11 @@ Partial Class frmDesignerLayout Me.RibbonStatusBar1 = New DevExpress.XtraBars.Ribbon.RibbonStatusBar() Me.RibbonPage2 = New DevExpress.XtraBars.Ribbon.RibbonPage() Me.SplitContainerControl1 = New DevExpress.XtraEditors.SplitContainerControl() + Me.LayoutControlMain = New DevExpress.XtraLayout.LayoutControl() + Me.LayoutControlGroupMain = New DevExpress.XtraLayout.LayoutControlGroup() Me.XtraTabControl1 = New DevExpress.XtraTab.XtraTabControl() Me.XtraTabPage1 = New DevExpress.XtraTab.XtraTabPage() - Me.PropertyGridControl1 = New DevExpress.XtraVerticalGrid.PropertyGridControl() + Me.PropertyGridMain = New DevExpress.XtraVerticalGrid.PropertyGridControl() Me.XtraTabPage2 = New DevExpress.XtraTab.XtraTabPage() Me.ToolboxControlMain = New DevExpress.XtraToolbox.ToolboxControl() Me.ToolboxGroupMain = New DevExpress.XtraToolbox.ToolboxGroup() @@ -43,18 +45,16 @@ Partial Class frmDesignerLayout Me.ToolboxItemMemoedit = New DevExpress.XtraToolbox.ToolboxItem() Me.ToolboxItemDatepicker = New DevExpress.XtraToolbox.ToolboxItem() Me.ToolboxItemCheckbox = New DevExpress.XtraToolbox.ToolboxItem() - Me.LayoutControlMain = New DevExpress.XtraLayout.LayoutControl() - Me.LayoutControlGroupMain = New DevExpress.XtraLayout.LayoutControlGroup() CType(Me.RibbonControl1, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.SplitContainerControl1, System.ComponentModel.ISupportInitialize).BeginInit() Me.SplitContainerControl1.SuspendLayout() + CType(Me.LayoutControlMain, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.LayoutControlGroupMain, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.XtraTabControl1, System.ComponentModel.ISupportInitialize).BeginInit() Me.XtraTabControl1.SuspendLayout() Me.XtraTabPage1.SuspendLayout() - CType(Me.PropertyGridControl1, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.PropertyGridMain, System.ComponentModel.ISupportInitialize).BeginInit() Me.XtraTabPage2.SuspendLayout() - CType(Me.LayoutControlMain, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.LayoutControlGroupMain, System.ComponentModel.ISupportInitialize).BeginInit() Me.SuspendLayout() ' 'RibbonControl1 @@ -62,7 +62,7 @@ Partial Class frmDesignerLayout Me.RibbonControl1.ExpandCollapseItem.Id = 0 Me.RibbonControl1.Items.AddRange(New DevExpress.XtraBars.BarItem() {Me.RibbonControl1.ExpandCollapseItem, Me.RibbonControl1.SearchEditItem, Me.BarListItem1, Me.BarButtonItem1, Me.BarButtonItem2}) Me.RibbonControl1.Location = New System.Drawing.Point(0, 0) - Me.RibbonControl1.MaxItemId = 4 + Me.RibbonControl1.MaxItemId = 5 Me.RibbonControl1.Name = "RibbonControl1" Me.RibbonControl1.Pages.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPage() {Me.RibbonPage1}) Me.RibbonControl1.Size = New System.Drawing.Size(1196, 158) @@ -78,15 +78,19 @@ Partial Class frmDesignerLayout ' 'BarButtonItem1 ' - Me.BarButtonItem1.Caption = "BarButtonItem1" + Me.BarButtonItem1.Caption = "Layout anpassen" Me.BarButtonItem1.Id = 2 + Me.BarButtonItem1.ImageOptions.SvgImage = CType(resources.GetObject("BarButtonItem1.ImageOptions.SvgImage"), DevExpress.Utils.Svg.SvgImage) Me.BarButtonItem1.Name = "BarButtonItem1" + Me.BarButtonItem1.RibbonStyle = DevExpress.XtraBars.Ribbon.RibbonItemStyles.SmallWithText ' 'BarButtonItem2 ' Me.BarButtonItem2.Caption = "Layout speichern" Me.BarButtonItem2.Id = 3 + Me.BarButtonItem2.ImageOptions.SvgImage = CType(resources.GetObject("BarButtonItem2.ImageOptions.SvgImage"), DevExpress.Utils.Svg.SvgImage) Me.BarButtonItem2.Name = "BarButtonItem2" + Me.BarButtonItem2.RibbonStyle = DevExpress.XtraBars.Ribbon.RibbonItemStyles.SmallWithText ' 'RibbonPage1 ' @@ -98,12 +102,12 @@ Partial Class frmDesignerLayout ' Me.RibbonPageGroup1.ItemLinks.Add(Me.BarListItem1) Me.RibbonPageGroup1.ItemLinks.Add(Me.BarButtonItem2) + Me.RibbonPageGroup1.ItemLinks.Add(Me.BarButtonItem1) Me.RibbonPageGroup1.Name = "RibbonPageGroup1" Me.RibbonPageGroup1.Text = "RibbonPageGroup1" ' 'RibbonPageGroup2 ' - Me.RibbonPageGroup2.ItemLinks.Add(Me.BarButtonItem1) Me.RibbonPageGroup2.Name = "RibbonPageGroup2" Me.RibbonPageGroup2.Text = "RibbonPageGroup2" ' @@ -132,6 +136,31 @@ Partial Class frmDesignerLayout Me.SplitContainerControl1.SplitterPosition = 818 Me.SplitContainerControl1.TabIndex = 8 ' + 'LayoutControlMain + ' + Me.LayoutControlMain.AllowDrop = True + Me.LayoutControlMain.BackColor = System.Drawing.Color.Transparent + Me.LayoutControlMain.Dock = System.Windows.Forms.DockStyle.Fill + Me.LayoutControlMain.Location = New System.Drawing.Point(0, 0) + Me.LayoutControlMain.Name = "LayoutControlMain" + Me.LayoutControlMain.OptionsCustomizationForm.DefaultPage = DevExpress.XtraLayout.CustomizationPage.LayoutTreeView + Me.LayoutControlMain.OptionsCustomizationForm.DesignTimeCustomizationFormPositionAndSize = New System.Drawing.Rectangle(1143, 263, 650, 400) + Me.LayoutControlMain.OptionsCustomizationForm.ShowLoadButton = False + Me.LayoutControlMain.OptionsCustomizationForm.ShowPropertyGrid = True + Me.LayoutControlMain.OptionsCustomizationForm.ShowSaveButton = False + Me.LayoutControlMain.Root = Me.LayoutControlGroupMain + Me.LayoutControlMain.Size = New System.Drawing.Size(818, 440) + Me.LayoutControlMain.TabIndex = 3 + Me.LayoutControlMain.Text = "LayoutControl1" + ' + 'LayoutControlGroupMain + ' + Me.LayoutControlGroupMain.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.[True] + Me.LayoutControlGroupMain.GroupBordersVisible = False + Me.LayoutControlGroupMain.Name = "Root" + Me.LayoutControlGroupMain.Size = New System.Drawing.Size(818, 440) + Me.LayoutControlGroupMain.TextVisible = False + ' 'XtraTabControl1 ' Me.XtraTabControl1.Dock = System.Windows.Forms.DockStyle.Fill @@ -144,26 +173,27 @@ Partial Class frmDesignerLayout ' 'XtraTabPage1 ' - Me.XtraTabPage1.Controls.Add(Me.PropertyGridControl1) + Me.XtraTabPage1.Controls.Add(Me.PropertyGridMain) Me.XtraTabPage1.Name = "XtraTabPage1" Me.XtraTabPage1.Size = New System.Drawing.Size(366, 415) - Me.XtraTabPage1.Text = "XtraTabPage1" + Me.XtraTabPage1.Text = "Eigenschaften" ' - 'PropertyGridControl1 + 'PropertyGridMain ' - Me.PropertyGridControl1.Dock = System.Windows.Forms.DockStyle.Fill - Me.PropertyGridControl1.Location = New System.Drawing.Point(0, 0) - Me.PropertyGridControl1.MenuManager = Me.RibbonControl1 - Me.PropertyGridControl1.Name = "PropertyGridControl1" - Me.PropertyGridControl1.Size = New System.Drawing.Size(366, 415) - Me.PropertyGridControl1.TabIndex = 0 + Me.PropertyGridMain.Cursor = System.Windows.Forms.Cursors.Hand + Me.PropertyGridMain.Dock = System.Windows.Forms.DockStyle.Fill + Me.PropertyGridMain.Location = New System.Drawing.Point(0, 0) + Me.PropertyGridMain.MenuManager = Me.RibbonControl1 + Me.PropertyGridMain.Name = "PropertyGridMain" + Me.PropertyGridMain.Size = New System.Drawing.Size(366, 415) + Me.PropertyGridMain.TabIndex = 0 ' 'XtraTabPage2 ' Me.XtraTabPage2.Controls.Add(Me.ToolboxControlMain) Me.XtraTabPage2.Name = "XtraTabPage2" Me.XtraTabPage2.Size = New System.Drawing.Size(366, 415) - Me.XtraTabPage2.Text = "XtraTabPage2" + Me.XtraTabPage2.Text = "Controls" ' 'ToolboxControlMain ' @@ -196,7 +226,7 @@ Partial Class frmDesignerLayout Me.ToolboxItemTextbox.Caption = "Textbox" Me.ToolboxItemTextbox.ImageOptions.Image = Global.DD_PM_WINDREAM.My.Resources.Resources.TextBox Me.ToolboxItemTextbox.Name = "ToolboxItemTextbox" - Me.ToolboxItemTextbox.Tag = "Textbox" + Me.ToolboxItemTextbox.Tag = "TextBox" ' 'ToolboxItemMemoedit ' @@ -219,31 +249,6 @@ Partial Class frmDesignerLayout Me.ToolboxItemCheckbox.Name = "ToolboxItemCheckbox" Me.ToolboxItemCheckbox.Tag = "Checkbox" ' - 'LayoutControlMain - ' - Me.LayoutControlMain.AllowCustomization = False - Me.LayoutControlMain.AllowDrop = True - Me.LayoutControlMain.BackColor = System.Drawing.Color.Transparent - Me.LayoutControlMain.Dock = System.Windows.Forms.DockStyle.Fill - Me.LayoutControlMain.Location = New System.Drawing.Point(0, 0) - Me.LayoutControlMain.Name = "LayoutControlMain" - Me.LayoutControlMain.OptionsCustomizationForm.DesignTimeCustomizationFormPositionAndSize = New System.Drawing.Rectangle(706, 255, 650, 400) - Me.LayoutControlMain.OptionsCustomizationForm.ShowLayoutTreeView = False - Me.LayoutControlMain.OptionsCustomizationForm.ShowLoadButton = False - Me.LayoutControlMain.OptionsCustomizationForm.ShowSaveButton = False - Me.LayoutControlMain.Root = Me.LayoutControlGroupMain - Me.LayoutControlMain.Size = New System.Drawing.Size(818, 440) - Me.LayoutControlMain.TabIndex = 3 - Me.LayoutControlMain.Text = "LayoutControl1" - ' - 'LayoutControlGroupMain - ' - Me.LayoutControlGroupMain.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.[True] - Me.LayoutControlGroupMain.GroupBordersVisible = False - Me.LayoutControlGroupMain.Name = "Root" - Me.LayoutControlGroupMain.Size = New System.Drawing.Size(818, 440) - Me.LayoutControlGroupMain.TextVisible = False - ' 'frmDesignerLayout ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) @@ -259,13 +264,13 @@ Partial Class frmDesignerLayout CType(Me.RibbonControl1, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.SplitContainerControl1, System.ComponentModel.ISupportInitialize).EndInit() Me.SplitContainerControl1.ResumeLayout(False) + CType(Me.LayoutControlMain, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.LayoutControlGroupMain, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.XtraTabControl1, System.ComponentModel.ISupportInitialize).EndInit() Me.XtraTabControl1.ResumeLayout(False) Me.XtraTabPage1.ResumeLayout(False) - CType(Me.PropertyGridControl1, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.PropertyGridMain, System.ComponentModel.ISupportInitialize).EndInit() Me.XtraTabPage2.ResumeLayout(False) - CType(Me.LayoutControlMain, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.LayoutControlGroupMain, System.ComponentModel.ISupportInitialize).EndInit() Me.ResumeLayout(False) Me.PerformLayout() @@ -288,7 +293,7 @@ Partial Class frmDesignerLayout Friend WithEvents ToolboxItemDatepicker As DevExpress.XtraToolbox.ToolboxItem Friend WithEvents ToolboxItemCheckbox As DevExpress.XtraToolbox.ToolboxItem Friend WithEvents BarListItem1 As DevExpress.XtraBars.BarListItem - Friend WithEvents PropertyGridControl1 As DevExpress.XtraVerticalGrid.PropertyGridControl + Friend WithEvents PropertyGridMain As DevExpress.XtraVerticalGrid.PropertyGridControl Friend WithEvents BarButtonItem1 As DevExpress.XtraBars.BarButtonItem Friend WithEvents BarButtonItem2 As DevExpress.XtraBars.BarButtonItem Friend WithEvents LayoutControlMain As DevExpress.XtraLayout.LayoutControl diff --git a/app/DD_PM_WINDREAM/frmDesignerLayout.resx b/app/DD_PM_WINDREAM/frmDesignerLayout.resx index a5fb450..c6386fb 100644 --- a/app/DD_PM_WINDREAM/frmDesignerLayout.resx +++ b/app/DD_PM_WINDREAM/frmDesignerLayout.resx @@ -122,21 +122,68 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFlEZXZFeHByZXNzLkRhdGEudjE5LjIsIFZlcnNpb249MTkuMi4z LjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjg4ZDE3NTRkNz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C9nPg0KPC9zdmc+Cw== \ No newline at end of file diff --git a/app/DD_PM_WINDREAM/frmDesignerLayout.vb b/app/DD_PM_WINDREAM/frmDesignerLayout.vb index c80ddbb..ec0484d 100644 --- a/app/DD_PM_WINDREAM/frmDesignerLayout.vb +++ b/app/DD_PM_WINDREAM/frmDesignerLayout.vb @@ -1,6 +1,8 @@ Imports System.IO Imports System.Text.Encoding +Imports DD_PM_WINDREAM.Controls Imports DevExpress.XtraBars +Imports DevExpress.XtraEditors Imports DevExpress.XtraLayout Imports DevExpress.XtraLayout.Customization Imports DevExpress.XtraLayout.Dragging @@ -16,6 +18,7 @@ Public Class frmDesignerLayout Private _DragItem As BaseLayoutItem Private _Window As DragFrameWindow Private _DragController As LayoutItemDragController = Nothing + Private _LayoutSerializer As LayoutControlSerializer = Nothing Protected ReadOnly Property DragFrameWindow As DragFrameWindow Get @@ -47,11 +50,14 @@ Public Class frmDesignerLayout Dim oHitInfo As BaseLayoutItemHitInfo = LayoutControlMain.CalcHitInfo(oPosition) Dim oLayoutControl As LayoutControlItem = DirectCast(_DragItem, LayoutControlItem) Dim oControlName As String = oLayoutControl.Tag & Guid.NewGuid().ToString().GetHashCode().ToString("x") - Dim oControl As Control = _ControlLoader.CreateLayoutControl(oLayoutControl.Tag, oControlName, 0) + Dim oControl As BaseEdit = _ControlLoader.CreateLayoutControl(oLayoutControl.Tag, oControlName, 0) If oLayoutControl IsNot Nothing Then HideDragHelper() oLayoutControl.Control = oControl + oLayoutControl.Text = oControlName + oLayoutControl.Name = "Container-" & oControlName + If (_DragController IsNot Nothing AndAlso _DragItem IsNot Nothing) Then If (_DragItem.Owner Is Nothing OrElse _DragItem.Parent Is Nothing) Then @@ -62,7 +68,7 @@ Public Class frmDesignerLayout Focus() End If HideDragHelper() - '_DragItem = Nothing + _DragItem = Nothing End If End Sub @@ -96,6 +102,7 @@ Public Class frmDesignerLayout Private Sub frmDesignerLayout_Load(sender As Object, e As EventArgs) Handles Me.Load Try _ControlLoader = New ControlLoader(LOGCONFIG, LayoutControlGroupMain) + _LayoutSerializer = New LayoutControlSerializer(LOGCONFIG) Dim oSQL = "Select * from TBIDB_LAYOUT_CONFIG" FormsDatatable = ClassDatabase.Return_Datatable_ConStr(oSQL, CONNECTION_STRING_IDB) @@ -114,24 +121,79 @@ Public Class frmDesignerLayout End Sub Private Sub Item_Click(sender As Object, e As ItemClickEventArgs) - SelectedLayoutId = e.Item.Tag - Dim oRow As DataRow = FormsDatatable.Select($"GUID = {SelectedLayoutId}").First() - 'Dim oXml = oRow.Item("XML_CONTENT") - Dim b As Byte() = System.Convert.FromBase64String(oRow.Item("XML_CONTENT")) + Try + SelectedLayoutId = e.Item.Tag + Dim oRow As DataRow = FormsDatatable.Select($"GUID = {SelectedLayoutId}").First() + 'Dim oXml = oRow.Item("XML_CONTENT") - Using oStream As New MemoryStream(b, False) - LayoutControlMain.RestoreLayoutFromStream(oStream) - End Using + Dim oLayout As Byte() = System.Convert.FromBase64String(oRow.Item("XML_LAYOUT")) + Dim oControls As Byte() = System.Convert.FromBase64String(oRow.Item("XML_CONTENT")) + + Using oLayoutStream As New MemoryStream(oLayout, False) + Using oControlStream As New MemoryStream(oControls, False) + _LayoutSerializer.RestoreLayoutExFromStream(LayoutControlMain, oLayoutStream, oControlStream) + End Using + End Using + Catch ex As Exception + MsgBox("Unexpected Error in FormSave:" & ex.Message, MsgBoxStyle.Critical) + End Try End Sub Private Sub BarButtonItem2_ItemClick(sender As Object, e As ItemClickEventArgs) Handles BarButtonItem2.ItemClick - Using oStream As New MemoryStream() - LayoutControlMain.SaveLayoutToStream(oStream) - Dim oBase64 = System.Convert.ToBase64String(oStream.ToArray()) - 'Dim oXml As String = UTF8.GetString(oStream.ToArray()) - Dim oSql As String = $"UPDATE TBIDB_LAYOUT_CONFIG SET XML_CONTENT = '{oBase64}' WHERE GUID = {SelectedLayoutId}" + Using oLayoutStream As New MemoryStream() + Using oControlStream As New MemoryStream() + _LayoutSerializer.SaveLayoutExToStream(LayoutControlMain, oLayoutStream, oControlStream) - ClassDatabase.Execute_non_Query_ConStr(oSql, CONNECTION_STRING_IDB) + Dim oLayout = System.Convert.ToBase64String(oLayoutStream.ToArray()) + Dim oControls = System.Convert.ToBase64String(oControlStream.ToArray()) + + Dim oSql As String = $"UPDATE TBIDB_LAYOUT_CONFIG SET XML_CONTENT = '{oControls}', XML_LAYOUT = '{oLayout}', CHANGED_WHO = '{Environment.UserName}' WHERE GUID = {SelectedLayoutId}" + + ClassDatabase.Execute_non_Query_ConStr(oSql, CONNECTION_STRING_IDB) + End Using End Using End Sub + + Private Sub BarButtonItem1_ItemClick(sender As Object, e As ItemClickEventArgs) Handles BarButtonItem1.ItemClick + LayoutControlMain.ShowCustomizationForm() + End Sub + + Private Sub LayoutControlMain_ItemSelectionChanged(sender As Object, e As EventArgs) Handles LayoutControlMain.ItemSelectionChanged + ' only layout control items have properties + If TypeOf sender IsNot LayoutControlItem Then + Exit Sub + End If + + Dim oLayoutItem As LayoutControlItem = DirectCast(sender, LayoutControlItem) + Dim oSelectedControl As BaseEdit = oLayoutItem.Control + Dim oMetadata As New Metadata + + ' Don't load properties for layout items like splitters, separators, etc. + If oLayoutItem.Control Is Nothing Then + Exit Sub + End If + + Select Case oSelectedControl.GetType + Case GetType(MemoEdit) + PropertyGridMain.SelectedObject = New Properties.MemoeditProperties() With { + .Id = 0, + .Name = oSelectedControl.Name + } + Case GetType(TextEdit) + PropertyGridMain.SelectedObject = New Properties.TextboxProperties() With { + .Id = 0, + .Name = oSelectedControl.Name + } + Case GetType(DateEdit) + PropertyGridMain.SelectedObject = New Properties.DatepickerProperties() With { + .Id = 0, + .Name = oSelectedControl.Name + } + Case GetType(CheckEdit) + PropertyGridMain.SelectedObject = New Properties.CheckboxProperties() With { + .Id = 0, + .Name = oSelectedControl.Name + } + End Select + End Sub End Class \ No newline at end of file diff --git a/app/DD_PM_WINDREAM/frmDesignerLayout/Editors/DatasourceEditor.vb b/app/DD_PM_WINDREAM/frmDesignerLayout/Editors/DatasourceEditor.vb new file mode 100644 index 0000000..9d41137 --- /dev/null +++ b/app/DD_PM_WINDREAM/frmDesignerLayout/Editors/DatasourceEditor.vb @@ -0,0 +1,48 @@ +Imports System.ComponentModel +'Imports System.ComponentModel.Design +Imports System.Drawing.Design +'Imports System.Windows.Forms +Imports System.Windows.Forms.Design + +Namespace Controls.Editors + Public Class DatasourceEditor + Inherits UITypeEditor + + Public Overrides Function GetEditStyle(context As ITypeDescriptorContext) As UITypeEditorEditStyle + Return UITypeEditorEditStyle.Modal + End Function + + Public Overrides Function EditValue(context As ITypeDescriptorContext, provider As IServiceProvider, value As Object) As Object + Dim oService As IWindowsFormsEditorService = TryCast(provider.GetService(GetType(IWindowsFormsEditorService)), IWindowsFormsEditorService) + Dim oDatasource As DatasourceType = DirectCast(value, DatasourceType) + + If oService IsNot Nothing AndAlso oDatasource IsNot Nothing Then + Using oForm As New frmDatasourceEditor() + oForm.Value = oDatasource + If oService.ShowDialog(oForm) = DialogResult.OK Then + + value = oForm.Value + End If + End Using + End If + + Return value + End Function + End Class + + Public Class DatasourceTypeConverter + Inherits TypeConverter + + Public Overrides Function ToString() As String + Return MyBase.ToString() + End Function + + ' Diese Funktion gibt den String zurück, der im PropertyGrid für den Benutzer sichtbar ist, kann ruhig etwas hübscher sein als foo;bar;baz + Public Overrides Function ConvertTo(context As ITypeDescriptorContext, culture As Globalization.CultureInfo, value As Object, destinationType As Type) As Object + Return "Datasource" + End Function + End Class + +End Namespace + + diff --git a/app/DD_PM_WINDREAM/frmDesignerLayout/Editors/DatasourceType.vb b/app/DD_PM_WINDREAM/frmDesignerLayout/Editors/DatasourceType.vb new file mode 100644 index 0000000..90849a3 --- /dev/null +++ b/app/DD_PM_WINDREAM/frmDesignerLayout/Editors/DatasourceType.vb @@ -0,0 +1,23 @@ +Imports System.ComponentModel +Imports System.Drawing.Design +Imports DigitalData.GUIs.ClientSuite.Controls.Editors + +Namespace Controls.Editors + + + Public Class DatasourceType + Public Property StaticList As New List(Of String) + Public Property SQLCommand As String = String.Empty + + Public Sub New() + End Sub + + Public Sub New(Values As List(Of String)) + _StaticList = Values + End Sub + + Public Sub New(SQLCommand As String) + _SQLCommand = SQLCommand + End Sub + End Class +End Namespace diff --git a/app/DD_PM_WINDREAM/frmDesignerLayout/Editors/StaticListEditor.vb b/app/DD_PM_WINDREAM/frmDesignerLayout/Editors/StaticListEditor.vb new file mode 100644 index 0000000..bf53f43 --- /dev/null +++ b/app/DD_PM_WINDREAM/frmDesignerLayout/Editors/StaticListEditor.vb @@ -0,0 +1,72 @@ +Imports System.ComponentModel +'Imports System.ComponentModel.Design +Imports System.Drawing.Design +'Imports System.Windows.Forms +Imports System.Windows.Forms.Design + +Public Class StaticListEditor + Inherits UITypeEditor + + Public Overrides Function GetEditStyle(context As ITypeDescriptorContext) As UITypeEditorEditStyle + Return UITypeEditorEditStyle.Modal + End Function + + Public Overrides Function EditValue(context As ITypeDescriptorContext, provider As IServiceProvider, value As Object) As Object + Dim oService As IWindowsFormsEditorService = TryCast(provider.GetService(GetType(IWindowsFormsEditorService)), IWindowsFormsEditorService) + Dim oStaticListString As String = DirectCast(value, StaticList).Value + + If oService IsNot Nothing AndAlso oStaticListString IsNot Nothing Then + Using oForm As New frmStaticListEditor() + oStaticListString = oStaticListString.Replace(";", vbNewLine) ' Semikolon zu vbNewLine + oForm.Value = oStaticListString + If oService.ShowDialog(oForm) = DialogResult.OK Then + Dim oString As String = oForm.Value.Replace(vbNewLine, ";") ' vbNewLine zu Semikolon + Dim oStaticList As New StaticList(oString) + value = oStaticList + End If + End Using + End If + + Return value + End Function +End Class + + + +Public Class StaticList + + Public Sub New() + _Value = String.Empty + End Sub + + Public Sub New(Value As String) + _Value = Value + End Sub + + Public Property Value As String +End Class + +Public Class StaticListTypeConverter + Inherits TypeConverter + + + Public Overrides Function ToString() As String + Return MyBase.ToString() + End Function + + ' Diese Funktion gibt den String zurück, der im PropertyGrid für den Benutzer sichtbar ist, kann ruhig etwas hübscher sein als foo;bar;baz + Public Overrides Function ConvertTo(context As ITypeDescriptorContext, culture As Globalization.CultureInfo, value As Object, destinationType As Type) As Object + Dim oStaticListString = String.Empty + + If TypeOf value Is StaticList Then + Dim oStaticList As StaticList = DirectCast(value, StaticList) + oStaticListString = oStaticList.Value + ElseIf TypeOf value Is String Then + oStaticListString = value + Else + MsgBox("Error in Converting StaticList value") + End If + + Return oStaticListString.Replace(";", ", ") + End Function +End Class diff --git a/app/DD_PM_WINDREAM/frmDesignerLayout/Editors/frmDatasourceEditor.Designer.vb b/app/DD_PM_WINDREAM/frmDesignerLayout/Editors/frmDatasourceEditor.Designer.vb new file mode 100644 index 0000000..bdc5603 --- /dev/null +++ b/app/DD_PM_WINDREAM/frmDesignerLayout/Editors/frmDatasourceEditor.Designer.vb @@ -0,0 +1,63 @@ + _ +Partial Class frmDatasourceEditor + Inherits DevExpress.XtraEditors.XtraForm + + 'Das Formular überschreibt den Löschvorgang, um die Komponentenliste zu bereinigen. + _ + 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. + _ + Private Sub InitializeComponent() + Me.PanelEditor = New DevExpress.XtraEditors.PanelControl() + Me.btnSave = New System.Windows.Forms.Button() + CType(Me.PanelEditor, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + 'PanelEditor + ' + Me.PanelEditor.Dock = System.Windows.Forms.DockStyle.Top + Me.PanelEditor.Location = New System.Drawing.Point(0, 0) + Me.PanelEditor.Name = "PanelEditor" + Me.PanelEditor.Size = New System.Drawing.Size(800, 394) + Me.PanelEditor.TabIndex = 0 + ' + 'btnSave + ' + Me.btnSave.Location = New System.Drawing.Point(713, 415) + Me.btnSave.Name = "btnSave" + Me.btnSave.Size = New System.Drawing.Size(75, 23) + Me.btnSave.TabIndex = 1 + Me.btnSave.Text = "Speichern" + Me.btnSave.UseVisualStyleBackColor = True + ' + 'frmDatasourceEditor + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(800, 450) + Me.Controls.Add(Me.btnSave) + Me.Controls.Add(Me.PanelEditor) + Me.Name = "frmDatasourceEditor" + Me.Text = "frmDatasourceEditor" + CType(Me.PanelEditor, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + + End Sub + + Friend WithEvents PanelEditor As DevExpress.XtraEditors.PanelControl + Friend WithEvents btnSave As Button +End Class diff --git a/app/DD_PM_WINDREAM/frmDesignerLayout/Editors/frmDatasourceEditor.resx b/app/DD_PM_WINDREAM/frmDesignerLayout/Editors/frmDatasourceEditor.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/app/DD_PM_WINDREAM/frmDesignerLayout/Editors/frmDatasourceEditor.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/app/DD_PM_WINDREAM/frmDesignerLayout/Editors/frmDatasourceEditor.vb b/app/DD_PM_WINDREAM/frmDesignerLayout/Editors/frmDatasourceEditor.vb new file mode 100644 index 0000000..6fd169e --- /dev/null +++ b/app/DD_PM_WINDREAM/frmDesignerLayout/Editors/frmDatasourceEditor.vb @@ -0,0 +1,54 @@ +Imports DD_PM_WINDREAM.Controls.Editors +'Imports ScintillaNET + +Public Class frmDatasourceEditor + Public Value As DatasourceType + + 'Private _Editor As Scintilla + Private _Editor As TextBox + + Private Sub frmDatasourceEditor_Load(sender As Object, e As EventArgs) Handles MyBase.Load + + + '_Editor = New Scintilla() With { + ' .Dock = DockStyle.Fill, + ' .BorderStyle = BorderStyle.None, + ' .Text = Value.SQLCommand + '} + + '_Editor.StyleResetDefault() + 'With _Editor.Styles(Style.Default) + ' .Font = "Consolas" + ' .Size = 10 + 'End With + '_Editor.StyleClearAll() + '_Editor.Lexer = Lexer.Sql + + '_Editor.Styles(Style.LineNumber).ForeColor = Color.FromArgb(255, 128, 128, 128) + '_Editor.Styles(Style.LineNumber).BackColor = Color.FromArgb(255, 228, 228, 228) + '_Editor.Styles(Style.Sql.Comment).ForeColor = Color.Green + '_Editor.Styles(Style.Sql.CommentLine).ForeColor = Color.Green + '_Editor.Styles(Style.Sql.CommentLineDoc).ForeColor = Color.Green + '_Editor.Styles(Style.Sql.Number).ForeColor = Color.Maroon + '_Editor.Styles(Style.Sql.Word).ForeColor = Color.Blue + '_Editor.Styles(Style.Sql.Word2).ForeColor = Color.Fuchsia + '_Editor.Styles(Style.Sql.User1).ForeColor = Color.Gray + '_Editor.Styles(Style.Sql.User2).ForeColor = Color.FromArgb(255, 0, 128, 192) + '_Editor.Styles(Style.Sql.String).ForeColor = Color.Red + '_Editor.Styles(Style.Sql.Character).ForeColor = Color.Red + '_Editor.Styles(Style.Sql.[Operator]).ForeColor = Color.Black + '_Editor.SetKeywords(0, "add alter as authorization backup begin bigint binary bit break browse bulk by cascade case catch check checkpoint close clustered column commit compute constraint containstable continue create current cursor cursor database date datetime datetime2 datetimeoffset dbcc deallocate decimal declare default delete deny desc disk distinct distributed double drop dump else end errlvl escape except exec execute exit external fetch file fillfactor float for foreign freetext freetexttable from full function goto grant group having hierarchyid holdlock identity identity_insert identitycol if image index insert int intersect into key kill lineno load merge money national nchar nocheck nocount nolock nonclustered ntext numeric nvarchar of off offsets on open opendatasource openquery openrowset openxml option order over percent plan precision primary print proc procedure public raiserror read readtext real reconfigure references replication restore restrict return revert revoke rollback rowcount rowguidcol rule save schema securityaudit select set setuser shutdown smalldatetime smallint smallmoney sql_variant statistics table table tablesample text textsize then time timestamp tinyint to top tran transaction trigger truncate try union unique uniqueidentifier update updatetext use user values varbinary varchar varying view waitfor when where while with writetext xml go ") + '_Editor.SetKeywords(1, "ascii cast char charindex ceiling coalesce collate contains convert current_date current_time current_timestamp current_user floor isnull max min nullif object_id session_user substring system_user tsequal ") + '_Editor.SetKeywords(4, "all and any between cross exists in inner is join left like not null or outer pivot right some unpivot ( ) * ") + '_Editor.SetKeywords(5, "sys objects sysobjects ") + + 'PanelEditor.Controls.Add(_Editor) + _Editor = New TextBox With {.Multiline = True} + + PanelEditor.Controls.Add(_Editor) + End Sub + + Private Sub btnSave_Click(sender As Object, e As EventArgs) Handles btnSave.Click + Value.SQLCommand = _Editor.Text + End Sub +End Class \ No newline at end of file diff --git a/app/DD_PM_WINDREAM/frmDesignerLayout/Editors/frmStaticListEditor.Designer.vb b/app/DD_PM_WINDREAM/frmDesignerLayout/Editors/frmStaticListEditor.Designer.vb new file mode 100644 index 0000000..e9eb256 --- /dev/null +++ b/app/DD_PM_WINDREAM/frmDesignerLayout/Editors/frmStaticListEditor.Designer.vb @@ -0,0 +1,81 @@ + _ +Partial Class frmStaticListEditor + Inherits System.Windows.Forms.Form + + 'Das Formular überschreibt den Löschvorgang, um die Komponentenliste zu bereinigen. + _ + 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. + _ + Private Sub InitializeComponent() + Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmStaticListEditor)) + Me.txtValue = New System.Windows.Forms.TextBox() + Me.Button1 = New System.Windows.Forms.Button() + Me.Label1 = New System.Windows.Forms.Label() + Me.Label2 = New System.Windows.Forms.Label() + Me.Button2 = New System.Windows.Forms.Button() + Me.SuspendLayout() + ' + 'txtValue + ' + resources.ApplyResources(Me.txtValue, "txtValue") + Me.txtValue.Name = "txtValue" + ' + 'Button1 + ' + resources.ApplyResources(Me.Button1, "Button1") + Me.Button1.DialogResult = System.Windows.Forms.DialogResult.OK + Me.Button1.Name = "Button1" + Me.Button1.UseVisualStyleBackColor = True + ' + 'Label1 + ' + resources.ApplyResources(Me.Label1, "Label1") + Me.Label1.Name = "Label1" + ' + 'Label2 + ' + resources.ApplyResources(Me.Label2, "Label2") + Me.Label2.Name = "Label2" + ' + 'Button2 + ' + resources.ApplyResources(Me.Button2, "Button2") + Me.Button2.DialogResult = System.Windows.Forms.DialogResult.Cancel + Me.Button2.Name = "Button2" + Me.Button2.UseVisualStyleBackColor = True + ' + 'frmStaticListEditor + ' + resources.ApplyResources(Me, "$this") + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.Controls.Add(Me.Button2) + Me.Controls.Add(Me.Label2) + Me.Controls.Add(Me.Label1) + Me.Controls.Add(Me.Button1) + Me.Controls.Add(Me.txtValue) + Me.Name = "frmStaticListEditor" + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + Friend WithEvents txtValue As System.Windows.Forms.TextBox + Friend WithEvents Button1 As System.Windows.Forms.Button + Friend WithEvents Label1 As System.Windows.Forms.Label + Friend WithEvents Label2 As System.Windows.Forms.Label + Friend WithEvents Button2 As System.Windows.Forms.Button +End Class diff --git a/app/DD_PM_WINDREAM/frmDesignerLayout/Editors/frmStaticListEditor.en-US.resx b/app/DD_PM_WINDREAM/frmDesignerLayout/Editors/frmStaticListEditor.en-US.resx new file mode 100644 index 0000000..9250f51 --- /dev/null +++ b/app/DD_PM_WINDREAM/frmDesignerLayout/Editors/frmStaticListEditor.en-US.resx @@ -0,0 +1,136 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Save + + + + 159, 13 + + + Enter Listelements (One per line) + + + Cancel + + + Edit Static List + + \ No newline at end of file diff --git a/app/DD_PM_WINDREAM/frmDesignerLayout/Editors/frmStaticListEditor.resx b/app/DD_PM_WINDREAM/frmDesignerLayout/Editors/frmStaticListEditor.resx new file mode 100644 index 0000000..d298956 --- /dev/null +++ b/app/DD_PM_WINDREAM/frmDesignerLayout/Editors/frmStaticListEditor.resx @@ -0,0 +1,279 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + 3 + + + 1 + + + + 6, 13 + + + Listenelemente eingeben (Ein Element pro Zeile) + + + 12, 235 + + + Statische Liste bearbeiten + + + + Bottom, Right + + + 234, 13 + + + Top, Bottom, Left, Right + + + 75, 23 + + + Button2 + + + True + + + Bottom, Left + + + 12, 227 + + + 3 + + + System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + True + + + 0, 13 + + + 431, 230 + + + 4 + + + $this + + + $this + + + 75, 23 + + + 0, 0 + + + $this + + + $this + + + 1 + + + 0 + + + CenterScreen + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 518, 265 + + + 516, 224 + + + Label1 + + + Label2 + + + 2 + + + 4 + + + 0 + + + txtValue + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Button1 + + + Speichern + + + True + + + 350, 230 + + + 2 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Bottom, Right + + + frmStaticListEditor + + + Abbrechen + + + True + + \ No newline at end of file diff --git a/app/DD_PM_WINDREAM/frmDesignerLayout/Editors/frmStaticListEditor.vb b/app/DD_PM_WINDREAM/frmDesignerLayout/Editors/frmStaticListEditor.vb new file mode 100644 index 0000000..4ca1596 --- /dev/null +++ b/app/DD_PM_WINDREAM/frmDesignerLayout/Editors/frmStaticListEditor.vb @@ -0,0 +1,19 @@ +Public Class frmStaticListEditor + + Public Property Value() As String + Get + Return txtValue.Text + End Get + Set(value As String) + txtValue.Text = value + End Set + End Property + + Private Sub frmStaticListEditor_Load(sender As Object, e As EventArgs) Handles MyBase.Load + 'noop + End Sub + + Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click + + End Sub +End Class \ No newline at end of file diff --git a/app/DD_PM_WINDREAM/frmDesignerLayout/Loader.vb b/app/DD_PM_WINDREAM/frmDesignerLayout/Loader.vb index fe7ab40..a72e68b 100644 --- a/app/DD_PM_WINDREAM/frmDesignerLayout/Loader.vb +++ b/app/DD_PM_WINDREAM/frmDesignerLayout/Loader.vb @@ -4,14 +4,14 @@ Imports DigitalData.Modules.Logging Public Class ControlLoader - Public Const CONTROL_TEXTEDIT = "TextBox" - Public Const CONTROL_MEMOEDIT = "Memoedit" - Public Const CONTROL_COMBOEDIT = "Combobox" - Public Const CONTROL_CHECKEDIT = "Checkbox" - Public Const CONTROL_RADIOEDIT = "Radiobutton" - Public Const CONTROL_DATEEDIT = "Datepicker" + Public Const CONTROL_TEXTEDIT = "TextBox" + Public Const CONTROL_MEMOEDIT = "Memoedit" + Public Const CONTROL_COMBOEDIT = "Combobox" + Public Const CONTROL_CHECKEDIT = "Checkbox" + Public Const CONTROL_RADIOEDIT = "Radiobutton" + Public Const CONTROL_DATEEDIT = "Datepicker" - Private _LayoutControlGroup As LayoutControlGroup + Private _LayoutControlGroup As LayoutControlGroup Private _LayoutControls As List(Of BaseEdit) Private _LogConfig As LogConfig Private _LOgger As Logger @@ -32,57 +32,57 @@ Public Class ControlLoader End Sub Public Sub AddControl(Name As String, Value As String, LayoutControlGroup As LayoutControlGroup) - Dim oTextEdit As New SimpleLabelItem() With { - .Name = Name, - .Text = Name & " - " & Value - } + Dim oTextEdit As New SimpleLabelItem() With { + .Name = Name, + .Text = Name & " - " & Value + } - LayoutControlGroup.AddItem(oTextEdit) - End Sub - Public Sub AddControl(Name As String, Value As String) - AddControl(Name, Value, _LayoutControlGroup) - End Sub + LayoutControlGroup.AddItem(oTextEdit) + End Sub + Public Sub AddControl(Name As String, Value As String) + AddControl(Name, Value, _LayoutControlGroup) + End Sub - Public Sub AddSeparator(LayoutControlGroup As LayoutControlGroup) - Dim oSeparator = New SimpleSeparator() + Public Sub AddSeparator(LayoutControlGroup As LayoutControlGroup) + Dim oSeparator = New SimpleSeparator() - LayoutControlGroup.AddItem(oSeparator) - End Sub - Public Sub AddSeparator() - AddSeparator(_LayoutControlGroup) - End Sub + LayoutControlGroup.AddItem(oSeparator) + End Sub + Public Sub AddSeparator() + AddSeparator(_LayoutControlGroup) + End Sub - Public Sub LoadControls(Datatable As DataTable, LayoutControlGroup As LayoutControlGroup) - For Each oRow As DataRow In Datatable.Rows - Dim oCaption As String = oRow.Item("COLNAME") - Dim oControlType As String = oRow.Item("CTRLTYPE") - Dim oControlId As Int64 = oRow.Item("RECORD_ID") - Dim oEditor As BaseEdit = CreateLayoutControl(oControlType, oControlId, oControlId) + Public Sub LoadControls(Datatable As DataTable, LayoutControlGroup As LayoutControlGroup) + For Each oRow As DataRow In Datatable.Rows + Dim oCaption As String = oRow.Item("COLNAME") + Dim oControlType As String = oRow.Item("CTRLTYPE") + Dim oControlId As Int64 = oRow.Item("RECORD_ID") + Dim oEditor As BaseEdit = CreateLayoutControl(oControlType, oControlId, oControlId) - If oEditor Is Nothing Then - Continue For - End If + If oEditor Is Nothing Then + Continue For + End If - oEditor.Tag = New Metadata() With { - .Id = oControlId, - .Type = oControlType, - .Caption = oCaption - } + oEditor.Tag = New Metadata() With { + .Id = oControlId, + .Type = oControlType, + .Caption = oCaption + } - LayoutControls.Add(oEditor) - LayoutControlGroup.AddItem(oCaption, oEditor) - Next + LayoutControls.Add(oEditor) + LayoutControlGroup.AddItem(oCaption, oEditor) + Next - LayoutControlGroup.AddItem(New EmptySpaceItem()) - End Sub - Public Sub LoadControls(Datatable As DataTable) - LoadControls(Datatable, _LayoutControlGroup) - End Sub + LayoutControlGroup.AddItem(New EmptySpaceItem()) + End Sub + Public Sub LoadControls(Datatable As DataTable) + LoadControls(Datatable, _LayoutControlGroup) + End Sub - Public Function CreateLayoutControl(Type As String, Name As String, Id As Int64) - Dim oEditor As BaseEdit = Nothing + Public Function CreateLayoutControl(Type As String, Name As String, Id As Int64) + Dim oEditor As BaseEdit = Nothing - LOGGER.Debug("Create new Control of type {0} with name {1}", Type, Name) + LOGGER.Debug("Create new Control of type {0} with name {1}", Type, Name) Select Case Type Case CONTROL_TEXTEDIT @@ -102,8 +102,8 @@ Public Class ControlLoader End Select Return oEditor - End Function - End Class + End Function +End Class diff --git a/app/DD_PM_WINDREAM/frmDesignerLayout/Localization.vb b/app/DD_PM_WINDREAM/frmDesignerLayout/Localization.vb new file mode 100644 index 0000000..48fc062 --- /dev/null +++ b/app/DD_PM_WINDREAM/frmDesignerLayout/Localization.vb @@ -0,0 +1,31 @@ +Imports System.ComponentModel + +Namespace Controls + Public Class Localization + Private Shared Function Lookup(key As String) + Try + 'Return My.Resources.ControlProperties.ResourceManager.GetString(key) + Return 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 Class +End Namespace + diff --git a/app/DD_PM_WINDREAM/frmDesignerLayout/Properties/BaseProperties.vb b/app/DD_PM_WINDREAM/frmDesignerLayout/Properties/BaseProperties.vb new file mode 100644 index 0000000..ad3bd59 --- /dev/null +++ b/app/DD_PM_WINDREAM/frmDesignerLayout/Properties/BaseProperties.vb @@ -0,0 +1,17 @@ +Imports System.ComponentModel +Imports DD_PM_WINDREAM.Controls.Localization + +Namespace Controls.Properties + Public MustInherit Class BaseProperties + + + + <[ReadOnly](True)> + Public Property Id As Integer + + + + Public Property Name As String + End Class +End Namespace + diff --git a/app/DD_PM_WINDREAM/frmDesignerLayout/Properties/CheckboxProperties.vb b/app/DD_PM_WINDREAM/frmDesignerLayout/Properties/CheckboxProperties.vb new file mode 100644 index 0000000..c2512d0 --- /dev/null +++ b/app/DD_PM_WINDREAM/frmDesignerLayout/Properties/CheckboxProperties.vb @@ -0,0 +1,7 @@ +Namespace Controls.Properties + Public Class CheckboxProperties + Inherits BaseProperties + End Class +End Namespace + + diff --git a/app/DD_PM_WINDREAM/frmDesignerLayout/Properties/ComboboxProperties.vb b/app/DD_PM_WINDREAM/frmDesignerLayout/Properties/ComboboxProperties.vb new file mode 100644 index 0000000..266a371 --- /dev/null +++ b/app/DD_PM_WINDREAM/frmDesignerLayout/Properties/ComboboxProperties.vb @@ -0,0 +1,14 @@ +Imports System.ComponentModel +Imports DD_PM_WINDREAM.Controls.Editors +Imports DD_PM_WINDREAM.Controls.Localization + +Namespace Controls.Properties + Public Class ComboboxProperties + Inherits BaseProperties + + + + Public Property Datasource As DatasourceType + End Class +End Namespace + diff --git a/app/DD_PM_WINDREAM/frmDesignerLayout/Properties/DatepickerProperties.vb b/app/DD_PM_WINDREAM/frmDesignerLayout/Properties/DatepickerProperties.vb new file mode 100644 index 0000000..4b3213a --- /dev/null +++ b/app/DD_PM_WINDREAM/frmDesignerLayout/Properties/DatepickerProperties.vb @@ -0,0 +1,6 @@ +Namespace Controls.Properties + Public Class DatepickerProperties + Inherits BaseProperties + End Class + +End Namespace \ No newline at end of file diff --git a/app/DD_PM_WINDREAM/frmDesignerLayout/Properties/MemoeditProperties.vb b/app/DD_PM_WINDREAM/frmDesignerLayout/Properties/MemoeditProperties.vb new file mode 100644 index 0000000..14c155d --- /dev/null +++ b/app/DD_PM_WINDREAM/frmDesignerLayout/Properties/MemoeditProperties.vb @@ -0,0 +1,7 @@ +Namespace Controls.Properties + Public Class MemoeditProperties + Inherits BaseProperties + End Class +End Namespace + + diff --git a/app/DD_PM_WINDREAM/frmDesignerLayout/Properties/TextboxProperties.vb b/app/DD_PM_WINDREAM/frmDesignerLayout/Properties/TextboxProperties.vb new file mode 100644 index 0000000..0dd0922 --- /dev/null +++ b/app/DD_PM_WINDREAM/frmDesignerLayout/Properties/TextboxProperties.vb @@ -0,0 +1,7 @@ +Namespace Controls.Properties + Public Class TextboxProperties + Inherits BaseProperties + End Class +End Namespace + + diff --git a/app/DD_PM_WINDREAM/frmDesignerLayout/Serializer.vb b/app/DD_PM_WINDREAM/frmDesignerLayout/Serializer.vb new file mode 100644 index 0000000..9af7f67 --- /dev/null +++ b/app/DD_PM_WINDREAM/frmDesignerLayout/Serializer.vb @@ -0,0 +1,297 @@ +Imports System.ComponentModel +Imports DevExpress.XtraEditors +Imports DevExpress.Utils.Serializing +Imports DevExpress.XtraLayout +Imports DevExpress.Utils.Serializing.Helpers +Imports System.IO +Imports DigitalData.Modules.Logging + +Public Class LayoutControlSerializer + Private appName As String = System.Reflection.Assembly.GetExecutingAssembly().FullName + Private serializer As XmlXtraSerializer = New MyXmlXtraSerializer() + Private LogConfig As LogConfig + Private Logger As Logger + + Public Sub New(LogConfig As LogConfig) + Me.LogConfig = LogConfig + Logger = LogConfig.GetLogger + End Sub + + 'Public Sub SaveLayoutExToXml(ByVal layoutControl As LayoutControl, ByVal filePath As String) + ' Try + ' Dim objects As New ObjectInfoCollection() + ' For Each ctrl As Control In layoutControl.Controls + ' If layoutControl.GetItemByControl(ctrl) IsNot Nothing Then + ' objects.Collection.Add(New ObjectInfo(ctrl)) + ' End If + ' Next ctrl + ' Dim filePathForControls As String = filePath.Replace(".xml", "Controls.xml") + ' layoutControl.SaveLayoutToXml(filePath) + ' serializer.SerializeObject(objects, filePathForControls, appName) + ' Catch ex As Exception + ' Logger.Error(ex) + ' End Try + 'End Sub + + Public Sub SaveLayoutExToStream(ByVal LayoutControl As LayoutControl, ByVal LayoutStream As Stream, ByVal ControlStream As Stream) + Try + Dim objects As New ObjectInfoCollection() + For Each ctrl As Control In LayoutControl.Controls + If LayoutControl.GetItemByControl(ctrl) IsNot Nothing Then + objects.Collection.Add(New ObjectInfo(ctrl)) + End If + Next ctrl + LayoutControl.SaveLayoutToStream(LayoutStream) + serializer.SerializeObject(objects, ControlStream, appName) + Catch ex As Exception + Logger.Error(ex) + End Try + End Sub + + 'Public Sub RestoreLayoutExFromXml(ByVal layoutControl As LayoutControl, ByVal filePath As String) + ' Try + ' Dim objects As New ObjectInfoCollection() + ' Dim filePathForControls As String = filePath.Replace(".xml", "Controls.xml") + ' serializer.DeserializeObject(objects, filePathForControls, appName) + ' For Each info As ObjectInfo In objects.Collection + ' Dim ctrl As Control = TryCast(info.SerializableObject, Control) + ' If ctrl IsNot Nothing Then + ' Dim controls() As Control = layoutControl.Controls.Find(ctrl.Name, False) + ' If controls.Length > 0 Then + ' layoutControl.Controls.Remove(controls(0)) + ' End If + ' layoutControl.Controls.Add(ctrl) + ' End If + ' Next info + ' layoutControl.RestoreLayoutFromXml(filePath) + ' Catch ex As Exception + ' Logger.Error(ex) + ' End Try + 'End Sub + + Public Sub RestoreLayoutExFromStream(ByVal layoutControl As LayoutControl, ByVal LayoutStream As Stream, ByVal ControlStream As Stream) + Try + Dim objects As New ObjectInfoCollection() + serializer.DeserializeObject(objects, ControlStream, appName) + For Each info As ObjectInfo In objects.Collection + Dim ctrl As Control = TryCast(info.SerializableObject, Control) + If ctrl IsNot Nothing Then + Dim controls() As Control = layoutControl.Controls.Find(ctrl.Name, False) + If controls.Length > 0 Then + layoutControl.Controls.Remove(controls(0)) + End If + layoutControl.Controls.Add(ctrl) + End If + Next info + layoutControl.RestoreLayoutFromStream(LayoutStream) + Catch ex As Exception + Logger.Error(ex) + End Try + End Sub +End Class + +Public Class MyXmlXtraSerializer + Inherits XmlXtraSerializer + + Public Sub New() + End Sub + + Protected Overrides Function CreateSerializeHelper(ByVal rootObj As Object, ByVal useRootObj As Boolean) As SerializeHelper + Return If(useRootObj, New MySerializeHelper(rootObj), New MySerializeHelper()) + End Function + + Protected Overrides Function CreateDeserializeHelper(ByVal rootObj As Object, ByVal useRootObj As Boolean) As DeserializeHelper + Return If(useRootObj, New MyDeserializeHelper(rootObj), New MyDeserializeHelper()) + End Function + +End Class + +Public Class ObjectInfoCollection + Implements IXtraSupportDeserializeCollectionItem + + Public Sub New() + _Collection = New List(Of ObjectInfo)() + End Sub + + ' Fields... + Private _Collection As List(Of ObjectInfo) + + + Public Property Collection() As List(Of ObjectInfo) + Get + Return _Collection + End Get + Set(ByVal value As List(Of ObjectInfo)) + _Collection = value + End Set + End Property + + Public Function CreateCollectionItem(ByVal propertyName As String, ByVal e As XtraItemEventArgs) As Object Implements IXtraSupportDeserializeCollectionItem.CreateCollectionItem + Dim info As New ObjectInfo() + Collection.Add(info) + Return info + End Function + + Public Sub SetIndexCollectionItem(ByVal propertyName As String, ByVal e As XtraSetItemIndexEventArgs) Implements IXtraSupportDeserializeCollectionItem.SetIndexCollectionItem + End Sub +End Class + +Public Class ObjectInfo + Public Sub New(ByVal serializableObject As Object) + Me.SerializableObject = serializableObject + End Sub + + Public Sub New() + End Sub + + + ' Fields... + Private _type As String + Private _SerializableObject As Object + + + Public Property Type1() As String + Get + Return _type + End Get + Set(ByVal value As String) + _type = value + Try + If _SerializableObject Is Nothing Then + Dim index As Integer = _type.LastIndexOf("."c) + Dim [nameSpace] = _type.Substring(0, index) + Dim type = System.Type.GetType(_type & ", " & [nameSpace]) + _SerializableObject = Activator.CreateInstance(type) + End If + Catch + End Try + End Set + End Property + + + Public Property SerializableObject() As Object + Get + Return _SerializableObject + End Get + Set(ByVal value As Object) + _SerializableObject = value + _type = _SerializableObject.GetType().ToString() + End Set + End Property + + + Public Property SerializableObjectName() As String + Get + Dim ctrl As Control = TryCast(SerializableObject, Control) + If ctrl IsNot Nothing Then + Return ctrl.Name + End If + Return String.Empty + End Get + Set(ByVal value As String) + Dim ctrl As Control = TryCast(SerializableObject, Control) + If ctrl IsNot Nothing Then + ctrl.Name = value + End If + End Set + End Property +End Class + +Public Class MySerializeHelper + Inherits SerializeHelper + + Public Sub New() + End Sub + + Public Sub New(ByVal rootObject As Object) + MyBase.New(rootObject) + End Sub + + Public Sub New(ByVal rootObject As Object, ByVal context As SerializationContext) + MyBase.New(rootObject, context) + End Sub + + Protected Overrides Sub SerializeProperty(ByVal store As XtraPropertyInfoCollection, ByVal obj As Object, ByVal pair As SerializablePropertyDescriptorPair, ByVal parentFlags As XtraSerializationFlags, ByVal options As DevExpress.Utils.OptionsLayoutBase) + Dim name = pair.Property.Name + + If name = "Tag" Then + Console.WriteLine() + End If + + Dim prop As PropertyDescriptor = pair.Property + Dim attr As XtraSerializableProperty = pair.Attribute + If attr Is Nothing AndAlso prop.IsBrowsable AndAlso prop.ShouldSerializeValue(obj) Then + If prop.PropertyType IsNot GetType(String) AndAlso prop.PropertyType.IsClass Then + pair = New SerializablePropertyDescriptorPair(prop, New XtraSerializableProperty(XtraSerializationVisibility.Content)) + Else + pair = New SerializablePropertyDescriptorPair(prop, New XtraSerializableProperty()) + End If + End If + MyBase.SerializeProperty(store, obj, pair, parentFlags, options) + End Sub +End Class + +Public Class MyDeserializeHelper + Inherits DeserializeHelper + + Public Sub New(ByVal rootObject As Object) + MyBase.New(rootObject) + End Sub + + Public Sub New(ByVal rootObject As Object, ByVal resetProperties As Boolean) + MyBase.New(rootObject, resetProperties) + End Sub + + Public Sub New(ByVal rootObject As Object, ByVal resetProperties As Boolean, ByVal context As SerializationContext) + MyBase.New(rootObject, resetProperties, context) + End Sub + + Public Sub New() + End Sub + + Protected Overrides Function CreateSerializationContext() As SerializationContext + Return New MySerializationContext() + End Function +End Class + +Public Class MySerializationContext + Inherits SerializationContext + + Public Sub New() + End Sub + + Protected Overrides Sub CustomGetSerializableProperties(ByVal obj As Object, ByVal pairsList As List(Of SerializablePropertyDescriptorPair), ByVal props As PropertyDescriptorCollection) + MyBase.CustomGetSerializableProperties(obj, pairsList, props) + Dim i As Integer = 0 + Do While i < pairsList.Count + Dim pair As SerializablePropertyDescriptorPair = pairsList(i) + Dim prop As PropertyDescriptor = pair.Property + Dim attr As XtraSerializableProperty = pair.Attribute + If attr Is Nothing AndAlso prop.IsBrowsable Then + If prop.PropertyType IsNot GetType(String) AndAlso prop.PropertyType.IsClass Then + pair = New SerializablePropertyDescriptorPair(prop, New XtraSerializableProperty(XtraSerializationVisibility.Content)) + Else + pair = New SerializablePropertyDescriptorPair(prop, New XtraSerializableProperty()) + End If + pairsList.RemoveAt(i) + pairsList.Insert(i, pair) + End If + i += 1 + Loop + End Sub + + Protected Overrides Function GetProperties(ByVal obj As Object, ByVal store As IXtraPropertyCollection) As PropertyDescriptorCollection + Dim propertyDescriptors As PropertyDescriptorCollection = MyBase.GetProperties(obj, store) + If store Is Nothing Then + Return propertyDescriptors + End If + Dim newPropertyDescriptors As New PropertyDescriptorCollection(Nothing) + For Each info As XtraPropertyInfo In store + Dim pd As PropertyDescriptor = propertyDescriptors(info.Name) + If pd IsNot Nothing Then + newPropertyDescriptors.Add(pd) + End If + Next info + Return newPropertyDescriptors + End Function +End Class