This commit is contained in:
Digital Data - Marlon Schreiber 2019-04-16 08:12:58 +02:00
commit 6dc5b137f3
348 changed files with 5210 additions and 2016 deletions

View File

@ -1,174 +0,0 @@
Imports System.IO
Imports System.Xml.Serialization
Imports DigitalData.Modules.Logging
Public Class ConfigManager(Of T)
Private Const USER_CONFIG_NAME As String = "UserConfig.xml"
Private Const COMPUTER_CONFIG_NAME As String = "ComputerConfig.xml"
Private ReadOnly _LogConfig As LogConfig
Private ReadOnly _Logger As Logger
Private ReadOnly _File As Filesystem.File
Private ReadOnly _UserPath As String
Private ReadOnly _ComputerPath As String
Private _CurrentDataPath As String
''' <summary>
''' The blueprint class from which the default config is created
''' </summary>
Private ReadOnly _Blueprint As T
Private ReadOnly _Serializer As XmlSerializer
Public ReadOnly Property Config As T
''' <summary>
''' Creates a new instance of the ConfigManager
''' </summary>
''' <example>
''' Public Class Config
''' Public Property StringEntry As String = "TEST"
''' Public Property BoolEntry As Boolean = True
''' Public Property IntEntry As Integer = 123
''' End Class
'''
''' Dim oConfigManager = New ConfigManager(Of Config)(_LogConfig, Application.UserAppDataPath, Application.CommonAppDataPath)
''' </example>
''' <param name="LogConfig">LogConfig instance</param>
''' <param name="UserConfigPath">The first path to check for a config file, eg. AppData</param>
''' <param name="ComputerConfigPath">The second path to check for a config file, eg. ProgramData</param>
Public Sub New(LogConfig As LogConfig, UserConfigPath As String, ComputerConfigPath As String)
_LogConfig = LogConfig
_Logger = LogConfig.GetLogger()
_File = New Filesystem.File(_LogConfig)
_UserPath = Path.Combine(UserConfigPath, USER_CONFIG_NAME)
_ComputerPath = Path.Combine(ComputerConfigPath, COMPUTER_CONFIG_NAME)
_Blueprint = Activator.CreateInstance(Of T)
_Serializer = New XmlSerializer(_Blueprint.GetType)
If Not Directory.Exists(UserConfigPath) Then
_Logger.Debug("UserConfigPath {0} did not exist and was created", UserConfigPath)
Directory.CreateDirectory(UserConfigPath)
End If
If Not _File.TestPathIsDirectory(UserConfigPath) Then
_Logger.Warn("UserConfigPath {0} is not a directory", UserConfigPath)
Throw New ArgumentException($"Path {UserConfigPath} is not a directory!")
End If
If Not Directory.Exists(ComputerConfigPath) Then
_Logger.Debug("ComputerConfigPath {0} did not exist and was created", ComputerConfigPath)
Directory.CreateDirectory(ComputerConfigPath)
End If
If Not _File.TestPathIsDirectory(ComputerConfigPath) Then
_Logger.Warn("ComputerConfigPath {0} is not a directory", ComputerConfigPath)
Throw New ArgumentException($"Path {ComputerConfigPath} is not a directory!")
End If
_Config = LoadConfig()
End Sub
''' <summary>
''' Save the current config object to `UserConfigPath`
''' </summary>
Public Sub Save()
WriteToFile(_Config, _UserPath)
End Sub
''' <summary>
''' First check if a user config exists and if it does, load it.
''' If not, check if a systemwide config exists and and if it does, load it.
''' Otherwise, create a user config using the default values from the supplied config class `T`
''' </summary>
''' <returns></returns>
Private Function LoadConfig() As T
Dim oConfig As T
If IO.File.Exists(_UserPath) Then
_Logger.Debug("Loading config from UserPath: {0}", _UserPath)
_CurrentDataPath = _UserPath
oConfig = ReadFromFile(_UserPath)
ElseIf IO.File.Exists(_ComputerPath) Then
_Logger.Debug("Loading config from ComputerPath: {0}", _ComputerPath)
_CurrentDataPath = _ComputerPath
oConfig = ReadFromFile(_ComputerPath)
Else
_Logger.Debug("Creating default config in UserPath: {0}", _UserPath)
_CurrentDataPath = _UserPath
oConfig = Activator.CreateInstance(_Blueprint.GetType)
WriteToFile(_Config, _UserPath)
End If
Return oConfig
End Function
''' <summary>
''' Serialize a config object to byte array
''' </summary>
''' <param name="Data"></param>
''' <returns></returns>
Private Function Serialize(Data As T) As Byte()
Try
_Logger.Debug("Serializing config object")
Using oStream = New MemoryStream()
_Serializer.Serialize(oStream, Data)
Return oStream.ToArray()
End Using
Catch ex As Exception
_Logger.Error(ex)
Throw ex
End Try
End Function
''' <summary>
''' Write an object to disk as xml
''' </summary>
''' <param name="Data">The object to write</param>
''' <param name="Path">The file name to write to</param>
Private Sub WriteToFile(Data As T, Path As String)
Try
_Logger.Debug("Saving config to: {0}", Path)
Dim oBytes = Serialize(Data)
Using oFileStream = New FileStream(Path, FileMode.Create, FileAccess.Write)
oFileStream.Write(oBytes, 0, oBytes.Length)
oFileStream.Flush()
End Using
Catch ex As Exception
_Logger.Error(ex)
Throw ex
End Try
End Sub
''' <summary>
''' Reads an xml from disk and deserializes to object
''' </summary>
''' <returns></returns>
Private Function ReadFromFile(Path As String) As T
Try
_Logger.Debug("Loading config from: {0}", Path)
Dim oConfig As T
Using oReader As New StreamReader(Path)
oConfig = _Serializer.Deserialize(oReader)
End Using
' If oConfig is Nothing, a config file was created but nothing was written to it.
' In this case we need to create oConfig from defaults so we have at least some config object
If oConfig Is Nothing Then
_Logger.Debug("Config file is valid but empty. Loading default values")
oConfig = Activator.CreateInstance(_Blueprint.GetType)
End If
Return oConfig
Catch ex As Exception
_Logger.Error(ex)
Throw ex
End Try
End Function
End Class

View File

@ -1,9 +0,0 @@
Public Class SinceVersionAttribute
Inherits Attribute
Public Version As Version
Public Sub New(Version As String)
Me.Version = New Version(Version)
End Sub
End Class

View File

@ -105,9 +105,6 @@
<Compile Include="frmLookupGrid.vb"> <Compile Include="frmLookupGrid.vb">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
<Compile Include="GridLookupEditExOLD.vb">
<SubType>Component</SubType>
</Compile>
<Compile Include="LookupControl.Designer.vb"> <Compile Include="LookupControl.Designer.vb">
<DependentUpon>LookupControl.vb</DependentUpon> <DependentUpon>LookupControl.vb</DependentUpon>
</Compile> </Compile>
@ -117,7 +114,6 @@
<Compile Include="LookupControl2.vb"> <Compile Include="LookupControl2.vb">
<SubType>Component</SubType> <SubType>Component</SubType>
</Compile> </Compile>
<Compile Include="LookupCreator.vb" />
<Compile Include="LookupGridHandler.vb" /> <Compile Include="LookupGridHandler.vb" />
<Compile Include="LookupGridRegistration.vb" /> <Compile Include="LookupGridRegistration.vb" />
<Compile Include="LookupGridView.Designer.vb"> <Compile Include="LookupGridView.Designer.vb">
@ -152,9 +148,6 @@
<EmbeddedResource Include="frmLookupGrid.resx"> <EmbeddedResource Include="frmLookupGrid.resx">
<DependentUpon>frmLookupGrid.vb</DependentUpon> <DependentUpon>frmLookupGrid.vb</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="GridLookupEditExOLD.resx">
<DependentUpon>GridLookupEditExOLD.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="LookupControl.resx"> <EmbeddedResource Include="LookupControl.resx">
<DependentUpon>LookupControl.vb</DependentUpon> <DependentUpon>LookupControl.vb</DependentUpon>
</EmbeddedResource> </EmbeddedResource>

View File

@ -0,0 +1,139 @@
Imports System.ComponentModel
Imports System.Drawing
Imports DevExpress.XtraEditors
Imports DevExpress.XtraEditors.Drawing
Imports DevExpress.XtraEditors.Registrator
Imports DevExpress.XtraEditors.Repository
Imports DevExpress.XtraEditors.ViewInfo
Imports DevExpress.XtraEditors.Popup
Imports DevExpress.Accessibility
Imports DevExpress.XtraEditors.Controls
<UserRepositoryItem("RegisterLookupControl2")>
Public Class RepositoryItemLookupControl2
Inherits RepositoryItemGridLookUpEdit
Shared Sub New()
RegisterLookupControl2()
End Sub
Public Const CustomEditName As String = "LookupControl2"
Public Sub New()
End Sub
Public Overrides ReadOnly Property EditorTypeName As String
Get
Return CustomEditName
End Get
End Property
Public Shared Sub RegisterLookupControl2()
Dim img As Image = Nothing
EditorRegistrationInfo.Default.Editors.Add(New EditorClassInfo(CustomEditName, GetType(LookupControl2), GetType(RepositoryItemLookupControl2), GetType(GridLookUpEditBaseViewInfo), New ButtonEditPainter(), True, img, GetType(ButtonEditAccessible)))
End Sub
Public Overrides Sub Assign(item As RepositoryItem)
BeginUpdate()
Try
MyBase.Assign(item)
Dim source As RepositoryItemLookupControl2 = TryCast(item, RepositoryItemLookupControl2)
If source Is Nothing Then
Return
End If
Finally
EndUpdate()
End Try
End Sub
End Class
<ToolboxItem(True)>
Public Class LookupControl2
Inherits GridLookUpEdit
Public Property MultiSelect As Boolean
Public Property AllowAddNewValues As Boolean
Public Property PreventDuplicates As Boolean
Public Property DataSource As DataTable
Public Property SelectedValues As List(Of String)
Private Const TAG_BUTTON_LOOKUP_FORM = "openLookupForm"
Private Const TEXT_NO_RECORDS = "Keine Datensätze ausgewählt"
Private Const TEXT_N_RECORDS = "{0} Datensätze ausgewählt"
Shared Sub New()
RepositoryItemLookupControl2.RegisterLookupControl2()
End Sub
Public Sub New()
Properties.Buttons.Add(New EditorButton() With {
.Kind = ButtonPredefines.Ellipsis,
.Tag = TAG_BUTTON_LOOKUP_FORM
})
AddHandler ButtonClick, AddressOf HandleButtonClick
AddHandler EditValueChanging, AddressOf HandleEditValueChanging
End Sub
Private Sub HandleEditValueChanging(sender As Object, e As ChangingEventArgs)
e.Cancel = True
End Sub
Private Sub HandleButtonClick(sender As Object, e As ButtonPressedEventArgs)
If e.Button.Tag <> TAG_BUTTON_LOOKUP_FORM Then
Exit Sub
End If
Dim oForm As frmLookupGrid = GetLookupForm()
Dim oResult = oForm.ShowDialog()
If oResult = Windows.Forms.DialogResult.OK Then
Dim oValues = oForm.SelectedValues
UpdateSelectedValues(oValues)
SelectedValues = oValues
End If
oForm.Dispose()
End Sub
Private Sub UpdateSelectedValues(Values As List(Of String))
If MultiSelect = True Then
Properties.DataSource = Values
Properties.NullText = IIf(Values.Count = 0, TEXT_NO_RECORDS, String.Format(TEXT_N_RECORDS, Values.Count))
Else
Text = Values.FirstOrDefault()
End If
End Sub
Private Function GetLookupForm() As frmLookupGrid
Dim oForm As New frmLookupGrid() With {
.MultiSelect = MultiSelect,
.AddNewValues = AllowAddNewValues,
.PreventDuplicates = PreventDuplicates,
.DataSource = DataSource,
.SelectedValues = SelectedValues,
.StartPosition = Windows.Forms.FormStartPosition.Manual,
.Location = PointToScreen(New Point(Width, 0))
}
Return oForm
End Function
<DesignerSerializationVisibility(DesignerSerializationVisibility.Content)>
Public Shadows ReadOnly Property Properties As RepositoryItemLookupControl2
Get
Return TryCast(MyBase.Properties, RepositoryItemLookupControl2)
End Get
End Property
Public Overrides ReadOnly Property EditorTypeName As String
Get
Return RepositoryItemLookupControl2.CustomEditName
End Get
End Property
End Class

View File

@ -9,7 +9,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "GUIs", "GUIs", "{8FFE925E-8
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Setups", "Setups", "{D887B4BE-E457-4E45-8E22-D086E92DD2B7}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Setups", "Setups", "{D887B4BE-E457-4E45-8E22-D086E92DD2B7}"
EndProject EndProject
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "EDMDesigner", "EDMDesigner\EDMDesigner.vbproj", "{5284F4E5-A6C1-4BCF-896F-3ABEA985B741}" Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "EDMDesigner", "GUIs.Test.EDMDesigner\EDMDesigner.vbproj", "{5284F4E5-A6C1-4BCF-896F-3ABEA985B741}"
EndProject EndProject
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Logging", "Modules.Logging\Logging.vbproj", "{903B2D7D-3B80-4BE9-8713-7447B704E1B0}" Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Logging", "Modules.Logging\Logging.vbproj", "{903B2D7D-3B80-4BE9-8713-7447B704E1B0}"
EndProject EndProject
@ -17,7 +17,7 @@ Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Windream", "Modules.Windrea
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Services", "Services", "{7AF3F9C2-C939-4A08-95C1-0453207E298A}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Services", "Services", "{7AF3F9C2-C939-4A08-95C1-0453207E298A}"
EndProject EndProject
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "TestGUI", "TestGUI\TestGUI.vbproj", "{93130E7D-A950-4CBD-A0D9-7A6FAF94DDC0}" Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "TestGUI", "GUIs.Test.TestGUI\TestGUI.vbproj", "{93130E7D-A950-4CBD-A0D9-7A6FAF94DDC0}"
EndProject EndProject
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Database", "Modules.Database\Database.vbproj", "{EAF0EA75-5FA7-485D-89C7-B2D843B03A96}" Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Database", "Modules.Database\Database.vbproj", "{EAF0EA75-5FA7-485D-89C7-B2D843B03A96}"
EndProject EndProject
@ -27,11 +27,11 @@ Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "DDTestService", "DDTestServ
EndProject EndProject
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Variables", "Variables\Variables.vbproj", "{836C9ADE-E04E-4E1E-B17A-201E68014790}" Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Variables", "Variables\Variables.vbproj", "{836C9ADE-E04E-4E1E-B17A-201E68014790}"
EndProject EndProject
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Config", "Config\Config.vbproj", "{44982F9B-6116-44E2-85D0-F39650B1EF99}" Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Config", "Modules.Config\Config.vbproj", "{44982F9B-6116-44E2-85D0-F39650B1EF99}"
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Controls", "Controls", "{F98C0329-C004-417F-B2AB-7466E88D8220}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Controls", "Controls", "{F98C0329-C004-417F-B2AB-7466E88D8220}"
EndProject EndProject
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "LookupControl", "LookupGrid\LookupControl.vbproj", "{3DCD6D1A-C830-4241-B7E4-27430E7EA483}" Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "LookupControl", "Controls.LookupGrid\LookupControl.vbproj", "{3DCD6D1A-C830-4241-B7E4-27430E7EA483}"
EndProject EndProject
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Filesystem", "Filesystem\Filesystem.vbproj", "{991D0231-4623-496D-8BD0-9CA906029CBC}" Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Filesystem", "Filesystem\Filesystem.vbproj", "{991D0231-4623-496D-8BD0-9CA906029CBC}"
EndProject EndProject
@ -49,15 +49,15 @@ Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "DDZUGFeRDService", "DDZUGFe
EndProject EndProject
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Interfaces", "Modules.Interfaces\Interfaces.vbproj", "{AB6F09BF-E794-4F6A-94BB-C97C0BA84D64}" Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Interfaces", "Modules.Interfaces\Interfaces.vbproj", "{AB6F09BF-E794-4F6A-94BB-C97C0BA84D64}"
EndProject EndProject
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "ZUGFeRDTest", "ZUGFeRDTest\ZUGFeRDTest.vbproj", "{16156434-E471-43F1-8030-76A0DA17CD5A}" Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "ZUGFeRDTest", "GUIs.Test.ZUGFeRDTest\ZUGFeRDTest.vbproj", "{16156434-E471-43F1-8030-76A0DA17CD5A}"
EndProject EndProject
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Jobs", "Jobs\Jobs.vbproj", "{39EC839A-3C30-4922-A41E-6B09D1DDE5C3}" Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Jobs", "Jobs\Jobs.vbproj", "{39EC839A-3C30-4922-A41E-6B09D1DDE5C3}"
EndProject EndProject
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "DD_CommunicationService", "DD_CommunicationService\DD_CommunicationService.vbproj", "{1FB2854F-C050-427D-9FAC-1D8F232E8025}" Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "DD_CommunicationService", "DD_CommunicationService\DD_CommunicationService.vbproj", "{1FB2854F-C050-427D-9FAC-1D8F232E8025}"
EndProject EndProject
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "GUI_EDMI", "GUI_EDMI\GUI_EDMI.vbproj", "{88EDAD5B-1B98-43E4-B068-1251E7AF01A0}" Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "GUI_EDMI", "GUIs.Test.GUI_EDMI\GUI_EDMI.vbproj", "{88EDAD5B-1B98-43E4-B068-1251E7AF01A0}"
EndProject EndProject
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "ClientSuite", "EDMI_ClientSuite\ClientSuite.vbproj", "{406C95F4-9FEA-45B6-8385-1768CDBBF1A7}" Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "ClientSuite", "GUIs.ClientSuite\ClientSuite.vbproj", "{406C95F4-9FEA-45B6-8385-1768CDBBF1A7}"
EndProject EndProject
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "DDEDMService", "SERVICES\DDEDM_NetworkService\DDEDMService.vbproj", "{A8C3F298-76AB-4359-AB3C-986E313B4336}" Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "DDEDMService", "SERVICES\DDEDM_NetworkService\DDEDMService.vbproj", "{A8C3F298-76AB-4359-AB3C-986E313B4336}"
EndProject EndProject
@ -67,6 +67,12 @@ Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "DDEDMLicenseService", "DDLi
EndProject EndProject
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "License", "Modules.License\License.vbproj", "{5EBACBFA-F11A-4BBF-8D02-91461F2293ED}" Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "License", "Modules.License\License.vbproj", "{5EBACBFA-F11A-4BBF-8D02-91461F2293ED}"
EndProject EndProject
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "ADSyncTest", "GUIs.Test.ADSyncTest\ADSyncTest.vbproj", "{7386AB04-DF8D-4DFB-809D-1FAC8212CB7E}"
EndProject
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "JobRunner", "JobRunner\JobRunner.vbproj", "{59461E98-A5AF-438C-A651-5021ACAE82AD}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "GUIs.Test", "GUIs.Test", "{CC368D6A-6AC4-4EB9-A092-14700FABEF7A}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@ -165,15 +171,23 @@ Global
{5EBACBFA-F11A-4BBF-8D02-91461F2293ED}.Debug|Any CPU.Build.0 = Debug|Any CPU {5EBACBFA-F11A-4BBF-8D02-91461F2293ED}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5EBACBFA-F11A-4BBF-8D02-91461F2293ED}.Release|Any CPU.ActiveCfg = Release|Any CPU {5EBACBFA-F11A-4BBF-8D02-91461F2293ED}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5EBACBFA-F11A-4BBF-8D02-91461F2293ED}.Release|Any CPU.Build.0 = Release|Any CPU {5EBACBFA-F11A-4BBF-8D02-91461F2293ED}.Release|Any CPU.Build.0 = Release|Any CPU
{7386AB04-DF8D-4DFB-809D-1FAC8212CB7E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7386AB04-DF8D-4DFB-809D-1FAC8212CB7E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7386AB04-DF8D-4DFB-809D-1FAC8212CB7E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7386AB04-DF8D-4DFB-809D-1FAC8212CB7E}.Release|Any CPU.Build.0 = Release|Any CPU
{59461E98-A5AF-438C-A651-5021ACAE82AD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{59461E98-A5AF-438C-A651-5021ACAE82AD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{59461E98-A5AF-438C-A651-5021ACAE82AD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{59461E98-A5AF-438C-A651-5021ACAE82AD}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
EndGlobalSection EndGlobalSection
GlobalSection(NestedProjects) = preSolution GlobalSection(NestedProjects) = preSolution
{5284F4E5-A6C1-4BCF-896F-3ABEA985B741} = {8FFE925E-8B84-45F1-93CB-32B1C96F41EB} {5284F4E5-A6C1-4BCF-896F-3ABEA985B741} = {CC368D6A-6AC4-4EB9-A092-14700FABEF7A}
{903B2D7D-3B80-4BE9-8713-7447B704E1B0} = {3E2008C8-27B1-41DD-9B1A-0C4029F6AECC} {903B2D7D-3B80-4BE9-8713-7447B704E1B0} = {3E2008C8-27B1-41DD-9B1A-0C4029F6AECC}
{4C86DF8F-A280-40D4-85B0-10B1BF66C15C} = {3E2008C8-27B1-41DD-9B1A-0C4029F6AECC} {4C86DF8F-A280-40D4-85B0-10B1BF66C15C} = {3E2008C8-27B1-41DD-9B1A-0C4029F6AECC}
{93130E7D-A950-4CBD-A0D9-7A6FAF94DDC0} = {8FFE925E-8B84-45F1-93CB-32B1C96F41EB} {93130E7D-A950-4CBD-A0D9-7A6FAF94DDC0} = {CC368D6A-6AC4-4EB9-A092-14700FABEF7A}
{EAF0EA75-5FA7-485D-89C7-B2D843B03A96} = {3E2008C8-27B1-41DD-9B1A-0C4029F6AECC} {EAF0EA75-5FA7-485D-89C7-B2D843B03A96} = {3E2008C8-27B1-41DD-9B1A-0C4029F6AECC}
{AF664D85-0A4B-4BAB-A2F8-83110C06553A} = {3E2008C8-27B1-41DD-9B1A-0C4029F6AECC} {AF664D85-0A4B-4BAB-A2F8-83110C06553A} = {3E2008C8-27B1-41DD-9B1A-0C4029F6AECC}
{63B0EAA3-8BF5-46DA-9040-15E781F4C3B1} = {7AF3F9C2-C939-4A08-95C1-0453207E298A} {63B0EAA3-8BF5-46DA-9040-15E781F4C3B1} = {7AF3F9C2-C939-4A08-95C1-0453207E298A}
@ -184,15 +198,17 @@ Global
{3207D8E7-36E3-4714-9B03-7B5B3D6D351A} = {3E2008C8-27B1-41DD-9B1A-0C4029F6AECC} {3207D8E7-36E3-4714-9B03-7B5B3D6D351A} = {3E2008C8-27B1-41DD-9B1A-0C4029F6AECC}
{7DEEC36E-EA5F-4711-AD1E-FD8894F4AD77} = {7AF3F9C2-C939-4A08-95C1-0453207E298A} {7DEEC36E-EA5F-4711-AD1E-FD8894F4AD77} = {7AF3F9C2-C939-4A08-95C1-0453207E298A}
{AB6F09BF-E794-4F6A-94BB-C97C0BA84D64} = {3E2008C8-27B1-41DD-9B1A-0C4029F6AECC} {AB6F09BF-E794-4F6A-94BB-C97C0BA84D64} = {3E2008C8-27B1-41DD-9B1A-0C4029F6AECC}
{16156434-E471-43F1-8030-76A0DA17CD5A} = {8FFE925E-8B84-45F1-93CB-32B1C96F41EB} {16156434-E471-43F1-8030-76A0DA17CD5A} = {CC368D6A-6AC4-4EB9-A092-14700FABEF7A}
{39EC839A-3C30-4922-A41E-6B09D1DDE5C3} = {3E2008C8-27B1-41DD-9B1A-0C4029F6AECC} {39EC839A-3C30-4922-A41E-6B09D1DDE5C3} = {3E2008C8-27B1-41DD-9B1A-0C4029F6AECC}
{1FB2854F-C050-427D-9FAC-1D8F232E8025} = {7AF3F9C2-C939-4A08-95C1-0453207E298A} {1FB2854F-C050-427D-9FAC-1D8F232E8025} = {7AF3F9C2-C939-4A08-95C1-0453207E298A}
{88EDAD5B-1B98-43E4-B068-1251E7AF01A0} = {8FFE925E-8B84-45F1-93CB-32B1C96F41EB} {88EDAD5B-1B98-43E4-B068-1251E7AF01A0} = {CC368D6A-6AC4-4EB9-A092-14700FABEF7A}
{406C95F4-9FEA-45B6-8385-1768CDBBF1A7} = {8FFE925E-8B84-45F1-93CB-32B1C96F41EB} {406C95F4-9FEA-45B6-8385-1768CDBBF1A7} = {8FFE925E-8B84-45F1-93CB-32B1C96F41EB}
{A8C3F298-76AB-4359-AB3C-986E313B4336} = {7AF3F9C2-C939-4A08-95C1-0453207E298A} {A8C3F298-76AB-4359-AB3C-986E313B4336} = {7AF3F9C2-C939-4A08-95C1-0453207E298A}
{5B1171DC-FFFE-4813-A20D-786AAE47B320} = {3E2008C8-27B1-41DD-9B1A-0C4029F6AECC} {5B1171DC-FFFE-4813-A20D-786AAE47B320} = {3E2008C8-27B1-41DD-9B1A-0C4029F6AECC}
{CBE9322E-67A1-4CC5-B25F-4A1B4C9FC55C} = {7AF3F9C2-C939-4A08-95C1-0453207E298A} {CBE9322E-67A1-4CC5-B25F-4A1B4C9FC55C} = {7AF3F9C2-C939-4A08-95C1-0453207E298A}
{5EBACBFA-F11A-4BBF-8D02-91461F2293ED} = {3E2008C8-27B1-41DD-9B1A-0C4029F6AECC} {5EBACBFA-F11A-4BBF-8D02-91461F2293ED} = {3E2008C8-27B1-41DD-9B1A-0C4029F6AECC}
{7386AB04-DF8D-4DFB-809D-1FAC8212CB7E} = {CC368D6A-6AC4-4EB9-A092-14700FABEF7A}
{59461E98-A5AF-438C-A651-5021ACAE82AD} = {7AF3F9C2-C939-4A08-95C1-0453207E298A}
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {C1BE4090-A0FD-48AF-86CB-39099D14B286} SolutionGuid = {C1BE4090-A0FD-48AF-86CB-39099D14B286}

View File

@ -31,8 +31,11 @@
<setting name="JOB_INTERVAL" serializeAs="String"> <setting name="JOB_INTERVAL" serializeAs="String">
<value>10</value> <value>10</value>
</setting> </setting>
<setting name="MSSQL_CONNECTION" serializeAs="String"> <setting name="MSSQL_CONNECTIONSTRING" serializeAs="String">
<value>Data Source=172.24.12.41\tests;Initial Catalog=DD_ECM;Persist Security Info=True;User ID=sa;Password=ddd</value> <value />
</setting>
<setting name="MSSQL_ENABLED" serializeAs="String">
<value>False</value>
</setting> </setting>
</DDZUGFeRDService.My.MySettings> </DDZUGFeRDService.My.MySettings>
</applicationSettings> </applicationSettings>

View File

@ -119,11 +119,19 @@ Namespace My
<Global.System.Configuration.ApplicationScopedSettingAttribute(), _ <Global.System.Configuration.ApplicationScopedSettingAttribute(), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Configuration.DefaultSettingValueAttribute("Data Source=172.24.12.41\tests;Initial Catalog=DD_ECM;Persist Security Info=True;"& _ Global.System.Configuration.DefaultSettingValueAttribute("")> _
"User ID=sa;Password=ddd")> _ Public ReadOnly Property MSSQL_CONNECTIONSTRING() As String
Public ReadOnly Property MSSQL_CONNECTION() As String
Get Get
Return CType(Me("MSSQL_CONNECTION"),String) Return CType(Me("MSSQL_CONNECTIONSTRING"),String)
End Get
End Property
<Global.System.Configuration.ApplicationScopedSettingAttribute(), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Configuration.DefaultSettingValueAttribute("False")> _
Public ReadOnly Property MSSQL_ENABLED() As Boolean
Get
Return CType(Me("MSSQL_ENABLED"),Boolean)
End Get End Get
End Property End Property
End Class End Class

View File

@ -23,8 +23,11 @@
<Setting Name="JOB_INTERVAL" Type="System.Int32" Scope="Application"> <Setting Name="JOB_INTERVAL" Type="System.Int32" Scope="Application">
<Value Profile="(Default)">10</Value> <Value Profile="(Default)">10</Value>
</Setting> </Setting>
<Setting Name="MSSQL_CONNECTION" Type="System.String" Scope="Application"> <Setting Name="MSSQL_CONNECTIONSTRING" Type="System.String" Scope="Application">
<Value Profile="(Default)">Data Source=172.24.12.41\tests;Initial Catalog=DD_ECM;Persist Security Info=True;User ID=sa;Password=ddd</Value> <Value Profile="(Default)" />
</Setting>
<Setting Name="MSSQL_ENABLED" Type="System.Boolean" Scope="Application">
<Value Profile="(Default)">False</Value>
</Setting> </Setting>
</Settings> </Settings>
</SettingsFile> </SettingsFile>

View File

@ -22,18 +22,27 @@ Public Class ThreadRunner
Private _originalEmailDirectory As String Private _originalEmailDirectory As String
Private _zugferd As ZUGFeRDInterface Private _zugferd As ZUGFeRDInterface
Private _jobArguments As WorkerArgs Private _jobArguments As WorkerArgs
Private _mssql As MSSQLServer
Private Const TIMER_INTERVAL_MS = 10_000 Private Const TIMER_INTERVAL_MS = 10_000
Public Sub New(LogConfig As LogConfig, Firebird As Firebird) Public Sub New(LogConfig As LogConfig, Firebird As Firebird, Optional MSSQL As MSSQLServer = Nothing)
_logConfig = LogConfig _logConfig = LogConfig
_logger = _logConfig.GetLogger() _logger = _logConfig.GetLogger()
_firebird = Firebird _firebird = Firebird
_zugferd = New ZUGFeRDInterface(_logConfig) _zugferd = New ZUGFeRDInterface(_logConfig)
_mssql = MSSQL
Dim args As New WorkerArgs() Dim args As New WorkerArgs()
args = LoadFolderConfig(args) args = LoadFolderConfig(args)
args = LoadPropertyMapFor(args, "DEFAULT") args = LoadPropertyMapFor(args, "DEFAULT")
' Use MSSQL Server if available
If _mssql IsNot Nothing Then
_logger.Debug("Data will be inserted into MSSQL Server.")
args.InsertIntoSQLServer = True
End If
_jobArguments = args _jobArguments = args
_logger.Debug("Checking SuccessDirectory {0}", args.SuccessDirectory) _logger.Debug("Checking SuccessDirectory {0}", args.SuccessDirectory)
@ -104,7 +113,7 @@ Public Class ThreadRunner
_logger.Debug("Background worker running..") _logger.Debug("Background worker running..")
Dim job As New ImportZUGFeRDFiles(_logConfig, _firebird) Dim job As New ImportZUGFeRDFiles(_logConfig, _firebird, _mssql)
job.Start(args) job.Start(args)
Catch ex As Exception Catch ex As Exception
_logger.Warn("Background worker failed!") _logger.Warn("Background worker failed!")

View File

@ -1,16 +1,18 @@
Imports System.IO Imports System.IO
Imports DigitalData.Modules.Database Imports DigitalData.Modules.Database
Imports DigitalData.Modules.Logging Imports DigitalData.Modules.Logging
Imports DigitalData.Modules.Logging.LogConfig
Public Class ZUGFeRDService Public Class ZUGFeRDService
Private _logConfig As LogConfig Private _logConfig As LogConfig
Private _logger As Logger Private _logger As Logger
Private _firebird As Firebird Private _firebird As Firebird
Private _mssql As MSSQLServer = Nothing
Private _threadRunner As ThreadRunner Private _threadRunner As ThreadRunner
Protected Overrides Sub OnStart(ByVal args() As String) Protected Overrides Sub OnStart(ByVal args() As String)
_logConfig = New LogConfig(LogConfig.PathType.CustomPath, Path.Combine(My.Application.Info.DirectoryPath, "Log")) _logConfig = New LogConfig(PathType.CustomPath, Path.Combine(My.Application.Info.DirectoryPath, "Log"))
_logConfig.Debug = True _logConfig.Debug = True
_logger = _logConfig.GetLogger() _logger = _logConfig.GetLogger()
_logger.Info($"{My.Settings.SERVICE_NAME} is starting.") _logger.Info($"{My.Settings.SERVICE_NAME} is starting.")
@ -20,14 +22,22 @@ Public Class ZUGFeRDService
Dim oUser As String = My.Settings.DB_USER Dim oUser As String = My.Settings.DB_USER
Dim oPassword As String = My.Settings.DB_PASSWORD Dim oPassword As String = My.Settings.DB_PASSWORD
Dim oJobInterval As Integer = My.Settings.JOB_INTERVAL Dim oJobInterval As Integer = My.Settings.JOB_INTERVAL
Dim oMSSQLConnectionString As String = My.Settings.MSSQL_CONNECTIONSTRING
_logger.Debug("Datasource: {0}", oDataSource) Dim oMSSQLEnabled As Boolean = My.Settings.MSSQL_ENABLED
_logger.Debug("Database: {0}", oDatabase)
_firebird = New Firebird(_logConfig, oDataSource, oDatabase, oUser, oPassword) _firebird = New Firebird(_logConfig, oDataSource, oDatabase, oUser, oPassword)
If oMSSQLEnabled = True Then
_mssql = New MSSQLServer(_logConfig, oMSSQLConnectionString)
If _mssql.DBInitialized = False Then
_logger.Warn("MSSQL Connection could not be initialized. Disabling MSSQL.")
_mssql = Nothing
End If
End If
Try Try
_threadRunner = New ThreadRunner(_logConfig, _firebird) _threadRunner = New ThreadRunner(_logConfig, _firebird, _mssql)
_threadRunner.Start(oJobInterval) _threadRunner.Start(oJobInterval)
Catch ex As Exception Catch ex As Exception
_logger.Error(ex) _logger.Error(ex)

View File

@ -1,43 +0,0 @@
Imports DevExpress.XtraBars.Ribbon
Imports DigitalData.Modules.Logging
''' <summary>
''' This BaseClass is used to provide common functionality like the Logger or ErrorHandler to all Forms
''' To use it, create a form and change the `Inherits` statement in FormName.Designer.vb to this form, eg.:
'''
''' Partial Class frmExample
''' Inherits BaseForm
'''
''' ...
''' End Class
''' </summary>
Public Class BaseForm
Inherits Form
Private ReadOnly _Logger As Logger
Private ReadOnly _ErrorHandler As ClassErrorHandler
Protected ReadOnly Property Logger As Logger
Get
Return _Logger
End Get
End Property
Public Sub New()
' Get the full name of the inheriting form
' so the log messages have the right classname
Dim oClassName = [GetType]().FullName
' My.LogConfig is undefined in the designer
_Logger = My.LogConfig?.GetLogger(oClassName)
_ErrorHandler = New ClassErrorHandler(_Logger)
' When you add something, be careful if it
' depends on a global var like My.LogConfig
' you might need to check for its existence with ?
End Sub
Public Sub ShowErrorMessage(Exception As Exception)
_ErrorHandler.ShowErrorMessage(Exception)
End Sub
End Class

View File

@ -1,60 +0,0 @@
Imports DevExpress.XtraBars.Docking
Imports DevExpress.XtraBars.Ribbon
Imports DigitalData.Modules.Logging
''' <summary>
''' This BaseClass is used to provide common functionality like the Logger or ErrorHandler to all Forms
''' To use it, create a form and change the `Inherits` statement in FormName.Designer.vb to this form, eg.:
'''
''' Partial Class frmExample
''' Inherits BaseRibbonForm
'''
''' ...
''' End Class
'''
''' Only BaseRibbonForms can have panels attached to it!
''' </summary>
Public Class BaseRibbonForm
Inherits RibbonForm
Private ReadOnly _Logger As Logger
Private ReadOnly _ErrorHandler As ClassErrorHandler
Protected ReadOnly Property Logger As Logger
Get
Return _Logger
End Get
End Property
Public Sub New()
' Get the full name of the inheriting form
' so the log messages have the right classname
Dim oClassName = [GetType]().FullName
' My.LogConfig is undefined in the designer
_Logger = My.LogConfig?.GetLogger(oClassName)
_ErrorHandler = New ClassErrorHandler(_Logger)
' When you add something, be careful if it
' depends on a global var like My.LogConfig
' you might need to check for its existence with ?
End Sub
Public Sub ShowErrorMessage(Exception As Exception)
_ErrorHandler.ShowErrorMessage(Exception)
End Sub
''' <summary>
''' Returns a list of panels that will be show when the form is opened.
''' This can be overridden by all inheriting forms to extend the list of panels
''' Panels will be created by PanelManager.
''' </summary>
''' <seealso cref="ClassPanelManager"/>
''' <returns>A list of PanelInformation</returns>
Public Overridable Function GetInitialPanels() As List(Of PanelInfo)
Return New List(Of PanelInfo)
End Function
End Class

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

@ -1,27 +0,0 @@
Imports System.ComponentModel
Public Class ClassControlLocalization
Private Shared Function Lookup(key As String)
Try
Return My.Resources.ControlProperties.ResourceManager.GetString(key)
Catch ex As Exception
Return key
End Try
End Function
Public Class LocalizedDescriptionAttribute
Inherits DescriptionAttribute
Public Sub New(key As String)
MyBase.New(Lookup(key))
End Sub
End Class
Public Class LocalizedCategoryAttribute
Inherits CategoryAttribute
Public Sub New(key As String)
MyBase.New(Lookup(key))
End Sub
End Class
End 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,40 +0,0 @@
Imports System.ComponentModel
Imports DigitalData.GUIs.ClientSuite.ClassControlLocalization
Imports DigitalData.GUIs.ClientSuite.ClassControlUtils
Namespace ControlProperties
Public MustInherit Class ClassBaseProperties
<LocalizedCategory("category_info")>
<LocalizedDescription("desc_id")>
<[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,7 +0,0 @@
Namespace ControlProperties
Public Class ClassComboboxProperties
Inherits ClassMultiInputProperties
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,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

@ -1,158 +0,0 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class frmFormDesigner
Inherits BaseRibbonForm
'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container()
Me.RibbonControl = New DevExpress.XtraBars.Ribbon.RibbonControl()
Me.RibbonPage1 = New DevExpress.XtraBars.Ribbon.RibbonPage()
Me.RibbonStatusBar = New DevExpress.XtraBars.Ribbon.RibbonStatusBar()
Me.LayoutControlMain = New DevExpress.XtraLayout.LayoutControl()
Me.LayoutControlGroupMain = New DevExpress.XtraLayout.LayoutControlGroup()
Me.ToolboxControl1 = New DevExpress.XtraToolbox.ToolboxControl()
Me.ToolboxGroup1 = New DevExpress.XtraToolbox.ToolboxGroup()
Me.ToolboxItemTextbox = New DevExpress.XtraToolbox.ToolboxItem()
Me.ToolboxItemMemo = New DevExpress.XtraToolbox.ToolboxItem()
Me.RibbonPageGroup1 = New DevExpress.XtraBars.Ribbon.RibbonPageGroup()
Me.ToolboxItem1 = New DevExpress.XtraToolbox.ToolboxItem()
CType(Me.RibbonControl, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.LayoutControlMain, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.LayoutControlGroupMain, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'RibbonControl
'
Me.RibbonControl.ExpandCollapseItem.Id = 0
Me.RibbonControl.Items.AddRange(New DevExpress.XtraBars.BarItem() {Me.RibbonControl.ExpandCollapseItem})
Me.RibbonControl.Location = New System.Drawing.Point(0, 0)
Me.RibbonControl.MaxItemId = 1
Me.RibbonControl.Name = "RibbonControl"
Me.RibbonControl.Pages.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPage() {Me.RibbonPage1})
Me.RibbonControl.Size = New System.Drawing.Size(870, 146)
Me.RibbonControl.StatusBar = Me.RibbonStatusBar
'
'RibbonPage1
'
Me.RibbonPage1.Name = "RibbonPage1"
Me.RibbonPage1.Text = "RibbonPage1"
'
'RibbonStatusBar
'
Me.RibbonStatusBar.Location = New System.Drawing.Point(0, 508)
Me.RibbonStatusBar.Name = "RibbonStatusBar"
Me.RibbonStatusBar.Ribbon = Me.RibbonControl
Me.RibbonStatusBar.Size = New System.Drawing.Size(870, 21)
'
'LayoutControlMain
'
Me.LayoutControlMain.BackColor = System.Drawing.Color.FromArgb(CType(CType(224, Byte), Integer), CType(CType(224, Byte), Integer), CType(CType(224, Byte), Integer))
Me.LayoutControlMain.Dock = System.Windows.Forms.DockStyle.Fill
Me.LayoutControlMain.Location = New System.Drawing.Point(0, 146)
Me.LayoutControlMain.Name = "LayoutControlMain"
Me.LayoutControlMain.Root = Me.LayoutControlGroupMain
Me.LayoutControlMain.Size = New System.Drawing.Size(658, 362)
Me.LayoutControlMain.TabIndex = 2
Me.LayoutControlMain.Text = "LayoutControl1"
'
'LayoutControlGroupMain
'
Me.LayoutControlGroupMain.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.[True]
Me.LayoutControlGroupMain.GroupBordersVisible = False
Me.LayoutControlGroupMain.Name = "LayoutControlGroupMain"
Me.LayoutControlGroupMain.Size = New System.Drawing.Size(658, 362)
Me.LayoutControlGroupMain.TextVisible = False
'
'ToolboxControl1
'
Me.ToolboxControl1.Caption = "Form Controls"
Me.ToolboxControl1.Dock = System.Windows.Forms.DockStyle.Right
Me.ToolboxControl1.Groups.Add(Me.ToolboxGroup1)
Me.ToolboxControl1.Location = New System.Drawing.Point(658, 146)
Me.ToolboxControl1.Name = "ToolboxControl1"
Me.ToolboxControl1.OptionsView.ShowMenuButton = False
Me.ToolboxControl1.OptionsView.ShowToolboxCaption = True
Me.ToolboxControl1.Size = New System.Drawing.Size(212, 362)
Me.ToolboxControl1.TabIndex = 4
Me.ToolboxControl1.Text = "Form Controls"
'
'ToolboxGroup1
'
Me.ToolboxGroup1.BeginGroupCaption = ""
Me.ToolboxGroup1.Caption = "ToolboxGroup1"
Me.ToolboxGroup1.Items.Add(Me.ToolboxItemTextbox)
Me.ToolboxGroup1.Items.Add(Me.ToolboxItemMemo)
Me.ToolboxGroup1.Items.Add(Me.ToolboxItem1)
Me.ToolboxGroup1.Name = "ToolboxGroup1"
'
'ToolboxItemTextbox
'
Me.ToolboxItemTextbox.BeginGroupCaption = Nothing
Me.ToolboxItemTextbox.Caption = "Textbox"
Me.ToolboxItemTextbox.Name = "ToolboxItemTextbox"
'
'ToolboxItemMemo
'
Me.ToolboxItemMemo.BeginGroupCaption = Nothing
Me.ToolboxItemMemo.Caption = "Multiline Textbox"
Me.ToolboxItemMemo.Name = "ToolboxItemMemo"
'
'RibbonPageGroup1
'
Me.RibbonPageGroup1.Name = "RibbonPageGroup1"
Me.RibbonPageGroup1.Text = "RibbonPageGroup1"
'
'ToolboxItem1
'
Me.ToolboxItem1.BeginGroupCaption = Nothing
Me.ToolboxItem1.Caption = "ToolboxItem1"
Me.ToolboxItem1.Name = "ToolboxItem1"
'
'frmFormDesigner
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(870, 529)
Me.Controls.Add(Me.LayoutControlMain)
Me.Controls.Add(Me.ToolboxControl1)
Me.Controls.Add(Me.RibbonStatusBar)
Me.Controls.Add(Me.RibbonControl)
Me.Name = "frmFormDesigner"
Me.Ribbon = Me.RibbonControl
Me.StatusBar = Me.RibbonStatusBar
Me.Text = "frmFormDesigner"
CType(Me.RibbonControl, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.LayoutControlMain, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.LayoutControlGroupMain, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents RibbonControl As DevExpress.XtraBars.Ribbon.RibbonControl
Friend WithEvents RibbonPage1 As DevExpress.XtraBars.Ribbon.RibbonPage
Friend WithEvents RibbonStatusBar As DevExpress.XtraBars.Ribbon.RibbonStatusBar
Friend WithEvents LayoutControlMain As DevExpress.XtraLayout.LayoutControl
Friend WithEvents LayoutControlGroupMain As DevExpress.XtraLayout.LayoutControlGroup
Friend WithEvents ToolboxControl1 As DevExpress.XtraToolbox.ToolboxControl
Friend WithEvents RibbonPageGroup1 As DevExpress.XtraBars.Ribbon.RibbonPageGroup
Friend WithEvents ToolboxGroup1 As DevExpress.XtraToolbox.ToolboxGroup
Friend WithEvents ToolboxItemTextbox As DevExpress.XtraToolbox.ToolboxItem
Friend WithEvents ToolboxItemMemo As DevExpress.XtraToolbox.ToolboxItem
Friend WithEvents ToolboxItem1 As DevExpress.XtraToolbox.ToolboxItem
End Class

View File

@ -1,68 +0,0 @@
Imports DevExpress.XtraEditors
Imports DevExpress.XtraLayout
Public Class frmFormDesigner
Private Const CONTROL_TEXTEDIT = "TextBox"
Private Const CONTROL_MEMOEDIT = "Memoedit"
Private Const CONTROL_COMBOEDIT = "Combobox"
Private Const CONTROL_CHECKEDIT = "Checkbox"
Private Const CONTROL_RADIOEDIT = "Radiobutton"
Private Const CONTROL_DATEEDIT = "Datepicker"
Private Sub frmFormDesigner_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim oFormId As Int64 = 104
My.Channel.CreateDatabaseRequest("Load Controls", True)
Dim oSQL As String = $"SELECT * FROM VWICM_FORMCONTROL WHERE FORMID = {oFormId}"
Dim oResult = My.Channel.ReturnDatatable(oSQL)
Dim oTable = oResult.Table
If Not oResult.OK Then
ShowErrorMessage(New ApplicationException(oResult.ErrorMessage))
End If
My.Channel.CloseDatabaseRequest()
LoadControls(oTable)
End Sub
Private Sub LoadControls(Datatable As DataTable)
For Each oRow As DataRow In Datatable.Rows
Dim oEditor As BaseEdit = Nothing
Dim oCaption As String = oRow.Item("COLNAME")
Dim oControlType As String = oRow.Item("CTRLTYPE")
Dim oControlId As String = oRow.Item("RECORD_ID").ToString
Select Case oControlType
Case CONTROL_TEXTEDIT
Dim oTextEdit As New TextEdit() With {.Name = oControlId}
oEditor = oTextEdit
Case CONTROL_MEMOEDIT
Dim oMemoEdit As New MemoEdit() With {.Name = oControlId}
oEditor = oMemoEdit
Case CONTROL_DATEEDIT
Dim oDateEdit As New DateEdit() With {.Name = oControlId}
oEditor = oDateEdit
Case CONTROL_CHECKEDIT
Dim oCheckEdit As New CheckEdit() With {.Name = oControlId}
oEditor = oCheckEdit
Case CONTROL_COMBOEDIT
Dim oComboEdit As New ComboBoxEdit() With {.Name = oControlId}
oEditor = oComboEdit
Case Else
End Select
If oEditor Is Nothing Then
Continue For
End If
LayoutControlGroupMain.AddItem(oCaption, oEditor)
Next
LayoutControlGroupMain.AddItem(New EmptySpaceItem())
End Sub
End Class

View File

@ -6,5 +6,5 @@
cause the file to be unrecognizable by the program. cause the file to be unrecognizable by the program.
--> -->
<GenericObjectDataSource DisplayName="DocumentResult" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource"> <GenericObjectDataSource DisplayName="DocumentResult" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
<TypeInfo>DigitalData.Modules.EDMIFileOps.EDMIServiceReference.DocumentResult, Connected Services.EDMIServiceReference.Reference.vb.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo> <TypeInfo>DigitalData.Modules.EDMIAPI.EDMIServiceReference.DocumentResult</TypeInfo>
</GenericObjectDataSource> </GenericObjectDataSource>

View File

@ -6,5 +6,5 @@
cause the file to be unrecognizable by the program. cause the file to be unrecognizable by the program.
--> -->
<GenericObjectDataSource DisplayName="IndexResult" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource"> <GenericObjectDataSource DisplayName="IndexResult" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
<TypeInfo>DigitalData.Modules.EDMIFileOps.EDMIServiceReference.IndexResult, Connected Services.EDMIServiceReference.Reference.vb.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo> <TypeInfo>DigitalData.Modules.EDMIAPI.EDMIServiceReference.IndexResult</TypeInfo>
</GenericObjectDataSource> </GenericObjectDataSource>

View File

@ -6,5 +6,5 @@
cause the file to be unrecognizable by the program. cause the file to be unrecognizable by the program.
--> -->
<GenericObjectDataSource DisplayName="NonQueryResult" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource"> <GenericObjectDataSource DisplayName="NonQueryResult" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
<TypeInfo>DigitalData.Modules.EDMIFileOps.EDMIServiceReference.NonQueryResult, Connected Services.EDMIServiceReference.Reference.vb.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo> <TypeInfo>DigitalData.Modules.EDMIAPI.EDMIServiceReference.NonQueryResult</TypeInfo>
</GenericObjectDataSource> </GenericObjectDataSource>

View File

@ -6,5 +6,5 @@
cause the file to be unrecognizable by the program. cause the file to be unrecognizable by the program.
--> -->
<GenericObjectDataSource DisplayName="ScalarResult" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource"> <GenericObjectDataSource DisplayName="ScalarResult" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
<TypeInfo>DigitalData.Modules.EDMIFileOps.EDMIServiceReference.ScalarResult, Connected Services.EDMIServiceReference.Reference.vb.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo> <TypeInfo>DigitalData.Modules.EDMIAPI.EDMIServiceReference.ScalarResult</TypeInfo>
</GenericObjectDataSource> </GenericObjectDataSource>

View File

@ -6,5 +6,5 @@
cause the file to be unrecognizable by the program. cause the file to be unrecognizable by the program.
--> -->
<GenericObjectDataSource DisplayName="TableResult" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource"> <GenericObjectDataSource DisplayName="TableResult" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
<TypeInfo>DigitalData.Modules.EDMIFileOps.EDMIServiceReference.TableResult, Connected Services.EDMIServiceReference.Reference.vb.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo> <TypeInfo>DigitalData.Modules.EDMIAPI.EDMIServiceReference.TableResult</TypeInfo>
</GenericObjectDataSource> </GenericObjectDataSource>

View File

@ -1,5 +1,5 @@
Imports DigitalData.Modules.Logging Imports DigitalData.Modules.Logging
Imports DigitalData.Modules.EDMIFileOps.EDMIServiceReference Imports DigitalData.Modules.EDMIAPI.EDMIServiceReference
Imports System.ServiceModel Imports System.ServiceModel
Imports System.IO Imports System.IO

View File

@ -6,8 +6,8 @@
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{5B1171DC-FFFE-4813-A20D-786AAE47B320}</ProjectGuid> <ProjectGuid>{5B1171DC-FFFE-4813-A20D-786AAE47B320}</ProjectGuid>
<OutputType>Library</OutputType> <OutputType>Library</OutputType>
<RootNamespace>DigitalData.Modules.EDMIFileOps</RootNamespace> <RootNamespace>DigitalData.Modules.EDMIAPI</RootNamespace>
<AssemblyName>DigitalData.Modules.EDMIFileOps</AssemblyName> <AssemblyName>DigitalData.Modules.EDMIAPI</AssemblyName>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<MyType>Windows</MyType> <MyType>Windows</MyType>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
@ -18,7 +18,7 @@
<DefineDebug>true</DefineDebug> <DefineDebug>true</DefineDebug>
<DefineTrace>true</DefineTrace> <DefineTrace>true</DefineTrace>
<OutputPath>bin\Debug\</OutputPath> <OutputPath>bin\Debug\</OutputPath>
<DocumentationFile>DigitalData.Modules.EDMIFileOps.xml</DocumentationFile> <DocumentationFile>DigitalData.Modules.EDMIAPI.xml</DocumentationFile>
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn> <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
@ -27,7 +27,7 @@
<DefineTrace>true</DefineTrace> <DefineTrace>true</DefineTrace>
<Optimize>true</Optimize> <Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath> <OutputPath>bin\Release\</OutputPath>
<DocumentationFile>DigitalData.Modules.EDMIFileOps.xml</DocumentationFile> <DocumentationFile>DigitalData.Modules.EDMIAPI.xml</DocumentationFile>
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn> <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
@ -106,19 +106,19 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="app.config" /> <None Include="app.config" />
<None Include="Connected Services\EDMIServiceReference\DigitalData.Modules.EDMIFileOps.EDMIServiceReference.DocumentResult.datasource"> <None Include="Connected Services\EDMIServiceReference\DigitalData.Modules.EDMIAPI.EDMIServiceReference.DocumentResult.datasource">
<DependentUpon>Reference.svcmap</DependentUpon> <DependentUpon>Reference.svcmap</DependentUpon>
</None> </None>
<None Include="Connected Services\EDMIServiceReference\DigitalData.Modules.EDMIFileOps.EDMIServiceReference.IndexResult.datasource"> <None Include="Connected Services\EDMIServiceReference\DigitalData.Modules.EDMIAPI.EDMIServiceReference.IndexResult.datasource">
<DependentUpon>Reference.svcmap</DependentUpon> <DependentUpon>Reference.svcmap</DependentUpon>
</None> </None>
<None Include="Connected Services\EDMIServiceReference\DigitalData.Modules.EDMIFileOps.EDMIServiceReference.NonQueryResult.datasource"> <None Include="Connected Services\EDMIServiceReference\DigitalData.Modules.EDMIAPI.EDMIServiceReference.NonQueryResult.datasource">
<DependentUpon>Reference.svcmap</DependentUpon> <DependentUpon>Reference.svcmap</DependentUpon>
</None> </None>
<None Include="Connected Services\EDMIServiceReference\DigitalData.Modules.EDMIFileOps.EDMIServiceReference.ScalarResult.datasource"> <None Include="Connected Services\EDMIServiceReference\DigitalData.Modules.EDMIAPI.EDMIServiceReference.ScalarResult.datasource">
<DependentUpon>Reference.svcmap</DependentUpon> <DependentUpon>Reference.svcmap</DependentUpon>
</None> </None>
<None Include="Connected Services\EDMIServiceReference\DigitalData.Modules.EDMIFileOps.EDMIServiceReference.TableResult.datasource"> <None Include="Connected Services\EDMIServiceReference\DigitalData.Modules.EDMIAPI.EDMIServiceReference.TableResult.datasource">
<DependentUpon>Reference.svcmap</DependentUpon> <DependentUpon>Reference.svcmap</DependentUpon>
</None> </None>
<None Include="Connected Services\EDMIServiceReference\DigitalData.Modules.Filesystem.xsd"> <None Include="Connected Services\EDMIServiceReference\DigitalData.Modules.Filesystem.xsd">

View File

@ -39,7 +39,7 @@ Namespace My.Resources
Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
Get Get
If Object.ReferenceEquals(resourceMan, Nothing) Then If Object.ReferenceEquals(resourceMan, Nothing) Then
Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("DigitalData.Modules.EDMIFileOps.Resources", GetType(Resources).Assembly) Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("DigitalData.Modules.EDMIAPI.Resources", GetType(Resources).Assembly)
resourceMan = temp resourceMan = temp
End If End If
Return resourceMan Return resourceMan

View File

@ -64,9 +64,9 @@ Namespace My
Friend Module MySettingsProperty Friend Module MySettingsProperty
<Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _ <Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _
Friend ReadOnly Property Settings() As Global.DigitalData.Modules.EDMIFileOps.My.MySettings Friend ReadOnly Property Settings() As Global.DigitalData.Modules.EDMIAPI.My.MySettings
Get Get
Return Global.DigitalData.Modules.EDMIFileOps.My.MySettings.Default Return Global.DigitalData.Modules.EDMIAPI.My.MySettings.Default
End Get End Get
End Property End Property
End Module End Module

View File

@ -12,14 +12,20 @@ Namespace My
Partial Friend Class MyApplication Partial Friend Class MyApplication
Private _Logger As Logger Private _Logger As Logger
Private _BaseUserConfigPath As String = Windows.Forms.Application.UserAppDataPath
Private _BaseMachineConfigPath As String = Windows.Forms.Application.CommonAppDataPath
Public Sub App_Startup() Handles Me.Startup Public Sub App_Startup() Handles Me.Startup
Dim oLogConfig As New LogConfig(PathType.AppData) Dim oLogConfig As New LogConfig(PathType.AppData)
' TODO: WHERE SHOULD CONFIG BE SAVED? LOCAL/ROAMING ' System Config files like Service Url will be saved in %LocalAppdata% so they will remain on the machine
Dim oUIConfigPAth = IO.Path.Combine(Windows.Forms.Application.UserAppDataPath, ClassConstants.FOLDER_NAME_LAYOUT) Dim oSystemConfigManager As New ConfigManager(Of ClassConfig)(oLogConfig,
Windows.Forms.Application.UserAppDataPath,
Windows.Forms.Application.CommonAppDataPath)
Dim oSystemConfigManager As New ConfigManager(Of ClassConfig)(oLogConfig, Windows.Forms.Application.UserAppDataPath, Windows.Forms.Application.CommonAppDataPath) ' Layout files will be saved in %Appdata% (Roaming) so they will be syncronized with the user profile
Dim oUIConfigManager As New ConfigManager(Of ClassUIConfig)(oLogConfig, oUIConfigPAth, oUIConfigPAth) Dim oUIConfigPath = IO.Path.Combine(Windows.Forms.Application.UserAppDataPath, ClassConstants.FOLDER_NAME_LAYOUT)
Dim oUIConfigManager As New ConfigManager(Of ClassUIConfig)(oLogConfig, oUIConfigPath, oUIConfigPath)
LogConfig = oLogConfig LogConfig = oLogConfig
SystemConfigManager = oSystemConfigManager SystemConfigManager = oSystemConfigManager

View File

@ -0,0 +1,22 @@
Imports DigitalData.Modules.Logging
Namespace Base
''' <summary>
''' Base Class which supplies a Logger/LogConfig
''' </summary>
Public Class BaseClass
Protected LogConfig As LogConfig
Protected Logger As Logger
Public Sub New(LogConfig As LogConfig)
Dim oClassName = Me.GetType().Name
Me.LogConfig = LogConfig
Me.Logger = LogConfig.GetLogger(oClassName)
End Sub
End Class
End Namespace

View File

@ -0,0 +1,60 @@
Imports DevExpress.XtraBars.Ribbon
Imports DigitalData.Modules.Logging
Namespace Base
''' <summary>
''' This BaseClass is used to provide common functionality like the Logger or ErrorHandler to all Forms
''' To use it, create a form and change the `Inherits` statement in FormName.Designer.vb to this form, eg.:
'''
''' Partial Class frmExample
''' Inherits BaseForm
'''
''' ...
''' End Class
''' </summary>
Public Class BaseForm
Inherits Form
Private ReadOnly _Logger As Logger
Private ReadOnly _ErrorHandler As ClassErrorHandler
Protected ReadOnly Property Logger As Logger
Get
Return _Logger
End Get
End Property
Public Sub New()
' Get the full name of the inheriting form
' so the log messages have the right classname
Dim oClassName = [GetType]().FullName
' My.LogConfig is undefined in the designer
_Logger = My.LogConfig?.GetLogger(oClassName)
_ErrorHandler = New ClassErrorHandler(_Logger)
' When you add something, be careful if it
' depends on a global var like My.LogConfig
' you might need to check for its existence with ?
End Sub
Public Sub ShowErrorMessage(Exception As Exception)
_ErrorHandler.ShowErrorMessage(Exception)
End Sub
Private Sub InitializeComponent()
Me.SuspendLayout()
'
'BaseForm
'
Me.ClientSize = New System.Drawing.Size(284, 261)
Me.Name = "BaseForm"
Me.ResumeLayout(False)
End Sub
Private Sub BaseForm_Load(sender As Object, e As EventArgs) Handles MyBase.Load
End Sub
End Class
End Namespace

View File

@ -0,0 +1,94 @@
Imports DevExpress.XtraBars.Docking
Imports DevExpress.XtraBars.Ribbon
Imports DigitalData.Modules.Logging
Namespace Base
''' <summary>
''' This BaseClass is used to provide common functionality like the Logger or ErrorHandler to all Forms
''' To use it, create a form and change the `Inherits` statement in FormName.Designer.vb to this form, eg.:
'''
''' Partial Class frmExample
''' Inherits BaseRibbonForm
'''
''' ...
''' End Class
'''
''' Only BaseRibbonForms can have panels attached to it!
''' </summary>
Public Class BaseRibbonForm
Inherits RibbonForm
Private ReadOnly _Logger As Logger
Private ReadOnly _ErrorHandler As ClassErrorHandler
Protected ReadOnly Property Logger As Logger
Get
Return _Logger
End Get
End Property
''' <summary>
''' Sets or gets the ribbon Page that will be shown when the window is visible
''' </summary>
''' <returns></returns>
Public Property DefaultRibbonPage As RibbonPage
Protected Overrides Sub OnLoad(e As EventArgs)
MyBase.OnLoad(e)
If DefaultRibbonPage IsNot Nothing Then
Ribbon.SelectPage(DefaultRibbonPage)
End If
End Sub
Protected Overrides Sub OnVisibleChanged(e As EventArgs)
MyBase.OnVisibleChanged(e)
If Visible And DefaultRibbonPage IsNot Nothing Then
Ribbon.SelectPage(DefaultRibbonPage)
End If
End Sub
Protected Overrides Sub OnActivated(e As EventArgs)
MyBase.OnVisibleChanged(e)
If Visible And DefaultRibbonPage IsNot Nothing Then
Ribbon.SelectPage(DefaultRibbonPage)
End If
End Sub
Public Sub New()
' Get the full name of the inheriting form
' so the log messages have the right classname
Dim oClassName = [GetType]().FullName
' My.LogConfig is undefined in the designer
_Logger = My.LogConfig?.GetLogger(oClassName)
_ErrorHandler = New ClassErrorHandler(_Logger)
' When you add something, be careful if it
' depends on a global var like My.LogConfig
' you might need to check for its existence with ?
End Sub
Public Sub ShowErrorMessage(Exception As Exception)
_ErrorHandler.ShowErrorMessage(Exception)
End Sub
Public Sub ShowErrorMessage(ErrorMessage As String)
_ErrorHandler.ShowErrorMessage(New Exception(ErrorMessage))
End Sub
''' <summary>
''' Returns a list of panels that will be show when the form is opened.
''' This can be overridden by all inheriting forms to extend the list of panels
''' Panels will be created by PanelManager.
''' </summary>
''' <seealso cref="ClassPanelManager"/>
''' <returns>A list of PanelInformation</returns>
Public Overridable Function GetInitialPanels() As List(Of PanelInfo)
Return New List(Of PanelInfo)
End Function
End Class
End Namespace

View File

@ -1,6 +1,5 @@
Imports System.ComponentModel Imports System.Xml.Serialization
Imports System.Runtime.CompilerServices Imports DigitalData.Modules.Config.ConfigAttributes
Imports System.Xml.Serialization
''' <summary> ''' <summary>
''' --- User Config for EDMI --- ''' --- User Config for EDMI ---
@ -37,7 +36,9 @@ Public Class ClassConfig
' === Simple/Actual Config Properties === ' === Simple/Actual Config Properties ===
' === Service Configuration === ' === Service Configuration ===
<ConnectionString>
Public Property ServiceIP As String = String.Empty Public Property ServiceIP As String = String.Empty
<ConnectionString>
Public Property ServicePort As Integer = -1 Public Property ServicePort As Integer = -1
Public Property HeartbeatInterval As Integer = 5000 Public Property HeartbeatInterval As Integer = 5000

View File

@ -6,12 +6,17 @@
Public Const SERVICE_MAX_CONNECTIONS = 10000 Public Const SERVICE_MAX_CONNECTIONS = 10000
Public Const SERVICE_OPEN_TIMEOUT = 3 Public Const SERVICE_OPEN_TIMEOUT = 3
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 FOLDER_NAME_LAYOUT = "Layout" Public Const FOLDER_NAME_LAYOUT = "Layout"
Public Const ATTRIBUTE_ID_COLUMN = "RECORD_ID" Public Const ATTRIBUTE_ID_COLUMN = "RECORD_ID"
Public Const DB_USER_ATTRIBUTE_ID = 1 Public Const DB_USER_ATTRIBUTE_ID = 1
Public Const DB_USER_ATTRIBUTE_SYSKEY = "001" Public Const DB_USER_ATTRIBUTE_SYSKEY = "001"

View File

@ -0,0 +1,12 @@
Imports DigitalData.GUIs.ClientSuite.Base
Imports DigitalData.Modules.Logging
Public Class ClassControlManager
Inherits BaseClass
Public Sub New(LogConfig As LogConfig)
MyBase.New(LogConfig)
End Sub
End Class

View File

@ -61,13 +61,6 @@ Public Class ClassLayout
End Function End Function
Public Shared Function GetLayoutDirectory() As String Public Shared Function GetLayoutDirectory() As String
Return Path.Combine(GetAppDataFolder(), ClassConstants.FOLDER_NAME_LAYOUT) Return Path.Combine(Application.UserAppDataPath, ClassConstants.FOLDER_NAME_LAYOUT)
End Function
Private Shared Function GetAppDataFolder() As String
Dim oLocalAppData = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)
Dim oProduct = My.Application.Info.ProductName
Dim oCompany = My.Application.Info.CompanyName
Return Path.Combine(oLocalAppData, oCompany, oProduct)
End Function End Function
End Class End Class

View File

@ -3,6 +3,7 @@ Imports DevExpress.XtraBars.Docking2010
Imports DevExpress.XtraBars.Docking2010.Views Imports DevExpress.XtraBars.Docking2010.Views
Imports DevExpress.XtraBars.Docking2010.Views.Tabbed Imports DevExpress.XtraBars.Docking2010.Views.Tabbed
Imports DevExpress.XtraGrid Imports DevExpress.XtraGrid
Imports DigitalData.GUIs.ClientSuite.Base
Imports DigitalData.Modules.Logging Imports DigitalData.Modules.Logging
Public Class ClassPanelManager Public Class ClassPanelManager

View File

@ -1,11 +1,11 @@
Imports System.ServiceModel Imports System.ServiceModel
Imports System.ServiceModel.Channels Imports System.ServiceModel.Channels
Imports DigitalData.Modules.Logging Imports DigitalData.Modules.Logging
Imports DigitalData.Modules.EDMIFileOps.EDMIServiceReference Imports DigitalData.Modules.EDMIAPI.EDMIServiceReference
Imports DigitalData.GUIs.ClientSuite.Base
Public Class ClassService Public Class ClassService
Private ReadOnly _LogConfig As LogConfig Inherits BaseClass
Private ReadOnly _Logger As Logger
Public Enum ConnectionTestResult Public Enum ConnectionTestResult
Successful Successful
@ -15,8 +15,7 @@ Public Class ClassService
End Enum End Enum
Public Sub New(LogConfig As LogConfig) Public Sub New(LogConfig As LogConfig)
_LogConfig = LogConfig MyBase.New(LogConfig)
_Logger = _LogConfig.GetLogger()
End Sub End Sub
Public Function TestConnection() As ConnectionTestResult Public Function TestConnection() As ConnectionTestResult
@ -33,10 +32,10 @@ Public Class ClassService
Return ConnectionTestResult.Successful Return ConnectionTestResult.Successful
Catch ex As EndpointNotFoundException Catch ex As EndpointNotFoundException
_Logger.Error(ex) Logger.Error(ex)
Return ConnectionTestResult.NotFound Return ConnectionTestResult.NotFound
Catch ex As Exception Catch ex As Exception
_Logger.Error(ex) Logger.Error(ex)
Return ConnectionTestResult.Unknown Return ConnectionTestResult.Unknown
End Try End Try
End Function End Function
@ -56,13 +55,13 @@ Public Class ClassService
Return ConnectionTestResult.Successful Return ConnectionTestResult.Successful
Catch ex As EndpointNotFoundException Catch ex As EndpointNotFoundException
_Logger.Error(ex) Logger.Error(ex)
Return ConnectionTestResult.NotFound Return ConnectionTestResult.NotFound
Catch ex As UriFormatException Catch ex As UriFormatException
_Logger.Error(ex) Logger.Error(ex)
Return ConnectionTestResult.EmptyURI Return ConnectionTestResult.EmptyURI
Catch ex As Exception Catch ex As Exception
_Logger.Error(ex) Logger.Error(ex)
Return ConnectionTestResult.Unknown Return ConnectionTestResult.Unknown
End Try End Try
End Function) End Function)

View File

@ -1,10 +1,13 @@
Imports System.ServiceModel Imports System.ServiceModel
Imports System.Threading Imports System.Threading
Imports System.Timers Imports System.Timers
Imports DigitalData.Modules.EDMIFileOps.EDMIServiceReference Imports DigitalData.GUIs.ClientSuite.Base
Imports DigitalData.Modules.EDMIAPI.EDMIServiceReference
Imports DigitalData.Modules.Logging Imports DigitalData.Modules.Logging
Public Class ClassTimer Public Class ClassTimer
Inherits BaseClass
Private _Callback As TimerCallback Private _Callback As TimerCallback
Private _LogConfig As LogConfig Private _LogConfig As LogConfig
Private _Logger As Logger Private _Logger As Logger
@ -15,10 +18,9 @@ Public Class ClassTimer
Public Delegate Sub OnlineChangedEventHandler(sender As Object, Online As Boolean) Public Delegate Sub OnlineChangedEventHandler(sender As Object, Online As Boolean)
Public Sub New(LogConfig As LogConfig, SynchronizingObject As frmMain, HeartbeatInterval As Integer) Public Sub New(LogConfig As LogConfig, SynchronizingObject As frmMain, HeartbeatInterval As Integer)
Try MyBase.New(LogConfig)
_LogConfig = LogConfig
_Logger = LogConfig.GetLogger()
Try
_Channel = My.ChannelFactory.CreateChannel() _Channel = My.ChannelFactory.CreateChannel()
_Channel.Open() _Channel.Open()
@ -29,13 +31,13 @@ Public Class ClassTimer
AddHandler _Timer.Elapsed, AddressOf Callback AddHandler _Timer.Elapsed, AddressOf Callback
Catch ex As Exception Catch ex As Exception
_Logger.Error(ex) Logger.Error(ex)
End Try End Try
End Sub End Sub
Public Async Sub Callback(sender As Object, e As ElapsedEventArgs) Public Async Sub Callback(sender As Object, e As ElapsedEventArgs)
Try Try
_Logger.Debug("Checking if Service is up...") Logger.Debug("Checking if Service is up...")
If _Channel.State = ServiceModel.CommunicationState.Faulted Then If _Channel.State = ServiceModel.CommunicationState.Faulted Then
_Channel = My.ChannelFactory.CreateChannel() _Channel = My.ChannelFactory.CreateChannel()
@ -44,12 +46,11 @@ Public Class ClassTimer
' Connect to service and send hearbeat request ' Connect to service and send hearbeat request
Dim oResult = Await _Channel.HeartbeatAsync() Dim oResult = Await _Channel.HeartbeatAsync()
Logger.Debug("Service is online")
_Logger.Debug("Service is online")
SetOnlineState(True) SetOnlineState(True)
Catch ex As Exception Catch ex As Exception
_Logger.Debug("Service is offline!") Logger.Debug("Service is offline!")
SetOnlineState(False) SetOnlineState(False)
Finally Finally

View File

@ -90,6 +90,9 @@
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\Modules.Logging\bin\Debug\NLog.dll</HintPath> <HintPath>..\Modules.Logging\bin\Debug\NLog.dll</HintPath>
</Reference> </Reference>
<Reference Include="ScintillaNET, Version=3.6.3.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\jacobslusser.ScintillaNET.3.6.3\lib\net40\ScintillaNET.dll</HintPath>
</Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.ComponentModel.DataAnnotations" /> <Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Configuration" /> <Reference Include="System.Configuration" />
@ -127,9 +130,14 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="ApplicationEvents.vb" /> <Compile Include="ApplicationEvents.vb" />
<Compile Include="ClassCommonCommands.vb" /> <Compile Include="Base\BaseClass.vb" />
<Compile Include="FormDesigner\Controls\Data.vb" />
<Compile Include="ClassControlManager.vb" />
<Compile Include="Common\ClassCommonCommands.vb" />
<Compile Include="Common\ClassCommonViews.vb" />
<Compile Include="ClassConfig.vb" /> <Compile Include="ClassConfig.vb" />
<Compile Include="ClassConstants.vb" /> <Compile Include="ClassConstants.vb" />
<Compile Include="FormDesigner\Controls\Loader.vb" />
<Compile Include="ClassControlPatcher.vb" /> <Compile Include="ClassControlPatcher.vb" />
<Compile Include="ClassDragDrop.vb" /> <Compile Include="ClassDragDrop.vb" />
<Compile Include="ClassErrorHandler.vb" /> <Compile Include="ClassErrorHandler.vb" />
@ -139,12 +147,32 @@
<Compile Include="ClassTimer.vb" /> <Compile Include="ClassTimer.vb" />
<Compile Include="ClassUIConfig.vb" /> <Compile Include="ClassUIConfig.vb" />
<Compile Include="ClassUtils.vb" /> <Compile Include="ClassUtils.vb" />
<Compile Include="Common\ClassCommon.vb" />
<Compile Include="ControlDefaults\GridControlDefaults.vb" /> <Compile Include="ControlDefaults\GridControlDefaults.vb" />
<Compile Include="ControlDefaults\TreeListDefaults.vb" /> <Compile Include="ControlDefaults\TreeListDefaults.vb" />
<Compile Include="FormEntityDesigner\frmFormDesigner.Designer.vb"> <Compile Include="FormDesigner\Controls\Editors\DatasourceType.vb" />
<Compile Include="FormDesigner\Controls\Metadata.vb" />
<Compile Include="FormDesigner\Controls\Editors\DatasourceEditor.vb" />
<Compile Include="FormDesigner\Controls\Editors\frmDatasourceEditor.Designer.vb">
<DependentUpon>frmDatasourceEditor.vb</DependentUpon>
</Compile>
<Compile Include="FormDesigner\Controls\Editors\frmDatasourceEditor.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="FormDesigner\Controls\Properties\DatepickerProperties.vb" />
<Compile Include="FormDesigner\Controls\Properties\MemoeditProperties.vb" />
<Compile Include="FormDesigner\Controls\Properties\CheckboxProperties.vb" />
<Compile Include="FormDesigner\Controls\Properties\TextboxProperties.vb" />
<Compile Include="FormDesigner\frmFormDesigner.Designer.vb">
<DependentUpon>frmFormDesigner.vb</DependentUpon> <DependentUpon>frmFormDesigner.vb</DependentUpon>
</Compile> </Compile>
<Compile Include="FormEntityDesigner\frmFormDesigner.vb"> <Compile Include="FormDesigner\frmFormDesigner.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="FormWorkflow\frmWorkflowStep.Designer.vb">
<DependentUpon>frmWorkflowStep.vb</DependentUpon>
</Compile>
<Compile Include="FormWorkflow\frmWorkflowStep.vb">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
<Compile Include="frmSearch.Designer.vb"> <Compile Include="frmSearch.Designer.vb">
@ -178,38 +206,20 @@
<Compile Include="_TEST\frmDocTest.vb"> <Compile Include="_TEST\frmDocTest.vb">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
<Compile Include="FormEntityDesigner\ClassControlBuilder.vb" /> <Compile Include="FormDesigner\Controls\Localization.vb" />
<Compile Include="FormEntityDesigner\ClassControlLocalization.vb" /> <Compile Include="FormDesigner\Controls\Properties\BaseProperties.vb" />
<Compile Include="FormEntityDesigner\ClassControlUtils.vb" /> <Compile Include="FormDesigner\Controls\Properties\ComboboxProperties.vb" />
<Compile Include="FormEntityDesigner\ControlProperties\BaseClasses\ClassBaseProperties.vb" /> <Compile Include="FormDesigner\Controls\Editors\StaticListEditor.vb" />
<Compile Include="FormEntityDesigner\ControlProperties\BaseClasses\ClassInputProperties.vb" /> <Compile Include="FormDesigner\Controls\Editors\frmStaticListEditor.designer.vb">
<Compile Include="FormEntityDesigner\ControlProperties\BaseClasses\ClassMultiInputProperties.vb" />
<Compile Include="FormEntityDesigner\ControlProperties\Controls\ClassComboboxProperties.vb" />
<Compile Include="FormEntityDesigner\ControlProperties\Controls\ClassLabelProperties.vb" />
<Compile Include="FormEntityDesigner\ControlProperties\Controls\ClassTextboxProperties.vb" />
<Compile Include="FormEntityDesigner\ControlProperties\Editors\ClassStaticListEditor.vb" />
<Compile Include="FormEntityDesigner\ControlProperties\Editors\frmStaticListEditor.designer.vb">
<DependentUpon>frmStaticListEditor.vb</DependentUpon> <DependentUpon>frmStaticListEditor.vb</DependentUpon>
</Compile> </Compile>
<Compile Include="FormEntityDesigner\ControlProperties\Editors\frmStaticListEditor.vb"> <Compile Include="FormDesigner\Controls\Editors\frmStaticListEditor.vb">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
<Compile Include="FormEntityDesigner\ControlSnapPanel.Designer.vb"> <Compile Include="Base\BaseForm.vb">
<DependentUpon>ControlSnapPanel.vb</DependentUpon>
</Compile>
<Compile Include="FormEntityDesigner\ControlSnapPanel.vb">
<SubType>Component</SubType>
</Compile>
<Compile Include="FormEntityDesigner\frmEntityDesigner.Designer.vb">
<DependentUpon>frmEntityDesigner.vb</DependentUpon>
</Compile>
<Compile Include="FormEntityDesigner\frmEntityDesigner.vb">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
<Compile Include="FormDefaults\BaseForm.vb"> <Compile Include="Base\BaseRibbonForm.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="FormDefaults\BaseRibbonForm.vb">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
<Compile Include="_TEST\frmFileTest.Designer.vb"> <Compile Include="_TEST\frmFileTest.Designer.vb">
@ -308,9 +318,18 @@
</Compile> </Compile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<EmbeddedResource Include="FormEntityDesigner\frmFormDesigner.resx"> <EmbeddedResource Include="Base\BaseForm.resx">
<DependentUpon>BaseForm.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="FormDesigner\Controls\Editors\frmDatasourceEditor.resx">
<DependentUpon>frmDatasourceEditor.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="FormDesigner\frmFormDesigner.resx">
<DependentUpon>frmFormDesigner.vb</DependentUpon> <DependentUpon>frmFormDesigner.vb</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="FormWorkflow\frmWorkflowStep.resx">
<DependentUpon>frmWorkflowStep.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="frmSearch.resx"> <EmbeddedResource Include="frmSearch.resx">
<DependentUpon>frmSearch.vb</DependentUpon> <DependentUpon>frmSearch.vb</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
@ -323,15 +342,12 @@
<EmbeddedResource Include="_TEST\frmDocTest.resx"> <EmbeddedResource Include="_TEST\frmDocTest.resx">
<DependentUpon>frmDocTest.vb</DependentUpon> <DependentUpon>frmDocTest.vb</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="FormEntityDesigner\ControlProperties\Editors\frmStaticListEditor.en-US.resx"> <EmbeddedResource Include="FormDesigner\Controls\Editors\frmStaticListEditor.en-US.resx">
<DependentUpon>frmStaticListEditor.vb</DependentUpon> <DependentUpon>frmStaticListEditor.vb</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="FormEntityDesigner\ControlProperties\Editors\frmStaticListEditor.resx"> <EmbeddedResource Include="FormDesigner\Controls\Editors\frmStaticListEditor.resx">
<DependentUpon>frmStaticListEditor.vb</DependentUpon> <DependentUpon>frmStaticListEditor.vb</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="FormEntityDesigner\frmEntityDesigner.resx">
<DependentUpon>frmEntityDesigner.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="_TEST\frmFileTest.resx"> <EmbeddedResource Include="_TEST\frmFileTest.resx">
<DependentUpon>frmFileTest.vb</DependentUpon> <DependentUpon>frmFileTest.vb</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
@ -429,9 +445,9 @@
<None Include="Resources\folder_go.png" /> <None Include="Resources\folder_go.png" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Config\Config.vbproj"> <ProjectReference Include="..\Controls.LookupGrid\LookupControl.vbproj">
<Project>{44982F9B-6116-44E2-85D0-F39650B1EF99}</Project> <Project>{3dcd6d1a-c830-4241-b7e4-27430e7ea483}</Project>
<Name>Config</Name> <Name>LookupControl</Name>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\EDMI_FILE_OPs\EDMIAPI.vbproj"> <ProjectReference Include="..\EDMI_FILE_OPs\EDMIAPI.vbproj">
<Project>{5b1171dc-fffe-4813-a20d-786aae47b320}</Project> <Project>{5b1171dc-fffe-4813-a20d-786aae47b320}</Project>
@ -441,9 +457,9 @@
<Project>{991d0231-4623-496d-8bd0-9ca906029cbc}</Project> <Project>{991d0231-4623-496d-8bd0-9ca906029cbc}</Project>
<Name>Filesystem</Name> <Name>Filesystem</Name>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\LookupGrid\LookupControl.vbproj"> <ProjectReference Include="..\Modules.Config\Config.vbproj">
<Project>{3DCD6D1A-C830-4241-B7E4-27430E7EA483}</Project> <Project>{44982f9b-6116-44e2-85d0-f39650b1ef99}</Project>
<Name>LookupControl</Name> <Name>Config</Name>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\Modules.License\License.vbproj"> <ProjectReference Include="..\Modules.License\License.vbproj">
<Project>{5ebacbfa-f11a-4bbf-8d02-91461f2293ed}</Project> <Project>{5ebacbfa-f11a-4bbf-8d02-91461f2293ed}</Project>
@ -458,6 +474,18 @@
<Name>DDEDMService</Name> <Name>DDEDMService</Name>
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>
<ItemGroup>
<None Include="Resources\TextBox.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\DatePicker.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\ComboBox.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\CheckBox.png" />
</ItemGroup>
<ItemGroup /> <ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
</Project> </Project>

View File

@ -0,0 +1,17 @@
Imports DigitalData.Modules.Logging
Public Class ClassCommon
Private _LogConfig As LogConfig
Private _Logger As Logger
Public Commands As ClassCommonCommands
Public Views As ClassCommonViews
Public Sub New(LogConfig As LogConfig)
_LogConfig = LogConfig
_Logger = LogConfig.GetLogger()
Commands = New ClassCommonCommands(LogConfig)
Views = New ClassCommonViews(LogConfig)
End Sub
End Class

View File

@ -1,5 +1,5 @@
Imports DigitalData.Modules.Logging Imports DigitalData.Modules.Logging
Imports DigitalData.Modules.EDMIFileOps.EDMIServiceReference Imports DigitalData.Modules.EDMIAPI.EDMIServiceReference
Public Class ClassCommonCommands Public Class ClassCommonCommands
Private _LogConfig As LogConfig Private _LogConfig As LogConfig

View File

@ -0,0 +1,55 @@
Imports DigitalData.Modules.Logging
Public Class ClassCommonViews
Private _LogConfig As LogConfig
Private _Logger As Logger
Public Sub New(LogConfig As LogConfig)
_LogConfig = LogConfig
_Logger = LogConfig.GetLogger()
End Sub
Public Async Function VWICM_FORM_CONTROL(FormId As Int64) As Task(Of DataTable)
Try
My.Channel.CreateDatabaseRequest("Load Controls", True)
Dim oSQL As String = $"SELECT * FROM VWICM_FORMCONTROL WHERE FORMID = {FormId}"
Dim oResult = Await My.Channel.ReturnDatatableAsync(oSQL)
Dim oTable = oResult.Table
If Not oResult.OK Then
_Logger.Error(New ApplicationException(oResult.ErrorMessage))
Return Nothing
End If
My.Channel.CloseDatabaseRequest()
Return oResult.Table
Catch ex As Exception
_Logger.Error(ex)
Throw ex
End Try
End Function
Public Async Function VWICM_WF_REQUESTCONTROLDATA(FormId As Int64, RequestId As Int64) As Task(Of DataTable)
Try
My.Channel.CreateDatabaseRequest("Load Control Data", True)
Dim oSQL As String = $"SELECT * FROM VWICM_WF_REQUESTCONTROLDATA WHERE FORMID = {FormId} AND REQUESTID = {RequestId}"
Dim oResult = Await My.Channel.ReturnDatatableAsync(oSQL)
Dim oTable = oResult.Table
If Not oResult.OK Then
_Logger.Error(New ApplicationException(oResult.ErrorMessage))
Return Nothing
End If
My.Channel.CloseDatabaseRequest()
Return oResult.Table
Catch ex As Exception
_Logger.Error(ex)
Throw ex
End Try
End Function
End Class

View File

@ -0,0 +1,41 @@
Imports DevExpress.XtraEditors
Imports DigitalData.Controls.LookupGrid
Imports DigitalData.GUIs.ClientSuite.Base
Imports DigitalData.Modules.Logging
Namespace Controls
Public Class ControlData
Inherits BaseClass
Public Sub New(LogConfig As LogConfig)
MyBase.New(LogConfig)
End Sub
Public Sub LoadControlData(ByRef Controls As List(Of BaseEdit), Data As DataTable)
Dim oCounter = 0
' TODO: Do we need databinding and does it work with lookup control
For Each oControl As BaseEdit In Controls
Dim oBindingSource As New BindingSource(Data, Nothing)
Select Case oControl.GetType
Case GetType(TextEdit)
oControl.DataBindings.Add("Text", oBindingSource, "CTRLVALUE", True, DataSourceUpdateMode.OnPropertyChanged)
Case GetType(MemoEdit)
oControl.DataBindings.Add("Text", oBindingSource, "CTRLVALUE", True, DataSourceUpdateMode.OnPropertyChanged)
Case GetType(DateEdit)
oControl.DataBindings.Add("Text", oBindingSource, "CTRLVALUE", True, DataSourceUpdateMode.OnPropertyChanged)
Case GetType(LookupControl2)
oControl.DataBindings.Add("Text", oBindingSource, "CTRLVALUE", True, DataSourceUpdateMode.OnPropertyChanged)
Case Else
End Select
oBindingSource.Position = oCounter
oCounter += 1
Next
End Sub
End Class
End Namespace

View File

@ -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

View File

@ -0,0 +1,23 @@
Imports System.ComponentModel
Imports System.Drawing.Design
Imports DigitalData.GUIs.ClientSuite.Controls.Editors
Namespace Controls.Editors
<Editor(GetType(DatasourceEditor), GetType(UITypeEditor))>
<TypeConverter(GetType(DatasourceTypeConverter))>
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

View File

@ -4,7 +4,7 @@ Imports System.Drawing.Design
'Imports System.Windows.Forms 'Imports System.Windows.Forms
Imports System.Windows.Forms.Design Imports System.Windows.Forms.Design
Public Class ClassStaticListEditor Public Class StaticListEditor
Inherits UITypeEditor Inherits UITypeEditor
Public Overrides Function GetEditStyle(context As ITypeDescriptorContext) As UITypeEditorEditStyle Public Overrides Function GetEditStyle(context As ITypeDescriptorContext) As UITypeEditorEditStyle
@ -31,7 +31,7 @@ Public Class ClassStaticListEditor
End Function End Function
End Class End Class
<Editor(GetType(ClassStaticListEditor), GetType(UITypeEditor))> <Editor(GetType(StaticListEditor), GetType(UITypeEditor))>
<TypeConverter(GetType(StaticListTypeConverter))> <TypeConverter(GetType(StaticListTypeConverter))>
Public Class StaticList Public Class StaticList

View File

@ -0,0 +1,63 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class frmDatasourceEditor
Inherits DevExpress.XtraEditors.XtraForm
'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.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

View File

@ -0,0 +1,50 @@
Imports DigitalData.GUIs.ClientSuite.Controls.Editors
Imports ScintillaNET
Public Class frmDatasourceEditor
Public Value As DatasourceType
Private _Editor As Scintilla
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)
End Sub
Private Sub btnSave_Click(sender As Object, e As EventArgs) Handles btnSave.Click
Value.SQLCommand = _Editor.Text
End Sub
End Class

View File

@ -0,0 +1,106 @@
Imports DevExpress.XtraEditors
Imports DevExpress.XtraLayout
Imports DigitalData.Controls.LookupGrid
Imports DigitalData.GUIs.ClientSuite.Base
Imports DigitalData.Modules.Logging
Namespace Controls
Public Class ControlLoader
Inherits BaseClass
Private _LayoutControlGroup As LayoutControlGroup
Private _LayoutControls As List(Of BaseEdit)
Public ReadOnly Property LayoutControls As List(Of BaseEdit)
Get
If _LayoutControls Is Nothing Then
_LayoutControls = New List(Of BaseEdit)
End If
Return _LayoutControls
End Get
End Property
Public Sub New(LogConfig As LogConfig, LayoutControlGroup As LayoutControlGroup)
MyBase.New(LogConfig)
_LayoutControlGroup = LayoutControlGroup
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
}
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()
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)
If oEditor Is Nothing Then
Continue For
End If
oEditor.Tag = New Metadata() With {
.Id = oControlId,
.Type = oControlType,
.Caption = oCaption
}
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
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)
Select Case Type
Case ClassConstants.CONTROL_TEXTEDIT
Dim oTextEdit As New TextEdit() With {.Name = Name}
oEditor = oTextEdit
Case ClassConstants.CONTROL_MEMOEDIT
Dim oMemoEdit As New MemoEdit() With {.Name = Name}
oEditor = oMemoEdit
Case ClassConstants.CONTROL_DATEEDIT
Dim oDateEdit As New DateEdit() With {.Name = Name}
oEditor = oDateEdit
Case ClassConstants.CONTROL_CHECKEDIT
Dim oCheckEdit As New CheckEdit() With {.Name = Name}
oEditor = oCheckEdit
Case ClassConstants.CONTROL_COMBOEDIT
Dim oComboEdit As New LookupControl2() With {.Name = Name}
oEditor = oComboEdit
Case Else
oEditor = Nothing
End Select
Return oEditor
End Function
End Class
End Namespace

View File

@ -0,0 +1,30 @@
Imports System.ComponentModel
Namespace Controls
Public Class Localization
Private Shared Function Lookup(key As String)
Try
Return My.Resources.ControlProperties.ResourceManager.GetString(key)
Catch ex As Exception
Return key
End Try
End Function
Public Class LocalizedDescriptionAttribute
Inherits DescriptionAttribute
Public Sub New(key As String)
MyBase.New(Lookup(key))
End Sub
End Class
Public Class LocalizedCategoryAttribute
Inherits CategoryAttribute
Public Sub New(key As String)
MyBase.New(Lookup(key))
End Sub
End Class
End Class
End Namespace

View File

@ -0,0 +1,9 @@
Namespace Controls
Public Class Metadata
Public Id As Int64
Public Type As String
Public Caption As String
End Class
End Namespace

View File

@ -0,0 +1,17 @@
Imports System.ComponentModel
Imports DigitalData.GUIs.ClientSuite.Controls.Localization
Namespace Controls.Properties
Public MustInherit Class BaseProperties
<LocalizedCategory("category_info")>
<LocalizedDescription("desc_id")>
<[ReadOnly](True)>
Public Property Id As Integer
<LocalizedCategory("category_info")>
<LocalizedDescription("desc_name")>
Public Property Name As String
End Class
End Namespace

View File

@ -0,0 +1,7 @@
Namespace Controls.Properties
Public Class CheckboxProperties
Inherits BaseProperties
End Class
End Namespace

View File

@ -0,0 +1,14 @@
Imports System.ComponentModel
Imports DigitalData.GUIs.ClientSuite.Controls.Editors
Imports DigitalData.GUIs.ClientSuite.Controls.Localization
Namespace Controls.Properties
Public Class ComboboxProperties
Inherits BaseProperties
<LocalizedCategory("category_data")>
<LocalizedDescription("desc_datasource")>
Public Property Datasource As DatasourceType
End Class
End Namespace

View File

@ -0,0 +1,6 @@
Namespace Controls.Properties
Public Class DatepickerProperties
Inherits BaseProperties
End Class
End Namespace

View File

@ -0,0 +1,7 @@
Namespace Controls.Properties
Public Class MemoeditProperties
Inherits BaseProperties
End Class
End Namespace

View File

@ -0,0 +1,7 @@
Namespace Controls.Properties
Public Class TextboxProperties
Inherits BaseProperties
End Class
End Namespace

Some files were not shown because too many files have changed in this diff Show More