csharp examples
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@4433 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
73e647bc45
commit
511f4d42bf
12 changed files with 210 additions and 0 deletions
30
SWIG/Examples/csharp/enum/runme.cs
Normal file
30
SWIG/Examples/csharp/enum/runme.cs
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
public class runme
|
||||
{
|
||||
static void Main()
|
||||
{
|
||||
// Print out the value of some enums
|
||||
Console.WriteLine("*** color ***");
|
||||
Console.WriteLine(" RED = " + example.RED);
|
||||
Console.WriteLine(" BLUE = " + example.BLUE);
|
||||
Console.WriteLine(" GREEN = " + example.GREEN);
|
||||
|
||||
Console.WriteLine("\n*** Foo::speed ***");
|
||||
Console.WriteLine(" Foo::IMPULSE = " + Foo.IMPULSE);
|
||||
Console.WriteLine(" Foo::WARP = " + Foo.WARP);
|
||||
Console.WriteLine(" Foo::LUDICROUS = " + Foo.LUDICROUS);
|
||||
|
||||
Console.WriteLine("\nTesting use of enums with functions\n");
|
||||
|
||||
example.enum_test(example.RED, Foo.IMPULSE);
|
||||
example.enum_test(example.BLUE, Foo.WARP);
|
||||
example.enum_test(example.GREEN, Foo.LUDICROUS);
|
||||
example.enum_test(1234,5678);
|
||||
|
||||
Console.WriteLine( "\nTesting use of enum with class method" );
|
||||
Foo f = new Foo();
|
||||
|
||||
f.enum_test(Foo.IMPULSE);
|
||||
f.enum_test(Foo.WARP);
|
||||
f.enum_test(Foo.LUDICROUS);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue