C# Class CSharpAnalytics.Sessions.SessionManager

Manages visitors and sessions to ensure they are correctly saved, restored and time-out as appropriate.
Mostrar archivo Open project: TechSmith/CSharpAnalytics Class Usage Examples

Protected Properties

Property Type Description
lastActivityAt DateTimeOffset
newSessionLock object

Private Properties

Property Type Description
End void
Hit void
MoveToNextSessionStatus void
ShouldTrackThisNewVisitor bool

Public Methods

Method Description
GetState ( ) : SessionState

Capture details of the SessionManager into a SessionState that can be safely stored and restored.

SessionManager ( SessionState sessionState, double sampleRate = 100.0 ) : System

Recreate a SessionManager from state.

StartNewSession ( ) : void

Manually start a new session. Useful for scoping out session custom variables, e.g. if an anonymous user becomes known via sign-in.

Protected Methods

Method Description
StartNewSession ( DateTimeOffset startedAt ) : void

Start a new session.

Private Methods

Method Description
End ( ) : void

End the current session.

Hit ( ) : void

Record a hit to this session to ensure counts and timeouts are honoured.

MoveToNextSessionStatus ( ) : void

Move to the next session status, e.g. Ending to Starting, Starting to Active.

ShouldTrackThisNewVisitor ( double sampleRate ) : bool

Whether a new visitor should be tracked or not.

Method Details

GetState() public method

Capture details of the SessionManager into a SessionState that can be safely stored and restored.
public GetState ( ) : SessionState
return SessionState

SessionManager() public method

Recreate a SessionManager from state.
public SessionManager ( SessionState sessionState, double sampleRate = 100.0 ) : System
sessionState SessionState SessionState containing details captured from a previous SessionManager or null if no previous SessionManager.
sampleRate double Sample rate to determine likelyhood of a new installation being tracked or not.
return System

StartNewSession() public method

Manually start a new session. Useful for scoping out session custom variables, e.g. if an anonymous user becomes known via sign-in.
public StartNewSession ( ) : void
return void

StartNewSession() protected method

Start a new session.
protected StartNewSession ( DateTimeOffset startedAt ) : void
startedAt DateTimeOffset When this session started.
return void

Property Details

lastActivityAt protected_oe property

protected DateTimeOffset lastActivityAt
return DateTimeOffset

newSessionLock protected_oe property

protected object newSessionLock
return object