2 Commits

Author SHA1 Message Date
Jonathan Jenne
6be0dd3aa8 Windream: Version 1.2.0 2021-05-10 11:38:32 +02:00
Jonathan Jenne
8ac01eefa4 Windream: use file versioning from Filesystem Module in VersionWMFilename 2021-05-10 11:37:58 +02:00
3 changed files with 28 additions and 20 deletions

View File

@@ -12,7 +12,7 @@ Imports System.Runtime.InteropServices
<Assembly: AssemblyDescription("")> <Assembly: AssemblyDescription("")>
<Assembly: AssemblyCompany("")> <Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("Modules.Windream")> <Assembly: AssemblyProduct("Modules.Windream")>
<Assembly: AssemblyCopyright("Copyright © 2018")> <Assembly: AssemblyCopyright("Copyright © 2021")>
<Assembly: AssemblyTrademark("")> <Assembly: AssemblyTrademark("")>
<Assembly: ComVisible(False)> <Assembly: ComVisible(False)>
@@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
' übernehmen, indem Sie "*" eingeben: ' übernehmen, indem Sie "*" eingeben:
' <Assembly: AssemblyVersion("1.0.*")> ' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("1.1.0.0")> <Assembly: AssemblyVersion("1.2.0.0")>
<Assembly: AssemblyFileVersion("1.1.0.0")> <Assembly: AssemblyFileVersion("1.2.0.0")>

View File

@@ -94,6 +94,7 @@ Public Class Windream
#Region "Private Properties" #Region "Private Properties"
Private ReadOnly _logger As Logger Private ReadOnly _logger As Logger
Private ReadOnly _logConfig As LogConfig Private ReadOnly _logConfig As LogConfig
Private ReadOnly _fileSystem As Filesystem.File
Private ReadOnly _sessionDomain As String Private ReadOnly _sessionDomain As String
Private ReadOnly _sessionPassword As String Private ReadOnly _sessionPassword As String
Private ReadOnly _sessionUsername As String Private ReadOnly _sessionUsername As String
@@ -144,6 +145,7 @@ Public Class Windream
' Create logger and save LogFactory for dependent classes ' Create logger and save LogFactory for dependent classes
_logger = LogConfig.GetLogger() _logger = LogConfig.GetLogger()
_logConfig = LogConfig _logConfig = LogConfig
_fileSystem = New Filesystem.File(LogConfig)
' Create a session ' Create a session
Dim oSession As IWMSession2 = NewSession(SessionServerName, SessionUserName, SessionPassword, SessionDomain) Dim oSession As IWMSession2 = NewSession(SessionServerName, SessionUserName, SessionPassword, SessionDomain)
@@ -1406,23 +1408,25 @@ Public Class Windream
End Try End Try
End Function End Function
Public Function VersionWMFilename(pPath As String, pExt As String) Public Function VersionWMFilename(pPath As String, pExt As String)
Dim rNewFilepath As String = pPath Return _fileSystem.GetVersionedFilename(pPath)
pPath = GetNormalizedPath(pPath)
Dim oPath = pPath.Substring(0, pPath.LastIndexOf("\")) 'Dim rNewFilepath As String = pPath
Dim oFilename = pPath.Substring(pPath.LastIndexOf("\") + 1, pPath.Length - pPath.LastIndexOf("\") - 1) 'pPath = GetNormalizedPath(pPath)
Dim oCheck = oFilename 'Dim oPath = pPath.Substring(0, pPath.LastIndexOf("\"))
Dim oSplit As List(Of String) = oFilename.Split("~").ToList() 'Dim oFilename = pPath.Substring(pPath.LastIndexOf("\") + 1, pPath.Length - pPath.LastIndexOf("\") - 1)
oFilename = oFilename.Replace(pExt, "") 'Dim oCheck = oFilename
Dim oCount As Integer = 2 'Dim oSplit As List(Of String) = oFilename.Split("~").ToList()
Do While TestFileExists(rNewFilepath) = True 'oFilename = oFilename.Replace(pExt, "")
oFilename = oFilename.Replace(pExt, "") 'Dim oCount As Integer = 2
Dim oVersion = "~" + (oCount - 1).ToString 'Do While TestFileExists(rNewFilepath) = True
oFilename = oFilename.Replace(oVersion, "") ' oFilename = oFilename.Replace(pExt, "")
oFilename = oFilename & "~" & oCount & pExt ' Dim oVersion = "~" + (oCount - 1).ToString
oCount += 1 ' oFilename = oFilename.Replace(oVersion, "")
rNewFilepath = oPath + "\" + oFilename ' oFilename = oFilename & "~" & oCount & pExt
Loop ' oCount += 1
Return rNewFilepath ' rNewFilepath = oPath + "\" + oFilename
'Loop
'Return rNewFilepath
End Function End Function
Public Function TestFolderExists(Path As String) As Boolean Public Function TestFolderExists(Path As String) As Boolean
Return TestObjectExists(GetNormalizedPath(Path), WMEntityFolder) Return TestObjectExists(GetNormalizedPath(Path), WMEntityFolder)

View File

@@ -136,6 +136,10 @@
<None Include="packages.config" /> <None Include="packages.config" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Modules.Filesystem\Filesystem.vbproj">
<Project>{991d0231-4623-496d-8bd0-9ca906029cbc}</Project>
<Name>Filesystem</Name>
</ProjectReference>
<ProjectReference Include="..\Modules.Language\Language.vbproj"> <ProjectReference Include="..\Modules.Language\Language.vbproj">
<Project>{d3c8cfed-d6f6-43a8-9bdf-454145d0352f}</Project> <Project>{d3c8cfed-d6f6-43a8-9bdf-454145d0352f}</Project>
<Name>Language</Name> <Name>Language</Name>