summaryrefslogtreecommitdiffstats
path: root/contrib/csharp/bindings/TestStatePass.cs
blob: b4712a4a1e7bf8cf7fcfa920a98914801cfec86f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using System;
using System.Runtime.InteropServices;

namespace uscxml_test {
	using org.uscxml;
	
	class TestStatePass
	{
		[DllImport("kernel32.dll", CharSet = CharSet.Auto)]
		private static extern void SetDllDirectory(string lpPathName);

		[STAThread]
		static void Main(string[] args) {

			if (args.Length < 1) {
				System.Console.WriteLine("Expected SCXML filename and optional dllPath as arguments");
				Environment.Exit(-1);
			}

			try {
				if (args.Length > 1)
					SetDllDirectory(args[1]);
			} catch (System.EntryPointNotFoundException) {}

			Interpreter sc = Interpreter.fromURL(args[0]);
			while(sc.step() != InterpreterState.USCXML_FINISHED) {}
		}
	}
}