fix delete after indexing, fix unexpected error in check_dropped_files

This commit is contained in:
Jonathan Jenne 2020-03-24 13:17:59 +01:00
parent ca0e115b4b
commit 0e737888f1
3 changed files with 32 additions and 14 deletions

View File

@ -639,7 +639,7 @@
<value>DocumentViewer1</value>
</data>
<data name="&gt;&gt;DocumentViewer1.Type" xml:space="preserve">
<value>DigitalData.Controls.DocumentViewer.DocumentViewer, DigitalData.Controls.DocumentViewer, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</value>
<value>DigitalData.Controls.DocumentViewer.DocumentViewer, DigitalData.Controls.DocumentViewer, Version=1.0.0.1, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;DocumentViewer1.Parent" xml:space="preserve">
<value>SplitContainer1.Panel2</value>

View File

@ -1173,6 +1173,15 @@ Public Class frmIndex
Try
ClassWindream._WDObjekttyp = _Objekttyp
Dim streamresult = ClassWindream.Stream_File(CURRENT_WORKFILE, CURRENT_NEWFILENAME)
If CONFIG.Config.DeleteOriginalFile = True Then
Try
My.Computer.FileSystem.DeleteFile(CURRENT_WORKFILE)
Catch ex As Exception
LOGGER.Error(ex)
End Try
End If
Return streamresult
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Critical, "Error in SINGLEFILE_2_WINDREAM:")
@ -1195,7 +1204,11 @@ Public Class frmIndex
Loop
End If
'Die Datei wird nun verschoben
If CONFIG.Config.DeleteOriginalFile = True Then
My.Computer.FileSystem.MoveFile(CURRENT_WORKFILE, CURRENT_NEWFILENAME)
Else
My.Computer.FileSystem.CopyFile(CURRENT_WORKFILE, CURRENT_NEWFILENAME)
End If
Dim Insert_String As String
Try
@ -1396,6 +1409,7 @@ Public Class frmIndex
End If
End If
BarCheckItem1.Checked = TopMost
labelFilePath.Caption = CURRENT_WORKFILE
@ -1455,6 +1469,8 @@ Public Class frmIndex
FormLoaded = True
If CONFIG.Config.ProfilePreselection Then
checkItemPreselection.Checked = True
If CURRENT_LASTDOKART <> "" Then
cmbDokumentart.SelectedIndex = cmbDokumentart.FindStringExact(CURRENT_LASTDOKART)
End If
@ -2154,7 +2170,7 @@ Public Class frmIndex
MsgBox("All files were successfully processed through Multiindexing", MsgBoxStyle.Information, "Success")
End If
DTACTUAL_FILES.Clear()
'DTACTUAL_FILES.Clear()
Me.Close()
End If
End If
@ -2187,7 +2203,7 @@ Public Class frmIndex
End If
End If
If CBool(CURR_DOKART_WD_DIRECT) = False Then
If CURR_DOKART_WD_DIRECT = False Then
'Datei verschieben
err = Move_Rename_Only(CURRENT_WORKFILE, CURRENT_NEWFILENAME, CURR_WORKFILE_EXTENSION, VERSION_DELIMITER)
Else
@ -2503,6 +2519,9 @@ Public Class frmIndex
ClearError()
ClearNotice()
DocumentViewer1.CloseDocument()
DocumentViewer1.Done()
Me.Cursor = Cursors.WaitCursor
ClassHelper.Refresh_RegexTable()
For Each rowregex As DataRow In CURRENT_DT_REGEX.Rows
@ -2535,7 +2554,7 @@ Public Class frmIndex
MsgBox("All files were successfully processed through Multiindexing", MsgBoxStyle.Information, "Success")
End If
DTACTUAL_FILES.Clear()
'DTACTUAL_FILES.Clear()
CancelAttempts = 2
Me.Close()
@ -2594,4 +2613,9 @@ Public Class frmIndex
CancelAttempts = 2
Close()
End Sub
Private Sub checkItemPreselection_CheckedChanged(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles checkItemPreselection.CheckedChanged
CONFIG.Config.ProfilePreselection = checkItemPreselection.Checked
CONFIG.Save()
End Sub
End Class

View File

@ -252,9 +252,7 @@ Public Class frmStart
Next
Show()
Catch ex As Exception
If Not ex.Message.StartsWith("Die Auflistung wurde geändert") Then
MsgBox("Unexpected Error in Check_Dropped_Files:" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
End If
End Try
End Sub
@ -262,15 +260,11 @@ Public Class frmStart
Try
Hide()
IndexForm.ShowDialog()
'AddHandler frmIndex.FormClosed, Sub()
' Show()
' BringToFront()
' End Sub
Catch ex As Exception
LOGGER.Error(ex)
MsgBox(ex.Message, MsgBoxStyle.Critical)
Finally
Show()
End Try
End Sub