dbus/mono/example .cvsignore, 1.1, 1.2 BusListener.cs, NONE, 1.1 Makefile.am, 1.4, 1.5

Jon Trowbridge trow at freedesktop.org
Wed Sep 29 01:46:47 UTC 2004


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

Modified Files:
	.cvsignore Makefile.am 
Added Files:
	BusListener.cs 
Log Message:
2004-09-28  Jon Trowbridge  <trow at ximian.com>

	    * mono/BusDriver.cs: Changed BusDriver struct to remove
	    the ServiceCreated and ServiceDeleted events and replace them
	    with the new ServiceOwnerChanged event.

	    * mono/example/BusListener.cs: Added a new example program,
	    which listens for and reports any ServiceOwnerChanged events
	    on the bus driver.

	    * mono/example/Makefile.am (DESTDIR): Build changes for the
	    new BusListener.cs example.



Index: .cvsignore
===================================================================
RCS file: /cvs/dbus/dbus/mono/example/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- .cvsignore	29 Mar 2004 12:50:45 -0000	1.1
+++ .cvsignore	29 Sep 2004 01:46:45 -0000	1.2
@@ -1,3 +1,4 @@
 .deps
 Makefile.in
 Makefile
+*.exe

--- NEW FILE: BusListener.cs ---
namespace Foo
{
	using System;
	using DBus;
	using Gtk;

	public class BusListener
	{

		static void OnServiceOwnerChanged (string serviceName,
						   string oldOwner,
						   string newOwner)
		{
			if (oldOwner == "")
				Console.WriteLine ("{0} created by {1}",
						   serviceName, newOwner);
			else if (newOwner == "")
				Console.WriteLine ("{0} released by {1}", 
						   serviceName, oldOwner);
			else
				Console.WriteLine ("{0} transfered from {1} to {2}",
						   serviceName, oldOwner, newOwner);
		}

		public static int Main (string [] args)
		{
			Application.Init ();

			Connection connection;
			connection = Bus.GetSessionBus ();

			BusDriver driver = BusDriver.New (connection);
			driver.ServiceOwnerChanged += new ServiceEventHandler (OnServiceOwnerChanged);

			Console.WriteLine ("Listening for service changes...");

			Application.Run ();

			return 0;
		}
	}

	
}

Index: Makefile.am
===================================================================
RCS file: /cvs/dbus/dbus/mono/example/Makefile.am,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- Makefile.am	20 Sep 2004 11:24:38 -0000	1.4
+++ Makefile.am	29 Sep 2004 01:46:45 -0000	1.5
@@ -1,6 +1,6 @@
 DESTDIR=
 
-NOINST_EXES=echo-server.exe echo-client.exe
+NOINST_EXES=echo-server.exe echo-client.exe bus-listener.exe
 DISTCLEANFILES=$(NOINST_EXES)
 
 all: $(NOINST_EXES)
@@ -11,10 +11,14 @@
 echo-client.exe: EchoClient.cs Echoer.cs
 	$(CSC) --target exe -L .. -r:../dbus-sharp.dll -o echo-client.exe $(srcdir)/EchoClient.cs $(srcdir)/Echoer.cs
 
+bus-listener.exe: BusListener.cs
+	$(CSC) --target exe -L .. -r:../dbus-sharp.dll -pkg:gtk-sharp -o bus-listener.exe $(srcdir)/BusListener.cs
+
+
 clean:
 	rm -f $(NOINST_EXES)
 
 install: all
 
-EXTRA_DIST=EchoServer.cs EchoClient.cs Echoer.cs
+EXTRA_DIST=EchoServer.cs EchoClient.cs Echoer.cs BusListener.cs
 



More information about the dbus-commit mailing list