Class SessionListenerEventArgs

The StateChanged event argument.

Inheritance
System.Object
SessionListenerEventArgs
Namespace: PushTechnology.ClientInterface.Client.Session
Assembly: Diffusion.Client.dll
Syntax
public sealed class SessionListenerEventArgs : EventArgs
Remarks

Added in 5.0.

Examples

An instance of this class can be obtained by the StateChanged event.

var factory = Diffusion.Sessions.SessionStateChangedHandler(
    (sender, args) => {
        var listenerEventArgs = args;
    } );

Properties

NewState

Gets the current session state.

Declaration
public SessionState NewState { get; }
Property Value
Type Description
SessionState

The current session state.

Remarks

Added in 5.0.

Examples

Printing the session state and identifier to the terminal.

var factory = Diffusion.Sessions.SessionStateChangedHandler(
    (sender, args) => {
        var id = args.Session.SessionId;
        var previous = args.OldState;
        var current = args.NewState;

        Console.WriteLine( $"Session {id} changed state from {previous} to {current}." );
    } );

OldState

Gets the previous session state.

Declaration
public SessionState OldState { get; }
Property Value
Type Description
SessionState

The previous session state.

Remarks

Added in 5.0.

Examples

Printing the session state and identifier to the terminal.

var factory = Diffusion.Sessions.SessionStateChangedHandler(
    (sender, args) => {
        var id = args.Session.SessionId;
        var previous = args.OldState;
        var current = args.NewState;

        Console.WriteLine( $"Session {id} changed state from {previous} to {current}." );
    } );

Session

Gets the session instance.

Declaration
public ISession Session { get; }
Property Value
Type Description
ISession

The session instance.

Remarks

Added in 5.0.

Examples

Printing the session state and identifier to the terminal.

var factory = Diffusion.Sessions.SessionStateChangedHandler(
    (sender, args) => {
        var id = args.Session.SessionId;
        var previous = args.OldState;
        var current = args.NewState;

        Console.WriteLine( $"Session {id} changed state from {previous} to {current}." );
    } );
Back to top