jj: update test gui
This commit is contained in:
parent
13e9b6b76e
commit
550041698f
37
TestGUI/Form1.Designer.vb
generated
37
TestGUI/Form1.Designer.vb
generated
@ -40,6 +40,9 @@ Partial Class Form1
|
||||
Me.Label5 = New System.Windows.Forms.Label()
|
||||
Me.Button5 = New System.Windows.Forms.Button()
|
||||
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.GridView1, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
Me.SuspendLayout()
|
||||
@ -55,7 +58,7 @@ Partial Class Form1
|
||||
'
|
||||
'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.Size = New System.Drawing.Size(56, 21)
|
||||
Me.Button3.TabIndex = 2
|
||||
@ -199,11 +202,40 @@ Partial Class Form1
|
||||
Me.ComboBox1.Size = New System.Drawing.Size(121, 21)
|
||||
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
|
||||
'
|
||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
||||
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
|
||||
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.Button5)
|
||||
Me.Controls.Add(Me.Label5)
|
||||
@ -249,4 +281,7 @@ Partial Class Form1
|
||||
Friend WithEvents Label5 As Label
|
||||
Friend WithEvents Button5 As Button
|
||||
Friend WithEvents ComboBox1 As ComboBox
|
||||
Friend WithEvents TextBox1 As TextBox
|
||||
Friend WithEvents Label6 As Label
|
||||
Friend WithEvents Button4 As Button
|
||||
End Class
|
||||
|
||||
@ -1,12 +1,34 @@
|
||||
Imports DigitalData.Modules.Windream
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports System.ComponentModel
|
||||
|
||||
Public Class Form1
|
||||
Dim MyLogger As LogConfig
|
||||
Shared Logger As NLog.Logger
|
||||
|
||||
Protected _windream As Windream
|
||||
Protected _windream2 As Windream2
|
||||
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
|
||||
_windream = New Windream("W", True)
|
||||
If _windream.LoggedInSession = True Then
|
||||
Dim serverName As String = TextBox1.Text
|
||||
|
||||
' 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")
|
||||
Else
|
||||
MsgBox("No session created")
|
||||
@ -17,7 +39,20 @@ Public Class Form1
|
||||
End Sub
|
||||
|
||||
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
|
||||
|
||||
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles GetValue.Click
|
||||
@ -86,4 +121,24 @@ Public Class Form1
|
||||
ComboBox1.DroppedDown = True
|
||||
|
||||
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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user