public static void Main() { Bus bus = Bus.Session; string bus_name = "mono.moonlight.tests"; ObjectPath path = new ObjectPath("/mono/moonlight/tests/logger"); if (!(bus.RequestName(bus_name, NameFlag.ReplaceExisting | NameFlag.AllowReplacement) == RequestNameReply.PrimaryOwner)) { Console.Error.WriteLine("Unable to request bus name."); return; } StandaloneServer ls = new StandaloneServer(); Console.WriteLine("UNIQUE NAME: {0}", bus.UniqueName); Bus.Session.Register(bus_name, path, ls); Console.WriteLine("name has owner: {0}", bus.NameHasOwner(bus_name)); Console.WriteLine("getting object: {0}", bus.GetObject <ITestLogger> (bus_name, path)); while (true) { bus.Iterate(); } }
public static void Main () { Bus bus = Bus.Session; string bus_name = "mono.moonlight.tests"; ObjectPath path = new ObjectPath ("/mono/moonlight/tests/logger"); if (!(bus.RequestName (bus_name, NameFlag.ReplaceExisting | NameFlag.AllowReplacement) == RequestNameReply.PrimaryOwner)) { Console.Error.WriteLine ("Unable to request bus name."); return; } StandaloneServer ls = new StandaloneServer (); Console.WriteLine ("UNIQUE NAME: {0}", bus.UniqueName); Bus.Session.Register (bus_name, path, ls); Console.WriteLine ("name has owner: {0}", bus.NameHasOwner (bus_name)); Console.WriteLine ("getting object: {0}", bus.GetObject <ITestLogger> (bus_name, path)); while (true) bus.Iterate (); }