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

GetTokensSubStrings() private method

Get the text token substrings from the data source and fire the event telling subscribers a list of text tokens is available.
private GetTokensSubStrings ( string fileName ) : void
fileName string
return void
		private void GetTokensSubStrings(string fileName)
		{
			if (TextTokenSubStringsLoaded == null)
				return;

			if (BeforeTextTokenSubStringsLoaded != null)
				BeforeTextTokenSubStringsLoaded(fileName == string.Empty ? null : fileName);

			using (new WaitCursor(this))
			{
				List<TextTokenSubstring> tokens = (string.IsNullOrEmpty(fileName) ?
					ReadTEScripture() : ReadFile(fileName));

				if (tokens == null || tokens.Count == 0)
				{
					string msg = (fileName == null) ?
						String.Format(FwCoreDlgs.kstidNoTokensFoundInCurrentScriptureProj, m_sListName) :
						String.Format(FwCoreDlgs.kstidNoTokensFoundInFile, m_sListName, m_openFileDialog.FileName);
					MessageBox.Show(msg, m_app.ApplicationName);
					ResetContextLists();
					lblScanMsg.Text = m_sInitialScanMsgLabel;
					m_tokenGrid.Invalidate();
				}
				else
				{
					TextTokenSubStringsLoaded(tokens);
				}
			}
		}