private void closeOthersToTheRightToolStripMenuItem_Click(object sender, EventArgs e)
{
// find the dock pane with this window
DockPane pane = GetDockPane();
if (pane != null)
{
// found the pane
List<ToolWindowDocument> docsToClose = new List<ToolWindowDocument>();
bool close = false;
foreach (IDockContent content in new List<IDockContent>(pane.Contents))
{
if (content == this)
{
close = true;
continue;
}
if (close)
{
ToolWindowDocument win = content as ToolWindowDocument;
if (win != null)
{
docsToClose.Add(win);
}
}
}
if (docsToClose.Count > 0)
{
CloseDocs("Close Other To the Right", docsToClose);
}
}
}