jj: update test gui

This commit is contained in:
Jonathan Jenne 2018-08-23 15:02:00 +02:00
parent 13e9b6b76e
commit 550041698f
2 changed files with 94 additions and 4 deletions

View File

@ -40,6 +40,9 @@ Partial Class Form1
Me.Label5 = New System.Windows.Forms.Label() Me.Label5 = New System.Windows.Forms.Label()
Me.Button5 = New System.Windows.Forms.Button() Me.Button5 = New System.Windows.Forms.Button()
Me.ComboBox1 = New System.Windows.Forms.ComboBox() Me.ComboBox1 = New System.Windows.Forms.ComboBox()
Me.TextBox1 = New System.Windows.Forms.TextBox()
Me.Label6 = New System.Windows.Forms.Label()
Me.Button4 = New System.Windows.Forms.Button()
CType(Me.GridControl1, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.GridControl1, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.GridView1, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.GridView1, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout() Me.SuspendLayout()
@ -55,7 +58,7 @@ Partial Class Form1
' '
'Button3 'Button3
' '
Me.Button3.Location = New System.Drawing.Point(297, 12) Me.Button3.Location = New System.Drawing.Point(556, 13)
Me.Button3.Name = "Button3" Me.Button3.Name = "Button3"
Me.Button3.Size = New System.Drawing.Size(56, 21) Me.Button3.Size = New System.Drawing.Size(56, 21)
Me.Button3.TabIndex = 2 Me.Button3.TabIndex = 2
@ -199,11 +202,40 @@ Partial Class Form1
Me.ComboBox1.Size = New System.Drawing.Size(121, 21) Me.ComboBox1.Size = New System.Drawing.Size(121, 21)
Me.ComboBox1.TabIndex = 19 Me.ComboBox1.TabIndex = 19
' '
'TextBox1
'
Me.TextBox1.Location = New System.Drawing.Point(362, 14)
Me.TextBox1.Name = "TextBox1"
Me.TextBox1.Size = New System.Drawing.Size(188, 21)
Me.TextBox1.TabIndex = 20
Me.TextBox1.Text = "sdd-vmx02-aps01"
'
'Label6
'
Me.Label6.AutoSize = True
Me.Label6.Location = New System.Drawing.Point(286, 17)
Me.Label6.Name = "Label6"
Me.Label6.Size = New System.Drawing.Size(70, 13)
Me.Label6.TabIndex = 21
Me.Label6.Text = "ServerName:"
'
'Button4
'
Me.Button4.Location = New System.Drawing.Point(764, 11)
Me.Button4.Name = "Button4"
Me.Button4.Size = New System.Drawing.Size(229, 23)
Me.Button4.TabIndex = 22
Me.Button4.Text = "Test Background Worker Logging"
Me.Button4.UseVisualStyleBackColor = True
'
'Form1 'Form1
' '
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(1050, 487) Me.ClientSize = New System.Drawing.Size(1050, 487)
Me.Controls.Add(Me.Button4)
Me.Controls.Add(Me.Label6)
Me.Controls.Add(Me.TextBox1)
Me.Controls.Add(Me.ComboBox1) Me.Controls.Add(Me.ComboBox1)
Me.Controls.Add(Me.Button5) Me.Controls.Add(Me.Button5)
Me.Controls.Add(Me.Label5) Me.Controls.Add(Me.Label5)
@ -249,4 +281,7 @@ Partial Class Form1
Friend WithEvents Label5 As Label Friend WithEvents Label5 As Label
Friend WithEvents Button5 As Button Friend WithEvents Button5 As Button
Friend WithEvents ComboBox1 As ComboBox Friend WithEvents ComboBox1 As ComboBox
Friend WithEvents TextBox1 As TextBox
Friend WithEvents Label6 As Label
Friend WithEvents Button4 As Button
End Class End Class

View File

@ -1,12 +1,34 @@
Imports DigitalData.Modules.Windream Imports DigitalData.Modules.Windream
Imports DigitalData.Modules.Logging Imports DigitalData.Modules.Logging
Imports System.ComponentModel
Public Class Form1 Public Class Form1
Dim MyLogger As LogConfig Dim MyLogger As LogConfig
Shared Logger As NLog.Logger
Protected _windream As Windream Protected _windream As Windream
Protected _windream2 As Windream2
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
_windream = New Windream("W", True) Dim serverName As String = TextBox1.Text
If _windream.LoggedInSession = True Then
' Windream.vb
'_windream = New Windream("W", True, False)
' Windream2.vb
Try
_windream2 = New ConnectionBuilder(MyLogger.LogFactory).
WithDriveLetter("W").
WithSessionReconnect().
With64BitSupport().
WithServerName("sdd-vmx02-aps01").
Connect()
Catch ex As Exception
Logger.Error(ex)
MsgBox("Login failed!")
Exit Sub
End Try
If _windream2.LoggedInSession = True Then
MsgBox("Session created") MsgBox("Session created")
Else Else
MsgBox("No session created") MsgBox("No session created")
@ -17,7 +39,20 @@ Public Class Form1
End Sub End Sub
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load
MyLogger = New LogConfig(LogConfig.PathType.AppData,) MyLogger = New LogConfig(LogConfig.PathType.CurrentDirectory, Nothing, "MAIN")
Logger = MyLogger.LogFactory.GetCurrentClassLogger()
Dim MySecondLogger = New LogConfig(LogConfig.PathType.CurrentDirectory, Nothing, "MAIN2")
Dim SecondLogger = MySecondLogger.LogFactory.GetCurrentClassLogger()
Logger.Warn("WANRING!!!")
Logger.Info("INFO!!!")
Logger.Debug("DEBUG!!!")
SecondLogger.Warn("WANRING!!!")
SecondLogger.Info("INFO!!!")
SecondLogger.Debug("DEBUG!!!")
End Sub End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles GetValue.Click Private Sub Button2_Click(sender As Object, e As EventArgs) Handles GetValue.Click
@ -86,4 +121,24 @@ Public Class Form1
ComboBox1.DroppedDown = True ComboBox1.DroppedDown = True
End Sub End Sub
Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
Dim bw1 As New BackgroundWorker
Dim bw2 As New BackgroundWorker
AddHandler bw1.DoWork, Sub()
Dim config1 As New LogConfig(LogConfig.PathType.CurrentDirectory, Nothing, "TEST1")
Dim logger As NLog.Logger = config1.LogFactory.GetCurrentClassLogger()
logger.Warn("WANRING!!!")
logger.Info("INFO!!!")
logger.Debug("DEBUG!!!")
Console.WriteLine("This is logger 1 calling!")
Console.WriteLine(config1.LogFile)
End Sub
bw1.RunWorkerAsync()
End Sub
End Class End Class