internal static List <SpellChecker.SpellingError> ToList(this RCW.IEnumSpellingError spellingErrors, SpellChecker spellChecker, string text, bool shouldSuppressCOMExceptions = true, bool shouldReleaseCOMObject = true) { if (spellingErrors == null) { throw new ArgumentNullException("spellingErrors"); } List <SpellChecker.SpellingError> list = new List <SpellChecker.SpellingError>(); try { for (;;) { RCW.ISpellingError spellingError = spellingErrors.Next(); if (spellingError == null) { break; } SpellChecker.SpellingError item = new SpellChecker.SpellingError(spellingError, spellChecker, text, shouldSuppressCOMExceptions, true); list.Add(item); } } catch (COMException obj) when(shouldSuppressCOMExceptions) { } finally { if (shouldReleaseCOMObject) { Marshal.ReleaseComObject(spellingErrors); } } return(list); }
public List <SpellChecker.SpellingError> ComprehensiveCheckImpl(string text) { RCW.IEnumSpellingError enumSpellingError = this._speller.Value.ComprehensiveCheck(text); if (enumSpellingError == null) { return(null); } return(enumSpellingError.ToList(this, text, false, true)); }