Decide_Filehandle: topmost MessageBox Fix
This commit is contained in:
parent
2ca5bd4c37
commit
a0c725163a
@ -1,5 +1,6 @@
|
|||||||
Imports System.IO
|
Imports System.IO
|
||||||
Imports System.Text.RegularExpressions
|
Imports System.Text.RegularExpressions
|
||||||
|
Imports DevExpress.XtraEditors
|
||||||
Imports Independentsoft
|
Imports Independentsoft
|
||||||
|
|
||||||
Public Class ClassFilehandle
|
Public Class ClassFilehandle
|
||||||
@ -16,31 +17,40 @@ Public Class ClassFilehandle
|
|||||||
Dim r = New Regex(String.Format("[{0}]", Regex.Escape(regexSearch)))
|
Dim r = New Regex(String.Format("[{0}]", Regex.Escape(regexSearch)))
|
||||||
Return r.Replace(Input, replacement)
|
Return r.Replace(Input, replacement)
|
||||||
End Function
|
End Function
|
||||||
Public Shared Function Decide_FileHandle(filename As String, handletype As String)
|
Public Shared Function Decide_FileHandle(pFilename As String, pHandletype As String)
|
||||||
Try
|
Try
|
||||||
If filename.EndsWith(".msg") Then
|
If pFilename.EndsWith(".msg") Then
|
||||||
CURRENT_MESSAGEID = ""
|
CURRENT_MESSAGEID = ""
|
||||||
Dim _msg As New Msg.Message(filename)
|
Dim oMsg As New Msg.Message(pFilename)
|
||||||
If _msg.Attachments.Count > 0 Then
|
If oMsg.Attachments.Count > 0 Then
|
||||||
Dim result As MsgBoxResult
|
|
||||||
|
Dim oTitle As String
|
||||||
|
Dim oMessage As String
|
||||||
|
|
||||||
If USER_LANGUAGE = "de-DE" Then
|
If USER_LANGUAGE = "de-DE" Then
|
||||||
result = MessageBox.Show(New Form With {.TopMost = True}, "Achtung: Die Email enthält Anhänge!" & vbNewLine & "Wollen Sie die Anhänge separat indexieren und herauslösen?", "Nachfrage zur Indexierung:", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
|
oTitle = "Nachfrage zur Indexierung:"
|
||||||
|
oMessage = "Achtung: Die Email enthält Anhänge!" & vbNewLine & "Wollen Sie die Anhänge separat indexieren und herauslösen?"
|
||||||
Else
|
Else
|
||||||
result = MessageBox.Show(New Form With {.TopMost = True}, "Attention: This Email contains Attachments!" & vbNewLine & "Do you want to extract the attachments and index them seperately?", "Question about Indexing:", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
|
oTitle = "Question about Indexing:"
|
||||||
|
oMessage = "Attention: This Email contains Attachments!" & vbNewLine & "Do you want to extract the attachments and index them seperately?"
|
||||||
End If
|
End If
|
||||||
|
Dim oResult As DialogResult
|
||||||
|
|
||||||
If result = MsgBoxResult.Yes Then
|
' Weird hack to force messagebox to be topmost
|
||||||
If handletype.StartsWith("|FW") Then
|
' https://stackoverflow.com/questions/1220882/keep-messagebox-show-on-top-of-other-application-using-c-sharp
|
||||||
Return Email_Decay(filename, True)
|
oResult = MessageBox.Show(oMessage, oTitle, MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly)
|
||||||
|
|
||||||
|
If oResult = MsgBoxResult.Yes Then
|
||||||
|
If pHandletype.StartsWith("|FW") Then
|
||||||
|
Return Email_Decay(pFilename, True)
|
||||||
Else
|
Else
|
||||||
Return Email_Decay(filename)
|
Return Email_Decay(pFilename)
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If filename.ToUpper.EndsWith(".LNK") Then
|
If pFilename.ToUpper.EndsWith(".LNK") Then
|
||||||
If USER_LANGUAGE = "de-DE" Then
|
If USER_LANGUAGE = "de-DE" Then
|
||||||
MsgBox("Verknüpfungen können nicht abgelegt werden!", MsgBoxStyle.Critical, "Global Indexer")
|
MsgBox("Verknüpfungen können nicht abgelegt werden!", MsgBoxStyle.Critical, "Global Indexer")
|
||||||
Else
|
Else
|
||||||
@ -49,7 +59,7 @@ Public Class ClassFilehandle
|
|||||||
Return False
|
Return False
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Return Insert_GI_File(filename, handletype)
|
Return Insert_GI_File(pFilename, pHandletype)
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
MsgBox("Unexpected Error in Decide_FileHandle: " & ex.Message, MsgBoxStyle.Critical)
|
MsgBox("Unexpected Error in Decide_FileHandle: " & ex.Message, MsgBoxStyle.Critical)
|
||||||
Return False
|
Return False
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user