private static SpellEngine RawGetSpellChecker(string dictId) { SpellEngine result = null; var rootDir = GetSpellingDirectoryPath(); var dictPath = GetShortName(Path.Combine(rootDir, Path.ChangeExtension(dictId, "dic"))); var affixPath = GetShortName(Path.Combine(rootDir, Path.ChangeExtension(dictId, "aff"))); var exceptionPath = GetExceptionFileName(dictPath); if (File.Exists(dictPath) && File.Exists(affixPath)) { try { result = new SpellEngine(affixPath, dictPath, exceptionPath); } catch (Exception) { if (result != null) { result.Dispose(); } throw; } } // Enhance JohnT: may want to look in OO and/or Firefox directory. return(result); }
private static SpellEngine RawGetSpellChecker(string dictId) { SpellEngine result = null; var rootDir = GetSpellingDirectoryPath(); var dictPath = GetShortName(Path.Combine(rootDir, Path.ChangeExtension(dictId, "dic"))); var affixPath = GetShortName(Path.Combine(rootDir, Path.ChangeExtension(dictId, "aff"))); var exceptionPath = GetExceptionFileName(dictPath); if (File.Exists(dictPath) && File.Exists(affixPath)) { try { result = new SpellEngine(affixPath, dictPath, exceptionPath); } catch (Exception) { if (result != null) result.Dispose(); throw; } } // Enhance JohnT: may want to look in OO and/or Firefox directory. return result; }