Thanks David,


I knew about the “partial class” trick but unfortunately in my project there are just too many stuff to enter manually like this..


This is such a frustrating limitation of the %typemap(cscode) !


I have so many great ideas with my project that all involve writing a macro that includes a %typemap(cscode) statement...


I give up...



From: David Piepgrass []
Sent: Friday, September 21, 2012 11:46 AM
To: Eric Cabot;
Subject: RE: How can I cumulate %typemap(cscode) !


Sorry, SWIG does not allow you to put more than one custom code block in a proxy class :(


The only way I know of to put any amount of code in the proxy class is to use


%typemap(csclassmodifiers) SWIGTYPE "public partial class"


and then make your own *.cs file that contains a partial class to manually add the stuff you want in the class.


From: Eric Cabot []
Sent: Thursday, September 20, 2012 2:02 PM
Subject: [Swig-user] How can I cumulate %typemap(cscode) !


I have two places in my .i files where I use %typemap(cscode) on the same class.



%typemap(cscode) MyClass %{

                // part #1...



%typemap(cscode) MyClass %{

                // part #2...



The problem is that they dont cumulate.  The last one wins !


I know the best would be to merge the two typemaps together but it’s impossible in my context.

(i.e.: the %typemap(cscode) is part of a macro that I call more than once on the same class !)


I tried to do this before the second one:

$typemap(cscode,MyClass) ;

%typemap(cscode) MyClass %{

                // part #2...



But not luck....


Is there a way to do it ?


Any help would be appreciated...