public RCW.ISpellChecker CreateSpellChecker() { RCW.ISpellCheckerFactory comFactory = SpellCheckerFactory.SpellCheckerCreationHelper.ComFactory; if (comFactory == null) { return(null); } return(comFactory.CreateSpellChecker(this._language)); }
private List <string> SupportedLanguagesImpl() { RCW.ISpellCheckerFactory comFactory = this.ComFactory; RCW.IEnumString enumString = (comFactory != null) ? comFactory.SupportedLanguages : null; List <string> result = null; if (enumString != null) { result = enumString.ToList(true, true); } return(result); }
private static bool CreateLockFree(bool suppressCOMExceptions = true, bool suppressOtherExceptions = true) { if (SpellCheckerFactory.Singleton.ComFactory != null) { try { Marshal.ReleaseComObject(SpellCheckerFactory.Singleton.ComFactory); } catch { } SpellCheckerFactory.Singleton.ComFactory = null; } bool flag = false; RCW.ISpellCheckerFactory comFactory = null; try { comFactory = new RCW.SpellCheckerFactoryCoClass(); flag = true; } catch (COMException obj) when(suppressCOMExceptions) { } catch (UnauthorizedAccessException inner) { if (!suppressCOMExceptions) { throw new COMException(string.Empty, inner); } } catch (InvalidCastException inner2) { if (!suppressCOMExceptions) { throw new COMException(string.Empty, inner2); } } catch (Exception ex) when(suppressOtherExceptions && !(ex is COMException) && !(ex is UnauthorizedAccessException)) { } if (flag) { SpellCheckerFactory.Singleton.ComFactory = comFactory; } return(flag); }