ApiExamples.ExTableColumn.RemoveColumnFromTable C# (CSharp) Метод

RemoveColumnFromTable() приватный Метод

private RemoveColumnFromTable ( ) : void
Результат void
        public void RemoveColumnFromTable()
        {
            //ExStart
            //ExId:RemoveTableColumn
            //ExSummary:Shows how to remove a column from a table in a document.
            Document doc = new Document(MyDir + "Table.Document.doc");
            Table table = (Table)doc.GetChild(NodeType.Table, 1, true);

            // Get the third column from the table and remove it.
            Column column = Column.FromIndex(table, 2);
            column.Remove();
            //ExEnd

            doc.Save(MyDir + @"\Artifacts\Table.RemoveColumn.doc");

            Assert.AreEqual(16, table.GetChildNodes(NodeType.Cell, true).Count);
            Assert.AreEqual("Cell 3 contents", table.Rows[2].Cells[2].ToString(SaveFormat.Text).Trim());
            Assert.AreEqual("Cell 3 contents", table.LastRow.Cells[2].ToString(SaveFormat.Text).Trim());
        }