Esempio n. 1
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);
        }
Esempio n. 2
0
        /// <summary>
        /// retourne la liste des parametres des methodes des registres
        /// </summary>
        /// <param name="doc"></param>
        /// <param name="nsmgr"></param>
        /// <returns></returns>
        public static List <ParametreRegistre> ParametresMethodesEntites(XmlDocument doc, XmlNamespaceManager nsmgr, int i, int cmp)
        {
            XmlNodeList   nodeList2;
            XmlElement    root = doc.DocumentElement;
            List <string> ListeParametresMethodesRegistres = 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']][2]/ 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']][3] / 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']][3] / preceding-sibling::w:tbl / w:tr /w:tc)]";


                nodeList2 = root.SelectNodes(xpath, nsmgr);

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

            return(ListeAParametresRegistre(ListeParametresMethodesRegistres));
        }