#region --------------- Copyright Dresser Wayne Pignone -------------
/*
* $Log: /Wrk/WayneLibraries/Wrk/Common/ConnectableWrongStateException.cs $
*
* 2 07-05-18 14:41 Mattias.larsson
* Added comments.
*
* 1 07-05-03 10:48 Mattias.larsson
* Added ConnectableWrongStateException.
*/
#endregion
using System;
namespace Wayne.Lib
{
///
/// The wrong state of the connection to a device.
///
public enum WrongDeviceConnectionState
{
#region Fields
///
/// Device is not Disconnected.
///
NotDisconnected,
///
/// Device is not Connecting.
///
NotConnecting,
///
/// Device is not Connected.
///
NotConnected,
///
/// Device is not Disconnecting.
///
NotDisconnecting
#endregion
}
///
/// The ConnectableWrongStateException is thrown when trying to access an IConnectable-object that
/// is is a wrong state.
///
public class ConnectableWrongStateException : Exception
{
#region Fields
WrongDeviceConnectionState wrongState;
#endregion
#region Construction
///
/// Initializes a new instance of the class.
///
public ConnectableWrongStateException(WrongDeviceConnectionState wrongState) { this.wrongState = wrongState; }
///
/// Initializes a new instance of the class.
///
public ConnectableWrongStateException(WrongDeviceConnectionState wrongState, string message) : base(message) { this.wrongState = wrongState; }
///
/// Initializes a new instance of the class.
///
public ConnectableWrongStateException(WrongDeviceConnectionState wrongState, string message, Exception inner) : base(message, inner) { this.wrongState = wrongState; }
#endregion
#region Properties
///
/// The wrong state of the connection to a device.
///
public WrongDeviceConnectionState WrongState
{
get { return wrongState; }
}
#endregion
}
}