2008-12-10 2 views

답변

1

을 변경 곳 편집기 ") 나는 이벤트를 잡을 수 나는 지금 그것을 시도, 그래서 에누리 걸릴 수 없습니다

public class Connect : IDTExtensibility2, IDTCommandTarget 
{ 
    public void OnConnection(object application, ext_ConnectMode connectMode, 
     object addInInst, ref Array custom) 
    { 
     _applicationObject = (DTE2) application; 
     _applicationObject.Events.SelectionEvents.OnChange += SelectionEvents_OnChange; 
    } 

    void SelectionEvents_OnChange() 
    { 
     vsWindowType type = _applicationObject.ActiveWindow.Type; 
     // switch (type) { ... } 
    } 
} 

편집 : 선택-이벤트가 아닌 어쩌면 당신이 필요로하는 것. 당신이 갈고리 할 수있는 다른 사건이 있는지 나는 모른다. 어쨌든 그 줄

vsWindowType type = _applicationObject.ActiveWindow.Type; 

은 현재 활성화 된 창의 유형을 알려줍니다.

관련 문제