using System;
using System.Runtime.Serialization;
namespace Chernobyl.Input.Controls
{
///
/// An exception that is thrown when the that you
/// attempting to perform an action on has been disconnected and can no
/// longer be used.
///
public class DisconnectedException : Exception
{
///
/// Initializes a new instance of the
/// class.
///
/// The that is disconnected.
/// The error message that explains the reason for
/// the exception.
public DisconnectedException(IControl control, string message)
: this(control, message, null)
{ }
///
/// Initializes a new instance of the class.
///
/// The that is disconnected.
/// The error message that explains the reason for
/// the exception.
/// The exception that is the cause of the
/// current exception, or a null reference (Nothing in Visual Basic) if
/// no inner exception is specified.
public DisconnectedException(IControl control, string message, Exception innerException)
: base(message, innerException)
{
Control = control;
}
///
/// Initializes a new instance of the class.
///
/// The that is disconnected.
/// The that holds
/// the serialized object data about the exception being thrown.
/// The that contains
/// contextual information about the source or destination.
/// The
/// parameter is null.
/// The class name is null or
/// is zero (0).
public DisconnectedException(IControl control, SerializationInfo info, StreamingContext context)
: base(info, context)
{
Control = control;
}
///
/// The that is disconnected.
///
public IControl Control { get; private set; }
}
}