using Opc.Ua; using System; using System.Runtime.Serialization; namespace Hylasoft.Opc.Common { /// /// Identifies an exception occurred during OPC Communication /// [Serializable] public class OpcException : Exception { /// /// Initialize a new instance of the OpcException class /// public OpcException() { } /// /// Initialize a new instance of the OpcException class /// public OpcException(string message) : base(message) { } /// /// Returns an (optional) associated OPC UA StatusCode for the exception. /// public StatusCode? Status { get; private set; } /// /// Initialize a new instance of the OpcException class /// public OpcException(string message, StatusCode status) : base(message) { Status = status; } /// /// Initialize a new instance of the OpcException class /// public OpcException(string message, Exception inner) : base(message, inner) { } /// /// Initialize a new instance of the OpcException class /// protected OpcException(SerializationInfo info, StreamingContext context) : base(info, context) { } /// /// Sets the System.Runtime.Serialization.SerializationInfo with information about the exception. /// /// The System.Runtime.Serialization.SerializationInfo that holds the serialized object data about the exception being thrown. /// The System.Runtime.Serialization.StreamingContext that contains contextual information about the source or destination. public override void GetObjectData(SerializationInfo info, StreamingContext context) { base.GetObjectData(info, context); } } }