CSharpTest.Net
InterpreterException Class
Members  Example  See Also  Send Feedback Download Help File
CSharpTest.Net.Library Assembly > CSharpTest.Net.Commands Namespace : InterpreterException Class

Glossary Item Box

Base exception for assertions and errors encountered while processing commands

Syntax

Visual Basic (Declaration) 
<SerializableAttribute()>
Public Class InterpreterException 
   Inherits System.ApplicationException
C# 
[SerializableAttribute()]
public class InterpreterException : System.ApplicationException 

Example

Library/Library.Test/TestCmdInterpreter.cs

C#Copy Code
InterpreterException ex = null;
try { throw new InterpreterException("TEST"); }
catch (InterpreterException e) { ex = e; }

Assert.IsNotNull(ex);
BinaryFormatter bf = new BinaryFormatter();
            
using( MemoryStream ms = new MemoryStream() )
{
    bf.Serialize(ms, ex);

    ms.Position = 0;
    ex = (InterpreterException)bf.Deserialize(ms);
    Assert.AreEqual("TEST", ex.Message);
}
VB.NETCopy Code
Dim ex As InterpreterException = Nothing
Try
    Throw New InterpreterException("TEST")
Catch e As InterpreterException
    ex = e
End Try

Assert.IsNotNull(ex)
Dim bf As New BinaryFormatter()

Using ms As New MemoryStream()
    bf.Serialize(ms, ex)

    ms.Position = 0
    ex = DirectCast(bf.Deserialize(ms), InterpreterException)
    Assert.AreEqual("TEST", ex.Message)
End Using

Inheritance Hierarchy

System.Object
   System.Exception
      System.ApplicationException
         CSharpTest.Net.Commands.InterpreterException

Requirements

Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7

See Also

Generated with Document! X 2011 by Innovasys