MS TestGui und Logger Daily

This commit is contained in:
Digital Data - Marlon Schreiber
2018-08-16 10:18:43 +02:00
parent bb42fccdbd
commit 07c4203f72
11 changed files with 421 additions and 104 deletions

View File

@@ -1,6 +1,24 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="TestGUI.My.MySettings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
<userSettings>
<TestGUI.My.MySettings>
<setting name="WMFilepath" serializeAs="String">
<value />
</setting>
<setting name="WMIndexName" serializeAs="String">
<value />
</setting>
<setting name="WMSearch" serializeAs="String">
<value />
</setting>
</TestGUI.My.MySettings>
</userSettings>
</configuration>

View File

@@ -23,40 +23,194 @@ Partial Class Form1
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.Button1 = New System.Windows.Forms.Button()
Me.Button3 = New System.Windows.Forms.Button()
Me.Label1 = New System.Windows.Forms.Label()
Me.Label2 = New System.Windows.Forms.Label()
Me.Label3 = New System.Windows.Forms.Label()
Me.txtWMValue = New System.Windows.Forms.TextBox()
Me.IndexFile = New System.Windows.Forms.Button()
Me.GetValue = New System.Windows.Forms.Button()
Me.Label4 = New System.Windows.Forms.Label()
Me.txtwmsearch = New System.Windows.Forms.TextBox()
Me.txtWMIndex = New System.Windows.Forms.TextBox()
Me.txtWMFile = New System.Windows.Forms.TextBox()
Me.Button2 = New System.Windows.Forms.Button()
Me.GridControl1 = New DevExpress.XtraGrid.GridControl()
Me.GridView1 = New DevExpress.XtraGrid.Views.Grid.GridView()
CType(Me.GridControl1, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.GridView1, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'Button1
'
Me.Button1.Location = New System.Drawing.Point(12, 78)
Me.Button1.Location = New System.Drawing.Point(12, 12)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(267, 23)
Me.Button1.TabIndex = 0
Me.Button1.Text = "windream instanzieren"
Me.Button1.UseVisualStyleBackColor = True
'
'Button3
'
Me.Button3.Location = New System.Drawing.Point(297, 12)
Me.Button3.Name = "Button3"
Me.Button3.Size = New System.Drawing.Size(56, 21)
Me.Button3.TabIndex = 2
Me.Button3.Text = "LogPath"
Me.Button3.UseVisualStyleBackColor = True
'
'Label1
'
Me.Label1.AutoSize = True
Me.Label1.Location = New System.Drawing.Point(16, 55)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(46, 13)
Me.Label1.TabIndex = 5
Me.Label1.Text = "WMFile:"
'
'Label2
'
Me.Label2.AutoSize = True
Me.Label2.Location = New System.Drawing.Point(16, 101)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(56, 13)
Me.Label2.TabIndex = 6
Me.Label2.Text = "WMIndex:"
'
'Label3
'
Me.Label3.AutoSize = True
Me.Label3.Location = New System.Drawing.Point(284, 101)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(37, 13)
Me.Label3.TabIndex = 7
Me.Label3.Text = "Value:"
'
'txtWMValue
'
Me.txtWMValue.Location = New System.Drawing.Point(287, 117)
Me.txtWMValue.Name = "txtWMValue"
Me.txtWMValue.Size = New System.Drawing.Size(263, 20)
Me.txtWMValue.TabIndex = 8
'
'IndexFile
'
Me.IndexFile.Location = New System.Drawing.Point(556, 74)
Me.IndexFile.Name = "IndexFile"
Me.IndexFile.Size = New System.Drawing.Size(75, 23)
Me.IndexFile.TabIndex = 9
Me.IndexFile.Text = "IndexFile"
Me.IndexFile.UseVisualStyleBackColor = True
'
'GetValue
'
Me.GetValue.Location = New System.Drawing.Point(287, 143)
Me.GetValue.Name = "GetValue"
Me.GetValue.Size = New System.Drawing.Size(99, 23)
Me.GetValue.TabIndex = 10
Me.GetValue.Text = "GetValue"
Me.GetValue.UseVisualStyleBackColor = True
'
'Label4
'
Me.Label4.AutoSize = True
Me.Label4.Location = New System.Drawing.Point(20, 195)
Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(46, 13)
Me.Label4.TabIndex = 12
Me.Label4.Text = "WMFile:"
'
'txtwmsearch
'
Me.txtwmsearch.DataBindings.Add(New System.Windows.Forms.Binding("Text", Global.TestGUI.My.MySettings.Default, "WMSearch", True, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged))
Me.txtwmsearch.Location = New System.Drawing.Point(19, 214)
Me.txtwmsearch.Name = "txtwmsearch"
Me.txtwmsearch.Size = New System.Drawing.Size(535, 20)
Me.txtwmsearch.TabIndex = 11
Me.txtwmsearch.Text = Global.TestGUI.My.MySettings.Default.WMSearch
'
'txtWMIndex
'
Me.txtWMIndex.DataBindings.Add(New System.Windows.Forms.Binding("Text", Global.TestGUI.My.MySettings.Default, "WMIndexName", True, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged))
Me.txtWMIndex.Location = New System.Drawing.Point(15, 117)
Me.txtWMIndex.Name = "txtWMIndex"
Me.txtWMIndex.Size = New System.Drawing.Size(267, 20)
Me.txtWMIndex.TabIndex = 4
Me.txtWMIndex.Text = Global.TestGUI.My.MySettings.Default.WMIndexName
'
'txtWMFile
'
Me.txtWMFile.DataBindings.Add(New System.Windows.Forms.Binding("Text", Global.TestGUI.My.MySettings.Default, "WMFilepath", True, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged))
Me.txtWMFile.Location = New System.Drawing.Point(15, 74)
Me.txtWMFile.Name = "txtWMFile"
Me.txtWMFile.Size = New System.Drawing.Size(535, 20)
Me.txtWMFile.TabIndex = 3
Me.txtWMFile.Text = Global.TestGUI.My.MySettings.Default.WMFilepath
'
'Button2
'
Me.Button2.Location = New System.Drawing.Point(12, 12)
Me.Button2.Location = New System.Drawing.Point(561, 214)
Me.Button2.Name = "Button2"
Me.Button2.Size = New System.Drawing.Size(267, 23)
Me.Button2.TabIndex = 1
Me.Button2.Text = "Logger initialisieren"
Me.Button2.Size = New System.Drawing.Size(75, 23)
Me.Button2.TabIndex = 13
Me.Button2.Text = "Button2"
Me.Button2.UseVisualStyleBackColor = True
'
'GridControl1
'
Me.GridControl1.Location = New System.Drawing.Point(19, 240)
Me.GridControl1.MainView = Me.GridView1
Me.GridControl1.Name = "GridControl1"
Me.GridControl1.Size = New System.Drawing.Size(535, 200)
Me.GridControl1.TabIndex = 14
Me.GridControl1.ViewCollection.AddRange(New DevExpress.XtraGrid.Views.Base.BaseView() {Me.GridView1})
'
'GridView1
'
Me.GridView1.GridControl = Me.GridControl1
Me.GridView1.Name = "GridView1"
'
'Form1
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(800, 450)
Me.Controls.Add(Me.GridControl1)
Me.Controls.Add(Me.Button2)
Me.Controls.Add(Me.Label4)
Me.Controls.Add(Me.txtwmsearch)
Me.Controls.Add(Me.GetValue)
Me.Controls.Add(Me.IndexFile)
Me.Controls.Add(Me.txtWMValue)
Me.Controls.Add(Me.Label3)
Me.Controls.Add(Me.Label2)
Me.Controls.Add(Me.Label1)
Me.Controls.Add(Me.txtWMIndex)
Me.Controls.Add(Me.txtWMFile)
Me.Controls.Add(Me.Button3)
Me.Controls.Add(Me.Button1)
Me.Name = "Form1"
Me.Text = "Form1"
CType(Me.GridControl1, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.GridView1, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents Button1 As Button
Friend WithEvents Button3 As Button
Friend WithEvents txtWMFile As TextBox
Friend WithEvents txtWMIndex As TextBox
Friend WithEvents Label1 As Label
Friend WithEvents Label2 As Label
Friend WithEvents Label3 As Label
Friend WithEvents txtWMValue As TextBox
Friend WithEvents IndexFile As Button
Friend WithEvents GetValue As Button
Friend WithEvents Label4 As Label
Friend WithEvents txtwmsearch As TextBox
Friend WithEvents Button2 As Button
Friend WithEvents GridControl1 As DevExpress.XtraGrid.GridControl
Friend WithEvents GridView1 As DevExpress.XtraGrid.Views.Grid.GridView
End Class

View File

@@ -1,7 +1,55 @@
Imports Modules.Windream
Imports Modules.Logging
Public Class Form1
Dim MyLogger As Logger
Protected _windream As Windream
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
_windream = New Windream("W", True)
If _windream.CurrentSessionIsLoggedIn = True Then
MsgBox("Session created")
Else
MsgBox("No session created")
End If
End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
Process.Start(MyLogger.LogDirectory)
End Sub
Dim WM As New Windream("W", True)
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load
MyLogger = New Logger(Logger.PathType.AppData)
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles GetValue.Click
My.Settings.Save
Dim result As DataTable = _windream.GetValueforIndex(txtWMFile.Text, txtWMIndex.Text)
If result.Rows.Count = 0 Then
MsgBox("No result")
Else
txtWMValue.Text = result.Rows(0).Item(0).ToString
End If
End Sub
Private Sub IndexFile_Click(sender As Object, e As EventArgs) Handles IndexFile.Click
My.Settings.Save()
Dim arrValue() As String = Nothing
ReDim Preserve arrValue(0)
arrValue(0) = txtWMValue.Text
If _windream.NewIndexFile(txtWMFile.Text, txtWMIndex.Text, arrValue) = True Then
MsgBox("Success")
Else
MsgBox("no indexing")
End If
End Sub
Private Sub Button2_Click_1(sender As Object, e As EventArgs) Handles Button2.Click
My.Settings.Save()
Dim DTResults As DataTable = _windream.GetSearchDocuments(txtwmsearch.Text, "Dokument-ID")
If DTResults.Rows.Count > 0 Then
GridControl1.DataSource = DTResults
Else
GridControl1.DataSource = Nothing
GridView1.Columns.Clear()
End If
End Sub
End Class

View File

@@ -10,7 +10,7 @@ Imports System.Runtime.InteropServices
<Assembly: AssemblyTitle("TestGUI")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyCompany("DD JJMS")>
<Assembly: AssemblyProduct("TestGUI")>
<Assembly: AssemblyCopyright("Copyright © 2018")>
<Assembly: AssemblyTrademark("")>

View File

@@ -1,10 +1,10 @@
'------------------------------------------------------------------------------
' <auto-generated>
' 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.
' </auto-generated>
'------------------------------------------------------------------------------
@@ -13,57 +13,93 @@ Option Explicit On
Namespace My
<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0"), _
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.7.0.0"), _
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
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
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
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
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
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
End Property
<Global.System.Configuration.UserScopedSettingAttribute(), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Configuration.DefaultSettingValueAttribute("")> _
Public Property WMFilepath() As String
Get
Return CType(Me("WMFilepath"),String)
End Get
Set
Me("WMFilepath") = value
End Set
End Property
<Global.System.Configuration.UserScopedSettingAttribute(), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Configuration.DefaultSettingValueAttribute("")> _
Public Property WMIndexName() As String
Get
Return CType(Me("WMIndexName"),String)
End Get
Set
Me("WMIndexName") = value
End Set
End Property
<Global.System.Configuration.UserScopedSettingAttribute(), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Configuration.DefaultSettingValueAttribute("")> _
Public Property WMSearch() As String
Get
Return CType(Me("WMSearch"),String)
End Get
Set
Me("WMSearch") = value
End Set
End Property
End Class
End Namespace
Namespace My
<Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _
<Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _
Friend Module MySettingsProperty
<Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _
<Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _
Friend ReadOnly Property Settings() As Global.TestGUI.My.MySettings
Get
Return Global.TestGUI.My.MySettings.Default

View File

@@ -1,7 +1,15 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" UseMySettingsClassName="true">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="My" GeneratedClassName="MySettings" UseMySettingsClassName="true">
<Profiles />
<Settings>
<Setting Name="WMFilepath" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="WMIndexName" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="WMSearch" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
</Settings>
</SettingsFile>

View File

@@ -0,0 +1 @@
DevExpress.XtraGrid.GridControl, DevExpress.XtraGrid.v18.1, Version=18.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a

View File

@@ -47,13 +47,29 @@
<OptionInfer>On</OptionInfer>
</PropertyGroup>
<ItemGroup>
<Reference Include="DevExpress.Data.v18.1, Version=18.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<Reference Include="DevExpress.Printing.v18.1.Core, Version=18.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<Reference Include="DevExpress.Utils.v18.1, Version=18.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<Reference Include="DevExpress.XtraEditors.v18.1, Version=18.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<Reference Include="DevExpress.XtraGrid.v18.1, Version=18.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.XtraLayout.v18.1, Version=18.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<Reference Include="DevExpress.XtraPrinting.v18.1, Version=18.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="Modules.Windream">
<HintPath>..\Modules.Windream\bin\Debug\Modules.Windream.dll</HintPath>
</Reference>
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.5.8\lib\net45\NLog.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.IO.Compression" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.ServiceModel" />
<Reference Include="System.Transactions" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
@@ -102,6 +118,7 @@
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="My Project\licenses.licx" />
<EmbeddedResource Include="My Project\Resources.resx">
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
@@ -120,6 +137,16 @@
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
</None>
<None Include="App.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<WCFMetadata Include="Connected Services\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Modules.Logging\Modules.Logging.vbproj">
<Project>{903b2d7d-3b80-4be9-8713-7447b704e1b0}</Project>
<Name>Modules.Logging</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
</Project>

4
TestGUI/packages.config Normal file
View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="NLog" version="4.5.8" targetFramework="net461" />
</packages>