From 4a77a2dd972e817a08a4571220c8406709af8c48 Mon Sep 17 00:00:00 2001 From: Jon Trowbridge Date: Tue, 31 Aug 2004 03:59:14 +0000 Subject: 2004-08-30 Jon Trowbridge * mono/BusDriver.cs: Added. This is a class for interacting with the org.freedesktop.DBus service. * mono/Message.cs: Added a mechanism to expose the message that is currently being dispatched via the static Message.Current property. Added Message.Sender and Message.Destination properties. * mono/Handler.cs: Expose the dispatched message via Message.Current when handling method calls. * mono/Service.cs: Expose the dispatched message via Message.Current when handling signal emissions. * mono/Connection.cs: Bind dbus_bus_get_base_service via the Connection.BaseService property. --- mono/BusDriver.cs | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 mono/BusDriver.cs (limited to 'mono/BusDriver.cs') diff --git a/mono/BusDriver.cs b/mono/BusDriver.cs new file mode 100644 index 00000000..8b1fc680 --- /dev/null +++ b/mono/BusDriver.cs @@ -0,0 +1,39 @@ +namespace DBus +{ + + using System; + + public delegate void ServiceEventHandler (string serviceName); + + [Interface ("org.freedesktop.DBus")] + public abstract class BusDriver + { + [Method] + public abstract string[] ListServices (); + + [Method] + public abstract string GetServiceOwner (string serviceName); + + [Method] + public abstract UInt32 GetConnectionUnixUser (string connectionName); + + + [Signal] + public virtual event ServiceEventHandler ServiceCreated; + + [Signal] + public virtual event ServiceEventHandler ServiceDeleted; + + + static public BusDriver New (Connection connection) + { + Service service; + service = Service.Get (connection, "org.freedesktop.DBus"); + + BusDriver driver; + driver = (BusDriver) service.GetObject (typeof (BusDriver), "/org/freedesktop/DBus"); + + return driver; + } + } +} -- cgit