C# Class DesktopAnalytics.Analytics

NB: if you don't dispose of this, your app might not really exit.
Inheritance: IDisposable
Mostra file Open project: hatton/DesktopAnalytics.net Class Usage Examples

Private Properties

Property Type Description
AttemptToGetUserIdSettingsFromDifferentChannel void
Client_Failed void
Client_Succeeded void
ExtractSetting string
GetLocationPropertiesOfThisMachine string>>.IEnumerable
GetOperatingSystemLabel string
GetUserConfigPath string
GetUserNameForEvent string
MakeSegmentIOProperties Properties
ReportIpAddressOfThisMachineAsync void
TrackWithApplicationProperties void
TryGetDefaultSettingsLocationInfo bool
TryGetSettingsLocationInfoFromEntryAssembly bool
UpdateSegmentIOInformationOnThisUser void
uname int

Public Methods

Method Description
Analytics ( string apiSecret, UserInfo userInfo, string>.Dictionary propertiesThatGoWithEveryEvent, bool allowTracking = true ) : System

Initialized a singleton; after calling this, use Analytics.Track() for each event.

Analytics ( string apiSecret, UserInfo userInfo, bool allowTracking = true ) : System
Dispose ( ) : void
IdentifyUpdate ( UserInfo userInfo ) : void

Use this after showing a registration dialog, so that this stuff is sent right away, rather than the next time you start up Analytics

ReportException ( Exception e ) : void

Sends the exception's message and stacktrace

ReportException ( Exception e, string>.Dictionary moreProperties ) : void

Sends the exception's message and stacktrace, plus additional information the program thinks may be relevant. Limited to MAX_EXCEPTION_REPORTS_PER_RUN

SetApplicationProperty ( string key, string value ) : void

Add a property that says something about the application, which goes out with every event.

Track ( string eventName ) : void

Record an event

Track ( string eventName, string>.Dictionary properties ) : void

Record an event with extra properties

Private Methods

Method Description
AttemptToGetUserIdSettingsFromDifferentChannel ( ) : void
Client_Failed ( BaseAction action, Exception e ) : void
Client_Succeeded ( BaseAction action ) : void
ExtractSetting ( string current, XDocument doc, string name ) : string
GetLocationPropertiesOfThisMachine ( ) : string>>.IEnumerable
GetOperatingSystemLabel ( ) : string
GetUserConfigPath ( ) : string
GetUserNameForEvent ( ) : string
MakeSegmentIOProperties ( string>.Dictionary properties ) : Properties
ReportIpAddressOfThisMachineAsync ( ) : void
TrackWithApplicationProperties ( string eventName, Properties properties = null ) : void

All calls to Segment.Analytics.Client.Track should run through here so we can provide defaults for every event

TryGetDefaultSettingsLocationInfo ( string &settingsLocation, string &softwareName ) : bool
TryGetSettingsLocationInfoFromEntryAssembly ( string &settingsLocation, string &softwareName ) : bool
UpdateSegmentIOInformationOnThisUser ( ) : void
uname ( IntPtr buf ) : int

Method Details

Analytics() public method

Initialized a singleton; after calling this, use Analytics.Track() for each event.
public Analytics ( string apiSecret, UserInfo userInfo, string>.Dictionary propertiesThatGoWithEveryEvent, bool allowTracking = true ) : System
apiSecret string The segment.com apiSecret
userInfo UserInfo Information about the user that you have previous collected
propertiesThatGoWithEveryEvent string>.Dictionary A set of key-value pairs to send with *every* event
allowTracking bool If false, this will not do any communication with segment.io
return System

Analytics() public method

public Analytics ( string apiSecret, UserInfo userInfo, bool allowTracking = true ) : System
apiSecret string
userInfo UserInfo
allowTracking bool
return System

Dispose() public method

public Dispose ( ) : void
return void

IdentifyUpdate() public static method

Use this after showing a registration dialog, so that this stuff is sent right away, rather than the next time you start up Analytics
public static IdentifyUpdate ( UserInfo userInfo ) : void
userInfo UserInfo
return void

ReportException() public static method

Sends the exception's message and stacktrace
public static ReportException ( Exception e ) : void
e System.Exception
return void

ReportException() public static method

Sends the exception's message and stacktrace, plus additional information the program thinks may be relevant. Limited to MAX_EXCEPTION_REPORTS_PER_RUN
public static ReportException ( Exception e, string>.Dictionary moreProperties ) : void
e System.Exception
moreProperties string>.Dictionary
return void

SetApplicationProperty() public static method

Add a property that says something about the application, which goes out with every event.
public static SetApplicationProperty ( string key, string value ) : void
key string
value string
return void

Track() public static method

Record an event
public static Track ( string eventName ) : void
eventName string
return void

Track() public static method

Record an event with extra properties
public static Track ( string eventName, string>.Dictionary properties ) : void
eventName string
properties string>.Dictionary
return void