'************************************************** ' FILE : ReferencedMacroNotFoundException.vb ' AUTHOR : Paulo Santos ' CREATION : 9/29/2007 11:40:10 PM ' COPYRIGHT : Copyright © 2007 ' PJ on Development ' All Rights Reserved. ' ' Description: ' Represents an error when a macro reference ' an unknown macro. ' ' Change log: ' 0.1 9/29/2007 11:40:10 PM ' Paulo Santos ' Created. '*************************************************** Imports System.Globalization Imports System.Runtime.Serialization Imports System.Security.Permissions ''' ''' Represents an error when a referenced macro is not found in the collection. ''' _ Public Class ReferencedMacroNotFoundException Inherits Exception Private __ReferencedMacroName As String #Region " Constructors " ''' ''' Initializes an instance of the class. ''' This is the default constructor for this class. ''' Public Sub New() End Sub ''' ''' Initializes an instance of the class. ''' ''' The name of the macro not found. Public Sub New(ByVal referencedMacroName As String) Me.New(String.Format(CultureInfo.InvariantCulture, My.Resources.ReferencedMacroNotFoundException_Message, referencedMacroName), referencedMacroName) End Sub ''' ''' Initializes an instance of the class. ''' ''' The message that describes the error. ''' The name of the macro not found. Public Sub New(ByVal message As String, ByVal referencedMacroName As String) MyBase.New(message) __ReferencedMacroName = referencedMacroName End Sub ''' ''' Initializes an instance of the class. ''' ''' The message that describes the error. ''' The exception that is the cause of the current exception, or a if no inner exception is specified. Public Sub New(ByVal message As String, ByVal innerException As Exception) MyBase.New(message, innerException) End Sub ''' ''' Initializes an instance of the class. ''' ''' The message that describes the error. ''' The name of the macro not found. ''' The exception that is the cause of the current exception, or a if no inner exception is specified. Public Sub New(ByVal message As String, ByVal referencedMacroName As String, ByVal innerException As Exception) Me.New(message, innerException) __ReferencedMacroName = referencedMacroName End Sub ''' Initializes a new instance of the class with serialized data. ''' 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). Protected Sub New(ByVal info As SerializationInfo, ByVal context As StreamingContext) MyBase.New(info, context) __ReferencedMacroName = info.GetString("__ReferencedMacroName") End Sub #End Region #Region " Public Properties " ''' ''' Gets the name of the referenced macro not found in the collection. ''' ''' The name of the referenced macro not found in the collection. Public ReadOnly Property ReferencedMacroName() As String Get Return __ReferencedMacroName End Get End Property #End Region ''' When overridden in a derived class, sets the with information about the exception. ''' 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 a null reference (Nothing in Visual Basic). ''' 2 ''' ''' ''' ''' _ Public Overrides Sub GetObjectData(ByVal info As System.Runtime.Serialization.SerializationInfo, ByVal context As System.Runtime.Serialization.StreamingContext) MyBase.GetObjectData(info, context) info.AddValue("__ReferencedMacroName", __ReferencedMacroName, GetType(String)) End Sub End Class