Пример #1
0
        private void UpdateValue(ParameterDataSet dataset, string name, string value, string comments, string lastmodified)
        {
            if (RemapDictionary.ContainsKey(name))
            {
                var codename = RemapDictionary[name];
                if (codename != "XXXX")
                {
                    var param = new InputParameter()
                    {
                        Id         = Guid.NewGuid(),
                        NameInFile = name,
                        Value      = value,
                        NameInCode = codename
                    };

                    dataset.AddParameter(param);
                }
                else
                {
                    AddErrorOutput($"Parameter {name} is defined as XXXX in remap dictionary");
                }
            }
            else
            {
                AddErrorOutput($"Parameter {name} not in remap dictionary");
            }
        }
Пример #2
0
        private void LoadOverrides(XmlNode xn, ParameterDataSetPtr datasetPtr)
        {
            var nodes = xn.SelectNodes("OverrideParameter");

            foreach (XmlNode node in nodes)
            {
                var overrideParam = new ParameterOverride();
                overrideParam.XMLNode = node.Attributes["Keyword"].Value;
                overrideParam.Active  = node.Attributes["Active"].Value == "true";
                if (RemapDictionary.ContainsKey(overrideParam.XMLNode))
                {
                    overrideParam.CodeName = RemapDictionary[overrideParam.XMLNode];
                }
                else
                {
                    throw new Exception($"Key {overrideParam.XMLNode} doesn't exist in Remap Dictioary");
                }
                var valuenode = node.SelectSingleNode("Value");
                if (valuenode != null)
                {
                    overrideParam.Value = valuenode.InnerText;
                }
                datasetPtr.Overrides.Add(overrideParam);
            }
        }