diff --git a/DDMonorepo.sln b/DDMonorepo.sln index e3058c50..72d2dbb9 100644 --- a/DDMonorepo.sln +++ b/DDMonorepo.sln @@ -3,10 +3,47 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 VisualStudioVersion = 15.0.27703.2000 MinimumVisualStudioVersion = 10.0.40219.1 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Modules", "Modules", "{3E2008C8-27B1-41DD-9B1A-0C4029F6AECC}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "GUIs", "GUIs", "{8FFE925E-8B84-45F1-93CB-32B1C96F41EB}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Setups", "Setups", "{D887B4BE-E457-4E45-8E22-D086E92DD2B7}" +EndProject +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "EDMDesigner", "EDMDesigner\EDMDesigner.vbproj", "{5284F4E5-A6C1-4BCF-896F-3ABEA985B741}" +EndProject +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Modules.Logging", "Modules.Logging\Modules.Logging.vbproj", "{903B2D7D-3B80-4BE9-8713-7447B704E1B0}" +EndProject +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Modules.Windream", "Modules.Windream\Modules.Windream.vbproj", "{4C86DF8F-A280-40D4-85B0-10B1BF66C15C}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Services", "Services", "{7AF3F9C2-C939-4A08-95C1-0453207E298A}" +EndProject Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {5284F4E5-A6C1-4BCF-896F-3ABEA985B741}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5284F4E5-A6C1-4BCF-896F-3ABEA985B741}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5284F4E5-A6C1-4BCF-896F-3ABEA985B741}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5284F4E5-A6C1-4BCF-896F-3ABEA985B741}.Release|Any CPU.Build.0 = Release|Any CPU + {903B2D7D-3B80-4BE9-8713-7447B704E1B0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {903B2D7D-3B80-4BE9-8713-7447B704E1B0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {903B2D7D-3B80-4BE9-8713-7447B704E1B0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {903B2D7D-3B80-4BE9-8713-7447B704E1B0}.Release|Any CPU.Build.0 = Release|Any CPU + {4C86DF8F-A280-40D4-85B0-10B1BF66C15C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4C86DF8F-A280-40D4-85B0-10B1BF66C15C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4C86DF8F-A280-40D4-85B0-10B1BF66C15C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4C86DF8F-A280-40D4-85B0-10B1BF66C15C}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {5284F4E5-A6C1-4BCF-896F-3ABEA985B741} = {8FFE925E-8B84-45F1-93CB-32B1C96F41EB} + {903B2D7D-3B80-4BE9-8713-7447B704E1B0} = {3E2008C8-27B1-41DD-9B1A-0C4029F6AECC} + {4C86DF8F-A280-40D4-85B0-10B1BF66C15C} = {3E2008C8-27B1-41DD-9B1A-0C4029F6AECC} + EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {C1BE4090-A0FD-48AF-86CB-39099D14B286} EndGlobalSection diff --git a/EDMDesigner/App.config b/EDMDesigner/App.config new file mode 100644 index 00000000..1fe0fd64 --- /dev/null +++ b/EDMDesigner/App.config @@ -0,0 +1,50 @@ + + + + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/EDMDesigner/ClassCurrentUser.vb b/EDMDesigner/ClassCurrentUser.vb new file mode 100644 index 00000000..71ae8052 --- /dev/null +++ b/EDMDesigner/ClassCurrentUser.vb @@ -0,0 +1,16 @@ +Imports DD_FirebirdDLL + +Public Class ClassCurrentUser + Public Username As String + Public Language As String + + Private DB As ClassFirebird + + Public Sub New(DB As ClassFirebird) + Username = Environment.UserName + DB = DB + + Dim sql As String = $"SELECT FNGET_USER_ACCESS('edm','{Username}') FROM rdb$database" + Dim result = DB.ReturnScalar(sql) + End Sub +End Class diff --git a/EDMDesigner/ClassInit.vb b/EDMDesigner/ClassInit.vb new file mode 100644 index 00000000..89ad1ef4 --- /dev/null +++ b/EDMDesigner/ClassInit.vb @@ -0,0 +1,24 @@ +Imports System.IO +Imports DD_FirebirdDLL +Public Class ClassInit + Public Shared Function Init_user() + Try + USER_USERNAME = Environment.UserName + Dim sql = String.Format("select FNGET_USER_ACCESS('edm','{0}') from rdb$database", USER_USERNAME) + Dim result = ClassDBFirebird.ExecuteScalar(sql, LOGGERFilePath) + + sql = String.Format("SELECT * FROM VW_TBEDM_USER WHERE UPPER(LOGIN_NAME) = UPPER('{0}')", USER_USERNAME) + DT_USER = ClassDBFirebird.ReturnDatatable(sql, LOGGERFilePath) + If Not IsNothing(result) Then + If Not IsNothing(DT_USER) Then + USER_LANGUAGE = DT_USER.Rows(0).Item("LANGUAGE") + End If + Return result + Else + Return False + End If + Catch ex As Exception + + End Try + End Function +End Class diff --git a/EDMDesigner/ClassLogger.vb b/EDMDesigner/ClassLogger.vb new file mode 100644 index 00000000..b70761ad --- /dev/null +++ b/EDMDesigner/ClassLogger.vb @@ -0,0 +1,179 @@ +Imports NLog +Imports NLog.Config +Imports NLog.Targets +Imports NLog.Targets.Wrappers +Imports NLog.Targets.Wrappers.BufferingTargetWrapperOverflowAction + +Imports System.IO + +Public Class ClassLogger + Private Const FileNameFormat As String = "${shortdate}-${var:product}.log" + Private Const FileNameFormatDetail As String = "${shortdate}-${var:product}-Detail.log" + Private Const FileNameFormatDebug As String = "${shortdate}-${var:product}-Debug.log" + + Private Const TARGET_DEFAULT As String = "default" + Private Const TARGET_DEFAULT_EX As String = "defaultEx" + Private Const TARGET_DETAIL As String = "detail" + Private Const TARGET_DEBUG As String = "debug" + + Private Const defaultLogFormat As String = "${longdate}|${level:uppercase=true}|${logger}|${message}" + Private Const exceptionLogFormat As String = "${longdate}|${level:uppercase=true}|${logger}|${message}|${exception:format=message}|${exception:format=toString}" + + Private config As LoggingConfiguration + Private debugOn As Boolean = False + + Private ReadOnly failSafePath As String = Path.GetTempPath() + Private ReadOnly basePath As String = failSafePath + + Public Enum PathType As Integer + AppData = 0 + CurrentDirectory = 1 + CustomPath = 2 + End Enum + + Public LogFile As String + + + Public Property Debug As Boolean + Get + Return debugOn + End Get + Set(value As Boolean) + If debugOn <> value Then + debugOn = value + + If value = True Then + ActivateDebugLog() + Else + DeactivateDebugLog() + End If + End If + End Set + End Property + + ''' + ''' Initializes a new Logger for a specific "Product" + ''' + ''' An name that identifies the Logs + ''' The basepath to write logs to. Can be AppData, CurrentDirectory or CustomPath. + ''' If `logPath` is set to custom, this defines the custom logPath + Public Sub New(product As String, logPath As PathType, Optional customLogPath As String = Nothing) + If logPath = PathType.AppData Then + Dim appDataDir = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + basePath = Path.Combine(appDataDir, "Digital Data", product) + ElseIf logPath = PathType.CurrentDirectory Then + basePath = "Log" + Else 'Custom Path + basePath = customLogPath + End If + + config = New LoggingConfiguration() + config.Variables("product") = product + + config.AddTarget(TARGET_DEFAULT_EX, WrapTargetInBuffered(GetDefaultLogTargetWithExceptions(basePath))) + config.AddTarget(TARGET_DEFAULT, WrapTargetInBuffered(GetDefaultLogTarget(basePath))) + config.AddTarget(TARGET_DETAIL, WrapTargetInBuffered(GetDetailLogTarget(basePath))) + config.AddTarget(TARGET_DEBUG, WrapTargetInBuffered(GetDebugLogTarget(basePath))) + + AddDefaultLogTargets() + + LogManager.Configuration = config + End Sub + + Private Function WrapTargetInBuffered(target As FileTarget) As Target + Dim bufferedWrapper = New BufferingTargetWrapper() + + bufferedWrapper.WrappedTarget = target + + ' Number of log events to be buffered. When the limit is reached, + ' then a synchronous flush is performed. + bufferedWrapper.BufferSize = 100 + + ' Action to be taken when the buffer exceeds the set bufferSize. + bufferedWrapper.OverflowAction = Flush + + ' Timeout (in milliseconds) after a write, until the entire buffer + ' is asynchronously flushed. Use -1 to disable timed flushes. + bufferedWrapper.FlushTimeout = 100 + + Return bufferedWrapper + End Function + + + Private Sub ActivateDebugLog() + ' Clear Logging Rules + config.LoggingRules.Clear() + + ' Add default targets and debug target + AddDefaultLogTargets() + config.AddRuleForOneLevel(LogLevel.Debug, TARGET_DEBUG) + + ' Reload all running loggers + LogManager.ReconfigExistingLoggers() + End Sub + + Private Sub DeactivateDebugLog() + ' Clear Logging Rules + config.LoggingRules.Clear() + + ' Add default targets + AddDefaultLogTargets() + + ' Reload all running loggers + LogManager.ReconfigExistingLoggers() + End Sub + + Private Sub AddDefaultLogTargets() + config.AddRuleForOneLevel(LogLevel.Error, TARGET_DEFAULT_EX) + config.AddRuleForOneLevel(LogLevel.Fatal, TARGET_DEFAULT_EX) + config.AddRuleForOneLevel(LogLevel.Warn, TARGET_DEFAULT) + config.AddRuleForOneLevel(LogLevel.Info, TARGET_DETAIL) + End Sub + +#Region "Log Targets" + Private Function GetDefaultLogTarget(basePath As String) As FileTarget + Dim defaultFilePath As String = Path.Combine(basePath, FileNameFormat) + Dim defaultLog As New FileTarget() With { + .FileName = defaultFilePath, + .Layout = defaultLogFormat, + .MaxArchiveFiles = 30, + .KeepFileOpen = True + } + + Return defaultLog + End Function + Private Function GetDefaultLogTargetWithExceptions(basePath As String) As FileTarget + Dim defaultFilePath As String = Path.Combine(basePath, FileNameFormat) + Dim defaultLogWithExceptionData As New FileTarget() With { + .FileName = defaultFilePath, + .Layout = exceptionLogFormat, + .MaxArchiveFiles = 30, + .KeepFileOpen = True + } + + Return defaultLogWithExceptionData + End Function + Private Function GetDetailLogTarget(basePath As String) As FileTarget + Dim detailFilePath As String = Path.Combine(basePath, FileNameFormatDetail) + Dim detailLog As New FileTarget() With { + .FileName = detailFilePath, + .Layout = defaultLogFormat, + .MaxArchiveFiles = 1, + .KeepFileOpen = True + } + + Return detailLog + End Function + Private Function GetDebugLogTarget(basePath As String) As FileTarget + Dim debugFilePath As String = Path.Combine(basePath, FileNameFormatDebug) + Dim debugLog As New FileTarget() With { + .FileName = debugFilePath, + .Layout = defaultLogFormat, + .MaxArchiveFiles = 1, + .KeepFileOpen = True + } + + Return debugLog + End Function +#End Region +End Class diff --git a/EDMDesigner/EDMDesigner.vbproj b/EDMDesigner/EDMDesigner.vbproj new file mode 100644 index 00000000..dd114a1a --- /dev/null +++ b/EDMDesigner/EDMDesigner.vbproj @@ -0,0 +1,201 @@ + + + + + Debug + AnyCPU + {5284F4E5-A6C1-4BCF-896F-3ABEA985B741} + WinExe + EDMDesigner.My.MyApplication + EDMDesigner + EDMDesigner + 512 + WindowsForms + v4.6.1 + true + + + AnyCPU + true + full + true + true + bin\Debug\ + EDMDesigner.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + AnyCPU + pdbonly + false + true + true + bin\Release\ + EDMDesigner.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + On + + + Binary + + + Off + + + On + + + + ..\..\DDFirebirdDLL\DD_FirebirdDLL\bin\Debug\DD_FirebirdDLL.dll + + + + + + + + + + + + + + + + + + ..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.dll + + + ..\packages\EntityFramework.Firebird.6.1.0\lib\net452\EntityFramework.Firebird.dll + + + ..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll + + + ..\packages\FirebirdSql.Data.FirebirdClient.6.1.0\lib\net452\FirebirdSql.Data.FirebirdClient.dll + + + + ..\packages\NLog.4.5.8\lib\net45\NLog.dll + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + FrmConnection.vb + + + Form + + + Form + + + FrmMain.vb + Form + + + + + True + Application.myapp + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + + FrmConnection.vb + + + FrmMain.vb + + + + VbMyResourcesResXFileCodeGenerator + Resources.Designer.vb + My.Resources + Designer + + + + + MyApplicationCodeGenerator + Application.Designer.vb + + + + SettingsSingleFileGenerator + My + Settings.Designer.vb + + + Designer + + + Always + + + Designer + + + + + + + + + + + {903b2d7d-3b80-4be9-8713-7447b704e1b0} + Modules.Logging + + + {4c86df8f-a280-40d4-85b0-10b1bf66c15c} + Modules.Windream + + + + \ No newline at end of file diff --git a/EDMDesigner/FrmConnection.Designer.vb b/EDMDesigner/FrmConnection.Designer.vb new file mode 100644 index 00000000..4915e059 --- /dev/null +++ b/EDMDesigner/FrmConnection.Designer.vb @@ -0,0 +1,167 @@ + _ +Partial Class FrmConnection + 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.components = New System.ComponentModel.Container() + Me.FbDatasourceTextBox = New System.Windows.Forms.TextBox() + Me.FbDatabaseLocationTextBox = New System.Windows.Forms.TextBox() + Me.FbUserTextBox = New System.Windows.Forms.TextBox() + Me.FbPasswordTextBox = New System.Windows.Forms.TextBox() + Me.btnConnect = New System.Windows.Forms.Button() + Me.lblPW = New System.Windows.Forms.Label() + Me.Label3 = New System.Windows.Forms.Label() + Me.Label2 = New System.Windows.Forms.Label() + Me.Label1 = New System.Windows.Forms.Label() + Me.StatusStrip1 = New System.Windows.Forms.StatusStrip() + Me.lblConnectionStatus = New System.Windows.Forms.ToolStripStatusLabel() + Me.BehaviorManager1 = New DevExpress.Utils.Behaviors.BehaviorManager(Me.components) + Me.StatusStrip1.SuspendLayout() + CType(Me.BehaviorManager1, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + 'FbDatasourceTextBox + ' + Me.FbDatasourceTextBox.Location = New System.Drawing.Point(15, 64) + Me.FbDatasourceTextBox.Name = "FbDatasourceTextBox" + Me.FbDatasourceTextBox.Size = New System.Drawing.Size(227, 20) + Me.FbDatasourceTextBox.TabIndex = 2 + ' + 'FbDatabaseLocationTextBox + ' + Me.FbDatabaseLocationTextBox.Location = New System.Drawing.Point(15, 25) + Me.FbDatabaseLocationTextBox.Name = "FbDatabaseLocationTextBox" + Me.FbDatabaseLocationTextBox.Size = New System.Drawing.Size(682, 20) + Me.FbDatabaseLocationTextBox.TabIndex = 1 + ' + 'FbUserTextBox + ' + Me.FbUserTextBox.Location = New System.Drawing.Point(248, 64) + Me.FbUserTextBox.Name = "FbUserTextBox" + Me.FbUserTextBox.Size = New System.Drawing.Size(140, 20) + Me.FbUserTextBox.TabIndex = 3 + ' + 'FbPasswordTextBox + ' + Me.FbPasswordTextBox.Location = New System.Drawing.Point(394, 64) + Me.FbPasswordTextBox.Name = "FbPasswordTextBox" + Me.FbPasswordTextBox.Size = New System.Drawing.Size(86, 20) + Me.FbPasswordTextBox.TabIndex = 4 + ' + 'btnConnect + ' + Me.btnConnect.Location = New System.Drawing.Point(486, 62) + Me.btnConnect.Name = "btnConnect" + Me.btnConnect.Size = New System.Drawing.Size(211, 23) + Me.btnConnect.TabIndex = 5 + Me.btnConnect.Text = "Connect" + Me.btnConnect.UseVisualStyleBackColor = True + ' + 'lblPW + ' + Me.lblPW.AutoSize = True + Me.lblPW.Location = New System.Drawing.Point(391, 48) + Me.lblPW.Name = "lblPW" + Me.lblPW.Size = New System.Drawing.Size(28, 13) + Me.lblPW.TabIndex = 34 + Me.lblPW.Text = "PW:" + ' + 'Label3 + ' + Me.Label3.AutoSize = True + Me.Label3.Location = New System.Drawing.Point(245, 48) + Me.Label3.Name = "Label3" + Me.Label3.Size = New System.Drawing.Size(43, 13) + Me.Label3.TabIndex = 33 + Me.Label3.Text = "UserID:" + ' + 'Label2 + ' + Me.Label2.AutoSize = True + Me.Label2.Location = New System.Drawing.Point(12, 48) + Me.Label2.Name = "Label2" + Me.Label2.Size = New System.Drawing.Size(62, 13) + Me.Label2.TabIndex = 32 + Me.Label2.Text = "Datasource" + ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.Location = New System.Drawing.Point(12, 9) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(75, 13) + Me.Label1.TabIndex = 31 + Me.Label1.Text = "FDB-Location:" + ' + 'StatusStrip1 + ' + Me.StatusStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.lblConnectionStatus}) + Me.StatusStrip1.Location = New System.Drawing.Point(0, 196) + Me.StatusStrip1.Name = "StatusStrip1" + Me.StatusStrip1.Size = New System.Drawing.Size(710, 22) + Me.StatusStrip1.TabIndex = 40 + Me.StatusStrip1.Text = "StatusStrip1" + ' + 'lblConnectionStatus + ' + Me.lblConnectionStatus.Name = "lblConnectionStatus" + Me.lblConnectionStatus.Size = New System.Drawing.Size(114, 17) + Me.lblConnectionStatus.Text = "lblConnectionStatus" + ' + 'FrmConnection + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(710, 218) + Me.Controls.Add(Me.StatusStrip1) + Me.Controls.Add(Me.FbDatasourceTextBox) + Me.Controls.Add(Me.FbDatabaseLocationTextBox) + Me.Controls.Add(Me.FbUserTextBox) + Me.Controls.Add(Me.FbPasswordTextBox) + Me.Controls.Add(Me.btnConnect) + Me.Controls.Add(Me.lblPW) + Me.Controls.Add(Me.Label3) + Me.Controls.Add(Me.Label2) + Me.Controls.Add(Me.Label1) + Me.Name = "FrmConnection" + Me.Text = "FrmConnection" + Me.StatusStrip1.ResumeLayout(False) + Me.StatusStrip1.PerformLayout() + CType(Me.BehaviorManager1, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + + Friend WithEvents FbDatasourceTextBox As TextBox + Friend WithEvents FbDatabaseLocationTextBox As TextBox + Friend WithEvents FbUserTextBox As TextBox + Friend WithEvents FbPasswordTextBox As TextBox + Friend WithEvents btnConnect As Button + Friend WithEvents lblPW As Label + Friend WithEvents Label3 As Label + Friend WithEvents Label2 As Label + Friend WithEvents Label1 As Label + Friend WithEvents StatusStrip1 As StatusStrip + Friend WithEvents lblConnectionStatus As ToolStripStatusLabel + Friend WithEvents BehaviorManager1 As DevExpress.Utils.Behaviors.BehaviorManager +End Class diff --git a/EDMDesigner/FrmConnection.resx b/EDMDesigner/FrmConnection.resx new file mode 100644 index 00000000..a9f75ee1 --- /dev/null +++ b/EDMDesigner/FrmConnection.resx @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + 17, 17 + + + 134, 17 + + \ No newline at end of file diff --git a/EDMDesigner/FrmConnection.vb b/EDMDesigner/FrmConnection.vb new file mode 100644 index 00000000..406e72ef --- /dev/null +++ b/EDMDesigner/FrmConnection.vb @@ -0,0 +1,32 @@ +Imports DD_FirebirdDLL + +Public Class FrmConnection + Private Sub FrmConnection_Load(sender As Object, e As EventArgs) Handles MyBase.Load + FbDatabaseLocationTextBox.DataBindings.Add("Text", My.Settings, "fbDatabaseLocation") + FbDatasourceTextBox.DataBindings.Add("Text", My.Settings, "fbDatasource") + FbUserTextBox.DataBindings.Add("Text", My.Settings, "fbUser") + FbPasswordTextBox.DataBindings.Add("Text", My.Settings, "fbPassword") + End Sub + + Private Sub BtnConnect_Click(sender As Object, e As EventArgs) Handles btnConnect.Click + My.Settings.Save() + + Dim dbTest As New ClassFirebird(My.Settings.fbDatasource, My.Settings.fbDatabaseLocation, My.Settings.fbUser, My.Settings.fbPassword) + + If dbTest.ConnectionFailed Then + MsgBox("Connection failed!", MsgBoxStyle.Information, "Database Connection") + + lblConnectionStatus.Text = "No connection established" + lblConnectionStatus.BackColor = Color.Red + + DialogResult = DialogResult.None + Else + MsgBox("Connection successful!", MsgBoxStyle.Information, "Database Connection") + + lblConnectionStatus.Text = "Connection established!" + lblConnectionStatus.BackColor = Color.GreenYellow + + DialogResult = DialogResult.OK + End If + End Sub +End Class \ No newline at end of file diff --git a/EDMDesigner/FrmMain.vb b/EDMDesigner/FrmMain.vb new file mode 100644 index 00000000..0bc796a9 --- /dev/null +++ b/EDMDesigner/FrmMain.vb @@ -0,0 +1,150 @@ +Imports DD_FirebirdDLL +Imports Modules.Logging + +Public Class FrmMain + Private SelectedTable As Integer + Private Logger As NLog.Logger + Private LogWrapper As Logger + Private DB As ClassFirebird + + Private Sub CreateTableNodesFromDatatable(dt As DataTable) + ' Node der Datenbank erstellen + Dim dbNode As New TreeNode With { + .Text = My.Settings.fbDatabaseLocation + } + + ' Übernode für Tabellen erstellen + Dim tablesNode As New TreeNode With { + .Text = "Tabellen", + .Name = "TABLES" + } + + ' Nodes für Tabellen erstellen + Dim tableNodeList As New List(Of TreeNode) + + For Each row As DataRow In dt.Rows + Dim node As New TreeNode With { + .Text = row.Item("TABLE"), + .Tag = row.Item("TABLE_ID") + } + + tableNodeList.Add(node) + Next + + ' Nodes zusammenfügen + tablesNode.Nodes.AddRange(tableNodeList.ToArray) + dbNode.Nodes.Add(tablesNode) + + ' Nodes einhängen + treeViewMain.Nodes.Add(dbNode) + End Sub + + Private Function LoadTables() + Return DB.ReturnDatatable("SELECT DISTINCT T.TABLE_ID,T.""TABLE"" from VWEDM_TABLE_COLUMN T") + End Function + + Private Function DatabaseSettingsExist() + Return My.Settings.fbDatabaseLocation <> String.Empty And My.Settings.fbDatasource <> String.Empty And My.Settings.fbUser <> String.Empty And My.Settings.fbPassword <> String.Empty + End Function + + Private Sub Init() + DB = New ClassFirebird(My.Settings.fbDatasource, My.Settings.fbDatabaseLocation, My.Settings.fbUser, My.Settings.fbPassword) + + If DB.ConnectionFailed Then + MsgBox("Database connection failed. Please check the log.", vbCritical) + Exit Sub + End If + + ' Get info about the logged in user + CurrentUser = New ClassCurrentUser(DB) + + Dim dt As DataTable = LoadTables() + CreateTableNodesFromDatatable(dt) + End Sub + + + + Private Sub FrmMain_Load(sender As Object, e As EventArgs) Handles Me.Load + LogWrapper = New Logger("EDMDesigner", ClassLogger.PathType.CurrentDirectory) + + Logger = NLog.LogManager.GetCurrentClassLogger() + + Modules.Windream.Constants. + + Logger.Debug("DEBUG1") + Logger.Debug("DEBUG2") + Logger.Debug("DEBUG3") + LogWrapper.Debug = False + Logger.Debug("DEBUG4") + Logger.Debug("DEBUG5") + Logger.Debug("DEBUG6") + LogWrapper.Debug = True + Logger.Debug("DEBUG7") + Logger.Debug("DEBUG8") + Logger.Debug("DEBUG9") + + + Logger.Info("Starting EDMDesigner..") + + Logger.Error(New IO.FileNotFoundException("Central 66"), "This is Error!") + + ' Check for existing database credentials + While Not DatabaseSettingsExist() + Dim result As DialogResult = FrmConnection.ShowDialog() + If result = DialogResult.OK Then + Exit While + End If + End While + + Init() + End Sub + + Private Sub TreeViewMain_NodeMouseClick(sender As Object, e As TreeNodeMouseClickEventArgs) Handles treeViewMain.NodeMouseClick + If e.Button = MouseButtons.Right Then + SelectedTable = -1 + + ' Wenn kein Node geklickt wurde, aussteigen + If e.Node Is Nothing OrElse e.Node.Parent Is Nothing Then + Exit Sub + End If + + Dim parentName As String = e.Node.Parent.Name + + ' Das Kontextmenü für den angeklickten Node öffnen + Select Case parentName + Case "TABLES" + SelectedTable = e.Node.Tag + contextMenuTable.Show(MousePosition) + End Select + + treeViewMain.SelectedNode = e.Node + End If + End Sub + + Private Sub SpaltenBearbeitenToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles SpaltenBearbeitenToolStripMenuItem.Click + Dim dt As DataTable = DB.ReturnDatatable($"SELECT * FROM VWEDM_TABLE_COLUMN WHERE TABLE_ID = {SelectedTable}") + gridControlTableProperties.DataSource = dt + End Sub + + Private Sub TabelleBearbeitenToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles TabelleBearbeitenToolStripMenuItem.Click + + End Sub + + Private Sub DebugAnToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles DebugAnToolStripMenuItem.Click + LogWrapper.Debug = True + End Sub + + Private Sub DebugAusToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles DebugAusToolStripMenuItem.Click + LogWrapper.Debug = False + End Sub + + Private Sub WriteDebugLogToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles WriteDebugLogToolStripMenuItem.Click + Logger.Debug("Welcome to monkey island!") + End Sub + + Private Sub SpamTheLogToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles SpamTheLogToolStripMenuItem.Click + For index = 1 To 100000 + Logger.Debug("Spam No. {0}", index) + Next + End Sub +End Class diff --git a/EDMDesigner/ModuleRuntimeVariables.vb b/EDMDesigner/ModuleRuntimeVariables.vb new file mode 100644 index 00000000..52caf268 --- /dev/null +++ b/EDMDesigner/ModuleRuntimeVariables.vb @@ -0,0 +1,9 @@ +Module ModuleRuntimeVariables + Public LOGGERFilePath As String + Public DT_USER As DataTable + Public USER_USERNAME As String + Public USER_LANGUAGE As String = "de-DE" + + + Public CurrentUser As ClassCurrentUser +End Module diff --git a/EDMDesigner/My Project/Application.Designer.vb b/EDMDesigner/My Project/Application.Designer.vb new file mode 100644 index 00000000..a76004e6 --- /dev/null +++ b/EDMDesigner/My Project/Application.Designer.vb @@ -0,0 +1,38 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:4.0.30319.42000 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +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. + ' + Partial Friend Class MyApplication + + _ + Public Sub New() + MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) + Me.IsSingleInstance = false + Me.EnableVisualStyles = true + Me.SaveMySettingsOnExit = true + Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses + End Sub + + _ + Protected Overrides Sub OnCreateMainForm() + Me.MainForm = Global.EDMDesigner.FrmMain + End Sub + End Class +End Namespace diff --git a/EDMDesigner/My Project/Application.myapp b/EDMDesigner/My Project/Application.myapp new file mode 100644 index 00000000..1243847f --- /dev/null +++ b/EDMDesigner/My Project/Application.myapp @@ -0,0 +1,11 @@ + + + true + Form1 + false + 0 + true + 0 + 0 + true + diff --git a/EDMDesigner/My Project/AssemblyInfo.vb b/EDMDesigner/My Project/AssemblyInfo.vb new file mode 100644 index 00000000..d8e372d0 --- /dev/null +++ b/EDMDesigner/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/EDMDesigner/My Project/DataSources/EDMDesigner.My.MySettings.datasource b/EDMDesigner/My Project/DataSources/EDMDesigner.My.MySettings.datasource new file mode 100644 index 00000000..0b2f5839 --- /dev/null +++ b/EDMDesigner/My Project/DataSources/EDMDesigner.My.MySettings.datasource @@ -0,0 +1,10 @@ + + + + EDMDesigner.My.MySettings, My Project.Resources.Designer.vb.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + \ No newline at end of file diff --git a/EDMDesigner/My Project/Resources.Designer.vb b/EDMDesigner/My Project/Resources.Designer.vb new file mode 100644 index 00000000..c4873fec --- /dev/null +++ b/EDMDesigner/My Project/Resources.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 + +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("EDMDesigner.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 + + ''' + ''' Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. + ''' + Friend ReadOnly Property database_link() As System.Drawing.Bitmap + Get + Dim obj As Object = ResourceManager.GetObject("database_link", resourceCulture) + Return CType(obj,System.Drawing.Bitmap) + End Get + End Property + End Module +End Namespace diff --git a/EDMDesigner/My Project/Resources.resx b/EDMDesigner/My Project/Resources.resx new file mode 100644 index 00000000..3ec55bff --- /dev/null +++ b/EDMDesigner/My Project/Resources.resx @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + ..\Resources\database_link.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + \ No newline at end of file diff --git a/EDMDesigner/My Project/Settings.Designer.vb b/EDMDesigner/My Project/Settings.Designer.vb new file mode 100644 index 00000000..e79b20fa --- /dev/null +++ b/EDMDesigner/My Project/Settings.Designer.vb @@ -0,0 +1,121 @@ +'------------------------------------------------------------------------------ +' +' 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 + + _ + Public Property fbDatasource() As String + Get + Return CType(Me("fbDatasource"),String) + End Get + Set + Me("fbDatasource") = value + End Set + End Property + + _ + Public Property fbUser() As String + Get + Return CType(Me("fbUser"),String) + End Get + Set + Me("fbUser") = value + End Set + End Property + + _ + Public Property fbPassword() As String + Get + Return CType(Me("fbPassword"),String) + End Get + Set + Me("fbPassword") = value + End Set + End Property + + _ + Public Property fbDatabaseLocation() As String + Get + Return CType(Me("fbDatabaseLocation"),String) + End Get + Set + Me("fbDatabaseLocation") = value + End Set + End Property + End Class +End Namespace + +Namespace My + + _ + Friend Module MySettingsProperty + + _ + Friend ReadOnly Property Settings() As Global.EDMDesigner.My.MySettings + Get + Return Global.EDMDesigner.My.MySettings.Default + End Get + End Property + End Module +End Namespace diff --git a/EDMDesigner/My Project/Settings.settings b/EDMDesigner/My Project/Settings.settings new file mode 100644 index 00000000..6ed66239 --- /dev/null +++ b/EDMDesigner/My Project/Settings.settings @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/EDMDesigner/My Project/licenses.licx b/EDMDesigner/My Project/licenses.licx new file mode 100644 index 00000000..ac169473 --- /dev/null +++ b/EDMDesigner/My Project/licenses.licx @@ -0,0 +1,6 @@ +DevExpress.XtraGrid.GridControl, DevExpress.XtraGrid.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.XtraWizard.WizardControl, DevExpress.XtraWizard.v18.1, Version=18.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a +DevExpress.XtraTreeList.TreeList, DevExpress.XtraTreeList.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 diff --git a/EDMDesigner/My Project/licenses.licx.bak b/EDMDesigner/My Project/licenses.licx.bak new file mode 100644 index 00000000..2d94c5a8 --- /dev/null +++ b/EDMDesigner/My Project/licenses.licx.bak @@ -0,0 +1,2 @@ +DevExpress.XtraBars.Docking.DockManager, DevExpress.XtraBars.v15.2, Version=15.2.16.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a +DevExpress.XtraGrid.GridControl, DevExpress.XtraGrid.v15.2, Version=15.2.16.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a diff --git a/EDMDesigner/Resources/database_link.png b/EDMDesigner/Resources/database_link.png new file mode 100644 index 00000000..4c8204af Binary files /dev/null and b/EDMDesigner/Resources/database_link.png differ diff --git a/EDMDesigner/frmMain.Designer.vb b/EDMDesigner/frmMain.Designer.vb new file mode 100644 index 00000000..168f2445 --- /dev/null +++ b/EDMDesigner/frmMain.Designer.vb @@ -0,0 +1,327 @@ + +Partial Class FrmMain + 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.components = New System.ComponentModel.Container() + Dim DockingContainer1 As DevExpress.XtraBars.Docking2010.Views.Tabbed.DockingContainer = New DevExpress.XtraBars.Docking2010.Views.Tabbed.DockingContainer() + Me.DocumentGroup1 = New DevExpress.XtraBars.Docking2010.Views.Tabbed.DocumentGroup(Me.components) + Me.Document1 = New DevExpress.XtraBars.Docking2010.Views.Tabbed.Document(Me.components) + Me.StatusStrip1 = New System.Windows.Forms.StatusStrip() + Me.ToolStripStatusLabelConState = New System.Windows.Forms.ToolStripStatusLabel() + Me.treeViewMain = New System.Windows.Forms.TreeView() + Me.gridControlTableProperties = New DevExpress.XtraGrid.GridControl() + Me.gridViewTableProperties = New DevExpress.XtraGrid.Views.Grid.GridView() + Me.MySettingsBindingSource = New System.Windows.Forms.BindingSource(Me.components) + Me.contextMenuTable = New System.Windows.Forms.ContextMenuStrip(Me.components) + Me.TabelleBearbeitenToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() + Me.TabelleLöschenToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() + Me.ToolStripSeparator1 = New System.Windows.Forms.ToolStripSeparator() + Me.SpaltenBearbeitenToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() + Me.NeueSpalteToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() + Me.MenuStrip1 = New System.Windows.Forms.MenuStrip() + Me.DebugToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() + Me.DebugAnToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() + Me.DebugAusToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() + Me.WriteDebugLogToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() + Me.DockManager1 = New DevExpress.XtraBars.Docking.DockManager(Me.components) + Me.DockPanel1 = New DevExpress.XtraBars.Docking.DockPanel() + Me.DockPanel1_Container = New DevExpress.XtraBars.Docking.ControlContainer() + Me.DockPanel2 = New DevExpress.XtraBars.Docking.DockPanel() + Me.DockPanel2_Container = New DevExpress.XtraBars.Docking.ControlContainer() + Me.DocumentManager1 = New DevExpress.XtraBars.Docking2010.DocumentManager(Me.components) + Me.TabbedView1 = New DevExpress.XtraBars.Docking2010.Views.Tabbed.TabbedView(Me.components) + Me.SpamTheLogToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() + CType(Me.DocumentGroup1, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.Document1, System.ComponentModel.ISupportInitialize).BeginInit() + Me.StatusStrip1.SuspendLayout() + CType(Me.gridControlTableProperties, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.gridViewTableProperties, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.MySettingsBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() + Me.contextMenuTable.SuspendLayout() + Me.MenuStrip1.SuspendLayout() + CType(Me.DockManager1, System.ComponentModel.ISupportInitialize).BeginInit() + Me.DockPanel1.SuspendLayout() + Me.DockPanel1_Container.SuspendLayout() + Me.DockPanel2.SuspendLayout() + Me.DockPanel2_Container.SuspendLayout() + CType(Me.DocumentManager1, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.TabbedView1, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + 'DocumentGroup1 + ' + Me.DocumentGroup1.Items.AddRange(New DevExpress.XtraBars.Docking2010.Views.Tabbed.Document() {Me.Document1}) + ' + 'Document1 + ' + Me.Document1.Caption = "DockPanel2" + Me.Document1.ControlName = "DockPanel2" + Me.Document1.FloatLocation = New System.Drawing.Point(-1910, 9) + Me.Document1.FloatSize = New System.Drawing.Size(200, 200) + Me.Document1.Properties.AllowClose = DevExpress.Utils.DefaultBoolean.[False] + Me.Document1.Properties.AllowFloat = DevExpress.Utils.DefaultBoolean.[True] + Me.Document1.Properties.AllowFloatOnDoubleClick = DevExpress.Utils.DefaultBoolean.[True] + ' + 'StatusStrip1 + ' + Me.StatusStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToolStripStatusLabelConState}) + Me.StatusStrip1.Location = New System.Drawing.Point(0, 509) + Me.StatusStrip1.Name = "StatusStrip1" + Me.StatusStrip1.Size = New System.Drawing.Size(955, 22) + Me.StatusStrip1.TabIndex = 0 + Me.StatusStrip1.Text = "StatusStrip1" + ' + 'ToolStripStatusLabelConState + ' + Me.ToolStripStatusLabelConState.Image = Global.EDMDesigner.My.Resources.Resources.database_link + Me.ToolStripStatusLabelConState.Name = "ToolStripStatusLabelConState" + Me.ToolStripStatusLabelConState.Size = New System.Drawing.Size(166, 17) + Me.ToolStripStatusLabelConState.Text = "No Connection established" + ' + 'treeViewMain + ' + Me.treeViewMain.Dock = System.Windows.Forms.DockStyle.Fill + Me.treeViewMain.Location = New System.Drawing.Point(0, 0) + Me.treeViewMain.Name = "treeViewMain" + Me.treeViewMain.Size = New System.Drawing.Size(191, 458) + Me.treeViewMain.TabIndex = 0 + ' + 'gridControlTableProperties + ' + Me.gridControlTableProperties.Dock = System.Windows.Forms.DockStyle.Fill + Me.gridControlTableProperties.Location = New System.Drawing.Point(0, 0) + Me.gridControlTableProperties.MainView = Me.gridViewTableProperties + Me.gridControlTableProperties.Name = "gridControlTableProperties" + Me.gridControlTableProperties.Size = New System.Drawing.Size(749, 457) + Me.gridControlTableProperties.TabIndex = 0 + Me.gridControlTableProperties.ViewCollection.AddRange(New DevExpress.XtraGrid.Views.Base.BaseView() {Me.gridViewTableProperties}) + ' + 'gridViewTableProperties + ' + Me.gridViewTableProperties.GridControl = Me.gridControlTableProperties + Me.gridViewTableProperties.Name = "gridViewTableProperties" + ' + 'MySettingsBindingSource + ' + Me.MySettingsBindingSource.DataSource = GetType(System.Configuration.ApplicationSettingsBase) + ' + 'contextMenuTable + ' + Me.contextMenuTable.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.TabelleBearbeitenToolStripMenuItem, Me.TabelleLöschenToolStripMenuItem, Me.ToolStripSeparator1, Me.SpaltenBearbeitenToolStripMenuItem, Me.NeueSpalteToolStripMenuItem}) + Me.contextMenuTable.Name = "contextMenuTable" + Me.contextMenuTable.Size = New System.Drawing.Size(179, 98) + ' + 'TabelleBearbeitenToolStripMenuItem + ' + Me.TabelleBearbeitenToolStripMenuItem.Name = "TabelleBearbeitenToolStripMenuItem" + Me.TabelleBearbeitenToolStripMenuItem.Size = New System.Drawing.Size(178, 22) + Me.TabelleBearbeitenToolStripMenuItem.Text = "Tabelle bearbeiten.." + ' + 'TabelleLöschenToolStripMenuItem + ' + Me.TabelleLöschenToolStripMenuItem.Name = "TabelleLöschenToolStripMenuItem" + Me.TabelleLöschenToolStripMenuItem.Size = New System.Drawing.Size(178, 22) + Me.TabelleLöschenToolStripMenuItem.Text = "Tabelle löschen.." + ' + 'ToolStripSeparator1 + ' + Me.ToolStripSeparator1.Name = "ToolStripSeparator1" + Me.ToolStripSeparator1.Size = New System.Drawing.Size(175, 6) + ' + 'SpaltenBearbeitenToolStripMenuItem + ' + Me.SpaltenBearbeitenToolStripMenuItem.Name = "SpaltenBearbeitenToolStripMenuItem" + Me.SpaltenBearbeitenToolStripMenuItem.Size = New System.Drawing.Size(178, 22) + Me.SpaltenBearbeitenToolStripMenuItem.Text = "Spalten bearbeiten.." + ' + 'NeueSpalteToolStripMenuItem + ' + Me.NeueSpalteToolStripMenuItem.Name = "NeueSpalteToolStripMenuItem" + Me.NeueSpalteToolStripMenuItem.Size = New System.Drawing.Size(178, 22) + Me.NeueSpalteToolStripMenuItem.Text = "Neue Spalte.." + ' + 'MenuStrip1 + ' + Me.MenuStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.DebugToolStripMenuItem, Me.WriteDebugLogToolStripMenuItem, Me.SpamTheLogToolStripMenuItem}) + Me.MenuStrip1.Location = New System.Drawing.Point(0, 0) + Me.MenuStrip1.Name = "MenuStrip1" + Me.MenuStrip1.Size = New System.Drawing.Size(955, 24) + Me.MenuStrip1.TabIndex = 1 + Me.MenuStrip1.Text = "MenuStrip1" + ' + 'DebugToolStripMenuItem + ' + Me.DebugToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.DebugAnToolStripMenuItem, Me.DebugAusToolStripMenuItem}) + Me.DebugToolStripMenuItem.Name = "DebugToolStripMenuItem" + Me.DebugToolStripMenuItem.Size = New System.Drawing.Size(54, 20) + Me.DebugToolStripMenuItem.Text = "Debug" + ' + 'DebugAnToolStripMenuItem + ' + Me.DebugAnToolStripMenuItem.Name = "DebugAnToolStripMenuItem" + Me.DebugAnToolStripMenuItem.Size = New System.Drawing.Size(132, 22) + Me.DebugAnToolStripMenuItem.Text = "Debug An" + ' + 'DebugAusToolStripMenuItem + ' + Me.DebugAusToolStripMenuItem.Name = "DebugAusToolStripMenuItem" + Me.DebugAusToolStripMenuItem.Size = New System.Drawing.Size(132, 22) + Me.DebugAusToolStripMenuItem.Text = "Debug Aus" + ' + 'WriteDebugLogToolStripMenuItem + ' + Me.WriteDebugLogToolStripMenuItem.Name = "WriteDebugLogToolStripMenuItem" + Me.WriteDebugLogToolStripMenuItem.Size = New System.Drawing.Size(108, 20) + Me.WriteDebugLogToolStripMenuItem.Text = "Write Debug Log" + ' + 'DockManager1 + ' + Me.DockManager1.Form = Me + Me.DockManager1.RootPanels.AddRange(New DevExpress.XtraBars.Docking.DockPanel() {Me.DockPanel1, Me.DockPanel2}) + Me.DockManager1.TopZIndexControls.AddRange(New String() {"DevExpress.XtraBars.BarDockControl", "DevExpress.XtraBars.StandaloneBarDockControl", "System.Windows.Forms.StatusBar", "System.Windows.Forms.MenuStrip", "System.Windows.Forms.StatusStrip", "DevExpress.XtraBars.Ribbon.RibbonStatusBar", "DevExpress.XtraBars.Ribbon.RibbonControl", "DevExpress.XtraBars.Navigation.OfficeNavigationBar", "DevExpress.XtraBars.Navigation.TileNavPane", "DevExpress.XtraBars.TabFormControl", "DevExpress.XtraBars.FluentDesignSystem.FluentDesignFormControl"}) + ' + 'DockPanel1 + ' + Me.DockPanel1.Controls.Add(Me.DockPanel1_Container) + Me.DockPanel1.Dock = DevExpress.XtraBars.Docking.DockingStyle.Left + Me.DockPanel1.ID = New System.Guid("f88fafa6-e45c-4fbf-9675-b590ab7ad0b3") + Me.DockPanel1.Location = New System.Drawing.Point(0, 24) + Me.DockPanel1.Name = "DockPanel1" + Me.DockPanel1.Options.ShowCloseButton = False + Me.DockPanel1.OriginalSize = New System.Drawing.Size(200, 200) + Me.DockPanel1.SavedSizeFactor = 0R + Me.DockPanel1.Size = New System.Drawing.Size(200, 485) + Me.DockPanel1.Text = "Datenbank" + ' + 'DockPanel1_Container + ' + Me.DockPanel1_Container.Controls.Add(Me.treeViewMain) + Me.DockPanel1_Container.Location = New System.Drawing.Point(4, 23) + Me.DockPanel1_Container.Name = "DockPanel1_Container" + Me.DockPanel1_Container.Size = New System.Drawing.Size(191, 458) + Me.DockPanel1_Container.TabIndex = 0 + ' + 'DockPanel2 + ' + Me.DockPanel2.Controls.Add(Me.DockPanel2_Container) + Me.DockPanel2.Dock = DevExpress.XtraBars.Docking.DockingStyle.Float + Me.DockPanel2.DockedAsTabbedDocument = True + Me.DockPanel2.FloatLocation = New System.Drawing.Point(-1910, 9) + Me.DockPanel2.ID = New System.Guid("01f09f00-3eb4-4caa-b31c-cbe38c6e45b3") + Me.DockPanel2.Location = New System.Drawing.Point(0, 0) + Me.DockPanel2.Name = "DockPanel2" + Me.DockPanel2.Options.ShowCloseButton = False + Me.DockPanel2.OriginalSize = New System.Drawing.Size(200, 200) + Me.DockPanel2.SavedSizeFactor = 1.0R + Me.DockPanel2.Size = New System.Drawing.Size(749, 457) + Me.DockPanel2.Text = "DockPanel2" + ' + 'DockPanel2_Container + ' + Me.DockPanel2_Container.Controls.Add(Me.gridControlTableProperties) + Me.DockPanel2_Container.Location = New System.Drawing.Point(0, 0) + Me.DockPanel2_Container.Name = "DockPanel2_Container" + Me.DockPanel2_Container.Size = New System.Drawing.Size(749, 457) + Me.DockPanel2_Container.TabIndex = 0 + ' + 'DocumentManager1 + ' + Me.DocumentManager1.ContainerControl = Me + Me.DocumentManager1.View = Me.TabbedView1 + Me.DocumentManager1.ViewCollection.AddRange(New DevExpress.XtraBars.Docking2010.Views.BaseView() {Me.TabbedView1}) + ' + 'TabbedView1 + ' + Me.TabbedView1.DocumentGroups.AddRange(New DevExpress.XtraBars.Docking2010.Views.Tabbed.DocumentGroup() {Me.DocumentGroup1}) + Me.TabbedView1.Documents.AddRange(New DevExpress.XtraBars.Docking2010.Views.BaseDocument() {Me.Document1}) + DockingContainer1.Element = Me.DocumentGroup1 + Me.TabbedView1.RootContainer.Nodes.AddRange(New DevExpress.XtraBars.Docking2010.Views.Tabbed.DockingContainer() {DockingContainer1}) + ' + 'SpamTheLogToolStripMenuItem + ' + Me.SpamTheLogToolStripMenuItem.Name = "SpamTheLogToolStripMenuItem" + Me.SpamTheLogToolStripMenuItem.Size = New System.Drawing.Size(95, 20) + Me.SpamTheLogToolStripMenuItem.Text = "Spam the Log!" + ' + 'FrmMain + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(955, 531) + Me.Controls.Add(Me.DockPanel1) + Me.Controls.Add(Me.StatusStrip1) + Me.Controls.Add(Me.MenuStrip1) + Me.Font = New System.Drawing.Font("Tahoma", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.MainMenuStrip = Me.MenuStrip1 + Me.Name = "FrmMain" + Me.Text = "EDM Designer" + CType(Me.DocumentGroup1, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.Document1, System.ComponentModel.ISupportInitialize).EndInit() + Me.StatusStrip1.ResumeLayout(False) + Me.StatusStrip1.PerformLayout() + CType(Me.gridControlTableProperties, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.gridViewTableProperties, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.MySettingsBindingSource, System.ComponentModel.ISupportInitialize).EndInit() + Me.contextMenuTable.ResumeLayout(False) + Me.MenuStrip1.ResumeLayout(False) + Me.MenuStrip1.PerformLayout() + CType(Me.DockManager1, System.ComponentModel.ISupportInitialize).EndInit() + Me.DockPanel1.ResumeLayout(False) + Me.DockPanel1_Container.ResumeLayout(False) + Me.DockPanel2.ResumeLayout(False) + Me.DockPanel2_Container.ResumeLayout(False) + CType(Me.DocumentManager1, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.TabbedView1, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + + Friend WithEvents StatusStrip1 As StatusStrip + Friend WithEvents treeViewMain As TreeView + Friend WithEvents ToolStripStatusLabelConState As ToolStripStatusLabel + Friend WithEvents gridControlTableProperties As DevExpress.XtraGrid.GridControl + Friend WithEvents gridViewTableProperties As DevExpress.XtraGrid.Views.Grid.GridView + Friend WithEvents contextMenuTable As ContextMenuStrip + Friend WithEvents TabelleBearbeitenToolStripMenuItem As ToolStripMenuItem + Friend WithEvents TabelleLöschenToolStripMenuItem As ToolStripMenuItem + Friend WithEvents ToolStripSeparator1 As ToolStripSeparator + Friend WithEvents SpaltenBearbeitenToolStripMenuItem As ToolStripMenuItem + Friend WithEvents NeueSpalteToolStripMenuItem As ToolStripMenuItem + Friend WithEvents MySettingsBindingSource As BindingSource + Friend WithEvents MenuStrip1 As MenuStrip + Friend WithEvents DockManager1 As DevExpress.XtraBars.Docking.DockManager + Friend WithEvents DockPanel1 As DevExpress.XtraBars.Docking.DockPanel + Friend WithEvents DockPanel1_Container As DevExpress.XtraBars.Docking.ControlContainer + Friend WithEvents DockPanel2 As DevExpress.XtraBars.Docking.DockPanel + Friend WithEvents DockPanel2_Container As DevExpress.XtraBars.Docking.ControlContainer + Friend WithEvents DocumentManager1 As DevExpress.XtraBars.Docking2010.DocumentManager + Friend WithEvents TabbedView1 As DevExpress.XtraBars.Docking2010.Views.Tabbed.TabbedView + Friend WithEvents DocumentGroup1 As DevExpress.XtraBars.Docking2010.Views.Tabbed.DocumentGroup + Friend WithEvents Document1 As DevExpress.XtraBars.Docking2010.Views.Tabbed.Document + Friend WithEvents DebugToolStripMenuItem As ToolStripMenuItem + Friend WithEvents DebugAnToolStripMenuItem As ToolStripMenuItem + Friend WithEvents DebugAusToolStripMenuItem As ToolStripMenuItem + Friend WithEvents WriteDebugLogToolStripMenuItem As ToolStripMenuItem + Friend WithEvents SpamTheLogToolStripMenuItem As ToolStripMenuItem +End Class diff --git a/EDMDesigner/frmMain.resx b/EDMDesigner/frmMain.resx new file mode 100644 index 00000000..230f4e9e --- /dev/null +++ b/EDMDesigner/frmMain.resx @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + 17, 17 + + + 422, 17 + + + 134, 17 + + + 613, 17 + + + 287, 17 + + + 728, 17 + + \ No newline at end of file diff --git a/EDMDesigner/nlog.config b/EDMDesigner/nlog.config new file mode 100644 index 00000000..78d910a1 --- /dev/null +++ b/EDMDesigner/nlog.config @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/EDMDesigner/packages.config b/EDMDesigner/packages.config new file mode 100644 index 00000000..59561d12 --- /dev/null +++ b/EDMDesigner/packages.config @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/Modules.Logging/Constants.vb b/Modules.Logging/Constants.vb new file mode 100644 index 00000000..ea428f0e --- /dev/null +++ b/Modules.Logging/Constants.vb @@ -0,0 +1,8 @@ +''' +''' Keeps the constants needed for the Logger +''' +Public Class Constants + Public Const KEEP_FILES_OPEN As Boolean = False + Public Const MAX_ARCHIVE_FILES_DEFAULT As Integer = 30 + Public Const MAX_ARCHIVE_FILES_DEBUG_DETAIL As Integer = 1 +End Class diff --git a/Modules.Logging/Logger.vb b/Modules.Logging/Logger.vb new file mode 100644 index 00000000..44a903e2 --- /dev/null +++ b/Modules.Logging/Logger.vb @@ -0,0 +1,212 @@ +Imports System.IO + +Imports NLog +Imports NLog.Config +Imports NLog.Targets + +''' +''' MODULE: Logger +''' +''' VERSION: 0.0.0.1 +''' +''' DATE: 13.08.2018 +''' +''' DESCRIPTION: Module that writes file-logs to different locations: +''' local application data, the current directory or a custom path. +''' Files and directories will be automatically created. +''' +''' Three different logfiles will be generated +''' +''' DEPENDENCIES: NLog, >= 4.5.8 +''' +''' PARAMETERS: product, String +''' logPath, PathType +''' customLogPath, String (optional) +''' +''' PROPERTIES: LogFile, String (readonly) +''' LogPath, String (readonly) +''' Debug, Boolean +''' +Public Class Logger + Private Const FILE_NAME_FORMAT_DEFAULT As String = "${shortdate}-${var:product}.log" + Private Const FILE_NAME_FORMAT_DETAIL As String = "${shortdate}-${var:product}-Detail.log" + Private Const FILE_NAME_FORMAT_DEBUG As String = "${shortdate}-${var:product}-Debug.log" + + Private Const TARGET_DEFAULT As String = "default" + Private Const TARGET_DEFAULT_EX As String = "defaultEx" + Private Const TARGET_DETAIL As String = "detail" + Private Const TARGET_DEBUG As String = "debug" + + Private Const LOG_FORMAT_DEFAULT As String = "${longdate}|${level:uppercase=true}|${logger}|${message}" + Private Const LOG_FORMAT_EXCEPTION As String = LOG_FORMAT_DEFAULT & "|${exception:format=message}|${exception:format=toString}" + + Private config As LoggingConfiguration + Private isDebug As Boolean = False + + Private ReadOnly failSafePath As String = Path.GetTempPath() + Private ReadOnly basePath As String = failSafePath + + Public Enum PathType As Integer + AppData = 0 + CurrentDirectory = 1 + CustomPath = 2 + End Enum + + ''' + ''' Returns the path to the current default logfile + ''' + ''' Filepath to the logfile + Public ReadOnly Property LogFile As String + + ''' + ''' Returns the path to the current log directory + ''' + ''' Directory path to the log directory + Public ReadOnly Property LogDirectory As String + + ''' + ''' Determines if a debug log will be written + ''' + ''' True, if debug log will be written. False otherwise. + Public Property Debug As Boolean + Get + Return isDebug + End Get + Set(isDebug As Boolean) + Me.isDebug = isDebug + ReloadConfig(isDebug) + End Set + End Property + + ''' + ''' Initializes a new Logger for a specific `Product`. + ''' + ''' logPath configurations: + ''' - AppData: writes to local application data directory + ''' - CurrentDirectory: writes to `Log` directory relative to the current directory + ''' - CustomPath: writes to custom path specified in `customLogPath` + ''' + ''' An name that identifies the Logs + ''' The basepath to write logs to. Can be AppData, CurrentDirectory or CustomPath. + ''' If `logPath` is set to custom, this defines the custom logPath + Public Sub New(product As String, logPath As PathType, Optional customLogPath As String = Nothing) + If logPath = PathType.AppData Then + Dim appDataDir = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + basePath = Path.Combine(appDataDir, "Digital Data", product) + ElseIf logPath = PathType.CurrentDirectory Then + Dim currentDirectory As String = Environment.CurrentDirectory + basePath = Path.Combine(currentDirectory, "Log") + Else 'Custom Path + basePath = customLogPath + End If + + config = New LoggingConfiguration() + config.Variables("product") = product + + config.AddTarget(TARGET_DEFAULT_EX, GetDefaultLogTargetWithExceptions(basePath)) + config.AddTarget(TARGET_DEFAULT, GetDefaultLogTarget(basePath)) + config.AddTarget(TARGET_DETAIL, GetDetailLogTarget(basePath)) + config.AddTarget(TARGET_DEBUG, GetDebugLogTarget(basePath)) + + LogDirectory = basePath + LogFile = GetCurrentLogFilePath() + + AddDefaultLogTargets() + + LogManager.Configuration = config + End Sub + + ''' + ''' Returns the full path of the current default log file. + ''' + ''' Full path of the current default log file + Private Function GetCurrentLogFilePath() + Dim logEventInfo As New LogEventInfo() With {.TimeStamp = Date.Now} + Dim target As FileTarget = config.FindTargetByName(TARGET_DEFAULT) + Dim fileName As String = target.FileName.Render(logEventInfo) + + Return fileName + End Function + + ''' + ''' Reconfigures and re-adds all loggers, optionally adding the debug rule. + ''' + ''' Adds the Debug rule if true. + Private Sub ReloadConfig(Optional Debug As Boolean = False) + ' Clear Logging Rules + config.LoggingRules.Clear() + + ' Add default targets and debug target + AddDefaultLogTargets() + + If Debug Then + config.AddRuleForOneLevel(LogLevel.Debug, TARGET_DEBUG) + End If + + ' Reload all running loggers + LogManager.ReconfigExistingLoggers() + End Sub + + ''' + ''' Adds default rules + ''' + Private Sub AddDefaultLogTargets() + config.AddRuleForOneLevel(LogLevel.Error, TARGET_DEFAULT_EX) + config.AddRuleForOneLevel(LogLevel.Fatal, TARGET_DEFAULT_EX) + config.AddRuleForOneLevel(LogLevel.Warn, TARGET_DEFAULT) + config.AddRuleForOneLevel(LogLevel.Info, TARGET_DETAIL) + End Sub + +#Region "Log Targets" + Private Function GetDefaultLogTarget(basePath As String) As FileTarget + Dim defaultFilePath As String = Path.Combine(basePath, FILE_NAME_FORMAT_DEFAULT) + Dim defaultLog As New FileTarget() With { + .Name = TARGET_DEFAULT, + .FileName = defaultFilePath, + .Layout = LOG_FORMAT_DEFAULT, + .MaxArchiveFiles = 30, + .KeepFileOpen = Constants.KEEP_FILES_OPEN + } + + + + Return defaultLog + End Function + Private Function GetDefaultLogTargetWithExceptions(basePath As String) As FileTarget + Dim defaultFilePath As String = Path.Combine(basePath, FILE_NAME_FORMAT_DEFAULT) + Dim defaultLogWithExceptionData As New FileTarget() With { + .Name = TARGET_DEFAULT_EX, + .FileName = defaultFilePath, + .Layout = LOG_FORMAT_EXCEPTION, + .MaxArchiveFiles = 30, + .KeepFileOpen = Constants.KEEP_FILES_OPEN + } + + Return defaultLogWithExceptionData + End Function + Private Function GetDetailLogTarget(basePath As String) As FileTarget + Dim detailFilePath As String = Path.Combine(basePath, FILE_NAME_FORMAT_DETAIL) + Dim detailLog As New FileTarget() With { + .Name = TARGET_DETAIL, + .FileName = detailFilePath, + .Layout = LOG_FORMAT_DEFAULT, + .MaxArchiveFiles = 1, + .KeepFileOpen = Constants.KEEP_FILES_OPEN + } + + Return detailLog + End Function + Private Function GetDebugLogTarget(basePath As String) As FileTarget + Dim debugFilePath As String = Path.Combine(basePath, FILE_NAME_FORMAT_DEBUG) + Dim debugLog As New FileTarget() With { + .Name = TARGET_DEBUG, + .FileName = debugFilePath, + .Layout = LOG_FORMAT_DEFAULT, + .MaxArchiveFiles = 1, + .KeepFileOpen = Constants.KEEP_FILES_OPEN + } + + Return debugLog + End Function +#End Region +End Class diff --git a/Modules.Logging/Modules.Logging.vbproj b/Modules.Logging/Modules.Logging.vbproj new file mode 100644 index 00000000..3d375bac --- /dev/null +++ b/Modules.Logging/Modules.Logging.vbproj @@ -0,0 +1,114 @@ + + + + + Debug + AnyCPU + {903B2D7D-3B80-4BE9-8713-7447B704E1B0} + Library + Modules.Logging + Modules.Logging + 512 + Windows + v4.6.1 + + + true + full + true + true + bin\Debug\ + Modules.Logging.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + pdbonly + false + true + true + bin\Release\ + Modules.Logging.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + On + + + Binary + + + Off + + + On + + + + + ..\packages\NLog.4.5.8\lib\net45\NLog.dll + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + True + Application.myapp + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + + VbMyResourcesResXFileCodeGenerator + Resources.Designer.vb + My.Resources + Designer + + + + + MyApplicationCodeGenerator + Application.Designer.vb + + + SettingsSingleFileGenerator + My + Settings.Designer.vb + + + + + \ No newline at end of file diff --git a/Modules.Logging/My Project/Application.Designer.vb b/Modules.Logging/My Project/Application.Designer.vb new file mode 100644 index 00000000..88dd01c7 --- /dev/null +++ b/Modules.Logging/My Project/Application.Designer.vb @@ -0,0 +1,13 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:4.0.30319.42000 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + diff --git a/Modules.Logging/My Project/Application.myapp b/Modules.Logging/My Project/Application.myapp new file mode 100644 index 00000000..758895de --- /dev/null +++ b/Modules.Logging/My Project/Application.myapp @@ -0,0 +1,10 @@ + + + false + false + 0 + true + 0 + 1 + true + diff --git a/Modules.Logging/My Project/AssemblyInfo.vb b/Modules.Logging/My Project/AssemblyInfo.vb new file mode 100644 index 00000000..ee079d9d --- /dev/null +++ b/Modules.Logging/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.Logging/My Project/Resources.Designer.vb b/Modules.Logging/My Project/Resources.Designer.vb new file mode 100644 index 00000000..adb6e7d3 --- /dev/null +++ b/Modules.Logging/My Project/Resources.Designer.vb @@ -0,0 +1,62 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:4.0.30319.42000 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My.Resources + + 'This class was auto-generated by the StronglyTypedResourceBuilder + 'class via a tool like ResGen or Visual Studio. + 'To add or remove a member, edit your .ResX file then rerun ResGen + 'with the /str option, or rebuild your VS project. + ''' + ''' A strongly-typed resource class, for looking up localized strings, etc. + ''' + _ + Friend Module Resources + + Private resourceMan As Global.System.Resources.ResourceManager + + Private resourceCulture As Global.System.Globalization.CultureInfo + + ''' + ''' Returns the cached ResourceManager instance used by this class. + ''' + _ + 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("Modules.Logging.Resources", GetType(Resources).Assembly) + resourceMan = temp + End If + Return resourceMan + End Get + End Property + + ''' + ''' Overrides the current thread's CurrentUICulture property for all + ''' resource lookups using this strongly typed resource class. + ''' + _ + Friend Property Culture() As Global.System.Globalization.CultureInfo + Get + Return resourceCulture + End Get + Set(ByVal value As Global.System.Globalization.CultureInfo) + resourceCulture = value + End Set + End Property + End Module +End Namespace diff --git a/Modules.Logging/My Project/Resources.resx b/Modules.Logging/My Project/Resources.resx new file mode 100644 index 00000000..af7dbebb --- /dev/null +++ b/Modules.Logging/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.Logging/My Project/Settings.Designer.vb b/Modules.Logging/My Project/Settings.Designer.vb new file mode 100644 index 00000000..92b0a2a3 --- /dev/null +++ b/Modules.Logging/My Project/Settings.Designer.vb @@ -0,0 +1,73 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:4.0.30319.42000 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +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 "My.Settings Auto-Save Functionality" +#If _MyType = "WindowsForms" Then + Private Shared addedHandler As Boolean + + Private Shared addedHandlerLockObject As New Object + + _ + Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal 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.Modules.Logging.My.MySettings + Get + Return Global.Modules.Logging.My.MySettings.Default + End Get + End Property + End Module +End Namespace diff --git a/Modules.Logging/My Project/Settings.settings b/Modules.Logging/My Project/Settings.settings new file mode 100644 index 00000000..85b890b3 --- /dev/null +++ b/Modules.Logging/My Project/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Modules.Logging/packages.config b/Modules.Logging/packages.config new file mode 100644 index 00000000..a3ffb2eb --- /dev/null +++ b/Modules.Logging/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/Modules.Windream/Constants.vb b/Modules.Windream/Constants.vb new file mode 100644 index 00000000..722d3935 --- /dev/null +++ b/Modules.Windream/Constants.vb @@ -0,0 +1,36 @@ +Public Class Constants + ' Primitive Types + Public Const INDEX_TYPE_UNDEFINED = 0 + Public Const INDEX_TYPE_STRING = 1 + Public Const INDEX_TYPE_INTEGER = 2 + Public Const INDEX_TYPE_FLOAT = 3 + Public Const INDEX_TYPE_BOOLEAN = 4 + Public Const INDEX_TYPE_DATE = 5 + Public Const INDEX_TYPE_FIXED_POINT = 6 + Public Const INDEX_TYPE_DATE_TIME = 7 + Public Const INDEX_TYPE_CURRENCY = 8 + Public Const INDEX_TYPE_TIME = 9 + Public Const INDEX_TYPE_VARIANT = 10 + + ' Vector Types + Public Const INDEX_TYPE_VECTOR_STRING = 4097 + Public Const INDEX_TYPE_VECTOR_INTEGER = 4098 + Public Const INDEX_TYPE_VECTOR_FLOAT = 4099 + Public Const INDEX_TYPE_VECTOR_BOOLEAN = 4100 + Public Const INDEX_TYPE_VECTOR_DATE = 4101 + Public Const INDEX_TYPE_VECTOR_FIXED_POINT = 4102 + Public Const INDEX_TYPE_VECTOR_DATE_TIME = 4103 + Public Const INDEX_TYPE_VECTOR_CURRENCY = 4014 + Public Const INDEX_TYPE_VECTOR_TIME = 4105 + Public Const INDEX_TYPE_VECTOR_INTEGER_64BIT = 4107 + + ' Special Types + Public Const INDEX_TYPE_FULLTEXT = 8193 + Public Const INDEX_TYPE_HASH = 36865 + + ' Misc Types / Unknown Types + Public Const INDEX_TYPE_MASK = &HFFF + Public Const INDEX_FLAG_MASK = &HFFFFF000 + Public Const INDEX_TYPE_VECTOR = &H1000 + Public Const INDEX_TYPE_DEFAULT_VALUE = &H4000 +End Class diff --git a/Modules.Windream/Modules.Windream.vbproj b/Modules.Windream/Modules.Windream.vbproj new file mode 100644 index 00000000..854a4ce6 --- /dev/null +++ b/Modules.Windream/Modules.Windream.vbproj @@ -0,0 +1,104 @@ + + + + + Debug + AnyCPU + {4C86DF8F-A280-40D4-85B0-10B1BF66C15C} + Library + Modules.Windream + Modules.Windream + 512 + Windows + v4.6.1 + + + true + full + true + true + bin\Debug\ + Modules.Windream.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + pdbonly + false + true + true + bin\Release\ + Modules.Windream.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + On + + + Binary + + + Off + + + On + + + + + + + + + + + + + + + + + + + + + + + + + + + True + Application.myapp + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + + VbMyResourcesResXFileCodeGenerator + Resources.Designer.vb + My.Resources + Designer + + + + + MyApplicationCodeGenerator + Application.Designer.vb + + + SettingsSingleFileGenerator + My + Settings.Designer.vb + + + + \ No newline at end of file diff --git a/Modules.Windream/My Project/Application.Designer.vb b/Modules.Windream/My Project/Application.Designer.vb new file mode 100644 index 00000000..88dd01c7 --- /dev/null +++ b/Modules.Windream/My Project/Application.Designer.vb @@ -0,0 +1,13 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:4.0.30319.42000 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + diff --git a/Modules.Windream/My Project/Application.myapp b/Modules.Windream/My Project/Application.myapp new file mode 100644 index 00000000..758895de --- /dev/null +++ b/Modules.Windream/My Project/Application.myapp @@ -0,0 +1,10 @@ + + + false + false + 0 + true + 0 + 1 + true + diff --git a/Modules.Windream/My Project/AssemblyInfo.vb b/Modules.Windream/My Project/AssemblyInfo.vb new file mode 100644 index 00000000..7d5dcb4b --- /dev/null +++ b/Modules.Windream/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.Windream/My Project/Resources.Designer.vb b/Modules.Windream/My Project/Resources.Designer.vb new file mode 100644 index 00000000..30090d5d --- /dev/null +++ b/Modules.Windream/My Project/Resources.Designer.vb @@ -0,0 +1,62 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:4.0.30319.42000 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My.Resources + + 'This class was auto-generated by the StronglyTypedResourceBuilder + 'class via a tool like ResGen or Visual Studio. + 'To add or remove a member, edit your .ResX file then rerun ResGen + 'with the /str option, or rebuild your VS project. + ''' + ''' A strongly-typed resource class, for looking up localized strings, etc. + ''' + _ + Friend Module Resources + + Private resourceMan As Global.System.Resources.ResourceManager + + Private resourceCulture As Global.System.Globalization.CultureInfo + + ''' + ''' Returns the cached ResourceManager instance used by this class. + ''' + _ + 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("Modules.Windream.Resources", GetType(Resources).Assembly) + resourceMan = temp + End If + Return resourceMan + End Get + End Property + + ''' + ''' Overrides the current thread's CurrentUICulture property for all + ''' resource lookups using this strongly typed resource class. + ''' + _ + Friend Property Culture() As Global.System.Globalization.CultureInfo + Get + Return resourceCulture + End Get + Set(ByVal value As Global.System.Globalization.CultureInfo) + resourceCulture = value + End Set + End Property + End Module +End Namespace diff --git a/Modules.Windream/My Project/Resources.resx b/Modules.Windream/My Project/Resources.resx new file mode 100644 index 00000000..af7dbebb --- /dev/null +++ b/Modules.Windream/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.Windream/My Project/Settings.Designer.vb b/Modules.Windream/My Project/Settings.Designer.vb new file mode 100644 index 00000000..980e1a4f --- /dev/null +++ b/Modules.Windream/My Project/Settings.Designer.vb @@ -0,0 +1,73 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:4.0.30319.42000 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +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 "My.Settings Auto-Save Functionality" +#If _MyType = "WindowsForms" Then + Private Shared addedHandler As Boolean + + Private Shared addedHandlerLockObject As New Object + + _ + Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal 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.Modules.Windream.My.MySettings + Get + Return Global.Modules.Windream.My.MySettings.Default + End Get + End Property + End Module +End Namespace diff --git a/Modules.Windream/My Project/Settings.settings b/Modules.Windream/My Project/Settings.settings new file mode 100644 index 00000000..85b890b3 --- /dev/null +++ b/Modules.Windream/My Project/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Modules.Windream/Session.vb b/Modules.Windream/Session.vb new file mode 100644 index 00000000..1b9c25cf --- /dev/null +++ b/Modules.Windream/Session.vb @@ -0,0 +1,5 @@ +Public Class Session + Public Sub New() + + End Sub +End Class