00001 namespace DBus
00002 {
00003 using System;
00004 using System.Runtime.InteropServices;
00005 using System.Diagnostics;
00006
00007 public class MethodCall : Message
00008 {
00009 public MethodCall() : base(MessageType.MethodCall)
00010 {
00011 }
00012
00013 internal MethodCall(IntPtr rawMessage, Service service) : base(rawMessage, service)
00014 {
00015 }
00016
00017 public MethodCall(Service service) : base(MessageType.MethodCall, service)
00018 {
00019 }
00020
00021 public MethodCall(Service service, string pathName, string interfaceName, string name)
00022 {
00023 this.service = service;
00024
00025 RawMessage = dbus_message_new_method_call(service.Name, pathName, interfaceName, name);
00026
00027 if (RawMessage == IntPtr.Zero) {
00028 throw new OutOfMemoryException();
00029 }
00030
00031 this.pathName = pathName;
00032 this.interfaceName = interfaceName;
00033 this.name = name;
00034
00035 dbus_message_unref(RawMessage);
00036 }
00037
00038 public new string PathName
00039 {
00040 get
00041 {
00042 return base.PathName;
00043 }
00044
00045 set
00046 {
00047 base.PathName = value;
00048 }
00049 }
00050
00051 public new string InterfaceName
00052 {
00053 get
00054 {
00055 return base.InterfaceName;
00056 }
00057
00058 set
00059 {
00060 base.InterfaceName = value;
00061 }
00062 }
00063
00064 public new string Name
00065 {
00066 get
00067 {
00068 return base.Name;
00069 }
00070
00071 set
00072 {
00073 base.Name = value;
00074 }
00075 }
00076
00077 [DllImport("dbus-1")]
00078 private extern static IntPtr dbus_message_new_method_call(string serviceName, string pathName, string interfaceName, string name);
00079 }
00080 }