merge
This commit is contained in:
@@ -63,6 +63,46 @@
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
</Reference>
|
||||
<Reference Include="DevExpress.XtraTreeList.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
|
||||
<Reference Include="DigitalData.Modules.Base, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\DDModules\Base\bin\Debug\DigitalData.Modules.Base.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DigitalData.Modules.Config, Version=1.1.4.1, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\DDModules\Config\bin\Debug\DigitalData.Modules.Config.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DigitalData.Modules.Database, Version=2.2.7.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\DDModules\Database\bin\Debug\DigitalData.Modules.Database.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DigitalData.Modules.EDMI.API, Version=1.5.4.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\DDModules\EDMIAPI\bin\Debug\DigitalData.Modules.EDMI.API.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DigitalData.Modules.Filesystem, Version=1.3.1.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\DDModules\Filesystem\bin\Debug\DigitalData.Modules.Filesystem.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DigitalData.Modules.Language, Version=1.6.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\DDModules\Language\bin\Debug\DigitalData.Modules.Language.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DigitalData.Modules.Logging, Version=2.5.4.2, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\DDModules\Logging\bin\Debug\DigitalData.Modules.Logging.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DigitalData.Modules.Patterns, Version=1.1.0.1, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\DDModules\Patterns\bin\Debug\DigitalData.Modules.Patterns.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DigitalData.Modules.Windows, Version=1.4.4.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\DDModules\Windows\bin\Debug\DigitalData.Modules.Windows.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DigitalData.Modules.ZooFlow, Version=1.2.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\DDModules\ZooFlow\bin\Debug\DigitalData.Modules.ZooFlow.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="GdPicture.NET.14">
|
||||
<HintPath>D:\ProgramFiles\GdPicture.NET 14\Redist\GdPicture.NET (.NET Framework 4.5)\GdPicture.NET.14.dll</HintPath>
|
||||
</Reference>
|
||||
@@ -133,10 +173,10 @@
|
||||
<Compile Include="DocumentResultList\Helpers.vb" />
|
||||
<Compile Include="DocumentResultList\Watcher.vb" />
|
||||
<Compile Include="DocumentResultList\Params.vb" />
|
||||
<Compile Include="frmDocumentResultList.Designer.vb">
|
||||
<Compile Include="DocumentResultList\frmDocumentResultList.Designer.vb">
|
||||
<DependentUpon>frmDocumentResultList.vb</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="frmDocumentResultList.vb">
|
||||
<Compile Include="DocumentResultList\frmDocumentResultList.vb">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="DocumentResultList\Cache.vb" />
|
||||
@@ -158,10 +198,16 @@
|
||||
<Compile Include="frmNotification_Startup.vb">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="frmSQLEditor.Designer.vb">
|
||||
<Compile Include="frmSQLConfig.Designer.vb">
|
||||
<DependentUpon>frmSQLConfig.vb</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="frmSQLConfig.vb">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="SQLEditor\frmSQLEditor.Designer.vb">
|
||||
<DependentUpon>frmSQLEditor.vb</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="frmSQLEditor.vb">
|
||||
<Compile Include="SQLEditor\frmSQLEditor.vb">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="frmSQLResult.Designer.vb">
|
||||
@@ -179,12 +225,6 @@
|
||||
<Compile Include="GridBuilder.vb" />
|
||||
<Compile Include="IBaseForm.vb" />
|
||||
<Compile Include="IResultForm.vb" />
|
||||
<Compile Include="NNMsgBoxEx.Designer.vb">
|
||||
<DependentUpon>NNMsgBoxEx.vb</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="NNMsgBoxEx.vb">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="My Project\AssemblyInfo.vb" />
|
||||
<Compile Include="My Project\Resources.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
@@ -221,13 +261,13 @@
|
||||
<EmbeddedResource Include="frmDialog.resx">
|
||||
<DependentUpon>frmDialog.vb</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="frmDocumentResultList.en.resx">
|
||||
<EmbeddedResource Include="DocumentResultList\frmDocumentResultList.en.resx">
|
||||
<DependentUpon>frmDocumentResultList.vb</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="frmDocumentResultList.fr.resx">
|
||||
<EmbeddedResource Include="DocumentResultList\frmDocumentResultList.fr.resx">
|
||||
<DependentUpon>frmDocumentResultList.vb</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="frmDocumentResultList.resx">
|
||||
<EmbeddedResource Include="DocumentResultList\frmDocumentResultList.resx">
|
||||
<DependentUpon>frmDocumentResultList.vb</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
@@ -243,7 +283,10 @@
|
||||
<EmbeddedResource Include="frmNotification_Startup.resx">
|
||||
<DependentUpon>frmNotification_Startup.vb</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="frmSQLEditor.resx">
|
||||
<EmbeddedResource Include="frmSQLConfig.resx">
|
||||
<DependentUpon>frmSQLConfig.vb</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="SQLEditor\frmSQLEditor.resx">
|
||||
<DependentUpon>frmSQLEditor.vb</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="frmSQLResult.resx">
|
||||
@@ -252,9 +295,6 @@
|
||||
<EmbeddedResource Include="frmWorkflow_Adhoc_start.resx">
|
||||
<DependentUpon>frmWorkflow_Adhoc_start.vb</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="NNMsgBoxEx.resx">
|
||||
<DependentUpon>NNMsgBoxEx.vb</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="My Project\licenses.licx" />
|
||||
<EmbeddedResource Include="My Project\Resources.resx">
|
||||
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
|
||||
@@ -289,46 +329,6 @@
|
||||
<Project>{3DCD6D1A-C830-4241-B7E4-27430E7EA483}</Project>
|
||||
<Name>LookupControl</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Modules.Base\Base\Base.vbproj">
|
||||
<Project>{6ea0c51f-c2b1-4462-8198-3de0b32b74f8}</Project>
|
||||
<Name>Base</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Modules.Config\Config.vbproj">
|
||||
<Project>{44982f9b-6116-44e2-85d0-f39650b1ef99}</Project>
|
||||
<Name>Config</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Modules.Database\Database.vbproj">
|
||||
<Project>{EAF0EA75-5FA7-485D-89C7-B2D843B03A96}</Project>
|
||||
<Name>Database</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Modules.EDMIAPI\EDMI.API.vbproj">
|
||||
<Project>{25017513-0d97-49d3-98d7-ba76d9b251b0}</Project>
|
||||
<Name>EDMI.API</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Modules.Filesystem\Filesystem.vbproj">
|
||||
<Project>{991d0231-4623-496d-8bd0-9ca906029cbc}</Project>
|
||||
<Name>Filesystem</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Modules.Language\Language.vbproj">
|
||||
<Project>{d3c8cfed-d6f6-43a8-9bdf-454145d0352f}</Project>
|
||||
<Name>Language</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Modules.Logging\Logging.vbproj">
|
||||
<Project>{903B2D7D-3B80-4BE9-8713-7447B704E1B0}</Project>
|
||||
<Name>Logging</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Modules.Patterns\Patterns.vbproj">
|
||||
<Project>{7c3b0c7e-59fe-4e1a-a655-27ae119f9444}</Project>
|
||||
<Name>Patterns</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Modules.ZooFlow\ZooFlow.vbproj">
|
||||
<Project>{81cac44f-3711-4c8f-ae98-e02a7448782a}</Project>
|
||||
<Name>ZooFlow</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Windows\Windows.vbproj">
|
||||
<Project>{5EFAEF9B-90B9-4F05-9F70-F79AD77FFF86}</Project>
|
||||
<Name>Windows</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
|
||||
@@ -127,7 +127,7 @@ Public Class frmDocumentResultList
|
||||
Private Function GetOperationMode() As OperationMode
|
||||
Dim oOperationMode As OperationMode
|
||||
|
||||
If Environment.Service.Client.IsOnline AndAlso Environment.Service.Address <> String.Empty Then
|
||||
If Environment.Service IsNot Nothing AndAlso Environment.Service.Client.IsOnline AndAlso Environment.Service.Address <> String.Empty Then
|
||||
oOperationMode = OperationMode.WithAppServer
|
||||
Else
|
||||
oOperationMode = OperationMode.NoAppServer
|
||||
@@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
|
||||
' übernehmen, indem Sie "*" eingeben:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("2.3.0.0")>
|
||||
<Assembly: AssemblyFileVersion("2.3.0.0")>
|
||||
<Assembly: AssemblyVersion("2.3.1.0")>
|
||||
<Assembly: AssemblyFileVersion("2.3.1.0")>
|
||||
|
||||
135
GUIs.Common/NNMsgBoxEx.Designer.vb
generated
135
GUIs.Common/NNMsgBoxEx.Designer.vb
generated
@@ -1,135 +0,0 @@
|
||||
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()>
|
||||
Partial Class NNMsgBoxEx
|
||||
Inherits DevExpress.XtraEditors.XtraForm
|
||||
|
||||
'Das Formular überschreibt den Löschvorgang, um die Komponentenliste zu bereinigen.
|
||||
<System.Diagnostics.DebuggerNonUserCode()>
|
||||
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
|
||||
Try
|
||||
If disposing AndAlso components IsNot Nothing Then
|
||||
components.Dispose()
|
||||
End If
|
||||
Finally
|
||||
MyBase.Dispose(disposing)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
'Wird vom Windows Form-Designer benötigt.
|
||||
Private components As System.ComponentModel.IContainer
|
||||
|
||||
'Hinweis: Die folgende Prozedur ist für den Windows Form-Designer erforderlich.
|
||||
'Das Bearbeiten ist mit dem Windows Form-Designer möglich.
|
||||
'Das Bearbeiten mit dem Code-Editor ist nicht möglich.
|
||||
<System.Diagnostics.DebuggerStepThrough()>
|
||||
Private Sub InitializeComponent()
|
||||
Me.chkBx = New System.Windows.Forms.CheckBox()
|
||||
Me.btn1 = New System.Windows.Forms.Button()
|
||||
Me.btn2 = New System.Windows.Forms.Button()
|
||||
Me.messageLbl = New System.Windows.Forms.Label()
|
||||
Me.btn3 = New System.Windows.Forms.Button()
|
||||
Me.PanelControl1 = New DevExpress.XtraEditors.PanelControl()
|
||||
CType(Me.PanelControl1, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
Me.PanelControl1.SuspendLayout()
|
||||
Me.SuspendLayout()
|
||||
'
|
||||
'chkBx
|
||||
'
|
||||
Me.chkBx.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
|
||||
Me.chkBx.AutoSize = True
|
||||
Me.chkBx.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
||||
Me.chkBx.Location = New System.Drawing.Point(12, 76)
|
||||
Me.chkBx.Name = "chkBx"
|
||||
Me.chkBx.Size = New System.Drawing.Size(152, 20)
|
||||
Me.chkBx.TabIndex = 22
|
||||
Me.chkBx.Text = "Don't show this again"
|
||||
Me.chkBx.UseVisualStyleBackColor = True
|
||||
Me.chkBx.Visible = False
|
||||
'
|
||||
'btn1
|
||||
'
|
||||
Me.btn1.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
||||
Me.btn1.AutoSize = True
|
||||
Me.btn1.DialogResult = System.Windows.Forms.DialogResult.Cancel
|
||||
Me.btn1.Location = New System.Drawing.Point(161, 12)
|
||||
Me.btn1.Name = "btn1"
|
||||
Me.btn1.Size = New System.Drawing.Size(100, 23)
|
||||
Me.btn1.TabIndex = 5
|
||||
Me.btn1.Text = "Button1"
|
||||
Me.btn1.UseVisualStyleBackColor = True
|
||||
Me.btn1.Visible = False
|
||||
'
|
||||
'btn2
|
||||
'
|
||||
Me.btn2.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
||||
Me.btn2.AutoSize = True
|
||||
Me.btn2.Location = New System.Drawing.Point(267, 12)
|
||||
Me.btn2.Name = "btn2"
|
||||
Me.btn2.Size = New System.Drawing.Size(100, 23)
|
||||
Me.btn2.TabIndex = 6
|
||||
Me.btn2.Text = "Button2"
|
||||
Me.btn2.UseVisualStyleBackColor = True
|
||||
Me.btn2.Visible = False
|
||||
'
|
||||
'messageLbl
|
||||
'
|
||||
Me.messageLbl.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
||||
Me.messageLbl.Location = New System.Drawing.Point(58, 10)
|
||||
Me.messageLbl.Name = "messageLbl"
|
||||
Me.messageLbl.Size = New System.Drawing.Size(415, 63)
|
||||
Me.messageLbl.TabIndex = 19
|
||||
Me.messageLbl.Text = "[Message]"
|
||||
'
|
||||
'btn3
|
||||
'
|
||||
Me.btn3.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
||||
Me.btn3.AutoSize = True
|
||||
Me.btn3.Location = New System.Drawing.Point(373, 12)
|
||||
Me.btn3.Name = "btn3"
|
||||
Me.btn3.Size = New System.Drawing.Size(100, 23)
|
||||
Me.btn3.TabIndex = 7
|
||||
Me.btn3.Text = "Button3"
|
||||
Me.btn3.UseVisualStyleBackColor = True
|
||||
Me.btn3.Visible = False
|
||||
'
|
||||
'PanelControl1
|
||||
'
|
||||
Me.PanelControl1.Controls.Add(Me.btn1)
|
||||
Me.PanelControl1.Controls.Add(Me.btn3)
|
||||
Me.PanelControl1.Controls.Add(Me.btn2)
|
||||
Me.PanelControl1.Dock = System.Windows.Forms.DockStyle.Bottom
|
||||
Me.PanelControl1.Location = New System.Drawing.Point(0, 102)
|
||||
Me.PanelControl1.Name = "PanelControl1"
|
||||
Me.PanelControl1.Size = New System.Drawing.Size(485, 47)
|
||||
Me.PanelControl1.TabIndex = 23
|
||||
'
|
||||
'NNMsgBoxEx
|
||||
'
|
||||
Me.Appearance.BackColor = System.Drawing.SystemColors.ControlLightLight
|
||||
Me.Appearance.Options.UseBackColor = True
|
||||
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None
|
||||
Me.CancelButton = Me.btn1
|
||||
Me.ClientSize = New System.Drawing.Size(485, 149)
|
||||
Me.Controls.Add(Me.PanelControl1)
|
||||
Me.Controls.Add(Me.chkBx)
|
||||
Me.Controls.Add(Me.messageLbl)
|
||||
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
|
||||
Me.MaximizeBox = False
|
||||
Me.MinimizeBox = False
|
||||
Me.Name = "NNMsgBoxEx"
|
||||
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
|
||||
Me.Text = "[Title]"
|
||||
CType(Me.PanelControl1, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
Me.PanelControl1.ResumeLayout(False)
|
||||
Me.PanelControl1.PerformLayout()
|
||||
Me.ResumeLayout(False)
|
||||
Me.PerformLayout()
|
||||
|
||||
End Sub
|
||||
|
||||
Private chkBx As System.Windows.Forms.CheckBox
|
||||
Private WithEvents btn1 As System.Windows.Forms.Button
|
||||
Private WithEvents btn2 As System.Windows.Forms.Button
|
||||
Private messageLbl As System.Windows.Forms.Label
|
||||
Private WithEvents btn3 As System.Windows.Forms.Button
|
||||
Friend WithEvents PanelControl1 As DevExpress.XtraEditors.PanelControl
|
||||
End Class
|
||||
@@ -1,196 +0,0 @@
|
||||
Imports System.Drawing
|
||||
Imports System.Windows.Forms
|
||||
|
||||
Public Class NNMsgBoxEx
|
||||
Public Sub New(message As String, title As String)
|
||||
Me.New(message, title, MessageBoxIcon.None)
|
||||
End Sub
|
||||
|
||||
Public Sub New(message As String, title As String, icon As MessageBoxIcon)
|
||||
Me.New(message, title, getMessageBoxIcon(icon))
|
||||
End Sub
|
||||
|
||||
Public Sub New(message As String, title As String, icon As Icon)
|
||||
InitializeComponent()
|
||||
messageLbl.Text = message
|
||||
Text = title
|
||||
m_sysIcon = icon
|
||||
If m_sysIcon Is Nothing Then messageLbl.Location = New System.Drawing.Point(FORM_X_MARGIN, FORM_Y_MARGIN)
|
||||
SetButtons("OK")
|
||||
End Sub
|
||||
|
||||
Private Shared Function getMessageBoxIcon(icon As MessageBoxIcon) As Icon
|
||||
Dim oIcon As Icon = Nothing
|
||||
|
||||
Select Case icon
|
||||
Case MessageBoxIcon.Asterisk
|
||||
oIcon = SystemIcons.Asterisk
|
||||
Case MessageBoxIcon.[Error]
|
||||
oIcon = SystemIcons.[Error]
|
||||
Case MessageBoxIcon.Exclamation
|
||||
oIcon = SystemIcons.Exclamation
|
||||
Case MessageBoxIcon.Question
|
||||
oIcon = SystemIcons.Question
|
||||
End Select
|
||||
|
||||
If oIcon IsNot Nothing Then
|
||||
Return DevExpress.Utils.Drawing.Helpers.StockIconHelper.GetWindows8AssociatedIcon(oIcon)
|
||||
Else
|
||||
Return Nothing
|
||||
End If
|
||||
End Function
|
||||
|
||||
Private m_minWidth As Integer
|
||||
Private m_minHeight As Integer
|
||||
|
||||
Public Sub SetMinSize(width As Integer, height As Integer)
|
||||
m_minWidth = width
|
||||
m_minHeight = height
|
||||
End Sub
|
||||
|
||||
Public Sub SetButtons(ParamArray names As String())
|
||||
Dim drs As DialogResult() = New DialogResult(names.Length - 1) {}
|
||||
|
||||
For i As Integer = 0 To names.Length - 1
|
||||
drs(i) = DialogResult.None
|
||||
Next
|
||||
|
||||
SetButtons(names, drs)
|
||||
End Sub
|
||||
|
||||
Public Sub SetButtons(names As String(), results As DialogResult())
|
||||
SetButtons(names, results, 1)
|
||||
End Sub
|
||||
|
||||
Public Sub SetButtons(names As String(), results As DialogResult(), def As Integer)
|
||||
If names Is Nothing Then Throw New ArgumentNullException("btnText", "Button Text is null")
|
||||
Dim count As Integer = names.Length
|
||||
If count < 1 OrElse count > 3 Then Throw New ArgumentException("Invalid number of buttons. Must be between 1 and 3.")
|
||||
m_minButtonRowWidth = setButtonParams(btn1, names(0), If(def = 1, 1, 2), results(0))
|
||||
|
||||
If count > 1 Then
|
||||
m_minButtonRowWidth += setButtonParams(btn2, names(1), If(def = 2, 1, 3), results(1)) + BUTTON_SPACE
|
||||
End If
|
||||
|
||||
If count > 2 Then
|
||||
m_minButtonRowWidth += setButtonParams(btn3, names(2), If(def = 3, 1, 4), results(2)) + BUTTON_SPACE
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private m_minButtonRowWidth As Integer
|
||||
|
||||
Private Shared Function setButtonParams(btn As Button, text As String, tab As Integer, dr As DialogResult) As Integer
|
||||
btn.Text = text
|
||||
btn.Visible = True
|
||||
btn.DialogResult = dr
|
||||
btn.TabIndex = tab
|
||||
Return btn.Size.Width
|
||||
End Function
|
||||
|
||||
Public Sub SetCheckbox(text As String)
|
||||
SetCheckbox(text, False)
|
||||
End Sub
|
||||
|
||||
Public Sub SetCheckbox(text As String, chcked As Boolean)
|
||||
chkBx.Visible = True
|
||||
chkBx.Text = text
|
||||
chkBx.Checked = chcked
|
||||
m_minButtonRowWidth += chkBx.Size.Width + CHECKBOX_SPACE
|
||||
End Sub
|
||||
|
||||
Private Sub DialogBox_Load(sender As Object, e As EventArgs)
|
||||
If Not btn1.Visible Then SetButtons(New String() {"OK"}, New DialogResult() {DialogResult.OK})
|
||||
m_minButtonRowWidth += 2 * FORM_X_MARGIN
|
||||
setDialogSize()
|
||||
setButtonRowLocations()
|
||||
End Sub
|
||||
|
||||
Const FORM_Y_MARGIN As Integer = 10
|
||||
Const FORM_X_MARGIN As Integer = 16
|
||||
Const BUTTON_SPACE As Integer = 5
|
||||
Const CHECKBOX_SPACE As Integer = 15
|
||||
Const TEXT_Y_MARGIN As Integer = 30
|
||||
|
||||
Private Sub setDialogSize()
|
||||
Dim requiredWidth As Integer = messageLbl.Location.X + messageLbl.Size.Width + FORM_X_MARGIN
|
||||
requiredWidth = If(requiredWidth > m_minButtonRowWidth, requiredWidth, m_minButtonRowWidth)
|
||||
Dim requiredHeight As Integer = messageLbl.Location.Y + messageLbl.Size.Height - btn2.Location.Y + ClientSize.Height + TEXT_Y_MARGIN
|
||||
Dim minSetWidth As Integer = If(ClientSize.Width > m_minWidth, ClientSize.Width, m_minWidth)
|
||||
Dim minSetHeight As Integer = If(ClientSize.Height > m_minHeight, ClientSize.Height, m_minHeight)
|
||||
Dim s As Size = New Size()
|
||||
s.Width = If(requiredWidth > minSetWidth, requiredWidth, minSetWidth)
|
||||
s.Height = If(requiredHeight > minSetHeight, requiredHeight, minSetHeight)
|
||||
ClientSize = s
|
||||
End Sub
|
||||
|
||||
Private Sub setButtonRowLocations()
|
||||
Dim formWidth As Integer = ClientRectangle.Width
|
||||
Dim x As Integer = formWidth - FORM_X_MARGIN
|
||||
Dim y As Integer = btn1.Location.Y
|
||||
|
||||
If btn3.Visible Then
|
||||
x -= btn3.Size.Width
|
||||
btn3.Location = New Point(x, y)
|
||||
x -= BUTTON_SPACE
|
||||
End If
|
||||
|
||||
If btn2.Visible Then
|
||||
x -= btn2.Size.Width
|
||||
btn2.Location = New Point(x, y)
|
||||
x -= BUTTON_SPACE
|
||||
End If
|
||||
|
||||
x -= btn1.Size.Width
|
||||
btn1.Location = New Point(x, y)
|
||||
If chkBx.Visible Then chkBx.Location = New Point(FORM_X_MARGIN, chkBx.Location.Y)
|
||||
End Sub
|
||||
|
||||
Private m_sysIcon As Icon
|
||||
|
||||
Protected Overrides Sub OnPaint(e As PaintEventArgs)
|
||||
If m_sysIcon IsNot Nothing Then
|
||||
Dim g As Graphics = e.Graphics
|
||||
g.DrawIconUnstretched(m_sysIcon, New Rectangle(FORM_X_MARGIN, FORM_Y_MARGIN, m_sysIcon.Width, m_sysIcon.Height))
|
||||
End If
|
||||
|
||||
MyBase.OnPaint(e)
|
||||
End Sub
|
||||
|
||||
Public ReadOnly Property CheckboxChecked As Boolean
|
||||
Get
|
||||
Return chkBx.Checked
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_result As DialogBoxResult
|
||||
|
||||
Public ReadOnly Property Result As DialogBoxResult
|
||||
Get
|
||||
Return m_result
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private Sub btn_Click(sender As Object, e As EventArgs) Handles btn1.Click, btn2.Click, btn3.Click
|
||||
If sender.Equals(btn1) Then
|
||||
m_result = DialogBoxResult.Button1
|
||||
ElseIf sender.Equals(btn2) Then
|
||||
m_result = DialogBoxResult.Button2
|
||||
ElseIf sender.Equals(btn3) Then
|
||||
m_result = DialogBoxResult.Button3
|
||||
End If
|
||||
|
||||
If (CType(sender, Button)).DialogResult = DialogResult.None Then
|
||||
Close()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Enum DialogBoxResult
|
||||
Button1
|
||||
Button2
|
||||
Button3
|
||||
End Enum
|
||||
|
||||
Private Sub NNMsgBoxEx_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
||||
|
||||
End Sub
|
||||
End Class
|
||||
271
GUIs.Common/frmSQLConfig.Designer.vb
generated
Normal file
271
GUIs.Common/frmSQLConfig.Designer.vb
generated
Normal file
@@ -0,0 +1,271 @@
|
||||
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
|
||||
Partial Class frmSQLConfig
|
||||
Inherits DevExpress.XtraEditors.XtraForm
|
||||
|
||||
'Das Formular überschreibt den Löschvorgang, um die Komponentenliste zu bereinigen.
|
||||
<System.Diagnostics.DebuggerNonUserCode()> _
|
||||
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
|
||||
Try
|
||||
If disposing AndAlso components IsNot Nothing Then
|
||||
components.Dispose()
|
||||
End If
|
||||
Finally
|
||||
MyBase.Dispose(disposing)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
'Wird vom Windows Form-Designer benötigt.
|
||||
Private components As System.ComponentModel.IContainer
|
||||
|
||||
'Hinweis: Die folgende Prozedur ist für den Windows Form-Designer erforderlich.
|
||||
'Das Bearbeiten ist mit dem Windows Form-Designer möglich.
|
||||
'Das Bearbeiten mit dem Code-Editor ist nicht möglich.
|
||||
<System.Diagnostics.DebuggerStepThrough()> _
|
||||
Private Sub InitializeComponent()
|
||||
Me.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(160, 15)
|
||||
Me.txtServerName.Name = "txtServerName"
|
||||
Me.txtServerName.Size = New System.Drawing.Size(427, 20)
|
||||
Me.txtServerName.StyleController = Me.LayoutControl1
|
||||
Me.txtServerName.TabIndex = 4
|
||||
'
|
||||
'txtUserName
|
||||
'
|
||||
Me.txtUserName.Location = New System.Drawing.Point(160, 45)
|
||||
Me.txtUserName.Name = "txtUserName"
|
||||
Me.txtUserName.Size = New System.Drawing.Size(136, 20)
|
||||
Me.txtUserName.StyleController = Me.LayoutControl1
|
||||
Me.txtUserName.TabIndex = 5
|
||||
'
|
||||
'txtPassword
|
||||
'
|
||||
Me.txtPassword.Location = New System.Drawing.Point(451, 45)
|
||||
Me.txtPassword.Name = "txtPassword"
|
||||
Me.txtPassword.Size = New System.Drawing.Size(136, 20)
|
||||
Me.txtPassword.StyleController = Me.LayoutControl1
|
||||
Me.txtPassword.TabIndex = 6
|
||||
'
|
||||
'cmbDatabase
|
||||
'
|
||||
Me.cmbDatabase.Location = New System.Drawing.Point(160, 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(427, 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, 164)
|
||||
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(160, 137)
|
||||
Me.txtConnectionString.Name = "txtConnectionString"
|
||||
Me.txtConnectionString.Properties.ReadOnly = True
|
||||
Me.txtConnectionString.Size = New System.Drawing.Size(427, 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, 18)
|
||||
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(142, 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(142, 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(142, 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(142, 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, 32)
|
||||
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, 122)
|
||||
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(142, 13)
|
||||
'
|
||||
'LayoutControlItem5
|
||||
'
|
||||
Me.LayoutControlItem5.Control = Me.btnTestConnection
|
||||
Me.LayoutControlItem5.Location = New System.Drawing.Point(291, 152)
|
||||
Me.LayoutControlItem5.Name = "LayoutControlItem5"
|
||||
Me.LayoutControlItem5.Size = New System.Drawing.Size(291, 49)
|
||||
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, 152)
|
||||
Me.EmptySpaceItem2.Name = "EmptySpaceItem2"
|
||||
Me.EmptySpaceItem2.Size = New System.Drawing.Size(291, 49)
|
||||
Me.EmptySpaceItem2.TextSize = New System.Drawing.Size(0, 0)
|
||||
'
|
||||
'frmSQLConfig
|
||||
'
|
||||
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 = "frmSQLConfig"
|
||||
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
|
||||
152
GUIs.Common/frmSQLConfig.vb
Normal file
152
GUIs.Common/frmSQLConfig.vb
Normal file
@@ -0,0 +1,152 @@
|
||||
Imports System.Data.SqlClient
|
||||
Imports System.Windows.Forms
|
||||
Imports DigitalData.Modules.Database
|
||||
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 = String.Empty
|
||||
Public Property FormTitle 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 FormTitle.Count > 0 Then
|
||||
Text = $"{FormTitle} - {Text}"
|
||||
End If
|
||||
|
||||
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 oPlainTextConnectionString = $"Server={txtServerName.Text};Database={cmbDatabase.Text};User Id={txtUserName.Text};Password={txtPassword.Text};"
|
||||
ConnectionString = MSSQLServer.EncryptConnectionString(oPlainTextConnectionString)
|
||||
Close()
|
||||
End If
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
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
|
||||
Reference in New Issue
Block a user