I have a managed syntax highlighter using the new VS extensibility API's and it gives me an ITextBuffer
, which is great.
In another part of my extension I am getting a DTE object and attaching to the active window changed event, which gives me an EnvDTE.Window
object.
var dte = (EnvDTE.DTE)this.GetService(typeof(EnvDTE.DTE));
dte.Events.WindowEvents.WindowActivated += WindowEvents_WindowActivated;
// ...
private void WindowEvents_WindowActivated(EnvDTE.Window GotFocus, EnvDTE.Window LostFocus)
{
// ???
// Profit
}
I would like to get the ITextBuffer out of Window in this method. Can anyone tell me a straight forward way to do that?