本文整理汇总了C#中IScrBook.InsertFootnoteAt方法的典型用法代码示例。如果您正苦于以下问题:C# IScrBook.InsertFootnoteAt方法的具体用法?C# IScrBook.InsertFootnoteAt怎么用?C# IScrBook.InsertFootnoteAt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IScrBook
的用法示例。
在下文中一共展示了IScrBook.InsertFootnoteAt方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateTestData
/// ------------------------------------------------------------------------------------
/// <summary>
///
/// </summary>
/// ------------------------------------------------------------------------------------
protected override void CreateTestData()
{
ITsStrFactory strfact = TsStrFactoryClass.Create();
//James
IScrBook book = AddBookToMockedScripture(59, "James");
AddTitleToMockedBook(book, "James");
// James first section
IScrSection section = AddSectionToMockedBook(book);
AddSectionHeadParaToSection(section, "Paul tells people", "Section Head");
IStTxtPara para = AddParaToMockedSectionContent(section, "Paragraph");
AddRunToMockedPara(para, "1", "Chapter Number");
AddRunToMockedPara(para, "1", "Verse Number");
AddRunToMockedPara(para, "and the earth was without form and void and darkness covered the face of the deep", null);
// James section2
IScrSection section2 = AddSectionToMockedBook(book);
AddSectionHeadParaToSection(section2, "Paul tells people more", "Section Head");
IStTxtPara para2 = AddParaToMockedSectionContent(section2, "Paragraph");
AddRunToMockedPara(para2, "2", "Chapter Number");
AddRunToMockedPara(para2, "1", "Verse Number");
AddRunToMockedPara(para2, "paul expounds on the nature of reality", null);
IStTxtPara para3 = AddParaToMockedSectionContent(section2, "Paragraph");
AddRunToMockedPara(para3, "2", "Verse Number");
AddRunToMockedPara(para3, "the existentialists are all wrong", null);
// insert footnotes into para 2 of James
ITsStrBldr jamesBldr = para2.Contents.GetBldr();
int iFootIch = 10;
for (int i = 0; i < 2; i++)
{
IStFootnote foot = book.InsertFootnoteAt(i, jamesBldr, iFootIch);
IScrTxtPara footPara = Cache.ServiceLocator.GetInstance<IScrTxtParaFactory>().CreateWithStyle(
foot, ScrStyleNames.NormalFootnoteParagraph);
footPara.Contents = strfact.MakeString("This is footnote text for footnote " + i.ToString(), Cache.DefaultVernWs);
iFootIch += 20;
}
para2.Contents = jamesBldr.GetString();
//Jude
m_Jude = AddBookToMockedScripture(65, "Jude");
AddTitleToMockedBook(m_Jude, "Jude");
//Jude intro section
IScrSection judeSection = AddSectionToMockedBook(m_Jude);
AddSectionHeadParaToSection(judeSection, "Introduction", "Intro Section Head");
IStTxtPara judePara = AddParaToMockedSectionContent(judeSection, "Intro Paragraph");
AddRunToMockedPara(judePara, "The Letter from Jude was written to warn against" +
" false teachers who claimed to be believers. In this brief letter, which is similar in" +
" content to 2 Peter the writer encourages his readers \u201Cto fight on for the faith which" +
" once and for all God has given to his people.", null);
// Insert BT (in two different writing systems) of intro paragraph
ICmTranslation transEn = AddBtToMockedParagraph(judePara, m_wsEn);
ICmTranslation transDe = AddBtToMockedParagraph(judePara, m_wsDe);
// Jude Scripture section
IScrSection judeSection2 = AddSectionToMockedBook(m_Jude);
AddSectionHeadParaToSection(judeSection2, "First section", "Section Head");
IStTxtPara judePara2 = AddParaToMockedSectionContent(judeSection2, "Paragraph");
AddRunToMockedPara(judePara2, "1", ScrStyleNames.ChapterNumber);
AddRunToMockedPara(judePara2, "1", ScrStyleNames.VerseNumber);
AddRunToMockedPara(judePara2, "This is the first verse", null);
AddRunToMockedPara(judePara2, "2", ScrStyleNames.VerseNumber);
AddRunToMockedPara(judePara2, "This is the second verse", null);
AddRunToMockedPara(judePara2, "3", ScrStyleNames.VerseNumber);
AddRunToMockedPara(judePara2, "This is the third verse", null);
AddRunToMockedPara(judePara2, "4", ScrStyleNames.VerseNumber);
AddRunToMockedPara(judePara2, "This is the fourth verse", null);
// Insert footnotes into para 1 of Jude
ITsStrBldr bldr = judePara.Contents.GetBldr();
iFootIch = 10;
for (int i = 0; i < 4; i++)
{
IStFootnote foot = m_Jude.InsertFootnoteAt(i, bldr, iFootIch);
IScrTxtPara footPara = Cache.ServiceLocator.GetInstance<IScrTxtParaFactory>().CreateWithStyle(
foot, ScrStyleNames.NormalFootnoteParagraph);
footPara.Contents = strfact.MakeString("This is text for footnote " + i.ToString(), Cache.DefaultVernWs);
iFootIch += 30;
// Insert ORC for footnote into BT (in both writing systems)
AddBtFootnote(transEn, i, m_wsEn, foot);
AddBtFootnote(transDe, i, m_wsDe, foot);
}
judePara.Contents = bldr.GetString();
// Insert footnotes into para 2 of Jude
bldr = judePara2.Contents.GetBldr();
iFootIch = 10;
for (int i = 0; i < 4; i++)
{
IStFootnote foot = m_Jude.InsertFootnoteAt(i + 4, bldr, iFootIch);
IScrTxtPara footPara = Cache.ServiceLocator.GetInstance<IScrTxtParaFactory>().CreateWithStyle(
foot, ScrStyleNames.NormalFootnoteParagraph);
footPara.Contents = strfact.MakeString("This is text for footnote " + (i+4).ToString(), Cache.DefaultVernWs);
//.........这里部分代码省略.........