Compare commits

...

4 Commits

Author SHA1 Message Date
Jonathan Jenne
5cf8636e49 30-08-2023 2023-08-30 16:09:32 +02:00
Jonathan Jenne
ea8ed48d25 15-08-23 2023-08-15 13:27:50 +02:00
Jonathan Jenne
775418fb7a 15-08-2023 2023-08-15 12:40:49 +02:00
Jonathan Jenne
3fa731fe5f 14-08-2023 2023-08-14 16:48:21 +02:00
34 changed files with 850 additions and 103 deletions

View File

@ -1,5 +1,5 @@
Public Class Config Public Class Config
Public Property ActiveModule As String = "slt" Public Property ActiveModule As String = "NONE"
''' <summary> ''' <summary>
''' This connection string needs to point to the database where the document data will be written to ''' This connection string needs to point to the database where the document data will be written to
@ -24,6 +24,9 @@
Public Property SQLQueryFetch As String = "" Public Property SQLQueryFetch As String = ""
Public Property OutputDirectory As String = "" Public Property OutputDirectory As String = ""
Public Property AddDateSubDirectory As Boolean = False
Public Property AddImportSubDirectory As Boolean = False
Public Property TimerIntervalMin As Integer = 0 Public Property TimerIntervalMin As Integer = 0
Public Property Debug As Boolean = False Public Property Debug As Boolean = False

View File

@ -0,0 +1,145 @@
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{8F0AC45C-C610-4432-9078-82DD26EA3E8F}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>Connectors.Common</RootNamespace>
<AssemblyName>Connectors.Common</AssemblyName>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<OptionExplicit>On</OptionExplicit>
<OptionCompare>Binary</OptionCompare>
<OptionStrict>Off</OptionStrict>
<OptionInfer>On</OptionInfer>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineDebug>true</DefineDebug>
<DefineTrace>true</DefineTrace>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineDebug>false</DefineDebug>
<DefineTrace>true</DefineTrace>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup>
<MyType>Windows</MyType>
</PropertyGroup>
<PropertyGroup>
<StartupObject>
</StartupObject>
</PropertyGroup>
<ItemGroup>
<Reference Include="DigitalData.Modules.Base">
<HintPath>..\..\DDModules\Base\bin\Debug\DigitalData.Modules.Base.dll</HintPath>
</Reference>
<Reference Include="DigitalData.Modules.Database">
<HintPath>..\..\DDModules\Database\bin\Debug\DigitalData.Modules.Database.dll</HintPath>
</Reference>
<Reference Include="DigitalData.Modules.Logging">
<HintPath>..\..\DDModules\Logging\bin\Debug\DigitalData.Modules.Logging.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.5.0.5\lib\net46\NLog.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.IO.Compression" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Import Include="Microsoft.VisualBasic" />
<Import Include="System.Collections.Generic" />
<Import Include="System.Diagnostics" />
<Import Include="System.Data" />
<Import Include="System.Drawing" />
<Import Include="System.Windows.Forms" />
<Import Include="System.Linq" />
<Import Include="System.Xml.Linq" />
<Import Include="System" />
</ItemGroup>
<ItemGroup>
<Compile Include="Config.vb" />
<Compile Include="Modules\BaseModule.vb" />
<Compile Include="Modules\ISync.vb" />
<Compile Include="Modules\Sharepoint\Constants.vb" />
<Compile Include="Modules\Sharepoint\Entities\SharepointDocument.vb" />
<Compile Include="Modules\Sharepoint\SharepointException.vb" />
<Compile Include="Modules\Sharepoint\SharepointSync.vb" />
<Compile Include="Modules\slt\Constants.vb" />
<Compile Include="Modules\slt\Entities\sltAvailableSystem.vb" />
<Compile Include="Modules\slt\Entities\sltDocument.vb" />
<Compile Include="Modules\slt\Responses\sltDocumentResponse.vb" />
<Compile Include="Modules\slt\Responses\sltLoginResponse.vb" />
<Compile Include="Modules\slt\Responses\sltLogoutResponse.vb" />
<Compile Include="Modules\slt\Responses\sltMandatorResponse.vb" />
<Compile Include="Modules\slt\Responses\sltResponse.vb" />
<Compile Include="Modules\slt\sltException.vb" />
<Compile Include="Modules\slt\sltSync.vb" />
<Compile Include="My Project\Application.Designer.vb">
<AutoGen>True</AutoGen>
<DependentUpon>Application.myapp</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<Compile Include="My Project\AssemblyInfo.vb" />
<EmbeddedResource Include="My Project\Resources.resx">
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
<CustomToolNamespace>My.Resources</CustomToolNamespace>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="My Project\Resources.Designer.vb">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<None Include="My Project\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
</None>
<None Include="app.config" />
<Compile Include="My Project\Settings.Designer.vb">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<None Include="My Project\Application.myapp">
<Generator>MyApplicationCodeGenerator</Generator>
<LastGenOutput>Application.Designer.vb</LastGenOutput>
</None>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@ -1,6 +1,5 @@
Imports System.IO Imports System.IO
Imports System.Threading.Tasks Imports System.Threading.Tasks
Imports DevExpress.DocumentView
Imports DigitalData.Modules.Base Imports DigitalData.Modules.Base
Imports DigitalData.Modules.Database Imports DigitalData.Modules.Database
Imports DigitalData.Modules.Logging Imports DigitalData.Modules.Logging
@ -12,13 +11,23 @@ Public MustInherit Class BaseModule
Friend ReadOnly Config As Config Friend ReadOnly Config As Config
Friend ReadOnly Database As MSSQLServer Friend ReadOnly Database As MSSQLServer
Public Const DIVIDER_TEXT = "-------------------------------------"
Public Enum LogLevel
Info
Warn
[Error]
End Enum
Public MustOverride Property Name As String Implements ISync.Name Public MustOverride Property Name As String Implements ISync.Name
Public MustOverride Property IsLoggedIn As Boolean Implements ISync.IsLoggedIn Public MustOverride Property IsLoggedIn As Boolean Implements ISync.IsLoggedIn
Public MustOverride Async Function Run() As Task Implements ISync.Run Public MustOverride Async Function Run() As Task Implements ISync.Run
Public MustOverride Function Cleanup() As Task Implements ISync.Cleanup Public MustOverride Function Cleanup() As Task Implements ISync.Cleanup
Public MustOverride Function TestConfigIsComplete() As Boolean Implements ISync.TestConfigIsComplete Public MustOverride Function TestConfigIsComplete() As Boolean Implements ISync.TestConfigIsComplete
Public Event OnLogEntry As EventHandler(Of String) Implements ISync.OnLogEntry Public Event OnLogEntry As EventHandler(Of Tuple(Of String, LogLevel)) Implements ISync.OnLogEntry
Public Event OnFileProcessed As EventHandler(Of String) Implements ISync.OnFileProcessed
Public Event OnFileError As EventHandler(Of String) Implements ISync.OnFileError
Public Sub New(pLogConfig As LogConfig, pDatabase As MSSQLServer, pConfig As Config) Public Sub New(pLogConfig As LogConfig, pDatabase As MSSQLServer, pConfig As Config)
MyBase.New(pLogConfig) MyBase.New(pLogConfig)
@ -64,6 +73,39 @@ Public MustInherit Class BaseModule
Return StringEx.ConvertTextToSlug(oName) & oExtension Return StringEx.ConvertTextToSlug(oName) & oExtension
End Function End Function
Friend Function GetFinalFileName(pFileName As String, pId As String) As String
Dim oExtension = Path.GetExtension(pFileName)
Return pId & oExtension
End Function
Friend Function GetFinalFilePath(pFileName As String) As String
Dim oFinalDirectoryPath = Config.OutputDirectory
If Config.AddDateSubDirectory = True Then
Dim oSubPath = FileEx.CreateDateDirectory(oFinalDirectoryPath)
If oSubPath Is Nothing Then
Throw New ApplicationException("Output sub path could not be created!")
End If
Logger.Debug("Date Subdirectory [{0}] created.", oSubPath)
oFinalDirectoryPath = oSubPath
End If
If Config.AddImportSubDirectory = True Then
Dim oGuid = Guid.NewGuid.ToString()
Dim oSubPath = Path.Combine(oFinalDirectoryPath, oGuid)
Try
Directory.CreateDirectory(oSubPath)
Catch ex As Exception
Throw New ApplicationException("Output subpath could not be created!")
End Try
Logger.Debug("Import Subdirectory [{0}] created", oSubPath)
oFinalDirectoryPath = oSubPath
End If
Return Path.Combine(oFinalDirectoryPath, pFileName)
End Function
Friend Function CopyFileToOutputPath(pFileContents As Byte(), pFilePath As String) As Boolean Friend Function CopyFileToOutputPath(pFileContents As Byte(), pFilePath As String) As Boolean
Try Try
Using oStream As New MemoryStream(pFileContents) Using oStream As New MemoryStream(pFileContents)
@ -108,14 +150,25 @@ Public MustInherit Class BaseModule
End Function End Function
Friend Sub AddInfoEntry(pMessage As String, ParamArray pArgs As Object()) Friend Sub AddInfoEntry(pMessage As String, ParamArray pArgs As Object())
RaiseEvent OnLogEntry(Me, String.Format(pMessage, pArgs)) RaiseEvent OnLogEntry(Me, New Tuple(Of String, LogLevel)(String.Format(pMessage, pArgs), LogLevel.Info))
End Sub End Sub
Friend Sub AddWarnEntry(pMessage As String, ParamArray pArgs As Object()) Friend Sub AddWarnEntry(pMessage As String, ParamArray pArgs As Object())
RaiseEvent OnLogEntry(Me, String.Format(pMessage, pArgs)) RaiseEvent OnLogEntry(Me, New Tuple(Of String, LogLevel)(String.Format(pMessage, pArgs), LogLevel.Warn))
End Sub End Sub
Friend Sub AddErrorEntry(pMessage As String, ParamArray pArgs As Object())
RaiseEvent OnLogEntry(Me, New Tuple(Of String, LogLevel)(String.Format(pMessage, pArgs), LogLevel.Error))
End Sub
Friend Sub AddDivider() Friend Sub AddDivider()
RaiseEvent OnLogEntry(Me, "---") RaiseEvent OnLogEntry(Me, New Tuple(Of String, LogLevel)(DIVIDER_TEXT, LogLevel.Info))
End Sub
Friend Sub RaiseFileProcessed(pFilePath As String)
RaiseEvent OnFileProcessed(Me, pFilePath)
End Sub
Friend Sub RaiseFileError(pFilePath As String)
RaiseEvent OnFileError(Me, pFilePath)
End Sub End Sub
End Class End Class

View File

@ -7,5 +7,7 @@ Public Interface ISync
Function Cleanup() As Task Function Cleanup() As Task
Function TestConfigIsComplete() As Boolean Function TestConfigIsComplete() As Boolean
Event OnLogEntry As EventHandler(Of String) Event OnLogEntry As EventHandler(Of Tuple(Of String, BaseModule.LogLevel))
Event OnFileProcessed As EventHandler(Of String)
Event OnFileError As EventHandler(Of String)
End Interface End Interface

View File

@ -1,8 +1,5 @@
Imports System.ComponentModel Imports System.Threading.Tasks
Imports System.IO
Imports System.Threading.Tasks
Imports DigitalData.Modules.Base Imports DigitalData.Modules.Base
Imports DigitalData.Modules.Config
Imports DigitalData.Modules.Database Imports DigitalData.Modules.Database
Imports DigitalData.Modules.Logging Imports DigitalData.Modules.Logging
Namespace Sharepoint Namespace Sharepoint
@ -10,8 +7,6 @@ Namespace Sharepoint
Inherits BaseModule Inherits BaseModule
Implements ISync Implements ISync
Private Const STRING1_PLACEHOLDER = "[String1]"
Public Overrides Property Name As String = "Sharepoint Sync" Public Overrides Property Name As String = "Sharepoint Sync"
Public Overrides Property IsLoggedIn As Boolean Public Overrides Property IsLoggedIn As Boolean
@ -45,33 +40,28 @@ Namespace Sharepoint
Logger.Info("ExtDocId: [{0}]", oDocument.Id) Logger.Info("ExtDocId: [{0}]", oDocument.Id)
Dim oFileName = ConvertFilenameToSlug(oDocument.Name) Dim oFileName = ConvertFilenameToSlug(oDocument.Name)
Dim oSubPath = FileEx.CreateDateDirectory(Config.OutputDirectory) Dim oTempFileName = GetFinalFileName(oDocument.Name, oDocument.Id)
If oSubPath Is Nothing Then Dim oFilePath = GetFinalFilePath(oTempFileName)
Throw New ApplicationException("Output sub path could not be created!")
End If
Dim oFilePath = Path.Combine(oSubPath, oFileName)
Logger.Debug("Subdirectory [{0}] created.", oSubPath)
If CopyFileToOutputPath(oDocument.Data, oFilePath) = False Then If CopyFileToOutputPath(oDocument.Data, oFilePath) = False Then
Throw New ApplicationException("File could not be created in output path!") Throw New ApplicationException("File could not be created in output path!")
End If End If
Dim oSQL = String.Format(Config.SQLQueryExport, oDocument.Id, oFileName) Dim oSQL = String.Format(Config.SQLQueryExport, oDocument.Id, oFileName)
If Await Database.ExecuteNonQueryAsync(oSQL) = True Then
If oSQL.Contains(STRING1_PLACEHOLDER) Then RaiseFileProcessed(oFilePath)
oSQL.Replace(STRING1_PLACEHOLDER, oDocument.Path) Else
Throw New ApplicationException("Database entry could not be written!")
End If End If
Await Database.ExecuteNonQueryAsync(oSQL)
Catch ex As Exception Catch ex As Exception
RaiseFileError(oDocId)
Logger.Error(ex) Logger.Error(ex)
AddWarnEntry("Error while running Sync: " & ex.Message) AddWarnEntry("Error while running Sync: " & ex.Message)
End Try End Try
Next Next
'TODO
AddInfoEntry("Finished Sync.") AddInfoEntry("Finished Sync.")
Catch ex As Exception Catch ex As Exception
Logger.Error(ex) Logger.Error(ex)
@ -96,8 +86,6 @@ Namespace Sharepoint
Return oComplete Return oComplete
End Function End Function
Private Async Function GetDocumentContent(pDocumentId As String) As Task(Of Entities.SharepointDocument) Private Async Function GetDocumentContent(pDocumentId As String) As Task(Of Entities.SharepointDocument)
Try Try
Dim oSql As String = $"SELECT T.LeafName, T.DirName, T2.Content Dim oSql As String = $"SELECT T.LeafName, T.DirName, T2.Content
@ -105,7 +93,7 @@ Namespace Sharepoint
INNER JOIN {Config.SharepointConfiguration.SharepointDatabase}.[AllDocStreams] T2 INNER JOIN {Config.SharepointConfiguration.SharepointDatabase}.[AllDocStreams] T2
ON T.Id = T2.Id AND T.InternalVersion = T2.InternalVersion AND T.SiteId = T2.SiteId ON T.Id = T2.Id AND T.InternalVersion = T2.InternalVersion AND T.SiteId = T2.SiteId
WHERE T.Id = '{pDocumentId}'" WHERE T.Id = '{pDocumentId}'"
Dim oTable As DataTable = Database.GetDatatable(oSql) Dim oTable As DataTable = Await Database.GetDatatableAsync(oSql)
If oTable Is Nothing OrElse oTable.Rows.Count = 0 Then If oTable Is Nothing OrElse oTable.Rows.Count = 0 Then
Logger.Warn("Document with Id [{0}] was not found in SharePoint Database!", pDocumentId) Logger.Warn("Document with Id [{0}] was not found in SharePoint Database!", pDocumentId)

View File

@ -1,15 +1,13 @@
Imports System.IO Imports System.Net.Http
Imports System.Net.Http
Imports Newtonsoft.Json Imports Newtonsoft.Json
Imports DigitalData.Modules.Base Imports DigitalData.Modules.Base
Imports DigitalData.Modules.Base.ModuleExtensions Imports DigitalData.Modules.Base.ModuleExtensions
Imports DigitalData.Modules.Database Imports DigitalData.Modules.Database
Imports DigitalData.Modules.Logging Imports DigitalData.Modules.Logging
Imports Connectors.Form.slt.Constants Imports Connectors.Common.slt.Constants
Imports Connectors.Form.slt.Responses Imports Connectors.Common.slt.Responses
Imports Connectors.Form.slt.Entities Imports Connectors.Common.slt.Entities
Imports System.Threading.Tasks Imports System.Threading.Tasks
Imports DigitalData.Modules.Config
Namespace slt Namespace slt
Public Class sltSync Public Class sltSync
@ -53,23 +51,25 @@ Namespace slt
AddInfoEntry("Document: [{0}]", oDocument.Name) AddInfoEntry("Document: [{0}]", oDocument.Name)
Logger.Info("ExtDocId: [{0}]", oDocument.ExtDocId) Logger.Info("ExtDocId: [{0}]", oDocument.ExtDocId)
Dim oDocumentName = GetFilenameWithExtension(oDocument.Name, oDocument.DocMimeType) Dim oDocumentName = GetFilenameWithExtension(oDocument.ExtDocId, oDocument.DocMimeType)
Dim oFileName = ConvertFilenameToSlug(oDocumentName) Dim oFileName = ConvertFilenameToSlug(oDocumentName)
Dim oSubPath = FileEx.CreateDateDirectory(Config.OutputDirectory) Dim oTempFileName = GetFinalFileName(oFileName, oDocument.ExtDocId)
If oSubPath Is Nothing Then Dim oFilePath = GetFinalFilePath(oFileName)
Throw New ApplicationException("Output sub path could not be created!")
End If
Dim oFilePath = Path.Combine(oSubPath, oFileName)
Logger.Debug("Subdirectory [{0}] created.", oSubPath)
If CopyFileToOutputPath(oDocument.Data, oFilePath) = False Then If CopyFileToOutputPath(oDocument.Data, oFilePath) = False Then
Throw New ApplicationException("File could not be created in output path!") Throw New ApplicationException("File could not be created in output path!")
End If End If
Dim oSQL = String.Format(Config.SQLQueryExport, oDocument.ExtDocId, oFileName) Dim oSQL = String.Format(Config.SQLQueryExport, oDocument.ExtDocId, oFileName)
Await Database.ExecuteNonQueryAsync(oSQL) If Await Database.ExecuteNonQueryAsync(oSQL) = True Then
RaiseFileProcessed(oFilePath)
Else
Throw New ApplicationException("Database entry could not be written!")
End If
Catch ex As Exception Catch ex As Exception
RaiseFileError(oDocId)
Logger.Error(ex) Logger.Error(ex)
AddWarnEntry("Error while running Sync: " & ex.Message) AddWarnEntry("Error while running Sync: " & ex.Message)
End Try End Try

View File

@ -0,0 +1,13 @@
'------------------------------------------------------------------------------
' <auto-generated>
' Dieser Code wurde von einem Tool generiert.
' Laufzeitversion:4.0.30319.42000
'
' Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
' der Code erneut generiert wird.
' </auto-generated>
'------------------------------------------------------------------------------
Option Strict On
Option Explicit On

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<MySubMain>true</MySubMain>
<MainForm>Form1</MainForm>
<SingleInstance>false</SingleInstance>
<ShutdownMode>0</ShutdownMode>
<EnableVisualStyles>true</EnableVisualStyles>
<AuthenticationMode>0</AuthenticationMode>
<ApplicationType>0</ApplicationType>
<SaveMySettingsOnExit>true</SaveMySettingsOnExit>
</MyApplicationData>

View File

@ -0,0 +1,36 @@
Imports System.Reflection
Imports System.Runtime.CompilerServices
Imports System.Runtime.InteropServices
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
<Assembly: AssemblyTitle("Connectors.Common")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyConfiguration("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("Connectors.Common")>
<Assembly: AssemblyCopyright("Copyright © 2023")>
<Assembly: AssemblyTrademark("")>
<Assembly: AssemblyCulture("")>
' Setting ComVisible to false makes the types in this assembly not visible
' to COM components. If you need to access a type in this assembly from
' COM, set the ComVisible attribute to true on that type.
<Assembly: ComVisible(False)>
' The following GUID is for the ID of the typelib if this project is exposed to COM
<Assembly: Guid("9006f149-aa49-4b8e-ba69-386d945fa738")>
' Version information for an assembly consists of the following four values:
'
' Major Version
' Minor Version
' Build Number
' Revision
'
' You can specify all the values or you can default the Build and Revision Numbers
' by using the '*' as shown below:
' [assembly: AssemblyVersion("1.0.*")]
<Assembly: AssemblyVersion("1.0.0.0")>
<Assembly: AssemblyFileVersion("1.0.0.0")>

View File

@ -0,0 +1,63 @@
'------------------------------------------------------------------------------
' <auto-generated>
' Dieser Code wurde von einem Tool generiert.
' Laufzeitversion:4.0.30319.42000
'
' Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
' der Code erneut generiert wird.
' </auto-generated>
'------------------------------------------------------------------------------
Option Strict On
Option Explicit On
Imports System
Namespace My.Resources
'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.
'''<summary>
''' Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
'''</summary>
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0"), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _
Friend Module Resources
Private resourceMan As Global.System.Resources.ResourceManager
Private resourceCulture As Global.System.Globalization.CultureInfo
'''<summary>
''' Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird.
'''</summary>
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
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("Connectors.Common.Resources", GetType(Resources).Assembly)
resourceMan = temp
End If
Return resourceMan
End Get
End Property
'''<summary>
''' Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle
''' Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden.
'''</summary>
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Friend Property Culture() As Global.System.Globalization.CultureInfo
Get
Return resourceCulture
End Get
Set
resourceCulture = value
End Set
End Property
End Module
End Namespace

View File

@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0"></xsd:element>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string"></xsd:attribute>
<xsd:attribute name="type" type="xsd:string"></xsd:attribute>
<xsd:attribute name="mimetype" type="xsd:string"></xsd:attribute>
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string"></xsd:attribute>
<xsd:attribute name="name" type="xsd:string"></xsd:attribute>
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"></xsd:element>
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2"></xsd:element>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1"></xsd:attribute>
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3"></xsd:attribute>
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4"></xsd:attribute>
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"></xsd:element>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required"></xsd:attribute>
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -0,0 +1,73 @@
'------------------------------------------------------------------------------
' <auto-generated>
' Dieser Code wurde von einem Tool generiert.
' Laufzeitversion:4.0.30319.42000
'
' Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
' der Code erneut generiert wird.
' </auto-generated>
'------------------------------------------------------------------------------
Option Strict On
Option Explicit On
Namespace My
<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.5.0.0"), _
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Partial Friend NotInheritable Class Settings
Inherits Global.System.Configuration.ApplicationSettingsBase
Private Shared defaultInstance As Settings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New Settings()),Settings)
#Region "Automatische My.Settings-Speicherfunktion"
#If _MyType = "WindowsForms" Then
Private Shared addedHandler As Boolean
Private Shared addedHandlerLockObject As New Object
<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 Settings
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
#End If
Return defaultInstance
End Get
End Property
End Class
End Namespace
Namespace My
<Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _
Friend Module MySettingsProperty
<Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _
Friend ReadOnly Property Settings() As Global.Connectors.Common.My.Settings
Get
Return Global.Connectors.Common.My.Settings.Default
End Get
End Property
End Module
End Namespace

View File

@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

View File

@ -0,0 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System">
<section name="DevExpress.LookAndFeel.Design.AppSettings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>
</configSections>
<applicationSettings>
<DevExpress.LookAndFeel.Design.AppSettings>
<setting name="DPIAwarenessMode" serializeAs="String">
<value>System</value>
</setting>
<setting name="RegisterBonusSkins" serializeAs="String">
<value>True</value>
</setting>
</DevExpress.LookAndFeel.Design.AppSettings>
</applicationSettings>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" />
</startup>
<system.diagnostics>
<sources>
<!-- This section defines the logging configuration for My.Application.Log -->
<source name="DefaultSource" switchName="DefaultSwitch">
<listeners>
<add name="FileLog" />
<!-- Uncomment the below section to write to the Application Event Log -->
<!--<add name="EventLog"/>-->
</listeners>
</source>
</sources>
<switches>
<add name="DefaultSwitch" value="Information" />
</switches>
<sharedListeners>
<add name="FileLog" type="Microsoft.VisualBasic.Logging.FileLogTraceListener, Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" initializeData="FileLogWriter" />
<!-- Uncomment the below section and replace APPLICATION_NAME with the name of your application to write to the Application Event Log -->
<!--<add name="EventLog" type="System.Diagnostics.EventLogTraceListener" initializeData="APPLICATION_NAME"/> -->
</sharedListeners>
</system.diagnostics>
</configuration>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net462" />
<package id="NLog" version="5.0.5" targetFramework="net462" />
</packages>

View File

@ -97,35 +97,18 @@
<Import Include="System" /> <Import Include="System" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Config.vb" />
<Compile Include="Modules\BaseModule.vb" />
<Compile Include="Modules\ISync.vb" />
<Compile Include="Modules\Sharepoint\Constants.vb" />
<Compile Include="Modules\Sharepoint\Entities\SharepointDocument.vb" />
<Compile Include="Modules\Sharepoint\SharepointException.vb" />
<Compile Include="Modules\Sharepoint\SharepointSync.vb" />
<Compile Include="Modules\slt\Constants.vb" />
<Compile Include="Modules\slt\Entities\sltDocument.vb" />
<Compile Include="frmMain.vb"> <Compile Include="frmMain.vb">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
<Compile Include="frmMain.Designer.vb"> <Compile Include="frmMain.Designer.vb">
<DependentUpon>frmMain.vb</DependentUpon> <DependentUpon>frmMain.vb</DependentUpon>
</Compile> </Compile>
<Compile Include="Modules\slt\Entities\sltAvailableSystem.vb" />
<Compile Include="My Project\Application.Designer.vb"> <Compile Include="My Project\Application.Designer.vb">
<AutoGen>True</AutoGen> <AutoGen>True</AutoGen>
<DependentUpon>Application.myapp</DependentUpon> <DependentUpon>Application.myapp</DependentUpon>
<DesignTime>True</DesignTime> <DesignTime>True</DesignTime>
</Compile> </Compile>
<Compile Include="My Project\AssemblyInfo.vb" /> <Compile Include="My Project\AssemblyInfo.vb" />
<Compile Include="Modules\slt\Responses\sltDocumentResponse.vb" />
<Compile Include="Modules\slt\sltException.vb" />
<Compile Include="Modules\slt\Responses\sltLoginResponse.vb" />
<Compile Include="Modules\slt\Responses\sltLogoutResponse.vb" />
<Compile Include="Modules\slt\Responses\sltMandatorResponse.vb" />
<Compile Include="Modules\slt\Responses\sltResponse.vb" />
<Compile Include="Modules\slt\sltSync.vb" />
<EmbeddedResource Include="frmMain.resx"> <EmbeddedResource Include="frmMain.resx">
<DependentUpon>frmMain.vb</DependentUpon> <DependentUpon>frmMain.vb</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
@ -161,6 +144,12 @@
<ItemGroup> <ItemGroup>
<Content Include="App.ico" /> <Content Include="App.ico" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Connectors.Common\Connectors.Common.vbproj">
<Project>{8f0ac45c-c610-4432-9078-82dd26ea3e8f}</Project>
<Name>Connectors.Common</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.

View File

@ -30,16 +30,20 @@
Me.RibbonControl1 = New DevExpress.XtraBars.Ribbon.RibbonControl() Me.RibbonControl1 = New DevExpress.XtraBars.Ribbon.RibbonControl()
Me.btnSyncStart = New DevExpress.XtraBars.BarButtonItem() Me.btnSyncStart = New DevExpress.XtraBars.BarButtonItem()
Me.btnStopSync = New DevExpress.XtraBars.BarButtonItem() Me.btnStopSync = New DevExpress.XtraBars.BarButtonItem()
Me.BarButtonItem1 = New DevExpress.XtraBars.BarButtonItem() Me.btnOpenLog = New DevExpress.XtraBars.BarButtonItem()
Me.btnForceSync = New DevExpress.XtraBars.BarButtonItem()
Me.txtFilesProcessed = New DevExpress.XtraBars.BarStaticItem()
Me.txtErrorsOccurred = New DevExpress.XtraBars.BarStaticItem()
Me.btnOpenConfig = New DevExpress.XtraBars.BarButtonItem()
Me.RibbonPage1 = New DevExpress.XtraBars.Ribbon.RibbonPage() Me.RibbonPage1 = New DevExpress.XtraBars.Ribbon.RibbonPage()
Me.RibbonPageGroup1 = New DevExpress.XtraBars.Ribbon.RibbonPageGroup() Me.RibbonPageGroup1 = New DevExpress.XtraBars.Ribbon.RibbonPageGroup()
Me.RibbonPageGroup2 = New DevExpress.XtraBars.Ribbon.RibbonPageGroup() Me.RibbonPageGroup2 = New DevExpress.XtraBars.Ribbon.RibbonPageGroup()
Me.RibbonStatusBar1 = New DevExpress.XtraBars.Ribbon.RibbonStatusBar()
Me.SyncTimer = New System.Windows.Forms.Timer(Me.components) Me.SyncTimer = New System.Windows.Forms.Timer(Me.components)
Me.TrayIcon = New System.Windows.Forms.NotifyIcon(Me.components) Me.TrayIcon = New System.Windows.Forms.NotifyIcon(Me.components)
Me.TrayMenu = New System.Windows.Forms.ContextMenuStrip(Me.components) Me.TrayMenu = New System.Windows.Forms.ContextMenuStrip(Me.components)
Me.btnToggleWindow = New System.Windows.Forms.ToolStripMenuItem() Me.btnToggleWindow = New System.Windows.Forms.ToolStripMenuItem()
Me.btnExit = New System.Windows.Forms.ToolStripMenuItem() Me.btnExit = New System.Windows.Forms.ToolStripMenuItem()
Me.btnForceSync = New DevExpress.XtraBars.BarButtonItem()
CType(Me.ListBoxControl1, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.ListBoxControl1, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.RibbonControl1, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.RibbonControl1, System.ComponentModel.ISupportInitialize).BeginInit()
Me.TrayMenu.SuspendLayout() Me.TrayMenu.SuspendLayout()
@ -50,16 +54,16 @@
Me.ListBoxControl1.Dock = System.Windows.Forms.DockStyle.Fill Me.ListBoxControl1.Dock = System.Windows.Forms.DockStyle.Fill
Me.ListBoxControl1.Location = New System.Drawing.Point(0, 63) Me.ListBoxControl1.Location = New System.Drawing.Point(0, 63)
Me.ListBoxControl1.Name = "ListBoxControl1" Me.ListBoxControl1.Name = "ListBoxControl1"
Me.ListBoxControl1.Size = New System.Drawing.Size(632, 215) Me.ListBoxControl1.Size = New System.Drawing.Size(632, 191)
Me.ListBoxControl1.TabIndex = 0 Me.ListBoxControl1.TabIndex = 0
' '
'RibbonControl1 'RibbonControl1
' '
Me.RibbonControl1.CommandLayout = DevExpress.XtraBars.Ribbon.CommandLayout.Simplified Me.RibbonControl1.CommandLayout = DevExpress.XtraBars.Ribbon.CommandLayout.Simplified
Me.RibbonControl1.ExpandCollapseItem.Id = 0 Me.RibbonControl1.ExpandCollapseItem.Id = 0
Me.RibbonControl1.Items.AddRange(New DevExpress.XtraBars.BarItem() {Me.RibbonControl1.ExpandCollapseItem, Me.RibbonControl1.SearchEditItem, Me.btnSyncStart, Me.btnStopSync, Me.BarButtonItem1, Me.btnForceSync}) Me.RibbonControl1.Items.AddRange(New DevExpress.XtraBars.BarItem() {Me.RibbonControl1.ExpandCollapseItem, Me.RibbonControl1.SearchEditItem, Me.btnSyncStart, Me.btnStopSync, Me.btnOpenLog, Me.btnForceSync, Me.txtFilesProcessed, Me.txtErrorsOccurred, Me.btnOpenConfig})
Me.RibbonControl1.Location = New System.Drawing.Point(0, 0) Me.RibbonControl1.Location = New System.Drawing.Point(0, 0)
Me.RibbonControl1.MaxItemId = 5 Me.RibbonControl1.MaxItemId = 8
Me.RibbonControl1.Name = "RibbonControl1" Me.RibbonControl1.Name = "RibbonControl1"
Me.RibbonControl1.Pages.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPage() {Me.RibbonPage1}) Me.RibbonControl1.Pages.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPage() {Me.RibbonPage1})
Me.RibbonControl1.ShowApplicationButton = DevExpress.Utils.DefaultBoolean.[False] Me.RibbonControl1.ShowApplicationButton = DevExpress.Utils.DefaultBoolean.[False]
@ -68,6 +72,7 @@
Me.RibbonControl1.ShowPageHeadersMode = DevExpress.XtraBars.Ribbon.ShowPageHeadersMode.Hide Me.RibbonControl1.ShowPageHeadersMode = DevExpress.XtraBars.Ribbon.ShowPageHeadersMode.Hide
Me.RibbonControl1.ShowToolbarCustomizeItem = False Me.RibbonControl1.ShowToolbarCustomizeItem = False
Me.RibbonControl1.Size = New System.Drawing.Size(632, 63) Me.RibbonControl1.Size = New System.Drawing.Size(632, 63)
Me.RibbonControl1.StatusBar = Me.RibbonStatusBar1
Me.RibbonControl1.Toolbar.ShowCustomizeItem = False Me.RibbonControl1.Toolbar.ShowCustomizeItem = False
' '
'btnSyncStart 'btnSyncStart
@ -85,12 +90,43 @@
Me.btnStopSync.ImageOptions.SvgImage = CType(resources.GetObject("btnStopSync.ImageOptions.SvgImage"), DevExpress.Utils.Svg.SvgImage) Me.btnStopSync.ImageOptions.SvgImage = CType(resources.GetObject("btnStopSync.ImageOptions.SvgImage"), DevExpress.Utils.Svg.SvgImage)
Me.btnStopSync.Name = "btnStopSync" Me.btnStopSync.Name = "btnStopSync"
' '
'BarButtonItem1 'btnOpenLog
' '
Me.BarButtonItem1.Caption = "Log öffnen" Me.btnOpenLog.Caption = "Log öffnen"
Me.BarButtonItem1.Id = 3 Me.btnOpenLog.Id = 3
Me.BarButtonItem1.ImageOptions.SvgImage = CType(resources.GetObject("BarButtonItem1.ImageOptions.SvgImage"), DevExpress.Utils.Svg.SvgImage) Me.btnOpenLog.ImageOptions.SvgImage = CType(resources.GetObject("btnOpenLog.ImageOptions.SvgImage"), DevExpress.Utils.Svg.SvgImage)
Me.BarButtonItem1.Name = "BarButtonItem1" Me.btnOpenLog.Name = "btnOpenLog"
'
'btnForceSync
'
Me.btnForceSync.Caption = "Sync Auslösen"
Me.btnForceSync.Enabled = False
Me.btnForceSync.Id = 4
Me.btnForceSync.ImageOptions.SvgImage = CType(resources.GetObject("btnForceSync.ImageOptions.SvgImage"), DevExpress.Utils.Svg.SvgImage)
Me.btnForceSync.Name = "btnForceSync"
'
'txtFilesProcessed
'
Me.txtFilesProcessed.Caption = "Keine Dateien"
Me.txtFilesProcessed.Id = 5
Me.txtFilesProcessed.ImageOptions.SvgImage = CType(resources.GetObject("txtFilesProcessed.ImageOptions.SvgImage"), DevExpress.Utils.Svg.SvgImage)
Me.txtFilesProcessed.Name = "txtFilesProcessed"
Me.txtFilesProcessed.PaintStyle = DevExpress.XtraBars.BarItemPaintStyle.CaptionGlyph
'
'txtErrorsOccurred
'
Me.txtErrorsOccurred.Caption = "Keine Fehler"
Me.txtErrorsOccurred.Id = 6
Me.txtErrorsOccurred.ImageOptions.SvgImage = CType(resources.GetObject("txtErrorsOccurred.ImageOptions.SvgImage"), DevExpress.Utils.Svg.SvgImage)
Me.txtErrorsOccurred.Name = "txtErrorsOccurred"
Me.txtErrorsOccurred.PaintStyle = DevExpress.XtraBars.BarItemPaintStyle.CaptionGlyph
'
'btnOpenConfig
'
Me.btnOpenConfig.Caption = "Config öffnen"
Me.btnOpenConfig.Id = 7
Me.btnOpenConfig.ImageOptions.SvgImage = CType(resources.GetObject("btnOpenConfig.ImageOptions.SvgImage"), DevExpress.Utils.Svg.SvgImage)
Me.btnOpenConfig.Name = "btnOpenConfig"
' '
'RibbonPage1 'RibbonPage1
' '
@ -109,10 +145,20 @@
'RibbonPageGroup2 'RibbonPageGroup2
' '
Me.RibbonPageGroup2.Alignment = DevExpress.XtraBars.Ribbon.RibbonPageGroupAlignment.Far Me.RibbonPageGroup2.Alignment = DevExpress.XtraBars.Ribbon.RibbonPageGroupAlignment.Far
Me.RibbonPageGroup2.ItemLinks.Add(Me.BarButtonItem1) Me.RibbonPageGroup2.ItemLinks.Add(Me.btnOpenLog)
Me.RibbonPageGroup2.ItemLinks.Add(Me.btnOpenConfig)
Me.RibbonPageGroup2.Name = "RibbonPageGroup2" Me.RibbonPageGroup2.Name = "RibbonPageGroup2"
Me.RibbonPageGroup2.Text = "RibbonPageGroup2" Me.RibbonPageGroup2.Text = "RibbonPageGroup2"
' '
'RibbonStatusBar1
'
Me.RibbonStatusBar1.ItemLinks.Add(Me.txtFilesProcessed)
Me.RibbonStatusBar1.ItemLinks.Add(Me.txtErrorsOccurred)
Me.RibbonStatusBar1.Location = New System.Drawing.Point(0, 254)
Me.RibbonStatusBar1.Name = "RibbonStatusBar1"
Me.RibbonStatusBar1.Ribbon = Me.RibbonControl1
Me.RibbonStatusBar1.Size = New System.Drawing.Size(632, 24)
'
'SyncTimer 'SyncTimer
' '
' '
@ -120,7 +166,7 @@
' '
Me.TrayIcon.ContextMenuStrip = Me.TrayMenu Me.TrayIcon.ContextMenuStrip = Me.TrayMenu
Me.TrayIcon.Icon = CType(resources.GetObject("TrayIcon.Icon"), System.Drawing.Icon) Me.TrayIcon.Icon = CType(resources.GetObject("TrayIcon.Icon"), System.Drawing.Icon)
Me.TrayIcon.Text = "sltSync" Me.TrayIcon.Text = "Connector"
Me.TrayIcon.Visible = True Me.TrayIcon.Visible = True
' '
'TrayMenu 'TrayMenu
@ -141,24 +187,18 @@
Me.btnExit.Size = New System.Drawing.Size(184, 22) Me.btnExit.Size = New System.Drawing.Size(184, 22)
Me.btnExit.Text = "Beenden" Me.btnExit.Text = "Beenden"
' '
'btnForceSync
'
Me.btnForceSync.Caption = "Sync Auslösen"
Me.btnForceSync.Enabled = False
Me.btnForceSync.Id = 4
Me.btnForceSync.ImageOptions.SvgImage = CType(resources.GetObject("btnForceSync.ImageOptions.SvgImage"), DevExpress.Utils.Svg.SvgImage)
Me.btnForceSync.Name = "btnForceSync"
'
'frmMain 'frmMain
' '
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(632, 278) Me.ClientSize = New System.Drawing.Size(632, 278)
Me.Controls.Add(Me.ListBoxControl1) Me.Controls.Add(Me.ListBoxControl1)
Me.Controls.Add(Me.RibbonStatusBar1)
Me.Controls.Add(Me.RibbonControl1) Me.Controls.Add(Me.RibbonControl1)
Me.IconOptions.SvgImage = CType(resources.GetObject("frmMain.IconOptions.SvgImage"), DevExpress.Utils.Svg.SvgImage) Me.IconOptions.SvgImage = CType(resources.GetObject("frmMain.IconOptions.SvgImage"), DevExpress.Utils.Svg.SvgImage)
Me.Name = "frmMain" Me.Name = "frmMain"
Me.Ribbon = Me.RibbonControl1 Me.Ribbon = Me.RibbonControl1
Me.StatusBar = Me.RibbonStatusBar1
Me.Text = "Sync" Me.Text = "Sync"
CType(Me.ListBoxControl1, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.ListBoxControl1, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.RibbonControl1, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.RibbonControl1, System.ComponentModel.ISupportInitialize).EndInit()
@ -174,7 +214,7 @@
Friend WithEvents btnSyncStart As DevExpress.XtraBars.BarButtonItem Friend WithEvents btnSyncStart As DevExpress.XtraBars.BarButtonItem
Friend WithEvents btnStopSync As DevExpress.XtraBars.BarButtonItem Friend WithEvents btnStopSync As DevExpress.XtraBars.BarButtonItem
Friend WithEvents RibbonPageGroup1 As DevExpress.XtraBars.Ribbon.RibbonPageGroup Friend WithEvents RibbonPageGroup1 As DevExpress.XtraBars.Ribbon.RibbonPageGroup
Friend WithEvents BarButtonItem1 As DevExpress.XtraBars.BarButtonItem Friend WithEvents btnOpenLog As DevExpress.XtraBars.BarButtonItem
Friend WithEvents RibbonPageGroup2 As DevExpress.XtraBars.Ribbon.RibbonPageGroup Friend WithEvents RibbonPageGroup2 As DevExpress.XtraBars.Ribbon.RibbonPageGroup
Friend WithEvents SyncTimer As Timer Friend WithEvents SyncTimer As Timer
Friend WithEvents TrayIcon As NotifyIcon Friend WithEvents TrayIcon As NotifyIcon
@ -182,6 +222,10 @@
Friend WithEvents btnToggleWindow As ToolStripMenuItem Friend WithEvents btnToggleWindow As ToolStripMenuItem
Friend WithEvents btnExit As ToolStripMenuItem Friend WithEvents btnExit As ToolStripMenuItem
Friend WithEvents btnForceSync As DevExpress.XtraBars.BarButtonItem Friend WithEvents btnForceSync As DevExpress.XtraBars.BarButtonItem
Friend WithEvents txtFilesProcessed As DevExpress.XtraBars.BarStaticItem
Friend WithEvents txtErrorsOccurred As DevExpress.XtraBars.BarStaticItem
Friend WithEvents RibbonStatusBar1 As DevExpress.XtraBars.Ribbon.RibbonStatusBar
Friend WithEvents btnOpenConfig As DevExpress.XtraBars.BarButtonItem
#End Region #End Region

View File

@ -155,7 +155,7 @@
TTI0LDE4SDh2LTRoMTZWMTh6IiBjbGFzcz0iUmVkIiAvPg0KICA8L2c+DQo8L3N2Zz4L TTI0LDE4SDh2LTRoMTZWMTh6IiBjbGFzcz0iUmVkIiAvPg0KICA8L2c+DQo8L3N2Zz4L
</value> </value>
</data> </data>
<data name="BarButtonItem1.ImageOptions.SvgImage" type="DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="btnOpenLog.ImageOptions.SvgImage" type="DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
AAEAAAD/////AQAAAAAAAAAMAgAAAFlEZXZFeHByZXNzLkRhdGEudjIxLjIsIFZlcnNpb249MjEuMi40 AAEAAAD/////AQAAAAAAAAAMAgAAAFlEZXZFeHByZXNzLkRhdGEudjIxLjIsIFZlcnNpb249MjEuMi40
LjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjg4ZDE3NTRkNzAwZTQ5YQUBAAAAHURl LjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjg4ZDE3NTRkNzAwZTQ5YQUBAAAAHURl
@ -190,6 +190,58 @@
MS4xTDIuOSw0LjFDMi40LDMuOCwyLDQsMiw0LjZ2MjAuNmMwLDAuNiwwLjQsMC44LDAuOSwwLjVMMTku MS4xTDIuOSw0LjFDMi40LDMuOCwyLDQsMiw0LjZ2MjAuNmMwLDAuNiwwLjQsMC44LDAuOSwwLjVMMTku
NywxNS41eiIgY2xhc3M9IkJsdWUiIC8+DQogIDwvZz4NCiAgPGcgaWQ9IkxheWVyXzIiIC8+DQo8L3N2 NywxNS41eiIgY2xhc3M9IkJsdWUiIC8+DQogIDwvZz4NCiAgPGcgaWQ9IkxheWVyXzIiIC8+DQo8L3N2
Zz4L Zz4L
</value>
</data>
<data name="txtFilesProcessed.ImageOptions.SvgImage" type="DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAEAAAD/////AQAAAAAAAAAMAgAAAFlEZXZFeHByZXNzLkRhdGEudjIxLjIsIFZlcnNpb249MjEuMi40
LjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjg4ZDE3NTRkNzAwZTQ5YQUBAAAAHURl
dkV4cHJlc3MuVXRpbHMuU3ZnLlN2Z0ltYWdlAQAAAAREYXRhBwICAAAACQMAAAAPAwAAAMUBAAAC77u/
PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0nVVRGLTgnPz4NCjxzdmcgeD0iMHB4IiB5PSIwcHgi
IHZpZXdCb3g9IjAgMCAzMiAzMiIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcv
MjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4bWw6c3Bh
Y2U9InByZXNlcnZlIiBpZD0iTmV3IiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCAzMiAz
MiI+DQogIDxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+CgkuQmxhY2t7ZmlsbDojNzI3MjcyO30KPC9zdHls
ZT4NCiAgPHBhdGggZD0iTTE5LDJINUM0LjQsMiw0LDIuNCw0LDN2MjRjMCwwLjYsMC40LDEsMSwxaDIw
YzAuNiwwLDEtMC40LDEtMVY5TDE5LDJ6IE0yNCwyNkg2VjRoMTJ2NWMwLDAuNiwwLjQsMSwxLDFoNSAg
VjI2eiIgY2xhc3M9IkJsYWNrIiAvPg0KPC9zdmc+Cw==
</value>
</data>
<data name="txtErrorsOccurred.ImageOptions.SvgImage" type="DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAEAAAD/////AQAAAAAAAAAMAgAAAFlEZXZFeHByZXNzLkRhdGEudjIxLjIsIFZlcnNpb249MjEuMi40
LjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjg4ZDE3NTRkNzAwZTQ5YQUBAAAAHURl
dkV4cHJlc3MuVXRpbHMuU3ZnLlN2Z0ltYWdlAQAAAAREYXRhBwICAAAACQMAAAAPAwAAANACAAAC77u/
PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0nVVRGLTgnPz4NCjxzdmcgeD0iMHB4IiB5PSIwcHgi
IHZpZXdCb3g9IjAgMCAzMiAzMiIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcv
MjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4bWw6c3Bh
Y2U9InByZXNlcnZlIiBpZD0iTGF5ZXJfMSIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAg
MzIgMzIiPg0KICA8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLkJsYWNre2ZpbGw6IzcyNzI3Mjt9Cgku
UmVke2ZpbGw6I0QxMUMxQzt9CgkuWWVsbG93e2ZpbGw6I0ZGQjExNTt9CgkuR3JlZW57ZmlsbDojMDM5
QzIzO30KPC9zdHlsZT4NCiAgPGcgaWQ9Ildhcm5pbmdDaXJjbGVkMiI+DQogICAgPHBhdGggZD0iTTE2
LDJDOC4zLDIsMiw4LjMsMiwxNnM2LjMsMTQsMTQsMTRzMTQtNi4zLDE0LTE0UzIzLjcsMiwxNiwyeiBN
MTYsMjhDOS40LDI4LDQsMjIuNiw0LDE2QzQsOS40LDkuNCw0LDE2LDQgICBzMTIsNS40LDEyLDEyQzI4
LDIyLjYsMjIuNiwyOCwxNiwyOHoiIGNsYXNzPSJSZWQiIC8+DQogICAgPGNpcmNsZSBjeD0iMTYiIGN5
PSIyMiIgcj0iMiIgY2xhc3M9IlJlZCIgLz4NCiAgICA8cmVjdCB4PSIxNCIgeT0iOCIgd2lkdGg9IjQi
IGhlaWdodD0iMTAiIHJ4PSIwIiByeT0iMCIgY2xhc3M9IlJlZCIgLz4NCiAgPC9nPg0KPC9zdmc+Cw==
</value>
</data>
<data name="btnOpenConfig.ImageOptions.SvgImage" type="DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAEAAAD/////AQAAAAAAAAAMAgAAAFlEZXZFeHByZXNzLkRhdGEudjIxLjIsIFZlcnNpb249MjEuMi40
LjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjg4ZDE3NTRkNzAwZTQ5YQUBAAAAHURl
dkV4cHJlc3MuVXRpbHMuU3ZnLlN2Z0ltYWdlAQAAAAREYXRhBwICAAAACQMAAAAPAwAAAJQCAAAC77u/
PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0nVVRGLTgnPz4NCjxzdmcgeD0iMHB4IiB5PSIwcHgi
IHZpZXdCb3g9IjAgMCAzMiAzMiIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcv
MjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4bWw6c3Bh
Y2U9InByZXNlcnZlIiBpZD0iT3BlbiIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgMzIg
MzIiPg0KICA8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLlllbGxvd3tmaWxsOiNGRkIxMTU7fQoJLnN0
MHtvcGFjaXR5OjAuNzU7fQo8L3N0eWxlPg0KICA8ZyBjbGFzcz0ic3QwIj4NCiAgICA8cGF0aCBkPSJN
Mi4yLDI1LjJsNS41LTEyYzAuMy0wLjcsMS0xLjIsMS44LTEuMkgyNlY5YzAtMC42LTAuNC0xLTEtMUgx
MlY1YzAtMC42LTAuNC0xLTEtMUgzQzIuNCw0LDIsNC40LDIsNXYyMCAgIGMwLDAuMiwwLDAuMywwLjEs
MC40QzIuMSwyNS4zLDIuMiwyNS4zLDIuMiwyNS4yeiIgY2xhc3M9IlllbGxvdyIgLz4NCiAgPC9nPg0K
ICA8cGF0aCBkPSJNMzEuMywxNEg5LjZMNCwyNmgyMS44YzAuNSwwLDEuMS0wLjMsMS4zLTAuN0wzMiwx
NC43QzMyLjEsMTQuMywzMS44LDE0LDMxLjMsMTR6IiBjbGFzcz0iWWVsbG93IiAvPg0KPC9zdmc+Cw==
</value> </value>
</data> </data>
<metadata name="SyncTimer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="SyncTimer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">

View File

@ -1,4 +1,6 @@
Imports System.ComponentModel Imports System.ComponentModel
Imports System.Runtime.Remoting.Messaging
Imports Connectors.Common
Imports DevExpress.XtraEditors.ViewInfo Imports DevExpress.XtraEditors.ViewInfo
Imports DigitalData.Modules.Config Imports DigitalData.Modules.Config
Imports DigitalData.Modules.Database Imports DigitalData.Modules.Database
@ -11,6 +13,25 @@ Partial Public Class frmMain
Private Database As MSSQLServer Private Database As MSSQLServer
Private Sync As ISync Private Sync As ISync
Private FilesProcessed As Integer = 0
Private ErrorsOccurred As Integer = 0
Public Enum LogLevel
Info
Warning
[Error]
End Enum
Private Class LogLine
Public Message As String
Public Level As LogLevel
Public CreatedWhen As Date = Now
Public Overrides Function ToString() As String
Return $"{CreatedWhen.ToShortDateString} {CreatedWhen.ToShortTimeString} {Message}"
End Function
End Class
Public Sub New() Public Sub New()
InitializeComponent() InitializeComponent()
End Sub End Sub
@ -24,20 +45,25 @@ Partial Public Class frmMain
AddInfoEntry("Application started.") AddInfoEntry("Application started.")
AddInfoEntry("Version: {0}", Application.ProductVersion) AddInfoEntry("Version: {0}", Application.ProductVersion)
AddInfoEntry("Timer Interval: {0} min", ConfigManager.Config.TimerIntervalMin.ToString)
AddDivider() AddDivider()
If ConfigManager.Config.ActiveModule = "NONE" Then
AddWarnEntry("No ActiveModule selected, check your configuration!", ConfigManager.Config.ActiveModule)
Exit Sub
End If
Database = New MSSQLServer(LogConfig, ConfigManager.Config.ConnectionString) Database = New MSSQLServer(LogConfig, ConfigManager.Config.ConnectionString)
Sync = InitializeModule(ConfigManager.Config.ActiveModule) Sync = InitializeModule(ConfigManager.Config.ActiveModule)
' Load Form Title from Module
Text = Sync.Name
If Sync Is Nothing Then If Sync Is Nothing Then
AddWarnEntry("ActiveModule '{0}' is not implemented!", ConfigManager.Config.ActiveModule) AddWarnEntry("ActiveModule '{0}' is not implemented!", ConfigManager.Config.ActiveModule)
Exit Sub Exit Sub
End If End If
' Load Form Title from Module
Text = Sync.Name
TrayIcon.Text = Sync.Name
If Database.DBInitialized = False Then If Database.DBInitialized = False Then
AddWarnEntry("Database could not be initialized. Please check connection string.") AddWarnEntry("Database could not be initialized. Please check connection string.")
Exit Sub Exit Sub
@ -52,13 +78,16 @@ Partial Public Class frmMain
End If End If
If ConfigManager.Config.TimerIntervalMin > 0 Then If ConfigManager.Config.TimerIntervalMin > 0 Then
AddInfoEntry("Timer Interval: {0} min", ConfigManager.Config.TimerIntervalMin.ToString)
SyncTimer.Interval = ConfigManager.Config.TimerIntervalMin * 60 * 1_000 SyncTimer.Interval = ConfigManager.Config.TimerIntervalMin * 60 * 1_000
StartTimer() StartTimer()
Else
AddInfoEntry("Timer Interval: Off", ConfigManager.Config.TimerIntervalMin.ToString)
End If End If
Catch ex As Exception Catch ex As Exception
Logger.Error(ex) Logger.Error(ex)
AddWarnEntry($"Error while loading the application: {ex.Message}") AddErrorEntry($"Error while loading the application: {ex.Message}")
End Try End Try
End Sub End Sub
@ -68,23 +97,41 @@ Partial Public Class frmMain
Select Case pActiveModule Select Case pActiveModule
Case "slt" Case "slt"
oSync = New slt.sltSync(LogConfig, Database, ConfigManager.Config) oSync = New slt.sltSync(LogConfig, Database, ConfigManager.Config)
AddHandler oSync.OnLogEntry, AddressOf Sync_OnLogEntry
Case "Sharepoint" Case "Sharepoint"
oSync = New Sharepoint.SharepointSync(LogConfig, Database, ConfigManager.Config) oSync = New Sharepoint.SharepointSync(LogConfig, Database, ConfigManager.Config)
AddHandler oSync.OnLogEntry, AddressOf Sync_OnLogEntry
Case Else Case Else
Return Nothing Return Nothing
End Select End Select
AddHandler oSync.OnLogEntry, AddressOf Sync_OnLogEntry
AddHandler oSync.OnFileError, AddressOf Sync_OnFileError
AddHandler oSync.OnFileProcessed, AddressOf Sync_OnFileProcessed
Return oSync Return oSync
End Function End Function
Private Sub Sync_OnLogEntry(sender As Object, e As String) Private Sub Sync_OnFileProcessed(sender As Object, e As String)
AddInfoEntry(e) FilesProcessed += 1
txtFilesProcessed.Caption = String.Format("{0} Dateien", FilesProcessed)
End Sub
Private Sub Sync_OnFileError(sender As Object, e As String)
ErrorsOccurred += 1
txtErrorsOccurred.Caption = String.Format("{0} Fehler", ErrorsOccurred)
End Sub
Private Sub Sync_OnLogEntry(sender As Object, e As Tuple(Of String, BaseModule.LogLevel))
Select Case e.Item2
Case BaseModule.LogLevel.Info
AddInfoEntry(e.Item1)
Case BaseModule.LogLevel.Warn
AddWarnEntry(e.Item1)
Case BaseModule.LogLevel.Error
AddErrorEntry(e.Item1)
End Select
End Sub End Sub
Private Async Function frmMain_Closing(sender As Object, e As CancelEventArgs) As Threading.Tasks.Task Handles Me.Closing Private Async Function frmMain_Closing(sender As Object, e As CancelEventArgs) As Threading.Tasks.Task Handles Me.Closing
@ -126,20 +173,46 @@ Partial Public Class frmMain
Private Sub AddInfoEntry(pMessage As String, ParamArray pArgs As Object()) Private Sub AddInfoEntry(pMessage As String, ParamArray pArgs As Object())
Logger.Info(pMessage, pArgs) Logger.Info(pMessage, pArgs)
ListBoxControl1.Items.Add(Now & " " & String.Format(pMessage, pArgs))
Dim oItem = New LogLine With {
.Message = String.Format(pMessage, pArgs),
.Level = LogLevel.Info
}
ListBoxControl1.Items.Add(oItem)
ListBoxControl1.MakeItemVisible(ListBoxControl1.Items.Count - 1) ListBoxControl1.MakeItemVisible(ListBoxControl1.Items.Count - 1)
End Sub End Sub
Private Sub AddWarnEntry(pMessage As String, ParamArray pArgs As Object()) Private Sub AddWarnEntry(pMessage As String, ParamArray pArgs As Object())
Logger.Info(pMessage, pArgs) Logger.Info(pMessage, pArgs)
ListBoxControl1.Items.Add(String.Format(pMessage, pArgs))
Dim oItem = New LogLine With {
.Message = String.Format(pMessage, pArgs),
.Level = LogLevel.Warning
}
ListBoxControl1.Items.Add(oItem)
End Sub
Private Sub AddErrorEntry(pMessage As String, ParamArray pArgs As Object())
Logger.Info(pMessage, pArgs)
Dim oItem = New LogLine With {
.Message = String.Format(pMessage, pArgs),
.Level = LogLevel.Error
}
ListBoxControl1.Items.Add(oItem)
End Sub End Sub
Private Sub AddDivider() Private Sub AddDivider()
ListBoxControl1.Items.Add("=====================================") ListBoxControl1.Items.Add(New LogLine With {
.Message = "-------------------------------------",
.Level = LogLevel.Info
})
End Sub End Sub
Private Sub BarButtonItem1_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem1.ItemClick Private Sub btnOpenLog_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles btnOpenLog.ItemClick
Try Try
Dim oPath = LogConfig.LogDirectory Dim oPath = LogConfig.LogDirectory
Process.Start("explorer.exe", oPath) Process.Start("explorer.exe", oPath)
@ -183,4 +256,26 @@ Partial Public Class frmMain
Await Sync.Run() Await Sync.Run()
btnForceSync.Enabled = True btnForceSync.Enabled = True
End Sub End Sub
End Class
Private Sub ListBoxControl1_DrawItem(sender As Object, e As DevExpress.XtraEditors.ListBoxDrawItemEventArgs) Handles ListBoxControl1.DrawItem
Dim oItem As LogLine = DirectCast(e.Item, LogLine)
Select Case oItem.Level
Case LogLevel.Warning
e.Appearance.ForeColor = Color.DarkOrange
e.Appearance.FontStyleDelta = FontStyle.Bold
Case LogLevel.Error
e.Appearance.ForeColor = Color.DarkRed
e.Appearance.FontStyleDelta = FontStyle.Bold
End Select
End Sub
Private Sub btnOpenConfig_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles btnOpenConfig.ItemClick
Try
Dim oPath = Application.StartupPath
Process.Start("explorer.exe", oPath)
Catch ex As Exception
Logger.Error(ex)
End Try
End Sub
End Class

View File

@ -1,8 +1,8 @@
Imports Microsoft.VisualStudio.TestTools.UnitTesting Imports Microsoft.VisualStudio.TestTools.UnitTesting
Imports Newtonsoft.Json Imports Newtonsoft.Json
Imports Connectors.Form.slt.Responses Imports Connectors.Common.slt.Responses
Namespace Connectors.Test Namespace Connectors.Test.slt
<TestClass> <TestClass>
Public Class AuthTest Public Class AuthTest
ReadOnly oAvailableSystemsResponse As String = "{""Message"":null,""State"":true,""Type"":40,""Value"":[{""Deactivated"":false,""Description"":"""",""Priority"":1,""SystemID"":""764f0168-0005-43ca-bfe7-267b5fe254f4"",""SystemName"":""Prod: e.wa riss Netze GmbH""}]}" ReadOnly oAvailableSystemsResponse As String = "{""Message"":null,""State"":true,""Type"":40,""Value"":[{""Deactivated"":false,""Description"":"""",""Priority"":1,""SystemID"":""764f0168-0005-43ca-bfe7-267b5fe254f4"",""SystemName"":""Prod: e.wa riss Netze GmbH""}]}"

View File

@ -9,13 +9,17 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" /> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.1" />
<PackageReference Include="MSTest.TestAdapter" Version="2.2.10" /> <PackageReference Include="MSTest.TestAdapter" Version="3.1.1" />
<PackageReference Include="MSTest.TestFramework" Version="2.2.10" /> <PackageReference Include="MSTest.TestFramework" Version="3.1.1" />
<PackageReference Include="coverlet.collector" Version="3.1.2" /> <PackageReference Include="coverlet.collector" Version="6.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Connectors.Common\Connectors.Common.vbproj" />
<ProjectReference Include="..\Connectors.Form\Connectors.Form.vbproj" /> <ProjectReference Include="..\Connectors.Form\Connectors.Form.vbproj" />
</ItemGroup> </ItemGroup>

View File

@ -7,6 +7,8 @@ Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Connectors.Form", "Connecto
EndProject EndProject
Project("{778DAE3C-4631-46EA-AA77-85C1314464D9}") = "Connectors.Test", "Connectors.Test\Connectors.Test.vbproj", "{71398AA2-8017-4CE2-8E29-187D38324FE7}" Project("{778DAE3C-4631-46EA-AA77-85C1314464D9}") = "Connectors.Test", "Connectors.Test\Connectors.Test.vbproj", "{71398AA2-8017-4CE2-8E29-187D38324FE7}"
EndProject EndProject
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Connectors.Common", "Connectors.Common\Connectors.Common.vbproj", "{8F0AC45C-C610-4432-9078-82DD26EA3E8F}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@ -21,6 +23,10 @@ Global
{71398AA2-8017-4CE2-8E29-187D38324FE7}.Debug|Any CPU.Build.0 = Debug|Any CPU {71398AA2-8017-4CE2-8E29-187D38324FE7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{71398AA2-8017-4CE2-8E29-187D38324FE7}.Release|Any CPU.ActiveCfg = Release|Any CPU {71398AA2-8017-4CE2-8E29-187D38324FE7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{71398AA2-8017-4CE2-8E29-187D38324FE7}.Release|Any CPU.Build.0 = Release|Any CPU {71398AA2-8017-4CE2-8E29-187D38324FE7}.Release|Any CPU.Build.0 = Release|Any CPU
{8F0AC45C-C610-4432-9078-82DD26EA3E8F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8F0AC45C-C610-4432-9078-82DD26EA3E8F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8F0AC45C-C610-4432-9078-82DD26EA3E8F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8F0AC45C-C610-4432-9078-82DD26EA3E8F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE