本文整理汇总了C#中CT_Tbl.GetTrArray方法的典型用法代码示例。如果您正苦于以下问题:C# CT_Tbl.GetTrArray方法的具体用法?C# CT_Tbl.GetTrArray怎么用?C# CT_Tbl.GetTrArray使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CT_Tbl
的用法示例。
在下文中一共展示了CT_Tbl.GetTrArray方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestCreateRow
public void TestCreateRow()
{
XWPFDocument doc = new XWPFDocument();
CT_Tbl table = new CT_Tbl();
CT_Row r1 = table.AddNewTr();
r1.AddNewTc().AddNewP();
r1.AddNewTc().AddNewP();
CT_Row r2 = table.AddNewTr();
r2.AddNewTc().AddNewP();
r2.AddNewTc().AddNewP();
CT_Row r3 = table.AddNewTr();
r3.AddNewTc().AddNewP();
r3.AddNewTc().AddNewP();
XWPFTable xtab = new XWPFTable(table, doc);
Assert.AreEqual(3, xtab.GetNumberOfRows());
Assert.IsNotNull(xtab.GetRow(2));
//add a new row
xtab.CreateRow();
Assert.AreEqual(4, xtab.GetNumberOfRows());
//check number of cols
Assert.AreEqual(2, table.GetTrArray(0).SizeOfTcArray());
//check creation of first row
xtab = new XWPFTable(new CT_Tbl(), doc);
Assert.AreEqual(1, xtab.GetCTTbl().GetTrArray(0).SizeOfTcArray());
}
示例2: TestConstructor
public void TestConstructor()
{
XWPFDocument doc = new XWPFDocument();
CT_Tbl ctTable = new CT_Tbl();
XWPFTable xtab = new XWPFTable(ctTable, doc);
Assert.IsNotNull(xtab);
Assert.AreEqual(1, ctTable.SizeOfTrArray());
Assert.AreEqual(1, ctTable.GetTrArray(0).SizeOfTcArray());
Assert.IsNotNull(ctTable.GetTrArray(0).GetTcArray(0).GetPArray(0));
ctTable = new CT_Tbl();
xtab = new XWPFTable(ctTable, doc, 3, 2);
Assert.IsNotNull(xtab);
Assert.AreEqual(3, ctTable.SizeOfTrArray());
Assert.AreEqual(2, ctTable.GetTrArray(0).SizeOfTcArray());
Assert.IsNotNull(ctTable.GetTrArray(0).GetTcArray(0).GetPArray(0));
}