dbus/mono/DBusType Array.cs, 1.1, 1.2 Boolean.cs, 1.1, 1.2 Byte.cs,
1.1, 1.2 Custom.cs, 1.1, 1.2 Dict.cs, 1.1, 1.2 Double.cs, 1.1,
1.2 Int32.cs, 1.1, 1.2 Int64.cs, 1.1, 1.2 Nil.cs, 1.1,
1.2 ObjectPath.cs, 1.2, 1.3 String.cs, 1.1, 1.2 UInt32.cs, 1.1,
1.2 UInt64.cs, 1.1, 1.2
Owen Fraser-Green
ow3n at pdx.freedesktop.org
Wed Mar 24 05:15:22 PST 2004
Update of /cvs/dbus/dbus/mono/DBusType
In directory pdx:/tmp/cvs-serv1352/DBusType
Modified Files:
Array.cs Boolean.cs Byte.cs Custom.cs Dict.cs Double.cs
Int32.cs Int64.cs Nil.cs ObjectPath.cs String.cs UInt32.cs
UInt64.cs
Log Message:
Made all DBusTypes take Service in the constructor because Array also needed it in the case of an array of OBJECT_PATH objects.
Index: Array.cs
===================================================================
RCS file: /cvs/dbus/dbus/mono/DBusType/Array.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- a/Array.cs 23 Mar 2004 12:10:32 -0000 1.1
+++ b/Array.cs 24 Mar 2004 13:15:20 -0000 1.2
@@ -16,19 +16,23 @@
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 @@
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 @@
}
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);
}
Index: Boolean.cs
===================================================================
RCS file: /cvs/dbus/dbus/mono/DBusType/Boolean.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- a/Boolean.cs 23 Mar 2004 12:10:32 -0000 1.1
+++ b/Boolean.cs 24 Mar 2004 13:15:20 -0000 1.2
@@ -18,12 +18,12 @@
{
}
- public Boolean(System.Boolean val)
+ public Boolean(System.Boolean val, Service service)
{
this.val = val;
}
- public Boolean(IntPtr iter)
+ public Boolean(IntPtr iter, Service service)
{
this.val = dbus_message_iter_get_boolean(iter);
}
Index: Byte.cs
===================================================================
RCS file: /cvs/dbus/dbus/mono/DBusType/Byte.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- a/Byte.cs 23 Mar 2004 12:10:32 -0000 1.1
+++ b/Byte.cs 24 Mar 2004 13:15:20 -0000 1.2
@@ -18,12 +18,12 @@
{
}
- public Byte(System.Byte val)
+ public Byte(System.Byte val, Service service)
{
this.val = val;
}
- public Byte(IntPtr iter)
+ public Byte(IntPtr iter, Service service)
{
this.val = dbus_message_iter_get_byte(iter);
}
Index: Custom.cs
===================================================================
RCS file: /cvs/dbus/dbus/mono/DBusType/Custom.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- a/Custom.cs 23 Mar 2004 12:10:32 -0000 1.1
+++ b/Custom.cs 24 Mar 2004 13:15:20 -0000 1.2
@@ -18,12 +18,12 @@
{
}
- public Custom(DBus.Custom val)
+ public Custom(DBus.Custom val, Service service)
{
this.val = val;
}
- public Custom(IntPtr iter)
+ public Custom(IntPtr iter, Service service)
{
string name;
IntPtr value;
Index: Dict.cs
===================================================================
RCS file: /cvs/dbus/dbus/mono/DBusType/Dict.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- a/Dict.cs 23 Mar 2004 12:10:32 -0000 1.1
+++ b/Dict.cs 24 Mar 2004 13:15:20 -0000 1.2
@@ -19,7 +19,7 @@
{
}
- public Dict(IDictionary val)
+ public Dict(IDictionary val, Service service)
{
this.val = new Hashtable();
foreach (DictionaryEntry entry in val) {
@@ -27,7 +27,7 @@
}
}
- public Dict(IntPtr iter)
+ public Dict(IntPtr iter, Service service)
{
IntPtr dictIter = Marshal.AllocCoTaskMem(Arguments.DBusMessageIterSize);
Index: Double.cs
===================================================================
RCS file: /cvs/dbus/dbus/mono/DBusType/Double.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- a/Double.cs 23 Mar 2004 12:10:32 -0000 1.1
+++ b/Double.cs 24 Mar 2004 13:15:20 -0000 1.2
@@ -18,12 +18,12 @@
{
}
- public Double(System.Double val)
+ public Double(System.Double val, Service service)
{
this.val = val;
}
- public Double(IntPtr iter)
+ public Double(IntPtr iter, Service service)
{
this.val = dbus_message_iter_get_double(iter);
}
Index: Int32.cs
===================================================================
RCS file: /cvs/dbus/dbus/mono/DBusType/Int32.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- a/Int32.cs 23 Mar 2004 12:10:32 -0000 1.1
+++ b/Int32.cs 24 Mar 2004 13:15:20 -0000 1.2
@@ -18,12 +18,12 @@
{
}
- public Int32(System.Int32 val)
+ public Int32(System.Int32 val, Service service)
{
this.val = val;
}
- public Int32(IntPtr iter)
+ public Int32(IntPtr iter, Service service)
{
this.val = dbus_message_iter_get_int32(iter);
}
Index: Int64.cs
===================================================================
RCS file: /cvs/dbus/dbus/mono/DBusType/Int64.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- a/Int64.cs 23 Mar 2004 12:10:32 -0000 1.1
+++ b/Int64.cs 24 Mar 2004 13:15:20 -0000 1.2
@@ -18,12 +18,12 @@
{
}
- public Int64(System.Int64 val)
+ public Int64(System.Int64 val, Service service)
{
this.val = val;
}
- public Int64(IntPtr iter)
+ public Int64(IntPtr iter, Service service)
{
this.val = dbus_message_iter_get_int64(iter);
}
Index: Nil.cs
===================================================================
RCS file: /cvs/dbus/dbus/mono/DBusType/Nil.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- a/Nil.cs 23 Mar 2004 12:10:32 -0000 1.1
+++ b/Nil.cs 24 Mar 2004 13:15:20 -0000 1.2
@@ -17,11 +17,11 @@
{
}
- public Nil(object nil)
+ public Nil(object nil, Service service)
{
}
- public Nil(IntPtr iter)
+ public Nil(IntPtr iter, Service service)
{
}
Index: ObjectPath.cs
===================================================================
RCS file: /cvs/dbus/dbus/mono/DBusType/ObjectPath.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- a/ObjectPath.cs 24 Mar 2004 10:28:15 -0000 1.2
+++ b/ObjectPath.cs 24 Mar 2004 13:15:20 -0000 1.3
@@ -20,19 +20,16 @@
{
}
- public ObjectPath(object val)
+ public ObjectPath(object val, Service service)
{
this.val = val;
+ this.service = service;
}
- public ObjectPath(IntPtr iter)
+ public ObjectPath(IntPtr iter, Service service)
{
this.pathName = Marshal.PtrToStringAnsi(dbus_message_iter_get_object_path(iter));
- }
-
- public void SetService(Service service)
- {
this.service = service;
}
@@ -43,17 +40,13 @@
Handler handler = this.service.GetHandler(this.val);
this.pathName = handler.PathName;
}
-
+
return this.pathName;
}
}
public void Append(IntPtr iter)
{
- if (PathName == null) {
- throw new ApplicationException("Unable to append ObjectPath before calling SetService()");
- }
-
if (!dbus_message_iter_append_object_path(iter, Marshal.StringToHGlobalAnsi(PathName)))
throw new ApplicationException("Failed to append OBJECT_PATH argument:" + val);
}
@@ -90,10 +83,6 @@
public object Get(System.Type type)
{
- if (this.service == null) {
- throw new ApplicationException("Unable to get ObjectPath before calling SetService()");
- }
-
try {
return this.service.GetObject(type, PathName);
} catch(Exception ex) {
Index: String.cs
===================================================================
RCS file: /cvs/dbus/dbus/mono/DBusType/String.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- a/String.cs 23 Mar 2004 12:10:32 -0000 1.1
+++ b/String.cs 24 Mar 2004 13:15:20 -0000 1.2
@@ -18,12 +18,12 @@
{
}
- public String(string val)
+ public String(string val, Service service)
{
this.val = val;
}
- public String(IntPtr iter)
+ public String(IntPtr iter, Service service)
{
this.val = Marshal.PtrToStringAnsi(dbus_message_iter_get_string(iter));
}
Index: UInt32.cs
===================================================================
RCS file: /cvs/dbus/dbus/mono/DBusType/UInt32.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- a/UInt32.cs 23 Mar 2004 12:10:32 -0000 1.1
+++ b/UInt32.cs 24 Mar 2004 13:15:20 -0000 1.2
@@ -18,12 +18,12 @@
{
}
- public UInt32(System.UInt32 val)
+ public UInt32(System.UInt32 val, Service service)
{
this.val = val;
}
- public UInt32(IntPtr iter)
+ public UInt32(IntPtr iter, Service service)
{
this.val = dbus_message_iter_get_uint32(iter);
}
Index: UInt64.cs
===================================================================
RCS file: /cvs/dbus/dbus/mono/DBusType/UInt64.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- a/UInt64.cs 23 Mar 2004 12:10:32 -0000 1.1
+++ b/UInt64.cs 24 Mar 2004 13:15:20 -0000 1.2
@@ -18,12 +18,12 @@
{
}
- public UInt64(System.UInt64 val)
+ public UInt64(System.UInt64 val, Service service)
{
this.val = val;
}
- public UInt64(IntPtr iter)
+ public UInt64(IntPtr iter, Service service)
{
this.val = dbus_message_iter_get_uint64(iter);
}
More information about the dbus-commit
mailing list