我要离开名单here。我想在解决方案或项目发生变化时收到通知。我从this代码开始添加到其中。
public void Watch()
{
DTE dte = Package.GetGlobalService(typeof(SDTE)) as DTE;
dte.Events.SolutionEvents.Opened += SolutionEvents_Opened;
dte.Events.TextEditorEvents.LineChanged += TextEditorEvents_LineChanged;
dte.Events.WindowEvents.WindowMoved += WindowEvents_WindowMoved;
}
private void WindowEvents_WindowMoved(Window Window, int Top, int Left, int Width, int Height)
{
System.Windows.Forms.MessageBox.Show("1-->");
}
private void TextEditorEvents_LineChanged(TextPoint StartPoint, TextPoint EndPoint, int Hint)
{
System.Windows.Forms.MessageBox.Show("2-->");
}
private void SolutionEvents_Opened()
{
System.Windows.Forms.MessageBox.Show("3-->");
}
但只有WindowEvents_WindowMoved会触发。我做错了吗?