/// <summary> /// This function gets a form, decrement children and show this form /// if there is no children /// </summary> /// <param name="childForm"></param> private void closeChild(TemplateForm childForm) { this.childrenNum--; if (childrenNum == 0) this.Show(); }
/// <summary> /// This function get a form, show it and hide this. /// It also sets parent field of the form to this. /// </summary> private void newChild(TemplateForm childForm) { TemplateForm parent = this.parent == null ? this : this.parent; childForm.parent = parent; parent.childrenNum++; parent.Hide(); childForm.Show(); }