예제 #1
0
파일: Styles.cs 프로젝트: xoposhiy/npoi
 public void SetStyleArray(int pos, CT_Style cT_Style)
 {
     lock (this)
     {
         this.styleField[pos] = cT_Style;
     }
 }
예제 #2
0
파일: Styles.cs 프로젝트: kahinke/npoi
 public static CT_Style Parse(XmlNode node, XmlNamespaceManager namespaceManager)
 {
     if (node == null)
         return null;
     CT_Style ctObj = new CT_Style();
     if (node.Attributes["w:type"] != null)
         ctObj.type = (ST_StyleType)Enum.Parse(typeof(ST_StyleType), node.Attributes["w:type"].Value);
     ctObj.styleId = XmlHelper.ReadString(node.Attributes["w:styleId"]);
     if (node.Attributes["w:default"] != null)
         ctObj.@default = (ST_OnOff)Enum.Parse(typeof(ST_OnOff), node.Attributes["w:default"].Value);
     if (node.Attributes["w:customStyle"] != null)
         ctObj.customStyle = (ST_OnOff)Enum.Parse(typeof(ST_OnOff), node.Attributes["w:customStyle"].Value);
     ctObj.tblStylePr = new List<CT_TblStylePr>();
     foreach (XmlNode childNode in node.ChildNodes)
     {
         if (childNode.LocalName == "name")
             ctObj.name = CT_String.Parse(childNode, namespaceManager);
         else if (childNode.LocalName == "aliases")
             ctObj.aliases = CT_String.Parse(childNode, namespaceManager);
         else if (childNode.LocalName == "basedOn")
             ctObj.basedOn = CT_String.Parse(childNode, namespaceManager);
         else if (childNode.LocalName == "next")
             ctObj.next = CT_String.Parse(childNode, namespaceManager);
         else if (childNode.LocalName == "link")
             ctObj.link = CT_String.Parse(childNode, namespaceManager);
         else if (childNode.LocalName == "autoRedefine")
             ctObj.autoRedefine = CT_OnOff.Parse(childNode, namespaceManager);
         else if (childNode.LocalName == "hidden")
             ctObj.hidden = CT_OnOff.Parse(childNode, namespaceManager);
         else if (childNode.LocalName == "uiPriority")
             ctObj.uiPriority = CT_DecimalNumber.Parse(childNode, namespaceManager);
         else if (childNode.LocalName == "semiHidden")
             ctObj.semiHidden = CT_OnOff.Parse(childNode, namespaceManager);
         else if (childNode.LocalName == "unhideWhenUsed")
             ctObj.unhideWhenUsed = CT_OnOff.Parse(childNode, namespaceManager);
         else if (childNode.LocalName == "qFormat")
             ctObj.qFormat = CT_OnOff.Parse(childNode, namespaceManager);
         else if (childNode.LocalName == "locked")
             ctObj.locked = CT_OnOff.Parse(childNode, namespaceManager);
         else if (childNode.LocalName == "personal")
             ctObj.personal = CT_OnOff.Parse(childNode, namespaceManager);
         else if (childNode.LocalName == "personalCompose")
             ctObj.personalCompose = CT_OnOff.Parse(childNode, namespaceManager);
         else if (childNode.LocalName == "personalReply")
             ctObj.personalReply = CT_OnOff.Parse(childNode, namespaceManager);
         else if (childNode.LocalName == "rsid")
             ctObj.rsid = CT_LongHexNumber.Parse(childNode, namespaceManager);
         else if (childNode.LocalName == "pPr")
             ctObj.pPr = CT_PPr.Parse(childNode, namespaceManager);
         else if (childNode.LocalName == "rPr")
             ctObj.rPr = CT_RPr.Parse(childNode, namespaceManager);
         else if (childNode.LocalName == "tblPr")
             ctObj.tblPr = CT_TblPrBase.Parse(childNode, namespaceManager);
         else if (childNode.LocalName == "trPr")
             ctObj.trPr = CT_TrPr.Parse(childNode, namespaceManager);
         else if (childNode.LocalName == "tcPr")
             ctObj.tcPr = CT_TcPr.Parse(childNode, namespaceManager);
         else if (childNode.LocalName == "tblStylePr")
             ctObj.tblStylePr.Add(CT_TblStylePr.Parse(childNode, namespaceManager));
     }
     return ctObj;
 }
예제 #3
0
파일: Styles.cs 프로젝트: xoposhiy/npoi
 public void AddNewStyle()
 {
     CT_Style s = new CT_Style();
     styleField.Add(s);
 }
예제 #4
0
파일: XWPFStyle.cs 프로젝트: xoposhiy/npoi
 /**
  * Set style
  * @param style		
  */
 public void SetStyle(CT_Style style)
 {
     this.ctStyle = style;
 }
예제 #5
0
파일: Styles.cs 프로젝트: kahinke/npoi
 public void AddNewStyle()
 {
     CT_Style s = new CT_Style();
     if (styleField == null)
         styleField = new List<CT_Style>();
     styleField.Add(s);
 }
예제 #6
0
파일: XWPFStyle.cs 프로젝트: xoposhiy/npoi
 /**
  * constructor
  * @param style
  * @param styles
  */
 public XWPFStyle(CT_Style style, XWPFStyles styles)
 {
     this.ctStyle = style;
     this.styles = styles;
 }
예제 #7
0
파일: XWPFStyle.cs 프로젝트: xoposhiy/npoi
 /**
  * constructor
  * @param style
  */
 public XWPFStyle(CT_Style style)
     : this(style, null)
 {
 }
예제 #8
0
        public void TestType()
        {
            CT_Style ctStyle = new CT_Style();
            XWPFStyle style = new XWPFStyle(ctStyle);

			style.StyleType = ST_StyleType.paragraph;
            Assert.AreEqual(ST_StyleType.paragraph, style.StyleType);
        }
예제 #9
0
파일: Styles.cs 프로젝트: age-soft/npoi
 public CT_Style AddNewStyle()
 {
     CT_Style s = new CT_Style();
     if (styleField == null)
         styleField = new List<CT_Style>();
     styleField.Add(s);
     return s;
 }
예제 #10
-1
        public void TestAddStylesToDocument()
        {
            XWPFDocument docOut = new XWPFDocument();
            XWPFStyles styles = docOut.CreateStyles();

            String strStyleName = "headline1";
            CT_Style ctStyle = new CT_Style();

            ctStyle.styleId = (strStyleName);
            XWPFStyle s = new XWPFStyle(ctStyle);
            styles.AddStyle(s);

            XWPFDocument docIn = XWPFTestDataSamples.WriteOutAndReadBack(docOut);

            styles = docIn.GetStyles();
            Assert.IsTrue(styles.StyleExist(strStyleName));
        }