diff options
author | Owen Fraser-Green <owen@discobabe.net> | 2004-03-24 17:02:08 +0000 |
---|---|---|
committer | Owen Fraser-Green <owen@discobabe.net> | 2004-03-24 17:02:08 +0000 |
commit | e29f0448ec403efef910e8daba6ad7707b3a5ce0 (patch) | |
tree | 0572afd24ec92c75dfb3c06b448f96dfa7a34237 /mono | |
parent | a745a709d00e2fd6145ca91f839fb1da947150a1 (diff) |
Modified to support char type.
Diffstat (limited to 'mono')
-rw-r--r-- | mono/DBusType/Byte.cs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/mono/DBusType/Byte.cs b/mono/DBusType/Byte.cs index 1e083a99..d5068f2e 100644 --- a/mono/DBusType/Byte.cs +++ b/mono/DBusType/Byte.cs @@ -23,6 +23,11 @@ namespace DBus.DBusType 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); @@ -39,6 +44,8 @@ namespace DBus.DBusType switch (type.ToString()) { case "System.Byte": case "System.Byte&": + case "System.Char": + case "System.Char&": return true; } @@ -72,6 +79,10 @@ namespace DBus.DBusType 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() + "'"); } |