C# Класс ACAT.Lib.Core.Utility.WindowActivityMonitor

Monitors the activity of the foreground window and notifies event subscribers if the focues of the active window changes, OR if the focus changes from one control to another inside the active window Also supports a heartbeat where subscribers can be periodically notified of the current focused window/ window element
Показать файл Открыть проект

Открытые методы

Метод Описание
Dispose ( ) : void

Disposes resources

GetActiveWindowAsync ( ) : void

Asyncrhonously forces an event to be raised regardless of whether focus changed or not

IsDifferent ( AutomationElement ele1, AutomationElement ele2 ) : bool

Compares the two automation elements and returns if they are identical or not

Pause ( ) : void

Pauses the activity monitoring. No events will be raised when paused

Resume ( ) : void

Resumes window activity monitoring.

Start ( ) : bool

Starts activity monitoring

Приватные методы

Метод Описание
GetActiveWindow ( ) : void
GetForegroundWindowInfo ( ) : ACAT.Lib.Core.Utility.WindowActivityMonitorInfo
GetProcessForWindow ( IntPtr hwnd ) : Process
_timer_Tick ( object sender, EventArgs e ) : void

The timer function to check the currently focused window and to see if focus changed or not

getActiveWindow ( bool flag = false ) : void
release ( Object syncObj ) : void

Releases the synch object

tryEnter ( Object syncObj ) : bool

Uses Monitor to see if it can enter

Описание методов

Dispose() публичный статический метод

Disposes resources
public static Dispose ( ) : void
Результат void

GetActiveWindowAsync() публичный статический метод

Asyncrhonously forces an event to be raised regardless of whether focus changed or not
public static GetActiveWindowAsync ( ) : void
Результат void

IsDifferent() публичный статический метод

Compares the two automation elements and returns if they are identical or not
public static IsDifferent ( AutomationElement ele1, AutomationElement ele2 ) : bool
ele1 System.Windows.Automation.AutomationElement first element
ele2 System.Windows.Automation.AutomationElement second element
Результат bool

Pause() публичный статический метод

Pauses the activity monitoring. No events will be raised when paused
public static Pause ( ) : void
Результат void

Resume() публичный статический метод

Resumes window activity monitoring.
public static Resume ( ) : void
Результат void

Start() публичный статический метод

Starts activity monitoring
public static Start ( ) : bool
Результат bool