diff options
author | Owen Fraser-Green <owen@discobabe.net> | 2004-03-25 14:04:43 +0000 |
---|---|---|
committer | Owen Fraser-Green <owen@discobabe.net> | 2004-03-25 14:04:43 +0000 |
commit | 7dd57040236dc34a313948f75b403a49df693649 (patch) | |
tree | 96ff9ce4b3164e90ba77128d0914e7fc8f1f18c0 /mono/DBusType/Int64.cs | |
parent | e29f0448ec403efef910e8daba6ad7707b3a5ce0 (diff) |
Added support for enumerations with marshalling to/from their underlying system type (Byte, Int32, UInt32, Int64, UInt64)
Diffstat (limited to 'mono/DBusType/Int64.cs')
-rw-r--r-- | mono/DBusType/Int64.cs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/mono/DBusType/Int64.cs b/mono/DBusType/Int64.cs index 1cc79c7c..741d272a 100644 --- a/mono/DBusType/Int64.cs +++ b/mono/DBusType/Int64.cs @@ -36,6 +36,10 @@ namespace DBus.DBusType 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&": @@ -68,6 +72,10 @@ namespace DBus.DBusType public object Get(System.Type type) { + if (type.IsEnum) { + return Enum.ToObject(type, this.val); + } + switch (type.ToString()) { case "System.Int64": case "System.Int64&": |