C# Class PersonalAnalytics.TrackerManager

Show file Open project: sealuzh/PersonalAnalytics Class Usage Examples

Public Properties

Property Type Description
TaskbarIcon Hardcodet.Wpf.TaskbarNotification.TaskbarIcon

Public Methods

Method Description
Continue ( ) : void

continues all trackers (that are enabled)

GetInstance ( ) : TrackerManager

Singleton

GetTrackers ( ) : List
InitializeTaskBarIcon ( ) : void

Dreates a taskbar icon to modify its tooltip and create the context menu options

Pause ( ) : void

stops all trackers starts a reminder to remind the user to resume it

PrepareSettings ( ) : void

Initialize/Prepare Settings

Register ( ITracker t ) : void

Tracker registers its service to the TrackerManager

RegisterTrackers ( ) : List

Register trackers for the TrackerManager (i.e. monitoring tool) (add a new tracker here to make it being integrated into the monitoring tool and retrospection)

SetAppVersion ( string v ) : void

Sets the current published app version

Start ( ) : void

Initialize the TrackerManager (prepares the settings, starts every tracker, creates a connection to the database, etc.)

Stop ( bool stoppedManually = false ) : void

stops the TrackerManager (stops every tracker, saves entries, dismisses connection to the database, etc.)

Private Methods

Method Description
CheckForStudyDataSharedReminder ( object sender, EventArgs e ) : void

On the first workday of the week, remind the user ONCE to share the collected study data with us.

ManuallyStartUserSurvey ( ) : void

gets the current instance of the userefficiency tracker and manually starts the survey there todo: ugly, hardcoded

OpenDataExportDirectory ( ) : void

Opens the directory where all the data is saved

OpenRetrospection ( ) : void

Opens the UI specified for the current retrospection

OpenSettings ( ) : void

Opens the browser to modify the settings

PauseContinueTracker ( System item ) : void

depending on the variable _isPaused, the tracker is paused or continued

PerformDatabaseUpdatesIfNecessary ( ) : void

In case the current database version != the targeted database version, perform an incremental udpate to the database (for each tracker)

SaveCurrentTimeZone ( object sender, EventArgs e ) : void

Saves the current (updated) time zone to the database (temporary workaround)

SetContextMenuOptions ( ) : void

Manually add ContextMenuOptions

SetTaskbarIconTooltip ( string message ) : void

helper method to change the tooltip text

ShutdownApplication ( ) : void

Shutdown the application only if the state is saved, database disconnected, etc.

TrayBallonTipClicked ( object s, RoutedEventArgs e ) : void

Click on a TaskbarIcon Balloon to resume the tracker todo: as soon as there are other balloons shown, we need to be able to distinguish which one

UpdateApplicationIfNecessary ( object sender, EventArgs e ) : void

Called in a regular interval to try and update the tool. Asks the user for consent prior to installing the update. In case the installation was successful, the tool will restart. source: https://msdn.microsoft.com/en-us/library/ms404263.aspx

UpdateTooltipIcon ( object sender, EventArgs e ) : void

Updates the taskbar icon tooltip text based on the timer and

UploadTrackedData ( bool isManually = true ) : void

Starts the upload wizard

Method Details

Continue() public method

continues all trackers (that are enabled)
public Continue ( ) : void
return void

GetInstance() public static method

Singleton
public static GetInstance ( ) : TrackerManager
return TrackerManager

GetTrackers() public method

public GetTrackers ( ) : List
return List

InitializeTaskBarIcon() public method

Dreates a taskbar icon to modify its tooltip and create the context menu options
public InitializeTaskBarIcon ( ) : void
return void

Pause() public method

stops all trackers starts a reminder to remind the user to resume it
public Pause ( ) : void
return void

PrepareSettings() public method

Initialize/Prepare Settings
public PrepareSettings ( ) : void
return void

Register() public method

Tracker registers its service to the TrackerManager
public Register ( ITracker t ) : void
t ITracker
return void

RegisterTrackers() public method

Register trackers for the TrackerManager (i.e. monitoring tool) (add a new tracker here to make it being integrated into the monitoring tool and retrospection)
public RegisterTrackers ( ) : List
return List

SetAppVersion() public method

Sets the current published app version
public SetAppVersion ( string v ) : void
v string
return void

Start() public method

Initialize the TrackerManager (prepares the settings, starts every tracker, creates a connection to the database, etc.)
public Start ( ) : void
return void

Stop() public method

stops the TrackerManager (stops every tracker, saves entries, dismisses connection to the database, etc.)
public Stop ( bool stoppedManually = false ) : void
stoppedManually bool
return void

Property Details

TaskbarIcon public property

public TaskbarIcon,Hardcodet.Wpf.TaskbarNotification TaskbarIcon
return Hardcodet.Wpf.TaskbarNotification.TaskbarIcon