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



            if (MethodeRegistre.NombreMethodesRegistres(doc, nsmgr, i) != 0)
            {
                string xpath = @"// w:p [ w:pPr / w:pStyle [@w:val='Heading1']][4] /following:: w:p [ w:pPr / w:pStyle [@w:val='Heading2']][3] /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']][4] /following:: w:p [ w:pPr / w:pStyle [@w:val='Heading2']][3] /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']][4] /following:: w:p [ w:pPr / w:pStyle [@w:val='Heading2']][3] /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)
                {
                    ListeTypeRetourRegistres.Add(isbn2.InnerText);
                }
                if (ListeTypeRetourRegistres.Count < 4)
                {
                    return(null);
                }
            }


            return(new TypeRetourRegistre(ListeTypeRetourRegistres[2], ListeTypeRetourRegistres[3]));
        }
Example #2
0
        /// <summary>
        /// Retourne la liste des registre du fichier
        /// </summary>
        /// <param name="doc"></param>
        /// <param name="nsmgr"></param>
        /// <returns></returns>
        public static List <Registre> Registres(XmlDocument doc, XmlNamespaceManager nsmgr)
        {
            List <Registre> registres = new List <Registre>();
            List <string>   noms      = NomsRegistres(doc, nsmgr);

            var i = 1;

            for (i = 1; i < NomsRegistres(doc, nsmgr).Count + 1; i++)
            {
                string interfacesImplementees   = InterfacesImplementeesRegistres(doc, nsmgr, i);
                List <MethodeRegistre> methodes = MethodeRegistre.MethodesRegistres(doc, nsmgr, i);
                string descriptions             = DescriptionsRegistres(doc, nsmgr, i);

                if (MethodeRegistre.NombreMethodesRegistres(doc, nsmgr, i) != 0)
                {
                    registres.Add(new Registre(noms[i - 1], descriptions, interfacesImplementees, methodes));
                }

                if (MethodeRegistre.NombreMethodesRegistres(doc, nsmgr, i) == 0)
                {
                    registres.Add(new Registre(noms[i - 1], descriptions, interfacesImplementees));
                }
            }
            return(registres);
        }