This commit is contained in:
SchreiberM
2015-09-30 17:05:36 +02:00
parent 3f25fc766f
commit 95fd5804d2
29 changed files with 2541 additions and 7481 deletions

View File

@@ -5,11 +5,12 @@ Public Class ClassDragDrop
Public Shared files_dropped As String()
Public Shared Function Drop_File(e As DragEventArgs)
Try
ClassLogger.Add(">> Drop_File", False)
If LogErrorsOnly = False Then ClassLogger.Add(">> In Drop_File....", False)
files_dropped = Nothing
Dim oApp As New Outlook.Application
Dim sql As String = "DELETE FROM TBPMO_FILES_USER WHERE UPPER(USER_WORK) = UPPER('" & Environment.UserName & "')"
ClassDatabase.Execute_non_Query(sql)
If e.Data.GetDataPresent(DataFormats.FileDrop) Then
If LogErrorsOnly = False Then ClassLogger.Add(">> DataFormats.FileDrop", False)
Dim MyFiles() As String
@@ -24,23 +25,9 @@ Public Class ClassDragDrop
' ListBox1.Items.Add(MyFiles(i))
Next
Return files_dropped
ElseIf e.Data.GetDataPresent("FileGroupDescriptor") Then
If LogErrorsOnly = False Then ClassLogger.Add(">> Drop of OutlookMessage", False)
'supports a drop of a Outlook message
Dim myobj As Object
End If
For i As Integer = 1 To oApp.ActiveExplorer.Selection.Count
myobj = oApp.ActiveExplorer.Selection.Item(i)
'hardcode a destination path for testing
Dim strFile As String = IO.Path.Combine(Path.GetTempPath, (myobj.Subject + ".msg").Replace(":", ""))
myobj.SaveAs(strFile)
ReDim Preserve files_dropped(i)
files_dropped(i) = "@OUTLOOKMESSAGE@" & strFile
Next
Return files_dropped
ElseIf e.Data.GetDataPresent("aryFileGroupDescriptor") AndAlso (e.Data.GetDataPresent("FileContents")) Then
If e.Data.GetDataPresent("FileGroupDescriptor") AndAlso (e.Data.GetDataPresent("FileContents")) Then
If LogErrorsOnly = False Then ClassLogger.Add(">> FileGroupDescriptor/FileContents", False)
'// the first step here is to get the stbFileName
'// of the attachment and
@@ -99,25 +86,25 @@ Public Class ClassDragDrop
'lblFile.Text += "Attachment File from Outlook could not be created" + Environment.NewLine
End If
End If
Else
'otherwise, do not handle
e.Effect = DragDropEffects.None
frmForm_Constructor.tsstatus_Detail_show(True, "DragEnter ... Other FileFormat")
If LogErrorsOnly = True Then ClassLogger.Add("DragEnter ... Other FileFormat", False)
End If
If e.Data.GetDataPresent("FileGroupDescriptor") Then
If LogErrorsOnly = False Then ClassLogger.Add(">> Drop of OutlookMessage", False)
'supports a drop of a Outlook message
Dim myobj As Object
For i As Integer = 1 To oApp.ActiveExplorer.Selection.Count
myobj = oApp.ActiveExplorer.Selection.Item(i)
If e.Data.GetDataPresent(DataFormats.FileDrop) Then
'Drop eines Outlook Attachments
ElseIf (e.Data.GetDataPresent("FileGroupDescriptor")) AndAlso (e.Data.GetDataPresent("FileContents")) Then
ElseIf e.Data.GetDataPresent("FileGroupDescriptor") Then
'hardcode a destination path for testing
Dim strFile As String = IO.Path.Combine(Path.GetTempPath, (myobj.Subject + ".msg").Replace(":", ""))
myobj.SaveAs(strFile)
ReDim Preserve files_dropped(i)
files_dropped(i) = "@OUTLOOKMESSAGE@" & strFile
Next
Return files_dropped
End If
Catch ex As Exception
MsgBox("Error in Drop_File: " & ex.Message, MsgBoxStyle.Critical)
End Try
@@ -149,20 +136,20 @@ Public Class ClassDragDrop
End Function
Public Shared Sub Drag_enter(e As DragEventArgs)
Try
My.Settings.WD_INDEXDOKART_SAVE = ""
If e.Data.GetDataPresent(DataFormats.FileDrop) Then
e.Effect = DragDropEffects.All
If LogErrorsOnly = True Then ClassLogger.Add("DragEnter ... SimpleFileDrop", False)
frmForm_Constructor.tslblStatusMain_show(True, "DragEnter ... SimpleFileDrop")
ElseIf (e.Data.GetDataPresent("FileGroupDescriptor")) AndAlso (e.Data.GetDataPresent("FileContents")) Then
e.Effect = DragDropEffects.Copy
frmForm_Constructor.tslblStatusMain_show(True, "DragEnter ... Attachment from Outlook")
If LogErrorsOnly = True Then frmForm_Constructor.tsstatus_Detail_show(True, "DragEnter ... Attachment from Outlook")
ElseIf e.Data.GetDataPresent("FileGroupDescriptor") Then
'handle a message dragged from Outlook
e.Effect = DragDropEffects.Copy
frmForm_Constructor.tslblStatusMain_show(True, "DragEnter ... OutlookMessage")
If LogErrorsOnly = True Then ClassLogger.Add("DragEnter ... OutlookMessage", False)
ElseIf e.Data.GetDataPresent("aryFileGroupDescriptor") AndAlso (e.Data.GetDataPresent("FileContents")) Then
e.Effect = DragDropEffects.Copy
frmForm_Constructor.tslblStatusMain_show(True, "DragEnter ... Attachment from Outlook")
If LogErrorsOnly = True Then frmForm_Constructor.tsstatus_Detail_show(True, "DragEnter ... Attachment from Outlook")
Else
'otherwise, do not handle
e.Effect = DragDropEffects.None