public T getValue <T>(string paramName) { lock (lockParameters) { iParam param = getParameter(paramName); if (param == null) { // message logger.Error("Could not find parameter '" + paramName + "' in parameter set '" + paramSetName + "', returning 0"); // return 0 return((T)Convert.ChangeType(Parameters.emptyValue <T>(), typeof(T))); } // return the value return(param.getValue <T>()); } }
public static T getValue <T>(string paramName) { lock (lockParameters) { // retrieve the parameter iParam param = getParameter(paramName); // create the parameter if it does not exist if (param == null) { param = addParameter <T>(paramName); } // if not able to create, return 0 if (param == null) { return((T)Convert.ChangeType(null, typeof(T))); } // return the value return(param.getValue <T>()); } }