summaryrefslogtreecommitdiffstats
path: root/mono/MethodReturn.cs
blob: 1e7731df016b68d7b9ac5b37a5e9aef5fb80bd82 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
namespace DBus
{
  using System;
  using System.Runtime.InteropServices;
  using System.Diagnostics;
  
  public class MethodReturn : Message
  {
    private MethodReturn() : base(MessageType.MethodReturn)
    {
    }    

    internal MethodReturn(IntPtr rawMessage, Service service) : base(rawMessage, service)
    {
    }
    
    public MethodReturn(MethodCall methodCall)
    {
      this.service = methodCall.Service;
      
      RawMessage = dbus_message_new_method_return(methodCall.RawMessage);
      
      if (RawMessage == IntPtr.Zero) {
	throw new OutOfMemoryException();
      }
      
      dbus_message_unref(RawMessage);
    }
    
    public new string PathName
    {
      get
	{
	  return base.PathName;
	}
    }

    public new string InterfaceName
    {
      get
	{
	  return base.InterfaceName;
	}
    }

    public new string Name
    {
      get
	{
	  return base.Name;
	}
    }
    
    [DllImport("dbus-1")]
    private extern static IntPtr dbus_message_new_method_return(IntPtr rawMessage);
  }
}