Example #1
0
        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);
        }
Example #2
0
        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());
        }