在 Visual Studio 2017 中永久隐藏任务列表 window

Permanently hide the Task List window in Visual Studio 2017

我无法在线找到此问题的答案,但基本上我想永久隐藏每当我测试 Biztalk 地图时弹出的任务列表 window。现在我已经通过尽可能地最小化 window 找到了一个临时解决方案,所以它不会妨碍,但最好完全摆脱它。

这是有问题的 window。

不幸的是,没有(为清楚起见,答案是否定的......除非你想写一个 Shell 扩展;)。

我经常和你一样对此感到沮丧,但我发现将它简单地隐藏在角落或沿着状态栏与隐藏它一样好。

我假设激活动作已融入地图设计器中。

您可以尝试 Visual Commander 的以下扩展,以便在任务列表 window 显示后自动关闭它:

public class E : VisualCommanderExt.IExtension
{
    public void SetSite(EnvDTE80.DTE2 DTE, Microsoft.VisualStudio.Shell.Package package)
    {
        events = DTE.Events;
        windowEvents = events.WindowEvents;
        windowEvents.WindowActivated += OnWindowActivated;
    }

    public void Close()
    {
        windowEvents.WindowActivated -= OnWindowActivated;
    }

    private void OnWindowActivated(EnvDTE.Window gotFocus, EnvDTE.Window lostFocus)
    {
        try
        {
            if (gotFocus.Caption == "Task List")
                CloseWindow(gotFocus);
        }
        catch (System.Exception)
        {
        }
    }

    private void CloseWindow(EnvDTE.Window w)
    {
        System.Windows.Threading.Dispatcher.CurrentDispatcher.BeginInvoke(
            System.Windows.Threading.DispatcherPriority.Background,
            new System.Action(() =>
         {
             try
             {
                 w.Close();
             }
             catch (System.Exception)
             {
             }
         }
                ));
    }

    private EnvDTE.Events events;
    private EnvDTE.WindowEvents windowEvents;
}