mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2025-12-26 23:50:09 +01:00
* 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.
37 lines
846 B
C#
37 lines
846 B
C#
namespace DBus
|
|
{
|
|
|
|
using System;
|
|
|
|
public delegate void ServiceEventHandler (string serviceName,
|
|
string oldOwner,
|
|
string newOwner);
|
|
|
|
[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 ServiceOwnerChanged;
|
|
|
|
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;
|
|
}
|
|
}
|
|
}
|