summaryrefslogtreecommitdiffstats
path: root/mono/DBusType/Int32.cs
diff options
context:
space:
mode:
Diffstat (limited to 'mono/DBusType/Int32.cs')
-rw-r--r--mono/DBusType/Int32.cs11
1 files changed, 9 insertions, 2 deletions
diff --git a/mono/DBusType/Int32.cs b/mono/DBusType/Int32.cs
index be78eba8..681a55f3 100644
--- a/mono/DBusType/Int32.cs
+++ b/mono/DBusType/Int32.cs
@@ -36,11 +36,14 @@ namespace DBus.DBusType
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 true; }
return false;
}
@@ -68,6 +71,10 @@ namespace DBus.DBusType
public object Get(System.Type type)
{
+ if (type.IsEnum) {
+ return Enum.ToObject(type, this.val);
+ }
+
switch (type.ToString()) {
case "System.Int32":
case "System.Int32&":