C# Class UserInputTracker.Daemon

Inheritance: Shared.BaseTrackerDisposable, ITracker
ファイルを表示 Open project: sealuzh/PersonalAnalytics

Public Methods

Method Description
CalculateMouseMovementDistance ( IEnumerable lastIntervalMouseMovements ) : double

Calculates the distance of the mouse movement in pixels. Could also be converted to centimeters or inches.

CreateDatabaseTablesIfNotExist ( ) : void
Daemon ( ) : System
GetVisualizationsDay ( DateTimeOffset date ) : List
IsEnabled ( ) : bool
Start ( ) : void
Stop ( ) : void
UpdateDatabaseTables ( int version ) : void

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Private Methods

Method Description
AddKeystrokesToAggregate ( UserInputAggregate aggregate, System.DateTime tsStart, System.DateTime tsEnd ) : void

For: Keystrokes Data Dequeues the respective buffer, adds it to a list (which prepares the data for saving) and updates the UserInputaggregate. Finally, it deletes the used items from the list.

AddMouseClicksToAggregate ( UserInputAggregate aggregate, System.DateTime tsStart, System.DateTime tsEnd ) : void

For: Mouse Clicks Data Dequeues the respective buffer, adds it to a list (which prepares the data for saving) and updates the UserInputaggregate. Finally, it deletes the used items from the list.

AddMouseMovementsToAggregate ( UserInputAggregate aggregate, System.DateTime tsStart, System.DateTime tsEnd ) : void

For: Mouse Movement Data Dequeues the respective buffer, adds it to a list (which prepares the data for saving) and updates the UserInputaggregate. Finally, it deletes the used items from the list.

AddMouseScrollsToAggregate ( UserInputAggregate aggregate, System.DateTime tsStart, System.DateTime tsEnd ) : void

For: Mouse Scrolls Data Dequeues the respective buffer, adds it to a list (which prepares the data for saving) and updates the UserInputaggregate. Finally, it deletes the used items from the list.

KeyboardListener_KeyDown ( object sender, KeyEventArgs e ) : void

Keyboard Click event. Create a new event and add it to the buffer.

MouseListener_MouseClick ( object sender, MouseEventArgs e ) : void

Mouse Click event. Create a new event and add it to the buffer.

MouseListener_MouseMoveExt ( object sender, Gma.System.MouseKeyHook.MouseEventExtArgs e ) : void

Mouse Movement event. Save it to a temp list to only save it ever x seconds to the database (see Settings.MouseSnapshotInterval) to reduce the data load.

MouseListener_MouseScrolling ( object sender, MouseEventArgs e ) : void

Mouse scrolling event. Save it to a temp list to only save it ever x seconds to the database (see Settings.MouseSnapshotInterval) to reduce the data load.

SaveInputBufferToDatabase ( ) : void

dequeues the currently counted number of elements from the buffer and saves them to the database (it can happen that more elements are added to the end of the queue while this happens, those elements will be safed to the database in the next run of this method)

SaveToDatabaseTick ( object sender, EventArgs e ) : void

Saves the buffer to the database and clears it afterwards.

Method Details

CalculateMouseMovementDistance() public static method

Calculates the distance of the mouse movement in pixels. Could also be converted to centimeters or inches.
public static CalculateMouseMovementDistance ( IEnumerable lastIntervalMouseMovements ) : double
lastIntervalMouseMovements IEnumerable
return double

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

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