Change DummyDoc to HideOnClose to be true. (If it is false, it works)
Then change menuItemLayoutByCode_Click to be like this:
Next: Close Document3 and Document5, then close Document1. You will see that Document2 is closed also. But if you check Document2's visibility, it is TRUE.
Thanks.
List<DummyDoc> docs = new List<DummyDoc>(6);
private void menuItemLayoutByCode_Click(object sender, System.EventArgs e)
{
dockPanel.SuspendLayout(true);
m_solutionExplorer.Show(dockPanel, DockState.DockRight);
m_propertyWindow.Show(m_solutionExplorer.Pane, m_solutionExplorer);
m_toolbox.Show(dockPanel, new Rectangle(98, 133, 200, 383));
m_outputWindow.Show(m_solutionExplorer.Pane, DockAlignment.Bottom, 0.35);
m_taskList.Show(m_toolbox.Pane, DockAlignment.Left, 0.4);
if (docs.Count == 0)
{
for (int i = 0; i < 6;i++ )
docs.Add(CreateNewDocument("Document" + i));
}
else
{
for (int i = 0; i < 6;i++ )
if (docs[i].Visible)
docs[i].Hide();
}
//CloseAllDocuments();
docs[0].Show(dockPanel, DockState.Document);
docs[1].Show(docs[0].Pane, DockAlignment.Bottom, 0.2);
docs[2].Show(docs[1].Pane, DockAlignment.Left, 0.25);
docs[3].Show(docs[1].Pane, DockAlignment.Left, 0.25);
Point corner = docs[0].PointToScreen(new Point(0, 0));
docs[4].Show(docs[3].Pane, DockAlignment.Bottom, 0.5);
docs[4].FloatAt(new Rectangle(corner.X + 20, corner.Y + 20, 200, 200));
docs[5].Show(docs[1].Pane, DockAlignment.Left, 1.0 / 3.0);
dockPanel.ResumeLayout(true, true);
}
Logged In: NO
The fix is in VisibleNestedPanelCollection.cs, Remove(DockPane pane) funtion:
replace the two PreviousPane with DisplayingPreviousPane, i.e:
if (this[i].NestedDockingStatus.PreviousPane == pane)
===>
if (this[i].NestedDockingStatus.DisplayingPreviousPane == pane)
for (int i = indexLastNestedPane - 1; i > index; i--)
{
NestedDockingStatus status = this[i].NestedDockingStatus;
if (status.DisplayingPreviousPane == pane)
====>
for (int i = indexLastNestedPane - 1; i > index; i--)
{
NestedDockingStatus status = this[i].NestedDockingStatus;
if (status.PreviousPane == pane)
Logged In: YES
user_id=595897
Originator: NO
Moving to Patches.
Need to look over this and add to code if needed.