Add WidigShared Project, seperate all logig into this shared project

This commit is contained in:
Jonathan Jenne
2021-08-02 10:54:43 +02:00
parent 3d55af8502
commit b8250583e1
25 changed files with 955 additions and 790 deletions

View File

@@ -0,0 +1,16 @@
Imports DigitalData.Modules.Config.ConfigAttributes
Public Class ClassConfig
' Global Settings (from computerconfig, overridable by userconfig)
<ConnectionString>
Public Property ConnectionString As String = ""
Public Property WMUsername As String = ""
Public Property WMUserPW As String = ""
Public Property WMDrive As String = "W"
Public Property WMRelPath As String = "\\windream\objects"
Public Property WMServer As String = ""
Public Property Domain As String = ""
Public Property LOG_DEBUG As Boolean = False
End Class

351
WiDigShared/ClassWIDig.vb Normal file
View File

@@ -0,0 +1,351 @@
Imports DigitalData.Modules.Logging
Imports DigitalData.Modules.Encryption
Imports DigitalData.Modules.Windream
Imports DigitalData.Modules.Database
Imports System.Text.RegularExpressions
Public Class ClassWIDig
Private LogConfig As LogConfig
Private Config As ClassConfig
Private Windream As Windream
Private Logger As Logger
Private Database As MSSQLServer
Public oRegex As New Regex("([\s\S]+)\={([\s\S]+)}")
Public Const CODE_SUCCESS = 0
Public Const CODE_ERROR = 1
Public Const MODE_OVERWRITE = "IMPO"
Public Const MODE_VERSION = "IMPV"
Public Const MODE_NACHINDEXIERUNG = "NI"
Public Const PARAM_SOURCE = "-Source@"
Public Const PARAM_MODE = "-Mode@"
Public Const PARAM_TARGET = "-Target@"
Public Const PARAM_WMTO = "-WMOT@"
Public Const PARAM_INDEX = "-index@"
Public Property ErrorMessage As String
Public Property ErrorWhileParsing As Boolean
Public Property ErrorWhileImporting As Boolean
Public Property RunMode As String
Public Property SourceFile As Object
Public Property TargetPath As Object
Public Property WindreamObjectType As String
Public Property WindreamIndicies As List(Of String)
Public Property IndexArray As List(Of String)
Public Sub New(pLogConfig As LogConfig, pConfig As ClassConfig)
LogConfig = pLogConfig
Logger = pLogConfig.GetLogger
Config = pConfig
End Sub
Public Shared Function GetProgramDataPath()
Return IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "Digital Data", "WIDig")
End Function
Public Shared Function GetAppDataPath()
Return IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Digital Data", "WIDig")
End Function
Public Function GetUserPWPlain()
Try
Dim oPassword As String
Dim oEncryption As New EncryptionLegacy("!35452didalog=")
If Config.WMUserPW = String.Empty Then
oPassword = ""
Else
oPassword = oEncryption.DecryptData(Config.WMUserPW)
End If
Return oPassword
Catch ex As Exception
Logger.Warn("Error in GetUserPWPlain - the password [" & Config.WMUserPW & "] could not be decrypted", False)
Return String.Empty
End Try
End Function
Public Function Connect2Windream(oPW As String)
Try
Windream = New Windream(LogConfig, False, Config.WMDrive, Config.WMRelPath, True, Config.WMServer, Config.WMUsername, oPW, Config.Domain)
If Not IsNothing(Windream) Then
If Windream.SessionLoggedin = True Then
Logger.Debug("windream initialisiert")
Return True
End If
End If
Return False
Catch ex As Exception
Logger.Warn("CHECKING WMConnectivity: " & ex.Message)
Return False
End Try
End Function
Public Function InitDatabase() As Boolean
If Config.ConnectionString.Length = 0 Then
Return False
End If
Try
Database = New MSSQLServer(LogConfig, Config.ConnectionString)
If Database.DBInitialized = True Then
Return True
Else
Return False
End If
Catch ex As Exception
Logger.Error(ex)
Return False
End Try
End Function
Public Function ParseArgs(pArguments As String(), Optional pTest As Boolean = False)
Dim oINDEXInfoStarted As Boolean = False
Dim oINDEXInfotemp As String = ""
Try
If pArguments.Length <= 3 Then
Logger.Warn($"Insufficient number of arguments [{pArguments.Length}]!")
System.Console.WriteLine($"Insufficient number of arguments - {Now.ToString}")
ErrorWhileParsing = True
Return False
End If
Dim oCount As Integer = 0
For Each oArg As String In pArguments
Logger.Debug($"[{oCount}] {oArg}")
oArg = oArg.Replace("""", "")
If oArg.StartsWith(PARAM_SOURCE) Then
SourceFile = oArg.Replace(PARAM_SOURCE, "")
If IsNumeric(SourceFile) Then
Logger.Info($"SourceFile seems to be a DocID [{SourceFile}]")
Dim oSQL = $"SELECT [dbo].[FNDD_GET_WINDREAM_FILE_PATH] ({SourceFile})"
SourceFile = Database.GetScalarValue(oSQL)
End If
If System.IO.File.Exists(SourceFile) = False Then
Logger.Warn($"Parser@Sourcefile - File [{SourceFile}] is not existing!")
ErrorMessage &= vbNewLine & $"Parser@Sourcefile - File [{SourceFile}] is not existing!"
ErrorWhileParsing = True
Return False
End If
ElseIf oArg.StartsWith(PARAM_MODE) Then
RunMode = oArg.Replace(PARAM_MODE, "").ToUpper
ElseIf oArg.StartsWith(PARAM_TARGET) Then
TargetPath = oArg.Replace(PARAM_TARGET, "")
Dim oWMFolder = System.IO.Path.GetDirectoryName(TargetPath)
Dim oWindowsPath = TargetPath
Dim oExtension = IO.Path.GetExtension(oWindowsPath)
Dim oNormalizePath = Windream.GetNormalizedPath(TargetPath)
If Windream.TestFileExists(TargetPath) = False Then
Logger.Info($"WMFile [{TargetPath}] not existing!")
End If
If RunMode = MODE_VERSION Then
Dim oWMCheckPath = Windream.VersionWMFilename(TargetPath, System.IO.Path.GetExtension(TargetPath))
If oNormalizePath.ToUpper <> oWMCheckPath.ToString.ToUpper Then
Logger.Info($"Target [{oNormalizePath}] already existed!! - NewWMFilename [{oWMCheckPath}]")
TargetPath = oWMCheckPath
End If
End If
'Checks and creates the path if necessary
Windream.NewFolder(TargetPath, oExtension)
ElseIf oArg.StartsWith(PARAM_WMTO) Then
WindreamObjectType = oArg.Replace(PARAM_WMTO, "")
Dim oObjectTypExists As Boolean = False
Dim myWMOTypes = Windream.ObjectTypes
For Each otype As String In myWMOTypes
If WindreamObjectType = otype Then
oObjectTypExists = True
Exit For
End If
Next
If oObjectTypExists = False Then
Logger.Info($"WindreamObjectType [{WindreamObjectType}] not existing!!")
ErrorMessage &= vbNewLine & $"WindreamObjectType [{WindreamObjectType}] not existing!!"
Return False
ErrorWhileParsing = True
Else
WindreamIndicies = Windream.GetIndiciesByObjecttype(WindreamObjectType)
End If
ElseIf oArg.StartsWith(PARAM_INDEX) Then
oINDEXInfotemp = oArg
oINDEXInfoStarted = True
oINDEXInfotemp = oINDEXInfotemp.Replace(PARAM_INDEX, "")
Else
' All args that do not start with an argument identifier (-EXAMPLE@) are just parts of other arguments
' and are put back together just like they used to be before.
If oINDEXInfoStarted Then
oINDEXInfotemp &= " " & oArg
End If
End If
oCount += 1
Next
Logger.Debug("INDEXInfoTemp: [{0}]", oINDEXInfotemp)
Dim oIndexparts As List(Of String) = oINDEXInfotemp.
Split(New String() {"#~#"}, StringSplitOptions.RemoveEmptyEntries).
ToList()
For Each oIndexPart As String In oIndexparts
Logger.Debug(oIndexPart)
Next
Logger.Info($" [{oIndexparts.Count}] Indices parsed")
IndexArray = oIndexparts
Return True
Catch ex As Exception
Logger.Error(ex)
Logger.Warn("Error in ParseArgs:" & vbNewLine & ex.Message)
ErrorMessage &= vbNewLine & "Error in ParseArgs:" & vbNewLine & ex.Message
ErrorWhileParsing = True
System.Console.WriteLine($"Error in ParseArgs - {Now.ToString}")
Return False
End Try
End Function
Public Function StreamORIndexFile()
Try
Dim oResult As Boolean = False
If RunMode = MODE_VERSION Then
oResult = Windream.NewFileStream(SourceFile, TargetPath)
ElseIf RunMode = MODE_OVERWRITE Then
Dim oDeleted = Windream.RemoveFile(TargetPath)
If oDeleted = True Then
oResult = Windream.NewFileStream(SourceFile, TargetPath)
Else
Logger.Warn($"Mode ImportOverwrite is active - but WMFile could not be deleted!!")
End If
ElseIf RunMode = MODE_NACHINDEXIERUNG Then
oResult = True
End If
If oResult = True Then
Dim oFilePathToIndex As String = TargetPath
If RunMode = MODE_NACHINDEXIERUNG Then
oFilePathToIndex = SourceFile
Logger.Info($"Using Sourcefile as FileName: [{SourceFile}]")
Else
Logger.Info($"File successfully streamed to windream [{TargetPath}]!")
End If
Logger.Info("Indexing file [{0}]", oFilePathToIndex)
For Each oIndex As String In IndexArray
Dim oMatch As Match = oRegex.Match(oIndex)
If oMatch.Success Then
Dim oIndexName = oMatch.Groups(1)?.Value
Dim oIndexValues = oMatch.Groups.Item(2)?.Value
Dim oSplitValue = New String() {"~#~"}
Dim oIndexValueArray = oIndexValues.Split(oSplitValue, StringSplitOptions.RemoveEmptyEntries)
Dim oIndexResult = False
Logger.Info("Setting Index [{0}] to [{1}].", oIndexName, oIndexValues)
If Windream.TestIndexNameIsVectorIndex(oIndexName) Then
Dim oCombinedIndexValues = Windream.GetVectorData(oFilePathToIndex, oIndexName, oIndexValueArray, False)
oIndexResult = Windream.SetFileIndex(oFilePathToIndex, oIndexName, oCombinedIndexValues.ToList, WindreamObjectType)
Else
oIndexResult = Windream.SetFileIndex(oFilePathToIndex, oIndexName, oIndexValueArray(0), WindreamObjectType)
End If
oResult = oIndexResult
Else
oResult = False
End If
If oResult = False Then
Logger.Warn("Indexing failed. Exiting.")
Exit For
End If
Next
End If
If oResult = True Then
Logger.Info("## All Tasks finished ##")
ErrorWhileImporting = False
End If
#Region "Old Logic"
'If oResult = True Then
' If oMode <> MODE_NACHINDEXIERUNG Then
' LOGGER.Info($"File successfully streamed to windream [{oTargetPath}]! Now indexing...")
' End If
' For Each oIndex2 As String In oIndexArr
' Dim oIndexInfo() = oIndex2.Split("={")
' Dim oIndexName = oIndexInfo(0)
' Dim oIndexvalue
' Dim r As Regex = New Regex(oRegExArg, RegexOptions.IgnoreCase)
' ' ' Match the regular expression pattern against a text string.
' Dim m As Match = r.Match(oIndex2)
' Do While m.Success
' ' oClearedBodyText = oClearedBodyText.Replace(m.Value, "")
' 'Dim g As Group = m.Groups(1)
' Dim g1 As Group = m.Groups(2)
' Dim g2 As Group = m.Groups(3)
' If Not IsNothing(g2.Value) Then
' oIndexvalue = g2.Value
' Console.WriteLine($"Indexvalue: {oIndexvalue}")
' End If
' If Len(oIndexvalue) > 0 Then
' If WMIndices.Contains(oIndexName) Then
' LOGGER.Info($"Setting Index: oIndexName [{oIndexName}] - oIndexvalue [{oIndexvalue}]")
' 'DEBUG
' oIndexvalue = New List(Of String) From {"Wert 1", "Wert 2", "wert 3"}
' 'DEBUG
' If WINDREAM.SetFileIndex(oTargetPath, oIndexName, oIndexvalue, oWMObjecttype) = False Then
' LOGGER.Info($"Index could not be set...")
' If WINDREAM.RemoveFile(oTargetPath) = True Then
' LOGGER.Info($"File deleted after error!")
' End If
' oResult = False
' Exit For
' End If
' Else
' LOGGER.Warn($"Transmitted index with name [{oIndexName}] is not existing in WM Objecttype!")
' If WINDREAM.RemoveFile(oTargetPath) = True Then
' LOGGER.Info($"File deleted after error!")
' End If
' oResult = False
' Exit For
' End If
' End If
' m = m.NextMatch()
' Loop
' Next
' If oResult = True Then
' LOGGER.Info("## All Tasks finished ##")
' oErrorImport = False
' End If
'End If
#End Region
Return oResult
Catch ex As Exception
Logger.Warn($"Unexpected Error in StreamORIndexFile: {ex.Message}")
Logger.Error(ex)
Return False
End Try
End Function
End Class

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,10 @@
<?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>false</MySubMain>
<SingleInstance>false</SingleInstance>
<ShutdownMode>0</ShutdownMode>
<EnableVisualStyles>true</EnableVisualStyles>
<AuthenticationMode>0</AuthenticationMode>
<ApplicationType>1</ApplicationType>
<SaveMySettingsOnExit>true</SaveMySettingsOnExit>
</MyApplicationData>

View File

@@ -0,0 +1,35 @@
Imports System
Imports System.Reflection
Imports System.Runtime.InteropServices
' Allgemeine Informationen über eine Assembly werden über die folgenden
' Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
' die einer Assembly zugeordnet sind.
' Werte der Assemblyattribute überprüfen
<Assembly: AssemblyTitle("WiDigShared")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("WiDigShared")>
<Assembly: AssemblyCopyright("Copyright © 2021")>
<Assembly: AssemblyTrademark("")>
<Assembly: ComVisible(False)>
'Die folgende GUID wird für die typelib-ID verwendet, wenn dieses Projekt für COM verfügbar gemacht wird.
<Assembly: Guid("0ebd0a01-c0bd-4db0-9174-976458068937")>
' Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
'
' Hauptversion
' Nebenversion
' Buildnummer
' Revision
'
' Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
' indem Sie "*" wie unten gezeigt eingeben:
' <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", "16.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("DigitalData.GUIs.WiDigShared.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:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</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 name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</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:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</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", "16.8.1.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 "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 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
#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.DigitalData.GUIs.WiDigShared.My.MySettings
Get
Return Global.DigitalData.GUIs.WiDigShared.My.MySettings.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)" UseMySettingsClassName="true">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

View File

@@ -0,0 +1,131 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{A5D032D4-ABDC-44BF-8666-5FBE42AF0AB7}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>DigitalData.GUIs.WiDigShared</RootNamespace>
<AssemblyName>DigitalData.GUIs.WiDigShared</AssemblyName>
<FileAlignment>512</FileAlignment>
<MyType>Windows</MyType>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<DefineDebug>true</DefineDebug>
<DefineTrace>true</DefineTrace>
<OutputPath>bin\Debug\</OutputPath>
<DocumentationFile>DigitalData.GUIs.WiDigShared.xml</DocumentationFile>
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<DefineDebug>false</DefineDebug>
<DefineTrace>true</DefineTrace>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DocumentationFile>DigitalData.GUIs.WiDigShared.xml</DocumentationFile>
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
</PropertyGroup>
<PropertyGroup>
<OptionExplicit>On</OptionExplicit>
</PropertyGroup>
<PropertyGroup>
<OptionCompare>Binary</OptionCompare>
</PropertyGroup>
<PropertyGroup>
<OptionStrict>Off</OptionStrict>
</PropertyGroup>
<PropertyGroup>
<OptionInfer>On</OptionInfer>
</PropertyGroup>
<ItemGroup>
<Reference Include="DigitalData.Modules.Config">
<HintPath>..\..\DDMonorepo\Modules.Config\bin\Debug\DigitalData.Modules.Config.dll</HintPath>
</Reference>
<Reference Include="DigitalData.Modules.Database">
<HintPath>..\..\DDMonorepo\Modules.Database\bin\Debug\DigitalData.Modules.Database.dll</HintPath>
</Reference>
<Reference Include="DigitalData.Modules.Encryption">
<HintPath>..\..\DDMonorepo\Encryption\bin\Debug\DigitalData.Modules.Encryption.dll</HintPath>
</Reference>
<Reference Include="DigitalData.Modules.Logging">
<HintPath>..\..\DDMonorepo\Modules.Logging\bin\Debug\DigitalData.Modules.Logging.dll</HintPath>
</Reference>
<Reference Include="DigitalData.Modules.Windream">
<HintPath>..\..\DDMonorepo\Modules.Windream\bin\Debug\DigitalData.Modules.Windream.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CSharp" />
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.7.0\lib\net45\NLog.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Data" />
<Reference Include="System.IO.Compression" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.ServiceModel" />
<Reference Include="System.Transactions" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Net.Http" />
</ItemGroup>
<ItemGroup>
<Import Include="Microsoft.VisualBasic" />
<Import Include="System" />
<Import Include="System.Collections" />
<Import Include="System.Collections.Generic" />
<Import Include="System.Data" />
<Import Include="System.Diagnostics" />
<Import Include="System.Linq" />
<Import Include="System.Xml.Linq" />
<Import Include="System.Threading.Tasks" />
</ItemGroup>
<ItemGroup>
<Compile Include="ClassConfig.vb" />
<Compile Include="ClassWIDig.vb" />
<Compile Include="My Project\AssemblyInfo.vb" />
<Compile Include="My Project\Application.Designer.vb">
<AutoGen>True</AutoGen>
<DependentUpon>Application.myapp</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<Compile Include="My Project\Resources.Designer.vb">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="My Project\Settings.Designer.vb">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="My Project\Resources.resx">
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
<CustomToolNamespace>My.Resources</CustomToolNamespace>
<SubType>Designer</SubType>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<None Include="My Project\Application.myapp">
<Generator>MyApplicationCodeGenerator</Generator>
<LastGenOutput>Application.Designer.vb</LastGenOutput>
</None>
<None Include="My Project\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<CustomToolNamespace>My</CustomToolNamespace>
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
</None>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
</Project>

View File

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