ZooFlow: First working version of Clipboard Watcher
This commit is contained in:
@@ -47,7 +47,6 @@ Public Class ClassInit
|
||||
_Loader.AddStep("Initializing IDB Database..", AddressOf InitializeIDBDatabase, True)
|
||||
_Loader.AddStep("Initializing IDB Service..", AddressOf InitializeIDBService, True)
|
||||
_Loader.AddStep("Initializing Language..", AddressOf InitializeLanguage, False)
|
||||
_Loader.AddStep("Initializing Clipboard Watcher..", AddressOf InitializeClipboardWatcher, False)
|
||||
_Loader.AddStep("Loading 3rd-party licenses..", AddressOf Initialize3rdParty, False)
|
||||
_Loader.AddStep("Loading Basic Configs..", AddressOf InitBasicData, False)
|
||||
' === Init Schritte definieren
|
||||
@@ -259,39 +258,6 @@ Public Class ClassInit
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Sub InitializeClipboardWatcher(MyApplication As My.MyApplication)
|
||||
Try
|
||||
Dim oUserId = My.Application.User.UserId
|
||||
Dim oWhereClause = $"T1.USER_ID = {oUserId} OR GROUP_ID IN (SELECT DISTINCT GUID FROM TBDD_GROUPS WHERE GUID IN (SELECT GROUP_ID FROM TBDD_GROUPS_USER WHERE USER_ID = {oUserId}))"
|
||||
|
||||
Dim oProfileSQL As String = $"SELECT DISTINCT GUID, NAME,REGEX_EXPRESSION,COMMENT,PROC_NAME,PROFILE_TYPE FROM VWCW_USER_PROFILE T1 WHERE {oWhereClause}"
|
||||
Dim oProcessSQL As String = $"SELECT DISTINCT T.GUID, T.PROFILE_ID,T.PROC_NAME FROM TBCW_PROFILE_PROCESS T, VWCW_USER_PROFILE T1 WHERE T.PROFILE_ID = T1.GUID AND ({oWhereClause})"
|
||||
Dim oWindowSQL As String = $"SELECT DISTINCT T.* FROM VWCW_PROFILE_REL_WINDOW T, VWCW_USER_PROFILE T1 WHERE T.PROFILE_ID = T1.GUID AND ({oWhereClause})"
|
||||
Dim oControlSQL As String = $"SELECT DISTINCT T.* FROM VWCW_PROFILE_REL_CONTROL T, VWCW_USER_PROFILE T1 WHERE T.PROFILE_ID = T1.GUID AND ({oWhereClause})"
|
||||
|
||||
Dim oUserProfiles = My.Database.GetDatatable(oProfileSQL)
|
||||
|
||||
If oUserProfiles Is Nothing OrElse oUserProfiles.Rows.Count = 0 Then
|
||||
MyApplication.ClipboardWatcher.Status = ClipboardWatcher.State.EnumStatus.NoProfilesConfigured
|
||||
End If
|
||||
|
||||
Dim oProfileProcesses = My.Database.GetDatatable(oProcessSQL)
|
||||
Dim oProfileWindows = My.Database.GetDatatable(oWindowSQL)
|
||||
Dim oProfileControls = My.Database.GetDatatable(oControlSQL)
|
||||
|
||||
MyApplication.ClipboardWatcher.Status = ClipboardWatcher.State.EnumStatus.OK
|
||||
MyApplication.ClipboardWatcher.UserProfiles = oUserProfiles
|
||||
MyApplication.ClipboardWatcher.ProfileProcesses = oProfileProcesses
|
||||
MyApplication.ClipboardWatcher.ProfileWindows = oProfileWindows
|
||||
MyApplication.ClipboardWatcher.ProfileControls = oProfileControls
|
||||
MyApplication.ClipboardWatcher.MonitoringActive = True
|
||||
Catch ex As Exception
|
||||
MyApplication.ClipboardWatcher.Status = ClipboardWatcher.State.EnumStatus.Exception
|
||||
_Logger.Error(ex)
|
||||
Throw New InitException("Error while initializing clipboard watcher!", ex)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Sub HandleUserInfo(MyApplication As My.MyApplication, Row As DataRow)
|
||||
Dim oValue As Object = Row.Item("VALUE")
|
||||
Dim oName As String = Row.Item("NAME").ToString
|
||||
|
||||
Reference in New Issue
Block a user