MS IDB Anbindung RightClick und Events

This commit is contained in:
2020-08-17 11:23:11 +02:00
parent 64d957a217
commit 1698e9cc97
21 changed files with 790 additions and 15 deletions

View File

@@ -10,4 +10,5 @@
Public Const MODULE_CLIPBOARDWATCHER = "CW"
Public Const MODULE_GLOBAL_INDEXER = "GLOBIX"
Public Const MODULE_ZOOFLOW = "ZOOFLOW"
End Class

View File

@@ -76,7 +76,23 @@ Public Class ClassInit
My.Application.User = oMyApplication.User
My.Application.Modules = oMyApplication.Modules
My.Application.ModulesActive = oMyApplication.ModulesActive
If My.Application.ModulesActive.Contains(ClassConstants.MODULE_ZOOFLOW) Then
If My.Database.DBInitialized Then
Dim oSQl = "SELECT * FROM TBDD_CONNECTION WHERE BEZEICHNUNG = 'IDB'"
Dim oDTCONN_IDB As DataTable = My.Database.GetDatatable(oSQl)
If oDTCONN_IDB.Rows.Count = 1 Then
Dim oConString = My.Database.GetConnectionString(oDTCONN_IDB.Rows(0).Item("SERVER"), oDTCONN_IDB.Rows(0).Item("DATENBANK"), oDTCONN_IDB.Rows(0).Item("USERNAME"), oDTCONN_IDB.Rows(0).Item("PASSWORD"))
My.Database_IDB = New MSSQLServer(My.LogConfig, oConString)
If My.Database.DBInitialized = False Then
_Logger.Warn("Could not initialize IDB-Database!")
Throw New InitException("Could not initialize IDB-Database!")
End If
End If
End If
End If
RaiseEvent Completed(sender, Nothing)
End If
End Sub
@@ -90,8 +106,8 @@ Public Class ClassInit
My.Database = New MSSQLServer(My.LogConfig, oDecryptedConnectionString)
If My.Database.DBInitialized = False Then
_Logger.Warn("Datenbank konnte nicht initialisiert werden!")
Throw New InitException("Datenbank konnte nicht initialisiert werden!")
_Logger.Warn("Could not initialize DD_ECM-Database!")
Throw New InitException("Could not initialize DD_ECM-Database!")
End If
End Sub
@@ -134,8 +150,11 @@ Public Class ClassInit
Case MODULE_GLOBAL_INDEXER
HandleModuleInfo(MyApplication, oType, oRow)
Case MODULE_ZOOFLOW
HandleModuleInfo(MyApplication, oType, oRow)
End Select
Next
Catch ex As Exception
_Logger.Error(ex)
Throw New InitException("Fehler beim Laden des Benutzers!")

View File

@@ -28,6 +28,7 @@ Namespace My
Property LogConfig As LogConfig
Property MainForm As frmAdmin
Property Database As MSSQLServer
Property Database_IDB As MSSQLServer
Property Queries As New ClassQueries
End Module
@@ -42,6 +43,7 @@ Namespace My
Public Property Modules As New Dictionary(Of String, State.ModuleState)
Public Property ModulesActive As New List(Of String)
Public Property ClipboardWatcher As New ClipboardWatcher.State
Public Property IDB_ConnectionString As String
End Class
End Namespace

View File

@@ -53,7 +53,7 @@ Partial Public Class frmAdmin
FlowForm.Show()
' === Load Data ===
RefreshData()
CW_RefreshData()
End Sub
Private Sub frmAdmin_Shown(sender As Object, e As EventArgs) Handles Me.Shown
@@ -85,7 +85,7 @@ Partial Public Class frmAdmin
End Sub
Private Sub TimerRefreshData_Tick(sender As Object, e As EventArgs)
RefreshData()
CW_RefreshData()
End Sub
Private Async Sub FlowForm_ClipboardChanged(sender As Object, e As IDataObject) Handles FlowForm.ClipboardChanged
@@ -175,14 +175,14 @@ Partial Public Class frmAdmin
End If
End Sub
Public Sub RefreshData()
Public Sub CW_RefreshData()
Try
Dim oUserId As Integer = My.Application.User.UserId
Dim oSql As String = My.Queries.ClipboardWatcher.VWCW_USER_PROFILE(oUserId)
My.Application.ClipboardWatcher.UserProfiles = My.Database.GetDatatable(oSql)
If My.Application.ClipboardWatcher.UserProfiles.Rows.Count = 0 Then
MsgBox("No profiles configured for this user so far!", MsgBoxStyle.Exclamation)
Logger.Debug("CW_RefreshData - No profiles configured for this user so far!")
Else
oSql = My.Queries.ClipboardWatcher.TBCW_PROFILE_PROCESS(oUserId)
My.Application.ClipboardWatcher.ProfileProcesses = My.Database.GetDatatable(oSql)

View File

@@ -1,9 +1,10 @@
Imports DigitalData.Modules.Messaging
Imports System.ComponentModel
Imports DigitalData.Modules.Messaging
Public Class frmFlowForm
Private WithEvents Watcher As ClassClipboardWatcher = ClassClipboardWatcher.Singleton
Private ActiveModules As List(Of String)
Private ESCHitCount As Integer = 0
Private CurrentState As OnFlowFormStateChangedEvent.FlowFormState = OnFlowFormStateChangedEvent.FlowFormState.Default
Public Event ClipboardChanged As EventHandler(Of IDataObject)
@@ -27,20 +28,31 @@ Public Class frmFlowForm
AddHandler MouseClick, New MouseEventHandler(AddressOf Form_MouseClick)
AddHandler MouseMove, New MouseEventHandler(AddressOf Form_MouseMove)
AddHandler KeyUp, New KeyEventHandler(AddressOf Form_KeyUp)
' === 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)
Try
EventBus.Instance.Unregister(Me)
Catch ex As Exception
End Try
End Sub
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))
Private Sub Form_MouseClick(sender As Object, ByVal e As MouseEventArgs)
If e.Button = MouseButtons.Right Then
MsgBox("RightMouseClick", MsgBoxStyle.OkOnly)
Else
If CurrentState = OnFlowFormStateChangedEvent.FlowFormState.HasSearchResults Then
SetFlowFormState(OnFlowFormStateChangedEvent.FlowFormState.Default)
EventBus.Instance.PostEvent(New OnFlowFormInteractionEvent(OnFlowFormInteractionEvent.FlowFormInteraction.Click))
End If
End If
End Sub
Private Sub Form_MouseMove(ByVal sender As Object, ByVal e As MouseEventArgs)
@@ -49,6 +61,23 @@ Public Class frmFlowForm
Win32.SendMessage(Handle, Win32.WM_NCLBUTTONDOWN, Win32.HTCAPTION, 0)
End If
End Sub
Private Sub Form_KeyUp(ByVal sender As Object, ByVal e As KeyEventArgs)
If e.KeyCode = Keys.Escape Then
If ESCHitCount > 0 Then
Dim result As DialogResult = MessageBox.Show("Exit Zooflow", "Please Varify", MessageBoxButtons.YesNo)
If result = DialogResult.Yes Then
Application.Exit()
End If
Else
ESCHitCount += 1
End If
ElseIf e.KeyCode = Keys.D AndAlso (e.Control) Then
If ActiveModules.Contains(ClassConstants.MODULE_ZOOFLOW) Then
MsgBox("Search")
End If
End If
End Sub
Public Sub OnEvent(e As OnFlowFormStateChangedEvent)
CurrentState = e.State
@@ -99,6 +128,10 @@ Public Class frmFlowForm
End If
End Sub
Private Sub frmFlowForm_Closing(sender As Object, e As CancelEventArgs) Handles Me.Closing
End Sub
'''' <summary>
'''' DragDrop Support
'''' </summary>