swig/SWIG/Doc/Manual/CSharp.html
William S Fulton 337f9292b2 minor update
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5226 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-11-01 00:50:52 +00:00

91 lines
2.9 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>SWIG and C#</title>
</head>
<body bgcolor="#FFFFFF">
<a name="n1"></a><H1>15 SWIG and C#</H1>
<!-- INDEX -->
<ul>
</ul>
<!-- INDEX -->
The C# module has only recently been added to SWIG and is still in a state of development.
The C# module is very similar to the Java module, so until some documentation has been written,
please use the <a href="Java.html">Java documentation</a> as a guide to using SWIG with C#.
<p>
The most noteable differences to Java are the following:
<ul>
<li>
When invoking SWIG use the <tt>-csharp</tt> command line option instead of <tt>-java</tt>.
</li>
<li>
Typemap equivalent names:
<blockquote><pre>
jni -> ctype
jtype -> imtype
jstype -> cstype
javain -> csin
javaout -> csout
javainterfaces -> csinterfaces
javabase -> csbase
javaclassmodifiers -> csclassmodifiers
javacode -> cscode
javaimports -> csimports
javaptrconstructormodifiers -> csptrconstructormodifiers
javagetcptr -> csgetcptr
javafinalize -> csfinalize
</pre></blockquote>
</li>
<li>
Feature equivalent names:
<blockquote><pre>
javaconst -> csconst
javamethodmodifiers -> csmethodmodifiers
</pre></blockquote>
</li>
<li>
Pragma equivalent names:
<blockquote><pre>
pragma(java) -> pragma(csharp)
jniclassbase -> imclassbase
jniclassclassmodifiers -> imclassclassmodifiers
jniclasscode -> imclasscode
jniclassimports -> imclassimports
jniclassinterfaces -> imclassinterfaces
</pre></blockquote>
</li>
<li>
Special variable equivalent names:
<blockquote><pre>
$javaclassname -> $csclassname
$javainput -> $csinput
$jnicall -> $imcall
</pre></blockquote>
</li>
</ul>
An Additional special variable, $module, is replaced by the module name which is obtained from the
<tt>%module</tt> directive or<tt> -module</tt> command line option.
<p>
Director support (callbacks into C#) have not yet been implemented.
<p>
The directory Examples/csharp has a number of examples.
If your SWIG installation went well Unix users should be able to type <tt>make</tt> in each example directory,
then <tt>ilrun runme</tt> (pnet C# compiler) or <tt>mono runme</tt> (Mono C# compiler).
Windows users can also get the examples working but need a Cygwin or Mingw environment for automatic configuration of the example makefiles.
Any one of the three C# compilers (pnet, mono or Microsoft) can be detected from within a <a href="http://www.cygwin.com">Cygwin</a> or <a href=http://www.mingw.org>MinGW</a> environment.
Some project files will be added soon for use with the Microsoft .NET C# compiler.
</body>
</html>