2 using System.Threading;
10 public static Service service = null;
11 public static Connection connection = null;
13 public static int Main(string [] args)
15 TestServer testServer = new TestServer();
16 Thread serverThread = new Thread(new ThreadStart(testServer.StartServer));
19 connection = Bus.GetSessionBus();
20 service = Service.Get(connection, "org.freedesktop.Test");
23 TestObject testObject = (TestObject) service.GetObject(typeof(TestObject), "/org/freedesktop/Test/TestObject");
25 Console.WriteLine ("Got object [{0}]", testObject);
27 System.Console.WriteLine(testObject.Test1("Hello"));
29 Console.WriteLine ("Got object [{0}]", testObject);
31 //RunTests(testObject);
36 public static void RunTests(TestObject testObject)
38 System.Console.WriteLine(testObject.Test1("Hello"));
42 public class TestServer
44 public Connection connection;
45 public Service service;
51 System.Console.WriteLine("Starting server...");
53 connection = Bus.GetSessionBus();
54 service = new Service(connection, "org.freedesktop.Test");
55 TestObject testObject = new TestObject();
56 service.RegisterObject(testObject, "/org/freedesktop/Test/TestObject");
58 System.Console.WriteLine("Foo!");
61 public void StartServer()
67 [Interface("org.freedesktop.Test.TestObject")]
68 public class TestObject
71 public virtual int Test1(string x)
73 System.Console.WriteLine("Called: " + x);