SIL.CoreImpl.SpellingHelper.GetSpellingDirectoryPath C# (CSharp) Method

GetSpellingDirectoryPath() static private method

Locates the directory in which we look for and create hunspell dictionaries.
static private GetSpellingDirectoryPath ( ) : string
return string
		internal static string GetSpellingDirectoryPath()
		{
			if (m_SpellingDirectoryPath == null)
			{
				var appdataFolder = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);

				// When running multiple builds in parallel we have to use separate directories for
				// each build, otherwise some unit tests might fail.
				var buildagentSubdir = Environment.GetEnvironmentVariable("BUILDAGENT_SUBKEY");
				if (!string.IsNullOrEmpty(buildagentSubdir))
					appdataFolder = Path.Combine(appdataFolder, buildagentSubdir);

				m_SpellingDirectoryPath = Path.Combine(appdataFolder, "hunspell");
				if (!Directory.Exists(m_SpellingDirectoryPath))
					Directory.CreateDirectory(m_SpellingDirectoryPath);
			}
			return m_SpellingDirectoryPath;
		}