public WindowList(ExtendedForm parentForm) { windowListForm = parentForm; windowListForm.ChildAdded += WindowListForm_ChildAdded; windowListForm.ChildRemoved += WindowListForm_ChildRemoved; this.parentForm = parentForm; }
/// <summary> /// Recursively counts the number of child forms within the parent/child tree. /// </summary> /// <param name="parent"></param> /// <returns></returns> private int GetChildFormCount(IWindowList parent) { int childCount = 0; foreach (var child in parent.ChildForms) { childCount += GetChildFormCount(child) + 1; } return(childCount); }