protected virtual void GetCopyOfTable(IWordDocumentTable sourceTable) { var newTable = (Table)sourceTable.GetCopy().Table; XmlElement.AppendChild(newTable); Tables.Add(new WordDocumentTable(Doc, newTable)); }
public IWordDocumentTable Add(IWordDocumentTable table) { if (string.IsNullOrEmpty(table.Name)) { return(null); } IWordDocumentTable tbl; if (Items.TryGetValue(table.Name, out tbl)) { return(null); } Items.Add(table.Name, table); return(table); }
private bool TryGetTable(string name, out IWordDocumentTable table) { IWordDocumentTable tbl; if (Items.TryGetValue(name, out tbl)) { table = tbl; return(true); } tbl = GetTable(name); if (tbl != null) { Items.Add(tbl.Name, tbl); table = tbl; return(true); } table = null; return(false); }
private void CopyTableToBookmark(IWordDocumentTable sourceTable) { var parentPara = (Paragraph)BkmEnd.Parent.ElementsBefore().LastOrDefault(e => e.GetType() == typeof(Paragraph)); SiblingElement = parentPara; BkmEnd.Parent.Remove(); Table = null; BkmStart = new BookmarkStart { Name = BkmStart.Name, Id = BkmStart.Id }; BkmEnd = new BookmarkEnd { Id = BkmStart.Id }; var newTable = (Table)sourceTable.GetCopy().Table; InsertXmlELement(newTable); newTable.GetFirstChild <TableRow>().GetFirstChild <TableCell>().Append(BkmStart); newTable.AppendChild(BkmEnd); Table = new WordDocumentTable(Doc, newTable); }
public WordDocumentTableCell(IWordDocumentTable table) { Table = (Table)table.Table; }
public WordDocumentTableRows(IWordDocumentTable table) { Table = (Table)table.Table; }