summaryrefslogtreecommitdiffstats
path: root/mono/MethodCall.cs
diff options
context:
space:
mode:
authorOwen Fraser-Green <owen@discobabe.net>2004-03-23 12:10:32 +0000
committerOwen Fraser-Green <owen@discobabe.net>2004-03-23 12:10:32 +0000
commitc916037773d7d3d8d37ca2c5a8899b7b728e377d (patch)
tree21c37372ab9795583e724e8459578b7fe0be330b /mono/MethodCall.cs
parent2195cf0dbde2ae26b5a684c6d914c1711f44c28d (diff)
First checkin of the Mono bindings.
Diffstat (limited to 'mono/MethodCall.cs')
-rw-r--r--mono/MethodCall.cs80
1 files changed, 80 insertions, 0 deletions
diff --git a/mono/MethodCall.cs b/mono/MethodCall.cs
new file mode 100644
index 00000000..ab7a4a36
--- /dev/null
+++ b/mono/MethodCall.cs
@@ -0,0 +1,80 @@
+namespace DBus
+{
+ using System;
+ using System.Runtime.InteropServices;
+ using System.Diagnostics;
+
+ public class MethodCall : Message
+ {
+ public MethodCall() : base(MessageType.MethodCall)
+ {
+ }
+
+ internal MethodCall(IntPtr rawMessage, Service service) : base(rawMessage, service)
+ {
+ }
+
+ public MethodCall(Service service) : base(MessageType.MethodCall, service)
+ {
+ }
+
+ public MethodCall(Service service, string pathName, string interfaceName, string name)
+ {
+ this.service = service;
+
+ RawMessage = dbus_message_new_method_call(service.Name, pathName, interfaceName, name);
+
+ if (RawMessage == IntPtr.Zero) {
+ throw new OutOfMemoryException();
+ }
+
+ this.pathName = pathName;
+ this.interfaceName = interfaceName;
+ this.name = name;
+
+ dbus_message_unref(RawMessage);
+ }
+
+ public new string PathName
+ {
+ get
+ {
+ return base.PathName;
+ }
+
+ set
+ {
+ base.PathName = value;
+ }
+ }
+
+ public new string InterfaceName
+ {
+ get
+ {
+ return base.InterfaceName;
+ }
+
+ set
+ {
+ base.InterfaceName = value;
+ }
+ }
+
+ public new string Name
+ {
+ get
+ {
+ return base.Name;
+ }
+
+ set
+ {
+ base.Name = value;
+ }
+ }
+
+ [DllImport("dbus-1")]
+ private extern static IntPtr dbus_message_new_method_call(string serviceName, string pathName, string interfaceName, string name);
+ }
+}