This commit is contained in:
Developer01 2025-04-28 12:54:55 +02:00
commit 66328bb243
2 changed files with 15 additions and 15 deletions

View File

@ -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.9.6.0")> <Assembly: AssemblyVersion("1.9.6.1")>
<Assembly: AssemblyFileVersion("1.9.6.0")> <Assembly: AssemblyFileVersion("1.9.6.1")>

View File

@ -1268,44 +1268,44 @@ Public Class Windream
End Try End Try
End Function End Function
Public Function SetFileIndexLoS(pPath As String, IndexName As String, pValues As List(Of String), pObjectType As String) As Boolean Public Function SetFileIndexLoS(Path As String, IndexName As String, Values As List(Of String), ObjectType As String) As Boolean
If TestSessionLoggedIn() = False Then If TestSessionLoggedIn() = False Then
Return False Return False
End If End If
If TestFileExists(pPath) = False Then If TestFileExists(Path) = False Then
_logger.Warn("File '{0}' does not exist", pPath) _logger.Warn("File '{0}' does not exist", Path)
Return False Return False
End If End If
Dim oWMObject As IWMObject6 Dim oWMObject As IWMObject6
Try Try
'Das windream-Objekt erzeugen oWMObject = GetFileByPath(Path)
oWMObject = GetFileByPath(pPath)
Catch ex As Exception Catch ex As Exception
_logger.Warn("Could not create a WMObject for path '{0}'!!", pPath) _logger.Warn("Could not create a WMObject for path '{0}'!!", Path)
_logger.Warn(ex.Message) _logger.Warn(ex.Message)
Return False Return False
End Try End Try
'Das windream-Objekt zum editieren sperren/locken
If LockObject(oWMObject, WMObjectEditModeIndexEdit) = False Then If LockObject(oWMObject, WMObjectEditModeIndexEdit) = False Then
_logger.Warn("File {0} could not be locked") _logger.Warn("File {0} could not be locked")
Return False Return False
End If End If
If oWMObject.aObjectType.aName = Constants.OBJECT_TYPE_DEFAULT Then If oWMObject.aObjectType.aName = Constants.OBJECT_TYPE_DEFAULT Then
oWMObject.aObjectType = GetObjectByName(pObjectType, WMEntityObjectType) oWMObject.aObjectType = GetObjectByName(ObjectType, WMEntityObjectType)
End If End If
Try Try
Dim oType As Integer = GetIndexType(IndexName) Dim oType As Integer = GetIndexType(IndexName)
Dim oConvertedValues As New List(Of String) Dim oConvertedValues As New List(Of String)
Dim oArray As Object Dim oArray As Object
_logger.Debug("SetFileIndexLoS '{0}' - Indextype: {1} - ... ", IndexName, oType) _logger.Debug("SetFileIndexLoS '{0}' - Indextype: {1} - Values.Count: {2} ... ", IndexName, oType, Values.Count)
ReDim oArray(pValues.Count - 1) ReDim oArray(Values.Count - 1)
For oIndex = 0 To pValues.Count - 1 For oIndex = 0 To Values.Count - 1
Dim oValue As Object = Helpers.ConvertAttrValue(oType, pValues.Item(oIndex)) Dim oValue As Object = Helpers.ConvertAttrValue(oType, Values.Item(oIndex))
_logger.Debug("Converted Value: {0}", oValue.ToString)
oArray(oIndex) = oValue oArray(oIndex) = oValue
Next Next
@ -1313,7 +1313,7 @@ Public Class Windream
oWMObject.Save() oWMObject.Save()
If UnlockObject(oWMObject) = False Then If UnlockObject(oWMObject) = False Then
_logger.Warn("File {0} could not be unlocked", pPath) _logger.Warn("File {0} could not be unlocked", Path)
End If End If
Return True Return True