示例#1
0
        /// <summary>
        /// Methode qui renvoie la liste des colonnes des types de retour des methodes des services
        /// </summary>
        /// <param name="doc"></param>
        /// <param name="nsmgr"></param>
        /// <returns></returns>
        public static TypeRetourService TypeRetourMethodesServices(XmlDocument doc, XmlNamespaceManager nsmgr, int i, int cmp)
        {
            XmlNodeList   nodeList2;
            XmlElement    root = doc.DocumentElement;
            List <string> ListeTypeRetourServices = new List <string>();

            if (MethodeService.NombreMethodesServices(doc, nsmgr, i) != 0)
            {
                string xpath = @"// w:p [ w:pPr / w:pStyle [@w:val='Heading1']][6] /following:: w:p [ w:pPr / w:pStyle [@w:val='Heading2']][1] /following:: w:p [ w:pPr / w:pStyle [@w:val='Heading3']][" + i + "]/following:: w:p [ w:pPr / w:pStyle [@w:val='Heading4']][3]/following:: w:p [ w:pPr / w:pStyle [@w:val='Heading5']][" + (cmp + 1) + "]/following:: w:p [ w:pPr / w:pStyle [@w:val='Heading6']][3]/ following-sibling::w:tbl / w:tr /w:tc  [count(. | // w:p [ w:pPr / w:pStyle [@w:val='Heading1']][6] /following:: w:p [ w:pPr / w:pStyle [@w:val='Heading2']][1] /following:: w:p [ w:pPr / w:pStyle [@w:val='Heading3']][" + i + "]/following:: w:p [ w:pPr / w:pStyle [@w:val='Heading4']][3]/following:: w:p [ w:pPr / w:pStyle [@w:val='Heading5']][" + (cmp + 1) + "]/following:: w:p [ w:pPr / w:pStyle [@w:val='Heading6']][4]/preceding-sibling:: w:tbl / w:tr /w:tc )= count(// w:p [ w:pPr / w:pStyle [@w:val='Heading1']][6] /following:: w:p [ w:pPr / w:pStyle [@w:val='Heading2']][1] /following:: w:p [ w:pPr / w:pStyle [@w:val='Heading3']][" + i + "]/following:: w:p [ w:pPr / w:pStyle [@w:val='Heading4']][3]/following:: w:p [ w:pPr / w:pStyle [@w:val='Heading5']][" + (cmp + 1) + "]/following:: w:p [ w:pPr / w:pStyle [@w:val='Heading6']][4]/preceding-sibling:: w:tbl / w:tr /w:tc)]";


                nodeList2 = root.SelectNodes(xpath, nsmgr);

                foreach (XmlNode isbn2 in nodeList2)
                {
                    ListeTypeRetourServices.Add(isbn2.InnerText);
                }
            }
            if (ListeTypeRetourServices.Count < 4)
            {
                return(null);
            }


            return(new TypeRetourService(ListeTypeRetourServices[2], ListeTypeRetourServices[3]));
        }
示例#2
0
        /// <summary>
        /// Retourne la liste des services du fichier
        /// </summary>
        /// <param name="doc"></param>
        /// <param name="nsmgr"></param>
        /// <returns></returns>
        public static List <Service> Services(XmlDocument doc, XmlNamespaceManager nsmgr)
        {
            List <Service> services = new List <Service>();
            List <string>  noms     = NomsServices(doc, nsmgr);


            for (int i = 1; i < NomsServices(doc, nsmgr).Count + 1; i++)
            {
                List <MethodeService> methodes = MethodeService.MethodesServices(doc, nsmgr, i);
                string descriptions            = DescriptionsService(doc, nsmgr, i);
                string interfacesImplementees  = InterfacesImplementeesServices(doc, nsmgr, i);


                if (MethodeService.NombreMethodesServices(doc, nsmgr, i) != 0)
                {
                    services.Add(new Service(noms[i - 1], descriptions, interfacesImplementees, methodes));
                }

                if (MethodeService.NombreMethodesServices(doc, nsmgr, i) == 0)
                {
                    services.Add(new Service(noms[i - 1], descriptions, interfacesImplementees));
                }
            }
            return(services);
        }