From 9c151743a6daef5028c79a198f35b4248885b3c0 Mon Sep 17 00:00:00 2001 From: Joe Shaw Date: Wed, 27 Oct 2004 22:35:02 +0000 Subject: 2004-10-27 Joe Shaw * 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. --- mono/Arguments.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'mono') 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 + "'"); -- cgit v1.2.3