private void AddRepeatSectoin(WordGroupDef wordDoc, XmlNode node) { var dataSetAttr = node.Attributes != null ? node.Attributes["dataset"] : null; var dataSet = dataSetAttr != null ? _dataSets[dataSetAttr.Value] : _dataSets.First().Value; var reset = node.Attributes != null && node.Attributes["reset"] != null; var oldStyle = new ContentStyle(_style); try { SetSectionStyle(node); var section = new WordRepeatSectionDef(dataSet) { Style = _style }; wordDoc.AddItem(section); _dataSetStack.Push(dataSet); try { section.ResetDatas = reset; BuildSections(section, node); } finally { _dataSetStack.Pop(); } } finally { _style.Assign(oldStyle); } }
public WordRepeatSectionDef AddRepeatSection(DataSet dataSet, ContentStyle style = null) { var result = new WordRepeatSectionDef(dataSet); AddItem(result); if (style != null) { result.Style = style; } return(result); }