clipboard watcher migration

This commit is contained in:
Jonathan Jenne
2019-09-25 16:30:35 +02:00
parent cc2d8cbe33
commit f5d43edeef
40 changed files with 1637 additions and 56 deletions

View File

@@ -18,12 +18,15 @@ Public Class frmFlowForm
Private Sub frmFlowForm_Load(sender As Object, e As EventArgs) Handles MyBase.Load
' === Set Form Properties ===
TopMost = True
AllowDrop = True
ShowInTaskbar = False
SetFlowFormState(OnFlowFormStateChangedEvent.FlowFormState.Default)
' === Register Events ===
AddHandler Click, AddressOf frmFlowForm_Click
AddHandler MouseClick, New MouseEventHandler(AddressOf Form_MouseClick)
AddHandler MouseMove, New MouseEventHandler(AddressOf Form_MouseMove)
' === Register As Event Listener ===
EventBus.Instance.Register(Me)
@@ -33,13 +36,20 @@ Public Class frmFlowForm
EventBus.Instance.Unregister(Me)
End Sub
Private Sub frmFlowForm_Click(sender As Object, e As EventArgs)
Private Sub Form_MouseClick(sender As Object, e As EventArgs)
If CurrentState = OnFlowFormStateChangedEvent.FlowFormState.HasSearchResults Then
SetFlowFormState(OnFlowFormStateChangedEvent.FlowFormState.Default)
EventBus.Instance.PostEvent(New OnFlowFormInteractionEvent(OnFlowFormInteractionEvent.FlowFormInteraction.Click))
End If
End Sub
Private Sub Form_MouseMove(ByVal sender As Object, ByVal e As MouseEventArgs)
If e.Button = MouseButtons.Left Then
Win32.ReleaseCapture()
Win32.SendMessage(Handle, Win32.WM_NCLBUTTONDOWN, Win32.HTCAPTION, 0)
End If
End Sub
Public Sub OnEvent(e As OnFlowFormStateChangedEvent)
CurrentState = e.State
SetFlowFormState(e.State)