protected bool TryCloseTab(int index) { if (index >= 0 || index < Tabs.Count) { // Close the specified content. IDockContent content = Tabs[index].Content; DockPane.CloseContent(content); if (PatchController.EnableSelectClosestOnClose == true) { SelectClosestPane(index); } return(true); } return(false); }