コード例 #1
0
        protected virtual void GetCopyOfTable(IWordDocumentTable sourceTable)
        {
            var newTable = (Table)sourceTable.GetCopy().Table;

            XmlElement.AppendChild(newTable);
            Tables.Add(new WordDocumentTable(Doc, newTable));
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        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);
        }
コード例 #5
0
 public WordDocumentTableCell(IWordDocumentTable table)
 {
     Table = (Table)table.Table;
 }
コード例 #6
0
 public WordDocumentTableRows(IWordDocumentTable table)
 {
     Table = (Table)table.Table;
 }