using System;
namespace ZB.MOM.WW.LmxOpcUa.Host.Domain
{
///
/// Event args for connection state transitions. (MXA-002)
///
public class ConnectionStateChangedEventArgs : EventArgs
{
///
/// Initializes a new instance of the class.
///
/// The connection state being exited.
/// The connection state being entered.
/// Additional context about the transition, such as a connection fault or reconnect attempt.
public ConnectionStateChangedEventArgs(ConnectionState previous, ConnectionState current, string message = "")
{
PreviousState = previous;
CurrentState = current;
Message = message ?? "";
}
///
/// Gets the previous MXAccess connection state before the transition was raised.
///
public ConnectionState PreviousState { get; }
///
/// Gets the new MXAccess connection state that the bridge moved into.
///
public ConnectionState CurrentState { get; }
///
/// Gets an operator-facing message that explains why the connection state changed.
///
public string Message { get; }
}
}