diff options
author | Joe Shaw <joe@novell.com> | 2005-01-11 19:59:06 +0000 |
---|---|---|
committer | John Palmieri <johnp@remedyz.boston.redhat.com> | 2006-06-28 08:15:39 -0400 |
commit | 43deb5cacc910933d1c6951e864fd024d082bd46 (patch) | |
tree | 60ca72fa797397901ae63144e9a2e0a48f126406 | |
parent | 0453ff1a4e36f0ec32bfd2dd20cb2c8e2d57ff11 (diff) |
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.
-rw-r--r-- | mono/DBusType/Array.cs | 3 | ||||
-rw-r--r-- | mono/DBusType/Dict.cs | 3 |
2 files changed, 5 insertions, 1 deletions
diff --git a/mono/DBusType/Array.cs b/mono/DBusType/Array.cs index bf41763..dd93a5c 100644 --- a/mono/DBusType/Array.cs +++ b/mono/DBusType/Array.cs @@ -106,6 +106,9 @@ namespace DBus.DBusType 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; diff --git a/mono/DBusType/Dict.cs b/mono/DBusType/Dict.cs index f5c76b4..660cac5 100644 --- a/mono/DBusType/Dict.cs +++ b/mono/DBusType/Dict.cs @@ -41,8 +41,9 @@ namespace DBus.DBusType // 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)); |