diff options
author | John (J5) Palmieri <johnp@redhat.com> | 2006-07-14 16:20:12 +0000 |
---|---|---|
committer | John (J5) Palmieri <johnp@redhat.com> | 2006-07-14 16:20:12 +0000 |
commit | a929c9a3b465db8b7e17b9b39936c612c2621a7c (patch) | |
tree | d1764257d1bd56f8e6a044516ccfc9bc44f7f9f5 /mono/Bus.cs | |
parent | 5efe8e7f1d97931710558495a951e0b35afbfb72 (diff) |
* Remove all bindings
Diffstat (limited to 'mono/Bus.cs')
-rw-r--r-- | mono/Bus.cs | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/mono/Bus.cs b/mono/Bus.cs deleted file mode 100644 index 05cf24c2..00000000 --- a/mono/Bus.cs +++ /dev/null @@ -1,54 +0,0 @@ -namespace DBus -{ - using System; - using System.Runtime.InteropServices; - using System.Diagnostics; - - public class Bus - { - // Keep in sync with C - private enum BusType - { - Session = 0, - System = 1, - Activation = 2 - } - - // Don't allow instantiation - private Bus () { } - - public static Connection GetSessionBus() - { - return GetBus(BusType.Session); - } - - public static Connection GetSystemBus() - { - return GetBus(BusType.System); - } - - private static Connection GetBus(BusType busType) - { - Error error = new Error(); - error.Init(); - - IntPtr rawConnection = dbus_bus_get((int) busType, ref error); - - if (rawConnection != IntPtr.Zero) { - Connection connection = Connection.Wrap(rawConnection); - connection.SetupWithMain(); - dbus_connection_unref(rawConnection); - - return connection; - } else { - throw new DBusException(error); - } - } - - [DllImport ("dbus-1")] - private extern static IntPtr dbus_bus_get (int which, ref Error error); - - [DllImport ("dbus-1")] - private extern static void dbus_connection_unref (IntPtr ptr); - } -} |