summaryrefslogtreecommitdiffstats
path: root/mono/DBusType/ObjectPath.cs
diff options
context:
space:
mode:
authorOwen Fraser-Green <owen@discobabe.net>2004-03-24 13:15:20 +0000
committerOwen Fraser-Green <owen@discobabe.net>2004-03-24 13:15:20 +0000
commitf33453896716e69cacd0d065b7cc633258678946 (patch)
treeed10e70ef8b1cb259a5d58afa276ef1ba94af56c /mono/DBusType/ObjectPath.cs
parent93aa62035612121523adf1ba47c27dd22866cb25 (diff)
Made all DBusTypes take Service in the constructor because Array also needed it in the case of an array of OBJECT_PATH objects.
Diffstat (limited to 'mono/DBusType/ObjectPath.cs')
-rw-r--r--mono/DBusType/ObjectPath.cs19
1 files changed, 4 insertions, 15 deletions
diff --git a/mono/DBusType/ObjectPath.cs b/mono/DBusType/ObjectPath.cs
index 6e03e2d1..40460bbf 100644
--- a/mono/DBusType/ObjectPath.cs
+++ b/mono/DBusType/ObjectPath.cs
@@ -20,19 +20,16 @@ namespace DBus.DBusType
{
}
- public ObjectPath(object val)
+ public ObjectPath(object val, Service service)
{
this.val = val;
+ this.service = service;
}
- public ObjectPath(IntPtr iter)
+ public ObjectPath(IntPtr iter, Service service)
{
this.pathName = Marshal.PtrToStringAnsi(dbus_message_iter_get_object_path(iter));
- }
-
- public void SetService(Service service)
- {
this.service = service;
}
@@ -43,17 +40,13 @@ namespace DBus.DBusType
Handler handler = this.service.GetHandler(this.val);
this.pathName = handler.PathName;
}
-
+
return this.pathName;
}
}
public void Append(IntPtr iter)
{
- if (PathName == null) {
- throw new ApplicationException("Unable to append ObjectPath before calling SetService()");
- }
-
if (!dbus_message_iter_append_object_path(iter, Marshal.StringToHGlobalAnsi(PathName)))
throw new ApplicationException("Failed to append OBJECT_PATH argument:" + val);
}
@@ -90,10 +83,6 @@ namespace DBus.DBusType
public object Get(System.Type type)
{
- if (this.service == null) {
- throw new ApplicationException("Unable to get ObjectPath before calling SetService()");
- }
-
try {
return this.service.GetObject(type, PathName);
} catch(Exception ex) {