code_junkie

How can I get the current editor in visual studio 2008 using C#

Nov 12th, 2011
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. public class Connect : IDTExtensibility2, IDTCommandTarget
  2. {
  3. public void OnConnection( object application, ext_ConnectMode connectMode,
  4. object addInInst, ref Array custom )
  5. {
  6. _applicationObject = ( DTE2 ) application;
  7. _applicationObject.Events.SelectionEvents.OnChange += SelectionEvents_OnChange;
  8. }
  9.  
  10. void SelectionEvents_OnChange()
  11. {
  12. vsWindowType type = _applicationObject.ActiveWindow.Type;
  13. // switch (type) { ... }
  14. }
  15. }
  16.  
  17. vsWindowType type = _applicationObject.ActiveWindow.Type;
Add Comment
Please, Sign In to add comment