dbus/mono/DBusType Array.cs,1.5,1.6 Dict.cs,1.5,1.6
Joe Shaw
joe@freedesktop.org
Tue Jan 11 11:59:08 PST 2005
Update of /cvs/dbus/dbus/mono/DBusType
In directory gabe:/tmp/cvs-serv18467/mono/DBusType
Modified Files:
Array.cs Dict.cs
Log Message:
2005-01-11 Joe Shaw <joeshaw@novell.com>
Patch from Tambet Ingo <tambet@ximian.com>
* mono/DBusType/Array.cs (Get): Get the underlying element type by
calling type.GetElementType(). The code previously depended on
broken Mono behavior, which was fixed in Mono 1.1.3.
* mono/DBusType/Dict.cs (constructor): Fix the parameters for
Activator.CreateInstance() so that the class's constructor is
called with the right parameters.
Index: Array.cs
===================================================================
RCS file: /cvs/dbus/dbus/mono/DBusType/Array.cs,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- Array.cs 29 Aug 2004 18:14:30 -0000 1.5
+++ Array.cs 11 Jan 2005 19:59:06 -0000 1.6
@@ -106,6 +106,9 @@
public object Get(System.Type type)
{
+ if (type.IsArray)
+ type = type.GetElementType ();
+
if (Arguments.Suits(elementType, type.UnderlyingSystemType)) {
this.val = System.Array.CreateInstance(type.UnderlyingSystemType, elements.Count);
int i = 0;
Index: Dict.cs
===================================================================
RCS file: /cvs/dbus/dbus/mono/DBusType/Dict.cs,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- Dict.cs 29 Aug 2004 18:14:30 -0000 1.5
+++ Dict.cs 11 Jan 2005 19:59:06 -0000 1.6
@@ -41,8 +41,9 @@
// Get the argument type and get the value
Type elementType = (Type) DBus.Arguments.DBusTypes[(char) dbus_message_iter_get_arg_type(dictIter)];
- object [] pars = new Object[1];
+ object [] pars = new Object[2];
pars[0] = dictIter;
+ pars[1] = service;
DBusType.IDBusType dbusType = (DBusType.IDBusType) Activator.CreateInstance(elementType, pars);
this.val.Add(key, dbusType);
} while (dbus_message_iter_next(dictIter));
More information about the dbus-commit
mailing list