private static List <string> RetrievePostAndPreActions(XmlNode workflowNode) { List <string> list = new List <string>(); if (workflowNode == null) { return(list); } for (int i = 0; i < workflowNode.ChildNodes.Count; i++) { list.AddRange(DDIVUtil.RetrievePostAndPreActions(workflowNode.ChildNodes[i])); } if (workflowNode.Attributes != null) { if (workflowNode.Attributes["PreAction"] != null) { list.Add(workflowNode.Attributes["PreAction"].Value); } if (workflowNode.Attributes["PostAction"] != null) { list.Add(workflowNode.Attributes["PostAction"].Value); } } return(list); }
internal static string RetrieveCodesInPostAndPreActions(string workflowName, string xaml, string codeBehind) { XmlDocument xmlDocument = new SafeXmlDocument(); xmlDocument.LoadXml(xaml); string result; using (XmlNodeList elementsByTagName = xmlDocument.GetElementsByTagName(workflowName)) { List <string> functionNames = DDIVUtil.RetrievePostAndPreActions(elementsByTagName[0]); result = DDIVUtil.RetrieveCodeFunctions(codeBehind, functionNames); } return(result); }