|
using System;
using System.Collections.ObjectModel;
using System.Windows.Media;
using Microsoft.VisualStudio.Language.Intellisense;
namespace DigitalSamurai.SpellSharp.Vsx.Actions
{
public class AddToCustomWordsDictionaryAction : ISmartTagAction
{
public SpellingTag SpellingTag { get; private set; }
public string DisplayText
{
get
{
return string.Format
(
"Add '{0}' to custom words dictionary.",
SpellingTag.MisspelledWord
);
}
}
public AddToCustomWordsDictionaryAction (SpellingTag spellingTag)
{
if (spellingTag == null)
{
throw new ArgumentNullException ("spellingTag");
}
SpellingTag = spellingTag;
}
public void Invoke ()
{
CustomWordsDictionary.AddWord
(
SpellingTag.ServiceProvider,
SpellingTag.MisspelledWord
);
}
#region -- ISmartTagAction stubs --
public ReadOnlyCollection<SmartTagActionSet> ActionSets
{
get { return null; }
}
public ImageSource Icon
{
get { return null; }
}
public bool IsEnabled
{
get { return true; }
}
#endregion
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.