Esempio n. 1
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();
            }
        }
Esempio n. 2
0
        /**
         * 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);
            }
        }
Esempio n. 3
0
 public static CT_Numbering Parse(XmlNode node, XmlNamespaceManager namespaceManager)
 {
     if (node == null)
         return null;
     CT_Numbering ctObj = new CT_Numbering();
     ctObj.numPicBullet = new List<CT_NumPicBullet>();
     ctObj.abstractNum = new List<CT_AbstractNum>();
     ctObj.num = new List<CT_Num>();
     foreach (XmlNode childNode in node.ChildNodes)
     {
         if (childNode.LocalName == "numIdMacAtCleanup")
             ctObj.numIdMacAtCleanup = CT_DecimalNumber.Parse(childNode, namespaceManager);
         else if (childNode.LocalName == "numPicBullet")
             ctObj.numPicBullet.Add(CT_NumPicBullet.Parse(childNode, namespaceManager));
         else if (childNode.LocalName == "abstractNum")
             ctObj.abstractNum.Add(CT_AbstractNum.Parse(childNode, namespaceManager));
         else if (childNode.LocalName == "num")
             ctObj.num.Add(CT_Num.Parse(childNode, namespaceManager));
     }
     return ctObj;
 }
Esempio n. 4
0
 public NumberingDocument(CT_Numbering numbering)
 {
     this.numbering = numbering;
 }
Esempio n. 5
0
 public NumberingDocument()
 {
     numbering = new CT_Numbering();
 }
Esempio n. 6
0
 /**
  * Sets the ctNumbering
  * @param numbering
  */
 public void SetNumbering(CT_Numbering numbering)
 {
     ctNumbering = numbering;
 }
Esempio n. 7
0
 public NumberingDocument(CT_Numbering numbering)
 {
     this.numbering = numbering;
 }
Esempio n. 8
0
        public static NumberingDocument Parse(Stream stream)
        {
            CT_Numbering obj = (CT_Numbering)serializer.Deserialize(stream);

            return(new NumberingDocument(obj));
        }
Esempio n. 9
0
 public NumberingDocument()
 {
     numbering = new CT_Numbering();
 }
Esempio n. 10
0
        public static NumberingDocument Parse(XmlDocument doc, XmlNamespaceManager NameSpaceManager)
        {
            CT_Numbering obj = CT_Numbering.Parse(doc.DocumentElement, NameSpaceManager);

            return(new NumberingDocument(obj));
        }