public bool Init()
{
bool retVal = true;
var spellingFile = UserManager.GetFullPath(SpellCheckFileName);
var doc = new XmlDocument();
try
{
if (File.Exists(spellingFile))
{
doc.Load(spellingFile);
var spellingNodes = doc.SelectNodes("/ACAT/Spellings/Spelling");
if (spellingNodes != null)
{
// load all the spellings
foreach (XmlNode node in spellingNodes)
{
createAndAdd(node);
}
}
}
else
{
Log.Debug("Spelling file " + spellingFile + " does not exist");
retVal = false;
}
}
catch (Exception ex)
{
Log.Debug("Error processing spelling file " + spellingFile + ". Exception: " + ex.ToString());
retVal = false;
}
return retVal;
}