WikiFunctions.Tools.GetTemplateParameterValues C# (CSharp) Method

GetTemplateParameterValues() public static method

Returns a dictionary of all named parameters used in the template and the value used. If the parameter is specified with no value, an empty string is returned as the value. If there are duplicate parameters, the value of the first (may be blank) is reported.
public static GetTemplateParameterValues ( string templateCall ) : string>.Dictionary
templateCall string
return string>.Dictionary
        public static Dictionary<string, string> GetTemplateParameterValues(string templateCall)
        {
            Dictionary<string, string> paramsFound = new Dictionary<string, string>();

            string pipecleanedtemplate = PipeCleanedTemplate(templateCall);

            foreach(Match m in param.Matches(pipecleanedtemplate))
            {
                if (!paramsFound.ContainsKey(m.Groups[1].Value))
                    paramsFound.Add(m.Groups[1].Value, templateCall.Substring(m.Groups[2].Index, m.Groups[2].Length).Trim());
            }

            return paramsFound;
        }
Tools