This commit is contained in:
Jonathan Jenne
2019-09-13 16:05:20 +02:00
parent 6b955569f6
commit 8a8b286c77
19 changed files with 621 additions and 527 deletions

View File

@@ -1,4 +1,6 @@
Public Class frmFlowForm
Imports DigitalData.Modules.Messaging
Public Class frmFlowForm
Private WithEvents Watcher As ClassClipboardWatcher = ClassClipboardWatcher.Singleton
Private ActiveModules As List(Of String)
@@ -13,10 +15,33 @@
End Sub
Private Sub frmFlowForm_Load(sender As Object, e As EventArgs) Handles MyBase.Load
' === Set Form Properties ===
AllowDrop = True
ShowInTaskbar = False
SetFlowFormState(OnFlowFormStateChangedEvent.FlowFormState.Default)
SetBitmap(My.Resources.CW_wartet_klein)
' === Register As Event Listener ===
EventBus.Instance.Register(Me)
End Sub
Private Sub frmFlowForm_Closed(sender As Object, e As EventArgs) Handles Me.Closed
EventBus.Instance.Unregister(Me)
End Sub
Private Sub frmFlowForm_Click(sender As Object, e As EventArgs) Handles Me.MouseClick
EventBus.Instance.PostEvent(New OnFlowFormInteractionEvent(OnFlowFormInteractionEvent.FlowFormInteraction.Click))
End Sub
Public Sub OnEvent(e As OnFlowFormStateChangedEvent)
SetFlowFormState(e.State)
End Sub
Public Sub SetFlowFormState(State As OnFlowFormStateChangedEvent.FlowFormState)
Select Case State
Case OnFlowFormStateChangedEvent.FlowFormState.HasSearchResults
SetBitmap(My.Resources.CW_GEFUNDEN_klein)
Case Else
SetBitmap(My.Resources.ZOOFLOW_Home_klein)
End Select
End Sub
Private Sub frmFlowForm_DragOver(sender As Object, e As DragEventArgs) Handles Me.DragOver
@@ -26,15 +51,15 @@
If e.Data.GetDataPresent(DataFormats.FileDrop) Then
' Handle file dragged from Windows
e.Effect = DragDropEffects.Copy
SetBitmap(My.Resources.CW_hatwas_klein)
SetFlowFormState(OnFlowFormStateChangedEvent.FlowFormState.HasSearchResults)
ElseIf e.Data.GetDataPresent("FileGroupDescriptor") Then
' Handle a message dragged from Outlook
e.Effect = DragDropEffects.Copy
SetBitmap(My.Resources.CW_hatwas_klein)
SetFlowFormState(OnFlowFormStateChangedEvent.FlowFormState.HasSearchResults)
ElseIf e.Data.GetDataPresent("aryFileGroupDescriptor") AndAlso (e.Data.GetDataPresent("FileContents")) Then
' Handle a message dragged from Thunderbird?
e.Effect = DragDropEffects.Copy
SetBitmap(My.Resources.CW_hatwas_klein)
SetFlowFormState(OnFlowFormStateChangedEvent.FlowFormState.HasSearchResults)
Else
' Otherwise, do not handle
e.Effect = DragDropEffects.None
@@ -43,7 +68,7 @@
End Sub
Private Sub frmFlowForm_DragLeave(sender As Object, e As EventArgs) Handles Me.DragLeave
SetBitmap(My.Resources.CW_wartet_klein)
SetFlowFormState(OnFlowFormStateChangedEvent.FlowFormState.Default)
End Sub
Private Sub Watcher_ClipboardChanged(sender As Object, e As IDataObject) Handles Watcher.ClipboardChanged
@@ -52,15 +77,15 @@
End If
End Sub
''' <summary>
''' DragDrop Support
''' </summary>
Protected Overrides Sub WndProc(ByRef m As Message)
If m.Msg = &H84 Then
m.Result = CType(2, IntPtr)
Return
End If
'''' <summary>
'''' DragDrop Support
'''' </summary>
'Protected Overrides Sub WndProc(ByRef m As Message)
' If m.Msg = &H84 Then
' m.Result = CType(2, IntPtr)
' Return
' End If
MyBase.WndProc(m)
End Sub
' MyBase.WndProc(m)
'End Sub
End Class