Beispiel #1
0
 private object Parse(string v, Type parameterType, string methodName, int index)
 {
     if (parameterType == typeof(string))
     {
         return(v);
     }
     if (parameterType == typeof(Frame3D))
     {
         return(Frame3D.Parse(v));
     }
     if (parameterType.IsEnum)
     {
         return(Enum.Parse(parameterType, v));
     }
     if (parameterType == typeof(int))
     {
         return(int.Parse(v));
     }
     if (parameterType == typeof(double))
     {
         return(double.Parse(v));
     }
     if (parameterType == typeof(Single))
     {
         return(Single.Parse(v));
     }
     if (parameterType == typeof(bool))
     {
         return(bool.Parse(v));
     }
     throw new Exception("Parameter type " + parameterType.Name + " is not supported. Method " + methodName + ", index " + index);
 }