public void SetStyleArray(int pos, CT_Style cT_Style) { lock (this) { this.styleField[pos] = cT_Style; } }
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; }
public void AddNewStyle() { CT_Style s = new CT_Style(); styleField.Add(s); }
/** * Set style * @param style */ public void SetStyle(CT_Style style) { this.ctStyle = style; }
public void AddNewStyle() { CT_Style s = new CT_Style(); if (styleField == null) styleField = new List<CT_Style>(); styleField.Add(s); }
/** * constructor * @param style * @param styles */ public XWPFStyle(CT_Style style, XWPFStyles styles) { this.ctStyle = style; this.styles = styles; }
/** * constructor * @param style */ public XWPFStyle(CT_Style style) : this(style, null) { }
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); }
public CT_Style AddNewStyle() { CT_Style s = new CT_Style(); if (styleField == null) styleField = new List<CT_Style>(); styleField.Add(s); return s; }
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)); }