本文整理汇总了C#中IStTxtPara类的典型用法代码示例。如果您正苦于以下问题:C# IStTxtPara类的具体用法?C# IStTxtPara怎么用?C# IStTxtPara使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IStTxtPara类属于命名空间,在下文中一共展示了IStTxtPara类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: XmlNotePara
/// ------------------------------------------------------------------------------------
/// <summary>
/// Initializes a new instance of the <see cref="XmlNotePara"/> class based on the given
/// StTxtPara.
/// </summary>
/// <param name="stTxtPara">The FDO paragraph.</param>
/// <param name="wsDefault">The default (analysis) writing system.</param>
/// <param name="lgwsf">The writing system factory.</param>
/// ------------------------------------------------------------------------------------
public XmlNotePara(IStTxtPara stTxtPara, int wsDefault, ILgWritingSystemFactory lgwsf)
{
// REVIEW: Ask TomB about this. The only paragraph style allowed in
// TE for notes is "Remark" so is it necessary to write it to the XML?
// It causes a problem for the OXES validator.
//StyleName = stTxtPara.StyleName;
ITsString tssParaContents = stTxtPara.Contents;
if (tssParaContents.RunCount == 0)
return;
int dummy;
int wsFirstRun = tssParaContents.get_Properties(0).GetIntPropValues(
(int)FwTextPropType.ktptWs, out dummy);
//if (wsFirstRun != wsDefault)
IcuLocale = lgwsf.GetStrFromWs(wsFirstRun);
for (int iRun = 0; iRun < tssParaContents.RunCount; iRun++)
{
ITsTextProps props = tssParaContents.get_Properties(iRun);
string text = tssParaContents.get_RunText(iRun);
if (TsStringUtils.IsHyperlink(props))
Runs.Add(new XmlHyperlinkRun(wsFirstRun, lgwsf, text, props));
else
Runs.Add(new XmlTextRun(wsFirstRun, lgwsf, text, props));
}
}
示例2: DoSetupFixture
/// <summary>
/// non-undoable task
/// </summary>
private void DoSetupFixture()
{
var textFactory = Cache.ServiceLocator.GetInstance<ITextFactory>();
var stTextFactory = Cache.ServiceLocator.GetInstance<IStTextFactory>();
m_text = textFactory.Create();
//Cache.LangProject.TextsOC.Add(m_text);
m_stText = stTextFactory.Create();
m_text.ContentsOA = m_stText;
m_para0 = m_stText.AddNewTextPara(null);
m_para0.Contents = TsStringUtils.MakeTss("Xxxhope xxxthis xxxwill xxxdo. xxxI xxxhope.", Cache.DefaultVernWs);
m_para1 = m_stText.AddNewTextPara(null);
m_para1.Contents = TsStringUtils.MakeTss("Xxxcertain xxxto xxxcatch xxxa xxxfrog. xxxCertainly xxxcan. xxxOn xxxLake xxxMonroe.", Cache.DefaultVernWs);
m_para2 = null;
using (ParagraphParser pp = new ParagraphParser(Cache))
foreach (IStTxtPara para in m_stText.ParagraphsOS)
pp.Parse(para);
m_expectedAnOcs = new List<AnalysisOccurrence>();
foreach (IStTxtPara para in m_stText.ParagraphsOS)
foreach (ISegment seg in para.SegmentsOS)
for (int i = 0; i < seg.AnalysesRS.Count; i++)
m_expectedAnOcs.Add(new AnalysisOccurrence(seg, i));
m_expectedAnOcsPara0 = new List<AnalysisOccurrence>();
foreach (ISegment seg in m_para0.SegmentsOS)
for (int i = 0; i < seg.AnalysesRS.Count; i++)
m_expectedAnOcsPara0.Add(new AnalysisOccurrence(seg, i));
}
示例3: BtConverter
/// ------------------------------------------------------------------------------------
/// <summary>
/// Make one for converting the specified paragraph.
/// </summary>
/// <param name="para">The paragraph.</param>
/// <param name="wsBt">The writing system for which to do the conversion.</param>
/// ------------------------------------------------------------------------------------
private BtConverter(IStTxtPara para, int wsBt)
{
m_para = para;
m_cache = para.Cache;
m_cpe = m_cache.ServiceLocator.UnicodeCharProps;
m_scr = para.Cache.LangProject.TranslatedScriptureOA;
m_wsBt = wsBt;
}
示例4: FdoParaToLfPara
/// <summary>
/// Make an LfParagraph object from an FDO StTxtPara.
/// </summary>
/// <returns>The LFParagraph.</returns>
/// <param name="fdoPara">FDO StTxtPara object to convert.</param>
public static LfParagraph FdoParaToLfPara(IStTxtPara fdoPara, ILgWritingSystemFactory wsf)
{
var lfPara = new LfParagraph();
lfPara.Guid = fdoPara.Guid;
lfPara.StyleName = fdoPara.StyleName;
lfPara.Content = ConvertFdoToMongoTsStrings.TextFromTsString(fdoPara.Contents, wsf);
return lfPara;
}
示例5: BtConverter
/// <summary>
/// Make one for converting the specified paragraph.
/// </summary>
/// <param name="para"></param>
public BtConverter(IStTxtPara para)
{
m_para = para;
m_cache = para.Cache;
kflidFT = StTxtPara.SegmentFreeTranslationFlid(m_cache);
kflidSegments = StTxtPara.SegmentsFlid(m_cache);
m_cpe = m_cache.LanguageWritingSystemFactoryAccessor.UnicodeCharProps;
m_scr = para.Cache.LangProject.TranslatedScriptureOA;
}
示例6: FixtureSetupInternal
private void FixtureSetupInternal()
{
// Setup default analysis ws
m_wsEn = Cache.ServiceLocator.WritingSystemManager.Get("en").Handle;
m_text = Cache.ServiceLocator.GetInstance<ITextFactory>().Create();
//Cache.LangProject.TextsOC.Add(m_text);
Cache.LangProject.TranslatedScriptureOA = Cache.ServiceLocator.GetInstance<IScriptureFactory>().Create();
m_para = Cache.ServiceLocator.GetInstance<IStTxtParaFactory>().Create();
IStText text = Cache.ServiceLocator.GetInstance<IStTextFactory>().Create();
m_text.ContentsOA = text;
text.ParagraphsOS.Add(m_para);
}
示例7: GetParaAnalyses
private static AnalysisOccurrence[] GetParaAnalyses(IStTxtPara para)
{
var result = new List<AnalysisOccurrence>();
var point1 = new AnalysisOccurrence(para.SegmentsOS[0], 0);
if (!point1.IsValid)
return result.ToArray();
do
{
if (point1.HasWordform)
result.Add(point1);
point1 = point1.NextWordform();
} while (point1 != null && point1.IsValid);
return result.ToArray();
}
示例8: Initialize
public override void Initialize()
{
CheckDisposed();
base.Initialize();
//m_inMemoryCache.InitializeAnnotationDefs();
InstallVirtuals(@"Language Explorer\Configuration\Words\AreaConfiguration.xml",
new string[] { "SIL.FieldWorks.IText.ParagraphSegmentsVirtualHandler", "SIL.FieldWorks.IText.OccurrencesInTextsVirtualHandler" });
m_wsVern = Cache.DefaultVernWs;
m_wsTrans = Cache.DefaultAnalWs;
m_text = new Text();
Cache.LangProject.TextsOC.Add(m_text);
m_para = new StTxtPara();
StText text = new StText();
m_text.ContentsOA = text;
text.ParagraphsOS.Append(m_para);
m_trans = new CmTranslation();
m_para.TranslationsOC.Add(m_trans);
kflidFT = StTxtPara.SegmentFreeTranslationFlid(Cache);
kflidSegments = StTxtPara.SegmentsFlid(Cache);
m_btPoss = Cache.LangProject.TranslationTagsOA.LookupPossibilityByGuid(
LangProject.kguidTranBackTranslation);
m_trans.TypeRA = m_btPoss;
m_fWasUseScriptDigits = Cache.LangProject.TranslatedScriptureOA.UseScriptDigits;
Cache.LangProject.TranslatedScriptureOA.UseScriptDigits = false;
// do we need to set status?
}
示例9: CreateTestData
/// ------------------------------------------------------------------------------------
/// <summary>
/// Create minimal test data required for every test.
/// </summary>
/// ------------------------------------------------------------------------------------
protected override void CreateTestData()
{
base.CreateTestData();
m_helper = new DiscourseTestHelper(Cache);
m_firstPara = m_helper.FirstPara;
m_stText = m_firstPara.Owner as IStText;
}
示例10: TestTearDown
/// ------------------------------------------------------------------------------------
/// <summary>
/// Override to end the undoable UOW, Undo everything, and 'commit',
/// which will essentially clear out the Redo stack.
/// </summary>
/// ------------------------------------------------------------------------------------
public override void TestTearDown()
{
m_philemon = null;
m_section = null;
m_para = null;
base.TestTearDown();
}
示例11: TestSetup
/// <summary>
///
/// </summary>
public override void TestSetup()
{
base.TestSetup();
m_wsVern = Cache.DefaultVernWs;
m_wsTrans = Cache.DefaultAnalWs;
m_book = Cache.ServiceLocator.GetInstance<IScrBookFactory>().Create(1);
m_section = Cache.ServiceLocator.GetInstance<IScrSectionFactory>().Create();
m_book.SectionsOS.Add(m_section);
m_section.ContentOA = m_text = Cache.ServiceLocator.GetInstance<IStTextFactory>().Create(); ;
m_para = m_text.AddNewTextPara(ScrStyleNames.NormalParagraph);
}
示例12: TestSetup
/// ------------------------------------------------------------------------------------
/// <summary>
/// Override to start an undoable UOW.
/// </summary>
/// ------------------------------------------------------------------------------------
public override void TestSetup()
{
base.TestSetup();
m_editingHelper.m_fUsingMockedSelection = true;
m_philemon = AddBookToMockedScripture(57, "Philemon");
AddTitleToMockedBook(m_philemon, "Philemon");
m_section = AddSectionToMockedBook(m_philemon);
m_para = AddParaToMockedSectionContent(m_section,
ScrStyleNames.NormalParagraph);
AddRunToMockedPara(m_para, "this is text", null);
}
示例13: CreateTestData
/// ------------------------------------------------------------------------------------
/// <summary>
/// Create test data for tests.
/// </summary>
/// ------------------------------------------------------------------------------------
protected override void CreateTestData()
{
m_servloc = Cache.ServiceLocator;
m_text = AddInterlinearTextToLangProj("My Interlinear Text");
m_stTextPara = AddParaToInterlinearTextContents(m_text, "Here is a sentence I can chart.");
m_stText = m_text.ContentsOA;
m_tssFact = Cache.TsStrFactory;
m_rowFact = m_servloc.GetInstance<IConstChartRowFactory>();
m_wordGrpFact = m_servloc.GetInstance<IConstChartWordGroupFactory>();
m_possFact = m_servloc.GetInstance<ICmPossibilityFactory>();
m_wfiFact = m_servloc.GetInstance<IWfiWordformFactory>();
m_mtMrkrFact = m_servloc.GetInstance<IConstChartMovedTextMarkerFactory>();
m_clsMrkrFact = m_servloc.GetInstance<IConstChartClauseMarkerFactory>();
}
示例14: Initialize
public override void Initialize()
{
CheckDisposed();
base.Initialize();
m_inMemoryCache.InitializeAnnotationDefs();
InstallVirtuals(@"Language Explorer\Configuration\Words\AreaConfiguration.xml",
new string[] { "SIL.FieldWorks.IText.ParagraphSegmentsVirtualHandler", "SIL.FieldWorks.IText.OccurrencesInTextsVirtualHandler" });
m_text = new Text();
Cache.LangProject.TextsOC.Add(m_text);
m_para = new StTxtPara();
StText text = new StText();
m_text.ContentsOA = text;
text.ParagraphsOS.Append(m_para);
}
示例15: CreateTestText
/// ------------------------------------------------------------------------------------
/// <summary>
/// Creates a text for testing.
/// </summary>
/// ------------------------------------------------------------------------------------
private void CreateTestText()
{
m_txt = m_servLoc.GetInstance<ITextFactory>().Create();
//Cache.LangProject.TextsOC.Add(m_txt);
m_stTxt = m_servLoc.GetInstance<IStTextFactory>().Create();
m_txt.ContentsOA = m_stTxt;
m_txtPara = m_txt.ContentsOA.AddNewTextPara(null);
// 0 1 2 3 4
// 0123456789012345678901234567890123456789012
// This is a test string for CopyObject tests.
int hvoVernWs = Cache.DefaultVernWs;
m_txtPara.Contents = TsStringUtils.MakeTss("This is a test string for CopyObject tests.", hvoVernWs);
}