123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- #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
- {
- /// <summary>
- /// The wrong state of the connection to a device.
- /// </summary>
- public enum WrongDeviceConnectionState
- {
- #region Fields
- /// <summary>
- /// Device is not Disconnected.
- /// </summary>
- NotDisconnected,
- /// <summary>
- /// Device is not Connecting.
- /// </summary>
- NotConnecting,
- /// <summary>
- /// Device is not Connected.
- /// </summary>
- NotConnected,
- /// <summary>
- /// Device is not Disconnecting.
- /// </summary>
- NotDisconnecting
- #endregion
- }
- /// <summary>
- /// The ConnectableWrongStateException is thrown when trying to access an IConnectable-object that
- /// is is a wrong state.
- /// </summary>
- public class ConnectableWrongStateException : Exception
- {
- #region Fields
- WrongDeviceConnectionState wrongState;
- #endregion
- #region Construction
- /// <summary>
- /// Initializes a new instance of the class.
- /// </summary>
- public ConnectableWrongStateException(WrongDeviceConnectionState wrongState) { this.wrongState = wrongState; }
- /// <summary>
- /// Initializes a new instance of the class.
- /// </summary>
- public ConnectableWrongStateException(WrongDeviceConnectionState wrongState, string message) : base(message) { this.wrongState = wrongState; }
- /// <summary>
- /// Initializes a new instance of the class.
- /// </summary>
- public ConnectableWrongStateException(WrongDeviceConnectionState wrongState, string message, Exception inner) : base(message, inner) { this.wrongState = wrongState; }
- #endregion
- #region Properties
- /// <summary>
- /// The wrong state of the connection to a device.
- /// </summary>
- public WrongDeviceConnectionState WrongState
- {
- get { return wrongState; }
- }
- #endregion
- }
- }
|