void DockPanel_ContentRemoved(object sender, DockContentEventArgs e) { ctlPuttyPanel pp = e.Content as ctlPuttyPanel; if (pp != null) { this.childWindows.Remove(pp.AppPanel.AppWindowHandle); } }
public ChildWindowFocusHelper(frmSuperPutty form) { this.MainForm = form; this.MainForm.ResizeEnd += HandleResizeEnd; foreach (IDockContent doc in this.MainForm.DockPanel.Contents) { ctlPuttyPanel pp = doc as ctlPuttyPanel; if (pp != null) { this.childWindows.Add(pp.AppPanel.AppWindowHandle, pp); } } this.MainForm.DockPanel.ContentAdded += DockPanel_ContentAdded; this.MainForm.DockPanel.ContentRemoved += DockPanel_ContentRemoved; }