/// <summary> /// Retourne la liste des services externes du fichier /// </summary> /// <param name="doc"></param> /// <param name="nsmgr"></param> /// <returns></returns> public static List <ServiceExterne> ServicesExternes(XmlDocument doc, XmlNamespaceManager nsmgr) { List <ServiceExterne> servicesExternes = new List <ServiceExterne>(); List <string> noms = NomsServiceExterne(doc, nsmgr); for (int i = 1; i < NomsServiceExterne(doc, nsmgr).Count + 1; i++) { List <MethodeServiceExterne> methodes = MethodeServiceExterne.MethodesServiceExterne(doc, nsmgr, i); string descriptions = DescriptionsServiceExterne(doc, nsmgr, i - 1); string interfacesImplementees = InterfacesImplementeesServiceExterne(doc, nsmgr, i - 1); if (MethodeServiceExterne.NombreMethodesServiceExterne(doc, nsmgr, i - 1) != 0) { servicesExternes.Add(new ServiceExterne(noms[i - 1], descriptions, interfacesImplementees, methodes)); } if (MethodeServiceExterne.NombreMethodesServiceExterne(doc, nsmgr, i - 1) == 0) { servicesExternes.Add(new ServiceExterne(noms[i - 1], descriptions, interfacesImplementees)); } } return(servicesExternes); }
/// <summary> /// retourne la liste des parametres des methodes des services externes /// </summary> /// <param name="doc"></param> /// <param name="nsmgr"></param> /// <returns></returns> public static List <ParametreServiceExterne> ParametresMethodesServiceExterne(XmlDocument doc, XmlNamespaceManager nsmgr, int i, int cmp) { XmlNodeList nodeList2; XmlElement root = doc.DocumentElement; List <string> ListeParametresMethodesServiceExterne = new List <string>(); if (MethodeServiceExterne.NombreMethodesServiceExterne(doc, nsmgr, i - 1) != 0) { string xpath = @"// w:p [ w:pPr / w:pStyle [@w:val='Heading1']][5] /following:: w:p [ w:pPr / w:pStyle [@w:val='Heading2']][" + i + "] /following:: w:p [ w:pPr / w:pStyle [@w:val='Heading3']][3] /following:: w:p [ w:pPr / w:pStyle [@w:val='Heading4']][" + (cmp + 1) + "] /following:: w:p [ w:pPr / w:pStyle [@w:val='Heading5']][2]/ following-sibling:: w:tbl / w:tr /w:tc [count(. | // w:p [ w:pPr / w:pStyle [@w:val='Heading1']][5] /following:: w:p [ w:pPr / w:pStyle [@w:val='Heading2']][" + i + "] /following:: w:p [ w:pPr / w:pStyle [@w:val='Heading3']][3] /following:: w:p [ w:pPr / w:pStyle [@w:val='Heading4']][" + (cmp + 1) + "] /following:: w:p [ w:pPr / w:pStyle [@w:val='Heading5']][3] / preceding-sibling::w:tbl / w:tr /w:tc)= count(// w:p [ w:pPr / w:pStyle [@w:val='Heading1']][5] /following:: w:p [ w:pPr / w:pStyle [@w:val='Heading2']][" + i + "] /following:: w:p [ w:pPr / w:pStyle [@w:val='Heading3']][3] /following:: w:p [ w:pPr / w:pStyle [@w:val='Heading4']][" + (cmp + 1) + "] /following:: w:p [ w:pPr / w:pStyle [@w:val='Heading5']][3] / preceding-sibling::w:tbl / w:tr /w:tc)]"; nodeList2 = root.SelectNodes(xpath, nsmgr); foreach (XmlNode isbn2 in nodeList2) { if (isbn2.InnerText != "") { ListeParametresMethodesServiceExterne.Add(isbn2.InnerText.Trim()); } } } return(ListeAParametresServiceExterne(ListeParametresMethodesServiceExterne)); }