コード例 #1
0
ファイル: XWPFNumbering.cs プロジェクト: zzy092/npoi
        /**
         * add a new number to the numbering document
         * @param num
         */
        public string AddNum(XWPFNum num)
        {
            ctNumbering.AddNewNum();
            int pos = (ctNumbering.GetNumList().Count) - 1;

            ctNumbering.SetNumArray(pos, num.GetCTNum());
            nums.Add(num);
            return(num.GetCTNum().numId);
        }
コード例 #2
0
ファイル: XWPFNumbering.cs プロジェクト: hiodava/Romero
        /**
         * read numbering form an existing package
         */

        internal override void OnDocumentRead()
        {
            NumberingDocument numberingDoc = null;

            XmlDocument doc = ConvertStreamToXml(GetPackagePart().GetInputStream());

            try {
                numberingDoc = NumberingDocument.Parse(doc, NamespaceManager);
                ctNumbering  = numberingDoc.Numbering;
                //get any Nums
                foreach (CT_Num ctNum in ctNumbering.GetNumList())
                {
                    nums.Add(new XWPFNum(ctNum, this));
                }
                foreach (CT_AbstractNum ctAbstractNum in ctNumbering.GetAbstractNumList())
                {
                    abstractNums.Add(new XWPFAbstractNum(ctAbstractNum, this));
                }
                isNew = false;
            } catch (Exception e) {
                throw new POIXMLException(e);
            }
        }
コード例 #3
0
ファイル: XWPFNumbering.cs プロジェクト: PeteGunterES/NPOI
        /**
         * read numbering form an existing package
         */

        internal override void OnDocumentRead()
        {
            NumberingDocument numberingDoc = null;

            XmlDocument doc = ConvertStreamToXml(GetPackagePart().GetInputStream());

            try {
                numberingDoc = NumberingDocument.Parse(doc, NamespaceManager);
                ctNumbering  = numberingDoc.Numbering;
                //get any Nums
                foreach (CT_Num ctNum in ctNumbering.GetNumList())
                {
                    nums.Add(new XWPFNum(ctNum, this));
                }
                foreach (CT_AbstractNum ctAbstractNum in ctNumbering.GetAbstractNumList())
                {
                    abstractNums.Add(new XWPFAbstractNum(ctAbstractNum, this));
                }
                //isNew = false; //ElectricSquare: The field 'XWPFNumbering.isNew' is assigned but its value is never used
            } catch (Exception e) {
                throw new POIXMLException(e);
            }
        }
コード例 #4
0
        /**
         * read numbering form an existing package
         */

        internal override void OnDocumentRead()
        {
            NumberingDocument numberingDoc = null;
            Stream            is1;

            is1 = GetPackagePart().GetInputStream();
            try {
                numberingDoc = NumberingDocument.Parse(is1);
                ctNumbering  = numberingDoc.Numbering;
                //get any Nums
                foreach (CT_Num ctNum in ctNumbering.GetNumList())
                {
                    nums.Add(new XWPFNum(ctNum, this));
                }
                foreach (CT_AbstractNum ctAbstractNum in ctNumbering.GetAbstractNumList())
                {
                    abstractNums.Add(new XWPFAbstractNum(ctAbstractNum, this));
                }
                isNew = false;
            } catch (Exception) {
                throw new POIXMLException();
            }
        }