/// <summary> /// This method is executed when action is selected in the context menu. /// </summary> public void Invoke() { bool succeeded; switch (action) { case DictionaryAction.IgnoreOnce: dictionary.IgnoreWordOnce(span); succeeded = true; break; case DictionaryAction.IgnoreAll: succeeded = dictionary.IgnoreWord(span.GetText(span.TextBuffer.CurrentSnapshot)); break; default: succeeded = dictionary.AddWordToDictionary(span.GetText(span.TextBuffer.CurrentSnapshot)); break; } Debug.Assert(succeeded, "Call to modify dictionary was unsuccessful"); }