From 6ede3e1be9f949c7bcefcf2287ede3147cf3754f Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Tue, 29 Jan 2019 16:32:37 +0100 Subject: [PATCH 01/23] jj: add service config form --- EDMI_ClientSuite/App.config | 12 +- EDMI_ClientSuite/ApplicationEvents.vb | 3 + EDMI_ClientSuite/ClassInit.vb | 59 +++++-- EDMI_ClientSuite/EDMI_ClientSuite.vbproj | 13 ++ .../My Project/Application.Designer.vb | 5 - EDMI_ClientSuite/My Project/Application.myapp | 1 - .../My Project/Settings.Designer.vb | 12 ++ EDMI_ClientSuite/My Project/Settings.settings | 3 + EDMI_ClientSuite/My Project/app.manifest | 76 +++++++++ EDMI_ClientSuite/frmMain.vb | 21 +++ EDMI_ClientSuite/frmServiceConfig.Designer.vb | 146 ++++++++++++++++++ EDMI_ClientSuite/frmServiceConfig.resx | 120 ++++++++++++++ EDMI_ClientSuite/frmServiceConfig.vb | 37 +++++ EDMI_ClientSuite/frmSplash.vb | 55 ++++--- 14 files changed, 522 insertions(+), 41 deletions(-) create mode 100644 EDMI_ClientSuite/My Project/app.manifest create mode 100644 EDMI_ClientSuite/frmServiceConfig.Designer.vb create mode 100644 EDMI_ClientSuite/frmServiceConfig.resx create mode 100644 EDMI_ClientSuite/frmServiceConfig.vb diff --git a/EDMI_ClientSuite/App.config b/EDMI_ClientSuite/App.config index 9720616f..cf3cc8b8 100644 --- a/EDMI_ClientSuite/App.config +++ b/EDMI_ClientSuite/App.config @@ -5,6 +5,9 @@
+ +
+ @@ -73,4 +76,11 @@ - \ No newline at end of file + + + + + + + + \ No newline at end of file diff --git a/EDMI_ClientSuite/ApplicationEvents.vb b/EDMI_ClientSuite/ApplicationEvents.vb index bc254e28..6740854b 100644 --- a/EDMI_ClientSuite/ApplicationEvents.vb +++ b/EDMI_ClientSuite/ApplicationEvents.vb @@ -6,5 +6,8 @@ ' StartupNextInstance: Wird beim Starten einer Einzelinstanzanwendung ausgelöst, wenn die Anwendung bereits aktiv ist. ' NetworkAvailabilityChanged: Wird beim Herstellen oder Trennen der Netzwerkverbindung ausgelöst. Partial Friend Class MyApplication + Public Sub App_Shutdown(sender As Object, e As EventArgs) Handles Me.Shutdown + + End Sub End Class End Namespace diff --git a/EDMI_ClientSuite/ClassInit.vb b/EDMI_ClientSuite/ClassInit.vb index c2346e4a..84f1c36b 100644 --- a/EDMI_ClientSuite/ClassInit.vb +++ b/EDMI_ClientSuite/ClassInit.vb @@ -4,24 +4,66 @@ Imports System.ServiceModel Imports EDMI_ClientSuite.NetworkService_DDEDM Public Class ClassInit - Private Const OPEN_TIMEOUT = 10 + Private Const OPEN_TIMEOUT_SECONDS = 3 Private Const MAX_MESSAGE_SIZE = 2147483647 Private Const MAX_BUFFER_SIZE = 2147483647 Private Const MAX_ARRAY_LENGTH = 2147483647 Private Const MAX_STRING_LENGTH = 2147483647 Private Const MAX_CONNECTIONS = 10000 - Public Property _LogConfig As LogConfig + Public Enum ConnectionTestResult + Successful + NotFound + Unknown + End Enum + + Private ReadOnly _Logger As Logger Public Sub New() - _LogConfig = New LogConfig(PathType.AppData) + _Logger = My.LogConfig.GetLogger() End Sub - Public Function CreateService() As ChannelFactory(Of IEDMServiceChannel) - Return CreateChannelFactory() + Public Function TestConnectionURLExists() + Return My.Settings.ICMServiceAddress <> String.Empty + End Function + + Public Async Function TestConnectionAsync(EndpointURL As String) As Task(Of ConnectionTestResult) + Return Await Task.Factory.StartNew(Function() + Try + Dim oChannelFactory = GetChannelFactory(EndpointURL) + Dim oChannel = oChannelFactory.CreateChannel() + oChannel.OperationTimeout = New TimeSpan(0, 0, OPEN_TIMEOUT_SECONDS) + oChannel.Open() + oChannel.Close() + + Return ConnectionTestResult.Successful + Catch ex As EndpointNotFoundException + Return ConnectionTestResult.NotFound + Catch ex As Exception + Return ConnectionTestResult.Unknown + End Try + End Function) + End Function + + Public Function GetChannelFactory() As ChannelFactory(Of IEDMServiceChannel) + Return GetChannelFactory(My.Settings.ICMServiceAddress) + End Function + + Public Function GetChannelFactory(EndpointURL As String) As ChannelFactory(Of IEDMServiceChannel) + Dim oBinding = GetBinding() + Dim oEndpoint = GetEndpoint(EndpointURL) + + Dim oFactory As New ChannelFactory(Of IEDMServiceChannel)(oBinding, oEndpoint) + Return oFactory + End Function + + Private Function GetEndpoint(EndpointURL As String) As EndpointAddress + Dim oEndpoint = New EndpointAddress(EndpointURL) + + Return oEndpoint End Function - Private Function CreateChannelFactory() As ChannelFactory(Of IEDMServiceChannel) + Private Function GetBinding() As NetTcpBinding Dim oBinding As New NetTcpBinding() oBinding.Security.Mode = SecurityMode.Transport oBinding.Security.Transport.ClientCredentialType = TcpClientCredentialType.Windows @@ -31,10 +73,9 @@ Public Class ClassInit oBinding.MaxConnections = MAX_CONNECTIONS oBinding.ReaderQuotas.MaxArrayLength = MAX_ARRAY_LENGTH oBinding.ReaderQuotas.MaxStringContentLength = MAX_STRING_LENGTH - oBinding.OpenTimeout = New TimeSpan(0, 0, OPEN_TIMEOUT) - Dim oEndpointAddress = New EndpointAddress(My.Settings.EDM_NetworkService_Adress) + oBinding.OpenTimeout = New TimeSpan(0, 0, OPEN_TIMEOUT_SECONDS) - Return New ChannelFactory(Of IEDMServiceChannel)(oBinding, oEndpointAddress) + Return oBinding End Function End Class diff --git a/EDMI_ClientSuite/EDMI_ClientSuite.vbproj b/EDMI_ClientSuite/EDMI_ClientSuite.vbproj index 573239e6..e4571d7a 100644 --- a/EDMI_ClientSuite/EDMI_ClientSuite.vbproj +++ b/EDMI_ClientSuite/EDMI_ClientSuite.vbproj @@ -61,6 +61,9 @@ On + + My Project\app.manifest + @@ -225,6 +228,12 @@ Form + + frmServiceConfig.vb + + + Form + frmSplash.vb @@ -293,6 +302,9 @@ frmMain.vb + + frmServiceConfig.vb + frmSplash.vb @@ -350,6 +362,7 @@ Designer + MyApplicationCodeGenerator Application.Designer.vb diff --git a/EDMI_ClientSuite/My Project/Application.Designer.vb b/EDMI_ClientSuite/My Project/Application.Designer.vb index 4d9b26d7..55d6a2a9 100644 --- a/EDMI_ClientSuite/My Project/Application.Designer.vb +++ b/EDMI_ClientSuite/My Project/Application.Designer.vb @@ -34,10 +34,5 @@ Namespace My Protected Overrides Sub OnCreateMainForm() Me.MainForm = Global.EDMI_ClientSuite.frmMain End Sub - - _ - Protected Overrides Sub OnCreateSplashScreen() - Me.SplashScreen = Global.EDMI_ClientSuite.frmSplash - End Sub End Class End Namespace diff --git a/EDMI_ClientSuite/My Project/Application.myapp b/EDMI_ClientSuite/My Project/Application.myapp index b84db44c..5eb49b3b 100644 --- a/EDMI_ClientSuite/My Project/Application.myapp +++ b/EDMI_ClientSuite/My Project/Application.myapp @@ -6,6 +6,5 @@ 0 true 0 - frmSplash true \ No newline at end of file diff --git a/EDMI_ClientSuite/My Project/Settings.Designer.vb b/EDMI_ClientSuite/My Project/Settings.Designer.vb index 6ec95a4e..4c923afa 100644 --- a/EDMI_ClientSuite/My Project/Settings.Designer.vb +++ b/EDMI_ClientSuite/My Project/Settings.Designer.vb @@ -62,6 +62,18 @@ Namespace My Return CType(Me("EDM_NetworkService_Adress"),String) End Get End Property + + _ + Public Property ICMServiceAddress() As String + Get + Return CType(Me("ICMServiceAddress"),String) + End Get + Set + Me("ICMServiceAddress") = value + End Set + End Property End Class End Namespace diff --git a/EDMI_ClientSuite/My Project/Settings.settings b/EDMI_ClientSuite/My Project/Settings.settings index c95acafd..feab57fd 100644 --- a/EDMI_ClientSuite/My Project/Settings.settings +++ b/EDMI_ClientSuite/My Project/Settings.settings @@ -5,5 +5,8 @@ net.tcp://172.24.12.67:9000/DigitalData/Services/Main + + + \ No newline at end of file diff --git a/EDMI_ClientSuite/My Project/app.manifest b/EDMI_ClientSuite/My Project/app.manifest new file mode 100644 index 00000000..ef881eb8 --- /dev/null +++ b/EDMI_ClientSuite/My Project/app.manifest @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/EDMI_ClientSuite/frmMain.vb b/EDMI_ClientSuite/frmMain.vb index 317ad4ae..f83dfda3 100644 --- a/EDMI_ClientSuite/frmMain.vb +++ b/EDMI_ClientSuite/frmMain.vb @@ -4,8 +4,29 @@ Imports DevExpress.XtraBars.Docking2010.Views.Widget Imports System.ComponentModel Imports EDMI_ClientSuite.ClassLayout Imports System.IO +Imports DigitalData.Modules.Logging +Imports DigitalData.Modules.Logging.LogConfig Public Class frmMain + Private _Logger As Logger + + Public Sub New() + ' Dieser Aufruf ist für den Designer erforderlich. + InitializeComponent() + + ' Fügen Sie Initialisierungen nach dem InitializeComponent()-Aufruf hinzu. + + ' Initialize Logger + Dim oLogConfig As New LogConfig(PathType.AppData) + _Logger = oLogConfig.GetLogger() + + ' This sets the LogConfig object that is used in the WHOLE application!! + My.LogConfig = oLogConfig + + ' Show splashscreen + frmSplash.ShowDialog() + End Sub + Private Sub FrmMain_Load(sender As Object, e As EventArgs) Handles Me.Load LabelCurrentUser.Caption = Environment.UserName LabelCurrentMachine.Caption = Environment.MachineName diff --git a/EDMI_ClientSuite/frmServiceConfig.Designer.vb b/EDMI_ClientSuite/frmServiceConfig.Designer.vb new file mode 100644 index 00000000..307237ce --- /dev/null +++ b/EDMI_ClientSuite/frmServiceConfig.Designer.vb @@ -0,0 +1,146 @@ + _ +Partial Class frmServiceConfig + Inherits DevExpress.XtraEditors.XtraForm + + 'Das Formular überschreibt den Löschvorgang, um die Komponentenliste zu bereinigen. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Wird vom Windows Form-Designer benötigt. + Private components As System.ComponentModel.IContainer + + 'Hinweis: Die folgende Prozedur ist für den Windows Form-Designer erforderlich. + 'Das Bearbeiten ist mit dem Windows Form-Designer möglich. + 'Das Bearbeiten mit dem Code-Editor ist nicht möglich. + _ + Private Sub InitializeComponent() + Me.txtIPAddress = New System.Windows.Forms.TextBox() + Me.btnCancel = New System.Windows.Forms.Button() + Me.btnTest = New System.Windows.Forms.Button() + Me.txtPort = New System.Windows.Forms.TextBox() + Me.Label1 = New System.Windows.Forms.Label() + Me.Label2 = New System.Windows.Forms.Label() + Me.Label3 = New System.Windows.Forms.Label() + Me.lblStatus = New System.Windows.Forms.Label() + Me.lblURL = New System.Windows.Forms.TextBox() + Me.SuspendLayout() + ' + 'txtIPAddress + ' + Me.txtIPAddress.Location = New System.Drawing.Point(12, 32) + Me.txtIPAddress.Name = "txtIPAddress" + Me.txtIPAddress.Size = New System.Drawing.Size(250, 21) + Me.txtIPAddress.TabIndex = 0 + ' + 'btnCancel + ' + Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel + Me.btnCancel.Location = New System.Drawing.Point(338, 124) + Me.btnCancel.Name = "btnCancel" + Me.btnCancel.Size = New System.Drawing.Size(75, 23) + Me.btnCancel.TabIndex = 1 + Me.btnCancel.Text = "Cancel" + Me.btnCancel.UseVisualStyleBackColor = True + ' + 'btnTest + ' + Me.btnTest.Location = New System.Drawing.Point(223, 124) + Me.btnTest.Name = "btnTest" + Me.btnTest.Size = New System.Drawing.Size(109, 23) + Me.btnTest.TabIndex = 2 + Me.btnTest.Text = "Verbindungstest" + Me.btnTest.UseVisualStyleBackColor = True + ' + 'txtPort + ' + Me.txtPort.Location = New System.Drawing.Point(268, 32) + Me.txtPort.Name = "txtPort" + Me.txtPort.Size = New System.Drawing.Size(145, 21) + Me.txtPort.TabIndex = 0 + Me.txtPort.Text = "9000" + ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.Location = New System.Drawing.Point(12, 16) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(64, 13) + Me.Label1.TabIndex = 3 + Me.Label1.Text = "IP-Adresse:" + ' + 'Label2 + ' + Me.Label2.AutoSize = True + Me.Label2.Location = New System.Drawing.Point(265, 16) + Me.Label2.Name = "Label2" + Me.Label2.Size = New System.Drawing.Size(31, 13) + Me.Label2.TabIndex = 3 + Me.Label2.Text = "Port:" + ' + 'Label3 + ' + Me.Label3.AutoSize = True + Me.Label3.Location = New System.Drawing.Point(9, 83) + Me.Label3.Name = "Label3" + Me.Label3.Size = New System.Drawing.Size(42, 13) + Me.Label3.TabIndex = 4 + Me.Label3.Text = "Status:" + ' + 'lblStatus + ' + Me.lblStatus.AutoSize = True + Me.lblStatus.Location = New System.Drawing.Point(9, 96) + Me.lblStatus.Name = "lblStatus" + Me.lblStatus.Size = New System.Drawing.Size(86, 13) + Me.lblStatus.TabIndex = 4 + Me.lblStatus.Text = "Nicht verbunden" + ' + 'lblURL + ' + Me.lblURL.Location = New System.Drawing.Point(12, 59) + Me.lblURL.Name = "lblURL" + Me.lblURL.ReadOnly = True + Me.lblURL.Size = New System.Drawing.Size(401, 21) + Me.lblURL.TabIndex = 0 + ' + 'frmServiceConfig + ' + Me.AcceptButton = Me.btnTest + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.CancelButton = Me.btnCancel + Me.ClientSize = New System.Drawing.Size(425, 159) + Me.Controls.Add(Me.lblStatus) + Me.Controls.Add(Me.Label3) + Me.Controls.Add(Me.Label2) + Me.Controls.Add(Me.Label1) + Me.Controls.Add(Me.btnTest) + Me.Controls.Add(Me.btnCancel) + Me.Controls.Add(Me.txtPort) + Me.Controls.Add(Me.lblURL) + Me.Controls.Add(Me.txtIPAddress) + Me.Name = "frmServiceConfig" + Me.Text = "Dienst Kommunikation konfigurieren" + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + + Friend WithEvents txtIPAddress As TextBox + Friend WithEvents btnCancel As Button + Friend WithEvents btnTest As Button + Friend WithEvents txtPort As TextBox + Friend WithEvents Label1 As Label + Friend WithEvents Label2 As Label + Friend WithEvents Label3 As Label + Friend WithEvents lblStatus As Label + Friend WithEvents lblURL As TextBox +End Class diff --git a/EDMI_ClientSuite/frmServiceConfig.resx b/EDMI_ClientSuite/frmServiceConfig.resx new file mode 100644 index 00000000..1af7de15 --- /dev/null +++ b/EDMI_ClientSuite/frmServiceConfig.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/EDMI_ClientSuite/frmServiceConfig.vb b/EDMI_ClientSuite/frmServiceConfig.vb new file mode 100644 index 00000000..45161233 --- /dev/null +++ b/EDMI_ClientSuite/frmServiceConfig.vb @@ -0,0 +1,37 @@ +Imports EDMI_ClientSuite.ClassInit + +Public Class frmServiceConfig + Private _Init As ClassInit + + Private Sub frmServiceConfig_Load(sender As Object, e As EventArgs) Handles Me.Load + _Init = New ClassInit() + + If _Init.TestConnectionURLExists() Then + lblURL.Text = My.Settings.ICMServiceAddress + End If + End Sub + + Private Async Sub btnTest_Click(sender As Object, e As EventArgs) Handles btnTest.Click + Dim oIPAddress = txtIPAddress.Text + Dim oPort = txtPort.Text + Dim oEndpointURL = $"net.tcp://{oIPAddress}:{oPort}/DigitalData/Services/Main" + Dim oResult As ConnectionTestResult + + lblStatus.Text = "Verbindung wird hergestellt..." + oResult = Await _Init.TestConnectionAsync(oEndpointURL) + + If oResult = ConnectionTestResult.Successful Then + My.Settings.ICMServiceAddress = oEndpointURL + lblURL.Text = oEndpointURL + 'My.Settings.Save() + lblStatus.Text = "Verbindung hergestellt." + Else + Select Case oResult + Case ConnectionTestResult.NotFound + lblStatus.Text = "Dienst konnte nicht gefunden werden. Bitte überprüfen sie Addresse und Port." + Case Else + lblStatus.Text = "Unbekannter Fehler." + End Select + End If + End Sub +End Class \ No newline at end of file diff --git a/EDMI_ClientSuite/frmSplash.vb b/EDMI_ClientSuite/frmSplash.vb index 496e0f6f..0ccd18b7 100644 --- a/EDMI_ClientSuite/frmSplash.vb +++ b/EDMI_ClientSuite/frmSplash.vb @@ -1,5 +1,6 @@ Imports System.ComponentModel Imports System.ServiceModel +Imports System.Threading Imports DigitalData.Modules.Logging Imports DigitalData.Modules.Logging.LogConfig Imports EDMI_ClientSuite.NetworkService_DDEDM @@ -13,7 +14,7 @@ Public NotInheritable Class frmSplash Private _CurrentRetry As Integer = 0 Private Const SLEEP_TIME = 600 - Private Const INIT_STEPS = 1 + Private Const INIT_STEPS = 2 Private Const MAX_RETRIES = 10 Private Const OPEN_TIMEOUT = 10 @@ -23,13 +24,29 @@ Public NotInheritable Class frmSplash lblVersion.Text = String.Format("Version {0}", My.Application.Info.Version.ToString) BringToFront() - StartWorker() + + Dim oInit As New ClassInit() + Dim oConnectionURLExists = oInit.TestConnectionURLExists + + If Not oConnectionURLExists Then + Dim oResult = frmServiceConfig.ShowDialog() + + If oResult = DialogResult.Cancel Then + MsgBox("Es wurde keine Dienst Verbindungsurl hinterlegt. Die Anwendung wird beendet.") + Application.Exit() + Else + StartWorker() + End If + Else + StartWorker() + End If End Sub Private Function SetProgress(_step As Integer) Return _step * (100 / INIT_STEPS) End Function +#Region "Worker" Private Sub StartWorker() AddHandler _Worker.DoWork, AddressOf bw_DoWork AddHandler _Worker.ProgressChanged, AddressOf bw_ProgressChanged @@ -39,33 +56,21 @@ Public NotInheritable Class frmSplash _Worker.RunWorkerAsync() End Sub -#Region "Worker" Private Sub bw_DoWork(sender As Object, e As System.ComponentModel.DoWorkEventArgs) - Dim oInit As ClassInit - - Try - oInit = New ClassInit() - My.LogConfig = oInit._LogConfig - _Logger = My.LogConfig.GetLogger() - Catch ex As Exception - Throw New Exception($"Error while initializing Logger: {ex.Message}", ex) - End Try + Dim oInit As New ClassInit() '------------------ _Worker.ReportProgress(SetProgress(1), "Connecting to service..") - Try - My.ChannelFactory = oInit.CreateService() - My.Channel = My.ChannelFactory.CreateChannel() - - AddHandler My.Channel.Faulted, Sub() - _Logger.Error("Could not connect to service") - Throw New Exception("Could not connect to service") - End Sub - My.Channel.Open() - Catch ex As Exception - Throw New Exception($"Error while connectiong to service: {ex.Message}", ex) - End Try - System.Threading.Thread.Sleep(SLEEP_TIME) + + Dim oChannelFactory As ChannelFactory(Of IEDMServiceChannel) + Dim oChannel As IEDMServiceChannel + Dim oConnectionSuccessful = False + + + oChannelFactory = oInit.GetChannelFactory() + oChannel = oChannelFactory.CreateChannel() + + Thread.Sleep(SLEEP_TIME) ' TODO: Initialize Usersettings and populate My.Application.User End Sub From afb2f1f65847c7206705f4ac1fba66940b2c624b Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Wed, 30 Jan 2019 14:39:55 +0100 Subject: [PATCH 02/23] jj: Logging Version 0.0.6 - Add Log Directory for appdata path --- Modules.Logging/LogConfig.vb | 3 +-- Modules.Logging/My Project/AssemblyInfo.vb | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Modules.Logging/LogConfig.vb b/Modules.Logging/LogConfig.vb index 9faa6422..45c17238 100644 --- a/Modules.Logging/LogConfig.vb +++ b/Modules.Logging/LogConfig.vb @@ -173,7 +173,6 @@ Public Class LogConfig basePath = Path.Combine(appDataDir, companyName, productName, FOLDER_NAME_LOG) ElseIf logPath = PathType.CurrentDirectory Then Dim currentDirectory As String = My.Application.Info.DirectoryPath - basePath = Path.Combine(currentDirectory, FOLDER_NAME_LOG) Else 'Custom Path basePath = customLogPath @@ -197,7 +196,7 @@ Public Class LogConfig End Using File.Delete(fileAccessPath) - Catch ex As UnauthorizedAccessException + Catch ex As Exception ' If creation fails, use failSafe path basePath = failSafePath End Try diff --git a/Modules.Logging/My Project/AssemblyInfo.vb b/Modules.Logging/My Project/AssemblyInfo.vb index 8dccce0d..f90d3a43 100644 --- a/Modules.Logging/My Project/AssemblyInfo.vb +++ b/Modules.Logging/My Project/AssemblyInfo.vb @@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices ' übernehmen, indem Sie "*" eingeben: ' - + From 1ae788f52ef039c0c72248a35c3c4bec83bd4fc2 Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Wed, 30 Jan 2019 14:40:05 +0100 Subject: [PATCH 03/23] jj --- EDMI_ClientSuite/App.config | 3 +- EDMI_ClientSuite/ClassInit.vb | 2 + EDMI_ClientSuite/EDMI_ClientSuite.vbproj | 2 +- .../My Project/Settings.Designer.vb | 2 +- EDMI_ClientSuite/My Project/licenses.licx | 7 +- EDMI_ClientSuite/frmMain.Designer.vb | 20 +++-- EDMI_ClientSuite/frmMain.resx | 87 +++++++++++-------- EDMI_ClientSuite/frmMain.vb | 6 ++ EDMI_ClientSuite/frmServiceConfig.Designer.vb | 81 +++++++++-------- EDMI_ClientSuite/frmServiceConfig.vb | 10 +-- EDMI_ClientSuite/frmSplash.vb | 11 ++- Modules.Logging/LogConfig.vb | 2 +- 12 files changed, 143 insertions(+), 90 deletions(-) diff --git a/EDMI_ClientSuite/App.config b/EDMI_ClientSuite/App.config index cf3cc8b8..28991ba1 100644 --- a/EDMI_ClientSuite/App.config +++ b/EDMI_ClientSuite/App.config @@ -76,7 +76,8 @@ - + + diff --git a/EDMI_ClientSuite/ClassInit.vb b/EDMI_ClientSuite/ClassInit.vb index 84f1c36b..0a34ee9a 100644 --- a/EDMI_ClientSuite/ClassInit.vb +++ b/EDMI_ClientSuite/ClassInit.vb @@ -38,8 +38,10 @@ Public Class ClassInit Return ConnectionTestResult.Successful Catch ex As EndpointNotFoundException + _Logger.Error(ex) Return ConnectionTestResult.NotFound Catch ex As Exception + _Logger.Error(ex) Return ConnectionTestResult.Unknown End Try End Function) diff --git a/EDMI_ClientSuite/EDMI_ClientSuite.vbproj b/EDMI_ClientSuite/EDMI_ClientSuite.vbproj index e4571d7a..4936cbb5 100644 --- a/EDMI_ClientSuite/EDMI_ClientSuite.vbproj +++ b/EDMI_ClientSuite/EDMI_ClientSuite.vbproj @@ -368,7 +368,7 @@ Application.Designer.vb - SettingsSingleFileGenerator + PublicSettingsSingleFileGenerator My Settings.Designer.vb diff --git a/EDMI_ClientSuite/My Project/Settings.Designer.vb b/EDMI_ClientSuite/My Project/Settings.Designer.vb index 4c923afa..cf0fa946 100644 --- a/EDMI_ClientSuite/My Project/Settings.Designer.vb +++ b/EDMI_ClientSuite/My Project/Settings.Designer.vb @@ -17,7 +17,7 @@ Namespace My _ - Partial Friend NotInheritable Class MySettings + Partial Public NotInheritable Class MySettings Inherits Global.System.Configuration.ApplicationSettingsBase Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings) diff --git a/EDMI_ClientSuite/My Project/licenses.licx b/EDMI_ClientSuite/My Project/licenses.licx index 8c262734..d96f8e6c 100644 --- a/EDMI_ClientSuite/My Project/licenses.licx +++ b/EDMI_ClientSuite/My Project/licenses.licx @@ -1,6 +1,7 @@ -DevExpress.XtraBars.Docking.DockManager, DevExpress.XtraBars.v18.1, Version=18.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a DevExpress.XtraGrid.GridControl, DevExpress.XtraGrid.v18.1, Version=18.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a -DevExpress.XtraBars.Ribbon.RibbonControl, DevExpress.XtraBars.v18.1, Version=18.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a +DevExpress.XtraBars.Docking.DockManager, DevExpress.XtraBars.v18.1, Version=18.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a +DevExpress.XtraVerticalGrid.PropertyGridControl, DevExpress.XtraVerticalGrid.v18.1, Version=18.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a +DevExpress.XtraEditors.TextEdit, DevExpress.XtraEditors.v18.1, Version=18.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a DevExpress.XtraTabbedMdi.XtraTabbedMdiManager, DevExpress.XtraBars.v18.1, Version=18.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a +DevExpress.XtraBars.Ribbon.RibbonControl, DevExpress.XtraBars.v18.1, Version=18.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a DevExpress.XtraBars.Docking2010.DocumentManager, DevExpress.XtraBars.v18.1, Version=18.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a -DevExpress.XtraVerticalGrid.PropertyGridControl, DevExpress.XtraVerticalGrid.v18.1, Version=18.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a diff --git a/EDMI_ClientSuite/frmMain.Designer.vb b/EDMI_ClientSuite/frmMain.Designer.vb index a2dcb50c..da9147d1 100644 --- a/EDMI_ClientSuite/frmMain.Designer.vb +++ b/EDMI_ClientSuite/frmMain.Designer.vb @@ -55,6 +55,7 @@ Partial Class frmMain Me.DockPanelProcessManager = New DevExpress.XtraBars.Docking.DockPanel() Me.DockPanel2_Container = New DevExpress.XtraBars.Docking.ControlContainer() Me.ProcessManagerOverview = New EDMI_ClientSuite.ProcessManagerOverview() + Me.BarButtonConnectionSettings = New DevExpress.XtraBars.BarButtonItem() CType(Me.RibbonControl, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.MainMenu, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.DocumentManager, System.ComponentModel.ISupportInitialize).BeginInit() @@ -71,9 +72,9 @@ Partial Class frmMain ' Me.RibbonControl.ApplicationButtonDropDownControl = Me.MainMenu Me.RibbonControl.ExpandCollapseItem.Id = 0 - Me.RibbonControl.Items.AddRange(New DevExpress.XtraBars.BarItem() {Me.RibbonControl.ExpandCollapseItem, Me.BarButtonExit, Me.BarButtonUserSettings, Me.LabelCurrentUser, Me.LabelCurrentMachine, Me.LabelCurrentVersion, Me.BarButtonItem1, Me.BarButtonDock1, Me.SkinDropDownButtonItem1, Me.BarButtonDashboard, Me.BarButtonEntityDesigner, Me.BarButtonDeleteControl}) + Me.RibbonControl.Items.AddRange(New DevExpress.XtraBars.BarItem() {Me.RibbonControl.ExpandCollapseItem, Me.BarButtonExit, Me.BarButtonUserSettings, Me.LabelCurrentUser, Me.LabelCurrentMachine, Me.LabelCurrentVersion, Me.BarButtonItem1, Me.BarButtonDock1, Me.SkinDropDownButtonItem1, Me.BarButtonDashboard, Me.BarButtonEntityDesigner, Me.BarButtonDeleteControl, Me.BarButtonConnectionSettings}) Me.RibbonControl.Location = New System.Drawing.Point(0, 0) - Me.RibbonControl.MaxItemId = 14 + Me.RibbonControl.MaxItemId = 15 Me.RibbonControl.Name = "RibbonControl" Me.RibbonControl.PageCategories.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPageCategory() {Me.RibbonPageCategoryEntityDesigner}) Me.RibbonControl.PageHeaderItemLinks.Add(Me.SkinDropDownButtonItem1) @@ -85,6 +86,7 @@ Partial Class frmMain ' Me.MainMenu.ItemLinks.Add(Me.BarButtonExit) Me.MainMenu.ItemLinks.Add(Me.BarButtonUserSettings) + Me.MainMenu.ItemLinks.Add(Me.BarButtonConnectionSettings) Me.MainMenu.Name = "MainMenu" Me.MainMenu.Ribbon = Me.RibbonControl ' @@ -97,7 +99,7 @@ Partial Class frmMain ' 'BarButtonUserSettings ' - Me.BarButtonUserSettings.Caption = "Einstellungen" + Me.BarButtonUserSettings.Caption = "Benutzereinstellungen" Me.BarButtonUserSettings.Id = 2 Me.BarButtonUserSettings.ImageOptions.Image = CType(resources.GetObject("BarButtonUserSettings.ImageOptions.Image"), System.Drawing.Image) Me.BarButtonUserSettings.Name = "BarButtonUserSettings" @@ -153,8 +155,8 @@ Partial Class frmMain ' Me.BarButtonEntityDesigner.Caption = "Entitäten Designer" Me.BarButtonEntityDesigner.Id = 12 - Me.BarButtonEntityDesigner.ImageOptions.Image = CType(resources.GetObject("BarButtonItem2.ImageOptions.Image"), System.Drawing.Image) - Me.BarButtonEntityDesigner.ImageOptions.LargeImage = CType(resources.GetObject("BarButtonItem2.ImageOptions.LargeImage"), System.Drawing.Image) + Me.BarButtonEntityDesigner.ImageOptions.Image = CType(resources.GetObject("BarButtonEntityDesigner.ImageOptions.Image"), System.Drawing.Image) + Me.BarButtonEntityDesigner.ImageOptions.LargeImage = CType(resources.GetObject("BarButtonEntityDesigner.ImageOptions.LargeImage"), System.Drawing.Image) Me.BarButtonEntityDesigner.Name = "BarButtonEntityDesigner" ' 'BarButtonDeleteControl @@ -330,6 +332,13 @@ Partial Class frmMain Me.ProcessManagerOverview.Size = New System.Drawing.Size(337, 163) Me.ProcessManagerOverview.TabIndex = 0 ' + 'BarButtonConnectionSettings + ' + Me.BarButtonConnectionSettings.Caption = "Verbindungseinstellungen" + Me.BarButtonConnectionSettings.Id = 14 + Me.BarButtonConnectionSettings.ImageOptions.Image = CType(resources.GetObject("BarButtonItem2.ImageOptions.Image"), System.Drawing.Image) + Me.BarButtonConnectionSettings.Name = "BarButtonConnectionSettings" + ' 'frmMain ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) @@ -393,4 +402,5 @@ Partial Class frmMain Friend WithEvents RibbonPageControlActions As DevExpress.XtraBars.Ribbon.RibbonPage Friend WithEvents RibbonPageGroup5 As DevExpress.XtraBars.Ribbon.RibbonPageGroup Friend WithEvents BarButtonDeleteControl As DevExpress.XtraBars.BarButtonItem + Friend WithEvents BarButtonConnectionSettings As DevExpress.XtraBars.BarButtonItem End Class diff --git a/EDMI_ClientSuite/frmMain.resx b/EDMI_ClientSuite/frmMain.resx index a62b3c60..11b50c42 100644 --- a/EDMI_ClientSuite/frmMain.resx +++ b/EDMI_ClientSuite/frmMain.resx @@ -226,6 +226,21 @@ dtfHMz5dSt6ZNvr+lL/8g/B3GBfUiNgEYWy5pBTVTbw5RrbgGG7HsuXqPDI2h0CXkH5Pxf+Y/WQCb+NP Mb4aY8tC94/UKNQYHaPfUeHfZj4Wkwm8jf8RNOkYVGhsr4wX/UNYHAzzX2JQy7PWC0aGAAAAAElFTkSu QmCC + + + + + iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAAALXRFWHRUaXRsZQBEQjtTb3Vy + Y2U7U3RvcjtkYXRhc291cmNlO0RhdGFiYXNlO0VkaXQo9rqcAAABpUlEQVRYR8WVMU7DQBBFU9Aj0XED + CgokKKgRlJBrUCKqFCAFjkDHTZBoKNIilI5LQBOkFEgs/yE7cnZmQ7xexcWTnNn5/08cjzMIIfSKW9wk + bnGTuMXPyXWTbXEirsSjeBbv4kN8V3BNjTN66EWDduHlZbnFSrAvbsWrCJmgxQMvN8stqnkopsIzzQGv + oZdlClAJPKMuTL0sUwA1zyJxCWZelimAmueRuARzL8sUgOZIXIJWA/T+E/T+EPa+hiNxIUq9iPAaeVmm + AGrmGXgTd+JU5L6K0eKBV/YafokX8SAuxZnYEztiq4JrapzRQy8atLVP72t442WZAqj5JxJ3ZXx+/zQQ + hyJUcJ0coOQGeOGLIVIDlFrDONwMkRqgxBqmvvnS59QAXdfwWOap2w6LO5IaoMsaHsl4VXgN58XXcNUD + 1+QvHFID5Pwbtg6H1ABtN2CMrjL3QmuWwtGYcJBhmzXMCgd0JhxkCuuuYVY4kGXCAdOKXXEgWMXUGmJW + h8TBdd2EA1kmPAeZNcPWCge0xiwHmcWh/4YDWmOWg8yaA6wVDiGEwS9IKlJjkp5nnAAAAABJRU5ErkJg + gg== @@ -340,52 +355,52 @@ - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAAAC3RFWHRUaXRsZQBIb21lOx50 - ZDgAAADUSURBVDhPnZE9DoJAEIWxtfFkJl7AOwCNHQlmW6O30cTCRlAvY/zDdpw3YcgusLCx+GB4O+9L - yEbGGB8TZsPkms3XBwL6DZqhBcpbBstAJKECu3xkynrOuZyNCdrlKTNjHAm/m85YWc8gKVZmJxIrbwRD - ZUUkjCPBI6SsdCQIcVUIwFBZgUT3MwRLZl8HuqQLbezzE7PQAL/hLFTXhB5FKnwuSZ8AHecWnIU3l+7n - VHiVvQKZIyIS7BDz9xbTs0yF6hp3BNrzCjwEC8bwCoLpCP6Doh9wyB/S6rhfgQAAAABJRU5ErkJggg== + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m + dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAALdEVYdFRpdGxlAEhvbWU7HnRkOAAAANRJREFUOE+d + kT0OgkAQhbG18WQmXsA7AI0dCWZbo7fRxMJGUC9j/MN2nDdhyC6wsLH4YHg770vIRsYYHxNmw+SazdcH + AvoNmqEFylsGy0AkoQK7fGTKes65nI0J2uUpM2McCb+bzlhZzyApVmYnEitvBENlRSSMI8EjpKx0JAhx + VQjAUFmBRPczBEtmXwe6pAtt7PMTs9AAv+EsVNeEHkUqfC5JnwAd5xachTeX7udUeJW9ApkjIhLsEPP3 + FtOzTIXqGncE2vMKPAQLxvAKgukI/oOiH3DIH9LquF+BAAAAAElFTkSuQmCC - iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAAAC3RFWHRUaXRsZQBIb21lOx50 - ZDgAAAE6SURBVFhH7ZLNDcIwDEZBzMUIcO8CDMAIVSfgR+KEhIAZYADm4cIVEeyqrpzETts0lEsPT22+ - 2vkeEhNjzF+pX4qiiGFaIX0LkkJgBpyBA9BZoq8All8BU9FZoo+AWy5KLPK74VBOxApo5UQt8QsBqXwH - nJyslIDSV0oBrRx/LX7zJJb5bc4lILPu7CIQKuczQQk48ztbC0jlW0D6xwcl4N2abyPQpZxQJeBpzTYJ - xJQTogRg7YYE+pQTjRKaQIpyIighCaQsJ1QJSeDChpC+5YQksZcEVsCHDaUoJ1CC7n0DmSSAoMQGwEF+ - AUGXNKHtHoEMz5oAH3azMn8+1kFwxtmpd/nZE+DQsJRLpRyccfcQLfcCZBQYBUICbXD3EC33AqS6SPwW - yygQI5ActwfxgqERwyERw+Ewky+3HJlMr7zcTAAAAABJRU5ErkJggg== + iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m + dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAALdEVYdFRpdGxlAEhvbWU7HnRkOAAAATpJREFUWEft + ks0NwjAMRkHMxQhw7wIMwAhVJ+BH4oSEgBlgAObhwhUR7KqunMRO2zSUSw9Pbb7a+R4SE2PMX6lfiqKI + YVohfQuSQmAGnIED0FmirwCWXwFT0Vmij4BbLkos8rvhUE7ECmjlRC3xCwGpfAecnKyUgNJXSgGtHH8t + fvMklvltziUgs+7sIhAq5zNBCTjzO1sLSOVbQPrHByXg3ZpvI9ClnFAl4GnNNgnElBOiBGDthgT6lBON + EppAinIiKCEJpCwnVAlJ4MKGkL7lhCSxlwRWwIcNpSgnUILufQOZJICgxAbAQX4BQZc0oe0egQzPmgAf + drMyfz7WQXDG2al3+dkT4NCwlEulHJxx9xAt9wJkFBgFQgJtcPcQLfcCpLpI/BbLKBAjkBy3B/GCoRHD + IRHD4TCTL7ccmUyvvNxMAAAAAElFTkSuQmCC - + - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAAADXRFWHRUaXRsZQBXaXphcmQ7 - ySU3BgAAATVJREFUOE+lk81Kw0AURoOv1Bdw5c6HKCiIPwh9ABcSxIUE1KUrdyriSsuAgmIUBBHcuBJ3 - Ndg0VNuFiE3m897pJM4k0yB44Esmyb1nZkLiAfhXioHv+6iJ1OeG2cyxBAVS6sEv/DwIgpeyxOscNKco - MzJLuQ6jQYT4YkONTfQE32WJOpDgMTpZRhLu4vVoHnTNxRYsMENYgp1YLKF3voJ+2ELnsAmZjbjIiUsQ - xGIR/ZuWytvpgtpG9jXkwgqWgJqnKWlyuVoIeDXR8RyS621ayfjdmJQFm5R2V6ypmbttWsndHkT4gOdo - wIUVKlsYR6J3taVe4tntExdgdl04JU4B30w/P/B+v6+auJlxSSYKFPojqpPUCwxySZ5c8mcBM0lCVAWu - MGWJxhaYoSJXGhQWGD8TvB9sYiYvp9hqZQAAAABJRU5ErkJggg== + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m + dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAANdEVYdFRpdGxlAFdpemFyZDvJJTcGAAABNUlEQVQ4 + T6WTzUrDQBRGg6/UF3DlzocoKIg/CH0AFxLEhQTUpSt3KuJKy4CCYhQEEdy4Enc12DRU24WITebz3ukk + ziTTIHjgSybJvWdmQuIB+FeKge/7qInU54bZzLEEBVLqwS/8PAiCl7LE6xw0pygzMku5DqNBhPhiQ41N + 9ATfZYk6kOAxOllGEu7i9WgedM3FFiwwQ1iCnVgsoXe+gn7YQuewCZmNuMiJSxDEYhH9m5bK2+mC2kb2 + NeTCCpaAmqcpaXK5Wgh4NdHxHJLrbVrJ+N2YlAWblHZXrKmZu21ayd0eRPiA52jAhRUqWxhHone1pV7i + 2e0TF2B2XTglTgHfTD8/8H6/r5q4mXFJJgoU+iOqk9QLDHJJnlzyZwEzSUJUBa4wZYnGFpihIlcaFBYY + PxO8H2xiJi+n2GplAAAAAElFTkSuQmCC - + - iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAAADXRFWHRUaXRsZQBXaXphcmQ7 - ySU3BgAAAjpJREFUWEfFlE1LW0EUht2U4i/oX3DXhav+BaH/wE0Fq6G1opsq3Uk2IsFNt6HgqoVSWzV+ - YKuiblqE2m0lFqlNriYmCCaSmOT4niQj9+N478w13r7wMHdOZuY8XCa3i4j+K2IxSsRilIjFKBGLing8 - Tob8BX2A93qQeohFBTZh0A+vTyQSV8lksg9T91mOuUIsKsIIpNNpUSIyAY4kcWeBSu53++n22Ne7JbQE - jt8/6wePbDVqVMtU3Juj4w8DPPWNXYDTlqiyhK7ACqiBDRArH32n7JdxOknFCHMs8Y9bgKMk8JvnYjKO - CZpMcLPct1dkLQ1TdmGI8ngu7I5rC/iQwRJHP8YxQZMnmU+DzYZudAT8whKIox/jmKDJA3BZ2BnzCPAb - Kf54R416DUvNoyswaC0Oe5orWCK3MU31ygWWmyVQAM17QCm/OSo2Z/Jbo3SyHCMrNUG1izy26cdXAI0f - gv3T1ReUWx+5uXiK07WXxHfDSk3S+a+PVC38wTazBAk8BjMgCebBNmgoAf4GVM4OsZTo6dRqczSN1h2w - A4G3Fv8lv+KNbM+i1MpB5rwpwaNJwgh0W8tvKPv5OV3+++loGkbCWICpFo9w81/je1zHtPX6w0qEEgBU - K53x0Iy7qYlEKIH2JkfCSnRMgGNvyqPCT6KjAhx38yCJjgtwTCTuRYCjKxFaIAhOkIRtraeHp3AbODCI - XiCJ9ErnKcSiBA7SQZRwn2VHLErgIF3cEpG+AYWS4FE8rwV1XQOqvYU8ut/neQAAAABJRU5ErkJggg== + iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m + dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAANdEVYdFRpdGxlAFdpemFyZDvJJTcGAAACOklEQVRY + R8WUTUtbQRSG3ZTiL+hfcNeFq/4Fof/ATQWrobWimyrdSTYiwU23oeCqhVJbNX5gq6JuWoTabSUWqU2u + JiYIJpKY5PieJCP343jvzDXevvAwd05m5jxcJreLiP4rYjFKxGKUiMUoEYuKeDxOhvwFfYD3epB6iEUF + NmHQD69PJBJXyWSyD1P3WY65Qiwqwgik02lRIjIBjiRxZ4FK7nf76fbY17sltASO3z/rB49sNWpUy1Tc + m6PjDwM89Y1dgNOWqLKErsAKqIENECsffafsl3E6ScUIcyzxj1uAoyTwm+diMo4Jmkxws9y3V2QtDVN2 + YYjyeC7sjmsL+JDBEkc/xjFBkyeZT4PNhm50BPzCEoijH+OYoMkDcFnYGfMI8Bsp/nhHjXoNS82jKzBo + LQ57mitYIrcxTfXKBZabJVAAzXtAKb85KjZn8lujdLIcIys1QbWLPLbpx1cAjR+C/dPVF5RbH7m5eIrT + tZfEd8NKTdL5r49ULfzBNrMECTwGMyAJ5sE2aCgB/gZUzg6xlOjp1GpzNI3WHbADgbcW/yW/4o1sz6LU + ykHmvCnBo0nCCHRby28o+/k5Xf776WgaRsJYgKkWj3DzX+N7XMe09frDSoQSAFQrnfHQjLupiUQogfYm + R8JKdEyAY2/Ko8JPoqMCHHfzIImOC3BMJO5FgKMrEVogCE6QhG2tp4encBs4MIheIIn0SucpxKIEDtJB + lHCfZUcsSuAgXdwSkb4BhZLgUTyvBXVdA6q9hTy63+d5AAAAAElFTkSuQmCC diff --git a/EDMI_ClientSuite/frmMain.vb b/EDMI_ClientSuite/frmMain.vb index f83dfda3..909cc805 100644 --- a/EDMI_ClientSuite/frmMain.vb +++ b/EDMI_ClientSuite/frmMain.vb @@ -108,4 +108,10 @@ Public Class frmMain frm.Show() RibbonPageCategoryEntityDesigner.Visible = True End Sub + + Private Sub BarButtonConnectionSettings_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonConnectionSettings.ItemClick + Dim frm As New frmServiceConfig() + frm.MdiParent = DocumentManager.MdiParent + frm.Show() + End Sub End Class \ No newline at end of file diff --git a/EDMI_ClientSuite/frmServiceConfig.Designer.vb b/EDMI_ClientSuite/frmServiceConfig.Designer.vb index 307237ce..c4b3a8e4 100644 --- a/EDMI_ClientSuite/frmServiceConfig.Designer.vb +++ b/EDMI_ClientSuite/frmServiceConfig.Designer.vb @@ -22,24 +22,19 @@ Partial Class frmServiceConfig 'Das Bearbeiten mit dem Code-Editor ist nicht möglich. _ Private Sub InitializeComponent() - Me.txtIPAddress = New System.Windows.Forms.TextBox() Me.btnCancel = New System.Windows.Forms.Button() Me.btnTest = New System.Windows.Forms.Button() - Me.txtPort = New System.Windows.Forms.TextBox() Me.Label1 = New System.Windows.Forms.Label() Me.Label2 = New System.Windows.Forms.Label() Me.Label3 = New System.Windows.Forms.Label() Me.lblStatus = New System.Windows.Forms.Label() - Me.lblURL = New System.Windows.Forms.TextBox() + Me.btnOK = New System.Windows.Forms.Button() + Me.txtIPAddress = New DevExpress.XtraEditors.TextEdit() + Me.txtPort = New DevExpress.XtraEditors.TextEdit() + CType(Me.txtIPAddress.Properties, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.txtPort.Properties, System.ComponentModel.ISupportInitialize).BeginInit() Me.SuspendLayout() ' - 'txtIPAddress - ' - Me.txtIPAddress.Location = New System.Drawing.Point(12, 32) - Me.txtIPAddress.Name = "txtIPAddress" - Me.txtIPAddress.Size = New System.Drawing.Size(250, 21) - Me.txtIPAddress.TabIndex = 0 - ' 'btnCancel ' Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel @@ -52,21 +47,13 @@ Partial Class frmServiceConfig ' 'btnTest ' - Me.btnTest.Location = New System.Drawing.Point(223, 124) + Me.btnTest.Location = New System.Drawing.Point(12, 124) Me.btnTest.Name = "btnTest" Me.btnTest.Size = New System.Drawing.Size(109, 23) Me.btnTest.TabIndex = 2 Me.btnTest.Text = "Verbindungstest" Me.btnTest.UseVisualStyleBackColor = True ' - 'txtPort - ' - Me.txtPort.Location = New System.Drawing.Point(268, 32) - Me.txtPort.Name = "txtPort" - Me.txtPort.Size = New System.Drawing.Size(145, 21) - Me.txtPort.TabIndex = 0 - Me.txtPort.Text = "9000" - ' 'Label1 ' Me.Label1.AutoSize = True @@ -88,7 +75,7 @@ Partial Class frmServiceConfig 'Label3 ' Me.Label3.AutoSize = True - Me.Label3.Location = New System.Drawing.Point(9, 83) + Me.Label3.Location = New System.Drawing.Point(12, 55) Me.Label3.Name = "Label3" Me.Label3.Size = New System.Drawing.Size(42, 13) Me.Label3.TabIndex = 4 @@ -96,20 +83,39 @@ Partial Class frmServiceConfig ' 'lblStatus ' - Me.lblStatus.AutoSize = True - Me.lblStatus.Location = New System.Drawing.Point(9, 96) + Me.lblStatus.Location = New System.Drawing.Point(12, 68) Me.lblStatus.Name = "lblStatus" - Me.lblStatus.Size = New System.Drawing.Size(86, 13) + Me.lblStatus.Size = New System.Drawing.Size(401, 53) Me.lblStatus.TabIndex = 4 Me.lblStatus.Text = "Nicht verbunden" ' - 'lblURL + 'btnOK ' - Me.lblURL.Location = New System.Drawing.Point(12, 59) - Me.lblURL.Name = "lblURL" - Me.lblURL.ReadOnly = True - Me.lblURL.Size = New System.Drawing.Size(401, 21) - Me.lblURL.TabIndex = 0 + Me.btnOK.DialogResult = System.Windows.Forms.DialogResult.Cancel + Me.btnOK.Location = New System.Drawing.Point(257, 124) + Me.btnOK.Name = "btnOK" + Me.btnOK.Size = New System.Drawing.Size(75, 23) + Me.btnOK.TabIndex = 1 + Me.btnOK.Text = "OK" + Me.btnOK.UseVisualStyleBackColor = True + ' + 'txtIPAddress + ' + Me.txtIPAddress.Location = New System.Drawing.Point(12, 32) + Me.txtIPAddress.Name = "txtIPAddress" + Me.txtIPAddress.Properties.Mask.EditMask = "\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}" + Me.txtIPAddress.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.RegEx + Me.txtIPAddress.Size = New System.Drawing.Size(250, 20) + Me.txtIPAddress.TabIndex = 6 + ' + 'txtPort + ' + Me.txtPort.Location = New System.Drawing.Point(268, 32) + Me.txtPort.Name = "txtPort" + Me.txtPort.Properties.Mask.EditMask = "n0" + Me.txtPort.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Numeric + Me.txtPort.Size = New System.Drawing.Size(145, 20) + Me.txtPort.TabIndex = 7 ' 'frmServiceConfig ' @@ -118,29 +124,32 @@ Partial Class frmServiceConfig Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.CancelButton = Me.btnCancel Me.ClientSize = New System.Drawing.Size(425, 159) + Me.Controls.Add(Me.txtPort) + Me.Controls.Add(Me.txtIPAddress) Me.Controls.Add(Me.lblStatus) Me.Controls.Add(Me.Label3) Me.Controls.Add(Me.Label2) Me.Controls.Add(Me.Label1) Me.Controls.Add(Me.btnTest) + Me.Controls.Add(Me.btnOK) Me.Controls.Add(Me.btnCancel) - Me.Controls.Add(Me.txtPort) - Me.Controls.Add(Me.lblURL) - Me.Controls.Add(Me.txtIPAddress) + Me.MaximizeBox = False + Me.MinimizeBox = False Me.Name = "frmServiceConfig" Me.Text = "Dienst Kommunikation konfigurieren" + CType(Me.txtIPAddress.Properties, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.txtPort.Properties, System.ComponentModel.ISupportInitialize).EndInit() Me.ResumeLayout(False) Me.PerformLayout() End Sub - - Friend WithEvents txtIPAddress As TextBox Friend WithEvents btnCancel As Button Friend WithEvents btnTest As Button - Friend WithEvents txtPort As TextBox Friend WithEvents Label1 As Label Friend WithEvents Label2 As Label Friend WithEvents Label3 As Label Friend WithEvents lblStatus As Label - Friend WithEvents lblURL As TextBox + Friend WithEvents btnOK As Button + Friend WithEvents txtIPAddress As DevExpress.XtraEditors.TextEdit + Friend WithEvents txtPort As DevExpress.XtraEditors.TextEdit End Class diff --git a/EDMI_ClientSuite/frmServiceConfig.vb b/EDMI_ClientSuite/frmServiceConfig.vb index 45161233..9345ce5c 100644 --- a/EDMI_ClientSuite/frmServiceConfig.vb +++ b/EDMI_ClientSuite/frmServiceConfig.vb @@ -5,10 +5,6 @@ Public Class frmServiceConfig Private Sub frmServiceConfig_Load(sender As Object, e As EventArgs) Handles Me.Load _Init = New ClassInit() - - If _Init.TestConnectionURLExists() Then - lblURL.Text = My.Settings.ICMServiceAddress - End If End Sub Private Async Sub btnTest_Click(sender As Object, e As EventArgs) Handles btnTest.Click @@ -22,7 +18,6 @@ Public Class frmServiceConfig If oResult = ConnectionTestResult.Successful Then My.Settings.ICMServiceAddress = oEndpointURL - lblURL.Text = oEndpointURL 'My.Settings.Save() lblStatus.Text = "Verbindung hergestellt." Else @@ -34,4 +29,9 @@ Public Class frmServiceConfig End Select End If End Sub + + Private Sub btnDelete_Click(sender As Object, e As EventArgs) + My.Settings.ICMServiceAddress = String.Empty + My.Settings.Save() + End Sub End Class \ No newline at end of file diff --git a/EDMI_ClientSuite/frmSplash.vb b/EDMI_ClientSuite/frmSplash.vb index 0ccd18b7..fb9db005 100644 --- a/EDMI_ClientSuite/frmSplash.vb +++ b/EDMI_ClientSuite/frmSplash.vb @@ -14,7 +14,7 @@ Public NotInheritable Class frmSplash Private _CurrentRetry As Integer = 0 Private Const SLEEP_TIME = 600 - Private Const INIT_STEPS = 2 + Private Const INIT_STEPS = 4 Private Const MAX_RETRIES = 10 Private Const OPEN_TIMEOUT = 10 @@ -73,6 +73,15 @@ Public NotInheritable Class frmSplash Thread.Sleep(SLEEP_TIME) ' TODO: Initialize Usersettings and populate My.Application.User + + _Worker.ReportProgress(SetProgress(2), "Initializing User Settings..") + Thread.Sleep(SLEEP_TIME) + + _Worker.ReportProgress(SetProgress(3), "Connecting to mainframe..") + Thread.Sleep(SLEEP_TIME) + + _Worker.ReportProgress(SetProgress(4), "Setting up neural network..") + Thread.Sleep(SLEEP_TIME) End Sub Private Sub bw_ProgressChanged(sender As Object, e As System.ComponentModel.ProgressChangedEventArgs) diff --git a/Modules.Logging/LogConfig.vb b/Modules.Logging/LogConfig.vb index 45c17238..7c8ed6c8 100644 --- a/Modules.Logging/LogConfig.vb +++ b/Modules.Logging/LogConfig.vb @@ -4,7 +4,7 @@ Imports NLog.Config Imports NLog.Targets ''' LogConfig -''' 0.0.0.5 +''' 0.0.0.6 ''' 02.10.2018 ''' ''' Module that writes file-logs to different locations: From 7d691246f57bd11ceef70869a4e92bd8f7dcf224 Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Wed, 30 Jan 2019 15:27:07 +0100 Subject: [PATCH 04/23] jj: add app state --- Config/BaseConfig.vb | 12 ++++++----- Config/Config.vbproj | 6 ++++++ EDMI_ClientSuite/EDMI_ClientSuite.vbproj | 4 +++- EDMI_ClientSuite/MyAppSettings.vb | 10 --------- EDMI_ClientSuite/MyApplication.vb | 21 ++++++++----------- EDMI_ClientSuite/Settings/LicenseState.vb | 7 +++++++ EDMI_ClientSuite/Settings/ModuleState.vb | 7 +++++++ EDMI_ClientSuite/Settings/UserState.vb | 20 ++++++++++++++++++ EDMI_ClientSuite/frmMain.Designer.vb | 25 +++++++++++++++-------- EDMI_ClientSuite/frmMain.resx | 23 ++++++++++----------- EDMI_ClientSuite/frmMain.vb | 7 ++++--- 11 files changed, 91 insertions(+), 51 deletions(-) delete mode 100644 EDMI_ClientSuite/MyAppSettings.vb create mode 100644 EDMI_ClientSuite/Settings/LicenseState.vb create mode 100644 EDMI_ClientSuite/Settings/ModuleState.vb create mode 100644 EDMI_ClientSuite/Settings/UserState.vb diff --git a/Config/BaseConfig.vb b/Config/BaseConfig.vb index bc2a89d7..4e909d06 100644 --- a/Config/BaseConfig.vb +++ b/Config/BaseConfig.vb @@ -1,9 +1,9 @@ Imports System.IO -Imports NLog +Imports DigitalData.Modules.Logging Public MustInherit Class BaseConfig Private Const _userConfigFileName As String = "UserConfig.xml" - Private _logFactory As LogFactory + Private _logFactory As LogConfig Private _logger As Logger Protected Const _configKey As String = "Key" @@ -16,9 +16,11 @@ Public MustInherit Class BaseConfig End Get End Property - Public Sub New(LogFactory As LogFactory) - _logFactory = LogFactory - _logger = LogFactory.GetCurrentClassLogger() + Public Sub New(LogConfig As LogConfig) + _logFactory = LogConfig + _logger = LogConfig.GetLogger() + + End Sub Private Function GetUserConfigPath() As String diff --git a/Config/Config.vbproj b/Config/Config.vbproj index fa1c6cec..01170d53 100644 --- a/Config/Config.vbproj +++ b/Config/Config.vbproj @@ -111,5 +111,11 @@ Designer + + + {903b2d7d-3b80-4be9-8713-7447b704e1b0} + Logging + + \ No newline at end of file diff --git a/EDMI_ClientSuite/EDMI_ClientSuite.vbproj b/EDMI_ClientSuite/EDMI_ClientSuite.vbproj index 4936cbb5..ccaaac56 100644 --- a/EDMI_ClientSuite/EDMI_ClientSuite.vbproj +++ b/EDMI_ClientSuite/EDMI_ClientSuite.vbproj @@ -262,7 +262,9 @@ True - + + + True True diff --git a/EDMI_ClientSuite/MyAppSettings.vb b/EDMI_ClientSuite/MyAppSettings.vb deleted file mode 100644 index 62fd1d39..00000000 --- a/EDMI_ClientSuite/MyAppSettings.vb +++ /dev/null @@ -1,10 +0,0 @@ -Imports DigitalData.Modules.Logging - -Module MyAppSettings - Public APP_DB_VERSION As String - - Public USER_LANGUAGE As String = "de-DE" - Public MyLogger As Logger - Public MyLogConfig As LogConfig - End Module - diff --git a/EDMI_ClientSuite/MyApplication.vb b/EDMI_ClientSuite/MyApplication.vb index 222d8d84..23a4744a 100644 --- a/EDMI_ClientSuite/MyApplication.vb +++ b/EDMI_ClientSuite/MyApplication.vb @@ -1,23 +1,18 @@ Imports System.ServiceModel +Imports System.Threading Imports DigitalData.Modules.Logging Imports EDMI_ClientSuite.NetworkService_DDEDM Namespace My - ''' - ''' Helper Class to hold User State - ''' - Public Class User - Public Username As String - Public MachineName As String - - Public Sub New() - Username = Environment.UserName - MachineName = Environment.MachineName - End Sub + + Public Class ModuleLicense + End Class + ''' ''' Extends the My Namespace + ''' Example: My.LogConfig ''' Module Extension @@ -28,10 +23,12 @@ Namespace My ''' ''' Extends the My.Application Namespace + ''' Example: My.Application.User ''' Partial Class MyApplication ' User Config - Public User As New User() + Public User As New UserState() + Public License As New LicenseState() End Class End Namespace diff --git a/EDMI_ClientSuite/Settings/LicenseState.vb b/EDMI_ClientSuite/Settings/LicenseState.vb new file mode 100644 index 00000000..0e830809 --- /dev/null +++ b/EDMI_ClientSuite/Settings/LicenseState.vb @@ -0,0 +1,7 @@ +Public Class LicenseState + Public Modules As List(Of ModuleState) + + Public Sub New() + Modules = New List(Of ModuleState) + End Sub +End Class diff --git a/EDMI_ClientSuite/Settings/ModuleState.vb b/EDMI_ClientSuite/Settings/ModuleState.vb new file mode 100644 index 00000000..b7d16406 --- /dev/null +++ b/EDMI_ClientSuite/Settings/ModuleState.vb @@ -0,0 +1,7 @@ +Public Class ModuleState + Public Name As String + + Public Sub New(Name As String) + Me.Name = Name + End Sub +End Class diff --git a/EDMI_ClientSuite/Settings/UserState.vb b/EDMI_ClientSuite/Settings/UserState.vb new file mode 100644 index 00000000..b43dddbb --- /dev/null +++ b/EDMI_ClientSuite/Settings/UserState.vb @@ -0,0 +1,20 @@ +Imports System.Threading + +''' +''' Helper Class to hold User State +''' +Public Class UserState + Public UserName As String + Public MachineName As String + Public Language As String + + + ''' + ''' Initialize user object with values that can be read from the environment + ''' + Public Sub New() + Language = Thread.CurrentThread.CurrentCulture.Name + UserName = Environment.UserName + MachineName = Environment.MachineName + End Sub +End Class \ No newline at end of file diff --git a/EDMI_ClientSuite/frmMain.Designer.vb b/EDMI_ClientSuite/frmMain.Designer.vb index da9147d1..8efedc74 100644 --- a/EDMI_ClientSuite/frmMain.Designer.vb +++ b/EDMI_ClientSuite/frmMain.Designer.vb @@ -25,6 +25,7 @@ Partial Class frmMain Me.MainMenu = New DevExpress.XtraBars.Ribbon.ApplicationMenu(Me.components) Me.BarButtonExit = New DevExpress.XtraBars.BarButtonItem() Me.BarButtonUserSettings = New DevExpress.XtraBars.BarButtonItem() + Me.BarButtonConnectionSettings = New DevExpress.XtraBars.BarButtonItem() Me.LabelCurrentUser = New DevExpress.XtraBars.BarStaticItem() Me.LabelCurrentMachine = New DevExpress.XtraBars.BarStaticItem() Me.LabelCurrentVersion = New DevExpress.XtraBars.BarStaticItem() @@ -55,7 +56,7 @@ Partial Class frmMain Me.DockPanelProcessManager = New DevExpress.XtraBars.Docking.DockPanel() Me.DockPanel2_Container = New DevExpress.XtraBars.Docking.ControlContainer() Me.ProcessManagerOverview = New EDMI_ClientSuite.ProcessManagerOverview() - Me.BarButtonConnectionSettings = New DevExpress.XtraBars.BarButtonItem() + Me.LabelCurrentLanguage = New DevExpress.XtraBars.BarStaticItem() CType(Me.RibbonControl, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.MainMenu, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.DocumentManager, System.ComponentModel.ISupportInitialize).BeginInit() @@ -72,9 +73,9 @@ Partial Class frmMain ' Me.RibbonControl.ApplicationButtonDropDownControl = Me.MainMenu Me.RibbonControl.ExpandCollapseItem.Id = 0 - Me.RibbonControl.Items.AddRange(New DevExpress.XtraBars.BarItem() {Me.RibbonControl.ExpandCollapseItem, Me.BarButtonExit, Me.BarButtonUserSettings, Me.LabelCurrentUser, Me.LabelCurrentMachine, Me.LabelCurrentVersion, Me.BarButtonItem1, Me.BarButtonDock1, Me.SkinDropDownButtonItem1, Me.BarButtonDashboard, Me.BarButtonEntityDesigner, Me.BarButtonDeleteControl, Me.BarButtonConnectionSettings}) + Me.RibbonControl.Items.AddRange(New DevExpress.XtraBars.BarItem() {Me.RibbonControl.ExpandCollapseItem, Me.BarButtonExit, Me.BarButtonUserSettings, Me.LabelCurrentUser, Me.LabelCurrentMachine, Me.LabelCurrentVersion, Me.BarButtonItem1, Me.BarButtonDock1, Me.SkinDropDownButtonItem1, Me.BarButtonDashboard, Me.BarButtonEntityDesigner, Me.BarButtonDeleteControl, Me.BarButtonConnectionSettings, Me.LabelCurrentLanguage}) Me.RibbonControl.Location = New System.Drawing.Point(0, 0) - Me.RibbonControl.MaxItemId = 15 + Me.RibbonControl.MaxItemId = 16 Me.RibbonControl.Name = "RibbonControl" Me.RibbonControl.PageCategories.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPageCategory() {Me.RibbonPageCategoryEntityDesigner}) Me.RibbonControl.PageHeaderItemLinks.Add(Me.SkinDropDownButtonItem1) @@ -104,6 +105,13 @@ Partial Class frmMain Me.BarButtonUserSettings.ImageOptions.Image = CType(resources.GetObject("BarButtonUserSettings.ImageOptions.Image"), System.Drawing.Image) Me.BarButtonUserSettings.Name = "BarButtonUserSettings" ' + 'BarButtonConnectionSettings + ' + Me.BarButtonConnectionSettings.Caption = "Verbindungseinstellungen" + Me.BarButtonConnectionSettings.Id = 14 + Me.BarButtonConnectionSettings.ImageOptions.Image = CType(resources.GetObject("BarButtonConnectionSettings.ImageOptions.Image"), System.Drawing.Image) + Me.BarButtonConnectionSettings.Name = "BarButtonConnectionSettings" + ' 'LabelCurrentUser ' Me.LabelCurrentUser.Caption = "Current User" @@ -235,6 +243,7 @@ Partial Class frmMain Me.RibbonStatusBar.ItemLinks.Add(Me.LabelCurrentUser) Me.RibbonStatusBar.ItemLinks.Add(Me.LabelCurrentMachine) Me.RibbonStatusBar.ItemLinks.Add(Me.LabelCurrentVersion) + Me.RibbonStatusBar.ItemLinks.Add(Me.LabelCurrentLanguage) Me.RibbonStatusBar.Location = New System.Drawing.Point(0, 556) Me.RibbonStatusBar.Name = "RibbonStatusBar" Me.RibbonStatusBar.Ribbon = Me.RibbonControl @@ -332,12 +341,11 @@ Partial Class frmMain Me.ProcessManagerOverview.Size = New System.Drawing.Size(337, 163) Me.ProcessManagerOverview.TabIndex = 0 ' - 'BarButtonConnectionSettings + 'LabelCurrentLanguage ' - Me.BarButtonConnectionSettings.Caption = "Verbindungseinstellungen" - Me.BarButtonConnectionSettings.Id = 14 - Me.BarButtonConnectionSettings.ImageOptions.Image = CType(resources.GetObject("BarButtonItem2.ImageOptions.Image"), System.Drawing.Image) - Me.BarButtonConnectionSettings.Name = "BarButtonConnectionSettings" + Me.LabelCurrentLanguage.Caption = "BarStaticItem1" + Me.LabelCurrentLanguage.Id = 15 + Me.LabelCurrentLanguage.Name = "LabelCurrentLanguage" ' 'frmMain ' @@ -403,4 +411,5 @@ Partial Class frmMain Friend WithEvents RibbonPageGroup5 As DevExpress.XtraBars.Ribbon.RibbonPageGroup Friend WithEvents BarButtonDeleteControl As DevExpress.XtraBars.BarButtonItem Friend WithEvents BarButtonConnectionSettings As DevExpress.XtraBars.BarButtonItem + Friend WithEvents LabelCurrentLanguage As DevExpress.XtraBars.BarStaticItem End Class diff --git a/EDMI_ClientSuite/frmMain.resx b/EDMI_ClientSuite/frmMain.resx index 11b50c42..38fec89d 100644 --- a/EDMI_ClientSuite/frmMain.resx +++ b/EDMI_ClientSuite/frmMain.resx @@ -228,19 +228,18 @@ QmCC - + - iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAAALXRFWHRUaXRsZQBEQjtTb3Vy - Y2U7U3RvcjtkYXRhc291cmNlO0RhdGFiYXNlO0VkaXQo9rqcAAABpUlEQVRYR8WVMU7DQBBFU9Aj0XED - CgokKKgRlJBrUCKqFCAFjkDHTZBoKNIilI5LQBOkFEgs/yE7cnZmQ7xexcWTnNn5/08cjzMIIfSKW9wk - bnGTuMXPyXWTbXEirsSjeBbv4kN8V3BNjTN66EWDduHlZbnFSrAvbsWrCJmgxQMvN8stqnkopsIzzQGv - oZdlClAJPKMuTL0sUwA1zyJxCWZelimAmueRuARzL8sUgOZIXIJWA/T+E/T+EPa+hiNxIUq9iPAaeVmm - AGrmGXgTd+JU5L6K0eKBV/YafokX8SAuxZnYEztiq4JrapzRQy8atLVP72t442WZAqj5JxJ3ZXx+/zQQ - hyJUcJ0coOQGeOGLIVIDlFrDONwMkRqgxBqmvvnS59QAXdfwWOap2w6LO5IaoMsaHsl4VXgN58XXcNUD - 1+QvHFID5Pwbtg6H1ABtN2CMrjL3QmuWwtGYcJBhmzXMCgd0JhxkCuuuYVY4kGXCAdOKXXEgWMXUGmJW - h8TBdd2EA1kmPAeZNcPWCge0xiwHmcWh/4YDWmOWg8yaA6wVDiGEwS9IKlJjkp5nnAAAAABJRU5ErkJg - gg== + iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m + dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAAtdEVYdFRpdGxlAERCO1NvdXJjZTtTdG9yO2RhdGFz + b3VyY2U7RGF0YWJhc2U7RWRpdCj2upwAAAGlSURBVFhHxZUxTsNAEEVT0CPRcQMKCiQoqBGUkGtQIqoU + IAWOQMdNkGgo0iKUjktAE6QUSCz/ITtydmZDvF7FxZOc2fn/TxyPMwgh9Ipb3CRucZO4xc/JdZNtcSKu + xKN4Fu/iQ3xXcE2NM3roRYN24eVlucVKsC9uxasImaDFAy83yy2qeSimwjPNAa+hl2UKUAk8oy5MvSxT + ADXPInEJZl6WKYCa55G4BHMvyxSA5khcglYD9P4T9P4Q9r6GI3EhSr2I8Bp5WaYAauYZeBN34lTkvorR + 4oFX9hp+iRfxIC7FmdgTO2KrgmtqnNFDLxq0tU/va3jjZZkCqPknEndlfH7/NBCHIlRwnRyg5AZ44Ysh + UgOUWsM43AyRGqDEGqa++dLn1ABd1/BY5qnbDos7khqgyxoeyXhVeA3nxddw1QPX5C8cUgPk/Bu2DofU + AG03YIyuMvdCa5bC0ZhwkGGbNcwKB3QmHGQK665hVjiQZcIB04pdcSBYxdQaYlaHxMF13YQDWSY8B5k1 + w9YKB7TGLAeZxaH/hgNaY5aDzJoDrBUOIYTBL0gqUmOSnmecAAAAAElFTkSuQmCC diff --git a/EDMI_ClientSuite/frmMain.vb b/EDMI_ClientSuite/frmMain.vb index 909cc805..ec4f7169 100644 --- a/EDMI_ClientSuite/frmMain.vb +++ b/EDMI_ClientSuite/frmMain.vb @@ -28,9 +28,10 @@ Public Class frmMain End Sub Private Sub FrmMain_Load(sender As Object, e As EventArgs) Handles Me.Load - LabelCurrentUser.Caption = Environment.UserName - LabelCurrentMachine.Caption = Environment.MachineName + LabelCurrentUser.Caption = My.Application.User.UserName + LabelCurrentMachine.Caption = My.Application.User.MachineName LabelCurrentVersion.Caption = My.Application.Info.Version.ToString + LabelCurrentLanguage.Caption = My.Application.User.Language Dim oDashboard = New frmDashboard() oDashboard.MdiParent = DocumentManager.MdiParent @@ -97,7 +98,7 @@ Public Class frmMain End Sub Private Sub BarButtonItem1_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem1.ItemClick - Dim frm As New frmFileTest(MyLogConfig) + Dim frm As New frmFileTest(My.LogConfig) frm.MdiParent = DocumentManager.MdiParent frm.Show() End Sub From 4cf64da043499b87276cd58a4d0f53c6c30183d6 Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Wed, 30 Jan 2019 16:20:16 +0100 Subject: [PATCH 05/23] jj: app state --- EDMI_ClientSuite/ApplicationEvents.vb | 17 +- EDMI_ClientSuite/ClassConstants.vb | 9 + EDMI_ClientSuite/ClassInit.vb | 17 +- EDMI_ClientSuite/ClassLayout.vb | 5 +- EDMI_ClientSuite/EDMI_ClientSuite.vbproj | 21 +- .../My Project/Resources.Designer.vb | 20 -- EDMI_ClientSuite/My Project/Resources.resx | 6 - EDMI_ClientSuite/My Project/licenses.licx | 7 +- EDMI_ClientSuite/MyApplication.vb | 6 - ...signer.vb => frmConfigService.Designer.vb} | 2 +- ...rviceConfig.resx => frmConfigService.resx} | 0 ...rmServiceConfig.vb => frmConfigService.vb} | 2 +- ....Designer.vb => frmConfigUser.Designer.vb} | 211 +++++++++--------- ...{frmUserBasics.resx => frmConfigUser.resx} | 45 ++++ EDMI_ClientSuite/frmConfigUser.vb | 24 ++ EDMI_ClientSuite/frmMain.vb | 13 +- EDMI_ClientSuite/frmSplash.vb | 2 +- EDMI_ClientSuite/frmUserBasics.vb | 27 --- 18 files changed, 221 insertions(+), 213 deletions(-) create mode 100644 EDMI_ClientSuite/ClassConstants.vb rename EDMI_ClientSuite/{frmServiceConfig.Designer.vb => frmConfigService.Designer.vb} (99%) rename EDMI_ClientSuite/{frmServiceConfig.resx => frmConfigService.resx} (100%) rename EDMI_ClientSuite/{frmServiceConfig.vb => frmConfigService.vb} (97%) rename EDMI_ClientSuite/{frmUserBasics.Designer.vb => frmConfigUser.Designer.vb} (51%) rename EDMI_ClientSuite/{frmUserBasics.resx => frmConfigUser.resx} (97%) create mode 100644 EDMI_ClientSuite/frmConfigUser.vb delete mode 100644 EDMI_ClientSuite/frmUserBasics.vb diff --git a/EDMI_ClientSuite/ApplicationEvents.vb b/EDMI_ClientSuite/ApplicationEvents.vb index 6740854b..7feea862 100644 --- a/EDMI_ClientSuite/ApplicationEvents.vb +++ b/EDMI_ClientSuite/ApplicationEvents.vb @@ -1,4 +1,7 @@ -Namespace My +Imports DigitalData.Modules.Logging +Imports DigitalData.Modules.Logging.LogConfig + +Namespace My ' Für MyApplication sind folgende Ereignisse verfügbar: ' Startup: Wird beim Starten der Anwendung noch vor dem Erstellen des Startformulars ausgelöst. ' Shutdown: Wird nach dem Schließen aller Anwendungsformulare ausgelöst. Dieses Ereignis wird nicht ausgelöst, wenn die Anwendung mit einem Fehler beendet wird. @@ -6,8 +9,18 @@ ' StartupNextInstance: Wird beim Starten einer Einzelinstanzanwendung ausgelöst, wenn die Anwendung bereits aktiv ist. ' NetworkAvailabilityChanged: Wird beim Herstellen oder Trennen der Netzwerkverbindung ausgelöst. Partial Friend Class MyApplication - Public Sub App_Shutdown(sender As Object, e As EventArgs) Handles Me.Shutdown + Private _Logger As Logger + + Public Sub App_Startup() Handles Me.Startup + Dim oLogConfig As New LogConfig(PathType.AppData) + LogConfig = oLogConfig + _Logger = LogConfig.GetLogger() + _Logger.Info("Starting Client Suite..") + End Sub + + Public Sub App_Shutdown(sender As Object, e As EventArgs) Handles Me.Shutdown + _Logger.Info("Shutting down Client Suite..") End Sub End Class End Namespace diff --git a/EDMI_ClientSuite/ClassConstants.vb b/EDMI_ClientSuite/ClassConstants.vb new file mode 100644 index 00000000..1f4d0d34 --- /dev/null +++ b/EDMI_ClientSuite/ClassConstants.vb @@ -0,0 +1,9 @@ +Public Class ClassConstants + Public Const SERVICE_MAX_MESSAGE_SIZE = 2147483647 + Public Const SERVICE_MAX_BUFFER_SIZE = 2147483647 + Public Const SERVICE_MAX_ARRAY_LENGTH = 2147483647 + Public Const SERVICE_MAX_STRING_LENGTH = 2147483647 + Public Const SERVICE_MAX_CONNECTIONS = 10000 + + Public Const FOLDER_NAME_LAYOUT = "Layout" +End Class diff --git a/EDMI_ClientSuite/ClassInit.vb b/EDMI_ClientSuite/ClassInit.vb index 0a34ee9a..544c27cc 100644 --- a/EDMI_ClientSuite/ClassInit.vb +++ b/EDMI_ClientSuite/ClassInit.vb @@ -5,11 +5,6 @@ Imports EDMI_ClientSuite.NetworkService_DDEDM Public Class ClassInit Private Const OPEN_TIMEOUT_SECONDS = 3 - Private Const MAX_MESSAGE_SIZE = 2147483647 - Private Const MAX_BUFFER_SIZE = 2147483647 - Private Const MAX_ARRAY_LENGTH = 2147483647 - Private Const MAX_STRING_LENGTH = 2147483647 - Private Const MAX_CONNECTIONS = 10000 Public Enum ConnectionTestResult Successful @@ -69,12 +64,12 @@ Public Class ClassInit Dim oBinding As New NetTcpBinding() oBinding.Security.Mode = SecurityMode.Transport oBinding.Security.Transport.ClientCredentialType = TcpClientCredentialType.Windows - oBinding.MaxReceivedMessageSize = MAX_MESSAGE_SIZE - oBinding.MaxBufferSize = MAX_BUFFER_SIZE - oBinding.MaxBufferPoolSize = MAX_BUFFER_SIZE - oBinding.MaxConnections = MAX_CONNECTIONS - oBinding.ReaderQuotas.MaxArrayLength = MAX_ARRAY_LENGTH - oBinding.ReaderQuotas.MaxStringContentLength = MAX_STRING_LENGTH + oBinding.MaxReceivedMessageSize = ClassConstants.SERVICE_MAX_MESSAGE_SIZE + oBinding.MaxBufferSize = ClassConstants.SERVICE_MAX_BUFFER_SIZE + oBinding.MaxBufferPoolSize = ClassConstants.SERVICE_MAX_BUFFER_SIZE + oBinding.MaxConnections = ClassConstants.SERVICE_MAX_CONNECTIONS + oBinding.ReaderQuotas.MaxArrayLength = ClassConstants.SERVICE_MAX_ARRAY_LENGTH + oBinding.ReaderQuotas.MaxStringContentLength = ClassConstants.SERVICE_MAX_STRING_LENGTH oBinding.OpenTimeout = New TimeSpan(0, 0, OPEN_TIMEOUT_SECONDS) Return oBinding diff --git a/EDMI_ClientSuite/ClassLayout.vb b/EDMI_ClientSuite/ClassLayout.vb index ae2f22e4..0b9e8e26 100644 --- a/EDMI_ClientSuite/ClassLayout.vb +++ b/EDMI_ClientSuite/ClassLayout.vb @@ -1,9 +1,6 @@ Imports System.IO -Imports DevExpress.Utils.Serializing Public Class ClassLayout - Public Const LAYOUT_FOLDER = "Layout" - Public Enum LayoutName LayoutMain End Enum @@ -15,7 +12,7 @@ Public Class ClassLayout Public Shared Function GetLayoutPath(LayoutName As LayoutName, Component As LayoutComponent) As String Dim oFileName As String = $"{LayoutName.ToString}-{Component.ToString}.xml" - Return IO.Path.Combine(GetAppDataFolder(), LAYOUT_FOLDER, oFileName) + Return IO.Path.Combine(GetAppDataFolder(), ClassConstants.FOLDER_NAME_LAYOUT, oFileName) End Function Private Shared Function GetAppDataFolder() As String diff --git a/EDMI_ClientSuite/EDMI_ClientSuite.vbproj b/EDMI_ClientSuite/EDMI_ClientSuite.vbproj index ccaaac56..600387f7 100644 --- a/EDMI_ClientSuite/EDMI_ClientSuite.vbproj +++ b/EDMI_ClientSuite/EDMI_ClientSuite.vbproj @@ -168,6 +168,7 @@ + @@ -228,10 +229,10 @@ Form - - frmServiceConfig.vb + + frmConfigService.vb - + Form @@ -240,10 +241,10 @@ Form - - frmUserBasics.vb + + frmConfigUser.vb - + Form @@ -304,14 +305,14 @@ frmMain.vb - - frmServiceConfig.vb + + frmConfigService.vb frmSplash.vb - - frmUserBasics.vb + + frmConfigUser.vb diff --git a/EDMI_ClientSuite/My Project/Resources.Designer.vb b/EDMI_ClientSuite/My Project/Resources.Designer.vb index 7f496587..108e91fc 100644 --- a/EDMI_ClientSuite/My Project/Resources.Designer.vb +++ b/EDMI_ClientSuite/My Project/Resources.Designer.vb @@ -60,26 +60,6 @@ Namespace My.Resources End Set End Property - ''' - ''' Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. - ''' - Friend ReadOnly Property email_go() As System.Drawing.Bitmap - Get - Dim obj As Object = ResourceManager.GetObject("email_go", resourceCulture) - Return CType(obj,System.Drawing.Bitmap) - End Get - End Property - - ''' - ''' Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. - ''' - Friend ReadOnly Property folder_go() As System.Drawing.Bitmap - Get - Dim obj As Object = ResourceManager.GetObject("folder_go", resourceCulture) - Return CType(obj,System.Drawing.Bitmap) - End Get - End Property - ''' ''' Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. ''' diff --git a/EDMI_ClientSuite/My Project/Resources.resx b/EDMI_ClientSuite/My Project/Resources.resx index ae2292dd..f9ad61a5 100644 --- a/EDMI_ClientSuite/My Project/Resources.resx +++ b/EDMI_ClientSuite/My Project/Resources.resx @@ -121,13 +121,7 @@ ..\Resources\iconfinder_Gowalla_324477.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\email_go.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - ..\Resources\user_16xLG.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\folder_go.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - \ No newline at end of file diff --git a/EDMI_ClientSuite/My Project/licenses.licx b/EDMI_ClientSuite/My Project/licenses.licx index d96f8e6c..ccd2d2a4 100644 --- a/EDMI_ClientSuite/My Project/licenses.licx +++ b/EDMI_ClientSuite/My Project/licenses.licx @@ -1,7 +1,8 @@ DevExpress.XtraGrid.GridControl, DevExpress.XtraGrid.v18.1, Version=18.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a -DevExpress.XtraBars.Docking.DockManager, DevExpress.XtraBars.v18.1, Version=18.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a -DevExpress.XtraVerticalGrid.PropertyGridControl, DevExpress.XtraVerticalGrid.v18.1, Version=18.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a DevExpress.XtraEditors.TextEdit, DevExpress.XtraEditors.v18.1, Version=18.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a DevExpress.XtraTabbedMdi.XtraTabbedMdiManager, DevExpress.XtraBars.v18.1, Version=18.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a -DevExpress.XtraBars.Ribbon.RibbonControl, DevExpress.XtraBars.v18.1, Version=18.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a +DevExpress.XtraLayout.LayoutControl, DevExpress.XtraLayout.v18.1, Version=18.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a +DevExpress.XtraVerticalGrid.PropertyGridControl, DevExpress.XtraVerticalGrid.v18.1, Version=18.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a +DevExpress.XtraBars.Docking.DockManager, DevExpress.XtraBars.v18.1, Version=18.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a DevExpress.XtraBars.Docking2010.DocumentManager, DevExpress.XtraBars.v18.1, Version=18.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a +DevExpress.XtraBars.Ribbon.RibbonControl, DevExpress.XtraBars.v18.1, Version=18.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a diff --git a/EDMI_ClientSuite/MyApplication.vb b/EDMI_ClientSuite/MyApplication.vb index 23a4744a..ec5661ae 100644 --- a/EDMI_ClientSuite/MyApplication.vb +++ b/EDMI_ClientSuite/MyApplication.vb @@ -4,12 +4,6 @@ Imports DigitalData.Modules.Logging Imports EDMI_ClientSuite.NetworkService_DDEDM Namespace My - - Public Class ModuleLicense - - End Class - - ''' ''' Extends the My Namespace ''' Example: My.LogConfig diff --git a/EDMI_ClientSuite/frmServiceConfig.Designer.vb b/EDMI_ClientSuite/frmConfigService.Designer.vb similarity index 99% rename from EDMI_ClientSuite/frmServiceConfig.Designer.vb rename to EDMI_ClientSuite/frmConfigService.Designer.vb index c4b3a8e4..907c4d8f 100644 --- a/EDMI_ClientSuite/frmServiceConfig.Designer.vb +++ b/EDMI_ClientSuite/frmConfigService.Designer.vb @@ -1,5 +1,5 @@  _ -Partial Class frmServiceConfig +Partial Class frmConfigService Inherits DevExpress.XtraEditors.XtraForm 'Das Formular überschreibt den Löschvorgang, um die Komponentenliste zu bereinigen. diff --git a/EDMI_ClientSuite/frmServiceConfig.resx b/EDMI_ClientSuite/frmConfigService.resx similarity index 100% rename from EDMI_ClientSuite/frmServiceConfig.resx rename to EDMI_ClientSuite/frmConfigService.resx diff --git a/EDMI_ClientSuite/frmServiceConfig.vb b/EDMI_ClientSuite/frmConfigService.vb similarity index 97% rename from EDMI_ClientSuite/frmServiceConfig.vb rename to EDMI_ClientSuite/frmConfigService.vb index 9345ce5c..791f99f7 100644 --- a/EDMI_ClientSuite/frmServiceConfig.vb +++ b/EDMI_ClientSuite/frmConfigService.vb @@ -1,6 +1,6 @@ Imports EDMI_ClientSuite.ClassInit -Public Class frmServiceConfig +Public Class frmConfigService Private _Init As ClassInit Private Sub frmServiceConfig_Load(sender As Object, e As EventArgs) Handles Me.Load diff --git a/EDMI_ClientSuite/frmUserBasics.Designer.vb b/EDMI_ClientSuite/frmConfigUser.Designer.vb similarity index 51% rename from EDMI_ClientSuite/frmUserBasics.Designer.vb rename to EDMI_ClientSuite/frmConfigUser.Designer.vb index b75661ca..a2dcc3e0 100644 --- a/EDMI_ClientSuite/frmUserBasics.Designer.vb +++ b/EDMI_ClientSuite/frmConfigUser.Designer.vb @@ -1,5 +1,5 @@  _ -Partial Class frmUserBasics +Partial Class frmConfigUser Inherits System.Windows.Forms.Form 'Das Formular überschreibt den Löschvorgang, um die Komponentenliste zu bereinigen. @@ -22,57 +22,59 @@ Partial Class frmUserBasics 'Das Bearbeiten mit dem Code-Editor ist nicht möglich. _ Private Sub InitializeComponent() - Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmUserBasics)) - Me.TabControl1 = New System.Windows.Forms.TabControl() - Me.TabPage1 = New System.Windows.Forms.TabPage() + Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmConfigUser)) + Me.TabPageSupport = New DevExpress.XtraTab.XtraTabPage() + Me.btnAppFolder = New DevExpress.XtraEditors.SimpleButton() + Me.btnLogFolder = New DevExpress.XtraEditors.SimpleButton() Me.Button4 = New System.Windows.Forms.Button() - Me.btnApplicationFolder = New System.Windows.Forms.Button() - Me.chkLogErrorsOnly = New System.Windows.Forms.CheckBox() Me.LinkLabel1 = New System.Windows.Forms.LinkLabel() - Me.Button1 = New System.Windows.Forms.Button() - Me.TabPage2 = New System.Windows.Forms.TabPage() + Me.chkLogErrorsOnly = New System.Windows.Forms.CheckBox() + Me.XtraTabControl1 = New DevExpress.XtraTab.XtraTabControl() + Me.TabPageMain = New DevExpress.XtraTab.XtraTabPage() + Me.Label1 = New System.Windows.Forms.Label() Me.Button3 = New System.Windows.Forms.Button() Me.cmbLanguage = New System.Windows.Forms.ComboBox() - Me.Label1 = New System.Windows.Forms.Label() - Me.TabControl1.SuspendLayout() - Me.TabPage1.SuspendLayout() + Me.TabPageSupport.SuspendLayout() + CType(Me.XtraTabControl1, System.ComponentModel.ISupportInitialize).BeginInit() + Me.XtraTabControl1.SuspendLayout() + Me.TabPageMain.SuspendLayout() Me.SuspendLayout() ' - 'TabControl1 - ' - Me.TabControl1.Controls.Add(Me.TabPage1) - Me.TabControl1.Controls.Add(Me.TabPage2) - Me.TabControl1.Dock = System.Windows.Forms.DockStyle.Fill - Me.TabControl1.Location = New System.Drawing.Point(0, 0) - Me.TabControl1.Name = "TabControl1" - Me.TabControl1.SelectedIndex = 0 - Me.TabControl1.Size = New System.Drawing.Size(800, 450) - Me.TabControl1.TabIndex = 0 - ' - 'TabPage1 - ' - Me.TabPage1.Controls.Add(Me.Label1) - Me.TabPage1.Controls.Add(Me.Button3) - Me.TabPage1.Controls.Add(Me.cmbLanguage) - Me.TabPage1.Controls.Add(Me.Button4) - Me.TabPage1.Controls.Add(Me.btnApplicationFolder) - Me.TabPage1.Controls.Add(Me.chkLogErrorsOnly) - Me.TabPage1.Controls.Add(Me.LinkLabel1) - Me.TabPage1.Controls.Add(Me.Button1) - Me.TabPage1.Location = New System.Drawing.Point(4, 22) - Me.TabPage1.Name = "TabPage1" - Me.TabPage1.Padding = New System.Windows.Forms.Padding(3) - Me.TabPage1.Size = New System.Drawing.Size(792, 424) - Me.TabPage1.TabIndex = 0 - Me.TabPage1.Text = "Logging und Support" - Me.TabPage1.UseVisualStyleBackColor = True + 'TabPageSupport + ' + Me.TabPageSupport.Controls.Add(Me.btnAppFolder) + Me.TabPageSupport.Controls.Add(Me.btnLogFolder) + Me.TabPageSupport.Controls.Add(Me.Button4) + Me.TabPageSupport.Controls.Add(Me.LinkLabel1) + Me.TabPageSupport.Controls.Add(Me.chkLogErrorsOnly) + Me.TabPageSupport.ImageOptions.Image = CType(resources.GetObject("TabPageSupport.ImageOptions.Image"), System.Drawing.Image) + Me.TabPageSupport.Name = "TabPageSupport" + Me.TabPageSupport.Size = New System.Drawing.Size(703, 448) + Me.TabPageSupport.Text = "Support" + ' + 'btnAppFolder + ' + Me.btnAppFolder.ImageOptions.Image = CType(resources.GetObject("SimpleButton1.ImageOptions.Image"), System.Drawing.Image) + Me.btnAppFolder.Location = New System.Drawing.Point(349, 58) + Me.btnAppFolder.Name = "btnAppFolder" + Me.btnAppFolder.Size = New System.Drawing.Size(164, 36) + Me.btnAppFolder.TabIndex = 21 + Me.btnAppFolder.Text = "AppData Ordner öffnen" + ' + 'btnLogFolder + ' + Me.btnLogFolder.ImageOptions.Image = CType(resources.GetObject("btnLogFolder.ImageOptions.Image"), System.Drawing.Image) + Me.btnLogFolder.Location = New System.Drawing.Point(349, 18) + Me.btnLogFolder.Name = "btnLogFolder" + Me.btnLogFolder.Size = New System.Drawing.Size(164, 34) + Me.btnLogFolder.TabIndex = 20 + Me.btnLogFolder.Text = "Log Ordner öffnen" ' 'Button4 ' - Me.Button4.Image = Global.EDMI_ClientSuite.My.Resources.Resources.email_go Me.Button4.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft Me.Button4.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.Button4.Location = New System.Drawing.Point(8, 6) + Me.Button4.Location = New System.Drawing.Point(15, 14) Me.Button4.Name = "Button4" Me.Button4.Size = New System.Drawing.Size(133, 23) Me.Button4.TabIndex = 19 @@ -80,72 +82,67 @@ Partial Class frmUserBasics Me.Button4.TextAlign = System.Drawing.ContentAlignment.MiddleRight Me.Button4.UseVisualStyleBackColor = True ' - 'btnApplicationFolder + 'LinkLabel1 ' - Me.btnApplicationFolder.Image = Global.EDMI_ClientSuite.My.Resources.Resources.folder_go - Me.btnApplicationFolder.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft - Me.btnApplicationFolder.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.btnApplicationFolder.Location = New System.Drawing.Point(265, 35) - Me.btnApplicationFolder.Name = "btnApplicationFolder" - Me.btnApplicationFolder.Size = New System.Drawing.Size(144, 23) - Me.btnApplicationFolder.TabIndex = 16 - Me.btnApplicationFolder.Text = "Open AppFolder User" - Me.btnApplicationFolder.TextAlign = System.Drawing.ContentAlignment.MiddleRight - Me.btnApplicationFolder.UseVisualStyleBackColor = True + Me.LinkLabel1.AutoSize = True + Me.LinkLabel1.Font = New System.Drawing.Font("Segoe UI", 9.75!) + Me.LinkLabel1.ImeMode = System.Windows.Forms.ImeMode.NoControl + Me.LinkLabel1.Location = New System.Drawing.Point(12, 87) + Me.LinkLabel1.Name = "LinkLabel1" + Me.LinkLabel1.Size = New System.Drawing.Size(200, 17) + Me.LinkLabel1.TabIndex = 15 + Me.LinkLabel1.TabStop = True + Me.LinkLabel1.Text = "Link zu Support-Tool Digital Data" ' 'chkLogErrorsOnly ' Me.chkLogErrorsOnly.AutoSize = True Me.chkLogErrorsOnly.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.chkLogErrorsOnly.Location = New System.Drawing.Point(147, 10) + Me.chkLogErrorsOnly.Location = New System.Drawing.Point(154, 18) Me.chkLogErrorsOnly.Name = "chkLogErrorsOnly" Me.chkLogErrorsOnly.Size = New System.Drawing.Size(100, 17) Me.chkLogErrorsOnly.TabIndex = 18 Me.chkLogErrorsOnly.Text = "Log Errors Only" Me.chkLogErrorsOnly.UseVisualStyleBackColor = True ' - 'LinkLabel1 + 'XtraTabControl1 ' - Me.LinkLabel1.AutoSize = True - Me.LinkLabel1.Font = New System.Drawing.Font("Segoe UI", 9.75!) - Me.LinkLabel1.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.LinkLabel1.Location = New System.Drawing.Point(5, 79) - Me.LinkLabel1.Name = "LinkLabel1" - Me.LinkLabel1.Size = New System.Drawing.Size(200, 17) - Me.LinkLabel1.TabIndex = 15 - Me.LinkLabel1.TabStop = True - Me.LinkLabel1.Text = "Link zu Support-Tool Digital Data" + Me.XtraTabControl1.Dock = System.Windows.Forms.DockStyle.Fill + Me.XtraTabControl1.HeaderLocation = DevExpress.XtraTab.TabHeaderLocation.Left + Me.XtraTabControl1.HeaderOrientation = DevExpress.XtraTab.TabOrientation.Horizontal + Me.XtraTabControl1.Location = New System.Drawing.Point(0, 0) + Me.XtraTabControl1.Name = "XtraTabControl1" + Me.XtraTabControl1.SelectedTabPage = Me.TabPageSupport + Me.XtraTabControl1.Size = New System.Drawing.Size(800, 450) + Me.XtraTabControl1.TabIndex = 51 + Me.XtraTabControl1.TabPages.AddRange(New DevExpress.XtraTab.XtraTabPage() {Me.TabPageMain, Me.TabPageSupport}) + ' + 'TabPageMain ' - 'Button1 - ' - Me.Button1.Image = Global.EDMI_ClientSuite.My.Resources.Resources.folder_go - Me.Button1.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft - Me.Button1.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.Button1.Location = New System.Drawing.Point(8, 35) - Me.Button1.Name = "Button1" - Me.Button1.Size = New System.Drawing.Size(133, 23) - Me.Button1.TabIndex = 17 - Me.Button1.Text = "Open Log-Folder" - Me.Button1.TextAlign = System.Drawing.ContentAlignment.MiddleRight - Me.Button1.UseVisualStyleBackColor = True - ' - 'TabPage2 - ' - Me.TabPage2.Location = New System.Drawing.Point(4, 22) - Me.TabPage2.Name = "TabPage2" - Me.TabPage2.Padding = New System.Windows.Forms.Padding(3) - Me.TabPage2.Size = New System.Drawing.Size(792, 424) - Me.TabPage2.TabIndex = 1 - Me.TabPage2.Text = "TabPage2" - Me.TabPage2.UseVisualStyleBackColor = True + Me.TabPageMain.Controls.Add(Me.Label1) + Me.TabPageMain.Controls.Add(Me.Button3) + Me.TabPageMain.Controls.Add(Me.cmbLanguage) + Me.TabPageMain.ImageOptions.Image = CType(resources.GetObject("TabPageMain.ImageOptions.Image"), System.Drawing.Image) + Me.TabPageMain.Name = "TabPageMain" + Me.TabPageMain.Size = New System.Drawing.Size(703, 448) + Me.TabPageMain.Text = "Allgemein" + ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.Location = New System.Drawing.Point(15, 21) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(91, 13) + Me.Label1.TabIndex = 53 + Me.Label1.Text = "Aktuelle Sprache:" ' 'Button3 ' Me.Button3.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.Button3.Location = New System.Drawing.Point(148, 139) + Me.Button3.Location = New System.Drawing.Point(158, 35) Me.Button3.Name = "Button3" Me.Button3.Size = New System.Drawing.Size(134, 23) - Me.Button3.TabIndex = 49 + Me.Button3.TabIndex = 52 Me.Button3.Text = "Sprache jetzt wechseln" Me.Button3.UseVisualStyleBackColor = True ' @@ -153,46 +150,40 @@ Partial Class frmUserBasics ' Me.cmbLanguage.FormattingEnabled = True Me.cmbLanguage.Items.AddRange(New Object() {"de-DE", "en-US"}) - Me.cmbLanguage.Location = New System.Drawing.Point(8, 141) + Me.cmbLanguage.Location = New System.Drawing.Point(18, 37) Me.cmbLanguage.Name = "cmbLanguage" Me.cmbLanguage.Size = New System.Drawing.Size(134, 21) - Me.cmbLanguage.TabIndex = 48 + Me.cmbLanguage.TabIndex = 51 ' - 'Label1 - ' - Me.Label1.AutoSize = True - Me.Label1.Location = New System.Drawing.Point(5, 125) - Me.Label1.Name = "Label1" - Me.Label1.Size = New System.Drawing.Size(91, 13) - Me.Label1.TabIndex = 50 - Me.Label1.Text = "Aktuelle Sprache:" - ' - 'frmUserBasics + 'frmConfigUser ' 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.TabControl1) + Me.Controls.Add(Me.XtraTabControl1) Me.Font = New System.Drawing.Font("Tahoma", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) - Me.Name = "frmUserBasics" + Me.Name = "frmConfigUser" Me.Text = "Grundeinstellungen User" - Me.TabControl1.ResumeLayout(False) - Me.TabPage1.ResumeLayout(False) - Me.TabPage1.PerformLayout() + Me.TabPageSupport.ResumeLayout(False) + Me.TabPageSupport.PerformLayout() + CType(Me.XtraTabControl1, System.ComponentModel.ISupportInitialize).EndInit() + Me.XtraTabControl1.ResumeLayout(False) + Me.TabPageMain.ResumeLayout(False) + Me.TabPageMain.PerformLayout() Me.ResumeLayout(False) End Sub - Friend WithEvents TabControl1 As TabControl - Friend WithEvents TabPage1 As TabPage - Friend WithEvents TabPage2 As TabPage + Friend WithEvents TabPageSupport As DevExpress.XtraTab.XtraTabPage Friend WithEvents Button4 As Button - Friend WithEvents chkLogErrorsOnly As CheckBox - Friend WithEvents Button1 As Button - Friend WithEvents btnApplicationFolder As Button Friend WithEvents LinkLabel1 As LinkLabel + Friend WithEvents chkLogErrorsOnly As CheckBox + Friend WithEvents XtraTabControl1 As DevExpress.XtraTab.XtraTabControl + Friend WithEvents TabPageMain As DevExpress.XtraTab.XtraTabPage Friend WithEvents Label1 As Label Friend WithEvents Button3 As Button Friend WithEvents cmbLanguage As ComboBox + Friend WithEvents btnLogFolder As DevExpress.XtraEditors.SimpleButton + Friend WithEvents btnAppFolder As DevExpress.XtraEditors.SimpleButton End Class diff --git a/EDMI_ClientSuite/frmUserBasics.resx b/EDMI_ClientSuite/frmConfigUser.resx similarity index 97% rename from EDMI_ClientSuite/frmUserBasics.resx rename to EDMI_ClientSuite/frmConfigUser.resx index cc0c9c2e..3ee5ee40 100644 --- a/EDMI_ClientSuite/frmUserBasics.resx +++ b/EDMI_ClientSuite/frmConfigUser.resx @@ -118,6 +118,51 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m + dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAArdEVYdFRpdGxlAE9wZW47Rm9sZGVyO0JhcnM7Umli + Ym9uO1N0YW5kYXJkO0xvYWTxw8RjAAAAb0lEQVQ4T6XQ0Q2AIAwEUBbsMs7Q0ZzHFeqVRIJ6VQof7+fC + XUiLmS2hYQYNM4qqChjhOS31fICVL8JKvb+BSBueHUB3cQCGB+oxmWjgVjj2TcAC8hzwx1+Fl34gXYb2 + g6ky1BtMl1295AoajrNyArCYwjN4ThJYAAAAAElFTkSuQmCC + + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m + dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAArdEVYdFRpdGxlAE9wZW47Rm9sZGVyO0JhcnM7Umli + Ym9uO1N0YW5kYXJkO0xvYWTxw8RjAAAAb0lEQVQ4T6XQ0Q2AIAwEUBbsMs7Q0ZzHFeqVRIJ6VQof7+fC + XUiLmS2hYQYNM4qqChjhOS31fICVL8JKvb+BSBueHUB3cQCGB+oxmWjgVjj2TcAC8hzwx1+Fl34gXYb2 + g6ky1BtMl1295AoajrNyArCYwjN4ThJYAAAAAElFTkSuQmCC + + + + + iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m + dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAARdEVYdFRpdGxlAEJ1ZztSZXBvcnQ7sbAXPQAAAc5J + REFUWEfFljFOw0AQRVMgEkHDPbgGbaDhBtyAO9AAHUhUuQOUtHRAuhRwBehAAiGBZP63ZqPZ3W/s2MYp + nmK/nT8zcRIpo6Io1oqUQyLl89FeHTvgyt3zms7XRKg5RErVwLEJHkDhHK/vAc987RI1h0ipGjiOAQem + CxCe+dolag6RUjVwzEHVAo/ORag5REoLlU2F/whngk+Q9gpnkQ9IyeIQFH7tC/iPIIVnaa9wFvmAlMQF + p3Y/Bqfg27yCZ2dgbJmpedzqOVKSEDQOwW3i/oK1zCxd2j8gJQLR9j3AXnKWlCw2+liiHE7ULClDAGyA + V6AaN4FZ9lhtAWKhA6AarwJ7yBkkEyju87NPKX9RnuiGBUngP4iWSBeICsFL4trwBqI35mdWLRC+uT/O + dSF6un5m1QK8Ju/OtYVPIPQrnZ9ZuYDdL5xry8J61S8QYLG9zkKoAzPfM0VKwgA4sSZdYA85g0jJAOjz + J1l+qdWsTLDQAqpRF+QSmWCRC5F9cJ24JtwAZr3L5mWCRS5Qbg22wJ25JrB2GzDrn2Y2LxMWygK4ngD+ + 26n7R3QOJnX9ApnwgYqzXXABnsCXwetLwLMoY7nmCwyNlEMi5XAUo19RwjicG819swAAAABJRU5ErkJg + gg== + + + + + iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m + dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAALdEVYdFRpdGxlAEhvbWU7HnRkOAAAATpJREFUWEft + ks0NwjAMRkHMxQhw7wIMwAhVJ+BH4oSEgBlgAObhwhUR7KqunMRO2zSUSw9Pbb7a+R4SE2PMX6lfiqKI + YVohfQuSQmAGnIED0FmirwCWXwFT0Vmij4BbLkos8rvhUE7ECmjlRC3xCwGpfAecnKyUgNJXSgGtHH8t + fvMklvltziUgs+7sIhAq5zNBCTjzO1sLSOVbQPrHByXg3ZpvI9ClnFAl4GnNNgnElBOiBGDthgT6lBON + EppAinIiKCEJpCwnVAlJ4MKGkL7lhCSxlwRWwIcNpSgnUILufQOZJICgxAbAQX4BQZc0oe0egQzPmgAf + drMyfz7WQXDG2al3+dkT4NCwlEulHJxx9xAt9wJkFBgFQgJtcPcQLfcCpLpI/BbLKBAjkBy3B/GCoRHD + IRHD4TCTL7ccmUyvvNxMAAAAAElFTkSuQmCC + + AAABAAoAMDAQAAEABABoBgAApgAAACAgEAABAAQA6AIAAA4HAAAQEBAAAQAEACgBAAD2CQAAMDAAAAEA diff --git a/EDMI_ClientSuite/frmConfigUser.vb b/EDMI_ClientSuite/frmConfigUser.vb new file mode 100644 index 00000000..33b04302 --- /dev/null +++ b/EDMI_ClientSuite/frmConfigUser.vb @@ -0,0 +1,24 @@ +Imports System.IO +Imports DigitalData.Modules.Logging +Public Class frmConfigUser + Private _Logger As Logger + + Private Sub LinkLabel1_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles LinkLabel1.LinkClicked + ' Specify that the link was visited. + Me.LinkLabel1.LinkVisited = True + ' Navigate to a URL. + System.Diagnostics.Process.Start("http://www.didalog.de/Support") + End Sub + + Private Sub frmUserBasics_Load(sender As Object, e As EventArgs) Handles Me.Load + _Logger = My.LogConfig.GetLogger() + End Sub + + Private Sub btnLogFolder_Click(sender As Object, e As EventArgs) Handles btnLogFolder.Click + Process.Start(My.LogConfig.LogDirectory) + End Sub + + Private Sub btnAppFolder_Click(sender As Object, e As EventArgs) Handles btnAppFolder.Click + Process.Start(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)) + End Sub +End Class \ No newline at end of file diff --git a/EDMI_ClientSuite/frmMain.vb b/EDMI_ClientSuite/frmMain.vb index ec4f7169..7237e462 100644 --- a/EDMI_ClientSuite/frmMain.vb +++ b/EDMI_ClientSuite/frmMain.vb @@ -14,15 +14,6 @@ Public Class frmMain ' Dieser Aufruf ist für den Designer erforderlich. InitializeComponent() - ' Fügen Sie Initialisierungen nach dem InitializeComponent()-Aufruf hinzu. - - ' Initialize Logger - Dim oLogConfig As New LogConfig(PathType.AppData) - _Logger = oLogConfig.GetLogger() - - ' This sets the LogConfig object that is used in the WHOLE application!! - My.LogConfig = oLogConfig - ' Show splashscreen frmSplash.ShowDialog() End Sub @@ -86,7 +77,7 @@ Public Class frmMain End Sub Private Sub BarButtonUserSettings_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonUserSettings.ItemClick - Dim frm As New frmUserBasics() + Dim frm As New frmConfigUser() frm.MdiParent = DocumentManager.MdiParent frm.Show() End Sub @@ -111,7 +102,7 @@ Public Class frmMain End Sub Private Sub BarButtonConnectionSettings_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonConnectionSettings.ItemClick - Dim frm As New frmServiceConfig() + Dim frm As New frmConfigService() frm.MdiParent = DocumentManager.MdiParent frm.Show() End Sub diff --git a/EDMI_ClientSuite/frmSplash.vb b/EDMI_ClientSuite/frmSplash.vb index fb9db005..678e65b8 100644 --- a/EDMI_ClientSuite/frmSplash.vb +++ b/EDMI_ClientSuite/frmSplash.vb @@ -29,7 +29,7 @@ Public NotInheritable Class frmSplash Dim oConnectionURLExists = oInit.TestConnectionURLExists If Not oConnectionURLExists Then - Dim oResult = frmServiceConfig.ShowDialog() + Dim oResult = frmConfigService.ShowDialog() If oResult = DialogResult.Cancel Then MsgBox("Es wurde keine Dienst Verbindungsurl hinterlegt. Die Anwendung wird beendet.") diff --git a/EDMI_ClientSuite/frmUserBasics.vb b/EDMI_ClientSuite/frmUserBasics.vb deleted file mode 100644 index bbcfe1a8..00000000 --- a/EDMI_ClientSuite/frmUserBasics.vb +++ /dev/null @@ -1,27 +0,0 @@ -Imports System.IO -Imports DigitalData.Modules.Logging -Public Class frmUserBasics - Private _Logger As Logger - Private _MyLogger As LogConfig - Private Sub LinkLabel1_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles LinkLabel1.LinkClicked - ' Specify that the link was visited. - Me.LinkLabel1.LinkVisited = True - ' Navigate to a URL. - System.Diagnostics.Process.Start("http://www.didalog.de/Support") - End Sub - - Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click - - End Sub - - Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click - Process.Start(_MyLogger.LogDirectory) - End Sub - - Private Sub frmUserBasics_Load(sender As Object, e As EventArgs) Handles Me.Load - Dim oUserAppdata = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "Digital Data\EDMI_Client_Suite\Log") - - _MyLogger = New LogConfig(LogConfig.PathType.CustomPath, oUserAppdata) - _Logger = _MyLogger.GetLogger() - End Sub -End Class \ No newline at end of file From d35a29e3db44ed860d03902e164884e336d6d2c3 Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Thu, 31 Jan 2019 16:58:47 +0100 Subject: [PATCH 06/23] jj --- EDMI_ClientSuite/EDMI_ClientSuite.vbproj | 12 ++-- .../frmEntityDesigner.Designer.vb | 39 +++++++---- EDMI_ClientSuite/License/LicenseSchema.xsd | 51 ++++++++++++++ .../{Settings => State}/LicenseState.vb | 0 .../{Settings => State}/ModuleState.vb | 0 .../{Settings => State}/UserState.vb | 2 +- EDMI_ClientSuite/frmConfigService.Designer.vb | 6 +- EDMI_ClientSuite/frmConfigService.vb | 9 +-- EDMI_ClientSuite/frmConfigUser.Designer.vb | 14 +++- EDMI_ClientSuite/frmConfigUser.resx | 9 +++ EDMI_ClientSuite/frmConfigUser.vb | 8 ++- EDMI_ClientSuite/frmMain.Designer.vb | 15 ++-- EDMI_ClientSuite/frmMain.resx | 68 +++++++------------ 13 files changed, 154 insertions(+), 79 deletions(-) create mode 100644 EDMI_ClientSuite/License/LicenseSchema.xsd rename EDMI_ClientSuite/{Settings => State}/LicenseState.vb (100%) rename EDMI_ClientSuite/{Settings => State}/ModuleState.vb (100%) rename EDMI_ClientSuite/{Settings => State}/UserState.vb (92%) diff --git a/EDMI_ClientSuite/EDMI_ClientSuite.vbproj b/EDMI_ClientSuite/EDMI_ClientSuite.vbproj index 600387f7..a8ec9152 100644 --- a/EDMI_ClientSuite/EDMI_ClientSuite.vbproj +++ b/EDMI_ClientSuite/EDMI_ClientSuite.vbproj @@ -13,6 +13,7 @@ WindowsForms v4.6.1 true + false publish\ true Disk @@ -25,7 +26,6 @@ true 0 1.0.0.%2a - false false true @@ -132,6 +132,7 @@ + @@ -263,9 +264,9 @@ True - - - + + + True True @@ -365,6 +366,9 @@ Designer + + Designer + MyApplicationCodeGenerator diff --git a/EDMI_ClientSuite/EntityDesigner/frmEntityDesigner.Designer.vb b/EDMI_ClientSuite/EntityDesigner/frmEntityDesigner.Designer.vb index ba5b306a..4885b865 100644 --- a/EDMI_ClientSuite/EntityDesigner/frmEntityDesigner.Designer.vb +++ b/EDMI_ClientSuite/EntityDesigner/frmEntityDesigner.Designer.vb @@ -22,15 +22,17 @@ Partial Class frmEntityDesigner 'Das Bearbeiten mit dem Code-Editor ist nicht möglich. Private Sub InitializeComponent() - Me.PanelMain = New EDMI_ClientSuite.ControlSnapPanel() + Me.components = New System.ComponentModel.Container() + Me.PanelMain = New EDMI_ClientSuite.ControlSnapPanel(Me.components) Me.TabControlMain = New DevExpress.XtraTab.XtraTabControl() Me.TabPageControls = New DevExpress.XtraTab.XtraTabPage() + 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.btnCombobox = New System.Windows.Forms.Button() + Me.Label1 = New System.Windows.Forms.Label() CType(Me.TabControlMain, System.ComponentModel.ISupportInitialize).BeginInit() Me.TabControlMain.SuspendLayout() Me.TabPageControls.SuspendLayout() @@ -63,6 +65,7 @@ Partial Class frmEntityDesigner ' '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) @@ -70,20 +73,29 @@ Partial Class frmEntityDesigner Me.TabPageControls.Size = New System.Drawing.Size(222, 425) Me.TabPageControls.Text = "Controls" ' + '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(15, 48) + Me.btnTextbox.Location = New System.Drawing.Point(3, 63) Me.btnTextbox.Name = "btnTextbox" - Me.btnTextbox.Size = New System.Drawing.Size(122, 23) + 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(15, 19) + Me.btnLabel.Location = New System.Drawing.Point(3, 34) Me.btnLabel.Name = "btnLabel" - Me.btnLabel.Size = New System.Drawing.Size(122, 23) + Me.btnLabel.Size = New System.Drawing.Size(216, 23) Me.btnLabel.TabIndex = 0 Me.btnLabel.Text = "Label" Me.btnLabel.UseVisualStyleBackColor = True @@ -118,14 +130,14 @@ Partial Class frmEntityDesigner Me.SplitContainerControlMain.TabIndex = 1 Me.SplitContainerControlMain.Text = "SplitContainerControl1" ' - 'btnCombobox + 'Label1 ' - Me.btnCombobox.Location = New System.Drawing.Point(15, 77) - Me.btnCombobox.Name = "btnCombobox" - Me.btnCombobox.Size = New System.Drawing.Size(122, 23) - Me.btnCombobox.TabIndex = 1 - Me.btnCombobox.Text = "Combobox" - Me.btnCombobox.UseVisualStyleBackColor = True + 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" ' 'frmEntityDesigner ' @@ -154,4 +166,5 @@ Partial Class frmEntityDesigner Friend WithEvents btnLabel As Button Friend WithEvents SplitContainerControlMain As DevExpress.XtraEditors.SplitContainerControl Friend WithEvents btnCombobox As Button + Friend WithEvents Label1 As Label End Class diff --git a/EDMI_ClientSuite/License/LicenseSchema.xsd b/EDMI_ClientSuite/License/LicenseSchema.xsd new file mode 100644 index 00000000..83b3b7be --- /dev/null +++ b/EDMI_ClientSuite/License/LicenseSchema.xsd @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/EDMI_ClientSuite/Settings/LicenseState.vb b/EDMI_ClientSuite/State/LicenseState.vb similarity index 100% rename from EDMI_ClientSuite/Settings/LicenseState.vb rename to EDMI_ClientSuite/State/LicenseState.vb diff --git a/EDMI_ClientSuite/Settings/ModuleState.vb b/EDMI_ClientSuite/State/ModuleState.vb similarity index 100% rename from EDMI_ClientSuite/Settings/ModuleState.vb rename to EDMI_ClientSuite/State/ModuleState.vb diff --git a/EDMI_ClientSuite/Settings/UserState.vb b/EDMI_ClientSuite/State/UserState.vb similarity index 92% rename from EDMI_ClientSuite/Settings/UserState.vb rename to EDMI_ClientSuite/State/UserState.vb index b43dddbb..c9b8360c 100644 --- a/EDMI_ClientSuite/Settings/UserState.vb +++ b/EDMI_ClientSuite/State/UserState.vb @@ -7,7 +7,7 @@ Public Class UserState Public UserName As String Public MachineName As String Public Language As String - + Public IsAdmin As Boolean ''' ''' Initialize user object with values that can be read from the environment diff --git a/EDMI_ClientSuite/frmConfigService.Designer.vb b/EDMI_ClientSuite/frmConfigService.Designer.vb index 907c4d8f..5404985e 100644 --- a/EDMI_ClientSuite/frmConfigService.Designer.vb +++ b/EDMI_ClientSuite/frmConfigService.Designer.vb @@ -117,9 +117,9 @@ Partial Class frmConfigService Me.txtPort.Size = New System.Drawing.Size(145, 20) Me.txtPort.TabIndex = 7 ' - 'frmServiceConfig + 'frmConfigService ' - Me.AcceptButton = Me.btnTest + Me.AcceptButton = Me.btnOK Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.CancelButton = Me.btnCancel @@ -135,7 +135,7 @@ Partial Class frmConfigService Me.Controls.Add(Me.btnCancel) Me.MaximizeBox = False Me.MinimizeBox = False - Me.Name = "frmServiceConfig" + Me.Name = "frmConfigService" Me.Text = "Dienst Kommunikation konfigurieren" CType(Me.txtIPAddress.Properties, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.txtPort.Properties, System.ComponentModel.ISupportInitialize).EndInit() diff --git a/EDMI_ClientSuite/frmConfigService.vb b/EDMI_ClientSuite/frmConfigService.vb index 791f99f7..ad9b758e 100644 --- a/EDMI_ClientSuite/frmConfigService.vb +++ b/EDMI_ClientSuite/frmConfigService.vb @@ -5,6 +5,8 @@ Public Class frmConfigService Private Sub frmServiceConfig_Load(sender As Object, e As EventArgs) Handles Me.Load _Init = New ClassInit() + + txtIPAddress.Focus() End Sub Private Async Sub btnTest_Click(sender As Object, e As EventArgs) Handles btnTest.Click @@ -17,8 +19,8 @@ Public Class frmConfigService oResult = Await _Init.TestConnectionAsync(oEndpointURL) If oResult = ConnectionTestResult.Successful Then + ' Save Endpoint URL My.Settings.ICMServiceAddress = oEndpointURL - 'My.Settings.Save() lblStatus.Text = "Verbindung hergestellt." Else Select Case oResult @@ -30,8 +32,7 @@ Public Class frmConfigService End If End Sub - Private Sub btnDelete_Click(sender As Object, e As EventArgs) - My.Settings.ICMServiceAddress = String.Empty - My.Settings.Save() + Private Sub btnOK_Click(sender As Object, e As EventArgs) Handles btnOK.Click + DialogResult = DialogResult.OK End Sub End Class \ No newline at end of file diff --git a/EDMI_ClientSuite/frmConfigUser.Designer.vb b/EDMI_ClientSuite/frmConfigUser.Designer.vb index a2dcc3e0..94f24f2a 100644 --- a/EDMI_ClientSuite/frmConfigUser.Designer.vb +++ b/EDMI_ClientSuite/frmConfigUser.Designer.vb @@ -24,6 +24,7 @@ Partial Class frmConfigUser Private Sub InitializeComponent() Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmConfigUser)) Me.TabPageSupport = New DevExpress.XtraTab.XtraTabPage() + Me.SimpleButton1 = New DevExpress.XtraEditors.SimpleButton() Me.btnAppFolder = New DevExpress.XtraEditors.SimpleButton() Me.btnLogFolder = New DevExpress.XtraEditors.SimpleButton() Me.Button4 = New System.Windows.Forms.Button() @@ -42,6 +43,7 @@ Partial Class frmConfigUser ' 'TabPageSupport ' + Me.TabPageSupport.Controls.Add(Me.SimpleButton1) Me.TabPageSupport.Controls.Add(Me.btnAppFolder) Me.TabPageSupport.Controls.Add(Me.btnLogFolder) Me.TabPageSupport.Controls.Add(Me.Button4) @@ -52,9 +54,18 @@ Partial Class frmConfigUser Me.TabPageSupport.Size = New System.Drawing.Size(703, 448) Me.TabPageSupport.Text = "Support" ' + 'SimpleButton1 + ' + Me.SimpleButton1.ImageOptions.Image = CType(resources.GetObject("SimpleButton1.ImageOptions.Image"), System.Drawing.Image) + Me.SimpleButton1.Location = New System.Drawing.Point(349, 100) + Me.SimpleButton1.Name = "SimpleButton1" + Me.SimpleButton1.Size = New System.Drawing.Size(164, 36) + Me.SimpleButton1.TabIndex = 21 + Me.SimpleButton1.Text = "AppData Ordner öffnen" + ' 'btnAppFolder ' - Me.btnAppFolder.ImageOptions.Image = CType(resources.GetObject("SimpleButton1.ImageOptions.Image"), System.Drawing.Image) + Me.btnAppFolder.ImageOptions.Image = CType(resources.GetObject("btnAppFolder.ImageOptions.Image"), System.Drawing.Image) Me.btnAppFolder.Location = New System.Drawing.Point(349, 58) Me.btnAppFolder.Name = "btnAppFolder" Me.btnAppFolder.Size = New System.Drawing.Size(164, 36) @@ -186,4 +197,5 @@ Partial Class frmConfigUser Friend WithEvents cmbLanguage As ComboBox Friend WithEvents btnLogFolder As DevExpress.XtraEditors.SimpleButton Friend WithEvents btnAppFolder As DevExpress.XtraEditors.SimpleButton + Friend WithEvents SimpleButton1 As DevExpress.XtraEditors.SimpleButton End Class diff --git a/EDMI_ClientSuite/frmConfigUser.resx b/EDMI_ClientSuite/frmConfigUser.resx index 3ee5ee40..8540ece9 100644 --- a/EDMI_ClientSuite/frmConfigUser.resx +++ b/EDMI_ClientSuite/frmConfigUser.resx @@ -125,6 +125,15 @@ Ym9uO1N0YW5kYXJkO0xvYWTxw8RjAAAAb0lEQVQ4T6XQ0Q2AIAwEUBbsMs7Q0ZzHFeqVRIJ6VQof7+fC XUiLmS2hYQYNM4qqChjhOS31fICVL8JKvb+BSBueHUB3cQCGB+oxmWjgVjj2TcAC8hzwx1+Fl34gXYb2 g6ky1BtMl1295AoajrNyArCYwjN4ThJYAAAAAElFTkSuQmCC + + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m + dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAArdEVYdFRpdGxlAE9wZW47Rm9sZGVyO0JhcnM7Umli + Ym9uO1N0YW5kYXJkO0xvYWTxw8RjAAAAb0lEQVQ4T6XQ0Q2AIAwEUBbsMs7Q0ZzHFeqVRIJ6VQof7+fC + XUiLmS2hYQYNM4qqChjhOS31fICVL8JKvb+BSBueHUB3cQCGB+oxmWjgVjj2TcAC8hzwx1+Fl34gXYb2 + g6ky1BtMl1295AoajrNyArCYwjN4ThJYAAAAAElFTkSuQmCC diff --git a/EDMI_ClientSuite/frmConfigUser.vb b/EDMI_ClientSuite/frmConfigUser.vb index 33b04302..44537f4f 100644 --- a/EDMI_ClientSuite/frmConfigUser.vb +++ b/EDMI_ClientSuite/frmConfigUser.vb @@ -1,4 +1,5 @@ -Imports System.IO +Imports System.Configuration +Imports System.IO Imports DigitalData.Modules.Logging Public Class frmConfigUser Private _Logger As Logger @@ -21,4 +22,9 @@ Public Class frmConfigUser Private Sub btnAppFolder_Click(sender As Object, e As EventArgs) Handles btnAppFolder.Click Process.Start(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)) End Sub + + Private Sub SimpleButton1_Click(sender As Object, e As EventArgs) Handles SimpleButton1.Click + Dim config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.PerUserRoamingAndLocal) + MessageBox.Show(config.FilePath) + End Sub End Class \ No newline at end of file diff --git a/EDMI_ClientSuite/frmMain.Designer.vb b/EDMI_ClientSuite/frmMain.Designer.vb index 8efedc74..c667e950 100644 --- a/EDMI_ClientSuite/frmMain.Designer.vb +++ b/EDMI_ClientSuite/frmMain.Designer.vb @@ -35,6 +35,7 @@ Partial Class frmMain Me.BarButtonDashboard = New DevExpress.XtraBars.BarButtonItem() Me.BarButtonEntityDesigner = New DevExpress.XtraBars.BarButtonItem() Me.BarButtonDeleteControl = New DevExpress.XtraBars.BarButtonItem() + Me.LabelCurrentLanguage = New DevExpress.XtraBars.BarStaticItem() Me.RibbonPageCategoryEntityDesigner = New DevExpress.XtraBars.Ribbon.RibbonPageCategory() Me.RibbonPageControlActions = New DevExpress.XtraBars.Ribbon.RibbonPage() Me.RibbonPageGroup5 = New DevExpress.XtraBars.Ribbon.RibbonPageGroup() @@ -56,7 +57,6 @@ Partial Class frmMain Me.DockPanelProcessManager = New DevExpress.XtraBars.Docking.DockPanel() Me.DockPanel2_Container = New DevExpress.XtraBars.Docking.ControlContainer() Me.ProcessManagerOverview = New EDMI_ClientSuite.ProcessManagerOverview() - Me.LabelCurrentLanguage = New DevExpress.XtraBars.BarStaticItem() CType(Me.RibbonControl, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.MainMenu, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.DocumentManager, System.ComponentModel.ISupportInitialize).BeginInit() @@ -117,6 +117,7 @@ Partial Class frmMain Me.LabelCurrentUser.Caption = "Current User" Me.LabelCurrentUser.Id = 3 Me.LabelCurrentUser.ImageOptions.Image = CType(resources.GetObject("LabelCurrentUser.ImageOptions.Image"), System.Drawing.Image) + Me.LabelCurrentUser.ImageOptions.LargeImage = CType(resources.GetObject("LabelCurrentUser.ImageOptions.LargeImage"), System.Drawing.Image) Me.LabelCurrentUser.Name = "LabelCurrentUser" ' 'LabelCurrentMachine @@ -175,6 +176,12 @@ Partial Class frmMain Me.BarButtonDeleteControl.ImageOptions.LargeImage = CType(resources.GetObject("BarButtonDeleteControl.ImageOptions.LargeImage"), System.Drawing.Image) Me.BarButtonDeleteControl.Name = "BarButtonDeleteControl" ' + 'LabelCurrentLanguage + ' + Me.LabelCurrentLanguage.Caption = "BarStaticItem1" + Me.LabelCurrentLanguage.Id = 15 + Me.LabelCurrentLanguage.Name = "LabelCurrentLanguage" + ' 'RibbonPageCategoryEntityDesigner ' Me.RibbonPageCategoryEntityDesigner.AutoStretchPageHeaders = True @@ -341,12 +348,6 @@ Partial Class frmMain Me.ProcessManagerOverview.Size = New System.Drawing.Size(337, 163) Me.ProcessManagerOverview.TabIndex = 0 ' - 'LabelCurrentLanguage - ' - Me.LabelCurrentLanguage.Caption = "BarStaticItem1" - Me.LabelCurrentLanguage.Id = 15 - Me.LabelCurrentLanguage.Name = "LabelCurrentLanguage" - ' 'frmMain ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) diff --git a/EDMI_ClientSuite/frmMain.resx b/EDMI_ClientSuite/frmMain.resx index 38fec89d..dc362ec9 100644 --- a/EDMI_ClientSuite/frmMain.resx +++ b/EDMI_ClientSuite/frmMain.resx @@ -244,51 +244,29 @@ - iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAADJ0RVh0VGl0 - bGUAQ3VzdG9tZXI7RW1wbG95ZWU7UGVyc29uO0NvbnRhY3Q7VXNlcjtDbGllbnR+ETboAAAJ8ElEQVRY - R8WWd1RU1xbGr0ls0agpdnqPjIJIr4qIAwhqpAQR6VWkhSKDVEFGCBa6gPQiA1ICCEaNj6IRQQ3qA6LE - FhOfRo1kJZqXqF/2GYKatUjWW4s/3l7rN3fmnnv2t/c++5w7HID/K+PefJ1GH21Cl2vdbsCdCDPmOqNN - +WcT1+7v223Zcz7F8k5vsgXOxK95fCrSuK8tULepwWu57eGtqlOqnFS4is3K4/p8nXFvjsGs3kuLq/fU - XNrordXSuk33eWeMMa4UbcXd03vx6FIxnt6uw8PzqbjZGoSL2dZoDVyGCkfFh6X2CtoldnJiH+P5HmPc - m2Mwq3NfvrjJX2fkSslWXMo0IrEs/HKrAb/cEOGn4Qr8dLUUIwO5eNATjYc9sbhW7YiOnWoodZR7cnCD - pOGEA6hxWZrSnWKB6w0e6Ihagvs9qXhw/gAe9O3FD+fScP/LFPynKw63W/0IX9xs8sKpYAWU2C/CXrP3 - uiYcQMVmlWsXsm1wIdMC1c6SaIvQxPXGbbjZHILrTYG4JvLEYLE9Bg5twhWiJ9kQx/1lUWq3CHtWzXk2 - 4QCK7RSe9aatwWdBaijatBCiQGOUOcrgRMQKdMXp4XSiEU5F66I9VAMiNwUc9ZBGi5sUiunZZONZYifj - +R5j3JtjMMtbL/nfE5R1hZMMsjdK47fHg2gTumGv+fvIspyLPOt5yLGahzTT97BTdxa8VabhyMeLUWgz - H/H6M59MOIAMiwW36jyVSWQuCW8Ffr0O/NyLO+cK0S7chJzNSthnK48ifw3UClairyYKu1fOfp5jMRfR - 2tO/JheTxvM9xrg3x2AmNH2vodhBmjJ8FzfOlANPh4GfOoCRL4AfPwdupeLFdSFGvtyOH7v88KgvFQLt - 6chctwDhK6Y2TjiAWP2ZbunmHyDJZBae/zwIPLkKPDoxKv6IuJGMF9fi8eCkB+610fnwRTiitN9Gosls - BKq95TPhAIwlJk9J5S98nuMghWePz1MAFMTDtlEeNAFfx+PZvwW42+yAOw22uN3shRi92QjTnP5CZ/4b - MyccANmb9cErB9tijfDkDmX8ywAJHwV+aAa+LwOGovBrbyBui6xxo9oGgxWOSOPLYhdfjq3/ZOKfA/gf - 7I0CV22XGn/e73fPZlIDXqYAjgH364HhPcCVcGoHF3xTaorhciucTrdAnN7s30KMJL1orjgAsZe/s/ii - lWJSKvhcQYvrX/jT3iBm5DvLZ12p9qfSn6Ls24Fv9gOXgoH+YHwnssJQrh6ullmgMVQLgUun7aM57xJv - EZN2ZBtykURElgEXnqHPfXKAoUdDZGMB7K/d9HcBsAymCcwXWjRHGlDZq6jz84GLAcQ2/NrtjuECQwzm - 6GGoyIy6fxFsZCavpTls/VnwXFimARdGgqH79biQfXpccLouF/SpLht6FUBOo9M/BcBK+X7m+oVf3e1M - Ar4rw4v+T/BbtwvuivgYytHGUKEpulMMINCYdoGeXURMJcQBvBLV4ban6XABqdrcNqE2G3oVQG7TFu7W - yGExt0eqicOjD4wG8Cbxjq/WbHvRdl38fqMITy8l4V6dFW5VmNH6r8VA4Spkb1iMddKTP6Zn3yfE5Se4 - 0tN2XMlpW66oeyNX1LWB89utyfkka7Kh1yrQ5MTdfFw1ykglXStGH3gVwNs7AlYFp9jyUOWjhastsXh4 - bg9uN7nh7D4zFDjIIsRwPjasFjffLOJlAxZ3f0TiG7hDneu5wk5rzitRg/NM0GBDHBd3yISLK1zJHaiz - 5755VMZdZ/xYyobY5DHxqfGJlublyVued1RFIHOLOpJNPsAu3ZnEDOwynAOhpQSy3HkQ2Ko8s7OTX0Nz - ZhAsCDZ/UmGnDVfQsY7LJ9xi1TnXnWp0mywm34Qw5oQV67jhh4fYLSbK1o6VcEpkOl9rd8nGytx61+cD - ZzJxn/4FXRBFoSp0NQ56aCHPVR1FnstxJEQPbTv0kU9vxZA0/d9dBGrlli6KWuSDNSPrB+aP+Z3kLFjG - bYlaSl/JBHlGnCDXiH19XXhqeLq56a4im6NZ9VvQflGAwft5qDsZgGE6C+715WCwUYAz2S7oSrfFv/ZY - 44tEc3oZGcAvSh2VXzohpcYMfkItOIbzWvku8pbkczYx/U//kz4O49GFjO1Pspeljty31jah0PpcDgkf - 749G/9009N6JReeN7ThxzRt5LZvQUOuLnsYIXG2MxIVCdzQKrSCM0YdXvAZyj1ti7zEdpDRrYG+7ERKq - jOCTrAH7YNVe860KzqTBAplCiHcIF0YHA9mb0spzZgSl6dfmNDjj5OWdOP/tbnTfDMexr13QMmCP5gFb - ujrg2JALyjvskFrDR1iGAQL26CAi2xDJlabIP8VH2lEtJDbyEFu3BNEiFcSIVJHcqInYch14Jqljnbdy - DemxQ4oFwRIXf0zxjNUIFlZbovWKHz4f9EfTZQcc6V+POjE2hDVqv7KC6KIV6i99hKZLDvjsshMa+h1R - 0m2JjOPGSP5sGRLqeYip/RCCw8rYUamEyApFhJcrIKJCGTureXBN4GGlvUwAabLeYFUXl+Jt32TN/pKO - zSjs4mPfcW0Un1mNyj4+KnvXooqo7F2D8l4zlPWsRunZVSg6bYLcDn2kHtVAUtMyJJJwbC1lXaOMqCol - ElREWJkCPimRR0gxbdEiWYQWySEgUxl8d4UzpMnOCrZLxFHM8tm14mlNjzPS27Wxp2050to1cOCkDokY - Ir/LCIXdxnQ1RM4pPWSc0KFSa1BplyLhCA9xoiXYeVgFUZRxRDkJl8ojtFhOLBpUKIPAAhlsz5cipBF8 - UAkWngoPSHMhwZZB3JVz3OOW4zAFsLtFjVCHkK6MlFZ1pNDvlGba+1TipKal4mzjaY1jSFhQrUKlpjKL - syVREmaiQWJRaQQclMK2XEn45RDZEgjKU8Bad/mfSXMxwbbnaAW2RqshscyMnPKQ0KCKBGokJpTQQFCW - 8UdUxSWOqfkQ0STKso18mS2V+RBl+xdRKfjnSMCXRH2zJOCTuRge6RJwipMD31OB/RFYQIgrwHpg+ip7 - WeP1fipZ9qGq3ztFqcI1fgk8hUuwLeNDKpsKQgqUEZyvhMA8JQQdVEAYW1taU3GJ82XgmyEDz3RpeHwq - Dfc0KbgIJeEULw3bCBlsCJaFlZ881rjK3zO0lTrEM55nQZrsuGbVf3kGTCPYHp3LM5i3wnCj1GbTzbIx - Fu6KIktvpR4rb8UBSy/FQYp+0MJT8dt1vkqw8lGEpbciLLwUYO4mf8fMRW5ojNXOsn0mDtINutYSSeqr - F3jI8Oaw006amEe8Q4y+K+xCVTm7kCX0/eUpyMrCTiy2TVhArFvZpPkEaxz2qpUgpAjmcAz2W/JP2Dhb - YzbnA2IOwfwxv8w/S5gS57g/AGl5Af+OTEZOAAAAAElFTkSuQmCC + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAAAMnRFWHRUaXRsZQBDdXN0b21l + cjtFbXBsb3llZTtQZXJzb247Q29udGFjdDtVc2VyO0NsaWVudH4RNugAAADNSURBVDhPpdExDkFBFAXQ + X4jeMkg0Kir03xrsRaWxCIuQ6EXCGv4KqL8CkXGvzLzMPP8xoTgymXffDaZwzv3l9TFbbLUh7OHiHWAM + Sc4qaMEJnHKGNkjWKuiCXg56IFmrYAJNyzQFyVoFS2haJs4kaxWM4AF6mXf8cyVrFdAOdAHvktynAj7Z + DcIyz9nPGMzh6PH8lrEKOrCC+M155h1nktUFA9jAHfi119D3eOYdZ8wwmxSUcIXwm79htowLqmiYq4oL + ajXMUUvB71zxBKd8P7UB7yhRAAAAAElFTkSuQmCC + + + + + iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAAAMnRFWHRUaXRsZQBDdXN0b21l + cjtFbXBsb3llZTtQZXJzb247Q29udGFjdDtVc2VyO0NsaWVudH4RNugAAAH4SURBVFhHxdaxS1VhGMdx + QRcHh8BoVWppyL3VEApsCPpjoiFCF8FddHEPGhqFXGxVgoiGIAIlR7FoMEg4/n6H8xze571frw7e6/BZ + 3vO8z/fcex2caJrmVg0cPF/ZuY5leSe/5H/nWN7LC6E7SfRS3Gi4siHNFbaF7vail+JGw4WnQkHyUmhH + K3opbjRc8NdOMfJBaEcreiluNFz4LhQjP4R2tKKX4kbDhb9CMfJbaEcreiluNFyg0GX+Ce1oRS/FjYY7 + i0KhYXyHdvW9FDca7mwKRYbxHdrV91LcaLizJhQZxndoV99LcaPhzn05EQoRz/oO7ep7KW40XHgjFCOv + hHa0opfiRsOFR0Ix4lna0YpeihsNVz4KBUu7Qnd70Utxo+HKgpwJhc3PPEN3e9FLcaNh8ExOpY7/ET+j + O0n0Utxo+BJ35bX4J/kkb+We0OyA6KW40XBlEs5qU3CWRC/FjYYLj+WzPCjOav7r/yKepeet6KW4wfCc + rMg3id96T6alnp2RA4k531mVeUmz0UtxK4buyJb4/71YWNqXJ+Kv25bkq9Csd3iXd17rBR7KT6FltfMO + Pat5p3f3vRQ3PZyVQ6EFN8G7Z6NHL7BeDI/KevToBUb56cNh9OgF6MKNix69wFE9PAJH0Rt4gXHDw3HC + w3HCw/FpJi4ACnRMQSftMegAAAAASUVORK5CYII= From c93c270e89ff285d30254b6d297fa44b89e929d7 Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Fri, 1 Feb 2019 11:07:21 +0100 Subject: [PATCH 07/23] jj: licensestate --- EDMI_ClientSuite/State/LicenseState.vb | 26 ++++++++++++++++++++++---- EDMI_ClientSuite/State/ModuleState.vb | 7 ------- 2 files changed, 22 insertions(+), 11 deletions(-) delete mode 100644 EDMI_ClientSuite/State/ModuleState.vb diff --git a/EDMI_ClientSuite/State/LicenseState.vb b/EDMI_ClientSuite/State/LicenseState.vb index 0e830809..f96b306d 100644 --- a/EDMI_ClientSuite/State/LicenseState.vb +++ b/EDMI_ClientSuite/State/LicenseState.vb @@ -1,7 +1,25 @@ Public Class LicenseState - Public Modules As List(Of ModuleState) + Public Modules As List(Of LicenseModule) +End Class + +Public Class LicenseModule + Public Name As String + Public ValidUntil As Date + Public Users As List(Of LicenseUser) +End Class - Public Sub New() - Modules = New List(Of ModuleState) - End Sub +Public Class LicenseUser + Public Type As UserType + Public Count As Integer + Public Test As Boolean + Public ValidUntil As Date End Class + +Public Enum UserType + PowerUser + [ReadOnly] + [WriteOnly] + ReadWrite +End Enum + + diff --git a/EDMI_ClientSuite/State/ModuleState.vb b/EDMI_ClientSuite/State/ModuleState.vb deleted file mode 100644 index b7d16406..00000000 --- a/EDMI_ClientSuite/State/ModuleState.vb +++ /dev/null @@ -1,7 +0,0 @@ -Public Class ModuleState - Public Name As String - - Public Sub New(Name As String) - Me.Name = Name - End Sub -End Class From e6914c6596db083e116b64a25fc621cecb8466f9 Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Fri, 1 Feb 2019 16:30:31 +0100 Subject: [PATCH 08/23] jj --- DDLicenseService/DDEDMLicenseService.vbproj | 144 ++++++ DDLicenseService/ILicenseService.vb | 10 + DDLicenseService/LicenseService.vb | 14 + .../My Project/Application.Designer.vb | 13 + DDLicenseService/My Project/Application.myapp | 10 + DDLicenseService/My Project/AssemblyInfo.vb | 35 ++ .../My Project/Resources.Designer.vb | 63 +++ DDLicenseService/My Project/Resources.resx | 117 +++++ .../My Project/Settings.Designer.vb | 73 +++ DDLicenseService/My Project/Settings.settings | 7 + DDLicenseService/ProjectInstaller.vb | 24 + .../Session.vb | 0 DDLicenseService/SettingsModule.vb | 4 + DDLicenseService/WindowsService.vb | 72 +++ DDLicenseService/app.config | 28 ++ DDLicenseService/packages.config | 4 + DDMonorepo.sln | 7 + EDMI_ClientSuite/EDMI_ClientSuite.vbproj | 5 +- EDMI_ClientSuite/License/LicenseSchema.vb | 201 ++++++++ EDMI_ClientSuite/MyApplication.vb | 1 - EDMI_ClientSuite/State/LicenseState.vb | 25 - .../ControlProperties.Designer.vb | 463 ------------------ .../ControlProperties.en.Designer.vb | 0 .../_Skpokpotrings/ControlProperties.en.resx | 252 ---------- .../_Skpokpotrings/ControlProperties.resx | 252 ---------- EDMI_ClientSuite/frmMain.Designer.vb | 13 +- EDMI_ClientSuite/frmMain.resx | 38 +- EDMI_ClientSuite/frmMain.vb | 40 ++ SERVICES/DDEDM_NetworkService/App.config | 38 +- .../DDEDM_NetworkService/DDEDMService.vbproj | 40 +- SERVICES/DDEDM_NetworkService/EDMService.vb | 12 - ...EDMWindowsService.vb => WindowsService.vb} | 4 +- SERVICES/DDEDM_NetworkService/packages.config | 5 + 33 files changed, 947 insertions(+), 1067 deletions(-) create mode 100644 DDLicenseService/DDEDMLicenseService.vbproj create mode 100644 DDLicenseService/ILicenseService.vb create mode 100644 DDLicenseService/LicenseService.vb create mode 100644 DDLicenseService/My Project/Application.Designer.vb create mode 100644 DDLicenseService/My Project/Application.myapp create mode 100644 DDLicenseService/My Project/AssemblyInfo.vb create mode 100644 DDLicenseService/My Project/Resources.Designer.vb create mode 100644 DDLicenseService/My Project/Resources.resx create mode 100644 DDLicenseService/My Project/Settings.Designer.vb create mode 100644 DDLicenseService/My Project/Settings.settings create mode 100644 DDLicenseService/ProjectInstaller.vb rename {SERVICES/DDEDM_NetworkService => DDLicenseService}/Session.vb (100%) create mode 100644 DDLicenseService/SettingsModule.vb create mode 100644 DDLicenseService/WindowsService.vb create mode 100644 DDLicenseService/app.config create mode 100644 DDLicenseService/packages.config create mode 100644 EDMI_ClientSuite/License/LicenseSchema.vb delete mode 100644 EDMI_ClientSuite/State/LicenseState.vb delete mode 100644 EDMI_ClientSuite/_Skpokpotrings/ControlProperties.Designer.vb delete mode 100644 EDMI_ClientSuite/_Skpokpotrings/ControlProperties.en.Designer.vb delete mode 100644 EDMI_ClientSuite/_Skpokpotrings/ControlProperties.en.resx delete mode 100644 EDMI_ClientSuite/_Skpokpotrings/ControlProperties.resx rename SERVICES/DDEDM_NetworkService/{EDMWindowsService.vb => WindowsService.vb} (97%) create mode 100644 SERVICES/DDEDM_NetworkService/packages.config diff --git a/DDLicenseService/DDEDMLicenseService.vbproj b/DDLicenseService/DDEDMLicenseService.vbproj new file mode 100644 index 00000000..2bd7fe17 --- /dev/null +++ b/DDLicenseService/DDEDMLicenseService.vbproj @@ -0,0 +1,144 @@ + + + + + Debug + AnyCPU + {CBE9322E-67A1-4CC5-B25F-4A1B4C9FC55C} + WinExe + DDLicenseService + DDEDMLicenseService + 512 + Console + v4.6.1 + True + + + true + full + true + true + bin\Debug\ + DDEDMLicenseService.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + pdbonly + false + true + true + bin\Release\ + DDEDMLicenseService.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + On + + + Binary + + + Off + + + On + + + DDLicenseService.EDMWindowsService + + + + + ..\packages\NLog.4.5.11\lib\net45\NLog.dll + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Component + + + + True + Application.myapp + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + + Component + + + + + VbMyResourcesResXFileCodeGenerator + Resources.Designer.vb + My.Resources + Designer + + + + + + MyApplicationCodeGenerator + Application.Designer.vb + + + SettingsSingleFileGenerator + My + Settings.Designer.vb + + + + + + {991d0231-4623-496d-8bd0-9ca906029cbc} + Filesystem + + + {eaf0ea75-5fa7-485d-89c7-b2d843b03a96} + Database + + + {903b2d7d-3b80-4be9-8713-7447b704e1b0} + Logging + + + + \ No newline at end of file diff --git a/DDLicenseService/ILicenseService.vb b/DDLicenseService/ILicenseService.vb new file mode 100644 index 00000000..f11f08e3 --- /dev/null +++ b/DDLicenseService/ILicenseService.vb @@ -0,0 +1,10 @@ +Imports System.ServiceModel + +' HINWEIS: Mit dem Befehl "Umbenennen" im Kontextmenü können Sie den Schnittstellennamen "ILicenseService" sowohl im Code als auch in der Konfigurationsdatei ändern. + +Public Interface ILicenseService + + + Sub DoWork() + +End Interface diff --git a/DDLicenseService/LicenseService.vb b/DDLicenseService/LicenseService.vb new file mode 100644 index 00000000..1afd3a26 --- /dev/null +++ b/DDLicenseService/LicenseService.vb @@ -0,0 +1,14 @@ +Imports DigitalData.Modules.Logging + +Public Class LicenseService + Implements ILicenseService + + Public Shared Event ClientConnectedEvent As EventHandler(Of Session) + Public Shared Event ClientDisconnectedEvent As EventHandler(Of Session) + + Public Shared LogConfig As LogConfig + + Public Sub DoWork() Implements ILicenseService.DoWork + End Sub + +End Class diff --git a/DDLicenseService/My Project/Application.Designer.vb b/DDLicenseService/My Project/Application.Designer.vb new file mode 100644 index 00000000..8ab460ba --- /dev/null +++ b/DDLicenseService/My Project/Application.Designer.vb @@ -0,0 +1,13 @@ +'------------------------------------------------------------------------------ +' +' Dieser Code wurde von einem Tool generiert. +' Laufzeitversion:4.0.30319.42000 +' +' Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn +' der Code erneut generiert wird. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + diff --git a/DDLicenseService/My Project/Application.myapp b/DDLicenseService/My Project/Application.myapp new file mode 100644 index 00000000..758895de --- /dev/null +++ b/DDLicenseService/My Project/Application.myapp @@ -0,0 +1,10 @@ + + + false + false + 0 + true + 0 + 1 + true + diff --git a/DDLicenseService/My Project/AssemblyInfo.vb b/DDLicenseService/My Project/AssemblyInfo.vb new file mode 100644 index 00000000..b3f69a0c --- /dev/null +++ b/DDLicenseService/My Project/AssemblyInfo.vb @@ -0,0 +1,35 @@ +Imports System +Imports System.Reflection +Imports System.Runtime.InteropServices + +' Allgemeine Informationen über eine Assembly werden über die folgenden +' Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, +' die einer Assembly zugeordnet sind. + +' Werte der Assemblyattribute überprüfen + + + + + + + + + + +'Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird. + + +' Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten: +' +' Hauptversion +' Nebenversion +' Buildnummer +' Revision +' +' Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden, +' übernehmen, indem Sie "*" eingeben: +' + + + diff --git a/DDLicenseService/My Project/Resources.Designer.vb b/DDLicenseService/My Project/Resources.Designer.vb new file mode 100644 index 00000000..82280de9 --- /dev/null +++ b/DDLicenseService/My Project/Resources.Designer.vb @@ -0,0 +1,63 @@ +'------------------------------------------------------------------------------ +' +' Dieser Code wurde von einem Tool generiert. +' Laufzeitversion:4.0.30319.42000 +' +' Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn +' der Code erneut generiert wird. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + +Imports System + +Namespace My.Resources + + 'Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert + '-Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert. + 'Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen + 'mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu. + ''' + ''' Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw. + ''' + _ + Friend Module Resources + + Private resourceMan As Global.System.Resources.ResourceManager + + Private resourceCulture As Global.System.Globalization.CultureInfo + + ''' + ''' Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird. + ''' + _ + Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager + Get + If Object.ReferenceEquals(resourceMan, Nothing) Then + Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("DDLicenseService.Resources", GetType(Resources).Assembly) + resourceMan = temp + End If + Return resourceMan + End Get + End Property + + ''' + ''' Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle + ''' Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden. + ''' + _ + Friend Property Culture() As Global.System.Globalization.CultureInfo + Get + Return resourceCulture + End Get + Set + resourceCulture = value + End Set + End Property + End Module +End Namespace diff --git a/DDLicenseService/My Project/Resources.resx b/DDLicenseService/My Project/Resources.resx new file mode 100644 index 00000000..af7dbebb --- /dev/null +++ b/DDLicenseService/My Project/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/DDLicenseService/My Project/Settings.Designer.vb b/DDLicenseService/My Project/Settings.Designer.vb new file mode 100644 index 00000000..2bbfdbc1 --- /dev/null +++ b/DDLicenseService/My Project/Settings.Designer.vb @@ -0,0 +1,73 @@ +'------------------------------------------------------------------------------ +' +' Dieser Code wurde von einem Tool generiert. +' Laufzeitversion:4.0.30319.42000 +' +' Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn +' der Code erneut generiert wird. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + _ + Partial Friend NotInheritable Class MySettings + Inherits Global.System.Configuration.ApplicationSettingsBase + + Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings) + +#Region "Automatische My.Settings-Speicherfunktion" +#If _MyType = "WindowsForms" Then + Private Shared addedHandler As Boolean + + Private Shared addedHandlerLockObject As New Object + + _ + Private Shared Sub AutoSaveSettings(sender As Global.System.Object, e As Global.System.EventArgs) + If My.Application.SaveMySettingsOnExit Then + My.Settings.Save() + End If + End Sub +#End If +#End Region + + Public Shared ReadOnly Property [Default]() As MySettings + Get + +#If _MyType = "WindowsForms" Then + If Not addedHandler Then + SyncLock addedHandlerLockObject + If Not addedHandler Then + AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings + addedHandler = True + End If + End SyncLock + End If +#End If + Return defaultInstance + End Get + End Property + End Class +End Namespace + +Namespace My + + _ + Friend Module MySettingsProperty + + _ + Friend ReadOnly Property Settings() As Global.DDLicenseService.My.MySettings + Get + Return Global.DDLicenseService.My.MySettings.Default + End Get + End Property + End Module +End Namespace diff --git a/DDLicenseService/My Project/Settings.settings b/DDLicenseService/My Project/Settings.settings new file mode 100644 index 00000000..85b890b3 --- /dev/null +++ b/DDLicenseService/My Project/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/DDLicenseService/ProjectInstaller.vb b/DDLicenseService/ProjectInstaller.vb new file mode 100644 index 00000000..0576459b --- /dev/null +++ b/DDLicenseService/ProjectInstaller.vb @@ -0,0 +1,24 @@ +Imports System.ComponentModel +Imports System.Configuration.Install +Imports System.ServiceProcess + + +Public Class ProjectInstaller + Inherits Installer + + Private ReadOnly process As ServiceProcessInstaller + Private ReadOnly components As IContainer + Private ReadOnly service As ServiceInstaller + + Public Sub New() + process = New ServiceProcessInstaller With { + .Account = ServiceAccount.NetworkService + } + service = New ServiceInstaller With { + .ServiceName = SERVICE_NAME, + .DisplayName = SERVICE_DISPLAY_NAME + } + Installers.Add(process) + Installers.Add(service) + End Sub +End Class diff --git a/SERVICES/DDEDM_NetworkService/Session.vb b/DDLicenseService/Session.vb similarity index 100% rename from SERVICES/DDEDM_NetworkService/Session.vb rename to DDLicenseService/Session.vb diff --git a/DDLicenseService/SettingsModule.vb b/DDLicenseService/SettingsModule.vb new file mode 100644 index 00000000..88b69220 --- /dev/null +++ b/DDLicenseService/SettingsModule.vb @@ -0,0 +1,4 @@ +Module SettingsModule + Public Const SERVICE_NAME As String = "DDEDMLicenseSvc" + Public Const SERVICE_DISPLAY_NAME As String = "Digital Data EDM License Service" +End Module \ No newline at end of file diff --git a/DDLicenseService/WindowsService.vb b/DDLicenseService/WindowsService.vb new file mode 100644 index 00000000..f3ac05f7 --- /dev/null +++ b/DDLicenseService/WindowsService.vb @@ -0,0 +1,72 @@ +Imports System.ServiceModel +Imports System.ServiceProcess +Imports System.Configuration +Imports DigitalData.Modules.Logging +Imports DigitalData.Modules.Database +Imports DigitalData.Modules.Database.Exceptions + +Public Class WindowsService + Inherits ServiceBase + + Private _serviceHost As ServiceHost = Nothing + + Private _logConfig As LogConfig + Private _logger As Logger + Private _db As Firebird + Private _clientsConnected As Integer = 0 + Private _clients As New List(Of Session) + + Public Sub New() + ServiceName = SERVICE_NAME + End Sub + + Public Shared Sub Main() + Run(New WindowsService()) + End Sub + + Protected Overrides Sub OnStart(ByVal args As String()) + Try + _logConfig = New LogConfig(LogConfig.PathType.CustomPath, "E:\EDMService") + _logger = _logConfig.GetLogger() + + _logger.Info("Service {0} is starting", SERVICE_DISPLAY_NAME) + + AddHandler LicenseService.ClientConnectedEvent, AddressOf EDMService_ClientConnected + AddHandler LicenseService.ClientDisconnectedEvent, AddressOf EDMService_ClientDisonnected + + LicenseService.LogConfig = _logConfig + + _logger.Info("Starting the WCF Service") + + _serviceHost = New ServiceHost(GetType(LicenseService)) + _serviceHost.Open() + + _logger.Info("Successfully started the WCF Service!") + + _logger.Info("Service {0} successfully started!", SERVICE_DISPLAY_NAME) + Catch ex As Exception + _logger.Error(ex, "Failed to start the service host!") + End Try + End Sub + + Private Sub EDMService_ClientDisonnected(sender As Object, e As Session) + _clientsConnected -= 1 + _clients.Remove(e) + _logger.Info("Client {0}/{1} disconnected! Total {2}", e.Username, e.SessionId, _clientsConnected) + End Sub + + Private Sub EDMService_ClientConnected(sender As Object, e As Session) + _clientsConnected += 1 + _clients.Add(e) + _logger.Info("Client {0}/{1} connected! Total {2}", e.Username, e.SessionId, _clientsConnected) + End Sub + + Protected Overrides Sub OnStop() + If _serviceHost IsNot Nothing Then + _serviceHost.Close() + _serviceHost = Nothing + End If + _logger.Info("Service {0} is stopping!", SERVICE_DISPLAY_NAME) + End Sub +End Class + diff --git a/DDLicenseService/app.config b/DDLicenseService/app.config new file mode 100644 index 00000000..fffa925f --- /dev/null +++ b/DDLicenseService/app.config @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/DDLicenseService/packages.config b/DDLicenseService/packages.config new file mode 100644 index 00000000..f89fa324 --- /dev/null +++ b/DDLicenseService/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/DDMonorepo.sln b/DDMonorepo.sln index 8362091a..1dd85fdb 100644 --- a/DDMonorepo.sln +++ b/DDMonorepo.sln @@ -65,6 +65,8 @@ Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "EDMIFileOps", "EDMI_FILE_OP EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ClientSuiteTest", "DXApplication1\ClientSuiteTest\ClientSuiteTest.csproj", "{221FDADA-D849-4036-A7CE-D1FC1D67E1FA}" EndProject +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "DDEDMLicenseService", "DDLicenseService\DDEDMLicenseService.vbproj", "{CBE9322E-67A1-4CC5-B25F-4A1B4C9FC55C}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -159,6 +161,10 @@ Global {221FDADA-D849-4036-A7CE-D1FC1D67E1FA}.Debug|Any CPU.Build.0 = Debug|Any CPU {221FDADA-D849-4036-A7CE-D1FC1D67E1FA}.Release|Any CPU.ActiveCfg = Release|Any CPU {221FDADA-D849-4036-A7CE-D1FC1D67E1FA}.Release|Any CPU.Build.0 = Release|Any CPU + {CBE9322E-67A1-4CC5-B25F-4A1B4C9FC55C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CBE9322E-67A1-4CC5-B25F-4A1B4C9FC55C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CBE9322E-67A1-4CC5-B25F-4A1B4C9FC55C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CBE9322E-67A1-4CC5-B25F-4A1B4C9FC55C}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -186,6 +192,7 @@ Global {A8C3F298-76AB-4359-AB3C-986E313B4336} = {7AF3F9C2-C939-4A08-95C1-0453207E298A} {5B1171DC-FFFE-4813-A20D-786AAE47B320} = {3E2008C8-27B1-41DD-9B1A-0C4029F6AECC} {221FDADA-D849-4036-A7CE-D1FC1D67E1FA} = {8FFE925E-8B84-45F1-93CB-32B1C96F41EB} + {CBE9322E-67A1-4CC5-B25F-4A1B4C9FC55C} = {7AF3F9C2-C939-4A08-95C1-0453207E298A} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {C1BE4090-A0FD-48AF-86CB-39099D14B286} diff --git a/EDMI_ClientSuite/EDMI_ClientSuite.vbproj b/EDMI_ClientSuite/EDMI_ClientSuite.vbproj index a8ec9152..8da0a440 100644 --- a/EDMI_ClientSuite/EDMI_ClientSuite.vbproj +++ b/EDMI_ClientSuite/EDMI_ClientSuite.vbproj @@ -248,6 +248,9 @@ Form + + LicenseSchema.xsd + True @@ -264,8 +267,6 @@ True - - True diff --git a/EDMI_ClientSuite/License/LicenseSchema.vb b/EDMI_ClientSuite/License/LicenseSchema.vb new file mode 100644 index 00000000..9c0e1b20 --- /dev/null +++ b/EDMI_ClientSuite/License/LicenseSchema.vb @@ -0,0 +1,201 @@ +'------------------------------------------------------------------------------ +' +' Dieser Code wurde von einem Tool generiert. +' Laufzeitversion:4.0.30319.42000 +' +' Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn +' der Code erneut generiert wird. +' +'------------------------------------------------------------------------------ + +Option Strict Off +Option Explicit On + +Imports System.Xml.Serialization + +' +'This source code was auto-generated by xsd, Version=4.6.1586.0. +' + +''' + _ +Partial Public Class License + + Private modulesField() As LicenseModule + + ''' + _ + Public Property Modules() As LicenseModule() + Get + Return Me.modulesField + End Get + Set + Me.modulesField = value + End Set + End Property +End Class + +''' + _ +Partial Public Class LicenseModule + + Private usersField() As LicenseModuleUser + + Private nameField As String + + Private validUntilField As Date + + Private validUntilFieldSpecified As Boolean + + ''' + _ + Public Property Users() As LicenseModuleUser() + Get + Return Me.usersField + End Get + Set + Me.usersField = value + End Set + End Property + + ''' + _ + Public Property Name() As String + Get + Return Me.nameField + End Get + Set + Me.nameField = value + End Set + End Property + + ''' + _ + Public Property ValidUntil() As Date + Get + Return Me.validUntilField + End Get + Set + Me.validUntilField = value + End Set + End Property + + ''' + _ + Public Property ValidUntilSpecified() As Boolean + Get + Return Me.validUntilFieldSpecified + End Get + Set + Me.validUntilFieldSpecified = value + End Set + End Property +End Class + +''' + _ +Partial Public Class LicenseModuleUser + + Private typeField As UserType + + Private countField As String + + Private testField As Boolean + + Private validUntilField As Date + + Private validUntilFieldSpecified As Boolean + + Public Sub New() + MyBase.New + Me.testField = true + End Sub + + ''' + _ + Public Property Type() As UserType + Get + Return Me.typeField + End Get + Set + Me.typeField = value + End Set + End Property + + ''' + _ + Public Property Count() As String + Get + Return Me.countField + End Get + Set + Me.countField = value + End Set + End Property + + ''' + _ + Public Property Test() As Boolean + Get + Return Me.testField + End Get + Set + Me.testField = value + End Set + End Property + + ''' + _ + Public Property ValidUntil() As Date + Get + Return Me.validUntilField + End Get + Set + Me.validUntilField = value + End Set + End Property + + ''' + _ + Public Property ValidUntilSpecified() As Boolean + Get + Return Me.validUntilFieldSpecified + End Get + Set + Me.validUntilFieldSpecified = value + End Set + End Property +End Class + +''' + _ +Public Enum UserType + + ''' + PowerUser + + ''' + [ReadOnly] + + ''' + [WriteOnly] + + ''' + ReadWrite +End Enum diff --git a/EDMI_ClientSuite/MyApplication.vb b/EDMI_ClientSuite/MyApplication.vb index ec5661ae..d1dabc6e 100644 --- a/EDMI_ClientSuite/MyApplication.vb +++ b/EDMI_ClientSuite/MyApplication.vb @@ -22,7 +22,6 @@ Namespace My Partial Class MyApplication ' User Config Public User As New UserState() - Public License As New LicenseState() End Class End Namespace diff --git a/EDMI_ClientSuite/State/LicenseState.vb b/EDMI_ClientSuite/State/LicenseState.vb deleted file mode 100644 index f96b306d..00000000 --- a/EDMI_ClientSuite/State/LicenseState.vb +++ /dev/null @@ -1,25 +0,0 @@ -Public Class LicenseState - Public Modules As List(Of LicenseModule) -End Class - -Public Class LicenseModule - Public Name As String - Public ValidUntil As Date - Public Users As List(Of LicenseUser) -End Class - -Public Class LicenseUser - Public Type As UserType - Public Count As Integer - Public Test As Boolean - Public ValidUntil As Date -End Class - -Public Enum UserType - PowerUser - [ReadOnly] - [WriteOnly] - ReadWrite -End Enum - - diff --git a/EDMI_ClientSuite/_Skpokpotrings/ControlProperties.Designer.vb b/EDMI_ClientSuite/_Skpokpotrings/ControlProperties.Designer.vb deleted file mode 100644 index 12f2a903..00000000 --- a/EDMI_ClientSuite/_Skpokpotrings/ControlProperties.Designer.vb +++ /dev/null @@ -1,463 +0,0 @@ -'------------------------------------------------------------------------------ -' -' Dieser Code wurde von einem Tool generiert. -' Laufzeitversion:4.0.30319.42000 -' -' Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn -' der Code erneut generiert wird. -' -'------------------------------------------------------------------------------ - -Option Strict On -Option Explicit On - -Imports System - -Namespace My.Resources - - 'Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert - '-Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert. - 'Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen - 'mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu. - ''' - ''' Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw. - ''' - _ - Friend Class ControlProperties - - Private Shared resourceMan As Global.System.Resources.ResourceManager - - Private Shared resourceCulture As Global.System.Globalization.CultureInfo - - _ - Friend Sub New() - MyBase.New - End Sub - - ''' - ''' Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird. - ''' - _ - Friend Shared ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager - Get - If Object.ReferenceEquals(resourceMan, Nothing) Then - Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("DigitalData.GUIS.ClientSuite.ControlProperties", GetType(ControlProperties).Assembly) - resourceMan = temp - End If - Return resourceMan - End Get - End Property - - ''' - ''' Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle - ''' Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden. - ''' - _ - Friend Shared Property Culture() As Global.System.Globalization.CultureInfo - Get - Return resourceCulture - End Get - Set - resourceCulture = value - End Set - End Property - - ''' - ''' Sucht eine lokalisierte Zeichenfolge, die Termin Einstellungen ähnelt. - ''' - Friend Shared ReadOnly Property category_appointment() As String - Get - Return ResourceManager.GetString("category_appointment", resourceCulture) - End Get - End Property - - ''' - ''' Sucht eine lokalisierte Zeichenfolge, die Daten ähnelt. - ''' - Friend Shared ReadOnly Property category_data() As String - Get - Return ResourceManager.GetString("category_data", resourceCulture) - End Get - End Property - - ''' - ''' Sucht eine lokalisierte Zeichenfolge, die Datenbank Einstellungen ähnelt. - ''' - Friend Shared ReadOnly Property category_database() As String - Get - Return ResourceManager.GetString("category_database", resourceCulture) - End Get - End Property - - ''' - ''' Sucht eine lokalisierte Zeichenfolge, die Datums Einstellungen ähnelt. - ''' - Friend Shared ReadOnly Property category_date() As String - Get - Return ResourceManager.GetString("category_date", resourceCulture) - End Get - End Property - - ''' - ''' Sucht eine lokalisierte Zeichenfolge, die Schrift Einstellungen ähnelt. - ''' - Friend Shared ReadOnly Property category_font() As String - Get - Return ResourceManager.GetString("category_font", resourceCulture) - End Get - End Property - - ''' - ''' Sucht eine lokalisierte Zeichenfolge, die Form Einstellungen ähnelt. - ''' - Friend Shared ReadOnly Property category_form() As String - Get - Return ResourceManager.GetString("category_form", resourceCulture) - End Get - End Property - - ''' - ''' Sucht eine lokalisierte Zeichenfolge, die Information ähnelt. - ''' - Friend Shared ReadOnly Property category_info() As String - Get - Return ResourceManager.GetString("category_info", resourceCulture) - End Get - End Property - - ''' - ''' Sucht eine lokalisierte Zeichenfolge, die Eingabe Eigenschaften ähnelt. - ''' - Friend Shared ReadOnly Property category_input() As String - Get - Return ResourceManager.GetString("category_input", resourceCulture) - End Get - End Property - - ''' - ''' Sucht eine lokalisierte Zeichenfolge, die Andere Einstellungen ähnelt. - ''' - Friend Shared ReadOnly Property category_other() As String - Get - Return ResourceManager.GetString("category_other", resourceCulture) - End Get - End Property - - ''' - ''' Sucht eine lokalisierte Zeichenfolge, die Ansichts Einstellungen ähnelt. - ''' - Friend Shared ReadOnly Property category_view() As String - Get - Return ResourceManager.GetString("category_view", resourceCulture) - End Get - End Property - - ''' - ''' Sucht eine lokalisierte Zeichenfolge, die Schlägt bereits eingegebene Einträge bei der der Eingabe vor. ähnelt. - ''' - Friend Shared ReadOnly Property desc_autosuggest() As String - Get - Return ResourceManager.GetString("desc_autosuggest", resourceCulture) - End Get - End Property - - ''' - ''' Sucht eine lokalisierte Zeichenfolge, die Gibt die Hintergrundfarbe des Elements an. ähnelt. - ''' - Friend Shared ReadOnly Property desc_backcolor() As String - Get - Return ResourceManager.GetString("desc_backcolor", resourceCulture) - End Get - End Property - - ''' - ''' Sucht eine lokalisierte Zeichenfolge, die Gibt den Beschreibungstext dieses Elements an. ähnelt. - ''' - Friend Shared ReadOnly Property desc_caption() As String - Get - Return ResourceManager.GetString("desc_caption", resourceCulture) - End Get - End Property - - ''' - ''' Sucht eine lokalisierte Zeichenfolge, die Gibt den Spaltentitel des Elements an. ähnelt. - ''' - Friend Shared ReadOnly Property desc_col_title() As String - Get - Return ResourceManager.GetString("desc_col_title", resourceCulture) - End Get - End Property - - ''' - ''' Sucht eine lokalisierte Zeichenfolge, die Gibt die Farbe an. ähnelt. - ''' - Friend Shared ReadOnly Property desc_color() As String - Get - Return ResourceManager.GetString("desc_color", resourceCulture) - End Get - End Property - - ''' - ''' Sucht eine lokalisierte Zeichenfolge, die Gibt den Standardwert dieses Elements an. ähnelt. - ''' - Friend Shared ReadOnly Property desc_defaultvalue() As String - Get - Return ResourceManager.GetString("desc_defaultvalue", resourceCulture) - End Get - End Property - - ''' - ''' Sucht eine lokalisierte Zeichenfolge, die Gibt die Beschreibung des Termins an. Dynamische Werte aus anderen Controls können mit der Syntax [%controlname] eingefügt werden ähnelt. - ''' - Friend Shared ReadOnly Property desc_description() As String - Get - Return ResourceManager.GetString("desc_description", resourceCulture) - End Get - End Property - - ''' - ''' Sucht eine lokalisierte Zeichenfolge, die Gibt einen SQL Befehl an, der das Control abhängig vom Ergebnis (0 oder 1) aktiviert oder deaktiviert ähnelt. - ''' - Friend Shared ReadOnly Property desc_enabledwhen() As String - Get - Return ResourceManager.GetString("desc_enabledwhen", resourceCulture) - End Get - End Property - - ''' - ''' Sucht eine lokalisierte Zeichenfolge, die Gibt die Schriftart an. ähnelt. - ''' - Friend Shared ReadOnly Property desc_fontstyle() As String - Get - Return ResourceManager.GetString("desc_fontstyle", resourceCulture) - End Get - End Property - - ''' - ''' Sucht eine lokalisierte Zeichenfolge, die Gibt das Format des Textes an. ähnelt. - ''' - Friend Shared ReadOnly Property desc_format() As String - Get - Return ResourceManager.GetString("desc_format", resourceCulture) - End Get - End Property - - ''' - ''' Sucht eine lokalisierte Zeichenfolge, die Gibt die Form-ID der zu öffnenden Form an. ähnelt. - ''' - Friend Shared ReadOnly Property desc_formid() As String - Get - Return ResourceManager.GetString("desc_formid", resourceCulture) - End Get - End Property - - ''' - ''' Sucht eine lokalisierte Zeichenfolge, die Der Name eines Elements von dem das End-Datum gelesen wird. ähnelt. - ''' - Friend Shared ReadOnly Property desc_fromdate() As String - Get - Return ResourceManager.GetString("desc_fromdate", resourceCulture) - End Get - End Property - - ''' - ''' Sucht eine lokalisierte Zeichenfolge, die Der Text, der beim überfahren des Controls angezeigt wird ähnelt. - ''' - Friend Shared ReadOnly Property desc_hint() As String - Get - Return ResourceManager.GetString("desc_hint", resourceCulture) - End Get - End Property - - ''' - ''' Sucht eine lokalisierte Zeichenfolge, die Gibt die eindeutige ID des Elements an. ähnelt. - ''' - Friend Shared ReadOnly Property desc_id() As String - Get - Return ResourceManager.GetString("desc_id", resourceCulture) - End Get - End Property - - ''' - ''' Sucht eine lokalisierte Zeichenfolge, die Gibt die Position des Elements an. ähnelt. - ''' - Friend Shared ReadOnly Property desc_location() As String - Get - Return ResourceManager.GetString("desc_location", resourceCulture) - End Get - End Property - - ''' - ''' Sucht eine lokalisierte Zeichenfolge, die Die Id des Formulars, das über das Kontextmenü geöffnet wird. ähnelt. - ''' - Friend Shared ReadOnly Property desc_masterdataid() As String - Get - Return ResourceManager.GetString("desc_masterdataid", resourceCulture) - End Get - End Property - - ''' - ''' Sucht eine lokalisierte Zeichenfolge, die Gibt an, ob das Feld mehrzeilig sein soll. ähnelt. - ''' - Friend Shared ReadOnly Property desc_multiline() As String - Get - Return ResourceManager.GetString("desc_multiline", resourceCulture) - End Get - End Property - - ''' - ''' Sucht eine lokalisierte Zeichenfolge, die Gibt den internen Namen des Elements an. ähnelt. - ''' - Friend Shared ReadOnly Property desc_name() As String - Get - Return ResourceManager.GetString("desc_name", resourceCulture) - End Get - End Property - - ''' - ''' Sucht eine lokalisierte Zeichenfolge, die Gibt den Ort des Termins an. Dynamische Werte aus anderen Controls können mit der Syntax [%controlname] eingefügt werden ähnelt. - ''' - Friend Shared ReadOnly Property desc_place() As String - Get - Return ResourceManager.GetString("desc_place", resourceCulture) - End Get - End Property - - ''' - ''' Sucht eine lokalisierte Zeichenfolge, die Gibt an, ob dieses Element nur lesbar ist. ähnelt. - ''' - Friend Shared ReadOnly Property desc_readonly() As String - Get - Return ResourceManager.GetString("desc_readonly", resourceCulture) - End Get - End Property - - ''' - ''' Sucht eine lokalisierte Zeichenfolge, die Gibt an ob dieses Element benötigt wird um die Eingabe abzuschließen. ähnelt. - ''' - Friend Shared ReadOnly Property desc_required() As String - Get - Return ResourceManager.GetString("desc_required", resourceCulture) - End Get - End Property - - ''' - ''' Sucht eine lokalisierte Zeichenfolge, die Gibt die Screen-ID der zu öffnenden Form an. ähnelt. - ''' - Friend Shared ReadOnly Property desc_screenid() As String - Get - Return ResourceManager.GetString("desc_screenid", resourceCulture) - End Get - End Property - - ''' - ''' Sucht eine lokalisierte Zeichenfolge, die Gibt an, ob nur vorhandene Listeneinträge ausgewählt werden können ähnelt. - ''' - Friend Shared ReadOnly Property desc_select_only() As String - Get - Return ResourceManager.GetString("desc_select_only", resourceCulture) - End Get - End Property - - ''' - ''' Sucht eine lokalisierte Zeichenfolge, die Gibt an, ob das Feld als Spalte im Grid angezeigt wird. ähnelt. - ''' - Friend Shared ReadOnly Property desc_showcolumn() As String - Get - Return ResourceManager.GetString("desc_showcolumn", resourceCulture) - End Get - End Property - - ''' - ''' Sucht eine lokalisierte Zeichenfolge, die Gibt die Größe des Elements an ähnelt. - ''' - Friend Shared ReadOnly Property desc_size() As String - Get - Return ResourceManager.GetString("desc_size", resourceCulture) - End Get - End Property - - ''' - ''' Sucht eine lokalisierte Zeichenfolge, die Gibt die Datenbank-Abfrage für dieses Element an. Es können @RECORD_ID und @FORM_ID als Platzhalter verwendet werden. ähnelt. - ''' - Friend Shared ReadOnly Property desc_sqlcommand() As String - Get - Return ResourceManager.GetString("desc_sqlcommand", resourceCulture) - End Get - End Property - - ''' - ''' Sucht eine lokalisierte Zeichenfolge, die Eine Liste von statischen Werten, die durch ';' getrennt sind. Überschreibt die Daten aus 'Datenbank-Einstellungen' ähnelt. - ''' - Friend Shared ReadOnly Property desc_staticlist() As String - Get - Return ResourceManager.GetString("desc_staticlist", resourceCulture) - End Get - End Property - - ''' - ''' Sucht eine lokalisierte Zeichenfolge, die Gibt den Betreff des Termins an. Dynamische Werte aus anderen Controls können mit der Syntax [%controlname] eingefügt werden ähnelt. - ''' - Friend Shared ReadOnly Property desc_subject() As String - Get - Return ResourceManager.GetString("desc_subject", resourceCulture) - End Get - End Property - - ''' - ''' Sucht eine lokalisierte Zeichenfolge, die Gibt den optionalen zweiten Betreff des Termins an. Dynamische Werte aus anderen Controls können mit der Syntax [%controlname] eingefügt werden ähnelt. - ''' - Friend Shared ReadOnly Property desc_subject2() As String - Get - Return ResourceManager.GetString("desc_subject2", resourceCulture) - End Get - End Property - - ''' - ''' Sucht eine lokalisierte Zeichenfolge, die Gibt die Reihenfolge an, in der das Element durch die Tabulatortaste aktiviert wird. ähnelt. - ''' - Friend Shared ReadOnly Property desc_tabindex() As String - Get - Return ResourceManager.GetString("desc_tabindex", resourceCulture) - End Get - End Property - - ''' - ''' Sucht eine lokalisierte Zeichenfolge, die Gibt an, ob das Element durch die Tabulartortaste aktiviert werden soll. ähnelt. - ''' - Friend Shared ReadOnly Property desc_tabstop() As String - Get - Return ResourceManager.GetString("desc_tabstop", resourceCulture) - End Get - End Property - - ''' - ''' Sucht eine lokalisierte Zeichenfolge, die Der Name eines Elements von dem das Start-Datum gelesen wird. ähnelt. - ''' - Friend Shared ReadOnly Property desc_todate() As String - Get - Return ResourceManager.GetString("desc_todate", resourceCulture) - End Get - End Property - - ''' - ''' Sucht eine lokalisierte Zeichenfolge, die Der Typ des Elements ähnelt. - ''' - Friend Shared ReadOnly Property desc_type() As String - Get - Return ResourceManager.GetString("desc_type", resourceCulture) - End Get - End Property - - ''' - ''' Sucht eine lokalisierte Zeichenfolge, die Gibt an, ob das Element angezeigt wird. ähnelt. - ''' - Friend Shared ReadOnly Property desc_visible() As String - Get - Return ResourceManager.GetString("desc_visible", resourceCulture) - End Get - End Property - End Class -End Namespace diff --git a/EDMI_ClientSuite/_Skpokpotrings/ControlProperties.en.Designer.vb b/EDMI_ClientSuite/_Skpokpotrings/ControlProperties.en.Designer.vb deleted file mode 100644 index e69de29b..00000000 diff --git a/EDMI_ClientSuite/_Skpokpotrings/ControlProperties.en.resx b/EDMI_ClientSuite/_Skpokpotrings/ControlProperties.en.resx deleted file mode 100644 index e526f696..00000000 --- a/EDMI_ClientSuite/_Skpokpotrings/ControlProperties.en.resx +++ /dev/null @@ -1,252 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Scheduler Configuration - - - Data - - - Database Configuration - - - Date Configuration - - - Font Configuration - - - Form Configuration - - - Information - - - Other Configuration - - - View Configuration - - - Suggests already entered entries - - - The element's background color. - - - The element's caption. - - - The element's color. - - - The element's colum title. - - - The element's default value. - - - The appointment's description. Dynamic values from other controls can be inserted with the syntax [%controlname]. - - - An SQL Query that enables or disables the Control depending on the result (0 or 1) - - - The element's font style. - - - The element's number format. - - - The form-ID of the form that will be opened. - - - The appointment's start-date. Dynamic values from other controls can be inserted with the syntax [%controlname]. - - - The text that will be shown when the control is hovered over - - - The element's unique identifier. - - - The element's location - - - The Form's Id that will be opened via the contextmenu. - - - Should the element be a multiline field? - - - The element's internal name - - - The appointment's location. Dynamic values from other controls can be inserted with the syntax [%controlname]. - - - Is the element read-only? - - - Is the element required to be filled to complete the input? - - - The screen-ID of the form that will be opened. - - - Can only existing list items be selected? - - - Should the element be show as a column? - - - The element's size - - - The database query for this element. @RECORD_ID and @FORM_ID can be used as placeholders. Dynamic values from other controls can be inserted with the Syntax @controlid@. - - - A list of static values seperated by a semicolon (;) - - - The appointment's subject. Dynamic values from other controls can be inserted with the syntax [%controlname]. - - - The appointment's optional secondary subject. Dynamic values from other controls can be inserted with the syntax [%controlname]. - - - The order in which this element should be activated by the tab key. - - - Should this element be activated by the tab key? - - - The appointment's end-date. Dynamic values from other controls can be inserted with the syntax [%controlname]. - - - The element's type - - - Should the element be visible? - - - Input Configuration - - \ No newline at end of file diff --git a/EDMI_ClientSuite/_Skpokpotrings/ControlProperties.resx b/EDMI_ClientSuite/_Skpokpotrings/ControlProperties.resx deleted file mode 100644 index af8c8fbb..00000000 --- a/EDMI_ClientSuite/_Skpokpotrings/ControlProperties.resx +++ /dev/null @@ -1,252 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Termin Einstellungen - - - Daten - - - Datenbank Einstellungen - - - Datums Einstellungen - - - Schrift Einstellungen - - - Form Einstellungen - - - Information - - - Andere Einstellungen - - - Ansichts Einstellungen - - - Schlägt bereits eingegebene Einträge bei der der Eingabe vor. - - - Gibt die Hintergrundfarbe des Elements an. - - - Gibt den Beschreibungstext dieses Elements an. - - - Gibt die Farbe an. - - - Gibt den Spaltentitel des Elements an. - - - Gibt den Standardwert dieses Elements an. - - - Gibt die Beschreibung des Termins an. Dynamische Werte aus anderen Controls können mit der Syntax [%controlname] eingefügt werden - - - Gibt einen SQL Befehl an, der das Control abhängig vom Ergebnis (0 oder 1) aktiviert oder deaktiviert - - - Gibt die Schriftart an. - - - Gibt das Format des Textes an. - - - Gibt die Form-ID der zu öffnenden Form an. - - - Der Name eines Elements von dem das End-Datum gelesen wird. - - - Der Text, der beim überfahren des Controls angezeigt wird - - - Gibt die eindeutige ID des Elements an. - - - Gibt die Position des Elements an. - - - Die Id des Formulars, das über das Kontextmenü geöffnet wird. - - - Gibt an, ob das Feld mehrzeilig sein soll. - - - Gibt den internen Namen des Elements an. - - - Gibt den Ort des Termins an. Dynamische Werte aus anderen Controls können mit der Syntax [%controlname] eingefügt werden - - - Gibt an, ob dieses Element nur lesbar ist. - - - Gibt an ob dieses Element benötigt wird um die Eingabe abzuschließen. - - - Gibt die Screen-ID der zu öffnenden Form an. - - - Gibt an, ob nur vorhandene Listeneinträge ausgewählt werden können - - - Gibt an, ob das Feld als Spalte im Grid angezeigt wird. - - - Gibt die Größe des Elements an - - - Gibt die Datenbank-Abfrage für dieses Element an. Es können @RECORD_ID und @FORM_ID als Platzhalter verwendet werden. - - - Eine Liste von statischen Werten, die durch ';' getrennt sind. Überschreibt die Daten aus 'Datenbank-Einstellungen' - - - Gibt den Betreff des Termins an. Dynamische Werte aus anderen Controls können mit der Syntax [%controlname] eingefügt werden - - - Gibt den optionalen zweiten Betreff des Termins an. Dynamische Werte aus anderen Controls können mit der Syntax [%controlname] eingefügt werden - - - Gibt die Reihenfolge an, in der das Element durch die Tabulatortaste aktiviert wird. - - - Gibt an, ob das Element durch die Tabulartortaste aktiviert werden soll. - - - Der Name eines Elements von dem das Start-Datum gelesen wird. - - - Der Typ des Elements - - - Gibt an, ob das Element angezeigt wird. - - - Eingabe Eigenschaften - - \ No newline at end of file diff --git a/EDMI_ClientSuite/frmMain.Designer.vb b/EDMI_ClientSuite/frmMain.Designer.vb index c667e950..3e5b83fb 100644 --- a/EDMI_ClientSuite/frmMain.Designer.vb +++ b/EDMI_ClientSuite/frmMain.Designer.vb @@ -57,6 +57,7 @@ Partial Class frmMain Me.DockPanelProcessManager = New DevExpress.XtraBars.Docking.DockPanel() Me.DockPanel2_Container = New DevExpress.XtraBars.Docking.ControlContainer() Me.ProcessManagerOverview = New EDMI_ClientSuite.ProcessManagerOverview() + Me.BarButtonItem2 = New DevExpress.XtraBars.BarButtonItem() CType(Me.RibbonControl, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.MainMenu, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.DocumentManager, System.ComponentModel.ISupportInitialize).BeginInit() @@ -73,9 +74,9 @@ Partial Class frmMain ' Me.RibbonControl.ApplicationButtonDropDownControl = Me.MainMenu Me.RibbonControl.ExpandCollapseItem.Id = 0 - Me.RibbonControl.Items.AddRange(New DevExpress.XtraBars.BarItem() {Me.RibbonControl.ExpandCollapseItem, Me.BarButtonExit, Me.BarButtonUserSettings, Me.LabelCurrentUser, Me.LabelCurrentMachine, Me.LabelCurrentVersion, Me.BarButtonItem1, Me.BarButtonDock1, Me.SkinDropDownButtonItem1, Me.BarButtonDashboard, Me.BarButtonEntityDesigner, Me.BarButtonDeleteControl, Me.BarButtonConnectionSettings, Me.LabelCurrentLanguage}) + Me.RibbonControl.Items.AddRange(New DevExpress.XtraBars.BarItem() {Me.RibbonControl.ExpandCollapseItem, Me.BarButtonExit, Me.BarButtonUserSettings, Me.LabelCurrentUser, Me.LabelCurrentMachine, Me.LabelCurrentVersion, Me.BarButtonItem1, Me.BarButtonDock1, Me.SkinDropDownButtonItem1, Me.BarButtonDashboard, Me.BarButtonEntityDesigner, Me.BarButtonDeleteControl, Me.BarButtonConnectionSettings, Me.LabelCurrentLanguage, Me.BarButtonItem2}) Me.RibbonControl.Location = New System.Drawing.Point(0, 0) - Me.RibbonControl.MaxItemId = 16 + Me.RibbonControl.MaxItemId = 17 Me.RibbonControl.Name = "RibbonControl" Me.RibbonControl.PageCategories.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPageCategory() {Me.RibbonPageCategoryEntityDesigner}) Me.RibbonControl.PageHeaderItemLinks.Add(Me.SkinDropDownButtonItem1) @@ -218,6 +219,7 @@ Partial Class frmMain 'RibbonPageGroup3 ' Me.RibbonPageGroup3.ItemLinks.Add(Me.BarButtonItem1) + Me.RibbonPageGroup3.ItemLinks.Add(Me.BarButtonItem2) Me.RibbonPageGroup3.Name = "RibbonPageGroup3" Me.RibbonPageGroup3.Text = "RibbonPageGroup3" ' @@ -348,6 +350,12 @@ Partial Class frmMain Me.ProcessManagerOverview.Size = New System.Drawing.Size(337, 163) Me.ProcessManagerOverview.TabIndex = 0 ' + 'BarButtonItem2 + ' + Me.BarButtonItem2.Caption = "License Test" + Me.BarButtonItem2.Id = 16 + Me.BarButtonItem2.Name = "BarButtonItem2" + ' 'frmMain ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) @@ -413,4 +421,5 @@ Partial Class frmMain Friend WithEvents BarButtonDeleteControl As DevExpress.XtraBars.BarButtonItem Friend WithEvents BarButtonConnectionSettings As DevExpress.XtraBars.BarButtonItem Friend WithEvents LabelCurrentLanguage As DevExpress.XtraBars.BarStaticItem + Friend WithEvents BarButtonItem2 As DevExpress.XtraBars.BarButtonItem End Class diff --git a/EDMI_ClientSuite/frmMain.resx b/EDMI_ClientSuite/frmMain.resx index dc362ec9..9a1ff3b1 100644 --- a/EDMI_ClientSuite/frmMain.resx +++ b/EDMI_ClientSuite/frmMain.resx @@ -244,29 +244,29 @@ - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAAAMnRFWHRUaXRsZQBDdXN0b21l - cjtFbXBsb3llZTtQZXJzb247Q29udGFjdDtVc2VyO0NsaWVudH4RNugAAADNSURBVDhPpdExDkFBFAXQ - X4jeMkg0Kir03xrsRaWxCIuQ6EXCGv4KqL8CkXGvzLzMPP8xoTgymXffDaZwzv3l9TFbbLUh7OHiHWAM - Sc4qaMEJnHKGNkjWKuiCXg56IFmrYAJNyzQFyVoFS2haJs4kaxWM4AF6mXf8cyVrFdAOdAHvktynAj7Z - DcIyz9nPGMzh6PH8lrEKOrCC+M155h1nktUFA9jAHfi119D3eOYdZ8wwmxSUcIXwm79htowLqmiYq4oL - ajXMUUvB71zxBKd8P7UB7yhRAAAAAElFTkSuQmCC + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m + dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAAydEVYdFRpdGxlAEN1c3RvbWVyO0VtcGxveWVlO1Bl + cnNvbjtDb250YWN0O1VzZXI7Q2xpZW50fhE26AAAAM1JREFUOE+l0TEOQUEUBdBfiN4ySDQqKvTfGuxF + pbEIi5DoRcIa/gqovwKRca/MvMw8/zGhODKZd98NpnDO/eX1MVtstSHs4eIdYAxJzipowQmccoY2SNYq + 6IJeDnogWatgAk3LNAXJWgVLaFomziRrFYzgAXqZd/xzJWsV0A50Ae+S3KcCPtkNwjLP2c8YzOHo8fyW + sQo6sIL4zXnmHWeS1QUD2MAd+LXX0Pd45h1nzDCbFJRwhfCbv2G2jAuqaJirigtqNcxRS8HvXPEEp3w/ + tQHvKFEAAAAASUVORK5CYII= - iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAAAMnRFWHRUaXRsZQBDdXN0b21l - cjtFbXBsb3llZTtQZXJzb247Q29udGFjdDtVc2VyO0NsaWVudH4RNugAAAH4SURBVFhHxdaxS1VhGMdx - QRcHh8BoVWppyL3VEApsCPpjoiFCF8FddHEPGhqFXGxVgoiGIAIlR7FoMEg4/n6H8xze571frw7e6/BZ - 3vO8z/fcex2caJrmVg0cPF/ZuY5leSe/5H/nWN7LC6E7SfRS3Gi4siHNFbaF7vail+JGw4WnQkHyUmhH - K3opbjRc8NdOMfJBaEcreiluNFz4LhQjP4R2tKKX4kbDhb9CMfJbaEcreiluNFyg0GX+Ce1oRS/FjYY7 - i0KhYXyHdvW9FDca7mwKRYbxHdrV91LcaLizJhQZxndoV99LcaPhzn05EQoRz/oO7ep7KW40XHgjFCOv - hHa0opfiRsOFR0Ix4lna0YpeihsNVz4KBUu7Qnd70Utxo+HKgpwJhc3PPEN3e9FLcaNh8ExOpY7/ET+j - O0n0Utxo+BJ35bX4J/kkb+We0OyA6KW40XBlEs5qU3CWRC/FjYYLj+WzPCjOav7r/yKepeet6KW4wfCc - rMg3id96T6alnp2RA4k531mVeUmz0UtxK4buyJb4/71YWNqXJ+Kv25bkq9Csd3iXd17rBR7KT6FltfMO - Pat5p3f3vRQ3PZyVQ6EFN8G7Z6NHL7BeDI/KevToBUb56cNh9OgF6MKNix69wFE9PAJH0Rt4gXHDw3HC - w3HCw/FpJi4ACnRMQSftMegAAAAASUVORK5CYII= + iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m + dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAAydEVYdFRpdGxlAEN1c3RvbWVyO0VtcGxveWVlO1Bl + cnNvbjtDb250YWN0O1VzZXI7Q2xpZW50fhE26AAAAfhJREFUWEfF1rFLVWEYx3FBFweHwGhVamnIvdUQ + CmwI+mOiIUIXwV10cQ8aGoVcbFWCiIYgAiVHsWgwSDj+fofzHN7nvV+vDt7r8Fne87zP99x7HZxomuZW + DRw8X9m5jmV5J7/kf+dY3ssLoTtJ9FLcaLiyIc0VtoXu9qKX4kbDhadCQfJSaEcreiluNFzw104x8kFo + Ryt6KW40XPguFCM/hHa0opfiRsOFv0Ix8ltoRyt6KW40XKDQZf4J7WhFL8WNhjuLQqFhfId29b0UNxru + bApFhvEd2tX3UtxouLMmFBnGd2hX30txo+HOfTkRChHP+g7t6nspbjRceCMUI6+EdrSil+JGw4VHQjHi + WdrRil6KGw1XPgoFS7tCd3vRS3Gj4cqCnAmFzc88Q3d70Utxo2HwTE6ljv8RP6M7SfRS3Gj4Enfltfgn + +SRv5Z7Q7IDopbjRcGUSzmpTcJZEL8WNhguP5bM8KM5q/uv/Ip6l563opbjB8JysyDeJ33pPpqWenZED + iTnfWZV5SbPRS3Erhu7Ilvj/vVhY2pcn4q/bluSr0Kx3eJd3XusFHspPoWW18w49q3mnd/e9FDc9nJVD + oQU3wbtno0cvsF4Mj8p69OgFRvnpw2H06AXowo2LHr3AUT08AkfRG3iBccPDccLDccLD8WkmLgAKdExB + J+0x6AAAAABJRU5ErkJggg== diff --git a/EDMI_ClientSuite/frmMain.vb b/EDMI_ClientSuite/frmMain.vb index 7237e462..510e1f1a 100644 --- a/EDMI_ClientSuite/frmMain.vb +++ b/EDMI_ClientSuite/frmMain.vb @@ -106,4 +106,44 @@ Public Class frmMain frm.MdiParent = DocumentManager.MdiParent frm.Show() End Sub + + Private Sub BarButtonItem2_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem2.ItemClick + Dim oUser1 = New LicenseModuleUser With { + .Type = UserType.PowerUser, + .Test = False, + .Count = 5, + .ValidUntil = New Date(), + .ValidUntilSpecified = True + } + + Dim oUsers As New List(Of LicenseModuleUser) + oUsers.Add(oUser1) + + Dim oModule = New LicenseModule() With { + .Users = oUsers.ToArray(), + .Name = "EDMI", + .ValidUntil = New Date(), + .ValidUntilSpecified = True + } + + Dim oModules As New List(Of LicenseModule) + oModules.Add(oModule) + + Dim oLicense = New License() With { + .Modules = oModules.ToArray + } + + Dim oSerializer As New Xml.Serialization.XmlSerializer(GetType(License)) + + Using oStream = New FileStream("E:\license.xml", FileMode.Create) + oSerializer.Serialize(oStream, oLicense) + oStream.Flush() + End Using + + Dim oLicense2 As License + + Using oReader As New StreamReader("E:\license.xml") + oLicense2 = oSerializer.Deserialize(oReader) + End Using + End Sub End Class \ No newline at end of file diff --git a/SERVICES/DDEDM_NetworkService/App.config b/SERVICES/DDEDM_NetworkService/App.config index 203b962c..a1581da4 100644 --- a/SERVICES/DDEDM_NetworkService/App.config +++ b/SERVICES/DDEDM_NetworkService/App.config @@ -1,4 +1,4 @@ - + @@ -18,20 +18,19 @@ - + - - - - - - + + + + + + @@ -39,27 +38,19 @@ - + - + - + @@ -76,4 +67,9 @@ - \ No newline at end of file + + + + + + \ No newline at end of file diff --git a/SERVICES/DDEDM_NetworkService/DDEDMService.vbproj b/SERVICES/DDEDM_NetworkService/DDEDMService.vbproj index f2c98f78..5594f0b6 100644 --- a/SERVICES/DDEDM_NetworkService/DDEDMService.vbproj +++ b/SERVICES/DDEDM_NetworkService/DDEDMService.vbproj @@ -6,7 +6,7 @@ AnyCPU {A8C3F298-76AB-4359-AB3C-986E313B4336} Exe - DigitalData.Services.EDMService.EDMWindowsService + DigitalData.Services.EDMService.WindowsService DigitalData.Services.EDMService EDMService 512 @@ -47,29 +47,23 @@ On - - ..\..\DDMonorepo\Modules.Database\bin\Debug\DigitalData.Modules.Database.dll + + ..\..\packages\FirebirdSql.Data.FirebirdClient.6.4.0\lib\net452\FirebirdSql.Data.FirebirdClient.dll - - ..\..\DDMonorepo\Filesystem\bin\Debug\DigitalData.Modules.Filesystem.dll - - - ..\..\DDMonorepo\Modules.Logging\bin\Debug\DigitalData.Modules.Logging.dll - - - ..\..\DDMonorepo\Modules.Database\bin\Debug\FirebirdSql.Data.FirebirdClient.dll - - - ..\..\DDMonorepo\Modules.Logging\bin\Debug\NLog.dll + + + ..\..\packages\NLog.4.5.11\lib\net45\NLog.dll + + @@ -92,10 +86,9 @@ - - + Component @@ -145,6 +138,21 @@ PreserveNewest Designer + + + + + {991d0231-4623-496d-8bd0-9ca906029cbc} + Filesystem + + + {EAF0EA75-5FA7-485D-89C7-B2D843B03A96} + Database + + + {903B2D7D-3B80-4BE9-8713-7447B704E1B0} + Logging + \ No newline at end of file diff --git a/SERVICES/DDEDM_NetworkService/EDMService.vb b/SERVICES/DDEDM_NetworkService/EDMService.vb index 84d6cf13..22cca182 100644 --- a/SERVICES/DDEDM_NetworkService/EDMService.vb +++ b/SERVICES/DDEDM_NetworkService/EDMService.vb @@ -8,16 +8,11 @@ Imports DigitalData.Services.EDMService Public Class EDMService Implements IEDMService - Implements IDisposable - - Public Shared Event ClientConnectedEvent As EventHandler(Of Session) - Public Shared Event ClientDisconnectedEvent As EventHandler(Of Session) Public Shared LogConfig As LogConfig Public Shared Database As Firebird Public Shared AppConfig As AppConfig - Private ReadOnly _session As Session Private ReadOnly _logger As Logger Private _request As Request = Nothing @@ -29,13 +24,6 @@ Public Class EDMService Dim oUsername = oOperationContext.ServiceSecurityContext.WindowsIdentity.Name _logger = LogConfig.GetLogger() - _session = New Session(oUsername) - - RaiseEvent ClientConnectedEvent(Me, _session) - End Sub - - Public Sub Dispose() Implements IDisposable.Dispose - RaiseEvent ClientDisconnectedEvent(Me, _session) End Sub #Region "Request" diff --git a/SERVICES/DDEDM_NetworkService/EDMWindowsService.vb b/SERVICES/DDEDM_NetworkService/WindowsService.vb similarity index 97% rename from SERVICES/DDEDM_NetworkService/EDMWindowsService.vb rename to SERVICES/DDEDM_NetworkService/WindowsService.vb index 67b30681..16830755 100644 --- a/SERVICES/DDEDM_NetworkService/EDMWindowsService.vb +++ b/SERVICES/DDEDM_NetworkService/WindowsService.vb @@ -5,7 +5,7 @@ Imports DigitalData.Modules.Logging Imports DigitalData.Modules.Database Imports DigitalData.Modules.Database.Exceptions -Public Class EDMWindowsService +Public Class WindowsService Inherits ServiceBase Private _serviceHost As ServiceHost = Nothing @@ -23,7 +23,7 @@ Public Class EDMWindowsService End Sub Public Shared Sub Main() - Run(New EDMWindowsService()) + Run(New WindowsService()) End Sub Protected Overrides Sub OnStart(ByVal args As String()) diff --git a/SERVICES/DDEDM_NetworkService/packages.config b/SERVICES/DDEDM_NetworkService/packages.config new file mode 100644 index 00000000..9204b8da --- /dev/null +++ b/SERVICES/DDEDM_NetworkService/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file From 35ec578535f545bdd82cdb6b424ee727db80b54b Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Mon, 4 Feb 2019 16:27:49 +0100 Subject: [PATCH 09/23] jj: License Module --- DDLicenseService/AppConfig.vb | 12 ++ DDLicenseService/DDEDMLicenseService.vbproj | 5 +- DDLicenseService/WindowsService.vb | 2 +- DDLicenseService/app.config | 28 +--- DDMonorepo.sln | 7 + EDMI_ClientSuite/EDMI_ClientSuite.vbproj | 10 +- EDMI_ClientSuite/frmMain.vb | 18 +-- Message/My Project/AssemblyInfo.vb | 4 +- Modules.License/License.vbproj | 129 ++++++++++++++++++ Modules.License/LicenseFile.vb | 51 +++++++ .../LicenseSchema.vb | 14 +- .../LicenseSchema.xsd | 2 +- .../My Project/Application.Designer.vb | 13 ++ Modules.License/My Project/Application.myapp | 10 ++ Modules.License/My Project/AssemblyInfo.vb | 35 +++++ .../My Project/Resources.Designer.vb | 63 +++++++++ Modules.License/My Project/Resources.resx | 117 ++++++++++++++++ .../My Project/Settings.Designer.vb | 73 ++++++++++ Modules.License/My Project/Settings.settings | 7 + Modules.License/packages.config | 4 + 20 files changed, 549 insertions(+), 55 deletions(-) create mode 100644 DDLicenseService/AppConfig.vb create mode 100644 Modules.License/License.vbproj create mode 100644 Modules.License/LicenseFile.vb rename {EDMI_ClientSuite/License => Modules.License}/LicenseSchema.vb (96%) rename {EDMI_ClientSuite/License => Modules.License}/LicenseSchema.xsd (99%) create mode 100644 Modules.License/My Project/Application.Designer.vb create mode 100644 Modules.License/My Project/Application.myapp create mode 100644 Modules.License/My Project/AssemblyInfo.vb create mode 100644 Modules.License/My Project/Resources.Designer.vb create mode 100644 Modules.License/My Project/Resources.resx create mode 100644 Modules.License/My Project/Settings.Designer.vb create mode 100644 Modules.License/My Project/Settings.settings create mode 100644 Modules.License/packages.config diff --git a/DDLicenseService/AppConfig.vb b/DDLicenseService/AppConfig.vb new file mode 100644 index 00000000..5503ef49 --- /dev/null +++ b/DDLicenseService/AppConfig.vb @@ -0,0 +1,12 @@ +Imports System.Configuration + +Public Class AppConfig + Public Shared ConfigPath As String + + Public Shared Sub Load() + With ConfigurationManager.AppSettings + ConfigPath = .Item("CONFIG_PATH") + End With + End Sub +End Class + diff --git a/DDLicenseService/DDEDMLicenseService.vbproj b/DDLicenseService/DDEDMLicenseService.vbproj index 2bd7fe17..6be2d11c 100644 --- a/DDLicenseService/DDEDMLicenseService.vbproj +++ b/DDLicenseService/DDEDMLicenseService.vbproj @@ -44,7 +44,7 @@ On - DDLicenseService.EDMWindowsService + DDLicenseService.WindowsService @@ -79,6 +79,7 @@ + @@ -114,7 +115,7 @@ - + MyApplicationCodeGenerator Application.Designer.vb diff --git a/DDLicenseService/WindowsService.vb b/DDLicenseService/WindowsService.vb index f3ac05f7..d1bdcfca 100644 --- a/DDLicenseService/WindowsService.vb +++ b/DDLicenseService/WindowsService.vb @@ -26,7 +26,7 @@ Public Class WindowsService Protected Overrides Sub OnStart(ByVal args As String()) Try - _logConfig = New LogConfig(LogConfig.PathType.CustomPath, "E:\EDMService") + _logConfig = New LogConfig(LogConfig.PathType.CustomPath, AppConfig.ConfigPath) _logger = _logConfig.GetLogger() _logger.Info("Service {0} is starting", SERVICE_DISPLAY_NAME) diff --git a/DDLicenseService/app.config b/DDLicenseService/app.config index fffa925f..0997aa57 100644 --- a/DDLicenseService/app.config +++ b/DDLicenseService/app.config @@ -1,28 +1,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + + + diff --git a/DDMonorepo.sln b/DDMonorepo.sln index 1dd85fdb..31b83654 100644 --- a/DDMonorepo.sln +++ b/DDMonorepo.sln @@ -67,6 +67,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ClientSuiteTest", "DXApplic EndProject Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "DDEDMLicenseService", "DDLicenseService\DDEDMLicenseService.vbproj", "{CBE9322E-67A1-4CC5-B25F-4A1B4C9FC55C}" EndProject +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "License", "Modules.License\License.vbproj", "{5EBACBFA-F11A-4BBF-8D02-91461F2293ED}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -165,6 +167,10 @@ Global {CBE9322E-67A1-4CC5-B25F-4A1B4C9FC55C}.Debug|Any CPU.Build.0 = Debug|Any CPU {CBE9322E-67A1-4CC5-B25F-4A1B4C9FC55C}.Release|Any CPU.ActiveCfg = Release|Any CPU {CBE9322E-67A1-4CC5-B25F-4A1B4C9FC55C}.Release|Any CPU.Build.0 = Release|Any CPU + {5EBACBFA-F11A-4BBF-8D02-91461F2293ED}.Debug|Any CPU.ActiveCfg = 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.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -193,6 +199,7 @@ Global {5B1171DC-FFFE-4813-A20D-786AAE47B320} = {3E2008C8-27B1-41DD-9B1A-0C4029F6AECC} {221FDADA-D849-4036-A7CE-D1FC1D67E1FA} = {8FFE925E-8B84-45F1-93CB-32B1C96F41EB} {CBE9322E-67A1-4CC5-B25F-4A1B4C9FC55C} = {7AF3F9C2-C939-4A08-95C1-0453207E298A} + {5EBACBFA-F11A-4BBF-8D02-91461F2293ED} = {3E2008C8-27B1-41DD-9B1A-0C4029F6AECC} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {C1BE4090-A0FD-48AF-86CB-39099D14B286} diff --git a/EDMI_ClientSuite/EDMI_ClientSuite.vbproj b/EDMI_ClientSuite/EDMI_ClientSuite.vbproj index 8da0a440..7370d18d 100644 --- a/EDMI_ClientSuite/EDMI_ClientSuite.vbproj +++ b/EDMI_ClientSuite/EDMI_ClientSuite.vbproj @@ -248,9 +248,6 @@ Form - - LicenseSchema.xsd - True @@ -367,9 +364,6 @@ Designer - - Designer - MyApplicationCodeGenerator @@ -438,6 +432,10 @@ {3DCD6D1A-C830-4241-B7E4-27430E7EA483} LookupControl + + {5ebacbfa-f11a-4bbf-8d02-91461f2293ed} + License + {903b2d7d-3b80-4be9-8713-7447b704e1b0} Logging diff --git a/EDMI_ClientSuite/frmMain.vb b/EDMI_ClientSuite/frmMain.vb index 510e1f1a..b9133050 100644 --- a/EDMI_ClientSuite/frmMain.vb +++ b/EDMI_ClientSuite/frmMain.vb @@ -6,6 +6,7 @@ Imports EDMI_ClientSuite.ClassLayout Imports System.IO Imports DigitalData.Modules.Logging Imports DigitalData.Modules.Logging.LogConfig +Imports DigitalData.Modules.License Public Class frmMain Private _Logger As Logger @@ -129,21 +130,16 @@ Public Class frmMain Dim oModules As New List(Of LicenseModule) oModules.Add(oModule) - Dim oLicense = New License() With { + Dim oLicense = New LicenseSchema() With { .Modules = oModules.ToArray } - Dim oSerializer As New Xml.Serialization.XmlSerializer(GetType(License)) + Dim oLicenseFile As New LicenseFile(My.LogConfig, "E:\") + oLicenseFile.SaveFile(oLicense) - Using oStream = New FileStream("E:\license.xml", FileMode.Create) - oSerializer.Serialize(oStream, oLicense) - oStream.Flush() - End Using + Dim oSerializer As New Xml.Serialization.XmlSerializer(GetType(LicenseSchema)) + Dim oLicense2 As LicenseSchema - Dim oLicense2 As License - - Using oReader As New StreamReader("E:\license.xml") - oLicense2 = oSerializer.Deserialize(oReader) - End Using + oLicense2 = oLicenseFile.LoadFile() End Sub End Class \ No newline at end of file diff --git a/Message/My Project/AssemblyInfo.vb b/Message/My Project/AssemblyInfo.vb index f862895e..b6fdfd76 100644 --- a/Message/My Project/AssemblyInfo.vb +++ b/Message/My Project/AssemblyInfo.vb @@ -8,10 +8,10 @@ Imports System.Runtime.InteropServices ' Werte der Assemblyattribute überprüfen - + - + diff --git a/Modules.License/License.vbproj b/Modules.License/License.vbproj new file mode 100644 index 00000000..e944f4ee --- /dev/null +++ b/Modules.License/License.vbproj @@ -0,0 +1,129 @@ + + + + + Debug + AnyCPU + {5EBACBFA-F11A-4BBF-8D02-91461F2293ED} + Library + DigitalData.Modules.License + DigitalData.Modules.License + 512 + Windows + v4.6.1 + + + true + full + true + true + bin\Debug\ + DigitalData.Modules.License.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + pdbonly + false + true + true + bin\Release\ + DigitalData.Modules.License.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + On + + + Binary + + + Off + + + On + + + + + ..\packages\NLog.4.5.11\lib\net45\NLog.dll + + + + + + + + + + + + + + + + + + + + + + + + + + + + + LicenseSchema.xsd + + + + True + Application.myapp + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + + VbMyResourcesResXFileCodeGenerator + Resources.Designer.vb + My.Resources + Designer + + + + + Designer + + + MyApplicationCodeGenerator + Application.Designer.vb + + + SettingsSingleFileGenerator + My + Settings.Designer.vb + + + + + + {991d0231-4623-496d-8bd0-9ca906029cbc} + Filesystem + + + {903b2d7d-3b80-4be9-8713-7447b704e1b0} + Logging + + + + \ No newline at end of file diff --git a/Modules.License/LicenseFile.vb b/Modules.License/LicenseFile.vb new file mode 100644 index 00000000..1be668c3 --- /dev/null +++ b/Modules.License/LicenseFile.vb @@ -0,0 +1,51 @@ +Imports System.IO +Imports System.Xml.Serialization +Imports DigitalData.Modules.Logging + +Public Class LicenseFile + Public Const LICENSE_FILENAME = "License.xml" + + Public ReadOnly Path As String + Private _Logger As Logger + + Public Sub New(LogConfig As LogConfig, Path As String) + Me.Path = Path + _Logger = LogConfig.GetLogger() + End Sub + + Private Function GetSerializer() As XmlSerializer + Dim oSerializer As New XmlSerializer(GetType(LicenseSchema)) + Return oSerializer + End Function + + Public Function LoadFile(Optional FileName As String = LICENSE_FILENAME) As LicenseSchema + Try + Dim oSerializer = GetSerializer() + Dim oFilePath As String = IO.Path.Combine(Path, FileName) + Dim oLicense As LicenseSchema + + Using oReader As New StreamReader(oFilePath) + oLicense = oSerializer.Deserialize(oReader) + End Using + + Return oLicense + Catch ex As Exception + _Logger.Error(ex) + Throw ex + End Try + End Function + + Public Sub SaveFile(License As LicenseSchema, Optional FileName As String = LICENSE_FILENAME) + Try + Dim oSerializer = GetSerializer() + + Using oStream = New FileStream(FileName, FileMode.Create, FileAccess.Write) + oSerializer.Serialize(oStream, License) + oStream.Flush() + End Using + Catch ex As Exception + _Logger.Error(ex) + Throw ex + End Try + End Sub +End Class diff --git a/EDMI_ClientSuite/License/LicenseSchema.vb b/Modules.License/LicenseSchema.vb similarity index 96% rename from EDMI_ClientSuite/License/LicenseSchema.vb rename to Modules.License/LicenseSchema.vb index 9c0e1b20..1fcda6f8 100644 --- a/EDMI_ClientSuite/License/LicenseSchema.vb +++ b/Modules.License/LicenseSchema.vb @@ -22,20 +22,20 @@ Imports System.Xml.Serialization System.SerializableAttribute(), _ System.Diagnostics.DebuggerStepThroughAttribute(), _ System.ComponentModel.DesignerCategoryAttribute("code"), _ - System.Xml.Serialization.XmlTypeAttribute(AnonymousType:=true, [Namespace]:="http://tempuri.org/LicenseSchema.xsd"), _ - System.Xml.Serialization.XmlRootAttribute([Namespace]:="http://tempuri.org/LicenseSchema.xsd", IsNullable:=false)> _ -Partial Public Class License - + System.Xml.Serialization.XmlTypeAttribute(AnonymousType:=true, [Namespace]:="http://tempuri.org/LicenseSchema.xsd"), + System.Xml.Serialization.XmlRootAttribute([Namespace]:="http://tempuri.org/LicenseSchema.xsd", IsNullable:=False)> +Partial Public Class LicenseSchema + Private modulesField() As LicenseModule - + ''' - _ + Public Property Modules() As LicenseModule() Get Return Me.modulesField End Get Set - Me.modulesField = value + Me.modulesField = Value End Set End Property End Class diff --git a/EDMI_ClientSuite/License/LicenseSchema.xsd b/Modules.License/LicenseSchema.xsd similarity index 99% rename from EDMI_ClientSuite/License/LicenseSchema.xsd rename to Modules.License/LicenseSchema.xsd index 83b3b7be..34a4f742 100644 --- a/EDMI_ClientSuite/License/LicenseSchema.xsd +++ b/Modules.License/LicenseSchema.xsd @@ -47,5 +47,5 @@ - + diff --git a/Modules.License/My Project/Application.Designer.vb b/Modules.License/My Project/Application.Designer.vb new file mode 100644 index 00000000..8ab460ba --- /dev/null +++ b/Modules.License/My Project/Application.Designer.vb @@ -0,0 +1,13 @@ +'------------------------------------------------------------------------------ +' +' Dieser Code wurde von einem Tool generiert. +' Laufzeitversion:4.0.30319.42000 +' +' Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn +' der Code erneut generiert wird. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + diff --git a/Modules.License/My Project/Application.myapp b/Modules.License/My Project/Application.myapp new file mode 100644 index 00000000..758895de --- /dev/null +++ b/Modules.License/My Project/Application.myapp @@ -0,0 +1,10 @@ + + + false + false + 0 + true + 0 + 1 + true + diff --git a/Modules.License/My Project/AssemblyInfo.vb b/Modules.License/My Project/AssemblyInfo.vb new file mode 100644 index 00000000..8a2b13b6 --- /dev/null +++ b/Modules.License/My Project/AssemblyInfo.vb @@ -0,0 +1,35 @@ +Imports System +Imports System.Reflection +Imports System.Runtime.InteropServices + +' Allgemeine Informationen über eine Assembly werden über die folgenden +' Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, +' die einer Assembly zugeordnet sind. + +' Werte der Assemblyattribute überprüfen + + + + + + + + + + +'Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird. + + +' Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten: +' +' Hauptversion +' Nebenversion +' Buildnummer +' Revision +' +' Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden, +' übernehmen, indem Sie "*" eingeben: +' + + + diff --git a/Modules.License/My Project/Resources.Designer.vb b/Modules.License/My Project/Resources.Designer.vb new file mode 100644 index 00000000..56b61925 --- /dev/null +++ b/Modules.License/My Project/Resources.Designer.vb @@ -0,0 +1,63 @@ +'------------------------------------------------------------------------------ +' +' Dieser Code wurde von einem Tool generiert. +' Laufzeitversion:4.0.30319.42000 +' +' Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn +' der Code erneut generiert wird. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + +Imports System + +Namespace My.Resources + + 'Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert + '-Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert. + 'Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen + 'mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu. + ''' + ''' Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw. + ''' + _ + Friend Module Resources + + Private resourceMan As Global.System.Resources.ResourceManager + + Private resourceCulture As Global.System.Globalization.CultureInfo + + ''' + ''' Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird. + ''' + _ + Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager + Get + If Object.ReferenceEquals(resourceMan, Nothing) Then + Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("DigitalData.Modules.License.Resources", GetType(Resources).Assembly) + resourceMan = temp + End If + Return resourceMan + End Get + End Property + + ''' + ''' Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle + ''' Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden. + ''' + _ + Friend Property Culture() As Global.System.Globalization.CultureInfo + Get + Return resourceCulture + End Get + Set + resourceCulture = value + End Set + End Property + End Module +End Namespace diff --git a/Modules.License/My Project/Resources.resx b/Modules.License/My Project/Resources.resx new file mode 100644 index 00000000..af7dbebb --- /dev/null +++ b/Modules.License/My Project/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Modules.License/My Project/Settings.Designer.vb b/Modules.License/My Project/Settings.Designer.vb new file mode 100644 index 00000000..de8d4535 --- /dev/null +++ b/Modules.License/My Project/Settings.Designer.vb @@ -0,0 +1,73 @@ +'------------------------------------------------------------------------------ +' +' Dieser Code wurde von einem Tool generiert. +' Laufzeitversion:4.0.30319.42000 +' +' Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn +' der Code erneut generiert wird. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + _ + Partial Friend NotInheritable Class MySettings + Inherits Global.System.Configuration.ApplicationSettingsBase + + Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings) + +#Region "Automatische My.Settings-Speicherfunktion" +#If _MyType = "WindowsForms" Then + Private Shared addedHandler As Boolean + + Private Shared addedHandlerLockObject As New Object + + _ + Private Shared Sub AutoSaveSettings(sender As Global.System.Object, e As Global.System.EventArgs) + If My.Application.SaveMySettingsOnExit Then + My.Settings.Save() + End If + End Sub +#End If +#End Region + + Public Shared ReadOnly Property [Default]() As MySettings + Get + +#If _MyType = "WindowsForms" Then + If Not addedHandler Then + SyncLock addedHandlerLockObject + If Not addedHandler Then + AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings + addedHandler = True + End If + End SyncLock + End If +#End If + Return defaultInstance + End Get + End Property + End Class +End Namespace + +Namespace My + + _ + Friend Module MySettingsProperty + + _ + Friend ReadOnly Property Settings() As Global.DigitalData.Modules.License.My.MySettings + Get + Return Global.DigitalData.Modules.License.My.MySettings.Default + End Get + End Property + End Module +End Namespace diff --git a/Modules.License/My Project/Settings.settings b/Modules.License/My Project/Settings.settings new file mode 100644 index 00000000..85b890b3 --- /dev/null +++ b/Modules.License/My Project/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Modules.License/packages.config b/Modules.License/packages.config new file mode 100644 index 00000000..f89fa324 --- /dev/null +++ b/Modules.License/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file From 69286492cab45c42e7641f32680a5eff58620916 Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Tue, 5 Feb 2019 13:36:10 +0100 Subject: [PATCH 10/23] jj --- EDMI_ClientSuite/EDMI_ClientSuite.vbproj | 10 +- .../EntityDesigner/frmEntityDesigner.vb | 7 +- EDMI_ClientSuite/MyApplication.vb | 1 + ...er.vb => ProcessManagerWidget.Designer.vb} | 2 +- ...verview.resx => ProcessManagerWidget.resx} | 0 ...gerOverview.vb => ProcessManagerWidget.vb} | 2 +- EDMI_ClientSuite/frmFileTest.vb | 8 +- EDMI_ClientSuite/frmMain.Designer.vb | 57 +++++++----- EDMI_ClientSuite/frmMain.resx | 91 +------------------ EDMI_ClientSuite/frmMain.vb | 33 +++---- 10 files changed, 68 insertions(+), 143 deletions(-) rename EDMI_ClientSuite/UserControls/{ProcessManagerOverview.Designer.vb => ProcessManagerWidget.Designer.vb} (98%) rename EDMI_ClientSuite/UserControls/{ProcessManagerOverview.resx => ProcessManagerWidget.resx} (100%) rename EDMI_ClientSuite/UserControls/{ProcessManagerOverview.vb => ProcessManagerWidget.vb} (94%) diff --git a/EDMI_ClientSuite/EDMI_ClientSuite.vbproj b/EDMI_ClientSuite/EDMI_ClientSuite.vbproj index 7370d18d..03abdef7 100644 --- a/EDMI_ClientSuite/EDMI_ClientSuite.vbproj +++ b/EDMI_ClientSuite/EDMI_ClientSuite.vbproj @@ -275,10 +275,10 @@ True ControlProperties.en.resx - - ProcessManagerOverview.vb + + ProcessManagerWidget.vb - + UserControl @@ -330,8 +330,8 @@ ControlProperties.Designer.vb My.Resources - - ProcessManagerOverview.vb + + ProcessManagerWidget.vb diff --git a/EDMI_ClientSuite/EntityDesigner/frmEntityDesigner.vb b/EDMI_ClientSuite/EntityDesigner/frmEntityDesigner.vb index 9e0a47ee..34ed1fc6 100644 --- a/EDMI_ClientSuite/EntityDesigner/frmEntityDesigner.vb +++ b/EDMI_ClientSuite/EntityDesigner/frmEntityDesigner.vb @@ -1,4 +1,5 @@ -Imports DevExpress.XtraEditors.Repository +Imports System.ComponentModel +Imports DevExpress.XtraEditors.Repository Imports DevExpress.XtraVerticalGrid Imports EDMI_ClientSuite.ClassControlUtils Imports EDMI_ClientSuite.ControlProperties @@ -254,4 +255,8 @@ Public Class frmEntityDesigner End If End Select End Sub + + Private Sub frmEntityDesigner_Closing(sender As Object, e As CancelEventArgs) Handles Me.Closing + My.MainForm.RibbonPageCategoryEntityDesigner.Visible = False + End Sub End Class \ No newline at end of file diff --git a/EDMI_ClientSuite/MyApplication.vb b/EDMI_ClientSuite/MyApplication.vb index d1dabc6e..228e18b1 100644 --- a/EDMI_ClientSuite/MyApplication.vb +++ b/EDMI_ClientSuite/MyApplication.vb @@ -13,6 +13,7 @@ Namespace My Property LogConfig As LogConfig Property ChannelFactory As ChannelFactory(Of IEDMServiceChannel) Property Channel As IEDMServiceChannel + Property MainForm As frmMain End Module ''' diff --git a/EDMI_ClientSuite/UserControls/ProcessManagerOverview.Designer.vb b/EDMI_ClientSuite/UserControls/ProcessManagerWidget.Designer.vb similarity index 98% rename from EDMI_ClientSuite/UserControls/ProcessManagerOverview.Designer.vb rename to EDMI_ClientSuite/UserControls/ProcessManagerWidget.Designer.vb index 685b7288..ba4e5736 100644 --- a/EDMI_ClientSuite/UserControls/ProcessManagerOverview.Designer.vb +++ b/EDMI_ClientSuite/UserControls/ProcessManagerWidget.Designer.vb @@ -1,5 +1,5 @@  _ -Partial Class ProcessManagerOverview +Partial Class ProcessManagerWidget Inherits System.Windows.Forms.UserControl 'UserControl überschreibt den Löschvorgang, um die Komponentenliste zu bereinigen. diff --git a/EDMI_ClientSuite/UserControls/ProcessManagerOverview.resx b/EDMI_ClientSuite/UserControls/ProcessManagerWidget.resx similarity index 100% rename from EDMI_ClientSuite/UserControls/ProcessManagerOverview.resx rename to EDMI_ClientSuite/UserControls/ProcessManagerWidget.resx diff --git a/EDMI_ClientSuite/UserControls/ProcessManagerOverview.vb b/EDMI_ClientSuite/UserControls/ProcessManagerWidget.vb similarity index 94% rename from EDMI_ClientSuite/UserControls/ProcessManagerOverview.vb rename to EDMI_ClientSuite/UserControls/ProcessManagerWidget.vb index 2139cd09..7a02571e 100644 --- a/EDMI_ClientSuite/UserControls/ProcessManagerOverview.vb +++ b/EDMI_ClientSuite/UserControls/ProcessManagerWidget.vb @@ -1,4 +1,4 @@ -Public Class ProcessManagerOverview +Public Class ProcessManagerWidget Public Delegate Sub RowDoubleClickedDelegate(RowView As DataRowView) Public Event RowDoubleClicked As RowDoubleClickedDelegate diff --git a/EDMI_ClientSuite/frmFileTest.vb b/EDMI_ClientSuite/frmFileTest.vb index a8130db6..0928c1c5 100644 --- a/EDMI_ClientSuite/frmFileTest.vb +++ b/EDMI_ClientSuite/frmFileTest.vb @@ -3,19 +3,17 @@ Imports DigitalData.Modules.Logging Public Class frmFileTest Private _fileOp As FileOp - Private _LogConfig As LogConfig Private _Logger As Logger - Public Sub New(LogConfig As LogConfig) + Public Sub New() InitializeComponent() - _LogConfig = LogConfig - _Logger = LogConfig.GetLogger() + _Logger = My.LogConfig.GetLogger() End Sub Private Sub frmFileTest_Load(sender As Object, e As EventArgs) Handles Me.Load Try - _fileOp = New FileOp(_LogConfig, My.Settings.EDM_NetworkService_Adress) + _fileOp = New FileOp(My.LogConfig, My.Settings.EDM_NetworkService_Adress) Catch ex As Exception _Logger.Warn($"Unexpected error in frmFileTest_Load: {ex.Message}") diff --git a/EDMI_ClientSuite/frmMain.Designer.vb b/EDMI_ClientSuite/frmMain.Designer.vb index 3e5b83fb..aa629754 100644 --- a/EDMI_ClientSuite/frmMain.Designer.vb +++ b/EDMI_ClientSuite/frmMain.Designer.vb @@ -21,6 +21,7 @@ Partial Class frmMain Private Sub InitializeComponent() Me.components = New System.ComponentModel.Container() Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmMain)) + Dim PushTransition1 As DevExpress.Utils.Animation.PushTransition = New DevExpress.Utils.Animation.PushTransition() Me.RibbonControl = New DevExpress.XtraBars.Ribbon.RibbonControl() Me.MainMenu = New DevExpress.XtraBars.Ribbon.ApplicationMenu(Me.components) Me.BarButtonExit = New DevExpress.XtraBars.BarButtonItem() @@ -36,6 +37,7 @@ Partial Class frmMain Me.BarButtonEntityDesigner = New DevExpress.XtraBars.BarButtonItem() Me.BarButtonDeleteControl = New DevExpress.XtraBars.BarButtonItem() Me.LabelCurrentLanguage = New DevExpress.XtraBars.BarStaticItem() + Me.BarButtonItem2 = New DevExpress.XtraBars.BarButtonItem() Me.RibbonPageCategoryEntityDesigner = New DevExpress.XtraBars.Ribbon.RibbonPageCategory() Me.RibbonPageControlActions = New DevExpress.XtraBars.Ribbon.RibbonPage() Me.RibbonPageGroup5 = New DevExpress.XtraBars.Ribbon.RibbonPageGroup() @@ -56,8 +58,9 @@ Partial Class frmMain Me.Label1 = New System.Windows.Forms.Label() Me.DockPanelProcessManager = New DevExpress.XtraBars.Docking.DockPanel() Me.DockPanel2_Container = New DevExpress.XtraBars.Docking.ControlContainer() - Me.ProcessManagerOverview = New EDMI_ClientSuite.ProcessManagerOverview() - Me.BarButtonItem2 = New DevExpress.XtraBars.BarButtonItem() + Me.ProcessManagerWidget = New EDMI_ClientSuite.ProcessManagerWidget() + Me.BarWorkspaceMenuItem1 = New DevExpress.XtraBars.BarWorkspaceMenuItem() + Me.WorkspaceManager1 = New DevExpress.Utils.WorkspaceManager() CType(Me.RibbonControl, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.MainMenu, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.DocumentManager, System.ComponentModel.ISupportInitialize).BeginInit() @@ -74,12 +77,13 @@ Partial Class frmMain ' Me.RibbonControl.ApplicationButtonDropDownControl = Me.MainMenu Me.RibbonControl.ExpandCollapseItem.Id = 0 - Me.RibbonControl.Items.AddRange(New DevExpress.XtraBars.BarItem() {Me.RibbonControl.ExpandCollapseItem, Me.BarButtonExit, Me.BarButtonUserSettings, Me.LabelCurrentUser, Me.LabelCurrentMachine, Me.LabelCurrentVersion, Me.BarButtonItem1, Me.BarButtonDock1, Me.SkinDropDownButtonItem1, Me.BarButtonDashboard, Me.BarButtonEntityDesigner, Me.BarButtonDeleteControl, Me.BarButtonConnectionSettings, Me.LabelCurrentLanguage, Me.BarButtonItem2}) + Me.RibbonControl.Items.AddRange(New DevExpress.XtraBars.BarItem() {Me.RibbonControl.ExpandCollapseItem, Me.BarButtonExit, Me.BarButtonUserSettings, Me.LabelCurrentUser, Me.LabelCurrentMachine, Me.LabelCurrentVersion, Me.BarButtonItem1, Me.BarButtonDock1, Me.SkinDropDownButtonItem1, Me.BarButtonDashboard, Me.BarButtonEntityDesigner, Me.BarButtonDeleteControl, Me.BarButtonConnectionSettings, Me.LabelCurrentLanguage, Me.BarButtonItem2, Me.BarWorkspaceMenuItem1}) Me.RibbonControl.Location = New System.Drawing.Point(0, 0) - Me.RibbonControl.MaxItemId = 17 + Me.RibbonControl.MaxItemId = 18 Me.RibbonControl.Name = "RibbonControl" Me.RibbonControl.PageCategories.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPageCategory() {Me.RibbonPageCategoryEntityDesigner}) Me.RibbonControl.PageHeaderItemLinks.Add(Me.SkinDropDownButtonItem1) + Me.RibbonControl.PageHeaderItemLinks.Add(Me.BarWorkspaceMenuItem1) Me.RibbonControl.Pages.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPage() {Me.RibbonPageStart, Me.RibbonPageView, Me.RibbonPageWorkflow}) Me.RibbonControl.Size = New System.Drawing.Size(1139, 146) Me.RibbonControl.StatusBar = Me.RibbonStatusBar @@ -117,15 +121,12 @@ Partial Class frmMain ' Me.LabelCurrentUser.Caption = "Current User" Me.LabelCurrentUser.Id = 3 - Me.LabelCurrentUser.ImageOptions.Image = CType(resources.GetObject("LabelCurrentUser.ImageOptions.Image"), System.Drawing.Image) - Me.LabelCurrentUser.ImageOptions.LargeImage = CType(resources.GetObject("LabelCurrentUser.ImageOptions.LargeImage"), System.Drawing.Image) Me.LabelCurrentUser.Name = "LabelCurrentUser" ' 'LabelCurrentMachine ' Me.LabelCurrentMachine.Caption = "Current Machine" Me.LabelCurrentMachine.Id = 4 - Me.LabelCurrentMachine.ImageOptions.Image = CType(resources.GetObject("LabelCurrentMachine.ImageOptions.Image"), System.Drawing.Image) Me.LabelCurrentMachine.Name = "LabelCurrentMachine" ' 'LabelCurrentVersion @@ -133,7 +134,6 @@ Partial Class frmMain Me.LabelCurrentVersion.Alignment = DevExpress.XtraBars.BarItemLinkAlignment.Right Me.LabelCurrentVersion.Caption = "Current Version" Me.LabelCurrentVersion.Id = 5 - Me.LabelCurrentVersion.ImageOptions.Image = CType(resources.GetObject("LabelCurrentVersion.ImageOptions.Image"), System.Drawing.Image) Me.LabelCurrentVersion.Name = "LabelCurrentVersion" ' 'BarButtonItem1 @@ -179,13 +179,20 @@ Partial Class frmMain ' 'LabelCurrentLanguage ' - Me.LabelCurrentLanguage.Caption = "BarStaticItem1" + Me.LabelCurrentLanguage.Caption = "CurrentLanguage" Me.LabelCurrentLanguage.Id = 15 Me.LabelCurrentLanguage.Name = "LabelCurrentLanguage" ' + 'BarButtonItem2 + ' + Me.BarButtonItem2.Caption = "License Test" + Me.BarButtonItem2.Id = 16 + Me.BarButtonItem2.Name = "BarButtonItem2" + ' 'RibbonPageCategoryEntityDesigner ' Me.RibbonPageCategoryEntityDesigner.AutoStretchPageHeaders = True + Me.RibbonPageCategoryEntityDesigner.Color = System.Drawing.Color.Red Me.RibbonPageCategoryEntityDesigner.Name = "RibbonPageCategoryEntityDesigner" Me.RibbonPageCategoryEntityDesigner.Pages.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPage() {Me.RibbonPageControlActions}) Me.RibbonPageCategoryEntityDesigner.Text = "Entitäten Designer" @@ -335,7 +342,7 @@ Partial Class frmMain ' 'DockPanel2_Container ' - Me.DockPanel2_Container.Controls.Add(Me.ProcessManagerOverview) + Me.DockPanel2_Container.Controls.Add(Me.ProcessManagerWidget) Me.DockPanel2_Container.Location = New System.Drawing.Point(5, 38) Me.DockPanel2_Container.Name = "DockPanel2_Container" Me.DockPanel2_Container.Size = New System.Drawing.Size(337, 163) @@ -343,18 +350,24 @@ Partial Class frmMain ' 'ProcessManagerOverview ' - Me.ProcessManagerOverview.DataSource = Nothing - Me.ProcessManagerOverview.Dock = System.Windows.Forms.DockStyle.Fill - Me.ProcessManagerOverview.Location = New System.Drawing.Point(0, 0) - Me.ProcessManagerOverview.Name = "ProcessManagerOverview" - Me.ProcessManagerOverview.Size = New System.Drawing.Size(337, 163) - Me.ProcessManagerOverview.TabIndex = 0 + Me.ProcessManagerWidget.DataSource = Nothing + Me.ProcessManagerWidget.Dock = System.Windows.Forms.DockStyle.Fill + Me.ProcessManagerWidget.Location = New System.Drawing.Point(0, 0) + Me.ProcessManagerWidget.Name = "ProcessManagerOverview" + Me.ProcessManagerWidget.Size = New System.Drawing.Size(337, 163) + Me.ProcessManagerWidget.TabIndex = 0 ' - 'BarButtonItem2 + 'BarWorkspaceMenuItem1 ' - Me.BarButtonItem2.Caption = "License Test" - Me.BarButtonItem2.Id = 16 - Me.BarButtonItem2.Name = "BarButtonItem2" + Me.BarWorkspaceMenuItem1.Caption = "BarWorkspaceMenuItem1" + Me.BarWorkspaceMenuItem1.Id = 17 + Me.BarWorkspaceMenuItem1.Name = "BarWorkspaceMenuItem1" + Me.BarWorkspaceMenuItem1.WorkspaceManager = Me.WorkspaceManager1 + ' + 'WorkspaceManager1 + ' + Me.WorkspaceManager1.TargetControl = Me + Me.WorkspaceManager1.TransitionType = PushTransition1 ' 'frmMain ' @@ -411,7 +424,7 @@ Partial Class frmMain Friend WithEvents SkinDropDownButtonItem1 As DevExpress.XtraBars.SkinDropDownButtonItem Friend WithEvents BarButtonDashboard As DevExpress.XtraBars.BarButtonItem Friend WithEvents RibbonPageGroup3 As DevExpress.XtraBars.Ribbon.RibbonPageGroup - Friend WithEvents ProcessManagerOverview As ProcessManagerOverview + Friend WithEvents ProcessManagerWidget As ProcessManagerWidget Friend WithEvents RibbonPageWorkflow As DevExpress.XtraBars.Ribbon.RibbonPage Friend WithEvents RibbonPageGroup4 As DevExpress.XtraBars.Ribbon.RibbonPageGroup Friend WithEvents BarButtonEntityDesigner As DevExpress.XtraBars.BarButtonItem @@ -422,4 +435,6 @@ Partial Class frmMain Friend WithEvents BarButtonConnectionSettings As DevExpress.XtraBars.BarButtonItem Friend WithEvents LabelCurrentLanguage As DevExpress.XtraBars.BarStaticItem Friend WithEvents BarButtonItem2 As DevExpress.XtraBars.BarButtonItem + Friend WithEvents BarWorkspaceMenuItem1 As DevExpress.XtraBars.BarWorkspaceMenuItem + Friend WithEvents WorkspaceManager1 As DevExpress.Utils.WorkspaceManager End Class diff --git a/EDMI_ClientSuite/frmMain.resx b/EDMI_ClientSuite/frmMain.resx index 9a1ff3b1..ffd1364b 100644 --- a/EDMI_ClientSuite/frmMain.resx +++ b/EDMI_ClientSuite/frmMain.resx @@ -240,94 +240,6 @@ UgOUWsM43AyRGqDEGqa++dLn1ABd1/BY5qnbDos7khqgyxoeyXhVeA3nxddw1QPX5C8cUgPk/Bu2DofU AG03YIyuMvdCa5bC0ZhwkGGbNcwKB3QmHGQK665hVjiQZcIB04pdcSBYxdQaYlaHxMF13YQDWSY8B5k1 w9YKB7TGLAeZxaH/hgNaY5aDzJoDrBUOIYTBL0gqUmOSnmecAAAAAElFTkSuQmCC - - - - - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m - dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAAydEVYdFRpdGxlAEN1c3RvbWVyO0VtcGxveWVlO1Bl - cnNvbjtDb250YWN0O1VzZXI7Q2xpZW50fhE26AAAAM1JREFUOE+l0TEOQUEUBdBfiN4ySDQqKvTfGuxF - pbEIi5DoRcIa/gqovwKRca/MvMw8/zGhODKZd98NpnDO/eX1MVtstSHs4eIdYAxJzipowQmccoY2SNYq - 6IJeDnogWatgAk3LNAXJWgVLaFomziRrFYzgAXqZd/xzJWsV0A50Ae+S3KcCPtkNwjLP2c8YzOHo8fyW - sQo6sIL4zXnmHWeS1QUD2MAd+LXX0Pd45h1nzDCbFJRwhfCbv2G2jAuqaJirigtqNcxRS8HvXPEEp3w/ - tQHvKFEAAAAASUVORK5CYII= - - - - - iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m - dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAAydEVYdFRpdGxlAEN1c3RvbWVyO0VtcGxveWVlO1Bl - cnNvbjtDb250YWN0O1VzZXI7Q2xpZW50fhE26AAAAfhJREFUWEfF1rFLVWEYx3FBFweHwGhVamnIvdUQ - CmwI+mOiIUIXwV10cQ8aGoVcbFWCiIYgAiVHsWgwSDj+fofzHN7nvV+vDt7r8Fne87zP99x7HZxomuZW - DRw8X9m5jmV5J7/kf+dY3ssLoTtJ9FLcaLiyIc0VtoXu9qKX4kbDhadCQfJSaEcreiluNFzw104x8kFo - Ryt6KW40XPguFCM/hHa0opfiRsOFv0Ix8ltoRyt6KW40XKDQZf4J7WhFL8WNhjuLQqFhfId29b0UNxru - bApFhvEd2tX3UtxouLMmFBnGd2hX30txo+HOfTkRChHP+g7t6nspbjRceCMUI6+EdrSil+JGw4VHQjHi - WdrRil6KGw1XPgoFS7tCd3vRS3Gj4cqCnAmFzc88Q3d70Utxo2HwTE6ljv8RP6M7SfRS3Gj4Enfltfgn - +SRv5Z7Q7IDopbjRcGUSzmpTcJZEL8WNhguP5bM8KM5q/uv/Ip6l563opbjB8JysyDeJ33pPpqWenZED - iTnfWZV5SbPRS3Erhu7Ilvj/vVhY2pcn4q/bluSr0Kx3eJd3XusFHspPoWW18w49q3mnd/e9FDc9nJVD - oQU3wbtno0cvsF4Mj8p69OgFRvnpw2H06AXowo2LHr3AUT08AkfRG3iBccPDccLDccLD8WkmLgAKdExB - J+0x6AAAAABJRU5ErkJggg== - - - - - iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m - dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAAkdEVYdFRpdGxlAFNlcnZlck1vZGU7U2VydmVyO1BD - O0NvbXB1dGVyO3LY4GcAAAVXSURBVFhHrZdZUxRnGIUlccVdzPIPkov8mvyD3OTWm1R5FzVgjAkIBmWR - nRFkSzSWFYSYoIFBWUwKk1Qq5QgMy7DMDLPP9MyAb855uxsHRJqxmKqn3p6m5zvnO+/3dTd7RESxP3cH - PCwFFu+CfRb784S/2QveAQUtd56hmB9bU3U3G8CHwvzRvp6+f76CIXlb6jpHizEOzagJoB8nAype3fKo - 2P10WnyBhLzwRV/DM78VkXXm8bv+wf+kpPxuCcbbYGI7A7xgb6745BbibzZgY5qY22iCLdmRgf2N3aM4 - tXuf+o4RChwETGFbA7zgQFPXmCRTWQmGUxLIJbQRP6t1nsf+UFKWV5JmtY6jibTcaH9MgUPW+I4GDjZ0 - jUp29aUkjTVJplclboD0mtYEzsUVnEuSrMRY8Z2VRHEuqnVVUvhdbZsaKATcVY4GDjGyTNYUau0Zk9bu - cWnpHnuNZrSq2a4wTZq6R6SpC3SOSCSRkRTGqHYNU+Aw2JmBOhgw1MCqtP/0p84ilXmp1UgjGQXpMCEj - q6kwqYQmRLJy8/a4ROIZ/VuVy52XgcK6W0/EyKxpnO13/pBYyooXNaowYmDVCMFsKWjj+mFcwvG0mqlq - GaLAEeBogBccZs8MzDCaWJW2208tMQysvUVNoFLQIhzPAlM4FDNp7RmXlVgaayQj15oH8zNQg54x7ggG - diFK148AM2JtJTi2aYGQVq4TrJdmwnWBnRSMptV8ZePvFDhqje9o4EhVq1t7ygg5eAJRkxjBgMSOX49z - YDqkqXMUW9TQpK42PMrPwHX0jDsgHMvqjFY02jQizWisKxEemzWwCb9FIxaynwbw24r6hxQ4BvhwcjRw - tBI9i2PxMMImxLkuhu+vRHkTMquf4NiPm5JNQ8cT3IxSujbK6wYocBzs0AB6FjMyEowZ2NOj0og9rWBW - uccUaQSsDR2Ppf7WRhZXUkjOkLLa3/IycIw9i6F37CGF2FOu9BBqCCmEsDYUJmLB42DUQEokLXVtw7IQ - SEoIaZXW/EqBE8DRAC84zp5xezFCzmwJkRLOaMliAff5BdYgKvBBTPGzJqT2plu/ByKGfFv1gAInrfGd - DVxBz7inl2Cgvn04R9BkXQzwuW8Slzk/sGqNawg1oQ+ry9d/ycvAibLaAb2ZcMY32twmmBHhzEyGIOKW - GtRqiFGwunXwFS2DaoQL8vI1NXAK8J3A0cBJ9kwNYIbcx7rHWbfAvBumlbCCOyMr1sjsUhwpJuVSZT8F - isDODHxX/UAXFHvpQ4zzgLOZZ8TWsV1nCYRmNuFdiol3MSaLWB9ff9+Xl4FT7FkQi8fury1IsRkKLqO3 - 2PucJevsUkJmIOa1hHk8jTq9GBcfDFy8ep8Cp4GjAV5Q9A16xpvLLEU3zYxwZff/XSYl9z6S3olSXGvI - FMQoOkVxgvfGqYWoplZS0ZtroMDRwKXKPt2CpiBmhMo47Zlx33/Z9YmcnSuUs66P9WZDsSlLlHXSF9Fj - pldc/jMF3rPGdzRwmj3jFmSEFJxBtWfGQZfDSWnuPy+fniuSht5zalbFwQsIE75Ne1C9y3G5cEUNvG+N - /0YDfCNWAxcr7mvvpjkbG3t2wAvCeD7wbYhp8Dp9FYegB9c9t17Pn+Mck7tQtm6A/x84G2DPfMHEhkjN - /wc4O3NmKqQ1YgmizvEYzOI8YGVq50vv5WWgiD2b9MXkr8kQCOQQkgkPeBGQZ2DC48y/3hXbgOMaoAF9 - GH12pu7h51+4ZLfgeBjXfhpuuwj5UsqY+PLAbfPBJj58Cxg9xQ8Ajr+uuZUBpsCL6JRx0cxuwPE4LsfP - MSB7/gewyEBZy6qOBQAAAABJRU5ErkJggg== - - - - - iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m - dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAATdEVYdFRpdGxlAFppcENvZGU7Q29kZTtJsi+oAAAF - pklEQVRYR8WX+XONdxjFU9101E63nyshqKjoH1JVVa1aat9LdUyNVkOHJExWsu9LY0siFLUkV1NMtRhS - lFpqSSKR3DXJzaXz9Jzn+773XhkzLTMw85ln+b7fc477Im6EiDxTHrp8mvDXc6AXeP4pQ09669Ab9AGv - 9qDvY9LvP6D2K+AFENF7c47DkZz/izwx8gxJJL8etV4SM2uPWiEi+vCh7sA/EgjcV+ye1cDepuf8aPgt - Nuf8zD8A/LQi+poA98XbGRBfR0C8YTww4zz8zNvRHew91mwqZh+xZtbg3C3+7vuSmHWUAfozQL9gAOuy - Fw8b0QcNbAHTm3PdoXfbZzobuAvH40UF/u57Ep/pYIABGiApt14/lvDLDZfbZI/jb4vrUoNaw1p3XdJr - zpjnIGaLpleflvFLSuW9xaUyniwqldhFJaBU0qpP4Rm/uHwAlQE2bDnCAAMZoD/fBz8WO+m5S21qZLgm - u2uvSzVqdS37a2qQBkM+S0H2sQthuBCGSrGMIwuKJRawpladEpcHATxd0uW/J9+nHQoFSMxymABMCWhE - 2D8MGsQuKNHeCcYtKFKc3i5xwoDQzO7fnVcIcI5du9svnQgQl3qQAQYxwID4jDpNpQkhUnnkqlQevqJ9 - UIxmlui4+UUqqgZuGMwtlLHACXHu2q19u0XM7AIZC+yZAdYmHQgF2LilVgOoAR7YeeiK7Dx4xYhQsEcd - OxeCcwqDgjFzCtTEntvcnWF0yZhZeRID2lzmrLMrIGs27WOAwRpgffphTWUud8m2A39Jxf7L2ofolHZL - IGZ2vowBbS5jMubzPOUuDbG7S6yevDMzV9E96ECA1fF7gwEGxqUcRICAivFC+Y+XpHzfJRXhBSPaERSn - mRHs0FkNZpi5FXMrqxPPOnEORk/LBjnYcd+hAVZtqAkF4Pvg0k544myTlOz5E1yUkpqLUgyKai5I0W7D - 6Ok5klB+whLsRH9cRsEkr/K8kkt2/SG5OxskZ1eDjJqaJRvLjklLuw8wQLesXF/NAEMYYNA3eB8awEp4 - /EyjFFZfkMIqQ0HVeSmovGAM0I/6LEsSfzghLU6fPp+IMCOnZkoODLO3G7LItgbJBNGfZEpC2XEToM0n - vs5uWRFXGQqwOmEvlgF9oBXo72LX+WBiU31yx+qjYTby00xr55ORMKAJ+yAwMtUr0VO2yoiPt5odZi8C - LFu7gwGGMsDgVRt2ayr7sv07MRcssG+2BKKnZCicyQjLoBlnZscaYvjkLUrTXcyAARav2R4KsHJ9lS4p - zguZFecko+Ks9vaOF1mbgBE0hpxHTE43BpzxnMETrMMnpUsUMDsPfrb4ZeHXFQzwGgMMWfFdJZbdakKR - tLIzin3BEBKN+giCoNE6i5qUpjS2enXX2ArsCiI/TJWoiTx3y23MHgSYt6o8FGDZtzs0FcV4MaX4tCSD - JkuAaG+JRgYNrRnihD0NaGTOaOiWyA9SQKqe3W5xa4A5X5UxwOsMMHQJ3geXtuBPx65JUuHvsrkAoG5i - BZvyfpNEEDkxVdblOyBGQQ/6ozIMJsNgYmoYE1Lk7QnJsi6vTm7B/FaLCz/E/DLry5JQAL4PD5ZMa4vu - r78qCXknJSHX5leJzwHZJyUuz6FCRtCIxuU6LDNjOuz9ZGDM43JhfsclN/HsTVQGmLm8mAHe0AB8HwxA - sdt3IKjAgNhG2PGyfXYzWEO9/Qxnrc32ueEGZ+D2dcn0ZYWhAHwfXNoXQ8KGnrMNBW+w6uxUce3Da7Mz - DM4u/Sk7bWkowBC+DwZw44DVZfVarZmXgnur1/qYTFtawAD6t6Df1MXZdTOXF8kMvBetX7C3KuDH9QC4 - bFcKPQ5T5mc44K3/J3yJIQD/VeKfSn4s/5c3H4G3LNjTh+YvA/2KxG8oLwKGeVLQzIYzPXvZXxD5He1Z - 8Ky/HUvEvynFkqiPC+j6AAAAAElFTkSuQmCC @@ -403,6 +315,9 @@ UrQgwP9Df+6iycr/ls9EijOR4kykOBMpzqPsfgDZ5w1jF/MagwAAAABJRU5ErkJggg== + + 412, 17 + 17, 17 diff --git a/EDMI_ClientSuite/frmMain.vb b/EDMI_ClientSuite/frmMain.vb index b9133050..6d4c6b23 100644 --- a/EDMI_ClientSuite/frmMain.vb +++ b/EDMI_ClientSuite/frmMain.vb @@ -15,6 +15,9 @@ Public Class frmMain ' Dieser Aufruf ist für den Designer erforderlich. InitializeComponent() + ' Assign My.MainForm before everything else + My.MainForm = Me + ' Show splashscreen frmSplash.ShowDialog() End Sub @@ -39,8 +42,8 @@ Public Class frmMain oDataTable.Rows.Add(oRow) - ProcessManagerOverview.DataSource = oDataTable - AddHandler ProcessManagerOverview.RowDoubleClicked, Sub(RowView As DataRowView) + ProcessManagerWidget.DataSource = oDataTable + AddHandler ProcessManagerWidget.RowDoubleClicked, Sub(RowView As DataRowView) MsgBox($"Clicked on Document {RowView.Row.Item("DocName")}") End Sub @@ -90,7 +93,7 @@ Public Class frmMain End Sub Private Sub BarButtonItem1_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem1.ItemClick - Dim frm As New frmFileTest(My.LogConfig) + Dim frm As New frmFileTest() frm.MdiParent = DocumentManager.MdiParent frm.Show() End Sub @@ -99,6 +102,7 @@ Public Class frmMain Dim frm As New frmEntityDesigner() frm.MdiParent = DocumentManager.MdiParent frm.Show() + RibbonPageCategoryEntityDesigner.Visible = True End Sub @@ -109,30 +113,17 @@ Public Class frmMain End Sub Private Sub BarButtonItem2_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem2.ItemClick - Dim oUser1 = New LicenseModuleUser With { - .Type = UserType.PowerUser, - .Test = False, - .Count = 5, - .ValidUntil = New Date(), - .ValidUntilSpecified = True - } - + Dim oUser1 = LicenseCreator.NewUser(UserType.PowerUser, 5) + Dim oUser2 = LicenseCreator.NewUser(UserType.WriteOnly, 5, Date.Now) Dim oUsers As New List(Of LicenseModuleUser) oUsers.Add(oUser1) + oUsers.Add(oUser2) - Dim oModule = New LicenseModule() With { - .Users = oUsers.ToArray(), - .Name = "EDMI", - .ValidUntil = New Date(), - .ValidUntilSpecified = True - } - + Dim oModule = LicenseCreator.NewModule("EDMI", oUsers) Dim oModules As New List(Of LicenseModule) oModules.Add(oModule) - Dim oLicense = New LicenseSchema() With { - .Modules = oModules.ToArray - } + Dim oLicense = LicenseCreator.NewLicense(oModules) Dim oLicenseFile As New LicenseFile(My.LogConfig, "E:\") oLicenseFile.SaveFile(oLicense) From 70ceeeb51acc6721258d3ac581e97b3660a18aea Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Tue, 5 Feb 2019 13:36:31 +0100 Subject: [PATCH 11/23] jj: make compression & encription public --- Filesystem/Compression.vb | 2 +- Filesystem/Encryption.vb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Filesystem/Compression.vb b/Filesystem/Compression.vb index 9edb4517..a1d5027e 100644 --- a/Filesystem/Compression.vb +++ b/Filesystem/Compression.vb @@ -2,7 +2,7 @@ Imports System.IO.Compression Imports DigitalData.Modules.Logging -Friend Class Compression +Public Class Compression Private ReadOnly _logger As Logger Public Sub New(LogConfig As LogConfig) diff --git a/Filesystem/Encryption.vb b/Filesystem/Encryption.vb index 77f3631e..b7a3b95b 100644 --- a/Filesystem/Encryption.vb +++ b/Filesystem/Encryption.vb @@ -5,7 +5,7 @@ Imports DigitalData.Modules.Logging ''' ''' https://stackoverflow.com/questions/10168240/encrypting-decrypting-a-string-in-c-sharp ''' -Friend Class Encryption +Public Class Encryption ' This constant is used to determine the keysize of the encryption algorithm in bits. ' We divide this by 8 within the code below to get the equivalent number of bytes. Private Const KEY_SIZE As Integer = 256 From 54af1a770b30f3f26d27628dcd152ef2abe97bd7 Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Tue, 5 Feb 2019 13:36:52 +0100 Subject: [PATCH 12/23] jj: license --- Modules.License/License.vbproj | 1 + Modules.License/LicenseCreator.vb | 34 ++++++++ Modules.License/LicenseFile.vb | 36 ++++++++- Modules.License/LicenseSchema.vb | 128 +++++++++++++++--------------- 4 files changed, 133 insertions(+), 66 deletions(-) create mode 100644 Modules.License/LicenseCreator.vb diff --git a/Modules.License/License.vbproj b/Modules.License/License.vbproj index e944f4ee..8254f7c8 100644 --- a/Modules.License/License.vbproj +++ b/Modules.License/License.vbproj @@ -72,6 +72,7 @@ + LicenseSchema.xsd diff --git a/Modules.License/LicenseCreator.vb b/Modules.License/LicenseCreator.vb new file mode 100644 index 00000000..eb62ec4a --- /dev/null +++ b/Modules.License/LicenseCreator.vb @@ -0,0 +1,34 @@ +Public Class LicenseCreator + Public Shared Function NewUser(Type As UserType, Count As Integer, Optional ValidUntil As Date = Nothing) As LicenseModuleUser + Dim oValidUntilSpecified = Not IsNothing(ValidUntil) + Dim oTest = IsNothing(ValidUntil) + + Return New LicenseModuleUser() With { + .Count = Count, + .Type = Type, + .Test = oTest, + .ValidUntil = ValidUntil, + .ValidUntilSpecified = oValidUntilSpecified + } + End Function + + Public Shared Function NewModule(Name As String, Users As List(Of LicenseModuleUser), Optional ValidUntil As Date = Nothing) As LicenseModule + Dim oUsers = Users.ToArray() + Dim oValidUntilSpecified = Not IsNothing(ValidUntil) + + Return New LicenseModule() With { + .Name = Name, + .Users = oUsers, + .ValidUntil = ValidUntil, + .ValidUntilSpecified = oValidUntilSpecified + } + End Function + + Public Shared Function NewLicense(Modules As List(Of LicenseModule)) As LicenseSchema + Dim oModules = Modules.ToArray() + + Return New LicenseSchema With { + .Modules = oModules + } + End Function +End Class diff --git a/Modules.License/LicenseFile.vb b/Modules.License/LicenseFile.vb index 1be668c3..0e842d37 100644 --- a/Modules.License/LicenseFile.vb +++ b/Modules.License/LicenseFile.vb @@ -1,4 +1,5 @@ Imports System.IO +Imports System.Xml Imports System.Xml.Serialization Imports DigitalData.Modules.Logging @@ -18,6 +19,21 @@ Public Class LicenseFile Return oSerializer End Function + Public Function TestFileValid(Optional FileName As String = LICENSE_FILENAME) As Boolean + Try + Dim oSerializer = GetSerializer() + Dim oFilePath As String = IO.Path.Combine(Path, FileName) + + Using oReader As New StreamReader(oFilePath), + oXmlReader = XmlReader.Create(oReader) + Return oSerializer.CanDeserialize(oXmlReader) + End Using + Catch ex As Exception + _Logger.Error(ex) + Throw ex + End Try + End Function + Public Function LoadFile(Optional FileName As String = LICENSE_FILENAME) As LicenseSchema Try Dim oSerializer = GetSerializer() @@ -35,13 +51,27 @@ Public Class LicenseFile End Try End Function - Public Sub SaveFile(License As LicenseSchema, Optional FileName As String = LICENSE_FILENAME) + Public Function Serialize(License As LicenseSchema) As Byte() Try Dim oSerializer = GetSerializer() - Using oStream = New FileStream(FileName, FileMode.Create, FileAccess.Write) + Using oStream = New MemoryStream() oSerializer.Serialize(oStream, License) - oStream.Flush() + Return oStream.ToArray() + End Using + Catch ex As Exception + _Logger.Error(ex) + Throw ex + End Try + End Function + + Public Sub SaveFile(License As LicenseSchema, Optional FileName As String = LICENSE_FILENAME) + Try + Dim oBytes = Serialize(License) + Dim oFilePath As String = IO.Path.Combine(Path, FileName) + + Using oFileStream = New FileStream(oFilePath, FileMode.Create, FileAccess.Write) + oFileStream.Write(oBytes, 0, oBytes.Length) End Using Catch ex As Exception _Logger.Error(ex) diff --git a/Modules.License/LicenseSchema.vb b/Modules.License/LicenseSchema.vb index 1fcda6f8..877fe8c0 100644 --- a/Modules.License/LicenseSchema.vb +++ b/Modules.License/LicenseSchema.vb @@ -12,24 +12,26 @@ Option Strict Off Option Explicit On Imports System.Xml.Serialization +Imports System.ComponentModel +Imports System.CodeDom.Compiler ' 'This source code was auto-generated by xsd, Version=4.6.1586.0. ' ''' - + Partial Public Class LicenseSchema Private modulesField() As LicenseModule ''' - + Public Property Modules() As LicenseModule() Get Return Me.modulesField @@ -41,161 +43,161 @@ Partial Public Class LicenseSchema End Class ''' - _ + Partial Public Class LicenseModule - + Private usersField() As LicenseModuleUser - + Private nameField As String - + Private validUntilField As Date - + Private validUntilFieldSpecified As Boolean - + ''' - _ + Public Property Users() As LicenseModuleUser() Get Return Me.usersField End Get Set - Me.usersField = value + Me.usersField = Value End Set End Property - + ''' - _ + Public Property Name() As String Get Return Me.nameField End Get Set - Me.nameField = value + Me.nameField = Value End Set End Property - + ''' - _ + Public Property ValidUntil() As Date Get Return Me.validUntilField End Get Set - Me.validUntilField = value + Me.validUntilField = Value End Set End Property - + ''' - _ + Public Property ValidUntilSpecified() As Boolean Get Return Me.validUntilFieldSpecified End Get Set - Me.validUntilFieldSpecified = value + Me.validUntilFieldSpecified = Value End Set End Property End Class ''' - _ + Partial Public Class LicenseModuleUser - + Private typeField As UserType - + Private countField As String - + Private testField As Boolean - + Private validUntilField As Date - + Private validUntilFieldSpecified As Boolean - + Public Sub New() MyBase.New - Me.testField = true + Me.testField = True End Sub - + ''' - _ + Public Property Type() As UserType Get Return Me.typeField End Get Set - Me.typeField = value + Me.typeField = Value End Set End Property - + ''' - _ + Public Property Count() As String Get Return Me.countField End Get Set - Me.countField = value + Me.countField = Value End Set End Property - + ''' - _ + Public Property Test() As Boolean Get Return Me.testField End Get Set - Me.testField = value + Me.testField = Value End Set End Property - + ''' - _ + Public Property ValidUntil() As Date Get Return Me.validUntilField End Get Set - Me.validUntilField = value + Me.validUntilField = Value End Set End Property - + ''' - _ + Public Property ValidUntilSpecified() As Boolean Get Return Me.validUntilFieldSpecified End Get Set - Me.validUntilFieldSpecified = value + Me.validUntilFieldSpecified = Value End Set End Property End Class ''' - _ + Public Enum UserType - + ''' PowerUser - + ''' [ReadOnly] - + ''' [WriteOnly] - + ''' ReadWrite End Enum From 8d301d14cefb1ec79b50e04dbbe1c1841d725da3 Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Tue, 5 Feb 2019 13:37:44 +0100 Subject: [PATCH 13/23] jj: rename usercontrols folder to widgets --- EDMI_ClientSuite/EDMI_ClientSuite.vbproj | 6 +++--- .../ProcessManagerWidget.Designer.vb | 0 .../{UserControls => Widgets}/ProcessManagerWidget.resx | 0 .../{UserControls => Widgets}/ProcessManagerWidget.vb | 0 4 files changed, 3 insertions(+), 3 deletions(-) rename EDMI_ClientSuite/{UserControls => Widgets}/ProcessManagerWidget.Designer.vb (100%) rename EDMI_ClientSuite/{UserControls => Widgets}/ProcessManagerWidget.resx (100%) rename EDMI_ClientSuite/{UserControls => Widgets}/ProcessManagerWidget.vb (100%) diff --git a/EDMI_ClientSuite/EDMI_ClientSuite.vbproj b/EDMI_ClientSuite/EDMI_ClientSuite.vbproj index 03abdef7..b37923ba 100644 --- a/EDMI_ClientSuite/EDMI_ClientSuite.vbproj +++ b/EDMI_ClientSuite/EDMI_ClientSuite.vbproj @@ -275,10 +275,10 @@ True ControlProperties.en.resx - + ProcessManagerWidget.vb - + UserControl @@ -330,7 +330,7 @@ ControlProperties.Designer.vb My.Resources - + ProcessManagerWidget.vb diff --git a/EDMI_ClientSuite/UserControls/ProcessManagerWidget.Designer.vb b/EDMI_ClientSuite/Widgets/ProcessManagerWidget.Designer.vb similarity index 100% rename from EDMI_ClientSuite/UserControls/ProcessManagerWidget.Designer.vb rename to EDMI_ClientSuite/Widgets/ProcessManagerWidget.Designer.vb diff --git a/EDMI_ClientSuite/UserControls/ProcessManagerWidget.resx b/EDMI_ClientSuite/Widgets/ProcessManagerWidget.resx similarity index 100% rename from EDMI_ClientSuite/UserControls/ProcessManagerWidget.resx rename to EDMI_ClientSuite/Widgets/ProcessManagerWidget.resx diff --git a/EDMI_ClientSuite/UserControls/ProcessManagerWidget.vb b/EDMI_ClientSuite/Widgets/ProcessManagerWidget.vb similarity index 100% rename from EDMI_ClientSuite/UserControls/ProcessManagerWidget.vb rename to EDMI_ClientSuite/Widgets/ProcessManagerWidget.vb From dd8be573d00326f0f104cd02bdcc6241c53f6caf Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Tue, 5 Feb 2019 13:49:11 +0100 Subject: [PATCH 14/23] jj: update deps --- Config/Config.vbproj | 6 ++---- Config/packages.config | 2 +- DDTestService/DDTestService.vbproj | 2 +- DDTestService/packages.config | 2 +- EDMDesigner/EDMDesigner.vbproj | 2 +- EDMDesigner/packages.config | 2 +- Filesystem/Filesystem.vbproj | 2 +- Filesystem/packages.config | 2 +- GUI_EDMI/App.config | 16 ++++++++-------- GUI_EDMI/GUI_EDMI.vbproj | 5 ++--- GUI_EDMI/packages.config | 2 +- Message/Messaging.vbproj | 4 ++-- Message/packages.config | 2 +- Modules.Database/Database.vbproj | 3 +-- Modules.Database/packages.config | 2 +- Modules.Logging/Logging.vbproj | 3 +-- Modules.Logging/packages.config | 2 +- Modules.Windream/Windream.vbproj | 2 +- Modules.Windream/packages.config | 2 +- TestGUI/TestGUI.vbproj | 6 ++---- TestGUI/packages.config | 2 +- 21 files changed, 32 insertions(+), 39 deletions(-) diff --git a/Config/Config.vbproj b/Config/Config.vbproj index 01170d53..4794b3ff 100644 --- a/Config/Config.vbproj +++ b/Config/Config.vbproj @@ -45,7 +45,7 @@ - ..\packages\NLog.4.5.10\lib\net45\NLog.dll + ..\packages\NLog.4.5.11\lib\net45\NLog.dll @@ -107,9 +107,7 @@ My Settings.Designer.vb - - Designer - + diff --git a/Config/packages.config b/Config/packages.config index 9764f16f..f89fa324 100644 --- a/Config/packages.config +++ b/Config/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/DDTestService/DDTestService.vbproj b/DDTestService/DDTestService.vbproj index 9068d5b2..31cceea4 100644 --- a/DDTestService/DDTestService.vbproj +++ b/DDTestService/DDTestService.vbproj @@ -52,7 +52,7 @@ - ..\packages\NLog.4.5.10\lib\net45\NLog.dll + ..\packages\NLog.4.5.11\lib\net45\NLog.dll diff --git a/DDTestService/packages.config b/DDTestService/packages.config index 9764f16f..f89fa324 100644 --- a/DDTestService/packages.config +++ b/DDTestService/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/EDMDesigner/EDMDesigner.vbproj b/EDMDesigner/EDMDesigner.vbproj index 4e1ba6c3..deed0716 100644 --- a/EDMDesigner/EDMDesigner.vbproj +++ b/EDMDesigner/EDMDesigner.vbproj @@ -76,7 +76,7 @@ - ..\packages\NLog.4.5.10\lib\net45\NLog.dll + ..\packages\NLog.4.5.11\lib\net45\NLog.dll diff --git a/EDMDesigner/packages.config b/EDMDesigner/packages.config index 9613071f..81ef80e4 100644 --- a/EDMDesigner/packages.config +++ b/EDMDesigner/packages.config @@ -3,5 +3,5 @@ - + \ No newline at end of file diff --git a/Filesystem/Filesystem.vbproj b/Filesystem/Filesystem.vbproj index 83bf4193..a0363c24 100644 --- a/Filesystem/Filesystem.vbproj +++ b/Filesystem/Filesystem.vbproj @@ -45,7 +45,7 @@ - ..\packages\NLog.4.5.10\lib\net45\NLog.dll + ..\packages\NLog.4.5.11\lib\net45\NLog.dll ..\packages\protobuf-net.2.4.0\lib\net40\protobuf-net.dll diff --git a/Filesystem/packages.config b/Filesystem/packages.config index 72e63d58..4c276e2a 100644 --- a/Filesystem/packages.config +++ b/Filesystem/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/GUI_EDMI/App.config b/GUI_EDMI/App.config index 4e26231d..48ca3356 100644 --- a/GUI_EDMI/App.config +++ b/GUI_EDMI/App.config @@ -6,7 +6,7 @@
- +
@@ -29,12 +29,7 @@ - - - - - - + @@ -57,4 +52,9 @@ - \ No newline at end of file + + + + + + \ No newline at end of file diff --git a/GUI_EDMI/GUI_EDMI.vbproj b/GUI_EDMI/GUI_EDMI.vbproj index af852fcb..eaeb5584 100644 --- a/GUI_EDMI/GUI_EDMI.vbproj +++ b/GUI_EDMI/GUI_EDMI.vbproj @@ -76,9 +76,8 @@ ..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll - - False - ..\Modules.Database\bin\Debug\FirebirdSql.Data.FirebirdClient.dll + + ..\packages\FirebirdSql.Data.FirebirdClient.6.4.0\lib\net452\FirebirdSql.Data.FirebirdClient.dll ..\packages\FirebirdSql.EntityFrameworkCore.Firebird.6.4.0\lib\netstandard2.0\FirebirdSql.EntityFrameworkCore.Firebird.dll diff --git a/GUI_EDMI/packages.config b/GUI_EDMI/packages.config index 959fc27e..2c2992ff 100644 --- a/GUI_EDMI/packages.config +++ b/GUI_EDMI/packages.config @@ -2,7 +2,7 @@ - + diff --git a/Message/Messaging.vbproj b/Message/Messaging.vbproj index afeeb152..8c9bb92e 100644 --- a/Message/Messaging.vbproj +++ b/Message/Messaging.vbproj @@ -50,8 +50,8 @@ P:\Projekte DIGITAL DATA\DIGITAL DATA - Entwicklung\DLL_Bibliotheken\Email .NET\Bin\Independentsoft.Email.dll - - ..\Modules.Logging\bin\Debug\NLog.dll + + ..\packages\NLog.4.5.11\lib\net45\NLog.dll diff --git a/Message/packages.config b/Message/packages.config index 9764f16f..f89fa324 100644 --- a/Message/packages.config +++ b/Message/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/Modules.Database/Database.vbproj b/Modules.Database/Database.vbproj index 4a66b0cb..e7c4b685 100644 --- a/Modules.Database/Database.vbproj +++ b/Modules.Database/Database.vbproj @@ -59,8 +59,7 @@ - False - ..\Modules.Logging\bin\Debug\NLog.dll + ..\packages\NLog.4.5.11\lib\net45\NLog.dll P:\Visual Studio Projekte\Bibliotheken\Oracle.ManagedDataAccess.dll diff --git a/Modules.Database/packages.config b/Modules.Database/packages.config index 9613071f..81ef80e4 100644 --- a/Modules.Database/packages.config +++ b/Modules.Database/packages.config @@ -3,5 +3,5 @@ - + \ No newline at end of file diff --git a/Modules.Logging/Logging.vbproj b/Modules.Logging/Logging.vbproj index b7982df8..037ea288 100644 --- a/Modules.Logging/Logging.vbproj +++ b/Modules.Logging/Logging.vbproj @@ -45,8 +45,7 @@ - ..\packages\NLog.4.5.10\lib\net45\NLog.dll - False + ..\packages\NLog.4.5.11\lib\net45\NLog.dll diff --git a/Modules.Logging/packages.config b/Modules.Logging/packages.config index 9764f16f..f89fa324 100644 --- a/Modules.Logging/packages.config +++ b/Modules.Logging/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/Modules.Windream/Windream.vbproj b/Modules.Windream/Windream.vbproj index 6d0c2317..c86a9f1a 100644 --- a/Modules.Windream/Windream.vbproj +++ b/Modules.Windream/Windream.vbproj @@ -65,7 +65,7 @@ - ..\packages\NLog.4.5.10\lib\net45\NLog.dll + ..\packages\NLog.4.5.11\lib\net45\NLog.dll diff --git a/Modules.Windream/packages.config b/Modules.Windream/packages.config index 9764f16f..f89fa324 100644 --- a/Modules.Windream/packages.config +++ b/Modules.Windream/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/TestGUI/TestGUI.vbproj b/TestGUI/TestGUI.vbproj index 5c07f2f3..62c78d92 100644 --- a/TestGUI/TestGUI.vbproj +++ b/TestGUI/TestGUI.vbproj @@ -60,7 +60,7 @@ - ..\packages\NLog.4.5.10\lib\net45\NLog.dll + ..\packages\NLog.4.5.11\lib\net45\NLog.dll @@ -139,9 +139,7 @@ Settings.Designer.vb - - Designer - + diff --git a/TestGUI/packages.config b/TestGUI/packages.config index 9764f16f..f89fa324 100644 --- a/TestGUI/packages.config +++ b/TestGUI/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file From 779d2fc3d7405a763f97dadb9b42a6df6e8bc1f2 Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Tue, 5 Feb 2019 14:03:38 +0100 Subject: [PATCH 15/23] jj: clean up deps --- EDMI_ClientSuite/ClassInit.vb | 3 +- EDMI_ClientSuite/EDMI_ClientSuite.vbproj | 65 ++---------------------- EDMI_ClientSuite/packages.config | 30 +---------- 3 files changed, 8 insertions(+), 90 deletions(-) diff --git a/EDMI_ClientSuite/ClassInit.vb b/EDMI_ClientSuite/ClassInit.vb index 544c27cc..d309802a 100644 --- a/EDMI_ClientSuite/ClassInit.vb +++ b/EDMI_ClientSuite/ClassInit.vb @@ -2,6 +2,7 @@ Imports DigitalData.Modules.Logging.LogConfig Imports System.ServiceModel Imports EDMI_ClientSuite.NetworkService_DDEDM +Imports System.ServiceModel.Channels Public Class ClassInit Private Const OPEN_TIMEOUT_SECONDS = 3 @@ -42,7 +43,7 @@ Public Class ClassInit End Function) End Function - Public Function GetChannelFactory() As ChannelFactory(Of IEDMServiceChannel) + Public Function GetChannelFactory() As IChannelFactory(Of IEDMServiceChannel) Return GetChannelFactory(My.Settings.ICMServiceAddress) End Function diff --git a/EDMI_ClientSuite/EDMI_ClientSuite.vbproj b/EDMI_ClientSuite/EDMI_ClientSuite.vbproj index b37923ba..b209e02b 100644 --- a/EDMI_ClientSuite/EDMI_ClientSuite.vbproj +++ b/EDMI_ClientSuite/EDMI_ClientSuite.vbproj @@ -82,77 +82,22 @@ ..\packages\FirebirdSql.EntityFrameworkCore.Firebird.6.4.0\lib\netstandard2.0\FirebirdSql.EntityFrameworkCore.Firebird.dll - - - ..\packages\Microsoft.EntityFrameworkCore.2.0.3\lib\netstandard2.0\Microsoft.EntityFrameworkCore.dll - - - ..\packages\Microsoft.EntityFrameworkCore.Relational.2.0.3\lib\netstandard2.0\Microsoft.EntityFrameworkCore.Relational.dll - - - ..\packages\Microsoft.Extensions.Caching.Abstractions.2.0.2\lib\netstandard2.0\Microsoft.Extensions.Caching.Abstractions.dll - - - ..\packages\Microsoft.Extensions.Caching.Memory.2.0.2\lib\netstandard2.0\Microsoft.Extensions.Caching.Memory.dll - - - ..\packages\Microsoft.Extensions.Configuration.Abstractions.2.0.2\lib\netstandard2.0\Microsoft.Extensions.Configuration.Abstractions.dll - - - ..\packages\Microsoft.Extensions.DependencyInjection.2.0.0\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.dll - - - ..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.2.0.0\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll - - - ..\packages\Microsoft.Extensions.Logging.2.0.2\lib\netstandard2.0\Microsoft.Extensions.Logging.dll - - - ..\packages\Microsoft.Extensions.Logging.Abstractions.2.0.2\lib\netstandard2.0\Microsoft.Extensions.Logging.Abstractions.dll - - - ..\packages\Microsoft.Extensions.Options.2.0.2\lib\netstandard2.0\Microsoft.Extensions.Options.dll - - - ..\packages\Microsoft.Extensions.Primitives.2.0.0\lib\netstandard2.0\Microsoft.Extensions.Primitives.dll - False ..\Modules.Logging\bin\Debug\NLog.dll - - ..\packages\Remotion.Linq.2.1.1\lib\net45\Remotion.Linq.dll - - - - ..\packages\System.Collections.Immutable.1.4.0\lib\netstandard2.0\System.Collections.Immutable.dll - - - ..\packages\System.ComponentModel.Annotations.4.4.0\lib\net461\System.ComponentModel.Annotations.dll - - - - - - ..\packages\System.Diagnostics.DiagnosticSource.4.4.1\lib\net46\System.Diagnostics.DiagnosticSource.dll - - - ..\packages\System.Interactive.Async.3.1.1\lib\net46\System.Interactive.Async.dll - - - ..\packages\System.Runtime.CompilerServices.Unsafe.4.4.0\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll - + + ..\packages\System.Runtime.Serialization.Primitives.4.3.0\lib\net46\System.Runtime.Serialization.Primitives.dll + True + True + - - - - diff --git a/EDMI_ClientSuite/packages.config b/EDMI_ClientSuite/packages.config index c68c1ffe..9ba88bff 100644 --- a/EDMI_ClientSuite/packages.config +++ b/EDMI_ClientSuite/packages.config @@ -2,33 +2,5 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + \ No newline at end of file From a1c96731ef1393819e6910a5676664090a09d816 Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Tue, 5 Feb 2019 16:47:32 +0100 Subject: [PATCH 16/23] jj: folder watcher --- EDMI_ClientSuite/EDMI_ClientSuite.vbproj | 5 +- EDMI_ClientSuite/frmMain.Designer.vb | 43 ++++---- Filesystem/FileWatcher.vb | 110 +++++++++++++++++++ Filesystem/Filesystem.vbproj | 1 + TestGUI/FolderWatcher.Designer.vb | 49 +++++++++ TestGUI/FolderWatcher.resx | 120 +++++++++++++++++++++ TestGUI/FolderWatcher.vb | 31 ++++++ TestGUI/My Project/Application.Designer.vb | 28 ++--- TestGUI/My Project/Application.myapp | 5 +- TestGUI/TestGUI.vbproj | 13 +++ 10 files changed, 365 insertions(+), 40 deletions(-) create mode 100644 Filesystem/FileWatcher.vb create mode 100644 TestGUI/FolderWatcher.Designer.vb create mode 100644 TestGUI/FolderWatcher.resx create mode 100644 TestGUI/FolderWatcher.vb diff --git a/EDMI_ClientSuite/EDMI_ClientSuite.vbproj b/EDMI_ClientSuite/EDMI_ClientSuite.vbproj index b209e02b..1cd69976 100644 --- a/EDMI_ClientSuite/EDMI_ClientSuite.vbproj +++ b/EDMI_ClientSuite/EDMI_ClientSuite.vbproj @@ -86,6 +86,7 @@ False ..\Modules.Logging\bin\Debug\NLog.dll + @@ -322,7 +323,9 @@ - + + Designer + diff --git a/EDMI_ClientSuite/frmMain.Designer.vb b/EDMI_ClientSuite/frmMain.Designer.vb index aa629754..f8156f5d 100644 --- a/EDMI_ClientSuite/frmMain.Designer.vb +++ b/EDMI_ClientSuite/frmMain.Designer.vb @@ -19,11 +19,10 @@ Partial Class frmMain 'Do not modify it using the code editor. Private Sub InitializeComponent() - Me.components = New System.ComponentModel.Container() Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmMain)) Dim PushTransition1 As DevExpress.Utils.Animation.PushTransition = New DevExpress.Utils.Animation.PushTransition() Me.RibbonControl = New DevExpress.XtraBars.Ribbon.RibbonControl() - Me.MainMenu = New DevExpress.XtraBars.Ribbon.ApplicationMenu(Me.components) + Me.MainMenu = New DevExpress.XtraBars.Ribbon.ApplicationMenu() Me.BarButtonExit = New DevExpress.XtraBars.BarButtonItem() Me.BarButtonUserSettings = New DevExpress.XtraBars.BarButtonItem() Me.BarButtonConnectionSettings = New DevExpress.XtraBars.BarButtonItem() @@ -38,6 +37,8 @@ Partial Class frmMain Me.BarButtonDeleteControl = New DevExpress.XtraBars.BarButtonItem() Me.LabelCurrentLanguage = New DevExpress.XtraBars.BarStaticItem() Me.BarButtonItem2 = New DevExpress.XtraBars.BarButtonItem() + Me.BarWorkspaceMenuItem1 = New DevExpress.XtraBars.BarWorkspaceMenuItem() + Me.WorkspaceManager1 = New DevExpress.Utils.WorkspaceManager() Me.RibbonPageCategoryEntityDesigner = New DevExpress.XtraBars.Ribbon.RibbonPageCategory() Me.RibbonPageControlActions = New DevExpress.XtraBars.Ribbon.RibbonPage() Me.RibbonPageGroup5 = New DevExpress.XtraBars.Ribbon.RibbonPageGroup() @@ -49,9 +50,9 @@ Partial Class frmMain Me.RibbonPageWorkflow = New DevExpress.XtraBars.Ribbon.RibbonPage() Me.RibbonPageGroup4 = New DevExpress.XtraBars.Ribbon.RibbonPageGroup() Me.RibbonStatusBar = New DevExpress.XtraBars.Ribbon.RibbonStatusBar() - Me.DocumentManager = New DevExpress.XtraBars.Docking2010.DocumentManager(Me.components) - Me.TabbedView1 = New DevExpress.XtraBars.Docking2010.Views.Tabbed.TabbedView(Me.components) - Me.DockManager = New DevExpress.XtraBars.Docking.DockManager(Me.components) + Me.DocumentManager = New DevExpress.XtraBars.Docking2010.DocumentManager() + Me.TabbedView1 = New DevExpress.XtraBars.Docking2010.Views.Tabbed.TabbedView() + Me.DockManager = New DevExpress.XtraBars.Docking.DockManager() Me.panelContainer1 = New DevExpress.XtraBars.Docking.DockPanel() Me.DockPanelGlobix = New DevExpress.XtraBars.Docking.DockPanel() Me.DockPanel1_Container = New DevExpress.XtraBars.Docking.ControlContainer() @@ -59,8 +60,6 @@ Partial Class frmMain Me.DockPanelProcessManager = New DevExpress.XtraBars.Docking.DockPanel() Me.DockPanel2_Container = New DevExpress.XtraBars.Docking.ControlContainer() Me.ProcessManagerWidget = New EDMI_ClientSuite.ProcessManagerWidget() - Me.BarWorkspaceMenuItem1 = New DevExpress.XtraBars.BarWorkspaceMenuItem() - Me.WorkspaceManager1 = New DevExpress.Utils.WorkspaceManager() CType(Me.RibbonControl, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.MainMenu, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.DocumentManager, System.ComponentModel.ISupportInitialize).BeginInit() @@ -189,10 +188,22 @@ Partial Class frmMain Me.BarButtonItem2.Id = 16 Me.BarButtonItem2.Name = "BarButtonItem2" ' + 'BarWorkspaceMenuItem1 + ' + Me.BarWorkspaceMenuItem1.Caption = "BarWorkspaceMenuItem1" + Me.BarWorkspaceMenuItem1.Id = 17 + Me.BarWorkspaceMenuItem1.Name = "BarWorkspaceMenuItem1" + Me.BarWorkspaceMenuItem1.WorkspaceManager = Me.WorkspaceManager1 + ' + 'WorkspaceManager1 + ' + Me.WorkspaceManager1.TargetControl = Me + Me.WorkspaceManager1.TransitionType = PushTransition1 + ' 'RibbonPageCategoryEntityDesigner ' Me.RibbonPageCategoryEntityDesigner.AutoStretchPageHeaders = True - Me.RibbonPageCategoryEntityDesigner.Color = System.Drawing.Color.Red + Me.RibbonPageCategoryEntityDesigner.Color = System.Drawing.Color.FromArgb(CType(CType(192, Byte), Integer), CType(CType(0, Byte), Integer), CType(CType(0, Byte), Integer)) Me.RibbonPageCategoryEntityDesigner.Name = "RibbonPageCategoryEntityDesigner" Me.RibbonPageCategoryEntityDesigner.Pages.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPage() {Me.RibbonPageControlActions}) Me.RibbonPageCategoryEntityDesigner.Text = "Entitäten Designer" @@ -348,27 +359,15 @@ Partial Class frmMain Me.DockPanel2_Container.Size = New System.Drawing.Size(337, 163) Me.DockPanel2_Container.TabIndex = 0 ' - 'ProcessManagerOverview + 'ProcessManagerWidget ' Me.ProcessManagerWidget.DataSource = Nothing Me.ProcessManagerWidget.Dock = System.Windows.Forms.DockStyle.Fill Me.ProcessManagerWidget.Location = New System.Drawing.Point(0, 0) - Me.ProcessManagerWidget.Name = "ProcessManagerOverview" + Me.ProcessManagerWidget.Name = "ProcessManagerWidget" Me.ProcessManagerWidget.Size = New System.Drawing.Size(337, 163) Me.ProcessManagerWidget.TabIndex = 0 ' - 'BarWorkspaceMenuItem1 - ' - Me.BarWorkspaceMenuItem1.Caption = "BarWorkspaceMenuItem1" - Me.BarWorkspaceMenuItem1.Id = 17 - Me.BarWorkspaceMenuItem1.Name = "BarWorkspaceMenuItem1" - Me.BarWorkspaceMenuItem1.WorkspaceManager = Me.WorkspaceManager1 - ' - 'WorkspaceManager1 - ' - Me.WorkspaceManager1.TargetControl = Me - Me.WorkspaceManager1.TransitionType = PushTransition1 - ' 'frmMain ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) diff --git a/Filesystem/FileWatcher.vb b/Filesystem/FileWatcher.vb new file mode 100644 index 00000000..215a4413 --- /dev/null +++ b/Filesystem/FileWatcher.vb @@ -0,0 +1,110 @@ +Imports System.IO +Imports DigitalData.Modules.Logging + +Public Class FileWatcher + Private ReadOnly _Logger As Logger + Private ReadOnly _Watchers As List(Of FileSystemWatcher) + Private ReadOnly _Files As Dictionary(Of String, FileProperties) + + Private _Path As String + + Public OfficeFilters As New List(Of String) From {"docx", "xlsx", "pptx"} + + Public Sub New(LogConfig As LogConfig, Path As String) + _Logger = LogConfig.GetLogger() + _Files = New Dictionary(Of String, FileProperties) + _Watchers = New List(Of FileSystemWatcher) + _Path = Path + + For Each oFilePath As String In Directory.EnumerateFiles(_Path) + Try + If IO.File.Exists(oFilePath) Then + _Files.Add(oFilePath, New FileProperties With { + .CreatedAt = DateTime.Now, + .ChangedAt = Nothing + }) + End If + Catch ex As Exception + _Logger.Error(ex) + _Logger.Warn("File {0} cannot be watched!") + End Try + Next + End Sub + + Public Sub Add(Filter As String, Optional SpecialTreatmentFilters As List(Of String) = Nothing) + _Watchers.Add(CreateWatcher(Filter)) + End Sub + + Public Sub Add(Filters As List(Of String), Optional SpecialTreatmentFilters As List(Of String) = Nothing) + For Each oFilter In Filters + _Watchers.Add(CreateWatcher(oFilter)) + Next + End Sub + + Private Function CreateWatcher(Filter As String) + Dim oWatcher = New FileSystemWatcher() With { + .Path = _Path, + .Filter = Filter, + .NotifyFilter = NotifyFilters.CreationTime _ + Or NotifyFilters.LastAccess _ + Or NotifyFilters.LastWrite _ + Or NotifyFilters.Size _ + Or NotifyFilters.FileName _ + Or NotifyFilters.Attributes + } + + AddHandler oWatcher.Created, AddressOf HandleFileCreated + AddHandler oWatcher.Changed, AddressOf HandleFileChanged + AddHandler oWatcher.Deleted, AddressOf HandleFileDeleted + AddHandler oWatcher.Renamed, AddressOf HandleFileRenamed + + Return oWatcher + End Function + + Private Sub HandleFileCreated(sender As Object, e As FileSystemEventArgs) + _Files.Add(e.FullPath, New FileProperties()) + _Logger.Info("[Created] " & e.FullPath) + End Sub + Private Sub HandleFileChanged(sender As Object, e As FileSystemEventArgs) + _Files.Item(e.FullPath).ChangedAt = DateTime.Now + _Logger.Info("[Changed] " & e.FullPath) + End Sub + Private Sub HandleFileDeleted(sender As Object, e As FileSystemEventArgs) + _Files.Remove(e.FullPath) + _Logger.Info("[Removed] " & e.FullPath) + End Sub + + Private Sub HandleFileRenamed(sender As Object, e As RenamedEventArgs) + Dim oProperties = _Files.Item(e.OldFullPath) + _Files.Remove(e.OldFullPath) + _Files.Add(e.FullPath, oProperties) + ' Soll eine umbenannte datei als NEU gelten? + + _Logger.Info("[Renamed] {0} --> {1}", e.OldFullPath, e.FullPath) + End Sub + + Public Sub Start() + For Each oWatcher In _Watchers + oWatcher.EnableRaisingEvents = True + Next + End Sub + + Public Sub [Stop]() + For Each oWatcher In _Watchers + If Not IsNothing(oWatcher) Then + oWatcher.EnableRaisingEvents = False + oWatcher.Dispose() + End If + Next + End Sub + + Public Class FileProperties + Public CreatedAt As DateTime + Public ChangedAt As DateTime + + Public Sub New() + CreatedAt = DateTime.Now + ChangedAt = Nothing + End Sub + End Class +End Class diff --git a/Filesystem/Filesystem.vbproj b/Filesystem/Filesystem.vbproj index a0363c24..f7fd9859 100644 --- a/Filesystem/Filesystem.vbproj +++ b/Filesystem/Filesystem.vbproj @@ -80,6 +80,7 @@ + True diff --git a/TestGUI/FolderWatcher.Designer.vb b/TestGUI/FolderWatcher.Designer.vb new file mode 100644 index 00000000..a0c1cbba --- /dev/null +++ b/TestGUI/FolderWatcher.Designer.vb @@ -0,0 +1,49 @@ + +Partial Class FolderWatcher + Inherits System.Windows.Forms.Form + + 'Das Formular überschreibt den Löschvorgang, um die Komponentenliste zu bereinigen. + + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Wird vom Windows Form-Designer benötigt. + Private components As System.ComponentModel.IContainer + + 'Hinweis: Die folgende Prozedur ist für den Windows Form-Designer erforderlich. + 'Das Bearbeiten ist mit dem Windows Form-Designer möglich. + 'Das Bearbeiten mit dem Code-Editor ist nicht möglich. + + Private Sub InitializeComponent() + Me.ListBox1 = New System.Windows.Forms.ListBox() + Me.SuspendLayout() + ' + 'ListBox1 + ' + Me.ListBox1.FormattingEnabled = True + Me.ListBox1.Location = New System.Drawing.Point(12, 12) + Me.ListBox1.Name = "ListBox1" + Me.ListBox1.Size = New System.Drawing.Size(388, 420) + Me.ListBox1.TabIndex = 0 + ' + 'FolderWatcher + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(413, 450) + Me.Controls.Add(Me.ListBox1) + Me.Name = "FolderWatcher" + Me.Text = "FolderWatcher" + Me.ResumeLayout(False) + + End Sub + + Friend WithEvents ListBox1 As ListBox +End Class diff --git a/TestGUI/FolderWatcher.resx b/TestGUI/FolderWatcher.resx new file mode 100644 index 00000000..1af7de15 --- /dev/null +++ b/TestGUI/FolderWatcher.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/TestGUI/FolderWatcher.vb b/TestGUI/FolderWatcher.vb new file mode 100644 index 00000000..2dff7c01 --- /dev/null +++ b/TestGUI/FolderWatcher.vb @@ -0,0 +1,31 @@ +Imports System.ComponentModel +Imports System.IO +Imports DigitalData.Modules.Filesystem +Imports DigitalData.Modules.Logging + +Public Class FolderWatcher + + Private _LogConfig As LogConfig + Private _Watcher As FileWatcher + + Public Sub FileCreated(_sender As Object, _e As FileSystemEventArgs) + ListBox1.Items.Add($"File created: {_e.FullPath}") + End Sub + + Public Sub FileChanged(_sender As Object, _e As FileSystemEventArgs) + ListBox1.Items.Add($"File changed: {_e.FullPath}") + End Sub + + Private Sub FolderWatcher_Load(sender As Object, e As EventArgs) Handles Me.Load + _LogConfig = New LogConfig(LogConfig.PathType.CurrentDirectory, Nothing, "MAIN") + _Watcher = New FileWatcher(_LogConfig, "E:\Watcher") + + _Watcher.Add("*.*") + + _Watcher.Start() + End Sub + + Private Sub FolderWatcher_Closing(sender As Object, e As CancelEventArgs) Handles Me.Closing + _Watcher.Stop() + End Sub +End Class \ No newline at end of file diff --git a/TestGUI/My Project/Application.Designer.vb b/TestGUI/My Project/Application.Designer.vb index abde74e4..b30e1dba 100644 --- a/TestGUI/My Project/Application.Designer.vb +++ b/TestGUI/My Project/Application.Designer.vb @@ -1,10 +1,10 @@ '------------------------------------------------------------------------------ ' -' This code was generated by a tool. -' Runtime Version:4.0.30319.42000 +' Dieser Code wurde von einem Tool generiert. +' Laufzeitversion:4.0.30319.42000 ' -' Changes to this file may cause incorrect behavior and will be lost if -' the code is regenerated. +' Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn +' der Code erneut generiert wird. ' '------------------------------------------------------------------------------ @@ -13,15 +13,15 @@ Option Explicit On Namespace My - - 'NOTE: This file is auto-generated; do not modify it directly. To make changes, - ' or if you encounter build errors in this file, go to the Project Designer - ' (go to Project Properties or double-click the My Project node in - ' Solution Explorer), and make changes on the Application tab. + + 'HINWEIS: Diese Datei wird automatisch generiert und darf nicht direkt bearbeitet werden. Wenn Sie Änderungen vornehmen möchten + ' oder in dieser Datei Buildfehler auftreten, wechseln Sie zum Projekt-Designer. + ' (Wechseln Sie dazu zu den Projekteigenschaften, oder doppelklicken Sie auf den Knoten "Mein Projekt" im + ' Projektmappen-Explorer). Nehmen Sie auf der Registerkarte "Anwendung" entsprechende Änderungen vor. ' Partial Friend Class MyApplication - - _ + + _ Public Sub New() MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) Me.IsSingleInstance = false @@ -29,10 +29,10 @@ Namespace My Me.SaveMySettingsOnExit = true Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses End Sub - - _ + + _ Protected Overrides Sub OnCreateMainForm() - Me.MainForm = Global.TestGUI.Form1 + Me.MainForm = Global.TestGUI.FolderWatcher End Sub End Class End Namespace diff --git a/TestGUI/My Project/Application.myapp b/TestGUI/My Project/Application.myapp index 1243847f..d87a023e 100644 --- a/TestGUI/My Project/Application.myapp +++ b/TestGUI/My Project/Application.myapp @@ -1,11 +1,10 @@  true - Form1 + FolderWatcher false 0 true 0 - 0 true - + \ No newline at end of file diff --git a/TestGUI/TestGUI.vbproj b/TestGUI/TestGUI.vbproj index 62c78d92..e0b1a238 100644 --- a/TestGUI/TestGUI.vbproj +++ b/TestGUI/TestGUI.vbproj @@ -93,6 +93,12 @@ + + FolderWatcher.vb + + + Form + Form @@ -117,6 +123,9 @@ + + FolderWatcher.vb + Form1.vb @@ -145,6 +154,10 @@ + + {991d0231-4623-496d-8bd0-9ca906029cbc} + Filesystem + {3dcd6d1a-c830-4241-b7e4-27430e7ea483} LookupControl From fedc45a88b2a7509069b1b7989c7d9ddc5a4a045 Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Wed, 6 Feb 2019 15:31:22 +0100 Subject: [PATCH 17/23] jj: filewatcher --- Filesystem/FileWatcher.vb | 98 ++++++++++++++++++----------- Filesystem/FileWatcherFilters.vb | 61 ++++++++++++++++++ Filesystem/FileWatcherProperties.vb | 10 +++ Filesystem/Filesystem.vbproj | 2 + TestGUI/FolderWatcher.vb | 25 +++++--- 5 files changed, 149 insertions(+), 47 deletions(-) create mode 100644 Filesystem/FileWatcherFilters.vb create mode 100644 Filesystem/FileWatcherProperties.vb diff --git a/Filesystem/FileWatcher.vb b/Filesystem/FileWatcher.vb index 215a4413..6f82047a 100644 --- a/Filesystem/FileWatcher.vb +++ b/Filesystem/FileWatcher.vb @@ -1,25 +1,33 @@ Imports System.IO +Imports DigitalData.Modules.Filesystem +Imports DigitalData.Modules.Filesystem.FileWatcherFilters Imports DigitalData.Modules.Logging + Public Class FileWatcher + ' Internals Private ReadOnly _Logger As Logger Private ReadOnly _Watchers As List(Of FileSystemWatcher) - Private ReadOnly _Files As Dictionary(Of String, FileProperties) + Private ReadOnly _Files As Dictionary(Of String, FileWatcherProperties) + Private ReadOnly _Filters As List(Of BaseFileFilter) + ' Options Private _Path As String - Public OfficeFilters As New List(Of String) From {"docx", "xlsx", "pptx"} + ' Public Events + Public Event FileSaved(ByVal FullName As String, ByVal IsSpecial As Boolean) - Public Sub New(LogConfig As LogConfig, Path As String) + Public Sub New(LogConfig As LogConfig, Path As String, Optional Filters As List(Of BaseFileFilter) = Nothing) _Logger = LogConfig.GetLogger() - _Files = New Dictionary(Of String, FileProperties) + _Files = New Dictionary(Of String, FileWatcherProperties) _Watchers = New List(Of FileSystemWatcher) + _Filters = IIf(IsNothing(Filters), GetDefaultFilters(), Filters) _Path = Path - For Each oFilePath As String In Directory.EnumerateFiles(_Path) + For Each oFilePath In Directory.EnumerateFiles(_Path) Try If IO.File.Exists(oFilePath) Then - _Files.Add(oFilePath, New FileProperties With { + _Files.Add(oFilePath, New FileWatcherProperties With { .CreatedAt = DateTime.Now, .ChangedAt = Nothing }) @@ -31,23 +39,39 @@ Public Class FileWatcher Next End Sub - Public Sub Add(Filter As String, Optional SpecialTreatmentFilters As List(Of String) = Nothing) + Public Sub Add(Filter As String) _Watchers.Add(CreateWatcher(Filter)) End Sub - Public Sub Add(Filters As List(Of String), Optional SpecialTreatmentFilters As List(Of String) = Nothing) - For Each oFilter In Filters - _Watchers.Add(CreateWatcher(oFilter)) + Public Sub Start() + For Each oWatcher In _Watchers + oWatcher.EnableRaisingEvents = True Next End Sub + Public Sub [Stop]() + For Each oWatcher In _Watchers + If Not IsNothing(oWatcher) Then + oWatcher.EnableRaisingEvents = False + oWatcher.Dispose() + End If + Next + End Sub + + Private Function GetDefaultFilters() + Return New List(Of BaseFileFilter) From { + New TempFileFilter, + New OfficeFileFilter + } + End Function + Private Function CreateWatcher(Filter As String) Dim oWatcher = New FileSystemWatcher() With { .Path = _Path, .Filter = Filter, - .NotifyFilter = NotifyFilters.CreationTime _ - Or NotifyFilters.LastAccess _ + .NotifyFilter = NotifyFilters.LastAccess _ Or NotifyFilters.LastWrite _ + Or NotifyFilters.FileName _ Or NotifyFilters.Size _ Or NotifyFilters.FileName _ Or NotifyFilters.Attributes @@ -62,16 +86,29 @@ Public Class FileWatcher End Function Private Sub HandleFileCreated(sender As Object, e As FileSystemEventArgs) - _Files.Add(e.FullPath, New FileProperties()) - _Logger.Info("[Created] " & e.FullPath) + _Files.Add(e.FullPath, New FileWatcherProperties()) + _Logger.Debug("[Created] " & e.FullPath) End Sub + + ''' + ''' This may fire twice for a single save operation, + ''' see: https://blogs.msdn.microsoft.com/oldnewthing/20140507-00/?p=1053/ + ''' Private Sub HandleFileChanged(sender As Object, e As FileSystemEventArgs) _Files.Item(e.FullPath).ChangedAt = DateTime.Now - _Logger.Info("[Changed] " & e.FullPath) + _Logger.Debug("[Changed] " & e.FullPath) + + Dim oShouldRaiseSave As Boolean = Not _Filters.Any(Function(oFilter) + Return oFilter.ShouldFilter(e) + End Function) + + If oShouldRaiseSave Then + RaiseEvent FileSaved(e.FullPath, False) + End If End Sub Private Sub HandleFileDeleted(sender As Object, e As FileSystemEventArgs) _Files.Remove(e.FullPath) - _Logger.Info("[Removed] " & e.FullPath) + _Logger.Debug("[Removed] " & e.FullPath) End Sub Private Sub HandleFileRenamed(sender As Object, e As RenamedEventArgs) @@ -80,31 +117,16 @@ Public Class FileWatcher _Files.Add(e.FullPath, oProperties) ' Soll eine umbenannte datei als NEU gelten? - _Logger.Info("[Renamed] {0} --> {1}", e.OldFullPath, e.FullPath) - End Sub + Dim oShouldRaiseSave = _Filters.Any(Function(oFilter) + Return oFilter.ShouldRaiseSave(e) + End Function) - Public Sub Start() - For Each oWatcher In _Watchers - oWatcher.EnableRaisingEvents = True - Next - End Sub + If oShouldRaiseSave Then + RaiseEvent FileSaved(e.OldFullPath, True) + End If - Public Sub [Stop]() - For Each oWatcher In _Watchers - If Not IsNothing(oWatcher) Then - oWatcher.EnableRaisingEvents = False - oWatcher.Dispose() - End If - Next + _Logger.Debug("[Renamed] {0} --> {1}", e.OldFullPath, e.FullPath) End Sub - Public Class FileProperties - Public CreatedAt As DateTime - Public ChangedAt As DateTime - Public Sub New() - CreatedAt = DateTime.Now - ChangedAt = Nothing - End Sub - End Class End Class diff --git a/Filesystem/FileWatcherFilters.vb b/Filesystem/FileWatcherFilters.vb new file mode 100644 index 00000000..84f70b62 --- /dev/null +++ b/Filesystem/FileWatcherFilters.vb @@ -0,0 +1,61 @@ +Imports System.IO + +''' +''' Built-in filters for FileWatcher that are useful for correctly detecting changes on Office documents (currently Office 2016) +''' +Public Class FileWatcherFilters + ''' + ''' Base Filter that all filters must inherit from + ''' Provides two functions that may be overridden and some useful file extension lists + ''' + Public MustInherit Class BaseFileFilter + Public TempFiles As New List(Of String) From {".tmp", ""} + + Public Overridable Function ShouldFilter(e As FileSystemEventArgs) As Boolean + Return False + End Function + Public Overridable Function ShouldRaiseSave(e As RenamedEventArgs) As Boolean + Return False + End Function + End Class + + ''' + ''' Simple Filter that filters changes made on temporary files + ''' + Public Class TempFileFilter + Inherits BaseFileFilter + + Public Overrides Function ShouldFilter(e As FileSystemEventArgs) As Boolean + Dim oFileInfo As New FileInfo(e.FullPath) + Return TempFiles.Contains(oFileInfo.Extension) + End Function + End Class + + ''' + ''' Filter to detect changes on Office files + ''' + Public Class OfficeFileFilter + Inherits BaseFileFilter + + Public OfficeFiles As New List(Of String) From {".docx", ".pptx", ".xlsx"} + + Public Overrides Function ShouldFilter(e As FileSystemEventArgs) As Boolean + Dim oFileInfo As New FileInfo(e.FullPath) + Return OfficeFiles.Contains(oFileInfo.Extension) And oFileInfo.Name.StartsWith("~") + End Function + + Public Overrides Function ShouldRaiseSave(e As RenamedEventArgs) As Boolean + Dim oIsTransform = OfficeFiles.Any(Function(Extension As String) + Return e.OldName.EndsWith(Extension) + End Function) + + ' Check if it is renamed to a temp file + Dim oIsTempFile = TempFiles.Any(Function(Extension) + Return e.Name.EndsWith(Extension) + End Function) + + + Return oIsTransform And oIsTempFile + End Function + End Class +End Class diff --git a/Filesystem/FileWatcherProperties.vb b/Filesystem/FileWatcherProperties.vb new file mode 100644 index 00000000..5eadecbe --- /dev/null +++ b/Filesystem/FileWatcherProperties.vb @@ -0,0 +1,10 @@ +Public Class FileWatcherProperties + Public Property CreatedAt As DateTime + Public Property ChangedAt As DateTime + Public ReadOnly Property HasChanged As Boolean + Public Sub New() + CreatedAt = DateTime.Now + ChangedAt = Nothing + HasChanged = False + End Sub +End Class diff --git a/Filesystem/Filesystem.vbproj b/Filesystem/Filesystem.vbproj index f7fd9859..720246c0 100644 --- a/Filesystem/Filesystem.vbproj +++ b/Filesystem/Filesystem.vbproj @@ -81,6 +81,8 @@ + + True diff --git a/TestGUI/FolderWatcher.vb b/TestGUI/FolderWatcher.vb index 2dff7c01..aa1dc9c3 100644 --- a/TestGUI/FolderWatcher.vb +++ b/TestGUI/FolderWatcher.vb @@ -1,30 +1,37 @@ Imports System.ComponentModel Imports System.IO Imports DigitalData.Modules.Filesystem +Imports DigitalData.Modules.Filesystem.FileWatcherFilters Imports DigitalData.Modules.Logging Public Class FolderWatcher Private _LogConfig As LogConfig + Private _Logger As Logger Private _Watcher As FileWatcher - Public Sub FileCreated(_sender As Object, _e As FileSystemEventArgs) - ListBox1.Items.Add($"File created: {_e.FullPath}") - End Sub - - Public Sub FileChanged(_sender As Object, _e As FileSystemEventArgs) - ListBox1.Items.Add($"File changed: {_e.FullPath}") - End Sub - + Private Sub FolderWatcher_Load(sender As Object, e As EventArgs) Handles Me.Load _LogConfig = New LogConfig(LogConfig.PathType.CurrentDirectory, Nothing, "MAIN") - _Watcher = New FileWatcher(_LogConfig, "E:\Watcher") + _LogConfig.Debug = True + _Logger = _LogConfig.GetLogger() + Dim oFilters As New List(Of BaseFileFilter) From { + New TempFileFilter, + New OfficeFileFilter + } + _Watcher = New FileWatcher(_LogConfig, "E:\Watcher", oFilters) _Watcher.Add("*.*") + AddHandler _Watcher.FileSaved, AddressOf HandleFileSaved + _Watcher.Start() End Sub + Private Sub HandleFileSaved(FullName As String, IsSpecial As Boolean) + _Logger.Info("{1}File Saved: {0}", FullName, IIf(IsSpecial, "Special ", "")) + End Sub + Private Sub FolderWatcher_Closing(sender As Object, e As CancelEventArgs) Handles Me.Closing _Watcher.Stop() End Sub From 9ee59ac4009c304da242805667a13c26cb673103 Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Wed, 13 Feb 2019 15:19:09 +0100 Subject: [PATCH 18/23] Config Manager WIP --- Config/Config.vbproj | 9 +- Config/ConfigManager.vb | 142 +++++++++++++++++++++ Config/{BaseConfig.vb => OldConfig.vb} | 2 +- Config/SinceVersionAttribute.vb | 9 ++ Filesystem/File.vb | 2 +- TestGUI/ConfigTest.Designer.vb | 62 +++++++++ TestGUI/ConfigTest.resx | 120 +++++++++++++++++ TestGUI/ConfigTest.vb | 25 ++++ TestGUI/Form1.Designer.vb | 12 ++ TestGUI/Form1.vb | 1 + TestGUI/My Project/Application.Designer.vb | 2 +- TestGUI/My Project/Application.myapp | 2 +- TestGUI/My Project/app.manifest | 76 +++++++++++ TestGUI/TestGUI.vbproj | 17 +++ 14 files changed, 476 insertions(+), 5 deletions(-) create mode 100644 Config/ConfigManager.vb rename Config/{BaseConfig.vb => OldConfig.vb} (98%) create mode 100644 Config/SinceVersionAttribute.vb create mode 100644 TestGUI/ConfigTest.Designer.vb create mode 100644 TestGUI/ConfigTest.resx create mode 100644 TestGUI/ConfigTest.vb create mode 100644 TestGUI/My Project/app.manifest diff --git a/Config/Config.vbproj b/Config/Config.vbproj index 4794b3ff..e1d2d6a4 100644 --- a/Config/Config.vbproj +++ b/Config/Config.vbproj @@ -54,6 +54,7 @@ + @@ -72,7 +73,8 @@ - + + True @@ -88,6 +90,7 @@ Settings.settings True + @@ -110,6 +113,10 @@ + + {991d0231-4623-496d-8bd0-9ca906029cbc} + Filesystem + {903b2d7d-3b80-4be9-8713-7447b704e1b0} Logging diff --git a/Config/ConfigManager.vb b/Config/ConfigManager.vb new file mode 100644 index 00000000..08672da4 --- /dev/null +++ b/Config/ConfigManager.vb @@ -0,0 +1,142 @@ +Imports System.IO +Imports System.Xml.Serialization +Imports DigitalData.Modules.Logging +Imports DigitalData.Modules.Filesystem + +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 ReadOnly _CurrentDataPath As String + + Private ReadOnly _Schema As T + Private ReadOnly _Serializer As XmlSerializer + + Public ReadOnly Property Config As T + + ''' + ''' Creates a new instance of the ConfigManager + ''' + ''' + ''' 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) + ''' + ''' LogConfig instance + ''' The first path to check for a config file, eg. AppData + ''' The second path to check for a config file, eg. ProgramData + 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) + + _Schema = Activator.CreateInstance(Of T) + _Serializer = New XmlSerializer(_Schema.GetType) + + If Not Directory.Exists(UserConfigPath) Then + Throw New DirectoryNotFoundException($"Path {UserConfigPath} does not exist!") + End If + + If Not Directory.Exists(ComputerConfigPath) Then + Throw New DirectoryNotFoundException($"Path {ComputerConfigPath} does not exist!") + End If + + If Not Filesystem.File Then Then + Throw New DirectoryNotFoundException() + End If + + If IO.File.Exists(_UserPath) Then + _Logger.Debug("Loading config from UserPath: {0}", _UserPath) + _CurrentDataPath = _UserPath + _Config = ReadFromFile(_UserPath) + ElseIf IO.File.Exists(_ComputerPath) Then + _Logger.Debug("Loading config from ComputerPath: {0}", _ComputerPath) + _CurrentDataPath = _ComputerPath + _Config = ReadFromFile(_ComputerPath) + Else + _Logger.Debug("Creating default config in UserPath: {0}", _UserPath) + _CurrentDataPath = _UserPath + _Config = Activator.CreateInstance(_Schema.GetType) + + WriteToFile(_Config, _UserPath) + End If + End Sub + + ''' + ''' Save the current config object to `UserConfigPath` + ''' + Public Sub Save() + WriteToFile(_Config, _UserPath) + End Sub + + ''' + ''' Serialize a config object to byte array + ''' + ''' + ''' + 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 + + ''' + ''' Write an object to disk as xml + ''' + ''' The object to write + ''' The file name to write to + 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 + + ''' + ''' Reads an xml from disk and deserializes to object + ''' + ''' + 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 + + Return oConfig + Catch ex As Exception + _Logger.Error(ex) + Throw ex + End Try + End Function +End Class diff --git a/Config/BaseConfig.vb b/Config/OldConfig.vb similarity index 98% rename from Config/BaseConfig.vb rename to Config/OldConfig.vb index 4e909d06..608cbd4d 100644 --- a/Config/BaseConfig.vb +++ b/Config/OldConfig.vb @@ -1,7 +1,7 @@ Imports System.IO Imports DigitalData.Modules.Logging -Public MustInherit Class BaseConfig +Public MustInherit Class OldConfig Private Const _userConfigFileName As String = "UserConfig.xml" Private _logFactory As LogConfig Private _logger As Logger diff --git a/Config/SinceVersionAttribute.vb b/Config/SinceVersionAttribute.vb new file mode 100644 index 00000000..f3b94c7e --- /dev/null +++ b/Config/SinceVersionAttribute.vb @@ -0,0 +1,9 @@ +Public Class SinceVersionAttribute + Inherits Attribute + + Public Version As Version + + Public Sub New(Version As String) + Me.Version = New Version(Version) + End Sub +End Class \ No newline at end of file diff --git a/Filesystem/File.vb b/Filesystem/File.vb index 4d02582f..d11c27c8 100644 --- a/Filesystem/File.vb +++ b/Filesystem/File.vb @@ -94,7 +94,7 @@ Public Class File IO.File.Move(FilePath, Path.Combine(Directory, oFileInfo.Name)) End Sub - Private Function TestPathIsDirectory(Path As String) As Boolean + Public Function TestPathIsDirectory(Path As String) As Boolean Dim oIsDirectory As Boolean = (System.IO.File.GetAttributes(Path) And FileAttributes.Directory) = FileAttributes.Directory Return oIsDirectory End Function diff --git a/TestGUI/ConfigTest.Designer.vb b/TestGUI/ConfigTest.Designer.vb new file mode 100644 index 00000000..5d46d129 --- /dev/null +++ b/TestGUI/ConfigTest.Designer.vb @@ -0,0 +1,62 @@ + _ +Partial Class ConfigTest + Inherits System.Windows.Forms.Form + + 'Das Formular überschreibt den Löschvorgang, um die Komponentenliste zu bereinigen. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Wird vom Windows Form-Designer benötigt. + Private components As System.ComponentModel.IContainer + + 'Hinweis: Die folgende Prozedur ist für den Windows Form-Designer erforderlich. + 'Das Bearbeiten ist mit dem Windows Form-Designer möglich. + 'Das Bearbeiten mit dem Code-Editor ist nicht möglich. + _ + Private Sub InitializeComponent() + Me.Button1 = New System.Windows.Forms.Button() + Me.Button2 = New System.Windows.Forms.Button() + Me.SuspendLayout() + ' + 'Button1 + ' + Me.Button1.Location = New System.Drawing.Point(119, 76) + Me.Button1.Name = "Button1" + Me.Button1.Size = New System.Drawing.Size(149, 45) + Me.Button1.TabIndex = 0 + Me.Button1.Text = "LoadConfig" + Me.Button1.UseVisualStyleBackColor = True + ' + 'Button2 + ' + Me.Button2.Location = New System.Drawing.Point(429, 86) + Me.Button2.Name = "Button2" + Me.Button2.Size = New System.Drawing.Size(75, 23) + Me.Button2.TabIndex = 1 + Me.Button2.Text = "SaveConfig" + Me.Button2.UseVisualStyleBackColor = True + ' + 'ConfigTest + ' + 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.Button2) + Me.Controls.Add(Me.Button1) + Me.Name = "ConfigTest" + Me.Text = "ConfigTest" + Me.ResumeLayout(False) + + End Sub + + Friend WithEvents Button1 As Button + Friend WithEvents Button2 As Button +End Class diff --git a/TestGUI/ConfigTest.resx b/TestGUI/ConfigTest.resx new file mode 100644 index 00000000..1af7de15 --- /dev/null +++ b/TestGUI/ConfigTest.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/TestGUI/ConfigTest.vb b/TestGUI/ConfigTest.vb new file mode 100644 index 00000000..8e0dbbc7 --- /dev/null +++ b/TestGUI/ConfigTest.vb @@ -0,0 +1,25 @@ +Imports DigitalData.Modules.Config +Imports DigitalData.Modules.Logging + +Public Class ConfigTest + Private _LogConfig As LogConfig + Private _config As ConfigManager(Of Config) + Private _FilePath As String = IO.Path.Combine(Application.LocalUserAppDataPath, "UserConfig.xml") + + Private Sub ConfigTest_Load(sender As Object, e As EventArgs) Handles MyBase.Load + _LogConfig = New LogConfig(LogConfig.PathType.AppData) + _config = New ConfigManager(Of Config)(_LogConfig, Application.UserAppDataPath, Application.CommonAppDataPath) + End Sub + + Public Class Config + + Public Property StringEntry As String = "TEST" + Public Property BoolEntry As Boolean = True + Public Property IntEntry As Integer = 123 + End Class + + Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click + _config.Config.IntEntry = 999 + _config.Save() + End Sub +End Class \ No newline at end of file diff --git a/TestGUI/Form1.Designer.vb b/TestGUI/Form1.Designer.vb index ece45d55..f4812171 100644 --- a/TestGUI/Form1.Designer.vb +++ b/TestGUI/Form1.Designer.vb @@ -45,6 +45,7 @@ Partial Class Form1 Me.Label6 = New System.Windows.Forms.Label() Me.Button4 = New System.Windows.Forms.Button() Me.LookupControl1 = New DigitalData.Controls.LookupGrid.LookupControl() + Me.Button6 = New System.Windows.Forms.Button() CType(Me.GridControl1, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.GridView1, System.ComponentModel.ISupportInitialize).BeginInit() Me.SuspendLayout() @@ -242,11 +243,21 @@ Partial Class Form1 Me.LookupControl1.Size = New System.Drawing.Size(270, 23) Me.LookupControl1.TabIndex = 23 ' + 'Button6 + ' + Me.Button6.Location = New System.Drawing.Point(764, 308) + Me.Button6.Name = "Button6" + Me.Button6.Size = New System.Drawing.Size(75, 23) + Me.Button6.TabIndex = 24 + Me.Button6.Text = "Button6" + Me.Button6.UseVisualStyleBackColor = True + ' 'Form1 ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(1050, 487) + Me.Controls.Add(Me.Button6) Me.Controls.Add(Me.LookupControl1) Me.Controls.Add(Me.Button4) Me.Controls.Add(Me.Label6) @@ -300,4 +311,5 @@ Partial Class Form1 Friend WithEvents Label6 As Label Friend WithEvents Button4 As Button Friend WithEvents LookupControl1 As DigitalData.Controls.LookupGrid.LookupControl + Friend WithEvents Button6 As Button End Class diff --git a/TestGUI/Form1.vb b/TestGUI/Form1.vb index 1103eed8..7b2dcde6 100644 --- a/TestGUI/Form1.vb +++ b/TestGUI/Form1.vb @@ -169,4 +169,5 @@ Public Class Form1 bw1.RunWorkerAsync() End Sub + End Class diff --git a/TestGUI/My Project/Application.Designer.vb b/TestGUI/My Project/Application.Designer.vb index b30e1dba..716d1571 100644 --- a/TestGUI/My Project/Application.Designer.vb +++ b/TestGUI/My Project/Application.Designer.vb @@ -32,7 +32,7 @@ Namespace My _ Protected Overrides Sub OnCreateMainForm() - Me.MainForm = Global.TestGUI.FolderWatcher + Me.MainForm = Global.TestGUI.ConfigTest End Sub End Class End Namespace diff --git a/TestGUI/My Project/Application.myapp b/TestGUI/My Project/Application.myapp index d87a023e..75bf29f8 100644 --- a/TestGUI/My Project/Application.myapp +++ b/TestGUI/My Project/Application.myapp @@ -1,7 +1,7 @@  true - FolderWatcher + ConfigTest false 0 true diff --git a/TestGUI/My Project/app.manifest b/TestGUI/My Project/app.manifest new file mode 100644 index 00000000..ef881eb8 --- /dev/null +++ b/TestGUI/My Project/app.manifest @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/TestGUI/TestGUI.vbproj b/TestGUI/TestGUI.vbproj index e0b1a238..4a719fb0 100644 --- a/TestGUI/TestGUI.vbproj +++ b/TestGUI/TestGUI.vbproj @@ -46,6 +46,9 @@ On + + My Project\app.manifest + @@ -93,6 +96,12 @@ + + ConfigTest.vb + + + Form + FolderWatcher.vb @@ -123,6 +132,9 @@ + + ConfigTest.vb + FolderWatcher.vb @@ -138,6 +150,7 @@ + MyApplicationCodeGenerator Application.Designer.vb @@ -154,6 +167,10 @@ + + {44982f9b-6116-44e2-85d0-f39650b1ef99} + Config + {991d0231-4623-496d-8bd0-9ca906029cbc} Filesystem From 914ba9dc90b1b9ab8a048cabc09be33e024b8309 Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Wed, 13 Feb 2019 16:23:02 +0100 Subject: [PATCH 19/23] config in client suite --- Config/Config.vbproj | 1 - Config/ConfigManager.vb | 44 +++++++++---- Config/OldConfig.vb | 78 ------------------------ EDMI_ClientSuite/ApplicationEvents.vb | 6 +- EDMI_ClientSuite/ClassConfig.vb | 3 + EDMI_ClientSuite/ClassInit.vb | 10 +-- EDMI_ClientSuite/EDMI_ClientSuite.vbproj | 5 ++ EDMI_ClientSuite/MyApplication.vb | 2 + EDMI_ClientSuite/frmConfigService.vb | 4 +- EDMI_ClientSuite/frmSplash.vb | 2 +- Filesystem/File.vb | 4 ++ 11 files changed, 60 insertions(+), 99 deletions(-) delete mode 100644 Config/OldConfig.vb create mode 100644 EDMI_ClientSuite/ClassConfig.vb diff --git a/Config/Config.vbproj b/Config/Config.vbproj index e1d2d6a4..4e569b1a 100644 --- a/Config/Config.vbproj +++ b/Config/Config.vbproj @@ -73,7 +73,6 @@ - diff --git a/Config/ConfigManager.vb b/Config/ConfigManager.vb index 08672da4..a1b894fb 100644 --- a/Config/ConfigManager.vb +++ b/Config/ConfigManager.vb @@ -12,7 +12,7 @@ Public Class ConfigManager(Of T) Private ReadOnly _File As Filesystem.File Private ReadOnly _UserPath As String Private ReadOnly _ComputerPath As String - Private ReadOnly _CurrentDataPath As String + Private _CurrentDataPath As String Private ReadOnly _Schema As T Private ReadOnly _Serializer As XmlSerializer @@ -53,33 +53,51 @@ Public Class ConfigManager(Of T) Throw New DirectoryNotFoundException($"Path {ComputerConfigPath} does not exist!") End If - If Not Filesystem.File Then Then - Throw New DirectoryNotFoundException() + If Not _File.TestPathIsDirectory(UserConfigPath) Then + Throw New ArgumentException($"Path {UserConfigPath} is not a directory!") End If + If Not _File.TestPathIsDirectory(ComputerConfigPath) Then + Throw New ArgumentException($"Path {ComputerConfigPath} is not a directory!") + End If + + _Config = LoadConfig() + End Sub + + ''' + ''' Save the current config object to `UserConfigPath` + ''' + Public Sub Save() + WriteToFile(_Config, _UserPath) + End Sub + + ''' + ''' 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` + ''' + ''' + 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 - _Config = ReadFromFile(_UserPath) + oConfig = ReadFromFile(_UserPath) ElseIf IO.File.Exists(_ComputerPath) Then _Logger.Debug("Loading config from ComputerPath: {0}", _ComputerPath) _CurrentDataPath = _ComputerPath - _Config = ReadFromFile(_ComputerPath) + oConfig = ReadFromFile(_ComputerPath) Else _Logger.Debug("Creating default config in UserPath: {0}", _UserPath) _CurrentDataPath = _UserPath - _Config = Activator.CreateInstance(_Schema.GetType) + oConfig = Activator.CreateInstance(_Schema.GetType) WriteToFile(_Config, _UserPath) End If - End Sub - ''' - ''' Save the current config object to `UserConfigPath` - ''' - Public Sub Save() - WriteToFile(_Config, _UserPath) - End Sub + Return oConfig + End Function ''' ''' Serialize a config object to byte array diff --git a/Config/OldConfig.vb b/Config/OldConfig.vb deleted file mode 100644 index 608cbd4d..00000000 --- a/Config/OldConfig.vb +++ /dev/null @@ -1,78 +0,0 @@ -Imports System.IO -Imports DigitalData.Modules.Logging - -Public MustInherit Class OldConfig - Private Const _userConfigFileName As String = "UserConfig.xml" - Private _logFactory As LogConfig - Private _logger As Logger - - Protected Const _configKey As String = "Key" - Protected Const _configValue As String = "Value" - Protected _dataTable As DataTable - - Protected ReadOnly Property PropertyNames As Dictionary(Of String, String) - Get - Return New Dictionary(Of String, String) - End Get - End Property - - Public Sub New(LogConfig As LogConfig) - _logFactory = LogConfig - _logger = LogConfig.GetLogger() - - - End Sub - - Private Function GetUserConfigPath() As String - Dim oAppData = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) - Dim oCompanyName = My.Application.Info.CompanyName - Dim oProductName = My.Application.Info.ProductName - - Return Path.Combine(oAppData, oCompanyName, oProductName, _userConfigFileName) - End Function - - Protected Function LoadConfig() As DataTable - Dim oUserConfigPath As String = GetUserConfigPath() - Dim oDatatable As New DataTable() - - If Not File.Exists(oUserConfigPath) Then - _logger.Warn("Config file {0} does not exist", oUserConfigPath) - Return Nothing - End If - - Try - oDatatable.ReadXml(oUserConfigPath) - Return oDatatable - Catch ex As Exception - _logger.Error(ex) - Return Nothing - End Try - End Function - - Protected Sub SaveConfig(DataTable As DataTable) - Dim oUserConfigPath As String = GetUserConfigPath() - - Try - DataTable.WriteXml(oUserConfigPath) - Catch ex As Exception - _logger.Error(ex) - End Try - End Sub - - Protected Function ConvertToDataTable(dictionary As Dictionary(Of String, String)) As DataTable - Dim oNewDataTable As New DataTable("Config") - oNewDataTable.Columns.Add(New DataColumn("Key", GetType(String))) - oNewDataTable.Columns.Add(New DataColumn("Value", GetType(String))) - - For Each oProperty In dictionary - Dim oNewRow = oNewDataTable.NewRow() - oNewRow.Item("Key") = oProperty.Key - oNewRow.Item("Value") = oProperty.Value - oNewDataTable.Rows.Add(oNewRow) - Next - - oNewDataTable.AcceptChanges() - - Return oNewDataTable - End Function -End Class diff --git a/EDMI_ClientSuite/ApplicationEvents.vb b/EDMI_ClientSuite/ApplicationEvents.vb index 7feea862..6e4808af 100644 --- a/EDMI_ClientSuite/ApplicationEvents.vb +++ b/EDMI_ClientSuite/ApplicationEvents.vb @@ -1,4 +1,5 @@ -Imports DigitalData.Modules.Logging +Imports DigitalData.Modules.Config +Imports DigitalData.Modules.Logging Imports DigitalData.Modules.Logging.LogConfig Namespace My @@ -13,7 +14,10 @@ Namespace My Public Sub App_Startup() Handles Me.Startup Dim oLogConfig As New LogConfig(PathType.AppData) + Dim oConfigManager As New ConfigManager(Of ClassConfig)(oLogConfig, Windows.Forms.Application.UserAppDataPath, Windows.Forms.Application.CommonAppDataPath) + LogConfig = oLogConfig + ConfigManager = oConfigManager _Logger = LogConfig.GetLogger() _Logger.Info("Starting Client Suite..") diff --git a/EDMI_ClientSuite/ClassConfig.vb b/EDMI_ClientSuite/ClassConfig.vb new file mode 100644 index 00000000..34f14285 --- /dev/null +++ b/EDMI_ClientSuite/ClassConfig.vb @@ -0,0 +1,3 @@ +Public Class ClassConfig + Public Property ServiceConnection As String = String.Empty +End Class diff --git a/EDMI_ClientSuite/ClassInit.vb b/EDMI_ClientSuite/ClassInit.vb index d309802a..bec7cdc4 100644 --- a/EDMI_ClientSuite/ClassInit.vb +++ b/EDMI_ClientSuite/ClassInit.vb @@ -1,5 +1,5 @@ Imports DigitalData.Modules.Logging -Imports DigitalData.Modules.Logging.LogConfig +Imports DigitalData.Modules.Config Imports System.ServiceModel Imports EDMI_ClientSuite.NetworkService_DDEDM Imports System.ServiceModel.Channels @@ -19,8 +19,9 @@ Public Class ClassInit _Logger = My.LogConfig.GetLogger() End Sub - Public Function TestConnectionURLExists() - Return My.Settings.ICMServiceAddress <> String.Empty + Public Function TestConnectionURLExists() As Boolean + Return My.ConfigManager.Config.ServiceConnection <> String.Empty + 'Return My.Settings.ICMServiceAddress <> String.Empty End Function Public Async Function TestConnectionAsync(EndpointURL As String) As Task(Of ConnectionTestResult) @@ -44,7 +45,8 @@ Public Class ClassInit End Function Public Function GetChannelFactory() As IChannelFactory(Of IEDMServiceChannel) - Return GetChannelFactory(My.Settings.ICMServiceAddress) + 'Return GetChannelFactory(My.Settings.ICMServiceAddress) + Return GetChannelFactory(My.ConfigManager.Config.ServiceConnection) End Function Public Function GetChannelFactory(EndpointURL As String) As ChannelFactory(Of IEDMServiceChannel) diff --git a/EDMI_ClientSuite/EDMI_ClientSuite.vbproj b/EDMI_ClientSuite/EDMI_ClientSuite.vbproj index 1cd69976..342ea652 100644 --- a/EDMI_ClientSuite/EDMI_ClientSuite.vbproj +++ b/EDMI_ClientSuite/EDMI_ClientSuite.vbproj @@ -115,6 +115,7 @@ + @@ -368,6 +369,10 @@ + + {44982F9B-6116-44E2-85D0-F39650B1EF99} + Config + {5b1171dc-fffe-4813-a20d-786aae47b320} EDMIFileOps diff --git a/EDMI_ClientSuite/MyApplication.vb b/EDMI_ClientSuite/MyApplication.vb index 228e18b1..f0442aed 100644 --- a/EDMI_ClientSuite/MyApplication.vb +++ b/EDMI_ClientSuite/MyApplication.vb @@ -1,5 +1,6 @@ Imports System.ServiceModel Imports System.Threading +Imports DigitalData.Modules.Config Imports DigitalData.Modules.Logging Imports EDMI_ClientSuite.NetworkService_DDEDM @@ -10,6 +11,7 @@ Namespace My ''' Module Extension + Property ConfigManager As ConfigManager(Of ClassConfig) Property LogConfig As LogConfig Property ChannelFactory As ChannelFactory(Of IEDMServiceChannel) Property Channel As IEDMServiceChannel diff --git a/EDMI_ClientSuite/frmConfigService.vb b/EDMI_ClientSuite/frmConfigService.vb index ad9b758e..3fbfd691 100644 --- a/EDMI_ClientSuite/frmConfigService.vb +++ b/EDMI_ClientSuite/frmConfigService.vb @@ -20,7 +20,9 @@ Public Class frmConfigService If oResult = ConnectionTestResult.Successful Then ' Save Endpoint URL - My.Settings.ICMServiceAddress = oEndpointURL + My.ConfigManager.Config.ServiceConnection = oEndpointURL + My.ConfigManager.Save() + 'My.Settings.ICMServiceAddress = oEndpointURL lblStatus.Text = "Verbindung hergestellt." Else Select Case oResult diff --git a/EDMI_ClientSuite/frmSplash.vb b/EDMI_ClientSuite/frmSplash.vb index 678e65b8..baeee23b 100644 --- a/EDMI_ClientSuite/frmSplash.vb +++ b/EDMI_ClientSuite/frmSplash.vb @@ -26,7 +26,7 @@ Public NotInheritable Class frmSplash BringToFront() Dim oInit As New ClassInit() - Dim oConnectionURLExists = oInit.TestConnectionURLExists + Dim oConnectionURLExists = oInit.TestConnectionURLExists() If Not oConnectionURLExists Then Dim oResult = frmConfigService.ShowDialog() diff --git a/Filesystem/File.vb b/Filesystem/File.vb index d11c27c8..e27264af 100644 --- a/Filesystem/File.vb +++ b/Filesystem/File.vb @@ -95,6 +95,10 @@ Public Class File End Sub Public Function TestPathIsDirectory(Path As String) As Boolean + If Not Directory.Exists(Path) Then + Return False + End If + Dim oIsDirectory As Boolean = (System.IO.File.GetAttributes(Path) And FileAttributes.Directory) = FileAttributes.Directory Return oIsDirectory End Function From 191b3010bb2bde5a98640dd1650417db612a760e Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Thu, 14 Feb 2019 15:15:42 +0100 Subject: [PATCH 20/23] Improve Config --- EDMI_ClientSuite/ClassConfig.vb | 44 +++++++++++++++++++++- EDMI_ClientSuite/MyApplication.vb | 5 +++ EDMI_ClientSuite/frmConfigService.vb | 11 +++++- EDMI_ClientSuite/frmConfigUser.Designer.vb | 22 +++-------- EDMI_ClientSuite/frmConfigUser.resx | 9 ----- EDMI_ClientSuite/frmConfigUser.vb | 10 +++-- 6 files changed, 68 insertions(+), 33 deletions(-) diff --git a/EDMI_ClientSuite/ClassConfig.vb b/EDMI_ClientSuite/ClassConfig.vb index 34f14285..d4a2c7f5 100644 --- a/EDMI_ClientSuite/ClassConfig.vb +++ b/EDMI_ClientSuite/ClassConfig.vb @@ -1,3 +1,43 @@ -Public Class ClassConfig - Public Property ServiceConnection As String = String.Empty +Imports System.ComponentModel +Imports System.Runtime.CompilerServices +Imports System.Xml.Serialization + +''' +''' --- User Config for EDMI --- +''' +''' All settings are simple properties that should have a default value where possible +''' +''' More complex properties (for example, ServiceConnection) are built from simple ones, +''' should be readonly and have an `XmlIgnore` Attribute to prevent them from being saved to the config file. +''' +''' They can make saving and loading complex properties more easy. +''' +''' The config is loaded with `ConfigManager` which is initialized in ApplicationEvents +''' to ensure that the config is loaded before any of the forms (that might need a config) +''' +''' The config object can be accessed in two ways: +''' +''' - My.ConfigManager.Config +''' - My.Config (which simply points to My.ConfigManager.Config) +''' +''' After changing a config value, My.ConfigManager.Save() must be called to persist the change in the config file +''' +Public Class ClassConfig + ' === Complex/Readonly Config Properties + + Public ReadOnly Property ServiceConnection As String + Get + If ServiceIP = String.Empty Or ServicePort = -1 Then + Return String.Empty + Else + Return $"net.tcp://{ServiceIP}:{ServicePort}/DigitalData/Services/Main" + End If + End Get + End Property + + ' === Simple/Actual Config Properties === + Public Property ServiceIP As String = String.Empty + Public Property ServicePort As Integer = -1 + Public Property LogDebug As Boolean = False + Public Property UserLanguage As String = "de-DE" End Class diff --git a/EDMI_ClientSuite/MyApplication.vb b/EDMI_ClientSuite/MyApplication.vb index f0442aed..a6e04ea8 100644 --- a/EDMI_ClientSuite/MyApplication.vb +++ b/EDMI_ClientSuite/MyApplication.vb @@ -12,6 +12,11 @@ Namespace My Module Extension Property ConfigManager As ConfigManager(Of ClassConfig) + ReadOnly Property Config As ClassConfig + Get + Return ConfigManager.Config + End Get + End Property Property LogConfig As LogConfig Property ChannelFactory As ChannelFactory(Of IEDMServiceChannel) Property Channel As IEDMServiceChannel diff --git a/EDMI_ClientSuite/frmConfigService.vb b/EDMI_ClientSuite/frmConfigService.vb index 3fbfd691..9e9ef5a2 100644 --- a/EDMI_ClientSuite/frmConfigService.vb +++ b/EDMI_ClientSuite/frmConfigService.vb @@ -6,6 +6,11 @@ Public Class frmConfigService Private Sub frmServiceConfig_Load(sender As Object, e As EventArgs) Handles Me.Load _Init = New ClassInit() + If My.ConfigManager.Config.ServiceConnection <> String.Empty Then + txtIPAddress.Text = My.ConfigManager.Config.ServiceIP + txtPort.Text = My.ConfigManager.Config.ServicePort + End If + txtIPAddress.Focus() End Sub @@ -15,12 +20,14 @@ Public Class frmConfigService Dim oEndpointURL = $"net.tcp://{oIPAddress}:{oPort}/DigitalData/Services/Main" Dim oResult As ConnectionTestResult + My.Config.ServiceIP = oIPAddress + My.Config.ServicePort = Integer.Parse(oPort) + lblStatus.Text = "Verbindung wird hergestellt..." - oResult = Await _Init.TestConnectionAsync(oEndpointURL) + oResult = Await _Init.TestConnectionAsync(My.ConfigManager.Config.ServiceConnection) If oResult = ConnectionTestResult.Successful Then ' Save Endpoint URL - My.ConfigManager.Config.ServiceConnection = oEndpointURL My.ConfigManager.Save() 'My.Settings.ICMServiceAddress = oEndpointURL lblStatus.Text = "Verbindung hergestellt." diff --git a/EDMI_ClientSuite/frmConfigUser.Designer.vb b/EDMI_ClientSuite/frmConfigUser.Designer.vb index 94f24f2a..7d598497 100644 --- a/EDMI_ClientSuite/frmConfigUser.Designer.vb +++ b/EDMI_ClientSuite/frmConfigUser.Designer.vb @@ -1,9 +1,9 @@ - _ + Partial Class frmConfigUser Inherits System.Windows.Forms.Form 'Das Formular überschreibt den Löschvorgang, um die Komponentenliste zu bereinigen. - _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) Try If disposing AndAlso components IsNot Nothing Then @@ -20,11 +20,10 @@ Partial Class frmConfigUser 'Hinweis: Die folgende Prozedur ist für den Windows Form-Designer erforderlich. 'Das Bearbeiten ist mit dem Windows Form-Designer möglich. 'Das Bearbeiten mit dem Code-Editor ist nicht möglich. - _ + Private Sub InitializeComponent() Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmConfigUser)) Me.TabPageSupport = New DevExpress.XtraTab.XtraTabPage() - Me.SimpleButton1 = New DevExpress.XtraEditors.SimpleButton() Me.btnAppFolder = New DevExpress.XtraEditors.SimpleButton() Me.btnLogFolder = New DevExpress.XtraEditors.SimpleButton() Me.Button4 = New System.Windows.Forms.Button() @@ -43,7 +42,6 @@ Partial Class frmConfigUser ' 'TabPageSupport ' - Me.TabPageSupport.Controls.Add(Me.SimpleButton1) Me.TabPageSupport.Controls.Add(Me.btnAppFolder) Me.TabPageSupport.Controls.Add(Me.btnLogFolder) Me.TabPageSupport.Controls.Add(Me.Button4) @@ -51,18 +49,9 @@ Partial Class frmConfigUser Me.TabPageSupport.Controls.Add(Me.chkLogErrorsOnly) Me.TabPageSupport.ImageOptions.Image = CType(resources.GetObject("TabPageSupport.ImageOptions.Image"), System.Drawing.Image) Me.TabPageSupport.Name = "TabPageSupport" - Me.TabPageSupport.Size = New System.Drawing.Size(703, 448) + Me.TabPageSupport.Size = New System.Drawing.Size(700, 444) Me.TabPageSupport.Text = "Support" ' - 'SimpleButton1 - ' - Me.SimpleButton1.ImageOptions.Image = CType(resources.GetObject("SimpleButton1.ImageOptions.Image"), System.Drawing.Image) - Me.SimpleButton1.Location = New System.Drawing.Point(349, 100) - Me.SimpleButton1.Name = "SimpleButton1" - Me.SimpleButton1.Size = New System.Drawing.Size(164, 36) - Me.SimpleButton1.TabIndex = 21 - Me.SimpleButton1.Text = "AppData Ordner öffnen" - ' 'btnAppFolder ' Me.btnAppFolder.ImageOptions.Image = CType(resources.GetObject("btnAppFolder.ImageOptions.Image"), System.Drawing.Image) @@ -135,7 +124,7 @@ Partial Class frmConfigUser Me.TabPageMain.Controls.Add(Me.cmbLanguage) Me.TabPageMain.ImageOptions.Image = CType(resources.GetObject("TabPageMain.ImageOptions.Image"), System.Drawing.Image) Me.TabPageMain.Name = "TabPageMain" - Me.TabPageMain.Size = New System.Drawing.Size(703, 448) + Me.TabPageMain.Size = New System.Drawing.Size(700, 444) Me.TabPageMain.Text = "Allgemein" ' 'Label1 @@ -197,5 +186,4 @@ Partial Class frmConfigUser Friend WithEvents cmbLanguage As ComboBox Friend WithEvents btnLogFolder As DevExpress.XtraEditors.SimpleButton Friend WithEvents btnAppFolder As DevExpress.XtraEditors.SimpleButton - Friend WithEvents SimpleButton1 As DevExpress.XtraEditors.SimpleButton End Class diff --git a/EDMI_ClientSuite/frmConfigUser.resx b/EDMI_ClientSuite/frmConfigUser.resx index 8540ece9..c4c2117d 100644 --- a/EDMI_ClientSuite/frmConfigUser.resx +++ b/EDMI_ClientSuite/frmConfigUser.resx @@ -118,15 +118,6 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m - dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAArdEVYdFRpdGxlAE9wZW47Rm9sZGVyO0JhcnM7Umli - Ym9uO1N0YW5kYXJkO0xvYWTxw8RjAAAAb0lEQVQ4T6XQ0Q2AIAwEUBbsMs7Q0ZzHFeqVRIJ6VQof7+fC - XUiLmS2hYQYNM4qqChjhOS31fICVL8JKvb+BSBueHUB3cQCGB+oxmWjgVjj2TcAC8hzwx1+Fl34gXYb2 - g6ky1BtMl1295AoajrNyArCYwjN4ThJYAAAAAElFTkSuQmCC - - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m diff --git a/EDMI_ClientSuite/frmConfigUser.vb b/EDMI_ClientSuite/frmConfigUser.vb index 44537f4f..9f083691 100644 --- a/EDMI_ClientSuite/frmConfigUser.vb +++ b/EDMI_ClientSuite/frmConfigUser.vb @@ -13,6 +13,8 @@ Public Class frmConfigUser Private Sub frmUserBasics_Load(sender As Object, e As EventArgs) Handles Me.Load _Logger = My.LogConfig.GetLogger() + + chkLogErrorsOnly.Checked = Not My.Config.LogDebug End Sub Private Sub btnLogFolder_Click(sender As Object, e As EventArgs) Handles btnLogFolder.Click @@ -23,8 +25,10 @@ Public Class frmConfigUser Process.Start(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)) End Sub - Private Sub SimpleButton1_Click(sender As Object, e As EventArgs) Handles SimpleButton1.Click - Dim config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.PerUserRoamingAndLocal) - MessageBox.Show(config.FilePath) + Private Sub chkLogErrorsOnly_CheckedChanged(sender As Object, e As EventArgs) Handles chkLogErrorsOnly.CheckedChanged + Dim oLogDebug = Not chkLogErrorsOnly.Checked + My.LogConfig.Debug = oLogDebug + My.Config.LogDebug = oLogDebug + My.ConfigManager.Save() End Sub End Class \ No newline at end of file From a2f4c064921047995bb7ab2e0dc32b27125dfd51 Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Thu, 14 Feb 2019 15:54:02 +0100 Subject: [PATCH 21/23] rename class init to class service --- EDMI_ClientSuite/ClassConstants.vb | 1 + .../{ClassInit.vb => ClassService.vb} | 39 +++++++------------ EDMI_ClientSuite/EDMI_ClientSuite.vbproj | 2 +- EDMI_ClientSuite/frmConfigService.vb | 18 ++++----- EDMI_ClientSuite/frmSplash.vb | 15 +++---- 5 files changed, 30 insertions(+), 45 deletions(-) rename EDMI_ClientSuite/{ClassInit.vb => ClassService.vb} (75%) diff --git a/EDMI_ClientSuite/ClassConstants.vb b/EDMI_ClientSuite/ClassConstants.vb index 1f4d0d34..df542a90 100644 --- a/EDMI_ClientSuite/ClassConstants.vb +++ b/EDMI_ClientSuite/ClassConstants.vb @@ -4,6 +4,7 @@ Public Const SERVICE_MAX_ARRAY_LENGTH = 2147483647 Public Const SERVICE_MAX_STRING_LENGTH = 2147483647 Public Const SERVICE_MAX_CONNECTIONS = 10000 + Public Const SERVICE_OPEN_TIMEOUT = 3 Public Const FOLDER_NAME_LAYOUT = "Layout" End Class diff --git a/EDMI_ClientSuite/ClassInit.vb b/EDMI_ClientSuite/ClassService.vb similarity index 75% rename from EDMI_ClientSuite/ClassInit.vb rename to EDMI_ClientSuite/ClassService.vb index bec7cdc4..a3c002c6 100644 --- a/EDMI_ClientSuite/ClassInit.vb +++ b/EDMI_ClientSuite/ClassService.vb @@ -1,11 +1,11 @@ -Imports DigitalData.Modules.Logging -Imports DigitalData.Modules.Config -Imports System.ServiceModel -Imports EDMI_ClientSuite.NetworkService_DDEDM +Imports System.ServiceModel Imports System.ServiceModel.Channels +Imports DigitalData.Modules.Logging +Imports EDMI_ClientSuite.NetworkService_DDEDM -Public Class ClassInit - Private Const OPEN_TIMEOUT_SECONDS = 3 +Public Class ClassService + Private ReadOnly _LogConfig As LogConfig + Private ReadOnly _Logger As Logger Public Enum ConnectionTestResult Successful @@ -13,23 +13,17 @@ Public Class ClassInit Unknown End Enum - Private ReadOnly _Logger As Logger - - Public Sub New() - _Logger = My.LogConfig.GetLogger() + Public Sub New(LogConfig As LogConfig) + _LogConfig = LogConfig + _Logger = _LogConfig.GetLogger() End Sub - Public Function TestConnectionURLExists() As Boolean - Return My.ConfigManager.Config.ServiceConnection <> String.Empty - 'Return My.Settings.ICMServiceAddress <> String.Empty - End Function - Public Async Function TestConnectionAsync(EndpointURL As String) As Task(Of ConnectionTestResult) Return Await Task.Factory.StartNew(Function() Try Dim oChannelFactory = GetChannelFactory(EndpointURL) Dim oChannel = oChannelFactory.CreateChannel() - oChannel.OperationTimeout = New TimeSpan(0, 0, OPEN_TIMEOUT_SECONDS) + oChannel.OperationTimeout = New TimeSpan(0, 0, ClassConstants.SERVICE_OPEN_TIMEOUT) oChannel.Open() oChannel.Close() @@ -45,24 +39,17 @@ Public Class ClassInit End Function Public Function GetChannelFactory() As IChannelFactory(Of IEDMServiceChannel) - 'Return GetChannelFactory(My.Settings.ICMServiceAddress) - Return GetChannelFactory(My.ConfigManager.Config.ServiceConnection) + Return GetChannelFactory(My.Config.ServiceConnection) End Function Public Function GetChannelFactory(EndpointURL As String) As ChannelFactory(Of IEDMServiceChannel) Dim oBinding = GetBinding() - Dim oEndpoint = GetEndpoint(EndpointURL) + Dim oEndpoint = New EndpointAddress(EndpointURL) Dim oFactory As New ChannelFactory(Of IEDMServiceChannel)(oBinding, oEndpoint) Return oFactory End Function - Private Function GetEndpoint(EndpointURL As String) As EndpointAddress - Dim oEndpoint = New EndpointAddress(EndpointURL) - - Return oEndpoint - End Function - Private Function GetBinding() As NetTcpBinding Dim oBinding As New NetTcpBinding() oBinding.Security.Mode = SecurityMode.Transport @@ -73,7 +60,7 @@ Public Class ClassInit oBinding.MaxConnections = ClassConstants.SERVICE_MAX_CONNECTIONS oBinding.ReaderQuotas.MaxArrayLength = ClassConstants.SERVICE_MAX_ARRAY_LENGTH oBinding.ReaderQuotas.MaxStringContentLength = ClassConstants.SERVICE_MAX_STRING_LENGTH - oBinding.OpenTimeout = New TimeSpan(0, 0, OPEN_TIMEOUT_SECONDS) + oBinding.OpenTimeout = New TimeSpan(0, 0, ClassConstants.SERVICE_OPEN_TIMEOUT) Return oBinding End Function diff --git a/EDMI_ClientSuite/EDMI_ClientSuite.vbproj b/EDMI_ClientSuite/EDMI_ClientSuite.vbproj index 342ea652..8f5b80da 100644 --- a/EDMI_ClientSuite/EDMI_ClientSuite.vbproj +++ b/EDMI_ClientSuite/EDMI_ClientSuite.vbproj @@ -117,8 +117,8 @@ - + True diff --git a/EDMI_ClientSuite/frmConfigService.vb b/EDMI_ClientSuite/frmConfigService.vb index 9e9ef5a2..d0a60491 100644 --- a/EDMI_ClientSuite/frmConfigService.vb +++ b/EDMI_ClientSuite/frmConfigService.vb @@ -1,10 +1,8 @@ -Imports EDMI_ClientSuite.ClassInit - -Public Class frmConfigService - Private _Init As ClassInit +Public Class frmConfigService + Private _Service As ClassService Private Sub frmServiceConfig_Load(sender As Object, e As EventArgs) Handles Me.Load - _Init = New ClassInit() + _Service = New ClassService(My.LogConfig) If My.ConfigManager.Config.ServiceConnection <> String.Empty Then txtIPAddress.Text = My.ConfigManager.Config.ServiceIP @@ -18,22 +16,20 @@ Public Class frmConfigService Dim oIPAddress = txtIPAddress.Text Dim oPort = txtPort.Text Dim oEndpointURL = $"net.tcp://{oIPAddress}:{oPort}/DigitalData/Services/Main" - Dim oResult As ConnectionTestResult + Dim oResult As ClassService.ConnectionTestResult My.Config.ServiceIP = oIPAddress My.Config.ServicePort = Integer.Parse(oPort) lblStatus.Text = "Verbindung wird hergestellt..." - oResult = Await _Init.TestConnectionAsync(My.ConfigManager.Config.ServiceConnection) + oResult = Await _Service.TestConnectionAsync(My.ConfigManager.Config.ServiceConnection) - If oResult = ConnectionTestResult.Successful Then - ' Save Endpoint URL + If oResult = ClassService.ConnectionTestResult.Successful Then My.ConfigManager.Save() - 'My.Settings.ICMServiceAddress = oEndpointURL lblStatus.Text = "Verbindung hergestellt." Else Select Case oResult - Case ConnectionTestResult.NotFound + Case ClassService.ConnectionTestResult.NotFound lblStatus.Text = "Dienst konnte nicht gefunden werden. Bitte überprüfen sie Addresse und Port." Case Else lblStatus.Text = "Unbekannter Fehler." diff --git a/EDMI_ClientSuite/frmSplash.vb b/EDMI_ClientSuite/frmSplash.vb index baeee23b..4a4a0e5b 100644 --- a/EDMI_ClientSuite/frmSplash.vb +++ b/EDMI_ClientSuite/frmSplash.vb @@ -25,14 +25,17 @@ Public NotInheritable Class frmSplash BringToFront() - Dim oInit As New ClassInit() - Dim oConnectionURLExists = oInit.TestConnectionURLExists() + Dim oService As New ClassService(My.LogConfig) + Dim oConnectionURLExists As Boolean = My.Config.ServiceConnection <> String.Empty + + 'Dim oInit As New ClassInit() + 'Dim oConnectionURLExists = oInit.TestConnectionURLExists() If Not oConnectionURLExists Then Dim oResult = frmConfigService.ShowDialog() If oResult = DialogResult.Cancel Then - MsgBox("Es wurde keine Dienst Verbindungsurl hinterlegt. Die Anwendung wird beendet.") + MsgBox("Es wurde keine Dienst-Verbindungsurl hinterlegt. Die Anwendung wird beendet.") Application.Exit() Else StartWorker() @@ -57,17 +60,15 @@ Public NotInheritable Class frmSplash End Sub Private Sub bw_DoWork(sender As Object, e As System.ComponentModel.DoWorkEventArgs) - Dim oInit As New ClassInit() + Dim oService As New ClassService(My.LogConfig) - '------------------ _Worker.ReportProgress(SetProgress(1), "Connecting to service..") Dim oChannelFactory As ChannelFactory(Of IEDMServiceChannel) Dim oChannel As IEDMServiceChannel Dim oConnectionSuccessful = False - - oChannelFactory = oInit.GetChannelFactory() + oChannelFactory = oService.GetChannelFactory() oChannel = oChannelFactory.CreateChannel() Thread.Sleep(SLEEP_TIME) From bc7605bdcfd1c7daeed080dbc77ea736053818e5 Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Mon, 18 Feb 2019 11:14:02 +0100 Subject: [PATCH 22/23] rename project to ClientSuite, add application timer --- Config/ConfigManager.vb | 13 +- DDMonorepo.sln | 2 +- EDMI_ClientSuite/App.config | 26 +- EDMI_ClientSuite/ApplicationEvents.vb | 4 +- EDMI_ClientSuite/ClassService.vb | 2 +- EDMI_ClientSuite/ClassTimer.vb | 37 ++ ..._ClientSuite.vbproj => ClientSuite.vbproj} | 68 +- .../DigitalData.Modules.Filesystem.xsd | 13 - .../DigitalData.Services.EDMService.wsdl | 104 ---- .../DigitalData.Services.EDMService.xsd | 129 ---- .../DigitalData.Services.EDMService1.xsd | 48 -- ...rkService_DDEDM.ContainerResult.datasource | 10 - ...orkService_DDEDM.NonQueryResult.datasource | 10 - ...tworkService_DDEDM.ScalarResult.datasource | 10 - ...etworkService_DDEDM.TableResult.datasource | 10 - .../NetworkService_DDEDM/Reference.svcmap | 37 -- .../NetworkService_DDEDM/Reference.vb | 588 ------------------ .../NetworkService_DDEDM/System.Data.xsd | 17 - .../configuration.svcinfo | 10 - .../configuration91.svcinfo | 210 ------- .../NetworkService_DDEDM/service.wsdl | 135 ---- .../NetworkService_DDEDM/service.xsd | 42 -- .../EntityDesigner/ClassControlBuilder.vb | 2 +- .../BaseClasses/ClassBaseProperties.vb | 4 +- .../BaseClasses/ClassInputProperties.vb | 2 +- .../BaseClasses/ClassMultiInputProperties.vb | 9 +- .../Controls/ClassLabelProperties.vb | 2 +- .../Controls/ClassTextboxProperties.vb | 2 +- .../frmEntityDesigner.Designer.vb | 2 +- .../EntityDesigner/frmEntityDesigner.vb | 4 +- .../My Project/Application.Designer.vb | 2 +- .../My Project/Resources.Designer.vb | 2 +- .../My Project/Settings.Designer.vb | 4 +- EDMI_ClientSuite/MyApplication.vb | 5 +- EDMI_ClientSuite/State/ServiceState.vb | 9 + .../Strings/ControlProperties.Designer.vb | 2 +- EDMI_ClientSuite/frmMain.Designer.vb | 2 +- EDMI_ClientSuite/frmMain.vb | 15 +- EDMI_ClientSuite/frmSplash.designer.vb | 2 +- EDMI_ClientSuite/frmSplash.vb | 3 +- 40 files changed, 120 insertions(+), 1478 deletions(-) create mode 100644 EDMI_ClientSuite/ClassTimer.vb rename EDMI_ClientSuite/{EDMI_ClientSuite.vbproj => ClientSuite.vbproj} (86%) delete mode 100644 EDMI_ClientSuite/Connected Services/NetworkService_DDEDM/DigitalData.Modules.Filesystem.xsd delete mode 100644 EDMI_ClientSuite/Connected Services/NetworkService_DDEDM/DigitalData.Services.EDMService.wsdl delete mode 100644 EDMI_ClientSuite/Connected Services/NetworkService_DDEDM/DigitalData.Services.EDMService.xsd delete mode 100644 EDMI_ClientSuite/Connected Services/NetworkService_DDEDM/DigitalData.Services.EDMService1.xsd delete mode 100644 EDMI_ClientSuite/Connected Services/NetworkService_DDEDM/EDMI_ClientSuite.NetworkService_DDEDM.ContainerResult.datasource delete mode 100644 EDMI_ClientSuite/Connected Services/NetworkService_DDEDM/EDMI_ClientSuite.NetworkService_DDEDM.NonQueryResult.datasource delete mode 100644 EDMI_ClientSuite/Connected Services/NetworkService_DDEDM/EDMI_ClientSuite.NetworkService_DDEDM.ScalarResult.datasource delete mode 100644 EDMI_ClientSuite/Connected Services/NetworkService_DDEDM/EDMI_ClientSuite.NetworkService_DDEDM.TableResult.datasource delete mode 100644 EDMI_ClientSuite/Connected Services/NetworkService_DDEDM/Reference.svcmap delete mode 100644 EDMI_ClientSuite/Connected Services/NetworkService_DDEDM/Reference.vb delete mode 100644 EDMI_ClientSuite/Connected Services/NetworkService_DDEDM/System.Data.xsd delete mode 100644 EDMI_ClientSuite/Connected Services/NetworkService_DDEDM/configuration.svcinfo delete mode 100644 EDMI_ClientSuite/Connected Services/NetworkService_DDEDM/configuration91.svcinfo delete mode 100644 EDMI_ClientSuite/Connected Services/NetworkService_DDEDM/service.wsdl delete mode 100644 EDMI_ClientSuite/Connected Services/NetworkService_DDEDM/service.xsd create mode 100644 EDMI_ClientSuite/State/ServiceState.vb diff --git a/Config/ConfigManager.vb b/Config/ConfigManager.vb index a1b894fb..e32f5059 100644 --- a/Config/ConfigManager.vb +++ b/Config/ConfigManager.vb @@ -2,6 +2,7 @@ Imports System.Xml.Serialization Imports DigitalData.Modules.Logging Imports DigitalData.Modules.Filesystem +Imports System.Xml Public Class ConfigManager(Of T) Private Const USER_CONFIG_NAME As String = "UserConfig.xml" @@ -14,11 +15,15 @@ Public Class ConfigManager(Of T) Private ReadOnly _ComputerPath As String Private _CurrentDataPath As String - Private ReadOnly _Schema As T + ''' + ''' The blueprint class from which the default config is created + ''' + Private ReadOnly _Blueprint As T Private ReadOnly _Serializer As XmlSerializer Public ReadOnly Property Config As T + ''' ''' Creates a new instance of the ConfigManager ''' @@ -42,8 +47,8 @@ Public Class ConfigManager(Of T) _UserPath = Path.Combine(UserConfigPath, USER_CONFIG_NAME) _ComputerPath = Path.Combine(ComputerConfigPath, COMPUTER_CONFIG_NAME) - _Schema = Activator.CreateInstance(Of T) - _Serializer = New XmlSerializer(_Schema.GetType) + _Blueprint = Activator.CreateInstance(Of T) + _Serializer = New XmlSerializer(_Blueprint.GetType) If Not Directory.Exists(UserConfigPath) Then Throw New DirectoryNotFoundException($"Path {UserConfigPath} does not exist!") @@ -91,7 +96,7 @@ Public Class ConfigManager(Of T) Else _Logger.Debug("Creating default config in UserPath: {0}", _UserPath) _CurrentDataPath = _UserPath - oConfig = Activator.CreateInstance(_Schema.GetType) + oConfig = Activator.CreateInstance(_Blueprint.GetType) WriteToFile(_Config, _UserPath) End If diff --git a/DDMonorepo.sln b/DDMonorepo.sln index 31b83654..5de0393a 100644 --- a/DDMonorepo.sln +++ b/DDMonorepo.sln @@ -57,7 +57,7 @@ Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "DD_CommunicationService", " EndProject Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "GUI_EDMI", "GUI_EDMI\GUI_EDMI.vbproj", "{88EDAD5B-1B98-43E4-B068-1251E7AF01A0}" EndProject -Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "EDMI_ClientSuite", "EDMI_ClientSuite\EDMI_ClientSuite.vbproj", "{406C95F4-9FEA-45B6-8385-1768CDBBF1A7}" +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "ClientSuite", "EDMI_ClientSuite\ClientSuite.vbproj", "{406C95F4-9FEA-45B6-8385-1768CDBBF1A7}" EndProject Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "DDEDMService", "SERVICES\DDEDM_NetworkService\DDEDMService.vbproj", "{A8C3F298-76AB-4359-AB3C-986E313B4336}" EndProject diff --git a/EDMI_ClientSuite/App.config b/EDMI_ClientSuite/App.config index 28991ba1..c6126768 100644 --- a/EDMI_ClientSuite/App.config +++ b/EDMI_ClientSuite/App.config @@ -2,11 +2,13 @@ -
+
+
-
+
+
@@ -19,7 +21,7 @@ - + @@ -27,11 +29,16 @@ - + net.tcp://172.24.12.67:9000/DigitalData/Services/Main - + + + + net.tcp://172.24.12.67:9000/DigitalData/Services/Main + + Skin/Office 2016 Colorful @@ -78,10 +85,15 @@ - + + + + + + - + \ No newline at end of file diff --git a/EDMI_ClientSuite/ApplicationEvents.vb b/EDMI_ClientSuite/ApplicationEvents.vb index 6e4808af..505e4b67 100644 --- a/EDMI_ClientSuite/ApplicationEvents.vb +++ b/EDMI_ClientSuite/ApplicationEvents.vb @@ -20,11 +20,11 @@ Namespace My ConfigManager = oConfigManager _Logger = LogConfig.GetLogger() - _Logger.Info("Starting Client Suite..") + _Logger.Debug("Starting Client Suite..") End Sub Public Sub App_Shutdown(sender As Object, e As EventArgs) Handles Me.Shutdown - _Logger.Info("Shutting down Client Suite..") + _Logger.Debug("Shutting down Client Suite..") End Sub End Class End Namespace diff --git a/EDMI_ClientSuite/ClassService.vb b/EDMI_ClientSuite/ClassService.vb index a3c002c6..479ac410 100644 --- a/EDMI_ClientSuite/ClassService.vb +++ b/EDMI_ClientSuite/ClassService.vb @@ -1,7 +1,7 @@ Imports System.ServiceModel Imports System.ServiceModel.Channels Imports DigitalData.Modules.Logging -Imports EDMI_ClientSuite.NetworkService_DDEDM +Imports DigitalData.Modules.EDMIFileOps.EDMIServiceReference Public Class ClassService Private ReadOnly _LogConfig As LogConfig diff --git a/EDMI_ClientSuite/ClassTimer.vb b/EDMI_ClientSuite/ClassTimer.vb new file mode 100644 index 00000000..ec024c02 --- /dev/null +++ b/EDMI_ClientSuite/ClassTimer.vb @@ -0,0 +1,37 @@ +Imports System.Threading +Imports System.Timers +Imports DigitalData.Modules.EDMIFileOps.EDMIServiceReference +Imports DigitalData.Modules.Logging + +Public Class ClassTimer + Private _Callback As TimerCallback + Private _LogConfig As LogConfig + Private _Logger As Logger + Private _Timer As Timers.Timer + Private _Channel As IEDMServiceChannel + + Private Const TIMER_START_TIME = 1000 + Private Const TIMER_INTERVAL = 5000 + + Public Sub Callback(sender As Object, e As ElapsedEventArgs) + _Logger.Info("Checking if Service is up...") + + ' Connect to service and send hearbeat request + + My.Application.Service.Online = True + My.Application.Service.LastChecked = DateTime.Now + End Sub + + Public Sub New(LogConfig As LogConfig) + _LogConfig = LogConfig + _Logger = LogConfig.GetLogger() + + _Channel = My.ChannelFactory.CreateChannel() + _Channel.Open() + + _Timer = New Timers.Timer(TIMER_INTERVAL) + _Timer.SynchronizingObject = My.MainForm + AddHandler _Timer.Elapsed, AddressOf Callback + _Timer.Enabled = True + End Sub +End Class diff --git a/EDMI_ClientSuite/EDMI_ClientSuite.vbproj b/EDMI_ClientSuite/ClientSuite.vbproj similarity index 86% rename from EDMI_ClientSuite/EDMI_ClientSuite.vbproj rename to EDMI_ClientSuite/ClientSuite.vbproj index 8f5b80da..04da0669 100644 --- a/EDMI_ClientSuite/EDMI_ClientSuite.vbproj +++ b/EDMI_ClientSuite/ClientSuite.vbproj @@ -6,9 +6,9 @@ AnyCPU {406C95F4-9FEA-45B6-8385-1768CDBBF1A7} WinExe - EDMI_ClientSuite.My.MyApplication - EDMI_ClientSuite - EDMI_ClientSuite + DigitalData.GUIs.ClientSuite.My.MyApplication + DigitalData.GUIs.ClientSuite + ClientSuite 512 WindowsForms v4.6.1 @@ -36,7 +36,7 @@ true true bin\Debug\ - EDMI_ClientSuite.xml + ClientSuite.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 @@ -46,7 +46,7 @@ true true bin\Release\ - EDMI_ClientSuite.xml + ClientSuite.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 @@ -119,12 +119,8 @@ + - - True - True - Reference.svcmap - DockManagerTest.vb @@ -211,6 +207,7 @@ True + True @@ -282,35 +279,6 @@ - - Designer - - - - Designer - - - Designer - - - Reference.svcmap - - - Reference.svcmap - - - Reference.svcmap - - - Reference.svcmap - - - - Designer - - - Designer - MyApplicationCodeGenerator @@ -321,7 +289,9 @@ My Settings.Designer.vb - + + Designer + @@ -335,21 +305,6 @@ - - - - - - - - - - - - WCF Proxy Generator - Reference.vb - - False @@ -394,5 +349,8 @@ Logging + + + \ No newline at end of file diff --git a/EDMI_ClientSuite/Connected Services/NetworkService_DDEDM/DigitalData.Modules.Filesystem.xsd b/EDMI_ClientSuite/Connected Services/NetworkService_DDEDM/DigitalData.Modules.Filesystem.xsd deleted file mode 100644 index 46469df3..00000000 --- a/EDMI_ClientSuite/Connected Services/NetworkService_DDEDM/DigitalData.Modules.Filesystem.xsd +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/EDMI_ClientSuite/Connected Services/NetworkService_DDEDM/DigitalData.Services.EDMService.wsdl b/EDMI_ClientSuite/Connected Services/NetworkService_DDEDM/DigitalData.Services.EDMService.wsdl deleted file mode 100644 index 2fd4ed52..00000000 --- a/EDMI_ClientSuite/Connected Services/NetworkService_DDEDM/DigitalData.Services.EDMService.wsdl +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/EDMI_ClientSuite/Connected Services/NetworkService_DDEDM/DigitalData.Services.EDMService.xsd b/EDMI_ClientSuite/Connected Services/NetworkService_DDEDM/DigitalData.Services.EDMService.xsd deleted file mode 100644 index dcec368e..00000000 --- a/EDMI_ClientSuite/Connected Services/NetworkService_DDEDM/DigitalData.Services.EDMService.xsd +++ /dev/null @@ -1,129 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/EDMI_ClientSuite/Connected Services/NetworkService_DDEDM/DigitalData.Services.EDMService1.xsd b/EDMI_ClientSuite/Connected Services/NetworkService_DDEDM/DigitalData.Services.EDMService1.xsd deleted file mode 100644 index 4fce5c2f..00000000 --- a/EDMI_ClientSuite/Connected Services/NetworkService_DDEDM/DigitalData.Services.EDMService1.xsd +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/EDMI_ClientSuite/Connected Services/NetworkService_DDEDM/EDMI_ClientSuite.NetworkService_DDEDM.ContainerResult.datasource b/EDMI_ClientSuite/Connected Services/NetworkService_DDEDM/EDMI_ClientSuite.NetworkService_DDEDM.ContainerResult.datasource deleted file mode 100644 index e187b1c4..00000000 --- a/EDMI_ClientSuite/Connected Services/NetworkService_DDEDM/EDMI_ClientSuite.NetworkService_DDEDM.ContainerResult.datasource +++ /dev/null @@ -1,10 +0,0 @@ - - - - EDMI_ClientSuite.NetworkService_DDEDM.ContainerResult, Connected Services.NetworkService_DDEDM.Reference.vb.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - \ No newline at end of file diff --git a/EDMI_ClientSuite/Connected Services/NetworkService_DDEDM/EDMI_ClientSuite.NetworkService_DDEDM.NonQueryResult.datasource b/EDMI_ClientSuite/Connected Services/NetworkService_DDEDM/EDMI_ClientSuite.NetworkService_DDEDM.NonQueryResult.datasource deleted file mode 100644 index dda8c325..00000000 --- a/EDMI_ClientSuite/Connected Services/NetworkService_DDEDM/EDMI_ClientSuite.NetworkService_DDEDM.NonQueryResult.datasource +++ /dev/null @@ -1,10 +0,0 @@ - - - - EDMI_ClientSuite.NetworkService_DDEDM.NonQueryResult, Connected Services.NetworkService_DDEDM.Reference.vb.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - \ No newline at end of file diff --git a/EDMI_ClientSuite/Connected Services/NetworkService_DDEDM/EDMI_ClientSuite.NetworkService_DDEDM.ScalarResult.datasource b/EDMI_ClientSuite/Connected Services/NetworkService_DDEDM/EDMI_ClientSuite.NetworkService_DDEDM.ScalarResult.datasource deleted file mode 100644 index dd44709e..00000000 --- a/EDMI_ClientSuite/Connected Services/NetworkService_DDEDM/EDMI_ClientSuite.NetworkService_DDEDM.ScalarResult.datasource +++ /dev/null @@ -1,10 +0,0 @@ - - - - EDMI_ClientSuite.NetworkService_DDEDM.ScalarResult, Connected Services.NetworkService_DDEDM.Reference.vb.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - \ No newline at end of file diff --git a/EDMI_ClientSuite/Connected Services/NetworkService_DDEDM/EDMI_ClientSuite.NetworkService_DDEDM.TableResult.datasource b/EDMI_ClientSuite/Connected Services/NetworkService_DDEDM/EDMI_ClientSuite.NetworkService_DDEDM.TableResult.datasource deleted file mode 100644 index f645aaa5..00000000 --- a/EDMI_ClientSuite/Connected Services/NetworkService_DDEDM/EDMI_ClientSuite.NetworkService_DDEDM.TableResult.datasource +++ /dev/null @@ -1,10 +0,0 @@ - - - - EDMI_ClientSuite.NetworkService_DDEDM.TableResult, Connected Services.NetworkService_DDEDM.Reference.vb.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - \ No newline at end of file diff --git a/EDMI_ClientSuite/Connected Services/NetworkService_DDEDM/Reference.svcmap b/EDMI_ClientSuite/Connected Services/NetworkService_DDEDM/Reference.svcmap deleted file mode 100644 index 46ef9665..00000000 --- a/EDMI_ClientSuite/Connected Services/NetworkService_DDEDM/Reference.svcmap +++ /dev/null @@ -1,37 +0,0 @@ - - - - false - true - true - - false - false - false - - - true - Auto - true - true - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/EDMI_ClientSuite/Connected Services/NetworkService_DDEDM/Reference.vb b/EDMI_ClientSuite/Connected Services/NetworkService_DDEDM/Reference.vb deleted file mode 100644 index 2354b9f6..00000000 --- a/EDMI_ClientSuite/Connected Services/NetworkService_DDEDM/Reference.vb +++ /dev/null @@ -1,588 +0,0 @@ -'------------------------------------------------------------------------------ -' -' Dieser Code wurde von einem Tool generiert. -' Laufzeitversion:4.0.30319.42000 -' -' Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn -' der Code erneut generiert wird. -' -'------------------------------------------------------------------------------ - -Option Strict On -Option Explicit On - -Imports System -Imports System.Runtime.Serialization - -Namespace NetworkService_DDEDM - - _ - Partial Public Class TableResult - Inherits Object - Implements System.Runtime.Serialization.IExtensibleDataObject, System.ComponentModel.INotifyPropertyChanged - - _ - Private extensionDataField As System.Runtime.Serialization.ExtensionDataObject - - _ - Private ErrorMessageField As String - - _ - Private OKField As Boolean - - _ - Private TableField As System.Data.DataTable - - _ - Public Property ExtensionData() As System.Runtime.Serialization.ExtensionDataObject Implements System.Runtime.Serialization.IExtensibleDataObject.ExtensionData - Get - Return Me.extensionDataField - End Get - Set - Me.extensionDataField = value - End Set - End Property - - _ - Public Property ErrorMessage() As String - Get - Return Me.ErrorMessageField - End Get - Set - If (Object.ReferenceEquals(Me.ErrorMessageField, value) <> true) Then - Me.ErrorMessageField = value - Me.RaisePropertyChanged("ErrorMessage") - End If - End Set - End Property - - _ - Public Property OK() As Boolean - Get - Return Me.OKField - End Get - Set - If (Me.OKField.Equals(value) <> true) Then - Me.OKField = value - Me.RaisePropertyChanged("OK") - End If - End Set - End Property - - _ - Public Property Table() As System.Data.DataTable - Get - Return Me.TableField - End Get - Set - If (Object.ReferenceEquals(Me.TableField, value) <> true) Then - Me.TableField = value - Me.RaisePropertyChanged("Table") - End If - End Set - End Property - - Public Event PropertyChanged As System.ComponentModel.PropertyChangedEventHandler Implements System.ComponentModel.INotifyPropertyChanged.PropertyChanged - - Protected Sub RaisePropertyChanged(ByVal propertyName As String) - Dim propertyChanged As System.ComponentModel.PropertyChangedEventHandler = Me.PropertyChangedEvent - If (Not (propertyChanged) Is Nothing) Then - propertyChanged(Me, New System.ComponentModel.PropertyChangedEventArgs(propertyName)) - End If - End Sub - End Class - - _ - Partial Public Class ScalarResult - Inherits Object - Implements System.Runtime.Serialization.IExtensibleDataObject, System.ComponentModel.INotifyPropertyChanged - - _ - Private extensionDataField As System.Runtime.Serialization.ExtensionDataObject - - _ - Private ErrorMessageField As String - - _ - Private OKField As Boolean - - _ - Private ScalarField As Object - - _ - Public Property ExtensionData() As System.Runtime.Serialization.ExtensionDataObject Implements System.Runtime.Serialization.IExtensibleDataObject.ExtensionData - Get - Return Me.extensionDataField - End Get - Set - Me.extensionDataField = value - End Set - End Property - - _ - Public Property ErrorMessage() As String - Get - Return Me.ErrorMessageField - End Get - Set - If (Object.ReferenceEquals(Me.ErrorMessageField, value) <> true) Then - Me.ErrorMessageField = value - Me.RaisePropertyChanged("ErrorMessage") - End If - End Set - End Property - - _ - Public Property OK() As Boolean - Get - Return Me.OKField - End Get - Set - If (Me.OKField.Equals(value) <> true) Then - Me.OKField = value - Me.RaisePropertyChanged("OK") - End If - End Set - End Property - - _ - Public Property Scalar() As Object - Get - Return Me.ScalarField - End Get - Set - If (Object.ReferenceEquals(Me.ScalarField, value) <> true) Then - Me.ScalarField = value - Me.RaisePropertyChanged("Scalar") - End If - End Set - End Property - - Public Event PropertyChanged As System.ComponentModel.PropertyChangedEventHandler Implements System.ComponentModel.INotifyPropertyChanged.PropertyChanged - - Protected Sub RaisePropertyChanged(ByVal propertyName As String) - Dim propertyChanged As System.ComponentModel.PropertyChangedEventHandler = Me.PropertyChangedEvent - If (Not (propertyChanged) Is Nothing) Then - propertyChanged(Me, New System.ComponentModel.PropertyChangedEventArgs(propertyName)) - End If - End Sub - End Class - - _ - Partial Public Class NonQueryResult - Inherits Object - Implements System.Runtime.Serialization.IExtensibleDataObject, System.ComponentModel.INotifyPropertyChanged - - _ - Private extensionDataField As System.Runtime.Serialization.ExtensionDataObject - - _ - Private ErrorMessageField As String - - _ - Private OKField As Boolean - - _ - Public Property ExtensionData() As System.Runtime.Serialization.ExtensionDataObject Implements System.Runtime.Serialization.IExtensibleDataObject.ExtensionData - Get - Return Me.extensionDataField - End Get - Set - Me.extensionDataField = value - End Set - End Property - - _ - Public Property ErrorMessage() As String - Get - Return Me.ErrorMessageField - End Get - Set - If (Object.ReferenceEquals(Me.ErrorMessageField, value) <> true) Then - Me.ErrorMessageField = value - Me.RaisePropertyChanged("ErrorMessage") - End If - End Set - End Property - - _ - Public Property OK() As Boolean - Get - Return Me.OKField - End Get - Set - If (Me.OKField.Equals(value) <> true) Then - Me.OKField = value - Me.RaisePropertyChanged("OK") - End If - End Set - End Property - - Public Event PropertyChanged As System.ComponentModel.PropertyChangedEventHandler Implements System.ComponentModel.INotifyPropertyChanged.PropertyChanged - - Protected Sub RaisePropertyChanged(ByVal propertyName As String) - Dim propertyChanged As System.ComponentModel.PropertyChangedEventHandler = Me.PropertyChangedEvent - If (Not (propertyChanged) Is Nothing) Then - propertyChanged(Me, New System.ComponentModel.PropertyChangedEventArgs(propertyName)) - End If - End Sub - End Class - - _ - Partial Public Class ContainerResult - Inherits Object - Implements System.Runtime.Serialization.IExtensibleDataObject, System.ComponentModel.INotifyPropertyChanged - - _ - Private extensionDataField As System.Runtime.Serialization.ExtensionDataObject - - Private ContainerField As NetworkService_DDEDM.FileContainerInner - - Private ErrorMessageField As String - - Private OKField As Boolean - - _ - Public Property ExtensionData() As System.Runtime.Serialization.ExtensionDataObject Implements System.Runtime.Serialization.IExtensibleDataObject.ExtensionData - Get - Return Me.extensionDataField - End Get - Set - Me.extensionDataField = value - End Set - End Property - - _ - Public Property Container() As NetworkService_DDEDM.FileContainerInner - Get - Return Me.ContainerField - End Get - Set - If (Object.ReferenceEquals(Me.ContainerField, value) <> true) Then - Me.ContainerField = value - Me.RaisePropertyChanged("Container") - End If - End Set - End Property - - _ - Public Property ErrorMessage() As String - Get - Return Me.ErrorMessageField - End Get - Set - If (Object.ReferenceEquals(Me.ErrorMessageField, value) <> true) Then - Me.ErrorMessageField = value - Me.RaisePropertyChanged("ErrorMessage") - End If - End Set - End Property - - _ - Public Property OK() As Boolean - Get - Return Me.OKField - End Get - Set - If (Me.OKField.Equals(value) <> true) Then - Me.OKField = value - Me.RaisePropertyChanged("OK") - End If - End Set - End Property - - Public Event PropertyChanged As System.ComponentModel.PropertyChangedEventHandler Implements System.ComponentModel.INotifyPropertyChanged.PropertyChanged - - Protected Sub RaisePropertyChanged(ByVal propertyName As String) - Dim propertyChanged As System.ComponentModel.PropertyChangedEventHandler = Me.PropertyChangedEvent - If (Not (propertyChanged) Is Nothing) Then - propertyChanged(Me, New System.ComponentModel.PropertyChangedEventArgs(propertyName)) - End If - End Sub - End Class - - _ - Partial Public Class FileContainerInner - Inherits Object - Implements System.Runtime.Serialization.IExtensibleDataObject, System.ComponentModel.INotifyPropertyChanged - - _ - Private extensionDataField As System.Runtime.Serialization.ExtensionDataObject - - Private ContentsField() As Byte - - Private CreatedAtField As Date - - Private ExtensionField As String - - Private FileIdField As String - - Private UpdatedAtField As Date - - _ - Public Property ExtensionData() As System.Runtime.Serialization.ExtensionDataObject Implements System.Runtime.Serialization.IExtensibleDataObject.ExtensionData - Get - Return Me.extensionDataField - End Get - Set - Me.extensionDataField = value - End Set - End Property - - _ - Public Property Contents() As Byte() - Get - Return Me.ContentsField - End Get - Set - If (Object.ReferenceEquals(Me.ContentsField, value) <> true) Then - Me.ContentsField = value - Me.RaisePropertyChanged("Contents") - End If - End Set - End Property - - _ - Public Property CreatedAt() As Date - Get - Return Me.CreatedAtField - End Get - Set - If (Me.CreatedAtField.Equals(value) <> true) Then - Me.CreatedAtField = value - Me.RaisePropertyChanged("CreatedAt") - End If - End Set - End Property - - _ - Public Property Extension() As String - Get - Return Me.ExtensionField - End Get - Set - If (Object.ReferenceEquals(Me.ExtensionField, value) <> true) Then - Me.ExtensionField = value - Me.RaisePropertyChanged("Extension") - End If - End Set - End Property - - _ - Public Property FileId() As String - Get - Return Me.FileIdField - End Get - Set - If (Object.ReferenceEquals(Me.FileIdField, value) <> true) Then - Me.FileIdField = value - Me.RaisePropertyChanged("FileId") - End If - End Set - End Property - - _ - Public Property UpdatedAt() As Date - Get - Return Me.UpdatedAtField - End Get - Set - If (Me.UpdatedAtField.Equals(value) <> true) Then - Me.UpdatedAtField = value - Me.RaisePropertyChanged("UpdatedAt") - End If - End Set - End Property - - Public Event PropertyChanged As System.ComponentModel.PropertyChangedEventHandler Implements System.ComponentModel.INotifyPropertyChanged.PropertyChanged - - Protected Sub RaisePropertyChanged(ByVal propertyName As String) - Dim propertyChanged As System.ComponentModel.PropertyChangedEventHandler = Me.PropertyChangedEvent - If (Not (propertyChanged) Is Nothing) Then - propertyChanged(Me, New System.ComponentModel.PropertyChangedEventArgs(propertyName)) - End If - End Sub - End Class - - _ - Public Interface IEDMService - - _ - Function CreateDatabaseRequest(ByVal Name As String, ByVal Debug As Boolean) As String - - _ - Function CreateDatabaseRequestAsync(ByVal Name As String, ByVal Debug As Boolean) As System.Threading.Tasks.Task(Of String) - - _ - Sub CloseDatabaseRequest() - - _ - Function CloseDatabaseRequestAsync() As System.Threading.Tasks.Task - - _ - Function ReturnDatatable(ByVal SQL As String) As NetworkService_DDEDM.TableResult - - _ - Function ReturnDatatableAsync(ByVal SQL As String) As System.Threading.Tasks.Task(Of NetworkService_DDEDM.TableResult) - - _ - Function ReturnScalar(ByVal SQL As String) As NetworkService_DDEDM.ScalarResult - - _ - Function ReturnScalarAsync(ByVal SQL As String) As System.Threading.Tasks.Task(Of NetworkService_DDEDM.ScalarResult) - - _ - Function ExecuteNonQuery(ByVal SQL As String) As NetworkService_DDEDM.NonQueryResult - - _ - Function ExecuteNonQueryAsync(ByVal SQL As String) As System.Threading.Tasks.Task(Of NetworkService_DDEDM.NonQueryResult) - - _ - Function CreateFile(ByVal Contents() As Byte, ByVal Extension As String) As String - - _ - Function CreateFileAsync(ByVal Contents() As Byte, ByVal Extension As String) As System.Threading.Tasks.Task(Of String) - - _ - Function UpdateFile(ByVal ContainerId As String, ByVal Contents() As Byte) As String - - _ - Function UpdateFileAsync(ByVal ContainerId As String, ByVal Contents() As Byte) As System.Threading.Tasks.Task(Of String) - - _ - Function GetFile(ByVal ContainerId As String) As NetworkService_DDEDM.ContainerResult - - _ - Function GetFileAsync(ByVal ContainerId As String) As System.Threading.Tasks.Task(Of NetworkService_DDEDM.ContainerResult) - - _ - Function DeleteFile(ByVal ContainerId As String) As Boolean - - _ - Function DeleteFileAsync(ByVal ContainerId As String) As System.Threading.Tasks.Task(Of Boolean) - End Interface - - _ - Public Interface IEDMServiceChannel - Inherits NetworkService_DDEDM.IEDMService, System.ServiceModel.IClientChannel - End Interface - - _ - Partial Public Class EDMServiceClient - Inherits System.ServiceModel.ClientBase(Of NetworkService_DDEDM.IEDMService) - Implements NetworkService_DDEDM.IEDMService - - Public Sub New() - MyBase.New - End Sub - - Public Sub New(ByVal endpointConfigurationName As String) - MyBase.New(endpointConfigurationName) - End Sub - - Public Sub New(ByVal endpointConfigurationName As String, ByVal remoteAddress As String) - MyBase.New(endpointConfigurationName, remoteAddress) - End Sub - - Public Sub New(ByVal endpointConfigurationName As String, ByVal remoteAddress As System.ServiceModel.EndpointAddress) - MyBase.New(endpointConfigurationName, remoteAddress) - End Sub - - Public Sub New(ByVal binding As System.ServiceModel.Channels.Binding, ByVal remoteAddress As System.ServiceModel.EndpointAddress) - MyBase.New(binding, remoteAddress) - End Sub - - Public Function CreateDatabaseRequest(ByVal Name As String, ByVal Debug As Boolean) As String Implements NetworkService_DDEDM.IEDMService.CreateDatabaseRequest - Return MyBase.Channel.CreateDatabaseRequest(Name, Debug) - End Function - - Public Function CreateDatabaseRequestAsync(ByVal Name As String, ByVal Debug As Boolean) As System.Threading.Tasks.Task(Of String) Implements NetworkService_DDEDM.IEDMService.CreateDatabaseRequestAsync - Return MyBase.Channel.CreateDatabaseRequestAsync(Name, Debug) - End Function - - Public Sub CloseDatabaseRequest() Implements NetworkService_DDEDM.IEDMService.CloseDatabaseRequest - MyBase.Channel.CloseDatabaseRequest - End Sub - - Public Function CloseDatabaseRequestAsync() As System.Threading.Tasks.Task Implements NetworkService_DDEDM.IEDMService.CloseDatabaseRequestAsync - Return MyBase.Channel.CloseDatabaseRequestAsync - End Function - - Public Function ReturnDatatable(ByVal SQL As String) As NetworkService_DDEDM.TableResult Implements NetworkService_DDEDM.IEDMService.ReturnDatatable - Return MyBase.Channel.ReturnDatatable(SQL) - End Function - - Public Function ReturnDatatableAsync(ByVal SQL As String) As System.Threading.Tasks.Task(Of NetworkService_DDEDM.TableResult) Implements NetworkService_DDEDM.IEDMService.ReturnDatatableAsync - Return MyBase.Channel.ReturnDatatableAsync(SQL) - End Function - - Public Function ReturnScalar(ByVal SQL As String) As NetworkService_DDEDM.ScalarResult Implements NetworkService_DDEDM.IEDMService.ReturnScalar - Return MyBase.Channel.ReturnScalar(SQL) - End Function - - Public Function ReturnScalarAsync(ByVal SQL As String) As System.Threading.Tasks.Task(Of NetworkService_DDEDM.ScalarResult) Implements NetworkService_DDEDM.IEDMService.ReturnScalarAsync - Return MyBase.Channel.ReturnScalarAsync(SQL) - End Function - - Public Function ExecuteNonQuery(ByVal SQL As String) As NetworkService_DDEDM.NonQueryResult Implements NetworkService_DDEDM.IEDMService.ExecuteNonQuery - Return MyBase.Channel.ExecuteNonQuery(SQL) - End Function - - Public Function ExecuteNonQueryAsync(ByVal SQL As String) As System.Threading.Tasks.Task(Of NetworkService_DDEDM.NonQueryResult) Implements NetworkService_DDEDM.IEDMService.ExecuteNonQueryAsync - Return MyBase.Channel.ExecuteNonQueryAsync(SQL) - End Function - - Public Function CreateFile(ByVal Contents() As Byte, ByVal Extension As String) As String Implements NetworkService_DDEDM.IEDMService.CreateFile - Return MyBase.Channel.CreateFile(Contents, Extension) - End Function - - Public Function CreateFileAsync(ByVal Contents() As Byte, ByVal Extension As String) As System.Threading.Tasks.Task(Of String) Implements NetworkService_DDEDM.IEDMService.CreateFileAsync - Return MyBase.Channel.CreateFileAsync(Contents, Extension) - End Function - - Public Function UpdateFile(ByVal ContainerId As String, ByVal Contents() As Byte) As String Implements NetworkService_DDEDM.IEDMService.UpdateFile - Return MyBase.Channel.UpdateFile(ContainerId, Contents) - End Function - - Public Function UpdateFileAsync(ByVal ContainerId As String, ByVal Contents() As Byte) As System.Threading.Tasks.Task(Of String) Implements NetworkService_DDEDM.IEDMService.UpdateFileAsync - Return MyBase.Channel.UpdateFileAsync(ContainerId, Contents) - End Function - - Public Function GetFile(ByVal ContainerId As String) As NetworkService_DDEDM.ContainerResult Implements NetworkService_DDEDM.IEDMService.GetFile - Return MyBase.Channel.GetFile(ContainerId) - End Function - - Public Function GetFileAsync(ByVal ContainerId As String) As System.Threading.Tasks.Task(Of NetworkService_DDEDM.ContainerResult) Implements NetworkService_DDEDM.IEDMService.GetFileAsync - Return MyBase.Channel.GetFileAsync(ContainerId) - End Function - - Public Function DeleteFile(ByVal ContainerId As String) As Boolean Implements NetworkService_DDEDM.IEDMService.DeleteFile - Return MyBase.Channel.DeleteFile(ContainerId) - End Function - - Public Function DeleteFileAsync(ByVal ContainerId As String) As System.Threading.Tasks.Task(Of Boolean) Implements NetworkService_DDEDM.IEDMService.DeleteFileAsync - Return MyBase.Channel.DeleteFileAsync(ContainerId) - End Function - End Class -End Namespace diff --git a/EDMI_ClientSuite/Connected Services/NetworkService_DDEDM/System.Data.xsd b/EDMI_ClientSuite/Connected Services/NetworkService_DDEDM/System.Data.xsd deleted file mode 100644 index 8c8a3c0c..00000000 --- a/EDMI_ClientSuite/Connected Services/NetworkService_DDEDM/System.Data.xsd +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/EDMI_ClientSuite/Connected Services/NetworkService_DDEDM/configuration.svcinfo b/EDMI_ClientSuite/Connected Services/NetworkService_DDEDM/configuration.svcinfo deleted file mode 100644 index 3e545624..00000000 --- a/EDMI_ClientSuite/Connected Services/NetworkService_DDEDM/configuration.svcinfo +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/EDMI_ClientSuite/Connected Services/NetworkService_DDEDM/configuration91.svcinfo b/EDMI_ClientSuite/Connected Services/NetworkService_DDEDM/configuration91.svcinfo deleted file mode 100644 index d39914e6..00000000 --- a/EDMI_ClientSuite/Connected Services/NetworkService_DDEDM/configuration91.svcinfo +++ /dev/null @@ -1,210 +0,0 @@ - - - - - - - tcpBinding - - - - - - - - - - - - - - - False - - - Buffered - - - OleTransactions - - - StrongWildcard - - - 0 - - - - - - 65536 - - - 0 - - - - - - False - - - System.ServiceModel.Configuration.XmlDictionaryReaderQuotasElement - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - System.ServiceModel.Configuration.StandardBindingOptionalReliableSessionElement - - - True - - - 00:10:00 - - - False - - - System.ServiceModel.Configuration.NetTcpSecurityElement - - - Transport - - - System.ServiceModel.Configuration.TcpTransportSecurityElement - - - Windows - - - EncryptAndSign - - - System.Security.Authentication.ExtendedProtection.Configuration.ExtendedProtectionPolicyElement - - - Never - - - TransportSelected - - - (Sammlung) - - - Tls, Tls11, Tls12 - - - System.ServiceModel.Configuration.MessageSecurityOverTcpElement - - - Windows - - - Default - - - - - - - - - net.tcp://localhost:9000/DigitalData/Services/Main - - - - - - netTcpBinding - - - tcpBinding - - - NetworkService_DDEDM.IEDMService - - - System.ServiceModel.Configuration.AddressHeaderCollectionElement - - - <Header /> - - - System.ServiceModel.Configuration.IdentityElement - - - System.ServiceModel.Configuration.UserPrincipalNameElement - - - - - - System.ServiceModel.Configuration.ServicePrincipalNameElement - - - - - - System.ServiceModel.Configuration.DnsElement - - - localhost - - - System.ServiceModel.Configuration.RsaElement - - - - - - System.ServiceModel.Configuration.CertificateElement - - - - - - System.ServiceModel.Configuration.CertificateReferenceElement - - - My - - - LocalMachine - - - FindBySubjectDistinguishedName - - - - - - False - - - tcpBinding - - - - - - - - - - - \ No newline at end of file diff --git a/EDMI_ClientSuite/Connected Services/NetworkService_DDEDM/service.wsdl b/EDMI_ClientSuite/Connected Services/NetworkService_DDEDM/service.wsdl deleted file mode 100644 index 520b3f35..00000000 --- a/EDMI_ClientSuite/Connected Services/NetworkService_DDEDM/service.wsdl +++ /dev/null @@ -1,135 +0,0 @@ - - - - - - - - - - - - - EncryptAndSign - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - net.tcp://localhost:9000/DigitalData/Services/Main - - localhost - - - - - \ No newline at end of file diff --git a/EDMI_ClientSuite/Connected Services/NetworkService_DDEDM/service.xsd b/EDMI_ClientSuite/Connected Services/NetworkService_DDEDM/service.xsd deleted file mode 100644 index b4d5ff0f..00000000 --- a/EDMI_ClientSuite/Connected Services/NetworkService_DDEDM/service.xsd +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/EDMI_ClientSuite/EntityDesigner/ClassControlBuilder.vb b/EDMI_ClientSuite/EntityDesigner/ClassControlBuilder.vb index faf70aea..1998a7d6 100644 --- a/EDMI_ClientSuite/EntityDesigner/ClassControlBuilder.vb +++ b/EDMI_ClientSuite/EntityDesigner/ClassControlBuilder.vb @@ -1,5 +1,5 @@ Imports DigitalData.Controls.LookupGrid -Imports EDMI_ClientSuite.ClassControlUtils +Imports DigitalData.GUIs.ClientSuite.ClassControlUtils Public Class ClassControlBuilder #Region "State" diff --git a/EDMI_ClientSuite/EntityDesigner/ControlProperties/BaseClasses/ClassBaseProperties.vb b/EDMI_ClientSuite/EntityDesigner/ControlProperties/BaseClasses/ClassBaseProperties.vb index 7f2ec34f..ba7e6905 100644 --- a/EDMI_ClientSuite/EntityDesigner/ControlProperties/BaseClasses/ClassBaseProperties.vb +++ b/EDMI_ClientSuite/EntityDesigner/ControlProperties/BaseClasses/ClassBaseProperties.vb @@ -1,6 +1,6 @@ Imports System.ComponentModel -Imports EDMI_ClientSuite.ClassControlLocalization -Imports EDMI_ClientSuite.ClassControlUtils +Imports DigitalData.GUIs.ClientSuite.ClassControlLocalization +Imports DigitalData.GUIs.ClientSuite.ClassControlUtils Namespace ControlProperties Public MustInherit Class ClassBaseProperties diff --git a/EDMI_ClientSuite/EntityDesigner/ControlProperties/BaseClasses/ClassInputProperties.vb b/EDMI_ClientSuite/EntityDesigner/ControlProperties/BaseClasses/ClassInputProperties.vb index b82463e5..8e9f2623 100644 --- a/EDMI_ClientSuite/EntityDesigner/ControlProperties/BaseClasses/ClassInputProperties.vb +++ b/EDMI_ClientSuite/EntityDesigner/ControlProperties/BaseClasses/ClassInputProperties.vb @@ -1,4 +1,4 @@ -Imports EDMI_ClientSuite.ClassControlLocalization +Imports DigitalData.GUIs.ClientSuite.ClassControlLocalization Namespace ControlProperties Public MustInherit Class ClassInputProperties diff --git a/EDMI_ClientSuite/EntityDesigner/ControlProperties/BaseClasses/ClassMultiInputProperties.vb b/EDMI_ClientSuite/EntityDesigner/ControlProperties/BaseClasses/ClassMultiInputProperties.vb index faa2cc44..93dafd11 100644 --- a/EDMI_ClientSuite/EntityDesigner/ControlProperties/BaseClasses/ClassMultiInputProperties.vb +++ b/EDMI_ClientSuite/EntityDesigner/ControlProperties/BaseClasses/ClassMultiInputProperties.vb @@ -1,12 +1,6 @@ -Imports System.ComponentModel -Imports System.Drawing.Design -Imports DevExpress.XtraEditors.Repository -Imports EDMI_ClientSuite.ClassControlLocalization +Imports DigitalData.GUIs.ClientSuite.ClassControlLocalization Namespace ControlProperties - - - Public Class ClassMultiInputProperties Inherits ClassInputProperties @@ -23,5 +17,4 @@ Namespace ControlProperties End Set End Property End Class - End Namespace diff --git a/EDMI_ClientSuite/EntityDesigner/ControlProperties/Controls/ClassLabelProperties.vb b/EDMI_ClientSuite/EntityDesigner/ControlProperties/Controls/ClassLabelProperties.vb index 392b8e99..ffff5f5f 100644 --- a/EDMI_ClientSuite/EntityDesigner/ControlProperties/Controls/ClassLabelProperties.vb +++ b/EDMI_ClientSuite/EntityDesigner/ControlProperties/Controls/ClassLabelProperties.vb @@ -1,5 +1,5 @@ Imports System.ComponentModel -Imports EDMI_ClientSuite.ClassControlLocalization +Imports DigitalData.GUIs.ClientSuite.ClassControlLocalization Namespace ControlProperties Public Class ClassLabelProperties diff --git a/EDMI_ClientSuite/EntityDesigner/ControlProperties/Controls/ClassTextboxProperties.vb b/EDMI_ClientSuite/EntityDesigner/ControlProperties/Controls/ClassTextboxProperties.vb index dd58222b..6a126901 100644 --- a/EDMI_ClientSuite/EntityDesigner/ControlProperties/Controls/ClassTextboxProperties.vb +++ b/EDMI_ClientSuite/EntityDesigner/ControlProperties/Controls/ClassTextboxProperties.vb @@ -1,5 +1,5 @@ Imports System.ComponentModel -Imports EDMI_ClientSuite.ClassControlLocalization +Imports DigitalData.GUIs.ClientSuite.ClassControlLocalization Namespace ControlProperties Public Class ClassTextboxProperties diff --git a/EDMI_ClientSuite/EntityDesigner/frmEntityDesigner.Designer.vb b/EDMI_ClientSuite/EntityDesigner/frmEntityDesigner.Designer.vb index 4885b865..9b1d1aa7 100644 --- a/EDMI_ClientSuite/EntityDesigner/frmEntityDesigner.Designer.vb +++ b/EDMI_ClientSuite/EntityDesigner/frmEntityDesigner.Designer.vb @@ -23,7 +23,7 @@ Partial Class frmEntityDesigner Private Sub InitializeComponent() Me.components = New System.ComponentModel.Container() - Me.PanelMain = New EDMI_ClientSuite.ControlSnapPanel(Me.components) + Me.PanelMain = New ClientSuite.ControlSnapPanel(Me.components) Me.TabControlMain = New DevExpress.XtraTab.XtraTabControl() Me.TabPageControls = New DevExpress.XtraTab.XtraTabPage() Me.btnCombobox = New System.Windows.Forms.Button() diff --git a/EDMI_ClientSuite/EntityDesigner/frmEntityDesigner.vb b/EDMI_ClientSuite/EntityDesigner/frmEntityDesigner.vb index 34ed1fc6..3510d287 100644 --- a/EDMI_ClientSuite/EntityDesigner/frmEntityDesigner.vb +++ b/EDMI_ClientSuite/EntityDesigner/frmEntityDesigner.vb @@ -1,8 +1,8 @@ Imports System.ComponentModel Imports DevExpress.XtraEditors.Repository Imports DevExpress.XtraVerticalGrid -Imports EDMI_ClientSuite.ClassControlUtils -Imports EDMI_ClientSuite.ControlProperties +Imports DigitalData.GUIs.ClientSuite.ClassControlUtils +Imports DigitalData.GUIs.ClientSuite.ControlProperties Public Class frmEntityDesigner Private _IsMouseDown As Boolean = False diff --git a/EDMI_ClientSuite/My Project/Application.Designer.vb b/EDMI_ClientSuite/My Project/Application.Designer.vb index 55d6a2a9..5c8d1e2a 100644 --- a/EDMI_ClientSuite/My Project/Application.Designer.vb +++ b/EDMI_ClientSuite/My Project/Application.Designer.vb @@ -32,7 +32,7 @@ Namespace My _ Protected Overrides Sub OnCreateMainForm() - Me.MainForm = Global.EDMI_ClientSuite.frmMain + Me.MainForm = Global.DigitalData.GUIs.ClientSuite.frmMain End Sub End Class End Namespace diff --git a/EDMI_ClientSuite/My Project/Resources.Designer.vb b/EDMI_ClientSuite/My Project/Resources.Designer.vb index 108e91fc..12f93519 100644 --- a/EDMI_ClientSuite/My Project/Resources.Designer.vb +++ b/EDMI_ClientSuite/My Project/Resources.Designer.vb @@ -39,7 +39,7 @@ Namespace My.Resources Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager Get If Object.ReferenceEquals(resourceMan, Nothing) Then - Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("EDMI_ClientSuite.Resources", GetType(Resources).Assembly) + Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("DigitalData.GUIs.ClientSuite.Resources", GetType(Resources).Assembly) resourceMan = temp End If Return resourceMan diff --git a/EDMI_ClientSuite/My Project/Settings.Designer.vb b/EDMI_ClientSuite/My Project/Settings.Designer.vb index cf0fa946..cfc02179 100644 --- a/EDMI_ClientSuite/My Project/Settings.Designer.vb +++ b/EDMI_ClientSuite/My Project/Settings.Designer.vb @@ -85,9 +85,9 @@ Namespace My Friend Module MySettingsProperty _ - Friend ReadOnly Property Settings() As Global.EDMI_ClientSuite.My.MySettings + Friend ReadOnly Property Settings() As Global.DigitalData.GUIs.ClientSuite.My.MySettings Get - Return Global.EDMI_ClientSuite.My.MySettings.Default + Return Global.DigitalData.GUIs.ClientSuite.My.MySettings.Default End Get End Property End Module diff --git a/EDMI_ClientSuite/MyApplication.vb b/EDMI_ClientSuite/MyApplication.vb index a6e04ea8..1669412c 100644 --- a/EDMI_ClientSuite/MyApplication.vb +++ b/EDMI_ClientSuite/MyApplication.vb @@ -2,7 +2,7 @@ Imports System.Threading Imports DigitalData.Modules.Config Imports DigitalData.Modules.Logging -Imports EDMI_ClientSuite.NetworkService_DDEDM +Imports DigitalData.Modules.EDMIFileOps.EDMIServiceReference Namespace My ''' @@ -24,12 +24,13 @@ Namespace My End Module ''' - ''' Extends the My.Application Namespace + ''' Extends the My.Application Namespace to hold Application State ''' Example: My.Application.User ''' Partial Class MyApplication ' User Config Public User As New UserState() + Public Service As New ServiceState() End Class End Namespace diff --git a/EDMI_ClientSuite/State/ServiceState.vb b/EDMI_ClientSuite/State/ServiceState.vb new file mode 100644 index 00000000..2cba01a4 --- /dev/null +++ b/EDMI_ClientSuite/State/ServiceState.vb @@ -0,0 +1,9 @@ +Public Class ServiceState + Public Online As Boolean + Public LastChecked As DateTime + + Public Sub New() + Online = True + LastChecked = DateTime.Now + End Sub +End Class diff --git a/EDMI_ClientSuite/Strings/ControlProperties.Designer.vb b/EDMI_ClientSuite/Strings/ControlProperties.Designer.vb index b6dd43c0..61587f26 100644 --- a/EDMI_ClientSuite/Strings/ControlProperties.Designer.vb +++ b/EDMI_ClientSuite/Strings/ControlProperties.Designer.vb @@ -43,7 +43,7 @@ Namespace My.Resources Public Shared ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager Get If Object.ReferenceEquals(resourceMan, Nothing) Then - Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("EDMI_ClientSuite.ControlProperties", GetType(ControlProperties).Assembly) + Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("DigitalData.GUIs.ClientSuite.ControlProperties", GetType(ControlProperties).Assembly) resourceMan = temp End If Return resourceMan diff --git a/EDMI_ClientSuite/frmMain.Designer.vb b/EDMI_ClientSuite/frmMain.Designer.vb index f8156f5d..bc74496a 100644 --- a/EDMI_ClientSuite/frmMain.Designer.vb +++ b/EDMI_ClientSuite/frmMain.Designer.vb @@ -59,7 +59,7 @@ Partial Class frmMain Me.Label1 = New System.Windows.Forms.Label() Me.DockPanelProcessManager = New DevExpress.XtraBars.Docking.DockPanel() Me.DockPanel2_Container = New DevExpress.XtraBars.Docking.ControlContainer() - Me.ProcessManagerWidget = New EDMI_ClientSuite.ProcessManagerWidget() + Me.ProcessManagerWidget = New ClientSuite.ProcessManagerWidget() CType(Me.RibbonControl, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.MainMenu, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.DocumentManager, System.ComponentModel.ISupportInitialize).BeginInit() diff --git a/EDMI_ClientSuite/frmMain.vb b/EDMI_ClientSuite/frmMain.vb index 6d4c6b23..0d160e77 100644 --- a/EDMI_ClientSuite/frmMain.vb +++ b/EDMI_ClientSuite/frmMain.vb @@ -1,15 +1,13 @@ -Imports DevExpress.XtraBars.Docking2010.Views -Imports DevExpress.XtraBars.Docking2010 -Imports DevExpress.XtraBars.Docking2010.Views.Widget +Imports DevExpress.XtraBars.Docking2010 Imports System.ComponentModel -Imports EDMI_ClientSuite.ClassLayout +Imports DigitalData.GUIs.ClientSuite.ClassLayout Imports System.IO Imports DigitalData.Modules.Logging -Imports DigitalData.Modules.Logging.LogConfig Imports DigitalData.Modules.License Public Class frmMain Private _Logger As Logger + Private _Timer As ClassTimer Public Sub New() ' Dieser Aufruf ist für den Designer erforderlich. @@ -18,6 +16,9 @@ Public Class frmMain ' Assign My.MainForm before everything else My.MainForm = Me + ' Initialize Main Timer + _Timer = New ClassTimer(My.LogConfig) + ' Show splashscreen frmSplash.ShowDialog() End Sub @@ -44,8 +45,8 @@ Public Class frmMain ProcessManagerWidget.DataSource = oDataTable AddHandler ProcessManagerWidget.RowDoubleClicked, Sub(RowView As DataRowView) - MsgBox($"Clicked on Document {RowView.Row.Item("DocName")}") - End Sub + MsgBox($"Clicked on Document {RowView.Row.Item("DocName")}") + End Sub LoadLayout() diff --git a/EDMI_ClientSuite/frmSplash.designer.vb b/EDMI_ClientSuite/frmSplash.designer.vb index a968c346..09ee2189 100644 --- a/EDMI_ClientSuite/frmSplash.designer.vb +++ b/EDMI_ClientSuite/frmSplash.designer.vb @@ -97,7 +97,7 @@ Partial Class frmSplash ' 'PictureBox1 ' - Me.PictureBox1.Image = Global.EDMI_ClientSuite.My.Resources.Resources.iconfinder_Gowalla_324477 + Me.PictureBox1.Image = Global.DigitalData.GUIs.ClientSuite.My.Resources.Resources.iconfinder_Gowalla_324477 Me.PictureBox1.Location = New System.Drawing.Point(0, -1) Me.PictureBox1.Name = "PictureBox1" Me.PictureBox1.Size = New System.Drawing.Size(520, 374) diff --git a/EDMI_ClientSuite/frmSplash.vb b/EDMI_ClientSuite/frmSplash.vb index 4a4a0e5b..ff5677bb 100644 --- a/EDMI_ClientSuite/frmSplash.vb +++ b/EDMI_ClientSuite/frmSplash.vb @@ -2,8 +2,7 @@ Imports System.ServiceModel Imports System.Threading Imports DigitalData.Modules.Logging -Imports DigitalData.Modules.Logging.LogConfig -Imports EDMI_ClientSuite.NetworkService_DDEDM +Imports DigitalData.Modules.EDMIFileOps.EDMIServiceReference Public NotInheritable Class frmSplash Private _Worker As New BackgroundWorker() From 4229682da01946792b5567571c6ff0cc7126a771 Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Mon, 18 Feb 2019 17:06:41 +0100 Subject: [PATCH 23/23] Add Heartbeat Function to Service, Add Timer to ClientSuite Service Startup check --- EDMI_ClientSuite/ClassConfig.vb | 6 ++ EDMI_ClientSuite/ClassLayout.vb | 32 ++++++++-- EDMI_ClientSuite/ClassService.vb | 26 ++++++++ EDMI_ClientSuite/ClassTimer.vb | 63 ++++++++++++++----- EDMI_ClientSuite/ClientSuite.vbproj | 4 +- EDMI_ClientSuite/MyApplication.vb | 4 +- EDMI_ClientSuite/State/ClassServiceState.vb | 4 ++ .../State/{UserState.vb => ClassUserState.vb} | 2 +- EDMI_ClientSuite/State/ServiceState.vb | 9 --- EDMI_ClientSuite/frmConfigService.vb | 2 +- EDMI_ClientSuite/frmMain.Designer.vb | 24 ++++--- EDMI_ClientSuite/frmMain.vb | 41 ++++++++---- EDMI_ClientSuite/frmSplash.vb | 42 ++++++++++--- ...erviceReference.ContainerResult.datasource | 2 +- ...ServiceReference.NonQueryResult.datasource | 2 +- ...MIServiceReference.ScalarResult.datasource | 2 +- ...DMIServiceReference.TableResult.datasource | 2 +- .../DigitalData.Services.EDMService.wsdl | 10 +++ .../DigitalData.Services.EDMService.xsd | 12 ++++ .../EDMIServiceReference/Reference.vb | 14 +++++ .../EDMIServiceReference/service.wsdl | 9 +++ SERVICES/DDEDM_NetworkService/EDMService.vb | 9 ++- SERVICES/DDEDM_NetworkService/IEDMService.vb | 5 ++ .../DDEDM_NetworkService/WindowsService.vb | 16 ----- 24 files changed, 258 insertions(+), 84 deletions(-) create mode 100644 EDMI_ClientSuite/State/ClassServiceState.vb rename EDMI_ClientSuite/State/{UserState.vb => ClassUserState.vb} (93%) delete mode 100644 EDMI_ClientSuite/State/ServiceState.vb diff --git a/EDMI_ClientSuite/ClassConfig.vb b/EDMI_ClientSuite/ClassConfig.vb index d4a2c7f5..bbf69a37 100644 --- a/EDMI_ClientSuite/ClassConfig.vb +++ b/EDMI_ClientSuite/ClassConfig.vb @@ -36,8 +36,14 @@ Public Class ClassConfig End Property ' === Simple/Actual Config Properties === + ' === Service Configuration === Public Property ServiceIP As String = String.Empty Public Property ServicePort As Integer = -1 + Public Property HeartbeatInterval As Integer = 5000 + + ' === Logging Configuration Public Property LogDebug As Boolean = False + + ' === User Configuration === Public Property UserLanguage As String = "de-DE" End Class diff --git a/EDMI_ClientSuite/ClassLayout.vb b/EDMI_ClientSuite/ClassLayout.vb index 0b9e8e26..1935d98d 100644 --- a/EDMI_ClientSuite/ClassLayout.vb +++ b/EDMI_ClientSuite/ClassLayout.vb @@ -1,7 +1,21 @@ Imports System.IO +''' +''' Helper Class to save DevExpress layouts +''' +''' Example: +''' +''' Layout 1 (for frmMain) +''' ---------------------------------------------- +''' | Component 1 Component 2 | +''' | |-------------| |----------------| | +''' | | MainGrid | | DocumentGrid | | +''' | |-------------| |----------------| | +''' | | +''' |--------------------------------------------- +''' Public Class ClassLayout - Public Enum LayoutName + Public Enum GroupName LayoutMain End Enum @@ -10,9 +24,19 @@ Public Class ClassLayout DocumentManager End Enum - Public Shared Function GetLayoutPath(LayoutName As LayoutName, Component As LayoutComponent) As String - Dim oFileName As String = $"{LayoutName.ToString}-{Component.ToString}.xml" - Return IO.Path.Combine(GetAppDataFolder(), ClassConstants.FOLDER_NAME_LAYOUT, oFileName) + ''' + ''' Returns a path for the chosen Devexpress layout file + ''' + ''' The Group to which the the component belongs to. For example, a form could be a Layout + ''' The component to which the layout belongs to + ''' + Public Shared Function GetLayoutPath(Group As GroupName, Component As LayoutComponent) As String + Dim oFileName As String = $"{Group.ToString}-{Component.ToString}.xml" + Return Path.Combine(GetLayoutDirectory(), oFileName) + End Function + + Public Shared Function GetLayoutDirectory() As String + Return Path.Combine(GetAppDataFolder(), ClassConstants.FOLDER_NAME_LAYOUT) End Function Private Shared Function GetAppDataFolder() As String diff --git a/EDMI_ClientSuite/ClassService.vb b/EDMI_ClientSuite/ClassService.vb index 479ac410..50f0c09e 100644 --- a/EDMI_ClientSuite/ClassService.vb +++ b/EDMI_ClientSuite/ClassService.vb @@ -18,6 +18,32 @@ Public Class ClassService _Logger = _LogConfig.GetLogger() End Sub + Public Function TestConnection() As ConnectionTestResult + Return TestConnection(My.Config.ServiceConnection) + End Function + + Public Function TestConnection(EndpointURL As String) As ConnectionTestResult + Try + Dim oChannelFactory = GetChannelFactory(EndpointURL) + Dim oChannel = oChannelFactory.CreateChannel() + oChannel.OperationTimeout = New TimeSpan(0, 0, ClassConstants.SERVICE_OPEN_TIMEOUT) + oChannel.Open() + oChannel.Close() + + Return ConnectionTestResult.Successful + Catch ex As EndpointNotFoundException + _Logger.Error(ex) + Return ConnectionTestResult.NotFound + Catch ex As Exception + _Logger.Error(ex) + Return ConnectionTestResult.Unknown + End Try + End Function + + Public Async Function TestConnectionAsync() As Task(Of ConnectionTestResult) + Return Await TestConnectionAsync(My.Config.ServiceConnection) + End Function + Public Async Function TestConnectionAsync(EndpointURL As String) As Task(Of ConnectionTestResult) Return Await Task.Factory.StartNew(Function() Try diff --git a/EDMI_ClientSuite/ClassTimer.vb b/EDMI_ClientSuite/ClassTimer.vb index ec024c02..7862b158 100644 --- a/EDMI_ClientSuite/ClassTimer.vb +++ b/EDMI_ClientSuite/ClassTimer.vb @@ -1,4 +1,5 @@ -Imports System.Threading +Imports System.ServiceModel +Imports System.Threading Imports System.Timers Imports DigitalData.Modules.EDMIFileOps.EDMIServiceReference Imports DigitalData.Modules.Logging @@ -10,28 +11,56 @@ Public Class ClassTimer Private _Timer As Timers.Timer Private _Channel As IEDMServiceChannel - Private Const TIMER_START_TIME = 1000 - Private Const TIMER_INTERVAL = 5000 + Public Event OnlineChanged As OnlineChangedEventHandler + Public Delegate Sub OnlineChangedEventHandler(sender As Object, Online As Boolean) - Public Sub Callback(sender As Object, e As ElapsedEventArgs) - _Logger.Info("Checking if Service is up...") + Public Sub New(LogConfig As LogConfig, SynchronizingObject As frmMain, HeartbeatInterval As Integer) + Try + _LogConfig = LogConfig + _Logger = LogConfig.GetLogger() - ' Connect to service and send hearbeat request + _Channel = My.ChannelFactory.CreateChannel() + _Channel.Open() - My.Application.Service.Online = True - My.Application.Service.LastChecked = DateTime.Now + _Timer = New Timers.Timer(HeartbeatInterval) With { + .SynchronizingObject = SynchronizingObject, + .Enabled = True + } + + AddHandler _Timer.Elapsed, AddressOf Callback + Catch ex As Exception + _Logger.Error(ex) + End Try End Sub - Public Sub New(LogConfig As LogConfig) - _LogConfig = LogConfig - _Logger = LogConfig.GetLogger() + Public Async Sub Callback(sender As Object, e As ElapsedEventArgs) + Try + _Logger.Debug("Checking if Service is up...") + + If _Channel.State = ServiceModel.CommunicationState.Faulted Then + _Channel = My.ChannelFactory.CreateChannel() + End If + + ' Connect to service and send hearbeat request + Dim oResult = Await _Channel.HeartbeatAsync() + - _Channel = My.ChannelFactory.CreateChannel() - _Channel.Open() + _Logger.Debug("Service is online") + + SetOnlineState(True) + Catch ex As Exception + _Logger.Debug("Service is offline!") + + SetOnlineState(False) + Finally + My.Application.Service.LastChecked = DateTime.Now + End Try + End Sub - _Timer = New Timers.Timer(TIMER_INTERVAL) - _Timer.SynchronizingObject = My.MainForm - AddHandler _Timer.Elapsed, AddressOf Callback - _Timer.Enabled = True + Private Sub SetOnlineState(NewState As Boolean) + If My.Application.Service.Online <> NewState Then + My.Application.Service.Online = NewState + RaiseEvent OnlineChanged(Me, NewState) + End If End Sub End Class diff --git a/EDMI_ClientSuite/ClientSuite.vbproj b/EDMI_ClientSuite/ClientSuite.vbproj index 04da0669..b961e407 100644 --- a/EDMI_ClientSuite/ClientSuite.vbproj +++ b/EDMI_ClientSuite/ClientSuite.vbproj @@ -207,8 +207,8 @@ True - - + + True True diff --git a/EDMI_ClientSuite/MyApplication.vb b/EDMI_ClientSuite/MyApplication.vb index 1669412c..668e9a65 100644 --- a/EDMI_ClientSuite/MyApplication.vb +++ b/EDMI_ClientSuite/MyApplication.vb @@ -29,8 +29,8 @@ Namespace My ''' Partial Class MyApplication ' User Config - Public User As New UserState() - Public Service As New ServiceState() + Public User As New ClassUserState() + Public Service As New ClassServiceState() End Class End Namespace diff --git a/EDMI_ClientSuite/State/ClassServiceState.vb b/EDMI_ClientSuite/State/ClassServiceState.vb new file mode 100644 index 00000000..25047b48 --- /dev/null +++ b/EDMI_ClientSuite/State/ClassServiceState.vb @@ -0,0 +1,4 @@ +Public Class ClassServiceState + Public Property Online As Boolean = True + Public Property LastChecked As DateTime = DateTime.Now +End Class diff --git a/EDMI_ClientSuite/State/UserState.vb b/EDMI_ClientSuite/State/ClassUserState.vb similarity index 93% rename from EDMI_ClientSuite/State/UserState.vb rename to EDMI_ClientSuite/State/ClassUserState.vb index c9b8360c..41bc5b75 100644 --- a/EDMI_ClientSuite/State/UserState.vb +++ b/EDMI_ClientSuite/State/ClassUserState.vb @@ -3,7 +3,7 @@ ''' ''' Helper Class to hold User State ''' -Public Class UserState +Public Class ClassUserState Public UserName As String Public MachineName As String Public Language As String diff --git a/EDMI_ClientSuite/State/ServiceState.vb b/EDMI_ClientSuite/State/ServiceState.vb deleted file mode 100644 index 2cba01a4..00000000 --- a/EDMI_ClientSuite/State/ServiceState.vb +++ /dev/null @@ -1,9 +0,0 @@ -Public Class ServiceState - Public Online As Boolean - Public LastChecked As DateTime - - Public Sub New() - Online = True - LastChecked = DateTime.Now - End Sub -End Class diff --git a/EDMI_ClientSuite/frmConfigService.vb b/EDMI_ClientSuite/frmConfigService.vb index d0a60491..60a66feb 100644 --- a/EDMI_ClientSuite/frmConfigService.vb +++ b/EDMI_ClientSuite/frmConfigService.vb @@ -22,7 +22,7 @@ My.Config.ServicePort = Integer.Parse(oPort) lblStatus.Text = "Verbindung wird hergestellt..." - oResult = Await _Service.TestConnectionAsync(My.ConfigManager.Config.ServiceConnection) + oResult = Await _Service.TestConnectionAsync() If oResult = ClassService.ConnectionTestResult.Successful Then My.ConfigManager.Save() diff --git a/EDMI_ClientSuite/frmMain.Designer.vb b/EDMI_ClientSuite/frmMain.Designer.vb index bc74496a..489d0300 100644 --- a/EDMI_ClientSuite/frmMain.Designer.vb +++ b/EDMI_ClientSuite/frmMain.Designer.vb @@ -19,10 +19,11 @@ Partial Class frmMain 'Do not modify it using the code editor. Private Sub InitializeComponent() + Me.components = New System.ComponentModel.Container() Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmMain)) Dim PushTransition1 As DevExpress.Utils.Animation.PushTransition = New DevExpress.Utils.Animation.PushTransition() Me.RibbonControl = New DevExpress.XtraBars.Ribbon.RibbonControl() - Me.MainMenu = New DevExpress.XtraBars.Ribbon.ApplicationMenu() + Me.MainMenu = New DevExpress.XtraBars.Ribbon.ApplicationMenu(Me.components) Me.BarButtonExit = New DevExpress.XtraBars.BarButtonItem() Me.BarButtonUserSettings = New DevExpress.XtraBars.BarButtonItem() Me.BarButtonConnectionSettings = New DevExpress.XtraBars.BarButtonItem() @@ -39,6 +40,7 @@ Partial Class frmMain Me.BarButtonItem2 = New DevExpress.XtraBars.BarButtonItem() Me.BarWorkspaceMenuItem1 = New DevExpress.XtraBars.BarWorkspaceMenuItem() Me.WorkspaceManager1 = New DevExpress.Utils.WorkspaceManager() + Me.LabelServiceOnline = New DevExpress.XtraBars.BarStaticItem() Me.RibbonPageCategoryEntityDesigner = New DevExpress.XtraBars.Ribbon.RibbonPageCategory() Me.RibbonPageControlActions = New DevExpress.XtraBars.Ribbon.RibbonPage() Me.RibbonPageGroup5 = New DevExpress.XtraBars.Ribbon.RibbonPageGroup() @@ -50,16 +52,16 @@ Partial Class frmMain Me.RibbonPageWorkflow = New DevExpress.XtraBars.Ribbon.RibbonPage() Me.RibbonPageGroup4 = New DevExpress.XtraBars.Ribbon.RibbonPageGroup() Me.RibbonStatusBar = New DevExpress.XtraBars.Ribbon.RibbonStatusBar() - Me.DocumentManager = New DevExpress.XtraBars.Docking2010.DocumentManager() - Me.TabbedView1 = New DevExpress.XtraBars.Docking2010.Views.Tabbed.TabbedView() - Me.DockManager = New DevExpress.XtraBars.Docking.DockManager() + Me.DocumentManager = New DevExpress.XtraBars.Docking2010.DocumentManager(Me.components) + Me.TabbedView1 = New DevExpress.XtraBars.Docking2010.Views.Tabbed.TabbedView(Me.components) + Me.DockManager = New DevExpress.XtraBars.Docking.DockManager(Me.components) Me.panelContainer1 = New DevExpress.XtraBars.Docking.DockPanel() Me.DockPanelGlobix = New DevExpress.XtraBars.Docking.DockPanel() Me.DockPanel1_Container = New DevExpress.XtraBars.Docking.ControlContainer() Me.Label1 = New System.Windows.Forms.Label() Me.DockPanelProcessManager = New DevExpress.XtraBars.Docking.DockPanel() Me.DockPanel2_Container = New DevExpress.XtraBars.Docking.ControlContainer() - Me.ProcessManagerWidget = New ClientSuite.ProcessManagerWidget() + Me.ProcessManagerWidget = New DigitalData.GUIs.ClientSuite.ProcessManagerWidget() CType(Me.RibbonControl, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.MainMenu, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.DocumentManager, System.ComponentModel.ISupportInitialize).BeginInit() @@ -76,9 +78,9 @@ Partial Class frmMain ' Me.RibbonControl.ApplicationButtonDropDownControl = Me.MainMenu Me.RibbonControl.ExpandCollapseItem.Id = 0 - Me.RibbonControl.Items.AddRange(New DevExpress.XtraBars.BarItem() {Me.RibbonControl.ExpandCollapseItem, Me.BarButtonExit, Me.BarButtonUserSettings, Me.LabelCurrentUser, Me.LabelCurrentMachine, Me.LabelCurrentVersion, Me.BarButtonItem1, Me.BarButtonDock1, Me.SkinDropDownButtonItem1, Me.BarButtonDashboard, Me.BarButtonEntityDesigner, Me.BarButtonDeleteControl, Me.BarButtonConnectionSettings, Me.LabelCurrentLanguage, Me.BarButtonItem2, Me.BarWorkspaceMenuItem1}) + Me.RibbonControl.Items.AddRange(New DevExpress.XtraBars.BarItem() {Me.RibbonControl.ExpandCollapseItem, Me.BarButtonExit, Me.BarButtonUserSettings, Me.LabelCurrentUser, Me.LabelCurrentMachine, Me.LabelCurrentVersion, Me.BarButtonItem1, Me.BarButtonDock1, Me.SkinDropDownButtonItem1, Me.BarButtonDashboard, Me.BarButtonEntityDesigner, Me.BarButtonDeleteControl, Me.BarButtonConnectionSettings, Me.LabelCurrentLanguage, Me.BarButtonItem2, Me.BarWorkspaceMenuItem1, Me.LabelServiceOnline}) Me.RibbonControl.Location = New System.Drawing.Point(0, 0) - Me.RibbonControl.MaxItemId = 18 + Me.RibbonControl.MaxItemId = 19 Me.RibbonControl.Name = "RibbonControl" Me.RibbonControl.PageCategories.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPageCategory() {Me.RibbonPageCategoryEntityDesigner}) Me.RibbonControl.PageHeaderItemLinks.Add(Me.SkinDropDownButtonItem1) @@ -200,6 +202,12 @@ Partial Class frmMain Me.WorkspaceManager1.TargetControl = Me Me.WorkspaceManager1.TransitionType = PushTransition1 ' + 'LabelServiceOnline + ' + Me.LabelServiceOnline.Caption = "BarStaticItem1" + Me.LabelServiceOnline.Id = 18 + Me.LabelServiceOnline.Name = "LabelServiceOnline" + ' 'RibbonPageCategoryEntityDesigner ' Me.RibbonPageCategoryEntityDesigner.AutoStretchPageHeaders = True @@ -271,6 +279,7 @@ Partial Class frmMain Me.RibbonStatusBar.ItemLinks.Add(Me.LabelCurrentMachine) Me.RibbonStatusBar.ItemLinks.Add(Me.LabelCurrentVersion) Me.RibbonStatusBar.ItemLinks.Add(Me.LabelCurrentLanguage) + Me.RibbonStatusBar.ItemLinks.Add(Me.LabelServiceOnline) Me.RibbonStatusBar.Location = New System.Drawing.Point(0, 556) Me.RibbonStatusBar.Name = "RibbonStatusBar" Me.RibbonStatusBar.Ribbon = Me.RibbonControl @@ -436,4 +445,5 @@ Partial Class frmMain Friend WithEvents BarButtonItem2 As DevExpress.XtraBars.BarButtonItem Friend WithEvents BarWorkspaceMenuItem1 As DevExpress.XtraBars.BarWorkspaceMenuItem Friend WithEvents WorkspaceManager1 As DevExpress.Utils.WorkspaceManager + Friend WithEvents LabelServiceOnline As DevExpress.XtraBars.BarStaticItem End Class diff --git a/EDMI_ClientSuite/frmMain.vb b/EDMI_ClientSuite/frmMain.vb index 0d160e77..804248fb 100644 --- a/EDMI_ClientSuite/frmMain.vb +++ b/EDMI_ClientSuite/frmMain.vb @@ -13,17 +13,33 @@ Public Class frmMain ' Dieser Aufruf ist für den Designer erforderlich. InitializeComponent() - ' Assign My.MainForm before everything else + ' Show splashscreen + frmSplash.ShowDialog() + + ' Initialize Form Related Variables My.MainForm = Me + End Sub - ' Initialize Main Timer - _Timer = New ClassTimer(My.LogConfig) + Private Sub SetOnlineLabel() + If My.Application.Service.Online Then + LabelServiceOnline.Caption = "Service Online" + LabelServiceOnline.ItemAppearance.Normal.ForeColor = Color.Green + Else + LabelServiceOnline.Caption = "Service Offline" + LabelServiceOnline.ItemAppearance.Normal.ForeColor = Color.Red + End If + End Sub - ' Show splashscreen - frmSplash.ShowDialog() + Private Sub HandleOnlineChanged(sender As Object, Online As Boolean) + SetOnlineLabel() End Sub Private Sub FrmMain_Load(sender As Object, e As EventArgs) Handles Me.Load + ' Initialize Main Timer + _Timer = New ClassTimer(My.LogConfig, Me, My.Config.HeartbeatInterval) + AddHandler _Timer.OnlineChanged, AddressOf HandleOnlineChanged + SetOnlineLabel() + LabelCurrentUser.Caption = My.Application.User.UserName LabelCurrentMachine.Caption = My.Application.User.MachineName LabelCurrentVersion.Caption = My.Application.Info.Version.ToString @@ -48,7 +64,6 @@ Public Class frmMain MsgBox($"Clicked on Document {RowView.Row.Item("DocName")}") End Sub - LoadLayout() End Sub @@ -57,21 +72,21 @@ Public Class frmMain End Sub Private Sub LoadLayout() - Dim oLayoutPathForDockManager As String = GetLayoutPath(LayoutName.LayoutMain, LayoutComponent.DockManager) - Dim oLayoutPathForDocumentManager As String = GetLayoutPath(LayoutName.LayoutMain, LayoutComponent.DocumentManager) + Dim oLayoutPathForDockManager As String = GetLayoutPath(GroupName.LayoutMain, LayoutComponent.DockManager) + Dim oLayoutPathForDocumentManager As String = GetLayoutPath(GroupName.LayoutMain, LayoutComponent.DocumentManager) - If IO.File.Exists(oLayoutPathForDockManager) Then + If File.Exists(oLayoutPathForDockManager) Then DockManager.RestoreLayoutFromXml(oLayoutPathForDockManager) End If - If IO.File.Exists(oLayoutPathForDocumentManager) Then + If File.Exists(oLayoutPathForDocumentManager) Then DocumentManager.View.RestoreLayoutFromXml(oLayoutPathForDocumentManager) End If End Sub Private Sub SaveLayout() - Dim oLayoutPathForDockManager As String = GetLayoutPath(LayoutName.LayoutMain, LayoutComponent.DockManager) - Dim oLayoutPathForDocumentManager As String = GetLayoutPath(LayoutName.LayoutMain, LayoutComponent.DocumentManager) - Dim oDirectory As String = Path.GetDirectoryName(oLayoutPathForDockManager) + Dim oLayoutPathForDockManager As String = GetLayoutPath(GroupName.LayoutMain, LayoutComponent.DockManager) + Dim oLayoutPathForDocumentManager As String = GetLayoutPath(GroupName.LayoutMain, LayoutComponent.DocumentManager) + Dim oDirectory As String = GetLayoutDirectory() If Not Directory.Exists(oDirectory) Then Directory.CreateDirectory(oDirectory) diff --git a/EDMI_ClientSuite/frmSplash.vb b/EDMI_ClientSuite/frmSplash.vb index ff5677bb..15d29bdd 100644 --- a/EDMI_ClientSuite/frmSplash.vb +++ b/EDMI_ClientSuite/frmSplash.vb @@ -49,6 +49,12 @@ Public NotInheritable Class frmSplash End Function #Region "Worker" + Private Enum WorkerResult + AllGood + ServiceOffline + End Enum + + Private Sub StartWorker() AddHandler _Worker.DoWork, AddressOf bw_DoWork AddHandler _Worker.ProgressChanged, AddressOf bw_ProgressChanged @@ -58,17 +64,25 @@ Public NotInheritable Class frmSplash _Worker.RunWorkerAsync() End Sub - Private Sub bw_DoWork(sender As Object, e As System.ComponentModel.DoWorkEventArgs) + Private Async Sub bw_DoWork(sender As Object, e As System.ComponentModel.DoWorkEventArgs) Dim oService As New ClassService(My.LogConfig) _Worker.ReportProgress(SetProgress(1), "Connecting to service..") - Dim oChannelFactory As ChannelFactory(Of IEDMServiceChannel) - Dim oChannel As IEDMServiceChannel Dim oConnectionSuccessful = False - oChannelFactory = oService.GetChannelFactory() - oChannel = oChannelFactory.CreateChannel() + e.Result = WorkerResult.AllGood + + _ChannelFactory = oService.GetChannelFactory() + _Channel = _ChannelFactory.CreateChannel() + + 'Dim oServiceOnline = Await oService.TestConnectionAsync() + Dim oServiceState = oService.TestConnection() + + If oServiceState <> ClassService.ConnectionTestResult.Successful Then + e.Result = WorkerResult.ServiceOffline + Return + End If Thread.Sleep(SLEEP_TIME) @@ -92,11 +106,25 @@ Public NotInheritable Class frmSplash Private Sub bw_RunWorkerCompleted(sender As Object, e As System.ComponentModel.RunWorkerCompletedEventArgs) ' Bei Fehler MsgBox anzeigen und Programm beenden If e.Error IsNot Nothing Then - 'ClassLogger.Add("Unexpected error in Initializing application....") - MsgBox(e.Error.Message, MsgBoxStyle.Critical, "Critical Error") + MsgBox(e.Error.Message, MsgBoxStyle.Critical, "Unhandled Error") + Application.Exit() + ElseIf e.Result <> WorkerResult.AllGood Then + Dim oErrorMessage + + Select Case e.Result + Case WorkerResult.ServiceOffline + oErrorMessage = "Service is offline!" + Case Else + oErrorMessage = "Unknown Error" + End Select + + MsgBox($"Application could not be started{vbNewLine}Reason: {oErrorMessage}", MsgBoxStyle.Critical, "Critical Error") Application.Exit() End If + My.ChannelFactory = _ChannelFactory + My.Channel = _Channel + ' Wenn kein Fehler, Splashscreen schließen Me.Close() End Sub diff --git a/EDMI_FILE_OPs/Connected Services/EDMIServiceReference/DigitalData.Modules.EDMIFileOps.EDMIServiceReference.ContainerResult.datasource b/EDMI_FILE_OPs/Connected Services/EDMIServiceReference/DigitalData.Modules.EDMIFileOps.EDMIServiceReference.ContainerResult.datasource index 92381800..37ec8092 100644 --- a/EDMI_FILE_OPs/Connected Services/EDMIServiceReference/DigitalData.Modules.EDMIFileOps.EDMIServiceReference.ContainerResult.datasource +++ b/EDMI_FILE_OPs/Connected Services/EDMIServiceReference/DigitalData.Modules.EDMIFileOps.EDMIServiceReference.ContainerResult.datasource @@ -6,5 +6,5 @@ cause the file to be unrecognizable by the program. --> - DigitalData.Modules.EDMIFileOps.EDMIServiceReference.ContainerResult + DigitalData.Modules.EDMIFileOps.EDMIServiceReference.ContainerResult, Connected Services.EDMIServiceReference.Reference.vb.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null \ No newline at end of file diff --git a/EDMI_FILE_OPs/Connected Services/EDMIServiceReference/DigitalData.Modules.EDMIFileOps.EDMIServiceReference.NonQueryResult.datasource b/EDMI_FILE_OPs/Connected Services/EDMIServiceReference/DigitalData.Modules.EDMIFileOps.EDMIServiceReference.NonQueryResult.datasource index 1ded1ec6..f729e1d8 100644 --- a/EDMI_FILE_OPs/Connected Services/EDMIServiceReference/DigitalData.Modules.EDMIFileOps.EDMIServiceReference.NonQueryResult.datasource +++ b/EDMI_FILE_OPs/Connected Services/EDMIServiceReference/DigitalData.Modules.EDMIFileOps.EDMIServiceReference.NonQueryResult.datasource @@ -6,5 +6,5 @@ cause the file to be unrecognizable by the program. --> - DigitalData.Modules.EDMIFileOps.EDMIServiceReference.NonQueryResult + DigitalData.Modules.EDMIFileOps.EDMIServiceReference.NonQueryResult, Connected Services.EDMIServiceReference.Reference.vb.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null \ No newline at end of file diff --git a/EDMI_FILE_OPs/Connected Services/EDMIServiceReference/DigitalData.Modules.EDMIFileOps.EDMIServiceReference.ScalarResult.datasource b/EDMI_FILE_OPs/Connected Services/EDMIServiceReference/DigitalData.Modules.EDMIFileOps.EDMIServiceReference.ScalarResult.datasource index 972a9621..7a412454 100644 --- a/EDMI_FILE_OPs/Connected Services/EDMIServiceReference/DigitalData.Modules.EDMIFileOps.EDMIServiceReference.ScalarResult.datasource +++ b/EDMI_FILE_OPs/Connected Services/EDMIServiceReference/DigitalData.Modules.EDMIFileOps.EDMIServiceReference.ScalarResult.datasource @@ -6,5 +6,5 @@ cause the file to be unrecognizable by the program. --> - DigitalData.Modules.EDMIFileOps.EDMIServiceReference.ScalarResult + DigitalData.Modules.EDMIFileOps.EDMIServiceReference.ScalarResult, Connected Services.EDMIServiceReference.Reference.vb.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null \ No newline at end of file diff --git a/EDMI_FILE_OPs/Connected Services/EDMIServiceReference/DigitalData.Modules.EDMIFileOps.EDMIServiceReference.TableResult.datasource b/EDMI_FILE_OPs/Connected Services/EDMIServiceReference/DigitalData.Modules.EDMIFileOps.EDMIServiceReference.TableResult.datasource index 21ec4794..afc8fe42 100644 --- a/EDMI_FILE_OPs/Connected Services/EDMIServiceReference/DigitalData.Modules.EDMIFileOps.EDMIServiceReference.TableResult.datasource +++ b/EDMI_FILE_OPs/Connected Services/EDMIServiceReference/DigitalData.Modules.EDMIFileOps.EDMIServiceReference.TableResult.datasource @@ -6,5 +6,5 @@ cause the file to be unrecognizable by the program. --> - DigitalData.Modules.EDMIFileOps.EDMIServiceReference.TableResult + DigitalData.Modules.EDMIFileOps.EDMIServiceReference.TableResult, Connected Services.EDMIServiceReference.Reference.vb.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null \ No newline at end of file diff --git a/EDMI_FILE_OPs/Connected Services/EDMIServiceReference/DigitalData.Services.EDMService.wsdl b/EDMI_FILE_OPs/Connected Services/EDMIServiceReference/DigitalData.Services.EDMService.wsdl index 2fd4ed52..47d71092 100644 --- a/EDMI_FILE_OPs/Connected Services/EDMIServiceReference/DigitalData.Services.EDMService.wsdl +++ b/EDMI_FILE_OPs/Connected Services/EDMIServiceReference/DigitalData.Services.EDMService.wsdl @@ -9,6 +9,12 @@ + + + + + + @@ -64,6 +70,10 @@ + + + + diff --git a/EDMI_FILE_OPs/Connected Services/EDMIServiceReference/DigitalData.Services.EDMService.xsd b/EDMI_FILE_OPs/Connected Services/EDMIServiceReference/DigitalData.Services.EDMService.xsd index dcec368e..29f05a8b 100644 --- a/EDMI_FILE_OPs/Connected Services/EDMIServiceReference/DigitalData.Services.EDMService.xsd +++ b/EDMI_FILE_OPs/Connected Services/EDMIServiceReference/DigitalData.Services.EDMService.xsd @@ -1,6 +1,18 @@  + + + + + + + + + + + + diff --git a/EDMI_FILE_OPs/Connected Services/EDMIServiceReference/Reference.vb b/EDMI_FILE_OPs/Connected Services/EDMIServiceReference/Reference.vb index 9d037d69..04d51826 100644 --- a/EDMI_FILE_OPs/Connected Services/EDMIServiceReference/Reference.vb +++ b/EDMI_FILE_OPs/Connected Services/EDMIServiceReference/Reference.vb @@ -427,6 +427,12 @@ Namespace EDMIServiceReference System.ServiceModel.ServiceContractAttribute([Namespace]:="http://DigitalData.Services.EDMService", ConfigurationName:="EDMIServiceReference.IEDMService")> _ Public Interface IEDMService + _ + Function Heartbeat() As Boolean + + _ + Function HeartbeatAsync() As System.Threading.Tasks.Task(Of Boolean) + _ Function CreateDatabaseRequest(ByVal Name As String, ByVal Debug As Boolean) As String @@ -513,6 +519,14 @@ Namespace EDMIServiceReference MyBase.New(binding, remoteAddress) End Sub + Public Function Heartbeat() As Boolean Implements EDMIServiceReference.IEDMService.Heartbeat + Return MyBase.Channel.Heartbeat + End Function + + Public Function HeartbeatAsync() As System.Threading.Tasks.Task(Of Boolean) Implements EDMIServiceReference.IEDMService.HeartbeatAsync + Return MyBase.Channel.HeartbeatAsync + End Function + Public Function CreateDatabaseRequest(ByVal Name As String, ByVal Debug As Boolean) As String Implements EDMIServiceReference.IEDMService.CreateDatabaseRequest Return MyBase.Channel.CreateDatabaseRequest(Name, Debug) End Function diff --git a/EDMI_FILE_OPs/Connected Services/EDMIServiceReference/service.wsdl b/EDMI_FILE_OPs/Connected Services/EDMIServiceReference/service.wsdl index 520b3f35..a655416c 100644 --- a/EDMI_FILE_OPs/Connected Services/EDMIServiceReference/service.wsdl +++ b/EDMI_FILE_OPs/Connected Services/EDMIServiceReference/service.wsdl @@ -39,6 +39,15 @@ + + + + + + + + + diff --git a/SERVICES/DDEDM_NetworkService/EDMService.vb b/SERVICES/DDEDM_NetworkService/EDMService.vb index 22cca182..5c670a1e 100644 --- a/SERVICES/DDEDM_NetworkService/EDMService.vb +++ b/SERVICES/DDEDM_NetworkService/EDMService.vb @@ -17,18 +17,25 @@ Public Class EDMService Private _request As Request = Nothing Private _debug As Boolean = False + Private _username As String Public Sub New() Dim oOperationContext As OperationContext = OperationContext.Current Dim oInstanceContext As InstanceContext = oOperationContext.InstanceContext Dim oUsername = oOperationContext.ServiceSecurityContext.WindowsIdentity.Name + _username = oUsername _logger = LogConfig.GetLogger() End Sub +#Region "Heartbeat" + Public Function Heartbeat() As Boolean Implements IEDMService.Heartbeat + Return True + End Function +#End Region #Region "Request" Public Function CreateDatabaseRequest(Name As String, Optional Debug As Boolean = False) As String Implements IEDMService.CreateDatabaseRequest - _request = New Request(Name, _session.Username, Database, Debug) + _request = New Request(Name, _username, Database, Debug) _debug = Debug _logger.Info("Creating request {0}/{1}", _request.Name, _request.RequestId) diff --git a/SERVICES/DDEDM_NetworkService/IEDMService.vb b/SERVICES/DDEDM_NetworkService/IEDMService.vb index 00aecbae..afc90e45 100644 --- a/SERVICES/DDEDM_NetworkService/IEDMService.vb +++ b/SERVICES/DDEDM_NetworkService/IEDMService.vb @@ -4,6 +4,11 @@ Imports DigitalData.Modules.Filesystem Interface IEDMService +#Region "Heartbeat" + + Function Heartbeat() As Boolean +#End Region + #Region "Database" Function CreateDatabaseRequest(Name As String, Optional Debug As Boolean = False) As String diff --git a/SERVICES/DDEDM_NetworkService/WindowsService.vb b/SERVICES/DDEDM_NetworkService/WindowsService.vb index 16830755..c6d2eb51 100644 --- a/SERVICES/DDEDM_NetworkService/WindowsService.vb +++ b/SERVICES/DDEDM_NetworkService/WindowsService.vb @@ -15,7 +15,6 @@ Public Class WindowsService Private _logger As Logger Private _db As Firebird Private _clientsConnected As Integer = 0 - Private _clients As New List(Of Session) Private _config As AppConfig Public Sub New() @@ -46,9 +45,6 @@ Public Class WindowsService _logger.Info("Successfully connected to database!") - AddHandler EDMService.ClientConnectedEvent, AddressOf EDMService_ClientConnected - AddHandler EDMService.ClientDisconnectedEvent, AddressOf EDMService_ClientDisonnected - EDMService.Database = _db EDMService.LogConfig = _logConfig EDMService.AppConfig = _config @@ -66,18 +62,6 @@ Public Class WindowsService End Try End Sub - Private Sub EDMService_ClientDisonnected(sender As Object, e As Session) - _clientsConnected -= 1 - _clients.Remove(e) - _logger.Info("Client {0}/{1} disconnected! Total {2}", e.Username, e.SessionId, _clientsConnected) - End Sub - - Private Sub EDMService_ClientConnected(sender As Object, e As Session) - _clientsConnected += 1 - _clients.Add(e) - _logger.Info("Client {0}/{1} connected! Total {2}", e.Username, e.SessionId, _clientsConnected) - End Sub - Protected Overrides Sub OnStop() If _serviceHost IsNot Nothing Then _serviceHost.Close()