dbus/mono Arguments.cs,1.6,1.7

Joe Shaw joe at freedesktop.org
Wed Oct 27 15:35:05 PDT 2004


Update of /cvs/dbus/dbus/mono
In directory gabe:/tmp/cvs-serv32237/mono

Modified Files:
	Arguments.cs 
Log Message:
2004-10-27  Joe Shaw  <joeshaw at 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.

Index: Arguments.cs
===================================================================
RCS file: /cvs/dbus/dbus/mono/Arguments.cs,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- Arguments.cs	29 Aug 2004 18:14:30 -0000	1.6
+++ Arguments.cs	27 Oct 2004 22:35:03 -0000	1.7
@@ -161,7 +161,14 @@
     // 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 + "'");
       



More information about the dbus-commit mailing list