Table of Contents

Class SessionListenerEventArgs

Namespace
PushTechnology.ClientInterface.Client.Session
Assembly
Diffusion.Client.dll

The StateChanged event argument.

public sealed class SessionListenerEventArgs : EventArgs
Inheritance
SessionListenerEventArgs
Inherited Members

Examples

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

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

Remarks

Added in 5.0.

Properties

NewState

Gets the current session state.

public SessionState NewState { get; }

Property Value

SessionState

The current session state.

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}." );
    } );

Remarks

Added in 5.0.

OldState

Gets the previous session state.

public SessionState OldState { get; }

Property Value

SessionState

The previous session state.

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}." );
    } );

Remarks

Added in 5.0.

Session

Gets the session instance.

public ISession Session { get; }

Property Value

ISession

The session instance.

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}." );
    } );

Remarks

Added in 5.0.