I am attempting to determine user actions inside the DevStudio designers.
I am using an Add-In to accomplish this by getting the active window (in
a 'WindowActivated' DTE event) from the DTE object and checking if it is
an IDesignerHost. If it is I then add selection event handlers so that I
can capture selection changes. The code looks like this:

//_dte.Events.get_WindowEvents.WindowActivated Handler
public void WindowActivated(
   EnvDTE.Window gotFocus,
   EnvDTE.Window lostFocus)
{
   if(gotFocus.Type == EnvDTE.vsWindowType.vsWindowTypeDocument)
   {
      if ( ( gotFocus.Object is IDesignerHost ) == true )
      {
         //do some processing here on the IDesignerHost interface....
      }
   }
}

This works great with a Win Forms designer. During debugging
the 'gotFocus.Object' shows as a
Microsoft.VisualStudio.Designer.Host.DesignerHost type and it is
an 'IDesignerHost'.

Unfortunately (for me) when a Web Form is activated the type is shown
as 'System.__ComObject' and it is definitely not an 'IDesignerHost'. Is
there any way to get to the 'IDesignerHost' for a Web Form Designer?
Alternatively, is there a way to capture events on the Web Form designer?
What is the type of the Web Forms designer?

- Thanks
  Brian

Reply via email to