* qt/Makfile.am:
[platform/upstream/dbus.git] / mono / ErrorMessage.cs
1 namespace DBus
2 {
3   using System;
4   using System.Runtime.InteropServices;
5   using System.Diagnostics;
6   
7   public class ErrorMessage : Message
8   {    
9     public ErrorMessage() : base(MessageType.Error)
10     {  
11     }
12
13     internal ErrorMessage(IntPtr rawMessage, Service service) : base(rawMessage, service)
14     {
15     }
16
17     public ErrorMessage(Service service) : base(MessageType.Error, service) 
18     {
19     }
20
21     public new string Name
22     {
23       get {
24         if (this.name == null) {
25           this.name = Marshal.PtrToStringAnsi(dbus_message_get_error_name(RawMessage));
26         }
27         
28         return this.name;
29       }
30       
31       set {
32         if (value != this.name) {
33           dbus_message_set_error_name(RawMessage, value);
34           this.name = value;
35         }
36       }
37     }
38
39     [DllImport("dbus-1")]
40     private extern static bool dbus_message_set_error_name(IntPtr rawMessage, string name);
41
42     [DllImport("dbus-1")]
43     private extern static IntPtr dbus_message_get_error_name(IntPtr rawMessage);
44   }
45 }