diff options
author | Owen Fraser-Green <owen@discobabe.net> | 2004-03-24 13:15:20 +0000 |
---|---|---|
committer | Owen Fraser-Green <owen@discobabe.net> | 2004-03-24 13:15:20 +0000 |
commit | f33453896716e69cacd0d065b7cc633258678946 (patch) | |
tree | ed10e70ef8b1cb259a5d58afa276ef1ba94af56c /mono/DBusType/Array.cs | |
parent | 93aa62035612121523adf1ba47c27dd22866cb25 (diff) |
Made all DBusTypes take Service in the constructor because Array also needed it in the case of an array of OBJECT_PATH objects.
Diffstat (limited to 'mono/DBusType/Array.cs')
-rw-r--r-- | mono/DBusType/Array.cs | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/mono/DBusType/Array.cs b/mono/DBusType/Array.cs index 3bce3afa..34a842c7 100644 --- a/mono/DBusType/Array.cs +++ b/mono/DBusType/Array.cs @@ -16,19 +16,23 @@ namespace DBus.DBusType private System.Array val; private ArrayList elements; private Type elementType; + private Service service = null; private Array() { } - public Array(System.Array val) + public Array(System.Array val, Service service) { this.val = val; this.elementType = Arguments.MatchType(val.GetType().UnderlyingSystemType); + this.service = service; } - public Array(IntPtr iter) + public Array(IntPtr iter, Service service) { + this.service = service; + IntPtr arrayIter = Marshal.AllocCoTaskMem(Arguments.DBusMessageIterSize); int elementTypeCode; @@ -38,8 +42,9 @@ namespace DBus.DBusType elements = new ArrayList(); do { - object [] pars = new Object[1]; + object [] pars = new Object[2]; pars[0] = arrayIter; + pars[1] = service; DBusType.IDBusType dbusType = (DBusType.IDBusType) Activator.CreateInstance(elementType, pars); elements.Add(dbusType); } while (dbus_message_iter_next(arrayIter)); @@ -58,8 +63,9 @@ namespace DBus.DBusType } foreach (object element in this.val) { - object [] pars = new Object[1]; + object [] pars = new Object[2]; pars[0] = element; + pars[1] = this.service; DBusType.IDBusType dbusType = (DBusType.IDBusType) Activator.CreateInstance(elementType, pars); dbusType.Append(arrayIter); } |