private void Template(XmlNode command) { var name = GetAttributeOrError(command, "Name", "The template was not given a name!\r\n" + command.OuterXml); var parameterAttribute = GetAttributeOrError(command, "Parameters", "The template was not given any parameters!\r\n" + command.OuterXml); // gather the parameters semi-colon separated var parameters = parameterAttribute.Split(';'); for (int i = 0; i < parameters.Length; i++) { parameters[i] = parameters[i].Trim(); } // this will allow overwriting templates Templates[name] = new MultirunTemplate(name, command.CloneNode(true), parameters); }
internal bool PrepareForExecution(KeyValuePair <string, string>[] parameters, out MultirunTemplate toExecute, ref string error) { if (!ValidateParameters(parameters, ref error)) { toExecute = null; return(false); } var newNode = Node.CloneNode(true); if (!ReplaceStrings(newNode, parameters, ref error)) { toExecute = null; return(false); } toExecute = new MultirunTemplate(Name, newNode, Parameters); return(true); }