From 4e5940e75375fb7f5c78da8711ff387293c01fc6 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Sat, 4 Nov 2006 00:21:28 +0000 Subject: [PATCH] InvalidCastException added for throwing from unmanaged code git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9524 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- SWIG/Lib/csharp/csharphead.swg | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/SWIG/Lib/csharp/csharphead.swg b/SWIG/Lib/csharp/csharphead.swg index 78ee70143..7938dee04 100644 --- a/SWIG/Lib/csharp/csharphead.swg +++ b/SWIG/Lib/csharp/csharphead.swg @@ -23,6 +23,7 @@ typedef enum { SWIG_CSharpArithmeticException, SWIG_CSharpDivideByZeroException, SWIG_CSharpIndexOutOfRangeException, + SWIG_CSharpInvalidCastException, SWIG_CSharpInvalidOperationException, SWIG_CSharpIOException, SWIG_CSharpNullReferenceException, @@ -55,6 +56,7 @@ static SWIG_CSharpException_t SWIG_csharp_exceptions[] = { { SWIG_CSharpArithmeticException, NULL }, { SWIG_CSharpDivideByZeroException, NULL }, { SWIG_CSharpIndexOutOfRangeException, NULL }, + { SWIG_CSharpInvalidCastException, NULL }, { SWIG_CSharpInvalidOperationException, NULL }, { SWIG_CSharpIOException, NULL }, { SWIG_CSharpNullReferenceException, NULL }, @@ -95,6 +97,7 @@ SWIGEXPORT void SWIGSTDCALL SWIGRegisterExceptionCallbacks_$module( SWIG_CSharpExceptionCallback_t arithmeticCallback, SWIG_CSharpExceptionCallback_t divideByZeroCallback, SWIG_CSharpExceptionCallback_t indexOutOfRangeCallback, + SWIG_CSharpExceptionCallback_t invalidCastCallback, SWIG_CSharpExceptionCallback_t invalidOperationCallback, SWIG_CSharpExceptionCallback_t ioCallback, SWIG_CSharpExceptionCallback_t nullReferenceCallback, @@ -105,6 +108,7 @@ SWIGEXPORT void SWIGSTDCALL SWIGRegisterExceptionCallbacks_$module( SWIG_csharp_exceptions[SWIG_CSharpArithmeticException].callback = arithmeticCallback; SWIG_csharp_exceptions[SWIG_CSharpDivideByZeroException].callback = divideByZeroCallback; SWIG_csharp_exceptions[SWIG_CSharpIndexOutOfRangeException].callback = indexOutOfRangeCallback; + SWIG_csharp_exceptions[SWIG_CSharpInvalidCastException].callback = invalidCastCallback; SWIG_csharp_exceptions[SWIG_CSharpInvalidOperationException].callback = invalidOperationCallback; SWIG_csharp_exceptions[SWIG_CSharpIOException].callback = ioCallback; SWIG_csharp_exceptions[SWIG_CSharpNullReferenceException].callback = nullReferenceCallback; @@ -136,6 +140,7 @@ SWIGEXPORT void SWIGSTDCALL SWIGRegisterExceptionArgumentCallbacks_$module( static ExceptionDelegate arithmeticDelegate = new ExceptionDelegate(SetPendingArithmeticException); static ExceptionDelegate divideByZeroDelegate = new ExceptionDelegate(SetPendingDivideByZeroException); static ExceptionDelegate indexOutOfRangeDelegate = new ExceptionDelegate(SetPendingIndexOutOfRangeException); + static ExceptionDelegate invalidCastDelegate = new ExceptionDelegate(SetPendingInvalidCastException); static ExceptionDelegate invalidOperationDelegate = new ExceptionDelegate(SetPendingInvalidOperationException); static ExceptionDelegate ioDelegate = new ExceptionDelegate(SetPendingIOException); static ExceptionDelegate nullReferenceDelegate = new ExceptionDelegate(SetPendingNullReferenceException); @@ -153,6 +158,7 @@ SWIGEXPORT void SWIGSTDCALL SWIGRegisterExceptionArgumentCallbacks_$module( ExceptionDelegate arithmeticDelegate, ExceptionDelegate divideByZeroDelegate, ExceptionDelegate indexOutOfRangeDelegate, + ExceptionDelegate invalidCastDelegate, ExceptionDelegate invalidOperationDelegate, ExceptionDelegate ioDelegate, ExceptionDelegate nullReferenceDelegate, @@ -178,6 +184,9 @@ SWIGEXPORT void SWIGSTDCALL SWIGRegisterExceptionArgumentCallbacks_$module( static void SetPendingIndexOutOfRangeException(string message) { SWIGPendingException.Set(new System.IndexOutOfRangeException(message, SWIGPendingException.Retrieve())); } + static void SetPendingInvalidCastException(string message) { + SWIGPendingException.Set(new System.InvalidCastException(message, SWIGPendingException.Retrieve())); + } static void SetPendingInvalidOperationException(string message) { SWIGPendingException.Set(new System.InvalidOperationException(message, SWIGPendingException.Retrieve())); } @@ -217,6 +226,7 @@ SWIGEXPORT void SWIGSTDCALL SWIGRegisterExceptionArgumentCallbacks_$module( arithmeticDelegate, divideByZeroDelegate, indexOutOfRangeDelegate, + invalidCastDelegate, invalidOperationDelegate, ioDelegate, nullReferenceDelegate,