summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Shaw <joe@novell.com>2004-10-27 22:35:02 +0000
committerJohn Palmieri <johnp@remedyz.boston.redhat.com>2006-06-28 08:15:39 -0400
commit6a8c3ac39418b5b9646e2e4135eb4282b7a7bbf0 (patch)
tree6f888c25df884db089ea5484b23eef148c1a09b4
parenteaf328cf1638ca600c5359170fd749bee2516a44 (diff)
2004-10-27 Joe Shaw <joeshaw@novell.com>
* mono/Arguments.cs (GetDBusTypeConstructor): type.UnderlyingSystemType will return "System.Byte" if you do it on "byte[]", which is not what we want. So check the type.IsArray property and use System.Array instead.
-rw-r--r--mono/Arguments.cs9
1 files changed, 8 insertions, 1 deletions
diff --git a/mono/Arguments.cs b/mono/Arguments.cs
index ca178ae..d78fbff 100644
--- a/mono/Arguments.cs
+++ b/mono/Arguments.cs
@@ -161,7 +161,14 @@ 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, typeof(Service)});
+ Type constructorType;
+
+ if (type.IsArray)
+ constructorType = typeof (System.Array);
+ else
+ constructorType = type.UnderlyingSystemType;
+
+ ConstructorInfo constructor = dbusType.GetConstructor(new Type[] {constructorType, typeof(Service)});
if (constructor == null)
throw new ArgumentException("There is no valid constructor for '" + dbusType + "' from type '" + type + "'");