dbus/mono/DBusType Array.cs, 1.4, 1.5 Boolean.cs, 1.2, 1.3 Byte.cs, 1.4, 1.5 Custom.cs, 1.2, 1.3 Dict.cs, 1.4, 1.5 Double.cs, 1.2, 1.3 IDBusType.cs, 1.1, 1.2 Int32.cs, 1.3, 1.4 Int64.cs, 1.3, 1.4 Nil.cs, 1.2, 1.3 ObjectPath.cs, 1.4, 1.5 String.cs, 1.2, 1.3 UInt32.cs, 1.3, 1.4 UInt64.cs, 1.3, 1.4

Jon Trowbridge trow at freedesktop.org
Sun Aug 29 11:14:33 PDT 2004


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

Modified Files:
	Array.cs Boolean.cs Byte.cs Custom.cs Dict.cs Double.cs 
	IDBusType.cs Int32.cs Int64.cs Nil.cs ObjectPath.cs String.cs 
	UInt32.cs UInt64.cs 
Log Message:
Mapped CRLF -> LF for consistency.


Index: Array.cs
===================================================================
RCS file: /cvs/dbus/dbus/mono/DBusType/Array.cs,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- Array.cs	1 May 2004 19:59:58 -0000	1.4
+++ Array.cs	29 Aug 2004 18:14:30 -0000	1.5
@@ -1,138 +1,138 @@
-using System;
-using System.Collections;
-using System.Runtime.InteropServices;
-using System.Reflection.Emit;
-
-using DBus;
-
-namespace DBus.DBusType
-{
-  /// <summary>
-  /// Array.
-  /// </summary>
-  public class Array : IDBusType
-  {
-    public const char Code = 'a';
-    private System.Array val;
-    private ArrayList elements;
-    private Type elementType;
-    private Service service = null;
-    
-    private Array()
-    {
-    }
-    
-    public Array(System.Array val, Service service) 
-    {
-      this.val = val;
-      this.elementType = Arguments.MatchType(val.GetType().UnderlyingSystemType);
-      this.service = service;
-    }
-
-    public Array(IntPtr iter, Service service)
-    {
-      this.service = service;
-
-      IntPtr arrayIter = Marshal.AllocCoTaskMem(Arguments.DBusMessageIterSize);
-      
-      int elementTypeCode;
-      bool notEmpty = dbus_message_iter_init_array_iterator(iter, arrayIter, out elementTypeCode);
-      this.elementType = (Type) Arguments.DBusTypes[(char) elementTypeCode];
-
-      elements = new ArrayList();
-
-      if (notEmpty) {
-	do {
-	  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));
-      }
-      
-      Marshal.FreeCoTaskMem(arrayIter);
-    }
-    
-    public void Append(IntPtr iter)
-    {
-      IntPtr arrayIter = Marshal.AllocCoTaskMem(Arguments.DBusMessageIterSize);
-
-      if (!dbus_message_iter_append_array(iter,
-					  arrayIter,
-					  (int) Arguments.GetCode(this.elementType))) {
-	throw new ApplicationException("Failed to append INT32 argument:" + val);
-      }
-
-      foreach (object element in this.val) {
-	object [] pars = new Object[2];
-	pars[0] = element;
-	pars[1] = this.service;
-	DBusType.IDBusType dbusType = (DBusType.IDBusType) Activator.CreateInstance(elementType, pars);
-	dbusType.Append(arrayIter);
-      }
-
-      Marshal.FreeCoTaskMem(arrayIter);
-    }    
-
-    public static bool Suits(System.Type type) 
-    {
-      if (type.IsArray) {
-	return true;
-      }
-      
-      return false;
-    }
-
-    public static void EmitMarshalIn(ILGenerator generator, Type type)
-    {
-      if (type.IsByRef) {
-	generator.Emit(OpCodes.Ldind_Ref);
-      }
-    }
-
-    public static void EmitMarshalOut(ILGenerator generator, Type type, bool isReturn) 
-    {
-      generator.Emit(OpCodes.Castclass, type);
-      if (!isReturn) {
-	generator.Emit(OpCodes.Stind_Ref);
-      }
-    }
-    
-    public object Get() 
-    {
-      throw new ArgumentException("Cannot call Get on an Array without specifying type.");
-    }
-
-    public object Get(System.Type type)
-    {
-      if (Arguments.Suits(elementType, type.UnderlyingSystemType)) {
-	this.val = System.Array.CreateInstance(type.UnderlyingSystemType, elements.Count);
-	int i = 0;
-	foreach (DBusType.IDBusType element in elements) {
-	  this.val.SetValue(element.Get(type.UnderlyingSystemType), i++);
-	}	
-      } else {
-	throw new ArgumentException("Cannot cast DBus.Type.Array to type '" + type.ToString() + "'");
-      }
-	
-	return this.val;
-    }    
-
-    [DllImport("dbus-1")]
-    private extern static bool dbus_message_iter_init_array_iterator(IntPtr iter,
-								     IntPtr arrayIter,
-								     out int elementType);
- 
-    [DllImport("dbus-1")]
-    private extern static bool dbus_message_iter_append_array(IntPtr iter, 
-							      IntPtr arrayIter,
-							      int elementType);
-
-    [DllImport("dbus-1")]
-    private extern static bool dbus_message_iter_has_next(IntPtr iter);
-
-    [DllImport("dbus-1")]
-    private extern static bool dbus_message_iter_next(IntPtr iter);
-  }
-}
+using System;
+using System.Collections;
+using System.Runtime.InteropServices;
+using System.Reflection.Emit;
+
+using DBus;
+
+namespace DBus.DBusType
+{
+  /// <summary>
+  /// Array.
+  /// </summary>
+  public class Array : IDBusType
+  {
+    public const char Code = 'a';
+    private System.Array val;
+    private ArrayList elements;
+    private Type elementType;
+    private Service service = null;
+    
+    private Array()
+    {
+    }
+    
+    public Array(System.Array val, Service service) 
+    {
+      this.val = val;
+      this.elementType = Arguments.MatchType(val.GetType().UnderlyingSystemType);
+      this.service = service;
+    }
+
+    public Array(IntPtr iter, Service service)
+    {
+      this.service = service;
+
+      IntPtr arrayIter = Marshal.AllocCoTaskMem(Arguments.DBusMessageIterSize);
+      
+      int elementTypeCode;
+      bool notEmpty = dbus_message_iter_init_array_iterator(iter, arrayIter, out elementTypeCode);
+      this.elementType = (Type) Arguments.DBusTypes[(char) elementTypeCode];
+
+      elements = new ArrayList();
+
+      if (notEmpty) {
+	do {
+	  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));
+      }
+      
+      Marshal.FreeCoTaskMem(arrayIter);
+    }
+    
+    public void Append(IntPtr iter)
+    {
+      IntPtr arrayIter = Marshal.AllocCoTaskMem(Arguments.DBusMessageIterSize);
+
+      if (!dbus_message_iter_append_array(iter,
+					  arrayIter,
+					  (int) Arguments.GetCode(this.elementType))) {
+	throw new ApplicationException("Failed to append INT32 argument:" + val);
+      }
+
+      foreach (object element in this.val) {
+	object [] pars = new Object[2];
+	pars[0] = element;
+	pars[1] = this.service;
+	DBusType.IDBusType dbusType = (DBusType.IDBusType) Activator.CreateInstance(elementType, pars);
+	dbusType.Append(arrayIter);
+      }
+
+      Marshal.FreeCoTaskMem(arrayIter);
+    }    
+
+    public static bool Suits(System.Type type) 
+    {
+      if (type.IsArray) {
+	return true;
+      }
+      
+      return false;
+    }
+
+    public static void EmitMarshalIn(ILGenerator generator, Type type)
+    {
+      if (type.IsByRef) {
+	generator.Emit(OpCodes.Ldind_Ref);
+      }
+    }
+
+    public static void EmitMarshalOut(ILGenerator generator, Type type, bool isReturn) 
+    {
+      generator.Emit(OpCodes.Castclass, type);
+      if (!isReturn) {
+	generator.Emit(OpCodes.Stind_Ref);
+      }
+    }
+    
+    public object Get() 
+    {
+      throw new ArgumentException("Cannot call Get on an Array without specifying type.");
+    }
+
+    public object Get(System.Type type)
+    {
+      if (Arguments.Suits(elementType, type.UnderlyingSystemType)) {
+	this.val = System.Array.CreateInstance(type.UnderlyingSystemType, elements.Count);
+	int i = 0;
+	foreach (DBusType.IDBusType element in elements) {
+	  this.val.SetValue(element.Get(type.UnderlyingSystemType), i++);
+	}	
+      } else {
+	throw new ArgumentException("Cannot cast DBus.Type.Array to type '" + type.ToString() + "'");
+      }
+	
+	return this.val;
+    }    
+
+    [DllImport("dbus-1")]
+    private extern static bool dbus_message_iter_init_array_iterator(IntPtr iter,
+								     IntPtr arrayIter,
+								     out int elementType);
+ 
+    [DllImport("dbus-1")]
+    private extern static bool dbus_message_iter_append_array(IntPtr iter, 
+							      IntPtr arrayIter,
+							      int elementType);
+
+    [DllImport("dbus-1")]
+    private extern static bool dbus_message_iter_has_next(IntPtr iter);
+
+    [DllImport("dbus-1")]
+    private extern static bool dbus_message_iter_next(IntPtr iter);
+  }
+}

Index: Boolean.cs
===================================================================
RCS file: /cvs/dbus/dbus/mono/DBusType/Boolean.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- Boolean.cs	24 Mar 2004 13:15:20 -0000	1.2
+++ Boolean.cs	29 Aug 2004 18:14:30 -0000	1.3
@@ -1,86 +1,86 @@
-using System;
-using System.Runtime.InteropServices;
-using System.Reflection.Emit;
-
-using DBus;
-
-namespace DBus.DBusType
-{
-  /// <summary>
-  /// Boolean
-  /// </summary>
-  public class Boolean : IDBusType
-  {
-    public const char Code = 'b';
-    private System.Boolean val;
-    
-    private Boolean()
-    {
-    }
-    
-    public Boolean(System.Boolean val, Service service) 
-    {
-      this.val = val;
-    }
-
-    public Boolean(IntPtr iter, Service service)
-    {
-      this.val = dbus_message_iter_get_boolean(iter);
-    }
-    
-    public void Append(IntPtr iter)
-    {
-      if (!dbus_message_iter_append_boolean(iter, val))
-	throw new ApplicationException("Failed to append BOOLEAN argument:" + val);
-    }
-
-    public static bool Suits(System.Type type) 
-    {
-      switch (type.ToString()) {
-      case "System.Boolean":
-      case "System.Boolean&":
-	return true;
-      }
-      
-      return false;
-    }
-
-    public static void EmitMarshalIn(ILGenerator generator, Type type)
-    {
-      if (type.IsByRef) {
-	generator.Emit(OpCodes.Ldind_I1);
-      }
-    }
-
-    public static void EmitMarshalOut(ILGenerator generator, Type type, bool isReturn) 
-    {
-      generator.Emit(OpCodes.Unbox, type);
-      generator.Emit(OpCodes.Ldind_I1);
-      if (!isReturn) {
-	generator.Emit(OpCodes.Stind_I1);
-      }
-    }
-    
-    public object Get() 
-    {
-      return this.val;
-    }
-
-    public object Get(System.Type type)
-    {
-      switch (type.ToString()) {
-      case "System.Boolean":
-      case "System.Boolean&":
-	return this.val;
-      default:
-	throw new ArgumentException("Cannot cast DBus.Type.Boolean to type '" + type.ToString() + "'");
-      }
-    }
-
-    [DllImport("dbus-1")]
-    private extern static System.Boolean dbus_message_iter_get_boolean(IntPtr iter);
- 
-    [DllImport("dbus-1")]
-    private extern static bool dbus_message_iter_append_boolean(IntPtr iter, System.Boolean value);
-  }
-}
+using System;
+using System.Runtime.InteropServices;
+using System.Reflection.Emit;
+
+using DBus;
+
+namespace DBus.DBusType
+{
+  /// <summary>
+  /// Boolean
+  /// </summary>
+  public class Boolean : IDBusType
+  {
+    public const char Code = 'b';
+    private System.Boolean val;
+    
+    private Boolean()
+    {
+    }
+    
+    public Boolean(System.Boolean val, Service service) 
+    {
+      this.val = val;
+    }
+
+    public Boolean(IntPtr iter, Service service)
+    {
+      this.val = dbus_message_iter_get_boolean(iter);
+    }
+    
+    public void Append(IntPtr iter)
+    {
+      if (!dbus_message_iter_append_boolean(iter, val))
+	throw new ApplicationException("Failed to append BOOLEAN argument:" + val);
+    }
+
+    public static bool Suits(System.Type type) 
+    {
+      switch (type.ToString()) {
+      case "System.Boolean":
+      case "System.Boolean&":
+	return true;
+      }
+      
+      return false;
+    }
+
+    public static void EmitMarshalIn(ILGenerator generator, Type type)
+    {
+      if (type.IsByRef) {
+	generator.Emit(OpCodes.Ldind_I1);
+      }
+    }
+
+    public static void EmitMarshalOut(ILGenerator generator, Type type, bool isReturn) 
+    {
+      generator.Emit(OpCodes.Unbox, type);
+      generator.Emit(OpCodes.Ldind_I1);
+      if (!isReturn) {
+	generator.Emit(OpCodes.Stind_I1);
+      }
+    }
+    
+    public object Get() 
+    {
+      return this.val;
+    }
+
+    public object Get(System.Type type)
+    {
+      switch (type.ToString()) {
+      case "System.Boolean":
+      case "System.Boolean&":
+	return this.val;
+      default:
+	throw new ArgumentException("Cannot cast DBus.Type.Boolean to type '" + type.ToString() + "'");
+      }
+    }
+
+    [DllImport("dbus-1")]
+    private extern static System.Boolean dbus_message_iter_get_boolean(IntPtr iter);
+ 
+    [DllImport("dbus-1")]
+    private extern static bool dbus_message_iter_append_boolean(IntPtr iter, System.Boolean value);
+  }
+}

Index: Byte.cs
===================================================================
RCS file: /cvs/dbus/dbus/mono/DBusType/Byte.cs,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- Byte.cs	25 Mar 2004 14:04:43 -0000	1.4
+++ Byte.cs	29 Aug 2004 18:14:30 -0000	1.5
@@ -1,105 +1,105 @@
-using System;
-using System.Runtime.InteropServices;
-using System.Reflection.Emit;
-
-using DBus;
-
-namespace DBus.DBusType
-{
-  /// <summary>
-  /// Byte
-  /// </summary>
-  public class Byte : IDBusType
-  {
-    public const char Code = 'y';
-    private System.Byte val;
-    
-    private Byte()
-    {
-    }
-    
-    public Byte(System.Byte val, Service service) 
-    {
-      this.val = val;
-    }
-
-    public Byte(System.Char val, Service service) 
-    {
-      this.val = (byte) val;
-    }
-
-    public Byte(IntPtr iter, Service service)
-    {
-      this.val = dbus_message_iter_get_byte(iter);
-    }
-    
-    public void Append(IntPtr iter)
-    {
-      if (!dbus_message_iter_append_byte(iter, val))
-	throw new ApplicationException("Failed to append BYTE argument:" + val);
-    }
-
-    public static bool Suits(System.Type type) 
-    {
-      if (type.IsEnum && type.UnderlyingSystemType == typeof(System.Byte)) {
-	return true;
-      }
-
-      switch (type.ToString()) {
-      case "System.Byte":
-      case "System.Byte&":
-      case "System.Char":
-      case "System.Char&":
-	return true;
-      }
-      
-      return false;
-    }
-
-    public static void EmitMarshalIn(ILGenerator generator, Type type)
-    {
-      if (type.IsByRef) {
-	generator.Emit(OpCodes.Ldind_U1);
-      }
-    }
-
-    public static void EmitMarshalOut(ILGenerator generator, Type type, bool isReturn) 
-    {
-      generator.Emit(OpCodes.Unbox, type);
-      generator.Emit(OpCodes.Ldind_U1);
-      if (!isReturn) {
-	generator.Emit(OpCodes.Stind_I1);
-      }
-    }
-    
-    public object Get() 
-    {
-      return this.val;
-    }
-
-    public object Get(System.Type type)
-    {
-      if (type.IsEnum) {
-	return Enum.ToObject(type, this.val);
-      }
-
-      switch (type.ToString()) {
-      case "System.Byte":
-      case "System.Byte&":
-	return this.val;
-      case "System.Char":
-      case "System.Char&":
-	char charVal = (char) this.val;
-	return charVal;
-      default:
-	throw new ArgumentException("Cannot cast DBus.Type.Byte to type '" + type.ToString() + "'");
-      }
-    }
-
-    [DllImport("dbus-1")]
-    private extern static System.Byte dbus_message_iter_get_byte(IntPtr iter);
- 
-    [DllImport("dbus-1")]
-    private extern static bool dbus_message_iter_append_byte(IntPtr iter, System.Byte value);
-  }
-}
+using System;
+using System.Runtime.InteropServices;
+using System.Reflection.Emit;
+
+using DBus;
+
+namespace DBus.DBusType
+{
+  /// <summary>
+  /// Byte
+  /// </summary>
+  public class Byte : IDBusType
+  {
+    public const char Code = 'y';
+    private System.Byte val;
+    
+    private Byte()
+    {
+    }
+    
+    public Byte(System.Byte val, Service service) 
+    {
+      this.val = val;
+    }
+
+    public Byte(System.Char val, Service service) 
+    {
+      this.val = (byte) val;
+    }
+
+    public Byte(IntPtr iter, Service service)
+    {
+      this.val = dbus_message_iter_get_byte(iter);
+    }
+    
+    public void Append(IntPtr iter)
+    {
+      if (!dbus_message_iter_append_byte(iter, val))
+	throw new ApplicationException("Failed to append BYTE argument:" + val);
+    }
+
+    public static bool Suits(System.Type type) 
+    {
+      if (type.IsEnum && type.UnderlyingSystemType == typeof(System.Byte)) {
+	return true;
+      }
+
+      switch (type.ToString()) {
+      case "System.Byte":
+      case "System.Byte&":
+      case "System.Char":
+      case "System.Char&":
+	return true;
+      }
+      
+      return false;
+    }
+
+    public static void EmitMarshalIn(ILGenerator generator, Type type)
+    {
+      if (type.IsByRef) {
+	generator.Emit(OpCodes.Ldind_U1);
+      }
+    }
+
+    public static void EmitMarshalOut(ILGenerator generator, Type type, bool isReturn) 
+    {
+      generator.Emit(OpCodes.Unbox, type);
+      generator.Emit(OpCodes.Ldind_U1);
+      if (!isReturn) {
+	generator.Emit(OpCodes.Stind_I1);
+      }
+    }
+    
+    public object Get() 
+    {
+      return this.val;
+    }
+
+    public object Get(System.Type type)
+    {
+      if (type.IsEnum) {
+	return Enum.ToObject(type, this.val);
+      }
+
+      switch (type.ToString()) {
+      case "System.Byte":
+      case "System.Byte&":
+	return this.val;
+      case "System.Char":
+      case "System.Char&":
+	char charVal = (char) this.val;
+	return charVal;
+      default:
+	throw new ArgumentException("Cannot cast DBus.Type.Byte to type '" + type.ToString() + "'");
+      }
+    }
+
+    [DllImport("dbus-1")]
+    private extern static System.Byte dbus_message_iter_get_byte(IntPtr iter);
+ 
+    [DllImport("dbus-1")]
+    private extern static bool dbus_message_iter_append_byte(IntPtr iter, System.Byte value);
+  }
+}

Index: Custom.cs
===================================================================
RCS file: /cvs/dbus/dbus/mono/DBusType/Custom.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- Custom.cs	24 Mar 2004 13:15:20 -0000	1.2
+++ Custom.cs	29 Aug 2004 18:14:30 -0000	1.3
@@ -1,109 +1,109 @@
-using System;
-using System.Runtime.InteropServices;
-using System.Reflection.Emit;
-
-using DBus;
-
-namespace DBus.DBusType
-{
-  /// <summary>
-  /// A named byte array, used for custom types.
-  /// </summary>
-  public class Custom : IDBusType
-  {
-    public const char Code = 'c';
-    private DBus.Custom val;
-    
-    private Custom()
-    {
-    }
-    
-    public Custom(DBus.Custom val, Service service) 
-    {
-      this.val = val;
-    }
-
-    public Custom(IntPtr iter, Service service)
-    {
-      string name;
-      IntPtr value;
-      int len;
-
-      if (!dbus_message_iter_get_custom(iter, out name, out value, out len)) {
-	throw new ApplicationException("Failed to get CUSTOM argument.");
-      }
-
-      this.val.Name = name;
-      this.val.Data = new byte[len];
-      Marshal.Copy(value, this.val.Data, 0, len);
-    }
-    
-    public void Append(IntPtr iter)
-    {
-      IntPtr data = Marshal.AllocCoTaskMem(this.val.Data.Length);
-      try {
-	Marshal.Copy(this.val.Data, 0, data, this.val.Data.Length);
-	if (!dbus_message_iter_append_custom(iter, this.val.Name, data, this.val.Data.Length)) {
-	  throw new ApplicationException("Failed to append CUSTOM argument:" + val);
-	}
-      } finally {
-	Marshal.FreeCoTaskMem(data);
-      }
-    }
-
-    public static bool Suits(System.Type type) 
-    {
-      switch (type.ToString()) {
-      case "DBus.Custom":
-      case "DBus.Custom&":
-	return true;
-      }
-      
-      return false;
-    }
-
-    public static void EmitMarshalIn(ILGenerator generator, Type type)
-    {
-      if (type.IsByRef) {
-	generator.Emit(OpCodes.Ldobj, type);
-      }
-    }
-
-    public static void EmitMarshalOut(ILGenerator generator, Type type, bool isReturn) 
-    {
-      generator.Emit(OpCodes.Unbox, type);
-      generator.Emit(OpCodes.Ldobj, type);
-      if (!isReturn) {
-	generator.Emit(OpCodes.Stobj, type);
-      }
-    }
-    
-    public object Get() 
-    {
-      return this.val;
-    }
-
-    public object Get(System.Type type)
-    {
-      switch (type.ToString()) {
-      case "DBus.Custom":
-      case "DBus.Custom&":
-	return this.val;
-      default:
-	throw new ArgumentException("Cannot cast DBus.Type.Custom to type '" + type.ToString() + "'");
-      }
-    }
-
-    [DllImport("dbus-1")]
-    private extern static bool dbus_message_iter_get_custom(IntPtr iter,
-							    out string name,
-							    out IntPtr value,
-							    out int len);
- 
-    [DllImport("dbus-1")]
-    private extern static bool dbus_message_iter_append_custom(IntPtr iter, 
-							       string name,
-							       IntPtr data,
-							       int len);
-  }
-}
+using System;
+using System.Runtime.InteropServices;
+using System.Reflection.Emit;
+
+using DBus;
+
+namespace DBus.DBusType
+{
+  /// <summary>
+  /// A named byte array, used for custom types.
+  /// </summary>
+  public class Custom : IDBusType
+  {
+    public const char Code = 'c';
+    private DBus.Custom val;
+    
+    private Custom()
+    {
+    }
+    
+    public Custom(DBus.Custom val, Service service) 
+    {
+      this.val = val;
+    }
+
+    public Custom(IntPtr iter, Service service)
+    {
+      string name;
+      IntPtr value;
+      int len;
+
+      if (!dbus_message_iter_get_custom(iter, out name, out value, out len)) {
+	throw new ApplicationException("Failed to get CUSTOM argument.");
+      }
+
+      this.val.Name = name;
+      this.val.Data = new byte[len];
+      Marshal.Copy(value, this.val.Data, 0, len);
+    }
+    
+    public void Append(IntPtr iter)
+    {
+      IntPtr data = Marshal.AllocCoTaskMem(this.val.Data.Length);
+      try {
+	Marshal.Copy(this.val.Data, 0, data, this.val.Data.Length);
+	if (!dbus_message_iter_append_custom(iter, this.val.Name, data, this.val.Data.Length)) {
+	  throw new ApplicationException("Failed to append CUSTOM argument:" + val);
+	}
+      } finally {
+	Marshal.FreeCoTaskMem(data);
+      }
+    }
+
+    public static bool Suits(System.Type type) 
+    {
+      switch (type.ToString()) {
+      case "DBus.Custom":
+      case "DBus.Custom&":
+	return true;
+      }
+      
+      return false;
+    }
+
+    public static void EmitMarshalIn(ILGenerator generator, Type type)
+    {
+      if (type.IsByRef) {
+	generator.Emit(OpCodes.Ldobj, type);
+      }
+    }
+
+    public static void EmitMarshalOut(ILGenerator generator, Type type, bool isReturn) 
+    {
+      generator.Emit(OpCodes.Unbox, type);
+      generator.Emit(OpCodes.Ldobj, type);
+      if (!isReturn) {
+	generator.Emit(OpCodes.Stobj, type);
+      }
+    }
+    
+    public object Get() 
+    {
+      return this.val;
+    }
+
+    public object Get(System.Type type)
+    {
+      switch (type.ToString()) {
+      case "DBus.Custom":
+      case "DBus.Custom&":
+	return this.val;
+      default:
+	throw new ArgumentException("Cannot cast DBus.Type.Custom to type '" + type.ToString() + "'");
+      }
+    }
+
+    [DllImport("dbus-1")]
+    private extern static bool dbus_message_iter_get_custom(IntPtr iter,
+							    out string name,
+							    out IntPtr value,
+							    out int len);
+ 
+    [DllImport("dbus-1")]
+    private extern static bool dbus_message_iter_append_custom(IntPtr iter, 
+							       string name,
+							       IntPtr data,
+							       int len);
+  }
+}

Index: Dict.cs
===================================================================
RCS file: /cvs/dbus/dbus/mono/DBusType/Dict.cs,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- Dict.cs	1 May 2004 19:59:58 -0000	1.4
+++ Dict.cs	29 Aug 2004 18:14:30 -0000	1.5
@@ -1,147 +1,147 @@
-using System;
-using System.Collections;
-using System.Runtime.InteropServices;
-using System.Reflection.Emit;
-
-using DBus;
-
-namespace DBus.DBusType
-{
-  /// <summary>
-  /// Dict.
-  /// </summary>
-  public class Dict : IDBusType
-  {
-    public const char Code = 'm';
-    private Hashtable val;
-    
-    private Dict()
-    {
-    }
-    
-    public Dict(IDictionary val, Service service)
-    {
-      this.val = new Hashtable();
-      foreach (DictionaryEntry entry in val) {
-	this.val.Add(entry.Key, entry.Value);
-      }
-    }
-
-    public Dict(IntPtr iter, Service service)
-    {
-      IntPtr dictIter = Marshal.AllocCoTaskMem(Arguments.DBusMessageIterSize);
-      
-      bool notEmpty = dbus_message_iter_init_dict_iterator(iter, dictIter);
-
-      this.val = new Hashtable();
-
-      if (notEmpty) {
-	do {
-	  string key = dbus_message_iter_get_dict_key(dictIter);
-	  
-	  // 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];
-	  pars[0] = dictIter;
-	  DBusType.IDBusType dbusType = (DBusType.IDBusType) Activator.CreateInstance(elementType, pars);
-	  this.val.Add(key, dbusType);
-	} while (dbus_message_iter_next(dictIter));
-      }
-      
-      Marshal.FreeCoTaskMem(dictIter);
-    }
-    
-    public void Append(IntPtr iter)
-    {
-      IntPtr dictIter = Marshal.AllocCoTaskMem(Arguments.DBusMessageIterSize);
-
-      if (!dbus_message_iter_append_dict(iter,
-					 dictIter)) {
-	throw new ApplicationException("Failed to append DICT argument:" + val);
-      }
-
-      foreach (DictionaryEntry entry in this.val) {
-	if (!dbus_message_iter_append_dict_key(dictIter, (string) entry.Key)) {
-	  throw new ApplicationException("Failed to append DICT key:" + entry.Key);
-	}
-	
-	// Get the element type
-	Type elementType = Arguments.MatchType(entry.Value.GetType());
-	object [] pars = new Object[1];
-	pars[0] = entry.Value;
-	DBusType.IDBusType dbusType = (DBusType.IDBusType) Activator.CreateInstance(elementType, pars);
-	dbusType.Append(dictIter);
-      }
-
-      Marshal.FreeCoTaskMem(dictIter);
-    }    
-
-    public static bool Suits(System.Type type) 
-    {
-      if (typeof(IDictionary).IsAssignableFrom(type)) {
-	return true;
-      }
-            
-      return false;
-    }
-
-    public static void EmitMarshalIn(ILGenerator generator, Type type)
-    {
-      if (type.IsByRef) {
-	generator.Emit(OpCodes.Ldind_Ref);
-      }
-    }
-
-    public static void EmitMarshalOut(ILGenerator generator, Type type, bool isReturn) 
-    {
-      generator.Emit(OpCodes.Castclass, type);
-      if (!isReturn) {
-	generator.Emit(OpCodes.Stind_Ref);
-      }
-    }
-    
-    public object Get() 
-    {
-      return Get(typeof(Hashtable));
-    }
-
-    public object Get(System.Type type)
-    {
-      IDictionary retVal;
-
-      if (Suits(type)) {
-	retVal = (IDictionary) Activator.CreateInstance(type, new object[0]);
-	foreach (DictionaryEntry entry in this.val) {
-	  retVal.Add(entry.Key, ((IDBusType) entry.Value).Get());
-	}
-      } else {
-	throw new ArgumentException("Cannot cast DBus.Type.Dict to type '" + type.ToString() + "'");
-      }
-	
-      return retVal;
-    }    
-
-    [DllImport("dbus-1")]
-    private extern static bool dbus_message_iter_init_dict_iterator(IntPtr iter,
-								    IntPtr dictIter);
- 
-    [DllImport("dbus-1")]
-    private extern static bool dbus_message_iter_append_dict(IntPtr iter, 
-							     IntPtr dictIter);
-
-    [DllImport("dbus-1")]
-    private extern static bool dbus_message_iter_has_next(IntPtr iter);
-
-    [DllImport("dbus-1")]
-    private extern static bool dbus_message_iter_next(IntPtr iter);
-
-    [DllImport("dbus-1")]
-    private extern static string dbus_message_iter_get_dict_key (IntPtr dictIter);  
-
-    [DllImport("dbus-1")]
-    private extern static bool dbus_message_iter_append_dict_key (IntPtr dictIter,
-								  string value);
-    [DllImport("dbus-1")]
-    private extern static int dbus_message_iter_get_arg_type(IntPtr iter);
-  }
-}
+using System;
+using System.Collections;
+using System.Runtime.InteropServices;
+using System.Reflection.Emit;
+
+using DBus;
+
+namespace DBus.DBusType
+{
+  /// <summary>
+  /// Dict.
+  /// </summary>
+  public class Dict : IDBusType
+  {
+    public const char Code = 'm';
+    private Hashtable val;
+    
+    private Dict()
+    {
+    }
+    
+    public Dict(IDictionary val, Service service)
+    {
+      this.val = new Hashtable();
+      foreach (DictionaryEntry entry in val) {
+	this.val.Add(entry.Key, entry.Value);
+      }
+    }
+
+    public Dict(IntPtr iter, Service service)
+    {
+      IntPtr dictIter = Marshal.AllocCoTaskMem(Arguments.DBusMessageIterSize);
+      
+      bool notEmpty = dbus_message_iter_init_dict_iterator(iter, dictIter);
+
+      this.val = new Hashtable();
+
+      if (notEmpty) {
+	do {
+	  string key = dbus_message_iter_get_dict_key(dictIter);
+	  
+	  // 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];
+	  pars[0] = dictIter;
+	  DBusType.IDBusType dbusType = (DBusType.IDBusType) Activator.CreateInstance(elementType, pars);
+	  this.val.Add(key, dbusType);
+	} while (dbus_message_iter_next(dictIter));
+      }
+      
+      Marshal.FreeCoTaskMem(dictIter);
+    }
+    
+    public void Append(IntPtr iter)
+    {
+      IntPtr dictIter = Marshal.AllocCoTaskMem(Arguments.DBusMessageIterSize);
+
+      if (!dbus_message_iter_append_dict(iter,
+					 dictIter)) {
+	throw new ApplicationException("Failed to append DICT argument:" + val);
+      }
+
+      foreach (DictionaryEntry entry in this.val) {
+	if (!dbus_message_iter_append_dict_key(dictIter, (string) entry.Key)) {
+	  throw new ApplicationException("Failed to append DICT key:" + entry.Key);
+	}
+	
+	// Get the element type
+	Type elementType = Arguments.MatchType(entry.Value.GetType());
+	object [] pars = new Object[1];
+	pars[0] = entry.Value;
+	DBusType.IDBusType dbusType = (DBusType.IDBusType) Activator.CreateInstance(elementType, pars);
+	dbusType.Append(dictIter);
+      }
+
+      Marshal.FreeCoTaskMem(dictIter);
+    }    
+
+    public static bool Suits(System.Type type) 
+    {
+      if (typeof(IDictionary).IsAssignableFrom(type)) {
+	return true;
+      }
+            
+      return false;
+    }
+
+    public static void EmitMarshalIn(ILGenerator generator, Type type)
+    {
+      if (type.IsByRef) {
+	generator.Emit(OpCodes.Ldind_Ref);
+      }
+    }
+
+    public static void EmitMarshalOut(ILGenerator generator, Type type, bool isReturn) 
+    {
+      generator.Emit(OpCodes.Castclass, type);
+      if (!isReturn) {
+	generator.Emit(OpCodes.Stind_Ref);
+      }
+    }
+    
+    public object Get() 
+    {
+      return Get(typeof(Hashtable));
+    }
+
+    public object Get(System.Type type)
+    {
+      IDictionary retVal;
+
+      if (Suits(type)) {
+	retVal = (IDictionary) Activator.CreateInstance(type, new object[0]);
+	foreach (DictionaryEntry entry in this.val) {
+	  retVal.Add(entry.Key, ((IDBusType) entry.Value).Get());
+	}
+      } else {
+	throw new ArgumentException("Cannot cast DBus.Type.Dict to type '" + type.ToString() + "'");
+      }
+	
+      return retVal;
+    }    
+
+    [DllImport("dbus-1")]
+    private extern static bool dbus_message_iter_init_dict_iterator(IntPtr iter,
+								    IntPtr dictIter);
+ 
+    [DllImport("dbus-1")]
+    private extern static bool dbus_message_iter_append_dict(IntPtr iter, 
+							     IntPtr dictIter);
+
+    [DllImport("dbus-1")]
+    private extern static bool dbus_message_iter_has_next(IntPtr iter);
+
+    [DllImport("dbus-1")]
+    private extern static bool dbus_message_iter_next(IntPtr iter);
+
+    [DllImport("dbus-1")]
+    private extern static string dbus_message_iter_get_dict_key (IntPtr dictIter);  
+
+    [DllImport("dbus-1")]
+    private extern static bool dbus_message_iter_append_dict_key (IntPtr dictIter,
+								  string value);
+    [DllImport("dbus-1")]
+    private extern static int dbus_message_iter_get_arg_type(IntPtr iter);
+  }
+}

Index: Double.cs
===================================================================
RCS file: /cvs/dbus/dbus/mono/DBusType/Double.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- Double.cs	24 Mar 2004 13:15:20 -0000	1.2
+++ Double.cs	29 Aug 2004 18:14:30 -0000	1.3
@@ -1,86 +1,86 @@
-using System;
-using System.Runtime.InteropServices;
-using System.Reflection.Emit;
-
-using DBus;
-
-namespace DBus.DBusType
-{
-  /// <summary>
-  /// IEEE 754 double
-  /// </summary>
-  public class Double : IDBusType
-  {
-    public const char Code = 'd';
-    private System.Double val;
-    
-    private Double()
-    {
-    }
-    
-    public Double(System.Double val, Service service) 
-    {
-      this.val = val;
-    }
-
-    public Double(IntPtr iter, Service service)
-    {
-      this.val = dbus_message_iter_get_double(iter);
-    }
-    
-    public void Append(IntPtr iter)
-    {
-      if (!dbus_message_iter_append_double(iter, val))
-	throw new ApplicationException("Failed to append DOUBLE argument:" + val);
-    }
-
-    public static bool Suits(System.Type type) 
-    {
-      switch (type.ToString()) {
-      case "System.Double":
-      case "System.Double&":
-	return true;
-      }
-      
-      return false;
-    }
-
-    public static void EmitMarshalIn(ILGenerator generator, Type type)
-    {
-      if (type.IsByRef) {
-	generator.Emit(OpCodes.Ldind_R8);
-      }
-    }
-
-    public static void EmitMarshalOut(ILGenerator generator, Type type, bool isReturn) 
-    {
-      generator.Emit(OpCodes.Unbox, type);
-      generator.Emit(OpCodes.Ldind_R8);
-      if (!isReturn) {
-	generator.Emit(OpCodes.Stind_R8);
-      }
-    }
-    
-    public object Get() 
-    {
-      return this.val;
-    }
-
-    public object Get(System.Type type)
-    {
-      switch (type.ToString()) {
-      case "System.Double":
-      case "System.Double&":
-	return this.val;
-      default:
-	throw new ArgumentException("Cannot cast DBus.Type.Double to type '" + type.ToString() + "'");
-      }
-    }
-
-    [DllImport("dbus-1")]
-    private extern static System.Double dbus_message_iter_get_double(IntPtr iter);
- 
-    [DllImport("dbus-1")]
-    private extern static bool dbus_message_iter_append_double(IntPtr iter, System.Double value);
-  }
-}
+using System;
+using System.Runtime.InteropServices;
+using System.Reflection.Emit;
+
+using DBus;
+
+namespace DBus.DBusType
+{
+  /// <summary>
+  /// IEEE 754 double
+  /// </summary>
+  public class Double : IDBusType
+  {
+    public const char Code = 'd';
+    private System.Double val;
+    
+    private Double()
+    {
+    }
+    
+    public Double(System.Double val, Service service) 
+    {
+      this.val = val;
+    }
+
+    public Double(IntPtr iter, Service service)
+    {
+      this.val = dbus_message_iter_get_double(iter);
+    }
+    
+    public void Append(IntPtr iter)
+    {
+      if (!dbus_message_iter_append_double(iter, val))
+	throw new ApplicationException("Failed to append DOUBLE argument:" + val);
+    }
+
+    public static bool Suits(System.Type type) 
+    {
+      switch (type.ToString()) {
+      case "System.Double":
+      case "System.Double&":
+	return true;
+      }
+      
+      return false;
+    }
+
+    public static void EmitMarshalIn(ILGenerator generator, Type type)
+    {
+      if (type.IsByRef) {
+	generator.Emit(OpCodes.Ldind_R8);
+      }
+    }
+
+    public static void EmitMarshalOut(ILGenerator generator, Type type, bool isReturn) 
+    {
+      generator.Emit(OpCodes.Unbox, type);
+      generator.Emit(OpCodes.Ldind_R8);
+      if (!isReturn) {
+	generator.Emit(OpCodes.Stind_R8);
+      }
+    }
+    
+    public object Get() 
+    {
+      return this.val;
+    }
+
+    public object Get(System.Type type)
+    {
+      switch (type.ToString()) {
+      case "System.Double":
+      case "System.Double&":
+	return this.val;
+      default:
+	throw new ArgumentException("Cannot cast DBus.Type.Double to type '" + type.ToString() + "'");
+      }
+    }
+
+    [DllImport("dbus-1")]
+    private extern static System.Double dbus_message_iter_get_double(IntPtr iter);
+ 
+    [DllImport("dbus-1")]
+    private extern static bool dbus_message_iter_append_double(IntPtr iter, System.Double value);
+  }
+}

Index: IDBusType.cs
===================================================================
RCS file: /cvs/dbus/dbus/mono/DBusType/IDBusType.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- IDBusType.cs	23 Mar 2004 12:10:32 -0000	1.1
+++ IDBusType.cs	29 Aug 2004 18:14:30 -0000	1.2
@@ -1,16 +1,16 @@
-using System;
-
-namespace DBus.DBusType
-{
-  /// <summary>
-  /// Base class for DBusTypes
-  /// </summary>
-  public interface IDBusType
-  {
-    object Get();
-    
-    object Get(System.Type type);  
-
-    void Append(IntPtr iter);
-  }
-}
+using System;
+
+namespace DBus.DBusType
+{
+  /// <summary>
+  /// Base class for DBusTypes
+  /// </summary>
+  public interface IDBusType
+  {
+    object Get();
+    
+    object Get(System.Type type);  
+
+    void Append(IntPtr iter);
+  }
+}

Index: Int32.cs
===================================================================
RCS file: /cvs/dbus/dbus/mono/DBusType/Int32.cs,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- Int32.cs	25 Mar 2004 14:04:43 -0000	1.3
+++ Int32.cs	29 Aug 2004 18:14:30 -0000	1.4
@@ -1,93 +1,93 @@
-using System;
-using System.Runtime.InteropServices;
-using System.Reflection.Emit;
-
-using DBus;
-
-namespace DBus.DBusType
-{
-  /// <summary>
-  /// 32-bit integer.
-  /// </summary>
-  public class Int32 : IDBusType
-  {
-    public const char Code = 'i';
-    private System.Int32 val;
-    
-    private Int32()
-    {
-    }
-    
-    public Int32(System.Int32 val, Service service) 
-    {
-      this.val = val;
-    }
-
-    public Int32(IntPtr iter, Service service)
-    {
-      this.val = dbus_message_iter_get_int32(iter);
-    }
-    
-    public void Append(IntPtr iter)
-    {
-      if (!dbus_message_iter_append_int32(iter, val))
-	throw new ApplicationException("Failed to append INT32 argument:" + val);
-    }
-
-    public static bool Suits(System.Type type) 
-    {
-      if (type.IsEnum && type.UnderlyingSystemType == typeof(System.Int32)) {
-	return true;
-      }
-      
-      switch (type.ToString()) {
-      case "System.Int32":
-      case "System.Int32&":
-	return true;      }
-      
-      return false;
-    }
-
-    public static void EmitMarshalIn(ILGenerator generator, Type type)
-    {
-      if (type.IsByRef) {
-	generator.Emit(OpCodes.Ldind_I4);
-      }
-    }
-
-    public static void EmitMarshalOut(ILGenerator generator, Type type, bool isReturn) 
-    {
-      generator.Emit(OpCodes.Unbox, type);
-      generator.Emit(OpCodes.Ldind_I4);
-      if (!isReturn) {
-	generator.Emit(OpCodes.Stind_I4);
-      }
-    }
-    
-    public object Get() 
-    {
-      return this.val;
-    }
-
-    public object Get(System.Type type)
-    {
-      if (type.IsEnum) {
-	return Enum.ToObject(type, this.val);
-      }
-      
-      switch (type.ToString()) {
-      case "System.Int32":
-      case "System.Int32&":
-	return this.val;
-      default:
-	throw new ArgumentException("Cannot cast DBus.Type.Int32 to type '" + type.ToString() + "'");
-      }
-    }    
-
-    [DllImport("dbus-1")]
-    private extern static System.Int32 dbus_message_iter_get_int32(IntPtr iter);
- 
-    [DllImport("dbus-1")]
-    private extern static bool dbus_message_iter_append_int32(IntPtr iter, System.Int32 value);
-  }
-}
+using System;
+using System.Runtime.InteropServices;
+using System.Reflection.Emit;
+
+using DBus;
+
+namespace DBus.DBusType
+{
+  /// <summary>
+  /// 32-bit integer.
+  /// </summary>
+  public class Int32 : IDBusType
+  {
+    public const char Code = 'i';
+    private System.Int32 val;
+    
+    private Int32()
+    {
+    }
+    
+    public Int32(System.Int32 val, Service service) 
+    {
+      this.val = val;
+    }
+
+    public Int32(IntPtr iter, Service service)
+    {
+      this.val = dbus_message_iter_get_int32(iter);
+    }
+    
+    public void Append(IntPtr iter)
+    {
+      if (!dbus_message_iter_append_int32(iter, val))
+	throw new ApplicationException("Failed to append INT32 argument:" + val);
+    }
+
+    public static bool Suits(System.Type type) 
+    {
+      if (type.IsEnum && type.UnderlyingSystemType == typeof(System.Int32)) {
+	return true;
+      }
+      
+      switch (type.ToString()) {
+      case "System.Int32":
+      case "System.Int32&":
+	return true;      }
+      
+      return false;
+    }
+
+    public static void EmitMarshalIn(ILGenerator generator, Type type)
+    {
+      if (type.IsByRef) {
+	generator.Emit(OpCodes.Ldind_I4);
+      }
+    }
+
+    public static void EmitMarshalOut(ILGenerator generator, Type type, bool isReturn) 
+    {
+      generator.Emit(OpCodes.Unbox, type);
+      generator.Emit(OpCodes.Ldind_I4);
+      if (!isReturn) {
+	generator.Emit(OpCodes.Stind_I4);
+      }
+    }
+    
+    public object Get() 
+    {
+      return this.val;
+    }
+
+    public object Get(System.Type type)
+    {
+      if (type.IsEnum) {
+	return Enum.ToObject(type, this.val);
+      }
+      
+      switch (type.ToString()) {
+      case "System.Int32":
+      case "System.Int32&":
+	return this.val;
+      default:
+	throw new ArgumentException("Cannot cast DBus.Type.Int32 to type '" + type.ToString() + "'");
+      }
+    }    
+
+    [DllImport("dbus-1")]
+    private extern static System.Int32 dbus_message_iter_get_int32(IntPtr iter);
+ 
+    [DllImport("dbus-1")]
+    private extern static bool dbus_message_iter_append_int32(IntPtr iter, System.Int32 value);
+  }
+}

Index: Int64.cs
===================================================================
RCS file: /cvs/dbus/dbus/mono/DBusType/Int64.cs,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- Int64.cs	25 Mar 2004 14:04:43 -0000	1.3
+++ Int64.cs	29 Aug 2004 18:14:30 -0000	1.4
@@ -1,94 +1,94 @@
-using System;
-using System.Runtime.InteropServices;
-using System.Reflection.Emit;
-
-using DBus;
-
-namespace DBus.DBusType
-{
-  /// <summary>
-  /// 64-bit integer.
-  /// </summary>
-  public class Int64 : IDBusType
-  {
-    public const char Code = 'x';
-    private System.Int64 val;
-    
-    private Int64()
-    {
-    }
-    
-    public Int64(System.Int64 val, Service service) 
-    {
-      this.val = val;
-    }
-
-    public Int64(IntPtr iter, Service service)
-    {
-      this.val = dbus_message_iter_get_int64(iter);
-    }
-    
-    public void Append(IntPtr iter)
-    {
-      if (!dbus_message_iter_append_int64(iter, val))
-	throw new ApplicationException("Failed to append INT64 argument:" + val);
-    }
-
-    public static bool Suits(System.Type type) 
-    {
-      if (type.IsEnum && type.UnderlyingSystemType == typeof(System.Int64)) {
-	return true;
-      }
-
-      switch (type.ToString()) {
-      case "System.Int64":
-      case "System.Int64&":
-	return true;
-      }
-      
-      return false;
-    }
-
-    public static void EmitMarshalIn(ILGenerator generator, Type type)
-    {
-      if (type.IsByRef) {
-	generator.Emit(OpCodes.Ldind_I8);
-      }
-    }
-
-    public static void EmitMarshalOut(ILGenerator generator, Type type, bool isReturn) 
-    {
-      generator.Emit(OpCodes.Unbox, type);
-      generator.Emit(OpCodes.Ldind_I8);
-      if (!isReturn) {
-	generator.Emit(OpCodes.Stind_I8);
-      }
-    }
-    
-    public object Get() 
-    {
-      return this.val;
-    }
-
-    public object Get(System.Type type)
-    {
-      if (type.IsEnum) {
-	return Enum.ToObject(type, this.val);
-      }
-
-      switch (type.ToString()) {
-      case "System.Int64":
-      case "System.Int64&":
-	return this.val;
-      default:
-	throw new ArgumentException("Cannot cast DBus.Type.Int64 to type '" + type.ToString() + "'");
-      }
-    }    
-
-    [DllImport("dbus-1")]
-    private extern static System.Int64 dbus_message_iter_get_int64(IntPtr iter);
- 
-    [DllImport("dbus-1")]
-    private extern static bool dbus_message_iter_append_int64(IntPtr iter, System.Int64 value);
-  }
-}
+using System;
+using System.Runtime.InteropServices;
+using System.Reflection.Emit;
+
+using DBus;
+
+namespace DBus.DBusType
+{
+  /// <summary>
+  /// 64-bit integer.
+  /// </summary>
+  public class Int64 : IDBusType
+  {
+    public const char Code = 'x';
+    private System.Int64 val;
+    
+    private Int64()
+    {
+    }
+    
+    public Int64(System.Int64 val, Service service) 
+    {
+      this.val = val;
+    }
+
+    public Int64(IntPtr iter, Service service)
+    {
+      this.val = dbus_message_iter_get_int64(iter);
+    }
+    
+    public void Append(IntPtr iter)
+    {
+      if (!dbus_message_iter_append_int64(iter, val))
+	throw new ApplicationException("Failed to append INT64 argument:" + val);
+    }
+
+    public static bool Suits(System.Type type) 
+    {
+      if (type.IsEnum && type.UnderlyingSystemType == typeof(System.Int64)) {
+	return true;
+      }
+
+      switch (type.ToString()) {
+      case "System.Int64":
+      case "System.Int64&":
+	return true;
+      }
+      
+      return false;
+    }
+
+    public static void EmitMarshalIn(ILGenerator generator, Type type)
+    {
+      if (type.IsByRef) {
+	generator.Emit(OpCodes.Ldind_I8);
+      }
+    }
+
+    public static void EmitMarshalOut(ILGenerator generator, Type type, bool isReturn) 
+    {
+      generator.Emit(OpCodes.Unbox, type);
+      generator.Emit(OpCodes.Ldind_I8);
+      if (!isReturn) {
+	generator.Emit(OpCodes.Stind_I8);
+      }
+    }
+    
+    public object Get() 
+    {
+      return this.val;
+    }
+
+    public object Get(System.Type type)
+    {
+      if (type.IsEnum) {
+	return Enum.ToObject(type, this.val);
+      }
+
+      switch (type.ToString()) {
+      case "System.Int64":
+      case "System.Int64&":
+	return this.val;
+      default:
+	throw new ArgumentException("Cannot cast DBus.Type.Int64 to type '" + type.ToString() + "'");
+      }
+    }    
+
+    [DllImport("dbus-1")]
+    private extern static System.Int64 dbus_message_iter_get_int64(IntPtr iter);
+ 
+    [DllImport("dbus-1")]
+    private extern static bool dbus_message_iter_append_int64(IntPtr iter, System.Int64 value);
+  }
+}

Index: Nil.cs
===================================================================
RCS file: /cvs/dbus/dbus/mono/DBusType/Nil.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- Nil.cs	24 Mar 2004 13:15:20 -0000	1.2
+++ Nil.cs	29 Aug 2004 18:14:30 -0000	1.3
@@ -1,68 +1,68 @@
-using System;
-using System.Runtime.InteropServices;
-using System.Reflection.Emit;
-
-using DBus;
-
-namespace DBus.DBusType
-{
-  /// <summary>
-  /// Marks a "void"/"unset"/"nonexistent"/"null" argument.
-  /// </summary>
-  public class Nil : IDBusType
-  {
-    public const char Code = 'v';
-    
-    private Nil()
-    {
-    }
-    
-    public Nil(object nil, Service service) 
-    {
-    }
-
-    public Nil(IntPtr iter, Service service)
-    {
-    }
-    
-    public void Append(IntPtr iter)
-    {
-      if (!dbus_message_iter_append_nil(iter))
-	throw new ApplicationException("Failed to append NIL argument");
-    }
-
-    public static bool Suits(System.Type type) 
-    {
-      return false;
-    }
-
-    public static void EmitMarshalIn(ILGenerator generator, Type type)
-    {
-      if (type.IsByRef) {
-	generator.Emit(OpCodes.Ldind_I1);
-      }
-    }
-
-    public static void EmitMarshalOut(ILGenerator generator, Type type, bool isReturn) 
-    {
-      generator.Emit(OpCodes.Unbox, type);
-      generator.Emit(OpCodes.Ldind_I1);
-      if (!isReturn) {
-	generator.Emit(OpCodes.Stind_I1);
-      }
-    }
-    
-    public object Get() 
-    {
-      return null;
-    }
-
-    public object Get(System.Type type)
-    {
-      throw new ArgumentException("Cannot cast DBus.Type.Nil to type '" + type.ToString() + "'");
-    }
-
-    [DllImport("dbus-1")]
-    private extern static bool dbus_message_iter_append_nil(IntPtr iter);
-  }
-}
+using System;
+using System.Runtime.InteropServices;
+using System.Reflection.Emit;
+
+using DBus;
+
+namespace DBus.DBusType
+{
+  /// <summary>
+  /// Marks a "void"/"unset"/"nonexistent"/"null" argument.
+  /// </summary>
+  public class Nil : IDBusType
+  {
+    public const char Code = 'v';
+    
+    private Nil()
+    {
+    }
+    
+    public Nil(object nil, Service service) 
+    {
+    }
+
+    public Nil(IntPtr iter, Service service)
+    {
+    }
+    
+    public void Append(IntPtr iter)
+    {
+      if (!dbus_message_iter_append_nil(iter))
+	throw new ApplicationException("Failed to append NIL argument");
+    }
+
+    public static bool Suits(System.Type type) 
+    {
+      return false;
+    }
+
+    public static void EmitMarshalIn(ILGenerator generator, Type type)
+    {
+      if (type.IsByRef) {
+	generator.Emit(OpCodes.Ldind_I1);
+      }
+    }
+
+    public static void EmitMarshalOut(ILGenerator generator, Type type, bool isReturn) 
+    {
+      generator.Emit(OpCodes.Unbox, type);
+      generator.Emit(OpCodes.Ldind_I1);
+      if (!isReturn) {
+	generator.Emit(OpCodes.Stind_I1);
+      }
+    }
+    
+    public object Get() 
+    {
+      return null;
+    }
+
+    public object Get(System.Type type)
+    {
+      throw new ArgumentException("Cannot cast DBus.Type.Nil to type '" + type.ToString() + "'");
+    }
+
+    [DllImport("dbus-1")]
+    private extern static bool dbus_message_iter_append_nil(IntPtr iter);
+  }
+}

Index: ObjectPath.cs
===================================================================
RCS file: /cvs/dbus/dbus/mono/DBusType/ObjectPath.cs,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- ObjectPath.cs	7 Jun 2004 11:40:20 -0000	1.4
+++ ObjectPath.cs	29 Aug 2004 18:14:30 -0000	1.5
@@ -1,99 +1,99 @@
-using System;
-using System.Runtime.InteropServices;
-using System.Reflection.Emit;
-
-using DBus;
-
-namespace DBus.DBusType
-{
-  /// <summary>
-  /// An object path.
-  /// </summary>
-  public class ObjectPath : IDBusType
-  {
-    public const char Code = 'o';
-    private string path = null;
-    private object val = null;
-    private Service service = null;
-    
-    private ObjectPath()
-    {
-    }
-    
-    public ObjectPath(object val, Service service) 
-    {
-      this.val = val;
-      this.service = service;
-    }
-    
-    public ObjectPath(IntPtr iter, Service service)
-    {
-      
-      this.path = Marshal.PtrToStringAnsi(dbus_message_iter_get_object_path(iter));
-      this.service = service;
-    }
-
-    private string Path
-    {
-      get {
-	if (this.path == null && this.val != null) {
-	  Handler handler = this.service.GetHandler(this.val);
-	  this.path = handler.Path;
-	}
-
-	return this.path;
-      }
-    }
-
-    public void Append(IntPtr iter) 
-    {
-      if (!dbus_message_iter_append_object_path(iter, Marshal.StringToHGlobalAnsi(Path)))
-	throw new ApplicationException("Failed to append OBJECT_PATH argument:" + val);
-    }
-
-    public static bool Suits(System.Type type) 
-    {
-      object[] attributes = type.GetCustomAttributes(typeof(InterfaceAttribute), false);
-      if (attributes.Length == 1) {
-	return true;
-      } else {
-	return false;
-      }
-    }
-
-    public static void EmitMarshalIn(ILGenerator generator, Type type)
-    {
-      if (type.IsByRef) {
-	generator.Emit(OpCodes.Ldind_Ref);
-      }
-    }
-
-    public static void EmitMarshalOut(ILGenerator generator, Type type, bool isReturn) 
-    {
-      generator.Emit(OpCodes.Castclass, type);
-      if (!isReturn) {
-	generator.Emit(OpCodes.Stind_Ref);
-      }
-    }
-
-    public object Get() 
-    {
-      throw new ArgumentException("Cannot call Get on an ObjectPath without specifying type.");
-    }
-
-    public object Get(System.Type type)
-    {
-      try {
-	return this.service.GetObject(type, Path);
-      } catch(Exception ex) {
-	throw new ArgumentException("Cannot cast object pointed to by Object Path to type '" + type.ToString() + "': " + ex);
-      }
-    }
-
-    [DllImport("dbus-1")]
-    private extern static IntPtr dbus_message_iter_get_object_path(IntPtr iter);
- 
-    [DllImport("dbus-1")]
-    private extern static bool dbus_message_iter_append_object_path(IntPtr iter, IntPtr path);
-  }
-}
+using System;
+using System.Runtime.InteropServices;
+using System.Reflection.Emit;
+
+using DBus;
+
+namespace DBus.DBusType
+{
+  /// <summary>
+  /// An object path.
+  /// </summary>
+  public class ObjectPath : IDBusType
+  {
+    public const char Code = 'o';
+    private string path = null;
+    private object val = null;
+    private Service service = null;
+    
+    private ObjectPath()
+    {
+    }
+    
+    public ObjectPath(object val, Service service) 
+    {
+      this.val = val;
+      this.service = service;
+    }
+    
+    public ObjectPath(IntPtr iter, Service service)
+    {
+      
+      this.path = Marshal.PtrToStringAnsi(dbus_message_iter_get_object_path(iter));
+      this.service = service;
+    }
+
+    private string Path
+    {
+      get {
+	if (this.path == null && this.val != null) {
+	  Handler handler = this.service.GetHandler(this.val);
+	  this.path = handler.Path;
+	}
+
+	return this.path;
+      }
+    }
+
+    public void Append(IntPtr iter) 
+    {
+      if (!dbus_message_iter_append_object_path(iter, Marshal.StringToHGlobalAnsi(Path)))
+	throw new ApplicationException("Failed to append OBJECT_PATH argument:" + val);
+    }
+
+    public static bool Suits(System.Type type) 
+    {
+      object[] attributes = type.GetCustomAttributes(typeof(InterfaceAttribute), false);
+      if (attributes.Length == 1) {
+	return true;
+      } else {
+	return false;
+      }
+    }
+
+    public static void EmitMarshalIn(ILGenerator generator, Type type)
+    {
+      if (type.IsByRef) {
+	generator.Emit(OpCodes.Ldind_Ref);
+      }
+    }
+
+    public static void EmitMarshalOut(ILGenerator generator, Type type, bool isReturn) 
+    {
+      generator.Emit(OpCodes.Castclass, type);
+      if (!isReturn) {
+	generator.Emit(OpCodes.Stind_Ref);
+      }
+    }
+
+    public object Get() 
+    {
+      throw new ArgumentException("Cannot call Get on an ObjectPath without specifying type.");
+    }
+
+    public object Get(System.Type type)
+    {
+      try {
+	return this.service.GetObject(type, Path);
+      } catch(Exception ex) {
+	throw new ArgumentException("Cannot cast object pointed to by Object Path to type '" + type.ToString() + "': " + ex);
+      }
+    }
+
+    [DllImport("dbus-1")]
+    private extern static IntPtr dbus_message_iter_get_object_path(IntPtr iter);
+ 
+    [DllImport("dbus-1")]
+    private extern static bool dbus_message_iter_append_object_path(IntPtr iter, IntPtr path);
+  }
+}

Index: String.cs
===================================================================
RCS file: /cvs/dbus/dbus/mono/DBusType/String.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- String.cs	24 Mar 2004 13:15:20 -0000	1.2
+++ String.cs	29 Aug 2004 18:14:30 -0000	1.3
@@ -1,86 +1,86 @@
-using System;
-using System.Runtime.InteropServices;
-using System.Reflection.Emit;
-
-using DBus;
-
-namespace DBus.DBusType
-{
-  /// <summary>
-  /// A string.
-  /// </summary>
-  public class String : IDBusType
-  {
-    public const char Code = 's';
-    private string val;
-    
-    private String()
-    {
-    }
-    
-    public String(string val, Service service) 
-    {
-      this.val = val;
-    }
-    
-    public String(IntPtr iter, Service service)
-    {
-      this.val = Marshal.PtrToStringAnsi(dbus_message_iter_get_string(iter));
-    }
-
-    public void Append(IntPtr iter) 
-    {
-      if (!dbus_message_iter_append_string(iter, Marshal.StringToHGlobalAnsi(val)))
-	throw new ApplicationException("Failed to append STRING argument:" + val);
-    }
-
-    public static bool Suits(System.Type type) 
-    {
-      switch (type.ToString()) {
-      case "System.String":
-      case "System.String&":
-	return true;
-      }
-      
-      return false;
-    }
-
-    public static void EmitMarshalIn(ILGenerator generator, Type type)
-    {
-      if (type.IsByRef) {
-	generator.Emit(OpCodes.Ldind_Ref);
-      }
-    }
-
-    public static void EmitMarshalOut(ILGenerator generator, Type type, bool isReturn) 
-    {
-      generator.Emit(OpCodes.Castclass, type);
-      if (!isReturn) {
-	generator.Emit(OpCodes.Stind_Ref);
-      }
-    }
-
-    public object Get() 
-    {
-      return this.val;
-    }
-
-    public object Get(System.Type type)
-    {
-      switch (type.ToString()) 
-	{
-	case "System.String":
-	case "System.String&":
-	  return this.val;
-	default:
-	  throw new ArgumentException("Cannot cast DBus.Type.String to type '" + type.ToString() + "'");
-	}
-    }    
-
-    [DllImport("dbus-1")]
-    private extern static IntPtr dbus_message_iter_get_string(IntPtr iter);
- 
-    [DllImport("dbus-1")]
-    private extern static bool dbus_message_iter_append_string(IntPtr iter, IntPtr value);
-  }
-}
+using System;
+using System.Runtime.InteropServices;
+using System.Reflection.Emit;
+
+using DBus;
+
+namespace DBus.DBusType
+{
+  /// <summary>
+  /// A string.
+  /// </summary>
+  public class String : IDBusType
+  {
+    public const char Code = 's';
+    private string val;
+    
+    private String()
+    {
+    }
+    
+    public String(string val, Service service) 
+    {
+      this.val = val;
+    }
+    
+    public String(IntPtr iter, Service service)
+    {
+      this.val = Marshal.PtrToStringAnsi(dbus_message_iter_get_string(iter));
+    }
+
+    public void Append(IntPtr iter) 
+    {
+      if (!dbus_message_iter_append_string(iter, Marshal.StringToHGlobalAnsi(val)))
+	throw new ApplicationException("Failed to append STRING argument:" + val);
+    }
+
+    public static bool Suits(System.Type type) 
+    {
+      switch (type.ToString()) {
+      case "System.String":
+      case "System.String&":
+	return true;
+      }
+      
+      return false;
+    }
+
+    public static void EmitMarshalIn(ILGenerator generator, Type type)
+    {
+      if (type.IsByRef) {
+	generator.Emit(OpCodes.Ldind_Ref);
+      }
+    }
+
+    public static void EmitMarshalOut(ILGenerator generator, Type type, bool isReturn) 
+    {
+      generator.Emit(OpCodes.Castclass, type);
+      if (!isReturn) {
+	generator.Emit(OpCodes.Stind_Ref);
+      }
+    }
+
+    public object Get() 
+    {
+      return this.val;
+    }
+
+    public object Get(System.Type type)
+    {
+      switch (type.ToString()) 
+	{
+	case "System.String":
+	case "System.String&":
+	  return this.val;
+	default:
+	  throw new ArgumentException("Cannot cast DBus.Type.String to type '" + type.ToString() + "'");
+	}
+    }    
+
+    [DllImport("dbus-1")]
+    private extern static IntPtr dbus_message_iter_get_string(IntPtr iter);
+ 
+    [DllImport("dbus-1")]
+    private extern static bool dbus_message_iter_append_string(IntPtr iter, IntPtr value);
+  }
+}

Index: UInt32.cs
===================================================================
RCS file: /cvs/dbus/dbus/mono/DBusType/UInt32.cs,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- UInt32.cs	25 Mar 2004 14:04:43 -0000	1.3
+++ UInt32.cs	29 Aug 2004 18:14:30 -0000	1.4
@@ -1,95 +1,95 @@
-using System;
-using System.Runtime.InteropServices;
-using System.Reflection.Emit;
-
-using DBus;
-
-namespace DBus.DBusType
-{
-  /// <summary>
-  /// 32-bit unsigned integer.
-  /// </summary>
-  public class UInt32 : IDBusType
-  {
-    public const char Code = 'u';
-    private System.UInt32 val;
-    
-    private UInt32()
-    {
-    }
-    
-    public UInt32(System.UInt32 val, Service service) 
-    {
-      this.val = val;
-    }
-
-    public UInt32(IntPtr iter, Service service)
-    {
-      this.val = dbus_message_iter_get_uint32(iter);
-    }
-    
-    public void Append(IntPtr iter)
-    {
-      if (!dbus_message_iter_append_uint32(iter, val))
-	throw new ApplicationException("Failed to append UINT32 argument:" + val);
-    }
-
-    public static bool Suits(System.Type type) 
-    {
-      if (type.IsEnum && type.UnderlyingSystemType == typeof(System.UInt32)) {
-	return true;
-      }
-
-      switch (type.ToString()) {
-      case "System.UInt32":
-      case "System.UInt32&":
-	return true;
-      }
-      
-      return false;
-    }
-
-    public static void EmitMarshalIn(ILGenerator generator, Type type)
-    {
-      if (type.IsByRef) {
-	generator.Emit(OpCodes.Ldind_U4);
-      }
-    }
-
-    public static void EmitMarshalOut(ILGenerator generator, Type type, bool isReturn) 
-    {
-      generator.Emit(OpCodes.Unbox, type);
-      generator.Emit(OpCodes.Ldind_U4);
-      if (!isReturn) {
-	generator.Emit(OpCodes.Stind_I4);
-      }
-    }
-    
-    public object Get() 
-    {
-      return this.val;
-    }
-
-    public object Get(System.Type type)
-    {
-      if (type.IsEnum) {
-	return Enum.ToObject(type, this.val);
-      }
-
-      switch (type.ToString()) 
-	{
-	case "System.UInt32":
-	case "System.UInt32&":
-	  return this.val;
-	default:
-	  throw new ArgumentException("Cannot cast DBus.Type.UInt32 to type '" + type.ToString() + "'");
-	}
-    }    
-
-    [DllImport("dbus-1")]
-    private extern static System.UInt32 dbus_message_iter_get_uint32(IntPtr iter);
- 
-    [DllImport("dbus-1")]
-    private extern static bool dbus_message_iter_append_uint32(IntPtr iter, System.UInt32 value);
-  }
-}
+using System;
+using System.Runtime.InteropServices;
+using System.Reflection.Emit;
+
+using DBus;
+
+namespace DBus.DBusType
+{
+  /// <summary>
+  /// 32-bit unsigned integer.
+  /// </summary>
+  public class UInt32 : IDBusType
+  {
+    public const char Code = 'u';
+    private System.UInt32 val;
+    
+    private UInt32()
+    {
+    }
+    
+    public UInt32(System.UInt32 val, Service service) 
+    {
+      this.val = val;
+    }
+
+    public UInt32(IntPtr iter, Service service)
+    {
+      this.val = dbus_message_iter_get_uint32(iter);
+    }
+    
+    public void Append(IntPtr iter)
+    {
+      if (!dbus_message_iter_append_uint32(iter, val))
+	throw new ApplicationException("Failed to append UINT32 argument:" + val);
+    }
+
+    public static bool Suits(System.Type type) 
+    {
+      if (type.IsEnum && type.UnderlyingSystemType == typeof(System.UInt32)) {
+	return true;
+      }
+
+      switch (type.ToString()) {
+      case "System.UInt32":
+      case "System.UInt32&":
+	return true;
+      }
+      
+      return false;
+    }
+
+    public static void EmitMarshalIn(ILGenerator generator, Type type)
+    {
+      if (type.IsByRef) {
+	generator.Emit(OpCodes.Ldind_U4);
+      }
+    }
+
+    public static void EmitMarshalOut(ILGenerator generator, Type type, bool isReturn) 
+    {
+      generator.Emit(OpCodes.Unbox, type);
+      generator.Emit(OpCodes.Ldind_U4);
+      if (!isReturn) {
+	generator.Emit(OpCodes.Stind_I4);
+      }
+    }
+    
+    public object Get() 
+    {
+      return this.val;
+    }
+
+    public object Get(System.Type type)
+    {
+      if (type.IsEnum) {
+	return Enum.ToObject(type, this.val);
+      }
+
+      switch (type.ToString()) 
+	{
+	case "System.UInt32":
+	case "System.UInt32&":
+	  return this.val;
+	default:
+	  throw new ArgumentException("Cannot cast DBus.Type.UInt32 to type '" + type.ToString() + "'");
+	}
+    }    
+
+    [DllImport("dbus-1")]
+    private extern static System.UInt32 dbus_message_iter_get_uint32(IntPtr iter);
+ 
+    [DllImport("dbus-1")]
+    private extern static bool dbus_message_iter_append_uint32(IntPtr iter, System.UInt32 value);
+  }
+}

Index: UInt64.cs
===================================================================
RCS file: /cvs/dbus/dbus/mono/DBusType/UInt64.cs,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- UInt64.cs	25 Mar 2004 14:04:43 -0000	1.3
+++ UInt64.cs	29 Aug 2004 18:14:30 -0000	1.4
@@ -1,95 +1,95 @@
-using System;
-using System.Runtime.InteropServices;
-using System.Reflection.Emit;
-
-using DBus;
-
-namespace DBus.DBusType
-{
-  /// <summary>
-  /// 64-bit unsigned integer.
-  /// </summary>
-  public class UInt64 : IDBusType
-  {
-    public const char Code = 't';
-    private System.UInt64 val;
-    
-    private UInt64()
-    {
-    }
-    
-    public UInt64(System.UInt64 val, Service service) 
-    {
-      this.val = val;
-    }
-
-    public UInt64(IntPtr iter, Service service)
-    {
-      this.val = dbus_message_iter_get_uint64(iter);
-    }
-    
-    public void Append(IntPtr iter)
-    {
-      if (!dbus_message_iter_append_uint64(iter, val))
-	throw new ApplicationException("Failed to append UINT64 argument:" + val);
-    }
-
-    public static bool Suits(System.Type type) 
-    {
-      if (type.IsEnum && type.UnderlyingSystemType == typeof(System.UInt64)) {
-	return true;
-      }
-
-      switch (type.ToString()) {
-      case "System.UInt64":
-      case "System.UInt64&":
-	return true;
-      }
-      
-      return false;
-    }
-
-    public static void EmitMarshalIn(ILGenerator generator, Type type)
-    {
-      if (type.IsByRef) {
-	generator.Emit(OpCodes.Ldind_I8);
-      }
-    }
-
-    public static void EmitMarshalOut(ILGenerator generator, Type type, bool isReturn) 
-    {
-      generator.Emit(OpCodes.Unbox, type);
-      generator.Emit(OpCodes.Ldind_I8);
-      if (!isReturn) {
-	generator.Emit(OpCodes.Stind_I8);
-      }
-    }
-    
-    public object Get() 
-    {
-      return this.val;
-    }
-
-    public object Get(System.Type type)
-    {
-      if (type.IsEnum) {
-	return Enum.ToObject(type, this.val);
-      }
-
-      switch (type.ToString()) 
-	{
-	case "System.UInt64":
-	case "System.UInt64&":
-	  return this.val;
-	default:
-	  throw new ArgumentException("Cannot cast DBus.Type.UInt64 to type '" + type.ToString() + "'");
-	}
-    }    
-
-    [DllImport("dbus-1")]
-    private extern static System.UInt64 dbus_message_iter_get_uint64(IntPtr iter);
- 
-    [DllImport("dbus-1")]
-    private extern static bool dbus_message_iter_append_uint64(IntPtr iter, System.UInt64 value);
-  }
-}
+using System;
+using System.Runtime.InteropServices;
+using System.Reflection.Emit;
+
+using DBus;
+
+namespace DBus.DBusType
+{
+  /// <summary>
+  /// 64-bit unsigned integer.
+  /// </summary>
+  public class UInt64 : IDBusType
+  {
+    public const char Code = 't';
+    private System.UInt64 val;
+    
+    private UInt64()
+    {
+    }
+    
+    public UInt64(System.UInt64 val, Service service) 
+    {
+      this.val = val;
+    }
+
+    public UInt64(IntPtr iter, Service service)
+    {
+      this.val = dbus_message_iter_get_uint64(iter);
+    }
+    
+    public void Append(IntPtr iter)
+    {
+      if (!dbus_message_iter_append_uint64(iter, val))
+	throw new ApplicationException("Failed to append UINT64 argument:" + val);
+    }
+
+    public static bool Suits(System.Type type) 
+    {
+      if (type.IsEnum && type.UnderlyingSystemType == typeof(System.UInt64)) {
+	return true;
+      }
+
+      switch (type.ToString()) {
+      case "System.UInt64":
+      case "System.UInt64&":
+	return true;
+      }
+      
+      return false;
+    }
+
+    public static void EmitMarshalIn(ILGenerator generator, Type type)
+    {
+      if (type.IsByRef) {
+	generator.Emit(OpCodes.Ldind_I8);
+      }
+    }
+
+    public static void EmitMarshalOut(ILGenerator generator, Type type, bool isReturn) 
+    {
+      generator.Emit(OpCodes.Unbox, type);
+      generator.Emit(OpCodes.Ldind_I8);
+      if (!isReturn) {
+	generator.Emit(OpCodes.Stind_I8);
+      }
+    }
+    
+    public object Get() 
+    {
+      return this.val;
+    }
+
+    public object Get(System.Type type)
+    {
+      if (type.IsEnum) {
+	return Enum.ToObject(type, this.val);
+      }
+
+      switch (type.ToString()) 
+	{
+	case "System.UInt64":
+	case "System.UInt64&":
+	  return this.val;
+	default:
+	  throw new ArgumentException("Cannot cast DBus.Type.UInt64 to type '" + type.ToString() + "'");
+	}
+    }    
+
+    [DllImport("dbus-1")]
+    private extern static System.UInt64 dbus_message_iter_get_uint64(IntPtr iter);
+ 
+    [DllImport("dbus-1")]
+    private extern static bool dbus_message_iter_append_uint64(IntPtr iter, System.UInt64 value);
+  }
+}



More information about the dbus-commit mailing list