Example #1
0
 static object GetValue(Intent intent, string name, Type type)
 {
     switch (Type.GetTypeCode (type)) {
     case TypeCode.String:
         return intent.GetStringExtra (name);
     case TypeCode.Single:
         return intent.GetFloatExtra (name, 0);
     case TypeCode.Double:
         return intent.GetDoubleExtra (name, 0);
     case TypeCode.Int32:
         return intent.GetIntExtra (name, 0);
     default:
         throw new Exception ("Type not supported");
     }
 }