Swi-cs-pl - A CSharp class library to connect .NET languages with SWI-Prolog
PlDomainException Constructor (info, context)
SwiPlCs interface ► SbsSW.SwiPlCs.Exceptions ► PlDomainException ► PlDomainException(SerializationInfo, StreamingContext)
This class is the base class to catch exceptions thrown by prolog in C#.
Declaration Syntax
C# | Visual Basic | Visual C++ | F# |
protected PlDomainException( SerializationInfo info, StreamingContext context )
Protected Sub New ( info As SerializationInfo, context As StreamingContext )
protected: PlDomainException( SerializationInfo^ info, StreamingContext context )
new : info : SerializationInfo * context : StreamingContext -> PlDomainException
Parameters
- info (SerializationInfo)
-
[Missing <param name="info"/> documentation for "M:SbsSW.SwiPlCs.Exceptions.PlDomainException.#ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)"]
- context (StreamingContext)
-
[Missing <param name="context"/> documentation for "M:SbsSW.SwiPlCs.Exceptions.PlDomainException.#ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)"]
Examples
Copy | |
---|---|
public void prolog_exception_sample() { const string exceptionText = "test_exception"; Assert.IsTrue(PlQuery.PlCall("assert( (test_throw :- throw(" + exceptionText + ")) )")); try { Assert.IsTrue(PlQuery.PlCall("test_throw")); } catch (PlException ex) { Assert.AreEqual(exceptionText, ex.Term.ToString()); Assert.AreEqual("Unknown message: " + exceptionText, ex.Message); } } |
Assembly: SwiPlCs (Module: SwiPlCs.dll) Version: 1.1.60605.0 (1.1.60605.0)