示例#1
0
        /// <summary>
        /// Update the values, formula and switch of the provided <see cref="ParameterValueSet"/>
        /// </summary>
        /// <param name="clone">
        /// The clone of the <see cref="ParameterValueSet"/> that is to be updated.
        /// </param>
        /// <param name="valueSetValues">
        /// The <see cref="ValueSetValues"/> used to update the <see cref="ParameterValueSet"/> clone with
        /// </param>
        private void UpdateClone(ParameterValueSet clone, ValueSetValues valueSetValues)
        {
            try
            {
                clone.Manual[valueSetValues.ComponentIndex] = valueSetValues.ManualValue;
            }
            catch (ArgumentOutOfRangeException)
            {
                clone.ResetManual();
                clone.Manual[valueSetValues.ComponentIndex] = valueSetValues.ManualValue;
            }
            catch (Exception exception)
            {
                throw exception;
            }

            try
            {
                clone.Formula[valueSetValues.ComponentIndex] = valueSetValues.FormulaValue;
            }
            catch (ArgumentOutOfRangeException)
            {
                clone.ResetFormula();
                clone.Formula[valueSetValues.ComponentIndex] = valueSetValues.FormulaValue;
            }
            catch (Exception exception)
            {
                throw exception;
            }

            try
            {
                clone.Computed[valueSetValues.ComponentIndex] = valueSetValues.ComputedValue;
            }
            catch (ArgumentOutOfRangeException)
            {
                clone.ResetComputed();
                clone.Computed[valueSetValues.ComponentIndex] = valueSetValues.ComputedValue;
            }
            catch (Exception exception)
            {
                throw exception;
            }

            try
            {
                clone.Reference[valueSetValues.ComponentIndex] = valueSetValues.ReferenceValue;
            }
            catch (ArgumentOutOfRangeException)
            {
                clone.ResetReference();
                clone.Reference[valueSetValues.ComponentIndex] = valueSetValues.ReferenceValue;
            }
            catch (Exception exception)
            {
                throw exception;
            }

            clone.ValueSwitch = valueSetValues.SwitchKind;
        }