本文整理汇总了C#中NPOI.XWPF.UserModel.XWPFRun.SetText方法的典型用法代码示例。如果您正苦于以下问题:C# XWPFRun.SetText方法的具体用法?C# XWPFRun.SetText怎么用?C# XWPFRun.SetText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NPOI.XWPF.UserModel.XWPFRun
的用法示例。
在下文中一共展示了XWPFRun.SetText方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestAddPageBreak
public void TestAddPageBreak()
{
ctRun.AddNewT().Value = ("TEST STRING");
ctRun.AddNewBr();
ctRun.AddNewT().Value = ("TEST2 STRING");
CT_Br breac = ctRun.AddNewBr();
breac.clear = (ST_BrClear.left);
ctRun.AddNewT().Value = ("TEST3 STRING");
Assert.AreEqual(2, ctRun.SizeOfBrArray());
XWPFRun run = new XWPFRun(new CT_R(), p);
run.SetText("TEXT1");
run.AddBreak();
run.SetText("TEXT2");
run.AddBreak(BreakType.TEXTWRAPPING);
Assert.AreEqual(2, run.GetCTR().SizeOfBrArray());
}
示例2: TestAddCarriageReturn
public void TestAddCarriageReturn()
{
ctRun.AddNewT().Value = ("TEST STRING");
ctRun.AddNewCr();
ctRun.AddNewT().Value = ("TEST2 STRING");
ctRun.AddNewCr();
ctRun.AddNewT().Value = ("TEST3 STRING");
Assert.AreEqual(2, ctRun.SizeOfCrArray());
XWPFRun run = new XWPFRun(new CT_R(), p);
run.SetText("T1");
run.AddCarriageReturn();
run.AddCarriageReturn();
run.SetText("T2");
run.AddCarriageReturn();
Assert.AreEqual(3, run.GetCTR().GetCrList().Count);
}
示例3: TestSetGetText
public void TestSetGetText()
{
ctRun.AddNewT().Value = ("TEST STRING");
ctRun.AddNewT().Value = ("TEST2 STRING");
ctRun.AddNewT().Value = ("TEST3 STRING");
Assert.AreEqual(3, ctRun.SizeOfTArray());
XWPFRun run = new XWPFRun(ctRun, p);
Assert.AreEqual("TEST2 STRING", run.GetText(1));
run.SetText("NEW STRING", 0);
Assert.AreEqual("NEW STRING", run.GetText(0));
//Run.Text=("xxx",14);
//Assert.Fail("Position wrong");
}
示例4: TestAddTabsAndLineBreaks
public void TestAddTabsAndLineBreaks()
{
ctRun.AddNewT().Value=("TEST STRING");
ctRun.AddNewCr();
ctRun.AddNewT().Value = (/*setter*/"TEST2 STRING");
ctRun.AddNewTab();
ctRun.AddNewT().Value = (/*setter*/"TEST3 STRING");
Assert.AreEqual(1, ctRun.SizeOfCrArray());
Assert.AreEqual(1, ctRun.SizeOfTabArray());
XWPFRun run = new XWPFRun(new CT_R(), p);
run.SetText("T1");
run.AddCarriageReturn();
run.SetText("T2");
run.AddTab();
run.SetText("T3");
Assert.AreEqual(1, run.GetCTR().GetCrList().Count);
Assert.AreEqual(1, run.GetCTR().GetTabList().Count);
Assert.AreEqual("T1\nT2\tT3", run.ToString());
}