Projektdateien hinzufügen.
This commit is contained in:
49
GUIs.ZooFlow/Modules/ClipboardWatcher/ClassProfileLoader.vb
Normal file
49
GUIs.ZooFlow/Modules/ClipboardWatcher/ClassProfileLoader.vb
Normal file
@@ -0,0 +1,49 @@
|
||||
Imports DigitalData.Modules.EDMI.API
|
||||
Imports DigitalData.Modules.Logging
|
||||
|
||||
Namespace ClipboardWatcher
|
||||
Public Class ClassProfileLoader
|
||||
Private ReadOnly LogConfig As LogConfig
|
||||
Private ReadOnly Logger As Logger
|
||||
Private ReadOnly Database As DatabaseWithFallback
|
||||
|
||||
Public Sub New(LogConfig As LogConfig, Database As DatabaseWithFallback)
|
||||
Me.LogConfig = LogConfig
|
||||
Me.Logger = LogConfig.GetLogger()
|
||||
Me.Database = Database
|
||||
End Sub
|
||||
|
||||
Public Function LoadProfiles() As Boolean
|
||||
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 = Database.GetDatatable("VWCW_USER_PROFILE", oProfileSQL, Constants.DatabaseType.ECM)
|
||||
Dim oProfileProcesses = Database.GetDatatable("VWCW_PROFILE_REL_WINDOW", oProcessSQL, Constants.DatabaseType.ECM)
|
||||
Dim oProfileWindows = Database.GetDatatable("VWCW_PROFILE_REL_WINDOW", oWindowSQL, Constants.DatabaseType.ECM)
|
||||
Dim oProfileControls = Database.GetDatatable("VWCW_PROFILE_REL_CONTROL", oControlSQL, Constants.DatabaseType.ECM)
|
||||
|
||||
My.Application.ClipboardWatcher.UserProfiles = oUserProfiles
|
||||
My.Application.ClipboardWatcher.ProfileProcesses = oProfileProcesses
|
||||
My.Application.ClipboardWatcher.ProfileWindows = oProfileWindows
|
||||
My.Application.ClipboardWatcher.ProfileControls = oProfileControls
|
||||
My.Application.ClipboardWatcher.MonitoringActive = True
|
||||
|
||||
Return True
|
||||
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
|
||||
Return False
|
||||
|
||||
End Try
|
||||
End Function
|
||||
End Class
|
||||
|
||||
End Namespace
|
||||
|
||||
18
GUIs.ZooFlow/Modules/ClipboardWatcher/State.vb
Normal file
18
GUIs.ZooFlow/Modules/ClipboardWatcher/State.vb
Normal file
@@ -0,0 +1,18 @@
|
||||
Imports DigitalData.Modules.ZooFlow.Params
|
||||
|
||||
Namespace ClipboardWatcher
|
||||
Public Class State
|
||||
Public Property UserProfiles As DataTable = Nothing
|
||||
Public Property ProfileProcesses As DataTable = Nothing
|
||||
Public Property ProfileWindows As DataTable = Nothing
|
||||
Public Property ProfileControls As DataTable = Nothing
|
||||
|
||||
Public MatchTreeView As TreeView = New TreeView()
|
||||
|
||||
Public Property CurrentMatchingProfiles As List(Of ProfileData) = New List(Of ProfileData)
|
||||
Public Property CurrentProfilesWithResults As List(Of ProfileData) = New List(Of ProfileData)
|
||||
Public Property CurrentClipboardContents As String = String.Empty
|
||||
|
||||
Public Property MonitoringActive As Boolean = False
|
||||
End Class
|
||||
End Namespace
|
||||
65
GUIs.ZooFlow/Modules/ClipboardWatcher/Watcher.vb
Normal file
65
GUIs.ZooFlow/Modules/ClipboardWatcher/Watcher.vb
Normal file
@@ -0,0 +1,65 @@
|
||||
Imports System.Runtime.InteropServices
|
||||
Imports DigitalData.Modules.Windows
|
||||
|
||||
Namespace ClipboardWatcher
|
||||
Public Class Watcher
|
||||
Inherits NativeWindow
|
||||
Implements IDisposable
|
||||
|
||||
Public Event ClipboardChanged As EventHandler(Of IDataObject)
|
||||
Public Shared Singleton As New Watcher
|
||||
|
||||
Private _Handle As IntPtr
|
||||
|
||||
Private Sub New()
|
||||
MyBase.CreateHandle(New CreateParams)
|
||||
_Handle = NativeMethods.SetClipboardViewer(Handle)
|
||||
End Sub
|
||||
|
||||
Protected Overrides Sub WndProc(ByRef m As Message)
|
||||
Select Case m.Msg
|
||||
Case NativeMethods.WM_DRAWCLIPBOARD
|
||||
Dim oData As IDataObject = Clipboard.GetDataObject
|
||||
RaiseEvent ClipboardChanged(Me, oData)
|
||||
End Select
|
||||
MyBase.WndProc(m)
|
||||
End Sub
|
||||
|
||||
#Region "IDisposable Support"
|
||||
' Für diese Klasse ist korrekte Ressourcenbereinigung besonders wichtig, da
|
||||
' mit systemübergreifenden Ressourcen gearbeitet wird
|
||||
|
||||
' So ermitteln Sie überflüssige Aufrufe
|
||||
Private _DisposedValue As Boolean = False
|
||||
|
||||
Protected Overridable Sub Dispose(ByVal pDisposing As Boolean)
|
||||
If Not _DisposedValue Then
|
||||
If pDisposing Then
|
||||
' TODO: Verwaltete Ressourcen freigeben, wenn sie explizit
|
||||
' aufgerufen werden
|
||||
End If
|
||||
MyBase.DestroyHandle()
|
||||
Dim H As IntPtr = NativeMethods.SetClipboardViewer(_Handle)
|
||||
End If
|
||||
_DisposedValue = True
|
||||
End Sub
|
||||
|
||||
' Dieser Code wird von Visual Basic hinzugefügt, um das Dispose-Muster
|
||||
' richtig zu implementieren.
|
||||
Public Sub Dispose() Implements IDisposable.Dispose
|
||||
' Sie sollten diesen Code nicht ändern, sondern stattdessen ihren
|
||||
' Bereinigungscode oben in
|
||||
' Dispose(ByVal disposing As Boolean) einfügen.
|
||||
Dispose(True)
|
||||
System.GC.SuppressFinalize(Me)
|
||||
End Sub
|
||||
|
||||
Protected Overrides Sub Finalize()
|
||||
MyBase.Finalize()
|
||||
Dispose(False)
|
||||
End Sub
|
||||
#End Region
|
||||
End Class
|
||||
|
||||
End Namespace
|
||||
|
||||
Reference in New Issue
Block a user