From 15f3de7903098c8ed0cb252a403a59004f66031c Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Tue, 4 May 2021 14:54:35 +0200 Subject: [PATCH] SQLConfig: set DialogResult --- SQLConfig/My Project/Application.Designer.vb | 2 +- SQLConfig/My Project/Resources.Designer.vb | 51 ++++++------- SQLConfig/My Project/Settings.Designer.vb | 76 ++++++++++---------- SQLConfig/SQLConfig.vbproj | 10 +-- SQLConfig/frmSQLConfig.vb | 11 ++- 5 files changed, 80 insertions(+), 70 deletions(-) diff --git a/SQLConfig/My Project/Application.Designer.vb b/SQLConfig/My Project/Application.Designer.vb index 5562f4b0..a03f20d9 100644 --- a/SQLConfig/My Project/Application.Designer.vb +++ b/SQLConfig/My Project/Application.Designer.vb @@ -32,7 +32,7 @@ Namespace My _ Protected Overrides Sub OnCreateMainForm() - Me.MainForm = Global.SQLConfig.frmSQLConfig + Me.MainForm = Global.DigitalData.Controls.SQLConfig.frmSQLConfig End Sub End Class End Namespace diff --git a/SQLConfig/My Project/Resources.Designer.vb b/SQLConfig/My Project/Resources.Designer.vb index b23248b0..f4cda3f5 100644 --- a/SQLConfig/My Project/Resources.Designer.vb +++ b/SQLConfig/My Project/Resources.Designer.vb @@ -1,60 +1,61 @@ '------------------------------------------------------------------------------ ' -' This code was generated by a tool. -' Runtime Version:4.0.30319.42000 +' Dieser Code wurde von einem Tool generiert. +' Laufzeitversion:4.0.30319.42000 ' -' Changes to this file may cause incorrect behavior and will be lost if -' the code is regenerated. +' Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn +' der Code erneut generiert wird. ' '------------------------------------------------------------------------------ Option Strict On Option Explicit On +Imports System 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. + + '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. ''' - ''' A strongly-typed resource class, for looking up localized strings, etc. + ''' 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 - + ''' - ''' Returns the cached ResourceManager instance used by this class. + ''' 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("SQLConfig.Resources", GetType(Resources).Assembly) + Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("DigitalData.Controls.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. + ''' Ü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(ByVal value As Global.System.Globalization.CultureInfo) + Set resourceCulture = value End Set End Property diff --git a/SQLConfig/My Project/Settings.Designer.vb b/SQLConfig/My Project/Settings.Designer.vb index 7a0222cc..8f2429b8 100644 --- a/SQLConfig/My Project/Settings.Designer.vb +++ b/SQLConfig/My Project/Settings.Designer.vb @@ -1,10 +1,10 @@ '------------------------------------------------------------------------------ ' -' This code was generated by a tool. -' Runtime Version:4.0.30319.42000 +' Dieser Code wurde von einem Tool generiert. +' Laufzeitversion:4.0.30319.42000 ' -' Changes to this file may cause incorrect behavior and will be lost if -' the code is regenerated. +' Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn +' der Code erneut generiert wird. ' '------------------------------------------------------------------------------ @@ -13,42 +13,42 @@ 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" + + 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 addedHandler As Boolean - Private Shared addedHandlerLockObject As New Object + 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 + _ + 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 + 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 @@ -57,16 +57,16 @@ Namespace My End Namespace Namespace My - - _ + + _ Friend Module MySettingsProperty - - _ - Friend ReadOnly Property Settings() As Global.SQLConfig.My.MySettings + + _ + Friend ReadOnly Property Settings() As Global.DigitalData.Controls.SQLConfig.My.MySettings Get - Return Global.SQLConfig.My.MySettings.Default + Return Global.DigitalData.Controls.SQLConfig.My.MySettings.Default End Get End Property End Module diff --git a/SQLConfig/SQLConfig.vbproj b/SQLConfig/SQLConfig.vbproj index d90e1443..5625c7e9 100644 --- a/SQLConfig/SQLConfig.vbproj +++ b/SQLConfig/SQLConfig.vbproj @@ -6,9 +6,9 @@ AnyCPU {65EFB268-C0E0-40C1-8981-9F70DEE5C74A} WinExe - SQLConfig.My.MyApplication - SQLConfig - SQLConfig + DigitalData.Controls.SQLConfig.My.MyApplication + DigitalData.Controls.SQLConfig + DigitalData.Controls.SQLConfig 512 WindowsForms v4.6.1 @@ -22,7 +22,7 @@ true true bin\Debug\ - SQLConfig.xml + DigitalData.Controls.SQLConfig.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 @@ -32,7 +32,7 @@ true true bin\Release\ - SQLConfig.xml + DigitalData.Controls.SQLConfig.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 diff --git a/SQLConfig/frmSQLConfig.vb b/SQLConfig/frmSQLConfig.vb index 05b463e5..706b34b4 100644 --- a/SQLConfig/frmSQLConfig.vb +++ b/SQLConfig/frmSQLConfig.vb @@ -1,4 +1,5 @@ -Imports System.Data.SqlClient +Imports System.ComponentModel +Imports System.Data.SqlClient Imports DigitalData.Modules.Database Imports DigitalData.Modules.Filesystem Imports DigitalData.Modules.Logging @@ -139,4 +140,12 @@ Public Class frmSQLConfig MsgBox("Error while connecting to Database", MsgBoxStyle.Critical, Text) End Try End Sub + + Private Sub frmSQLConfig_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing + If ConnectionString <> String.Empty Then + DialogResult = DialogResult.OK + Else + DialogResult = DialogResult.Cancel + End If + End Sub End Class \ No newline at end of file