public virtual Table InsertTableAfterSelf(int rowCount, int columnCount) { XElement newTable = HelperFunctions.CreateTable(rowCount, columnCount); Xml.AddAfterSelf(newTable); XElement newlyInserted = Xml.ElementsAfterSelf().First(); return(new Table(Document, newlyInserted)); }
public virtual Table InsertTableAfterSelf(Table t) { Xml.AddAfterSelf(t.Xml); XElement newlyInserted = Xml.ElementsAfterSelf().First(); //Dmitchern return(new Table(Document, newlyInserted)); //return new table, dont affect parameter table //t.Xml = newlyInserted; //return t; }
public virtual Table InsertTableAfterSelf(int rowCount, int columnCount) { var newTable = HelperFunctions.CreateTable(rowCount, columnCount); Xml.AddAfterSelf(newTable); var newlyInserted = this.Xml.ElementsAfterSelf().First(); var table = new Table(this.Document, newlyInserted); table.PackagePart = this.PackagePart; return(table); }
public virtual Paragraph InsertParagraphAfterSelf(Paragraph p) { Xml.AddAfterSelf(p.Xml); XElement newlyInserted = Xml.ElementsAfterSelf().First(); //Dmitchern if (this as Paragraph != null) { return(new Paragraph(Document, newlyInserted, (this as Paragraph)._endIndex)); } p.Xml = newlyInserted; //IMPORTANT: I think we have return new paragraph in any case, but I dont know what to put as startIndex parameter into Paragraph constructor return(p); }
public virtual void InsertPageBreakAfterSelf() { XElement p = new XElement ( XName.Get("p", DocX.w.NamespaceName), new XElement ( XName.Get("r", DocX.w.NamespaceName), new XElement ( XName.Get("br", DocX.w.NamespaceName), new XAttribute(XName.Get("type", DocX.w.NamespaceName), "page") ) ) ); Xml.AddAfterSelf(p); }
public virtual Paragraph InsertParagraphAfterSelf(string text, bool trackChanges, Formatting formatting) { XElement newParagraph = new XElement ( XName.Get("p", DocX.w.NamespaceName), new XElement(XName.Get("pPr", DocX.w.NamespaceName)), HelperFunctions.FormatInput(text, formatting.Xml) ); if (trackChanges) { newParagraph = Paragraph.CreateEdit(EditType.ins, DateTime.Now, newParagraph); } Xml.AddAfterSelf(newParagraph); XElement newlyInserted = Xml.ElementsAfterSelf().First(); Paragraph p = new Paragraph(Document, newlyInserted, -1); return(p); }