public void SetParameterValueFromArgument(CdmTraitDefinition trait, CdmArgumentDefinition arg) { ResolvedTrait resTrait = this.Get(trait); if (resTrait?.ParameterValues != null) { List <dynamic> av = resTrait.ParameterValues.Values; dynamic newVal = arg.Value; // get the value index from the parameter collection given the parameter that this argument is setting var paramDef = arg.GetParameterDef(); if (paramDef != null) { resTrait.ParameterValues.SetParameterValue(this.ResOpt, paramDef.GetName(), newVal); } else { // debug paramDef = arg.GetParameterDef(); } } }
public void SetParameterValueFromArgument(CdmTraitDefinition trait, CdmArgumentDefinition arg) { ResolvedTrait resTrait = this.Get(trait); if (resTrait?.ParameterValues != null) { List <dynamic> av = resTrait.ParameterValues.Values; dynamic newVal = arg.Value; // get the value index from the parameter collection given the parameter that this argument is setting int iParam = resTrait.ParameterValues.IndexOf(arg.GetParameterDef()); av[iParam] = ParameterValue.FetchReplacementValue(this.ResOpt, av[iParam], newVal, true); resTrait.ParameterValues.WasSet[iParam] = true; } }