diff --git a/DDMonorepo.sln b/DDMonorepo.sln index 38a35eba..b2d88dd7 100644 --- a/DDMonorepo.sln +++ b/DDMonorepo.sln @@ -128,6 +128,10 @@ Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "GlobalIndexer", "GUIs.Globa EndProject Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "SQLEditor", "Controls.SQLEditor\SQLEditor.vbproj", "{3E7BC8A9-91EF-49B8-8110-2C01F664C24A}" EndProject +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "SQLConfig", "SQLConfig\SQLConfig.vbproj", "{65EFB268-C0E0-40C1-8981-9F70DEE5C74A}" +EndProject +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Monitor", "GUIs.Monitor\Monitor.vbproj", "{E24E8D40-0361-4C07-8FAE-3621DE316E70}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -338,6 +342,14 @@ Global {3E7BC8A9-91EF-49B8-8110-2C01F664C24A}.Debug|Any CPU.Build.0 = Debug|Any CPU {3E7BC8A9-91EF-49B8-8110-2C01F664C24A}.Release|Any CPU.ActiveCfg = Release|Any CPU {3E7BC8A9-91EF-49B8-8110-2C01F664C24A}.Release|Any CPU.Build.0 = Release|Any CPU + {65EFB268-C0E0-40C1-8981-9F70DEE5C74A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {65EFB268-C0E0-40C1-8981-9F70DEE5C74A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {65EFB268-C0E0-40C1-8981-9F70DEE5C74A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {65EFB268-C0E0-40C1-8981-9F70DEE5C74A}.Release|Any CPU.Build.0 = Release|Any CPU + {E24E8D40-0361-4C07-8FAE-3621DE316E70}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E24E8D40-0361-4C07-8FAE-3621DE316E70}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E24E8D40-0361-4C07-8FAE-3621DE316E70}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E24E8D40-0361-4C07-8FAE-3621DE316E70}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -394,6 +406,8 @@ Global {16857A4E-2609-47E6-9C35-7669D64DD040} = {3E2008C8-27B1-41DD-9B1A-0C4029F6AECC} {40384B94-1F94-4249-9A5A-D02E0B346738} = {8FFE925E-8B84-45F1-93CB-32B1C96F41EB} {3E7BC8A9-91EF-49B8-8110-2C01F664C24A} = {F98C0329-C004-417F-B2AB-7466E88D8220} + {65EFB268-C0E0-40C1-8981-9F70DEE5C74A} = {F98C0329-C004-417F-B2AB-7466E88D8220} + {E24E8D40-0361-4C07-8FAE-3621DE316E70} = {8FFE925E-8B84-45F1-93CB-32B1C96F41EB} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {C1BE4090-A0FD-48AF-86CB-39099D14B286} diff --git a/GUIs.Monitor/Form1.Designer.vb b/GUIs.Monitor/Form1.Designer.vb new file mode 100644 index 00000000..d1926fb6 --- /dev/null +++ b/GUIs.Monitor/Form1.Designer.vb @@ -0,0 +1,76 @@ +Imports DigitalData.GUIs.Common.Base + +Partial Public Class Form1 + Inherits BaseRibbonForm + + ''' + ''' Required designer variable. + ''' + Private components As System.ComponentModel.IContainer = Nothing + + ''' + ''' Clean up any resources being used. + ''' + ''' true if managed resources should be disposed; otherwise, false. + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + If disposing AndAlso (components IsNot Nothing) Then + components.Dispose() + End If + MyBase.Dispose(disposing) + End Sub + +#Region "Windows Form Designer generated code" + + ''' + ''' Required method for Designer support - do not modify + ''' the contents of this method with the code editor. + ''' + Private Sub InitializeComponent() + Me.ribbonControl1 = New DevExpress.XtraBars.Ribbon.RibbonControl() + Me.ribbonPage1 = New DevExpress.XtraBars.Ribbon.RibbonPage() + Me.ribbonPageGroup1 = New DevExpress.XtraBars.Ribbon.RibbonPageGroup() + CType(Me.ribbonControl1, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + 'ribbonControl1 + ' + Me.ribbonControl1.ExpandCollapseItem.Id = 0 + Me.ribbonControl1.Items.AddRange(New DevExpress.XtraBars.BarItem() {Me.ribbonControl1.ExpandCollapseItem, Me.ribbonControl1.SearchEditItem}) + Me.ribbonControl1.Location = New System.Drawing.Point(0, 0) + Me.ribbonControl1.MaxItemId = 1 + Me.ribbonControl1.Name = "ribbonControl1" + Me.ribbonControl1.Pages.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPage() {Me.ribbonPage1}) + Me.ribbonControl1.Size = New System.Drawing.Size(1034, 158) + ' + 'ribbonPage1 + ' + Me.ribbonPage1.Groups.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPageGroup() {Me.ribbonPageGroup1}) + Me.ribbonPage1.Name = "ribbonPage1" + Me.ribbonPage1.Text = "ribbonPage1" + ' + 'ribbonPageGroup1 + ' + Me.ribbonPageGroup1.Name = "ribbonPageGroup1" + Me.ribbonPageGroup1.Text = "ribbonPageGroup1" + ' + 'Form1 + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(1034, 619) + Me.Controls.Add(Me.ribbonControl1) + Me.Name = "Form1" + Me.Ribbon = Me.ribbonControl1 + Me.Text = "Monitor" + CType(Me.ribbonControl1, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + +#End Region + + Private WithEvents ribbonControl1 As DevExpress.XtraBars.Ribbon.RibbonControl + Private WithEvents ribbonPage1 As DevExpress.XtraBars.Ribbon.RibbonPage + Private WithEvents ribbonPageGroup1 As DevExpress.XtraBars.Ribbon.RibbonPageGroup +End Class diff --git a/GUIs.Monitor/Form1.resx b/GUIs.Monitor/Form1.resx new file mode 100644 index 00000000..1af7de15 --- /dev/null +++ b/GUIs.Monitor/Form1.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/GUIs.Monitor/Form1.vb b/GUIs.Monitor/Form1.vb new file mode 100644 index 00000000..b3b74198 --- /dev/null +++ b/GUIs.Monitor/Form1.vb @@ -0,0 +1,6 @@ +Imports System.ComponentModel +Imports System.Text + + +Partial Public Class Form1 +End Class diff --git a/GUIs.Monitor/Monitor.vbproj b/GUIs.Monitor/Monitor.vbproj new file mode 100644 index 00000000..3840206d --- /dev/null +++ b/GUIs.Monitor/Monitor.vbproj @@ -0,0 +1,137 @@ + + + Debug + x86 + 8.0.30703 + 2.0 + {E24E8D40-0361-4C07-8FAE-3621DE316E70} + WinExe + DigitalData.GUIs.Monitor + DigitalData.GUIs.Monitor + v4.5.2 + Monitor.Program + 512 + On + Binary + Off + On + + + AnyCPU + true + full + false + bin\Debug\ + true + true + prompt + + + AnyCPU + pdbonly + true + bin\Release\ + false + true + prompt + + + WindowsForms + + + DigitalData.GUIs.Monitor.My.MyApplication + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Form + + + Form1.vb + + + True + Application.myapp + True + + + + Form1.vb + + + + VbMyResourcesResXFileCodeGenerator + Resources.Designer.vb + My.Resources + Designer + + + True + Resources.resx + True + + + + SettingsSingleFileGenerator + Settings.Designer.vb + + + True + Settings.settings + True + + + + + MyApplicationCodeGenerator + Application.Designer.vb + + + + + {d20a6bf2-c7c6-4a7a-b34d-fa27d775a049} + Common + + + {65efb268-c0e0-40c1-8981-9f70dee5c74a} + SQLConfig + + + + + \ No newline at end of file diff --git a/GUIs.Monitor/My Project/Application.Designer.vb b/GUIs.Monitor/My Project/Application.Designer.vb new file mode 100644 index 00000000..ed856bf0 --- /dev/null +++ b/GUIs.Monitor/My Project/Application.Designer.vb @@ -0,0 +1,38 @@ +'------------------------------------------------------------------------------ +' +' 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 + + '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 + Me.EnableVisualStyles = true + Me.SaveMySettingsOnExit = true + Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses + End Sub + + _ + Protected Overrides Sub OnCreateMainForm() + Me.MainForm = Global.DigitalData.GUIs.Monitor.Form1 + End Sub + End Class +End Namespace diff --git a/GUIs.Monitor/My Project/Application.myapp b/GUIs.Monitor/My Project/Application.myapp new file mode 100644 index 00000000..1243847f --- /dev/null +++ b/GUIs.Monitor/My Project/Application.myapp @@ -0,0 +1,11 @@ + + + true + Form1 + false + 0 + true + 0 + 0 + true + diff --git a/GUIs.Monitor/My Project/AssemblyInfo.vb b/GUIs.Monitor/My Project/AssemblyInfo.vb new file mode 100644 index 00000000..330d72a8 --- /dev/null +++ b/GUIs.Monitor/My Project/AssemblyInfo.vb @@ -0,0 +1,36 @@ +Imports System.Reflection +Imports System.Runtime.CompilerServices +Imports System.Runtime.InteropServices + +' General Information about an assembly is controlled through the following +' set of attributes. Change these attribute values to modify the information +' associated with an assembly. + + + + + + + + + +' Setting ComVisible to false makes the types in this assembly not visible +' to COM components. If you need to access a type in this assembly from +' COM, set the ComVisible attribute to true on that type. + + +' The following GUID is for the ID of the typelib if this project is exposed to COM + + +' Version information for an assembly consists of the following four values: +' +' Major Version +' Minor Version +' Build Number +' Revision +' +' You can specify all the values or you can default the Build and Revision Numbers +' by using the '*' as shown below: +' [assembly: AssemblyVersion("1.0.*")] + + diff --git a/GUIs.Monitor/My Project/Resources.Designer.vb b/GUIs.Monitor/My Project/Resources.Designer.vb new file mode 100644 index 00000000..6e2e2c9f --- /dev/null +++ b/GUIs.Monitor/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.GUIs.Monitor.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/GUIs.Monitor/My Project/Resources.resx b/GUIs.Monitor/My Project/Resources.resx new file mode 100644 index 00000000..901f10d6 --- /dev/null +++ b/GUIs.Monitor/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/GUIs.Monitor/My Project/Settings.Designer.vb b/GUIs.Monitor/My Project/Settings.Designer.vb new file mode 100644 index 00000000..008b7edb --- /dev/null +++ b/GUIs.Monitor/My Project/Settings.Designer.vb @@ -0,0 +1,71 @@ +'------------------------------------------------------------------------------ +' +' 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 + + + + _ +Partial Friend NotInheritable Class Settings + Inherits Global.System.Configuration.ApplicationSettingsBase + + Private Shared defaultInstance As Settings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New Settings()),Settings) + +#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 Settings + 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 + +Namespace My + + _ + Friend Module MySettingsProperty + + _ + Friend ReadOnly Property Settings() As Global.DigitalData.GUIs.Monitor.Settings + Get + Return Global.DigitalData.GUIs.Monitor.Settings.Default + End Get + End Property + End Module +End Namespace diff --git a/GUIs.Monitor/My Project/Settings.settings b/GUIs.Monitor/My Project/Settings.settings new file mode 100644 index 00000000..39645652 --- /dev/null +++ b/GUIs.Monitor/My Project/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/GUIs.Monitor/My Project/licenses.licx b/GUIs.Monitor/My Project/licenses.licx new file mode 100644 index 00000000..3f51afe8 --- /dev/null +++ b/GUIs.Monitor/My Project/licenses.licx @@ -0,0 +1 @@ +DevExpress.XtraBars.Ribbon.RibbonControl, DevExpress.XtraBars.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a diff --git a/GUIs.Monitor/app.config b/GUIs.Monitor/app.config new file mode 100644 index 00000000..8f96d242 --- /dev/null +++ b/GUIs.Monitor/app.config @@ -0,0 +1,41 @@ + + + + +
+ + + + + + System + + + True + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/SQLConfig/App.config b/SQLConfig/App.config new file mode 100644 index 00000000..cd714553 --- /dev/null +++ b/SQLConfig/App.config @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/SQLConfig/My Project/Application.Designer.vb b/SQLConfig/My Project/Application.Designer.vb new file mode 100644 index 00000000..5562f4b0 --- /dev/null +++ b/SQLConfig/My Project/Application.Designer.vb @@ -0,0 +1,38 @@ +'------------------------------------------------------------------------------ +' +' 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 + + '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 + Me.EnableVisualStyles = true + Me.SaveMySettingsOnExit = true + Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses + End Sub + + _ + Protected Overrides Sub OnCreateMainForm() + Me.MainForm = Global.SQLConfig.frmSQLConfig + End Sub + End Class +End Namespace diff --git a/SQLConfig/My Project/Application.myapp b/SQLConfig/My Project/Application.myapp new file mode 100644 index 00000000..745fec77 --- /dev/null +++ b/SQLConfig/My Project/Application.myapp @@ -0,0 +1,10 @@ + + + true + frmSQLConfig + false + 0 + true + 0 + true + \ No newline at end of file diff --git a/SQLConfig/My Project/AssemblyInfo.vb b/SQLConfig/My Project/AssemblyInfo.vb new file mode 100644 index 00000000..ec79e040 --- /dev/null +++ b/SQLConfig/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 wird für die typelib-ID verwendet, 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, +' indem Sie "*" wie unten gezeigt eingeben: +' + + + diff --git a/SQLConfig/My Project/Resources.Designer.vb b/SQLConfig/My Project/Resources.Designer.vb new file mode 100644 index 00000000..b23248b0 --- /dev/null +++ b/SQLConfig/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("SQLConfig.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/SQLConfig/My Project/Resources.resx b/SQLConfig/My Project/Resources.resx new file mode 100644 index 00000000..af7dbebb --- /dev/null +++ b/SQLConfig/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/SQLConfig/My Project/Settings.Designer.vb b/SQLConfig/My Project/Settings.Designer.vb new file mode 100644 index 00000000..7a0222cc --- /dev/null +++ b/SQLConfig/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.SQLConfig.My.MySettings + Get + Return Global.SQLConfig.My.MySettings.Default + End Get + End Property + End Module +End Namespace diff --git a/SQLConfig/My Project/Settings.settings b/SQLConfig/My Project/Settings.settings new file mode 100644 index 00000000..85b890b3 --- /dev/null +++ b/SQLConfig/My Project/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/SQLConfig/My Project/licenses.licx b/SQLConfig/My Project/licenses.licx new file mode 100644 index 00000000..d21850c7 --- /dev/null +++ b/SQLConfig/My Project/licenses.licx @@ -0,0 +1,4 @@ +DevExpress.XtraEditors.ComboBoxEdit, DevExpress.XtraEditors.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a +DevExpress.XtraEditors.CheckEdit, DevExpress.XtraEditors.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a +DevExpress.XtraLayout.LayoutControl, DevExpress.XtraLayout.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a +DevExpress.XtraEditors.TextEdit, DevExpress.XtraEditors.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a diff --git a/SQLConfig/SQLConfig.vbproj b/SQLConfig/SQLConfig.vbproj new file mode 100644 index 00000000..d90e1443 --- /dev/null +++ b/SQLConfig/SQLConfig.vbproj @@ -0,0 +1,158 @@ + + + + + Debug + AnyCPU + {65EFB268-C0E0-40C1-8981-9F70DEE5C74A} + WinExe + SQLConfig.My.MyApplication + SQLConfig + SQLConfig + 512 + WindowsForms + v4.6.1 + true + true + + + AnyCPU + true + full + true + true + bin\Debug\ + SQLConfig.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + AnyCPU + pdbonly + false + true + true + bin\Release\ + SQLConfig.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + On + + + Binary + + + Off + + + On + + + + + + False + D:\ProgramFiles\DevExpress 19.2\Components\Bin\Framework\DevExpress.XtraEditors.v19.2.dll + + + False + D:\ProgramFiles\DevExpress 19.2\Components\Bin\Framework\DevExpress.XtraLayout.v19.2.dll + + + + ..\packages\NLog.4.7.5\lib\net45\NLog.dll + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + frmSQLConfig.vb + + + Form + + + + True + Application.myapp + True + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + + frmSQLConfig.vb + + + + VbMyResourcesResXFileCodeGenerator + Resources.Designer.vb + My.Resources + Designer + + + + + MyApplicationCodeGenerator + Application.Designer.vb + + + SettingsSingleFileGenerator + My + Settings.Designer.vb + + + + + + + {eaf0ea75-5fa7-485d-89c7-b2d843b03a96} + Database + + + {991d0231-4623-496d-8bd0-9ca906029cbc} + Filesystem + + + {903b2d7d-3b80-4be9-8713-7447b704e1b0} + Logging + + + + \ No newline at end of file diff --git a/SQLConfig/frmSQLConfig.Designer.vb b/SQLConfig/frmSQLConfig.Designer.vb new file mode 100644 index 00000000..a54c19ed --- /dev/null +++ b/SQLConfig/frmSQLConfig.Designer.vb @@ -0,0 +1,271 @@ + _ +Partial Class frmSQLConfig + 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.LayoutControl1 = New DevExpress.XtraLayout.LayoutControl() + Me.txtServerName = New DevExpress.XtraEditors.TextEdit() + Me.txtUserName = New DevExpress.XtraEditors.TextEdit() + Me.txtPassword = New DevExpress.XtraEditors.TextEdit() + Me.cmbDatabase = New DevExpress.XtraEditors.ComboBoxEdit() + Me.btnTestConnection = New DevExpress.XtraEditors.SimpleButton() + Me.txtConnectionString = New DevExpress.XtraEditors.TextEdit() + Me.chkWinAuth = New DevExpress.XtraEditors.CheckEdit() + Me.LayoutControlGroup1 = New DevExpress.XtraLayout.LayoutControlGroup() + Me.LayoutControlItem1 = New DevExpress.XtraLayout.LayoutControlItem() + Me.LayoutControlItem2 = New DevExpress.XtraLayout.LayoutControlItem() + Me.LayoutControlItem4 = New DevExpress.XtraLayout.LayoutControlItem() + Me.LayoutControlItem3 = New DevExpress.XtraLayout.LayoutControlItem() + Me.LayoutControlItem7 = New DevExpress.XtraLayout.LayoutControlItem() + Me.LayoutControlItem6 = New DevExpress.XtraLayout.LayoutControlItem() + Me.LayoutControlItem5 = New DevExpress.XtraLayout.LayoutControlItem() + Me.EmptySpaceItem2 = New DevExpress.XtraLayout.EmptySpaceItem() + CType(Me.LayoutControl1, System.ComponentModel.ISupportInitialize).BeginInit() + Me.LayoutControl1.SuspendLayout() + CType(Me.txtServerName.Properties, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.txtUserName.Properties, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.txtPassword.Properties, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.cmbDatabase.Properties, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.txtConnectionString.Properties, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.chkWinAuth.Properties, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.LayoutControlGroup1, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.LayoutControlItem1, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.LayoutControlItem2, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.LayoutControlItem4, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.LayoutControlItem3, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.LayoutControlItem7, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.LayoutControlItem6, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.LayoutControlItem5, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.EmptySpaceItem2, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + 'LayoutControl1 + ' + Me.LayoutControl1.Controls.Add(Me.txtServerName) + Me.LayoutControl1.Controls.Add(Me.txtUserName) + Me.LayoutControl1.Controls.Add(Me.txtPassword) + Me.LayoutControl1.Controls.Add(Me.cmbDatabase) + Me.LayoutControl1.Controls.Add(Me.btnTestConnection) + Me.LayoutControl1.Controls.Add(Me.txtConnectionString) + Me.LayoutControl1.Controls.Add(Me.chkWinAuth) + Me.LayoutControl1.Dock = System.Windows.Forms.DockStyle.Fill + Me.LayoutControl1.Location = New System.Drawing.Point(0, 0) + Me.LayoutControl1.Name = "LayoutControl1" + Me.LayoutControl1.Root = Me.LayoutControlGroup1 + Me.LayoutControl1.Size = New System.Drawing.Size(602, 221) + Me.LayoutControl1.TabIndex = 0 + Me.LayoutControl1.Text = "LayoutControl1" + ' + 'txtServerName + ' + Me.txtServerName.Location = New System.Drawing.Point(148, 15) + Me.txtServerName.Name = "txtServerName" + Me.txtServerName.Size = New System.Drawing.Size(439, 20) + Me.txtServerName.StyleController = Me.LayoutControl1 + Me.txtServerName.TabIndex = 4 + ' + 'txtUserName + ' + Me.txtUserName.Location = New System.Drawing.Point(148, 45) + Me.txtUserName.Name = "txtUserName" + Me.txtUserName.Size = New System.Drawing.Size(148, 20) + Me.txtUserName.StyleController = Me.LayoutControl1 + Me.txtUserName.TabIndex = 5 + ' + 'txtPassword + ' + Me.txtPassword.Location = New System.Drawing.Point(439, 45) + Me.txtPassword.Name = "txtPassword" + Me.txtPassword.Size = New System.Drawing.Size(148, 20) + Me.txtPassword.StyleController = Me.LayoutControl1 + Me.txtPassword.TabIndex = 6 + ' + 'cmbDatabase + ' + Me.cmbDatabase.Location = New System.Drawing.Point(148, 75) + Me.cmbDatabase.Name = "cmbDatabase" + Me.cmbDatabase.Properties.Buttons.AddRange(New DevExpress.XtraEditors.Controls.EditorButton() {New DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)}) + Me.cmbDatabase.Size = New System.Drawing.Size(439, 20) + Me.cmbDatabase.StyleController = Me.LayoutControl1 + Me.cmbDatabase.TabIndex = 7 + ' + 'btnTestConnection + ' + Me.btnTestConnection.ImageOptions.SvgImageSize = New System.Drawing.Size(16, 16) + Me.btnTestConnection.Location = New System.Drawing.Point(303, 166) + Me.btnTestConnection.Name = "btnTestConnection" + Me.btnTestConnection.Size = New System.Drawing.Size(287, 22) + Me.btnTestConnection.StyleController = Me.LayoutControl1 + Me.btnTestConnection.TabIndex = 8 + Me.btnTestConnection.Text = "Verbindung zur Datenbank herstellen" + ' + 'txtConnectionString + ' + Me.txtConnectionString.Location = New System.Drawing.Point(148, 139) + Me.txtConnectionString.Name = "txtConnectionString" + Me.txtConnectionString.Properties.ReadOnly = True + Me.txtConnectionString.Size = New System.Drawing.Size(439, 20) + Me.txtConnectionString.StyleController = Me.LayoutControl1 + Me.txtConnectionString.TabIndex = 9 + ' + 'chkWinAuth + ' + Me.chkWinAuth.Location = New System.Drawing.Point(17, 107) + Me.chkWinAuth.Name = "chkWinAuth" + Me.chkWinAuth.Properties.Caption = "Windows Authentifizierung" + Me.chkWinAuth.Size = New System.Drawing.Size(568, 20) + Me.chkWinAuth.StyleController = Me.LayoutControl1 + Me.chkWinAuth.TabIndex = 10 + ' + 'LayoutControlGroup1 + ' + Me.LayoutControlGroup1.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.[True] + Me.LayoutControlGroup1.GroupBordersVisible = False + Me.LayoutControlGroup1.Items.AddRange(New DevExpress.XtraLayout.BaseLayoutItem() {Me.LayoutControlItem1, Me.LayoutControlItem2, Me.LayoutControlItem4, Me.LayoutControlItem3, Me.LayoutControlItem7, Me.LayoutControlItem6, Me.LayoutControlItem5, Me.EmptySpaceItem2}) + Me.LayoutControlGroup1.Name = "LayoutControlGroup1" + Me.LayoutControlGroup1.Size = New System.Drawing.Size(602, 221) + Me.LayoutControlGroup1.TextVisible = False + ' + 'LayoutControlItem1 + ' + Me.LayoutControlItem1.Control = Me.txtServerName + Me.LayoutControlItem1.Location = New System.Drawing.Point(0, 0) + Me.LayoutControlItem1.Name = "LayoutControlItem1" + Me.LayoutControlItem1.Padding = New DevExpress.XtraLayout.Utils.Padding(5, 5, 5, 5) + Me.LayoutControlItem1.Size = New System.Drawing.Size(582, 30) + Me.LayoutControlItem1.Text = "Server Name:" + Me.LayoutControlItem1.TextSize = New System.Drawing.Size(130, 13) + ' + 'LayoutControlItem2 + ' + Me.LayoutControlItem2.Control = Me.txtUserName + Me.LayoutControlItem2.Location = New System.Drawing.Point(0, 30) + Me.LayoutControlItem2.Name = "LayoutControlItem2" + Me.LayoutControlItem2.Padding = New DevExpress.XtraLayout.Utils.Padding(5, 5, 5, 5) + Me.LayoutControlItem2.Size = New System.Drawing.Size(291, 30) + Me.LayoutControlItem2.Text = "Benutzername:" + Me.LayoutControlItem2.TextSize = New System.Drawing.Size(130, 13) + ' + 'LayoutControlItem4 + ' + Me.LayoutControlItem4.Control = Me.cmbDatabase + Me.LayoutControlItem4.Location = New System.Drawing.Point(0, 60) + Me.LayoutControlItem4.Name = "LayoutControlItem4" + Me.LayoutControlItem4.Padding = New DevExpress.XtraLayout.Utils.Padding(5, 5, 5, 5) + Me.LayoutControlItem4.Size = New System.Drawing.Size(582, 30) + Me.LayoutControlItem4.Text = "Datenbank:" + Me.LayoutControlItem4.TextSize = New System.Drawing.Size(130, 13) + ' + 'LayoutControlItem3 + ' + Me.LayoutControlItem3.Control = Me.txtPassword + Me.LayoutControlItem3.Location = New System.Drawing.Point(291, 30) + Me.LayoutControlItem3.Name = "LayoutControlItem3" + Me.LayoutControlItem3.Padding = New DevExpress.XtraLayout.Utils.Padding(5, 5, 5, 5) + Me.LayoutControlItem3.Size = New System.Drawing.Size(291, 30) + Me.LayoutControlItem3.Text = "Passwort:" + Me.LayoutControlItem3.TextSize = New System.Drawing.Size(130, 13) + ' + 'LayoutControlItem7 + ' + Me.LayoutControlItem7.Control = Me.chkWinAuth + Me.LayoutControlItem7.Location = New System.Drawing.Point(0, 90) + Me.LayoutControlItem7.Name = "LayoutControlItem7" + Me.LayoutControlItem7.Size = New System.Drawing.Size(582, 34) + Me.LayoutControlItem7.Spacing = New DevExpress.XtraLayout.Utils.Padding(5, 5, 5, 5) + Me.LayoutControlItem7.TextSize = New System.Drawing.Size(0, 0) + Me.LayoutControlItem7.TextVisible = False + ' + 'LayoutControlItem6 + ' + Me.LayoutControlItem6.Control = Me.txtConnectionString + Me.LayoutControlItem6.Location = New System.Drawing.Point(0, 124) + Me.LayoutControlItem6.Name = "LayoutControlItem6" + Me.LayoutControlItem6.Padding = New DevExpress.XtraLayout.Utils.Padding(5, 5, 5, 5) + Me.LayoutControlItem6.Size = New System.Drawing.Size(582, 30) + Me.LayoutControlItem6.Text = "Aktueller Connectionstring:" + Me.LayoutControlItem6.TextSize = New System.Drawing.Size(130, 13) + ' + 'LayoutControlItem5 + ' + Me.LayoutControlItem5.Control = Me.btnTestConnection + Me.LayoutControlItem5.Location = New System.Drawing.Point(291, 154) + Me.LayoutControlItem5.Name = "LayoutControlItem5" + Me.LayoutControlItem5.Size = New System.Drawing.Size(291, 47) + Me.LayoutControlItem5.TextSize = New System.Drawing.Size(0, 0) + Me.LayoutControlItem5.TextVisible = False + ' + 'EmptySpaceItem2 + ' + Me.EmptySpaceItem2.AllowHotTrack = False + Me.EmptySpaceItem2.Location = New System.Drawing.Point(0, 154) + Me.EmptySpaceItem2.Name = "EmptySpaceItem2" + Me.EmptySpaceItem2.Size = New System.Drawing.Size(291, 47) + Me.EmptySpaceItem2.TextSize = New System.Drawing.Size(0, 0) + ' + 'frmConfigDatabase + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(602, 221) + Me.Controls.Add(Me.LayoutControl1) + Me.Name = "frmConfigDatabase" + Me.Text = "Datenbank Verbindung" + CType(Me.LayoutControl1, System.ComponentModel.ISupportInitialize).EndInit() + Me.LayoutControl1.ResumeLayout(False) + CType(Me.txtServerName.Properties, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.txtUserName.Properties, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.txtPassword.Properties, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.cmbDatabase.Properties, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.txtConnectionString.Properties, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.chkWinAuth.Properties, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.LayoutControlGroup1, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.LayoutControlItem1, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.LayoutControlItem2, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.LayoutControlItem4, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.LayoutControlItem3, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.LayoutControlItem7, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.LayoutControlItem6, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.LayoutControlItem5, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.EmptySpaceItem2, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + + End Sub + + Friend WithEvents LayoutControl1 As DevExpress.XtraLayout.LayoutControl + Friend WithEvents LayoutControlGroup1 As DevExpress.XtraLayout.LayoutControlGroup + Friend WithEvents txtServerName As DevExpress.XtraEditors.TextEdit + Friend WithEvents txtUserName As DevExpress.XtraEditors.TextEdit + Friend WithEvents txtPassword As DevExpress.XtraEditors.TextEdit + Friend WithEvents cmbDatabase As DevExpress.XtraEditors.ComboBoxEdit + Friend WithEvents btnTestConnection As DevExpress.XtraEditors.SimpleButton + Friend WithEvents txtConnectionString As DevExpress.XtraEditors.TextEdit + Friend WithEvents chkWinAuth As DevExpress.XtraEditors.CheckEdit + Friend WithEvents LayoutControlItem1 As DevExpress.XtraLayout.LayoutControlItem + Friend WithEvents LayoutControlItem2 As DevExpress.XtraLayout.LayoutControlItem + Friend WithEvents LayoutControlItem4 As DevExpress.XtraLayout.LayoutControlItem + Friend WithEvents LayoutControlItem3 As DevExpress.XtraLayout.LayoutControlItem + Friend WithEvents LayoutControlItem7 As DevExpress.XtraLayout.LayoutControlItem + Friend WithEvents LayoutControlItem6 As DevExpress.XtraLayout.LayoutControlItem + Friend WithEvents LayoutControlItem5 As DevExpress.XtraLayout.LayoutControlItem + Friend WithEvents EmptySpaceItem2 As DevExpress.XtraLayout.EmptySpaceItem +End Class diff --git a/SQLConfig/frmSQLConfig.resx b/SQLConfig/frmSQLConfig.resx new file mode 100644 index 00000000..1af7de15 --- /dev/null +++ b/SQLConfig/frmSQLConfig.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/SQLConfig/frmSQLConfig.vb b/SQLConfig/frmSQLConfig.vb new file mode 100644 index 00000000..05b463e5 --- /dev/null +++ b/SQLConfig/frmSQLConfig.vb @@ -0,0 +1,142 @@ +Imports System.Data.SqlClient +Imports DigitalData.Modules.Database +Imports DigitalData.Modules.Filesystem +Imports DigitalData.Modules.Logging + +Public Class frmSQLConfig + Private Const STRING_CONNECTION_SUCCESSFUL = "Die Verbindung wurde erfolgreich aufgebaut!" & vbNewLine & "Möchten Sie diese Verbindung nun in der Anwendung speichern?" + + Private ReadOnly Logger As Logger + Private ReadOnly LogConfig As LogConfig + + Public Property ConnectionString As String + + Public Sub New() + ' Dieser Aufruf ist für den Designer erforderlich. + InitializeComponent() + + ' Fügen Sie Initialisierungen nach dem InitializeComponent()-Aufruf hinzu. + End Sub + + Public Sub New(LogConfig As LogConfig) + ' Dieser Aufruf ist für den Designer erforderlich. + InitializeComponent() + + ' Fügen Sie Initialisierungen nach dem InitializeComponent()-Aufruf hinzu. + Me.LogConfig = LogConfig + Logger = LogConfig.GetLogger() + End Sub + + Private Sub frmSQLConfig_Load(sender As Object, e As EventArgs) Handles MyBase.Load + Dim oConnectionString = ConnectionString + + If Not oConnectionString = String.Empty Then + Dim oBuilder As SqlConnectionStringBuilder + Try + oBuilder = New SqlConnectionStringBuilder(ConnectionString) + Catch ex As Exception + oBuilder = Nothing + End Try + + If oBuilder Is Nothing Then + MsgBox("Connection String ist ungültig!", MsgBoxStyle.Critical, Text) + Exit Sub + End If + + If oConnectionString.Contains("Trusted") Then + chkWinAuth.Checked = True + txtConnectionString.Text = oConnectionString + Else + chkWinAuth.Checked = False + txtConnectionString.Text = oConnectionString.Replace(oBuilder.Password, "XXXXXX") + txtUserName.Text = oBuilder.UserID + End If + + txtServerName.Text = oBuilder.DataSource + cmbDatabase.Text = oBuilder.InitialCatalog + End If + End Sub + + Private Sub chkWinAuth_CheckedChanged(sender As Object, e As EventArgs) Handles chkWinAuth.CheckedChanged + txtPassword.Enabled = Not chkWinAuth.Checked + txtUserName.Enabled = Not chkWinAuth.Checked + End Sub + + Private Sub cmbDatabase_Click(sender As Object, e As EventArgs) Handles cmbDatabase.Click + Cursor = Cursors.WaitCursor + + Dim oConnectionString As String = GetConnectionString(False) + Dim oDatabase As New MSSQLServer(LogConfig, oConnectionString) + + If oDatabase.DBInitialized = False Then + MsgBox("Verbindung fehlgeschlagen!", MsgBoxStyle.Critical, Text) + Exit Sub + End If + + Try + Using oConnection = New SqlClient.SqlConnection(oConnectionString) + oConnection.Open() + Using oCommand As New SqlClient.SqlCommand("sp_databases", oConnection) + Using oReader As SqlClient.SqlDataReader = oCommand.ExecuteReader + If oReader.HasRows Then + cmbDatabase.Properties.Items.Clear() + + Do While oReader.Read + cmbDatabase.Properties.Items.Add(oReader("Database_Name")) + Loop + cmbDatabase.ShowPopup() + Else + MsgBox("The standard-databases could not be retrieved. The default database will be set!" & vbNewLine & "Check rights in sql-server for user: " & Me.txtUserName.Text, MsgBoxStyle.Exclamation) + End If + End Using + End Using + End Using + + Catch ex As Exception + Logger.Error(ex) + Finally + Cursor = Cursors.Default + End Try + End Sub + + Private Function GetConnectionString(WithDatabase As Boolean) As String + Dim oConnectionString As String + + If chkWinAuth.Checked Then + oConnectionString = $"Data Source={txtServerName.Text};Trusted_Connection=True;" + Else + oConnectionString = $"Server={txtServerName.Text};User Id={txtUserName.Text};Password={txtPassword.Text};" + End If + + If WithDatabase Then + oConnectionString &= $"Database={cmbDatabase.Text};" + End If + + Return oConnectionString + End Function + + Private Sub btnTestConnection_Click(sender As Object, e As EventArgs) Handles btnTestConnection.Click + Try + Dim oConnectionString = GetConnectionString(True) + + Using oConnection As New SqlConnection(oConnectionString) + oConnection.Open() + oConnection.Close() + End Using + + Dim oResult = MessageBox.Show(STRING_CONNECTION_SUCCESSFUL, Text, MessageBoxButtons.YesNo, MessageBoxIcon.Question) + + If oResult = DialogResult.Yes Then + Dim oCrypt As New EncryptionLegacy("!35452didalog=") + Dim oEncryptedPassword = oCrypt.EncryptData(txtPassword.Text) + Dim oEncryptedConnectionString = $"Server={txtServerName.Text};Database={cmbDatabase.Text};User Id={txtUserName.Text};Password={oEncryptedPassword};" + + ConnectionString = oEncryptedConnectionString + Close() + End If + Catch ex As Exception + Logger.Error(ex) + MsgBox("Error while connecting to Database", MsgBoxStyle.Critical, Text) + End Try + End Sub +End Class \ No newline at end of file diff --git a/SQLConfig/packages.config b/SQLConfig/packages.config new file mode 100644 index 00000000..6f6bc401 --- /dev/null +++ b/SQLConfig/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file