public virtual void SetValue <T>(string sName, T value) { AnyParameter p = FindByName(sName); if (p == null || (p is IParameter <T>) == false) { throw new InvalidOperationException("ParameterSet.GetValue - parameter " + sName + " is of type + " + p.TypeName()); } (p as IParameter <T>).setValue(value); on_parameter_modified(sName); }
public virtual T GetValue <T>(string sName) { AnyParameter p = FindByName(sName); if (p == null) { throw new InvalidOperationException("ParameterSet.GetValue - parameter " + sName + " does not exist in this set"); } if ((p is IParameter <T>) == false) { throw new InvalidOperationException("ParameterSet.GetValue - parameter " + sName + " is of type + " + p.TypeName()); } return((p as IParameter <T>).getValue()); }