C# Class WindowsActivityTracker.Daemon

This tracker stores all program switches (window switch) and changes of the window titles in the database (using Windows Hooks and its events).
Inheritance: Shared.BaseTrackerDisposable, ITracker
Exibir arquivo Open project: sealuzh/PersonalAnalytics

Public Methods

Method Description
CreateDatabaseTablesIfNotExist ( ) : void
Daemon ( ) : System
GetVisualizationsDay ( DateTimeOffset date ) : List
GetVisualizationsWeek ( DateTimeOffset date ) : List
IsEnabled ( ) : bool
Start ( ) : void
Stop ( ) : void
UpdateDatabaseTables ( int version ) : void
WinEventProc ( IntPtr hWinEventHook, uint eventType, IntPtr hwnd, int idObject, int idChild, uint dwEventThread, uint dwmsEventTime ) : void

Catch Window Switch Events

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Private Methods

Method Description
CheckIfIdleTime ( object sender, System.Timers.ElapsedEventArgs e ) : void

check every 10 seconds if the user has been idle for the past 120s

GetActiveWindowTitle ( IntPtr handle ) : string

Get the name of the currently active window

GetProcessName ( IntPtr handle ) : string

Get the name of the current process

StoreIdle ( ) : void
StoreProcess ( ) : void

Method Details

CreateDatabaseTablesIfNotExist() public method

public CreateDatabaseTablesIfNotExist ( ) : void
return void

Daemon() public method

public Daemon ( ) : System
return System

Dispose() protected method

protected Dispose ( bool disposing ) : void
disposing bool
return void

GetVisualizationsDay() public method

public GetVisualizationsDay ( DateTimeOffset date ) : List
date DateTimeOffset
return List

GetVisualizationsWeek() public method

public GetVisualizationsWeek ( DateTimeOffset date ) : List
date DateTimeOffset
return List

IsEnabled() public method

public IsEnabled ( ) : bool
return bool

Start() public method

public Start ( ) : void
return void

Stop() public method

public Stop ( ) : void
return void

UpdateDatabaseTables() public method

public UpdateDatabaseTables ( int version ) : void
version int
return void

WinEventProc() public method

Catch Window Switch Events
public WinEventProc ( IntPtr hWinEventHook, uint eventType, IntPtr hwnd, int idObject, int idChild, uint dwEventThread, uint dwmsEventTime ) : void
hWinEventHook System.IntPtr
eventType uint
hwnd System.IntPtr
idObject int
idChild int
dwEventThread uint
dwmsEventTime uint
return void