/** * Gets a index of the document */ private int GetIndexForDockContent(DockContent doc) { int count = this.dockPanel.Documents.Length; for (int i = 0; i<count; i++) { if (doc.Equals(this.dockPanel.Documents[i])) { return i; } } return -1; }