private void InsertFromParameter(Parameter parameter, bool insertIfMissing) { if (parameter == null || string.IsNullOrEmpty(parameter.Name)) { return; } int index = GetIndexOf(parameter.Name); if (index == -1) { if (HasRuntime) { index = Runtime.Count; IValue val = parameter.Value.CreateValue(); val.GetFrom(parameter.Value); Runtime.Add(val); } else if (insertIfMissing) { index = Serialized.Count; Serialized.Add(parameter); } Index[parameter.Name] = index; } }
public void InsertFromParameter(GenericParameter parameter) { int index = GetIndexOf(parameter.Name); if (index == -1) { if (HasRuntime) { index = Runtime.Count; IValue val = parameter.CreateValue(); val.GetFrom(parameter); Runtime.Add(val); } else { index = Serialized.Count; Serialized.Add(parameter); } Index[parameter.Name] = index; } }
public List <Pair <string, IValue> > GetPairs() { List <Pair <string, IValue> > pairs = new List <Pair <string, IValue> >(); if (HasRuntime) { for (int i = 0; i < Runtime.Count; i++) { pairs.Add(new Pair <string, IValue>(Serialized[i].Name, Runtime[i])); } } else { for (int i = 0; i < Serialized.Count; i++) { IValue val = Serialized[i].CreateValue(); val.GetFrom(Serialized[i]); pairs.Add(new Pair <string, IValue>(Serialized[i].Name, val)); } } return(pairs); }