aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Software/Visual_Studio/Utilities/Tango.Stubs.CLI/Program.cs13
1 files changed, 6 insertions, 7 deletions
diff --git a/Software/Visual_Studio/Utilities/Tango.Stubs.CLI/Program.cs b/Software/Visual_Studio/Utilities/Tango.Stubs.CLI/Program.cs
index 01a9b3c66..dd1d9d3e0 100644
--- a/Software/Visual_Studio/Utilities/Tango.Stubs.CLI/Program.cs
+++ b/Software/Visual_Studio/Utilities/Tango.Stubs.CLI/Program.cs
@@ -59,19 +59,18 @@ namespace Tango.Stubs.CLI
{
String arg = args[argIndex++].ToString();
- double numD;
- int numI;
- if (int.TryParse(arg, out numI))
+ if (prop.PropertyType == typeof(UInt32))
{
- prop.SetValue(request, numI);
+ prop.SetValue(request, UInt32.Parse(arg));
}
- else if (double.TryParse(arg, out numD))
+ else if (prop.PropertyType == typeof(bool))
{
- prop.SetValue(request, numD);
+ prop.SetValue(request, bool.Parse(arg));
}
else
{
- prop.SetValue(request, arg);
+ object converted = Convert.ChangeType(arg, prop.PropertyType);
+ prop.SetValue(request, converted);
}
}