dbus/mono/example BusListener.cs,1.1,1.2

Joe Shaw joe@freedesktop.org
Tue Jan 25 11:47:15 PST 2005


Update of /cvs/dbus/dbus/mono/example
In directory gabe:/tmp/cvs-serv1895/mono/example

Modified Files:
	BusListener.cs 
Log Message:
2005-01-25  Joe Shaw  <joeshaw@novell.com>

	* Land the mono binding changes to conform to the new APIs.

	* mono/Makefile.am: Remove Custom.cs, DBusType/Custom.cs,
	DBusType/Dict.cs, and DBusType/Nil.cs from the build.

	* mono/Arguments.cs (GetCodeAsString): Added.  Returns the dbus
	type code as a string.
	(InitAppending): Rename dbus_message_append_iter_init() to
	dbus_message_iter_init_append().

	* mono/BusDriver.cs: Rename ServiceEventHandler to
	NameOwnerChangedHandler.  Rename GetServiceOwner to GetOwner.
	Rename ServiceOwnerChanged to NameOwnerChanged.

	* mono/Connection.cs: Rename BaseService to UniqueName, and the
	underlying C call.

	* mono/Custom.cs: Removed.  The CUSTOM type has been removed.

	* mono/Service.cs: Rename Exists to HasOwner, internally rename
	dbus_bus_acquire_service() to dbus_bus_request_name().

	* mono/DBusType/Array.cs (ctor): Use Type.GetElementType() instead
	of Type.UnderlyingSystemType to get the correct element type for
	the array.
	(ctor): Update code for new APIs: use dbus_message_iter_recurse(),
	dbus_message_get_{element|arg}_type() instead of
	dbus_message_iter_init_array_iterator().
	(Append): Replace dbus_message_iter_append_array() with
	dbus_message_iter_open_container() and
	dbus_message_iter_close_container().

	* mono/DBusType/Custom.cs, mono/DBusType/Nil.cs: Removed.  These
	types have been removed.
	
	* mono/DBusType/*.cs: Replace calls of
	dbus_message_iter_get_[type]() to dbus_message_iter_get_basic(),
	but specify the type in the DllImport extern declaration.  Ditto
	for dbus_message_iter_append_[type]() ->
	dbus_message_iter_append_basic().

	* mono/example/BusListener.cs: Update for ServiceEventHandler ->
	NameOwnerChangedHandler.

Index: BusListener.cs
===================================================================
RCS file: /cvs/dbus/dbus/mono/example/BusListener.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- BusListener.cs	29 Sep 2004 01:46:45 -0000	1.1
+++ BusListener.cs	25 Jan 2005 19:47:13 -0000	1.2
@@ -7,19 +7,19 @@
 	public class BusListener
 	{
 
-		static void OnServiceOwnerChanged (string serviceName,
-						   string oldOwner,
-						   string newOwner)
+		static void OnNameOwnerChanged (string name,
+						string oldOwner,
+						string newOwner)
 		{
 			if (oldOwner == "")
 				Console.WriteLine ("{0} created by {1}",
-						   serviceName, newOwner);
+						   name, newOwner);
 			else if (newOwner == "")
 				Console.WriteLine ("{0} released by {1}", 
-						   serviceName, oldOwner);
+						   name, oldOwner);
 			else
 				Console.WriteLine ("{0} transfered from {1} to {2}",
-						   serviceName, oldOwner, newOwner);
+						   name, oldOwner, newOwner);
 		}
 
 		public static int Main (string [] args)
@@ -30,9 +30,9 @@
 			connection = Bus.GetSessionBus ();
 
 			BusDriver driver = BusDriver.New (connection);
-			driver.ServiceOwnerChanged += new ServiceEventHandler (OnServiceOwnerChanged);
+			driver.NameOwnerChanged += new NameOwnerChangedHandler (OnNameOwnerChanged);
 
-			Console.WriteLine ("Listening for service changes...");
+			Console.WriteLine ("Listening for name owner changes...");
 
 			Application.Run ();
 



More information about the dbus-commit mailing list