SIL.FieldWorks.FwCoreDlgs.CharContextCtrl.ReadTEScripture C# (CSharp) Method

ReadTEScripture() private method

Reads the current TE scripture project.
private ReadTEScripture ( ) : List
return List
		private List<TextTokenSubstring> ReadTEScripture()
		{
			var scrDataSource = new ScrChecksDataSource(m_cache, ResourceHelper.GetResourceString("kstidPunctCheckWhitespaceChar"),
				FwDirectoryFinder.LegacyWordformingCharOverridesFile, FwDirectoryFinder.TeStylesPath);

			scrDataSource.LoadException += scrDataSource_LoadException;

			IScrCheckInventory scrCharInventoryBldr = CreateScrCharInventoryBldr(FwDirectoryFinder.BasicEditorialChecksDll,
				scrDataSource, m_checkToRun == CheckType.Punctuation ?
				"SILUBS.ScriptureChecks.PunctuationCheck" : "SILUBS.ScriptureChecks.CharactersCheck");

			var tokens = new List<ITextToken>();
			var scr = m_cache.LangProject.TranslatedScriptureOA;
			if (scr == null || scr.ScriptureBooksOS.Count == 0)
				return null;

			foreach (var book in scr.ScriptureBooksOS)
			{
				if (scrDataSource.GetText(book.CanonicalNum, 0))
					tokens.AddRange(scrDataSource.TextTokens());
			}

			foreach (KeyValuePair<string, string> kvp in m_chkParams)
				scrDataSource.SetParameterValue(kvp.Key, kvp.Value);

			scrDataSource.SetParameterValue("PreferredLocale", string.Empty);

			return tokens.Count == 0 ? null : GetTokenSubstrings(scrCharInventoryBldr, tokens);
		}