private void popOffUserControlStack(RentMeUserControl customerUserControl) { if (this.userControlStack.Count < 2) { return; } var previousUC = this.userControlStack[this.userControlStack.Count - 1]; this.userControlStack.RemoveAt(this.userControlStack.Count - 1); var newUcInterface = this.userControlStack[this.userControlStack.Count - 1]; UserControl newUserControl = newUcInterface; newUserControl.Enabled = true; newUserControl.Visible = true; newUserControl.Location = this.userControlLocation; newUcInterface.ChildReturned = previousUC; this.swapDataGridView(newUcInterface.DataGrid); newUcInterface.StateChanged += this.StateChange; Controls.Add(newUserControl); newUcInterface.processChild(); }
private void removeUCFromDisplay(RentMeUserControl userControl) { UserControl uc = userControl; uc.Enabled = false; uc.Visible = false; Controls.Remove(uc); userControl.StateChanged -= this.StateChange; }
private void addUCToDisplay(RentMeUserControl ucInterface) { UserControl userControl = ucInterface; userControl.Enabled = true; userControl.Visible = true; userControl.Location = this.userControlLocation; this.swapDataGridView(ucInterface.DataGrid); ucInterface.StateChanged += this.StateChange; Controls.Add(userControl); if (this.userControlStack.Count >= 2) { ucInterface.ParentParameter = this.userControlStack[this.userControlStack.Count - 2]; ucInterface.processParentIntention(); } }
private void displayNewUserControl(RentMeUserControl uc) { this.userControlStack.Add(uc); this.addUCToDisplay(uc); }