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

ReadFile() private method

Reads a file for text tokens.
private ReadFile ( string fileName ) : List
fileName string Name of the file.
return List
		private List<TextTokenSubstring> ReadFile(string fileName)
		{
			if (!File.Exists(fileName))
				return null;

			List<TextTokenSubstring> tokens;

			try
			{
				m_fileData = File.ReadAllLines(fileName);
				NormalizeFileData();

				var data = new TextFileDataSource(m_scrChecksDllFile,
					m_checkToRun == CheckType.Punctuation ? "PunctuationCheck" : "CharactersCheck",
					m_fileData,
					ResourceHelper.GetResourceString("kstidFileLineRef"), m_chkParams, CharacterCategorizer);

				tokens = data.GetReferences();
			}
			catch (Exception e)
			{
				MessageBox.Show(string.Format(FwCoreDlgs.kstidNonUnicodeFileError, e.Message),
					m_app.ApplicationName, MessageBoxButtons.OK,MessageBoxIcon.Information);
				return null;
			}

			return tokens;
		}