summaryrefslogtreecommitdiffstats
path: root/mono/Arguments.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/Arguments.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/Arguments.cs')
-rw-r--r--mono/Arguments.cs16
1 files changed, 5 insertions, 11 deletions
diff --git a/mono/Arguments.cs b/mono/Arguments.cs
index 0df205c3..d5407a5d 100644
--- a/mono/Arguments.cs
+++ b/mono/Arguments.cs
@@ -74,17 +74,15 @@ namespace DBus
// Append an argument
public void Append(DBusType.IDBusType dbusType)
{
- if (dbusType.GetType() == typeof(DBusType.ObjectPath)) {
- ((DBusType.ObjectPath) dbusType).SetService(message.Service);
- }
dbusType.Append(appenderIter);
}
// Append an argument of the specified type
private void AppendType(Type type, object val)
{
- object [] pars = new Object[1];
+ object [] pars = new Object[2];
pars[0] = val;
+ pars[1] = message.Service;
DBusType.IDBusType dbusType = (DBusType.IDBusType) Activator.CreateInstance(MatchType(type), pars);
Append(dbusType);
}
@@ -163,7 +161,7 @@ namespace DBus
// Get the appropriate constructor for a D-BUS type
public static ConstructorInfo GetDBusTypeConstructor(Type dbusType, Type type)
{
- ConstructorInfo constructor = dbusType.GetConstructor(new Type[] {type.UnderlyingSystemType});
+ ConstructorInfo constructor = dbusType.GetConstructor(new Type[] {type.UnderlyingSystemType, typeof(Service)});
if (constructor == null)
throw new ArgumentException("There is no valid constructor for '" + dbusType + "' from type '" + type + "'");
@@ -254,17 +252,13 @@ namespace DBus
{
get
{
- object [] pars = new Object[1];
+ object [] pars = new Object[2];
pars[0] = iter;
+ pars[1] = arguments.message.Service;
Type type = (Type) DBusTypes[(char) dbus_message_iter_get_arg_type(iter)];
DBusType.IDBusType dbusType = (DBusType.IDBusType) Activator.CreateInstance(type, pars);
- // Special case for ObjectPath
- if (type == typeof(DBusType.ObjectPath)) {
- ((DBusType.ObjectPath) dbusType).SetService(arguments.message.Service);
- }
-
return dbusType;
}
}