本文整理汇总了C#中SILUBS.SharedScrUtils.BCVRef类的典型用法代码示例。如果您正苦于以下问题:C# BCVRef类的具体用法?C# BCVRef怎么用?C# BCVRef使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BCVRef类属于SILUBS.SharedScrUtils命名空间,在下文中一共展示了BCVRef类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: FootnoteHashEntry
/// ------------------------------------------------------------------------------------
/// <summary>
/// Constructor
/// </summary>
/// <param name="startRef">The start reference at the position where the footnote ORC is
/// in the vernacular text</param>
/// <param name="endRef">The end reference at the position where the footnote ORC is in
/// the vernacular text (can be different from start ref because of verse bridges).
/// </param>
/// <param name="hvo">The ID of the paragraph containing the ORC for the footnote. This
/// could also be the last paragraph where it was found if it is in the process of
/// being deleted (in which case ORCs may still exist in the corresponding back
/// translations).</param>
/// ------------------------------------------------------------------------------------
public FootnoteHashEntry(BCVRef startRef, BCVRef endRef, int hvo)
{
m_startRef = new BCVRef(startRef);
m_endRef = new BCVRef(endRef);
m_hvoPara = hvo;
m_fFound = true;
}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:21,代码来源:ScrFootnote.cs
示例2: InsertErrorAnnotation
/// ------------------------------------------------------------------------------------
/// <summary>
/// Insert a new check result annotation at its correct position in the list.
/// </summary>
/// <param name="startRef">beginning reference note refers to</param>
/// <param name="endRef">ending reference note refers to</param>
/// <param name="beginObject">id of beginning object note refers to</param>
/// <param name="endObject">id of ending object note refers to</param>
/// <param name="checkId">The check id.</param>
/// <param name="bldrQuote">Para builder to use for the cited text paragraph</param>
/// <param name="bldrDiscussion">Para builder to use to build the Discussion
/// paragraph</param>
/// <returns>note inserted into annotation list</returns>
/// ------------------------------------------------------------------------------------
public IScrScriptureNote InsertErrorAnnotation(BCVRef startRef, BCVRef endRef,
ICmObject beginObject, ICmObject endObject, Guid checkId,
StTxtParaBldr bldrQuote, StTxtParaBldr bldrDiscussion)
{
return InsertNote(startRef, endRef, beginObject, endObject, checkId, -1,
0, 0, bldrQuote, bldrDiscussion, null, null, GetInsertIndexForRef(startRef));
}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:21,代码来源:ScrScriptureNote.cs
示例3: SendFocusMessage
/// ------------------------------------------------------------------------------------
/// <summary>
/// Notify all Santa Fe windows that a Scripture Reference focus change has occured.
/// </summary>
/// <param name="sRef">The string representation of the reference (e.g. MAT 1:1)</param>
/// ------------------------------------------------------------------------------------
public static void SendFocusMessage(string sRef)
{
BCVRef bcvRef = new BCVRef(sRef);
if (!bcvRef.Valid)
return;
s_SantaFeRefKey.SetValue(null, sRef);
PostMessage(new IntPtr(-1), s_FocusMsg, (uint)FocusTypes.ScriptureReferenceFocus, 0);
}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:14,代码来源:SantaFeFocusMessageHandler.cs
示例4: GetFirstNoteForReference
/// ------------------------------------------------------------------------------------
/// <summary>
/// Get the first annotation in the list that covers the specified reference.
/// </summary>
/// <param name="reference">Scripture reference to seek</param>
/// <returns>The first note for the specified reference, if any; otherwise null</returns>
/// ------------------------------------------------------------------------------------
public IScrScriptureNote GetFirstNoteForReference(BCVRef reference)
{
foreach (IScrScriptureNote note in NotesOS)
{
if (note.BeginRef <= reference && note.EndRef >= reference)
return note;
}
return null;
}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:16,代码来源:ScrScriptureNote.cs
示例5: SegmentInfo
/// ------------------------------------------------------------------------------------
/// <summary>
/// Initializes a new instance of the <see cref="T:SegmentInfo"/> class.
/// </summary>
/// <param name="sMarker">The segment marker.</param>
/// <param name="sText">The segment text.</param>
/// <param name="domain">The import domain.</param>
/// <param name="reference">The current Scripture reference.</param>
/// <param name="ws">The writing system (-1 to indicate the default WS).</param>
/// ------------------------------------------------------------------------------------
internal SegmentInfo(string sMarker, string sText, ImportDomain domain,
BCVRef reference, int ws)
{
m_sMarker = sMarker;
m_sText = sText;
m_domain = domain;
m_ref = reference;
m_ws = ws;
}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:19,代码来源:TeImportManagerTests.cs
示例6: BtFootnoteBldrInfo
/// ------------------------------------------------------------------------------------
/// <summary>
/// Constructor
/// </summary>
/// <param name="ws"></param>
/// <param name="bldr"></param>
/// <param name="styleId"></param>
/// <param name="ichOffset"></param>
/// <param name="reference"></param>
/// ------------------------------------------------------------------------------------
public BtFootnoteBldrInfo(int ws, ITsStrBldr bldr, string styleId, int ichOffset,
BCVRef reference)
{
this.ws = ws;
this.bldr = bldr;
this.styleId = styleId;
this.ichOffset = ichOffset;
this.reference = new BCVRef(reference);
}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:19,代码来源:TeImport.cs
示例7: VerifyParaDiff
/// <summary>overload for same end ref</summary>
public static void VerifyParaDiff(Difference diff,
BCVRef startAndEnd, DifferenceType type,
StTxtPara paraCurr, int ichMinCurr, int ichLimCurr,
StTxtPara paraRev, int ichMinRev, int ichLimRev)
{
VerifyParaDiff(diff, startAndEnd, startAndEnd, type,
paraCurr, ichMinCurr, ichLimCurr,
paraRev, ichMinRev, ichLimRev);
}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:10,代码来源:DiffTestHelper.cs
示例8: SCTextSegment
/// ------------------------------------------------------------------------------------
/// <summary>
/// Initializes a new instance of the <see cref="SCTextSegment"/> class.
/// </summary>
/// ------------------------------------------------------------------------------------
public SCTextSegment(string text, string marker, string literalVerse,
BCVRef firstRef, BCVRef lastRef, string filename, int lineNumber)
{
m_marker = marker;
m_text = text;
m_firstRef = new BCVRef(firstRef);
m_lastRef = new BCVRef(lastRef);
m_filename = filename;
m_lineNumber = lineNumber;
m_literalVerse = literalVerse;
}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:16,代码来源:SCTextSegment.cs
示例9: DummyPictureCheckingToken
public DummyPictureCheckingToken(ICmObject obj, int ws, string icuLocale)
{
m_startRef = m_endRef = new BCVRef(1, 3, 34);
m_fNoteStart = false;
m_fParagraphStart = false;
m_icuLocale = icuLocale;
m_object = obj;
m_sText = "La biblioteque in Monroe";
m_paraStyleName = ScrStyleNames.Figure;
m_textType = TextType.Other;
Ws = ws;
m_flid = CmPictureTags.kflidCaption;
}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:13,代码来源:FdoScriptureTests.cs
示例10: GetInsertIndexForRef
/// ------------------------------------------------------------------------------------
/// <summary>
/// Gets the insert index where a new annotation is inserted when the annotation's
/// reference is that specified. The index will be at the end of those for the
/// specified reference.
/// </summary>
/// ------------------------------------------------------------------------------------
private int GetInsertIndexForRef(BCVRef startRef)
{
IFdoOwningSequence<IScrScriptureNote> notes = NotesOS;
for (int i = notes.Count - 1; i >= 0; i--)
{
IScrScriptureNote note = notes[i];
if (note.BeginRef <= startRef)
return i + 1;
}
return 0;
}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:20,代码来源:ScrScriptureNote.cs
示例11: DummyParaCheckingToken
/// ------------------------------------------------------------------------------------
/// <summary>
/// Initializes a new instance of the <see cref="DummyParaCheckingToken"/> class.
/// </summary>
/// <param name="obj">The obj.</param>
/// <param name="ws">The writing system</param>
/// <param name="paraOffset">The para offset.</param>
/// <param name="startRef">The start reference.</param>
/// <param name="endRef">The end reference.</param>
/// ------------------------------------------------------------------------------------
public DummyParaCheckingToken(ICmObject obj, int ws, int paraOffset,
BCVRef startRef, BCVRef endRef)
{
m_startRef = startRef;
m_endRef = endRef;
m_fNoteStart = false;
m_fParagraphStart = false;
m_icuLocale = null;
m_object = obj;
m_sText = "This is lousy text and it is bad, it is";
m_paraStyleName = ScrStyleNames.NormalParagraph;
m_textType = TextType.Verse;
Ws = ws;
m_flid = (int)StTxtPara.StTxtParaTags.kflidContents;
m_paraOffset = paraOffset;
}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:26,代码来源:FdoScriptureTests.cs
示例12: TextEnum
/// ------------------------------------------------------------------------------------
/// <summary>
/// Create a text segment enumerator for importing a project
/// </summary>
/// <param name="firstRef">start reference for importing</param>
/// <param name="lastRef">end reference for importing</param>
/// <returns></returns>
/// ------------------------------------------------------------------------------------
public ISCTextEnum TextEnum(BCVRef firstRef, BCVRef lastRef)
{
try
{
if (m_encConverters == null)
m_encConverters = new EncConverters();
}
catch (DirectoryNotFoundException ex)
{
string message = string.Format(ScriptureUtilsException.GetResourceString(
"kstidEncConverterInitError"), ex.Message);
throw new EncodingConverterException(message,
"/Beginning_Tasks/Import_Standard_Format/Unable_to_Import/Encoding_converter_not_found.htm");
}
// get the enumerator that will return text segments
return new SCTextEnum(m_settings, m_domain, firstRef, lastRef, m_encConverters);
}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:26,代码来源:SCScriptureText.cs
示例13: Initialize
public override void Initialize()
{
base.Initialize();
m_styleSheet = new FwStyleSheet();
m_styleSheet.Init(Cache, m_scr.Hvo, (int)Scripture.ScriptureTags.kflidStyles);
InitWsInfo();
DummyTeImporter.s_translatorNoteDefn = m_scrInMemoryCache.m_translatorNoteDefn;
DummyTeImporter.s_consultantNoteDefn = m_scrInMemoryCache.m_consultantNoteDefn;
m_titus = new BCVRef(56001001);
m_settings = new DummyScrImportSet();
m_scr.ImportSettingsOC.Add(m_settings);
m_settings.ImportTypeEnum = TypeOfImport.Other;
m_settings.StartRef = m_titus;
m_settings.EndRef = m_titus;
m_settings.ImportTranslation = true;
InitializeImportSettings();
m_importer = new DummyTeImporter(m_settings, Cache, m_styleSheet, m_scrInMemoryCache);
m_importer.Initialize();
}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:23,代码来源:TeImportTestsBase.cs
示例14: ValidBCVRefs
public void ValidBCVRefs()
{
BCVRef bcvRef = new BCVRef(1, 2, 3, 0);
Assert.IsTrue(bcvRef.Valid);
Assert.AreEqual(1002003, (int)bcvRef);
Assert.AreEqual(1, bcvRef.Book);
Assert.AreEqual(2, bcvRef.Chapter);
Assert.AreEqual(3, bcvRef.Verse);
bcvRef = new BCVRef(4005006);
Assert.IsTrue(bcvRef.Valid);
Assert.AreEqual(4005006, (int)bcvRef);
Assert.AreEqual(4, bcvRef.Book);
Assert.AreEqual(5, bcvRef.Chapter);
Assert.AreEqual(6, bcvRef.Verse);
bcvRef = new BCVRef();
Assert.IsFalse(bcvRef.Valid);
Assert.AreEqual(0, (int)bcvRef);
Assert.AreEqual(0, bcvRef.Book);
Assert.AreEqual(0, bcvRef.Chapter);
Assert.AreEqual(0, bcvRef.Verse);
}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:23,代码来源:BCVRefTests.cs
示例15: SCTextEnum
/// ------------------------------------------------------------------------------------
/// <summary>
/// Initializes a new instance of the <see cref="SCTextEnum"/> class.
/// </summary>
/// <param name="settings">The import settings</param>
/// <param name="domain">The source domain</param>
/// <param name="startRef">first reference to retrieve</param>
/// <param name="endRef">last reference to retrieve</param>
/// <param name="encConverters">The encoding converters repository</param>
/// ------------------------------------------------------------------------------------
public SCTextEnum(IScrImportSet settings, ImportDomain domain,
BCVRef startRef, BCVRef endRef, IEncConverters encConverters)
{
m_settings = settings;
m_domain = domain;
m_startRef = new BCVRef(startRef);
m_endRef = new BCVRef(endRef);
m_mappingSet = m_settings.GetMappingSetForDomain(domain);
// Gets the set of encoding converters
m_encConverters = encConverters;
// make a list of all of the begin and end markers for inline markers
// Also build the map of encoding converters
m_InlineBeginAndEndMarkers = new List<string>();
foreach (ImportMappingInfo mapping in m_settings.GetMappingListForDomain(domain))
{
if (mapping.IsInline || m_settings.ImportTypeEnum == TypeOfImport.Paratext5)
{
m_InlineBeginAndEndMarkers.Add(mapping.BeginMarker);
if (mapping.IsInline)
m_InlineBeginAndEndMarkers.Add(mapping.EndMarker);
}
}
m_InlineBeginAndEndMarkers.Sort(new StrLengthComparer(false));
// Build a list of all of the characters that inline markers start with
Set<char> tempCharList = new Set<char>();
foreach (string marker in m_InlineBeginAndEndMarkers)
tempCharList.Add(marker[0]); // Set ignores duplicates.
m_InlineMarkerStartChars = tempCharList.ToArray();
// Get the import file source that will provide the files to import.
m_importSource = settings.GetImportFiles(domain);
m_importSourceEnum = m_importSource.GetEnumerator();
}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:47,代码来源:SCTextEnum.cs
示例16: UndoImport_ReplaceBook
public void UndoImport_ReplaceBook()
{
FdoCache cache = m_firstMainWnd.Cache;
Scripture scr = (Scripture)m_firstMainWnd.ScriptureObj;
Set<int> origDrafts = new Set<int>(scr.ArchivedDraftsOC.HvoArray);
// Create a settings object and set it to be a Paratext import of Philemon.
ScrImportSet settings = new ScrImportSet();
scr.ImportSettingsOC.Add(settings);
settings.ImportTypeEnum = TypeOfImport.Paratext6;
settings.ParatextScrProj = "TEV";
settings.SetMapping(MappingSet.Main, new ImportMappingInfo(@"\it", @"\it*", false, MappingTargetType.TEStyle, MarkerDomain.Default, "Emphasis", null));
cache.Save();
// Setup the reference to import.
BCVRef scrRef = new BCVRef(57001001);
// Do the import.
settings.ImportTranslation = true;
settings.ImportBookIntros = true;
settings.StartRef = scrRef;
settings.EndRef = scrRef;
m_firstMainWnd.Import(settings);
IScrDraft importedDraft = GetImportedVersion(cache, origDrafts, 2);
IScrBook importedPhm = importedDraft.FindBook(57);
Assert.IsNotNull(importedPhm);
Assert.IsTrue(cache.ActionHandlerAccessor.CanUndo());
Assert.AreEqual(UndoResult.kuresRefresh, cache.ActionHandlerAccessor.Undo());
IScrBook restoredPhm = scr.FindBook(57);
Assert.IsNotNull(restoredPhm);
Assert.AreNotEqual(restoredPhm.Hvo, importedPhm.Hvo);
Set<int> finalDrafts = new Set<int>(scr.ArchivedDraftsOC.HvoArray);
Assert.AreEqual(origDrafts.Count, finalDrafts.Count);
}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:37,代码来源:TeAppTests.cs
示例17: UndoImport_NewBook
public void UndoImport_NewBook()
{
FdoCache cache = m_firstMainWnd.Cache;
Scripture scr = (Scripture)m_firstMainWnd.ScriptureObj;
Set<int> origDrafts = new Set<int>(scr.ArchivedDraftsOC.HvoArray);
// Create a settings object and set it to be a Paratext import of Titus.
ScrImportSet settings = new ScrImportSet();
scr.ImportSettingsOC.Add(settings);
settings.ImportTypeEnum = TypeOfImport.Paratext6;
settings.ParatextScrProj = "TEV";
settings.SetMapping(MappingSet.Main, new ImportMappingInfo(@"\it", @"\it*", false, MappingTargetType.TEStyle, MarkerDomain.Default, "Emphasis", null));
cache.Save();
// Setup the reference to import.
BCVRef scrRef = new BCVRef(56001001);
// Do the import.
settings.ImportTranslation = true;
settings.ImportBookIntros = true;
settings.StartRef = scrRef;
settings.EndRef = scrRef;
m_firstMainWnd.Import(settings);
IScrDraft importedDrafts = GetImportedVersion(cache, origDrafts, 1);
Assert.IsNotNull(importedDrafts.FindBook(56));
Assert.IsTrue(cache.ActionHandlerAccessor.CanUndo());
Assert.AreEqual(UndoResult.kuresRefresh, cache.ActionHandlerAccessor.Undo());
Assert.IsNull(scr.FindBook(56));
// JohnT: no longer happens, and I can't think why it should, since Undo does not
// change Scripture.
Set<int> finalDrafts = new Set<int>(scr.ArchivedDraftsOC.HvoArray);
Assert.AreEqual(origDrafts.Count, finalDrafts.Count);
}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:35,代码来源:TeAppTests.cs
示例18: VerifyStylesComboBoxAfterImport
public void VerifyStylesComboBoxAfterImport()
{
Unpacker.UnpackTEVTitusWithUnmappedStyle();
try
{
// Move selection to a place in the text where the styles combo contents
// are not restricted to exclude general paragraphs (Jud 1:10 will do).
m_firstDraftView.GotoVerse(65001010);
// Make sure the style combo box doesn't have the UnknownTEStyle in it.
Assert.IsTrue(m_firstMainWnd.ParaStylesComboBox.FindString(@"\xx") < 0,
@"'\xx' was found!");
// Create a settings object and set it to be a Paratext import of the
// TEV scripture project (containing Titus with an unmapped marker).
IScripture scr = (Scripture)m_firstMainWnd.ScriptureObj;
IScrImportSet settings = new ScrImportSet();
scr.ImportSettingsOC.Add(settings);
scr.DefaultImportSettings = settings;
settings.ImportTypeEnum = TypeOfImport.Paratext6;
settings.ParatextScrProj = "TEV";
// Setup the reference to import.
BCVRef scrRef = new BCVRef(56001001);
// Do the import.
settings.ImportTranslation = true;
(settings as ScrImportSet).StartRef = scrRef;
(settings as ScrImportSet).EndRef = scrRef;
m_firstMainWnd.Import(settings);
m_firstMainWnd.InitStyleComboBox();
// Move selection back to Jud 1:10 because the selection seems to get messed
// up in this test.
m_firstDraftView.GotoVerse(65001010);
// Make sure the styles combo now contains a new style for the unmapped marker
// found in our test TEV style sheet and in the test Titus scripture data
// (the style file and scripture data file contain the unmapped marker '\xx').
Assert.IsTrue(m_firstMainWnd.ParaStylesComboBox.FindString(@"\xx") >= 0,
@"'\xx' was not found!");
}
finally
{
Unpacker.UnPackParatextTestProjects();
}
}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:47,代码来源:TeAppTests.cs
示例19: ChapterVerseRefAsString
/// ------------------------------------------------------------------------------------
/// <summary>
/// Convert a Scripture reference to a string (perhaps like this: 16:3, depending on the
/// chapterVerseSeparator). It will also handle script digits if necessary.
/// </summary>
/// <param name="reference">A ScrReference that holds the chapter and verse to format</param>
/// <param name="hvoWs">The HVO of the writing system in which we are displaying this
/// reference (used to determine whether to use script digits and whether to include
/// right-to-left marks)</param>
/// <returns>A formatted chapter/verse reference</returns>
/// <remarks>See TeHeaderFooterVc for an example of how to format the full reference,
/// including book name. The method BookName in that class could be moved somewhere
/// more appropriate if it's ever needed.</remarks>
/// ------------------------------------------------------------------------------------
public string ChapterVerseRefAsString(BCVRef reference, int hvoWs)
{
bool fUseScriptDigits = (UseScriptDigits && hvoWs == Cache.DefaultVernWs);
string sVerseRef = (reference.Verse > 0) ?
ConvertToString(reference.Verse, fUseScriptDigits) : String.Empty;
if (reference.Chapter > 0 && reference.Verse > 0)
{
return ConvertToString(reference.Chapter, fUseScriptDigits) +
ChapterVerseSeparatorForWs(hvoWs) + sVerseRef;
}
return sVerseRef;
}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:27,代码来源:FdoScripture.cs
示例20: ParsePictureLoc
/// ------------------------------------------------------------------------------------
/// <summary>
/// Parses a picture location range string.
/// </summary>
/// <param name="s">The string representation of a picture location range.</param>
/// <param name="anchorLocation">The anchor location.</param>
/// <param name="locType">The type of the location range. The incoming value tells us
/// the assumed type for parsing. The out value can be set to a different type if we
/// discover that the actual value is another type.</param>
/// <param name="locationMin">The location min.</param>
/// <param name="locationMax">The location max.</param>
/// <remarks>This is implemented on Scripture because CmPicture's implementation does
/// not handle Scripture reference ranges.</remarks>
/// ------------------------------------------------------------------------------------
public void ParsePictureLoc(string s, int anchorLocation,
ref PictureLocationRangeType locType, out int locationMin, out int locationMax)
{
locationMin = locationMax = 0;
if (BCVRef.GetChapterFromBcv(anchorLocation) == 1 &&
BCVRef.GetVerseFromBcv(anchorLocation) == 0)
{
string[] pieces = s.Split(new char[] { '-' }, 2,
StringSplitOptions.RemoveEmptyEntries);
if (pieces.Length == 2 &&
Int32.TryParse(pieces[0], out locationMin) &&
Int32.TryParse(pieces[1], out locationMax))
{
locType = PictureLocationRangeType.ParagraphRange;
return;
}
locType = PictureLocationRangeType.AfterAnchor;
return;
}
BCVRef startRef = new BCVRef(anchorLocation);
BCVRef endRef = new BCVRef(anchorLocation);
if (ScrReference.ParseRefRange(s, ref startRef, ref endRef, Versification) &&
startRef <= anchorLocation && endRef >= anchorLocation)
{
locationMin = startRef.BBCCCVVV;
locationMax = endRef.BBCCCVVV;
locType = PictureLocationRangeType.ReferenceRange;
}
else
locType = PictureLocationRangeType.AfterAnchor;
}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:46,代码来源:FdoScripture.cs
注:本文中的SILUBS.SharedScrUtils.BCVRef类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论