I am working on extending the spell checker that has recently been updated on the code gallery: http://code.msdn.microsoft.com/spellCheckerSample
I would like to update it so that the "ignore" list of words comes from CustomDictionary.xml, the same file that the static code analysis tools use.
From within my VS 2010 editor extension, I need to:
- Find the project in which the current file resides.
- Find the "CustomDictionary.XML" file, if it exists.
- If it exists, I need to check it out from source control
- If it doesn't exist, I need to add it to the current project (and to the source control)
- Add text to the CustomDictionary.XML file (this is the easy part).
Is anyone aware of any examples that would help me learn how to do this? I am using the VS2010 Release Candidate.
Thanks.
~ Cameron
Here's what I have so far:
public ISpellingDictionaryService GetSpellingDictionaryService(ITextBuffer textBuffer)
{
var bufferAdapter = AdaptersFactory.GetBufferAdapter(textBuffer);
if (bufferAdapter != null)
{
var extensibleObject = bufferAdapter as IExtensibleObject;
if (extensibleObject != null)
{
object document;
extensibleObject.GetAutomationObject("Document", null, out document);
// Control never gets here... GetAutomationObject appears to recurse.
}
}
}