private void PopulateSuggestions(RCW.ISpellingError error, SpellChecker spellChecker, string text, bool shouldSuppressCOMExceptions, bool shouldReleaseCOMObject) { try { this._suggestions = new List <string>(); if (this.CorrectiveAction == SpellChecker.CorrectiveAction.GetSuggestions) { List <string> collection = spellChecker.Suggest(text, shouldSuppressCOMExceptions); this._suggestions.AddRange(collection); } else if (this.CorrectiveAction == SpellChecker.CorrectiveAction.Replace) { this._suggestions.Add(this.Replacement); } } finally { if (shouldReleaseCOMObject) { Marshal.ReleaseComObject(error); } } }