public void SetValueAcrossSteps(string variableName, object value) { if (!sourceVariables.ContainsKey(variableName)) { sourceVariables.Add(variableName, value); } else { sourceVariables[variableName] = value; } foreach (Step step in Steps.Where(i => i.InSourceVariables.Any(j => j.Name == variableName))) { SourceVariable variable = step.InSourceVariables.First(i => i.Name == variableName); step.InValues[step.InSourceVariables.ToList().IndexOf(variable)] = value; } foreach (Step step in Steps.Where(i => i.DependentVariables.Any(j => j.Name == variableName))) { SourceVariable variable = step.DependentVariables.First(i => i.Name == variableName); step.DependentValues[step.DependentVariables.ToList().IndexOf(variable)] = value; UpdateStepState(step); } }
public void SetValueString(string variableName, string s) { SourceVariable v = Plan.Variables.FirstOrDefault(i => i.Name == variableName); if (v != null && s != "System.Double[]") { object value = string.IsNullOrEmpty(s) ? null : DataFuncs.DeserializeValue(v.Type, s); SetValueAcrossSteps(variableName, value); } }