Commit 0c168e3e authored by Jon Trowbridge's avatar Jon Trowbridge

2004-09-28 Jon Trowbridge <trow@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.
parent 73a69d49
2004-09-28 Jon Trowbridge <trow@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.
2004-09-27 Olivier Andrieu <oliv__a@users.sourceforge.net>
* bus/signals.c (bus_match_rule_parse): validate the components of
......
......@@ -3,7 +3,9 @@ namespace DBus
using System;
public delegate void ServiceEventHandler (string serviceName);
public delegate void ServiceEventHandler (string serviceName,
string oldOwner,
string newOwner);
[Interface ("org.freedesktop.DBus")]
public abstract class BusDriver
......@@ -19,11 +21,7 @@ namespace DBus
[Signal]
public virtual event ServiceEventHandler ServiceCreated;
[Signal]
public virtual event ServiceEventHandler ServiceDeleted;
public virtual event ServiceEventHandler ServiceOwnerChanged;
static public BusDriver New (Connection connection)
{
......
.deps
Makefile.in
Makefile
*.exe
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;
}
}
}
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-server.exe: EchoServer.cs Echoer.cs
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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment