void ViewChangeNotification(BackupTaskViewsEnum newView) { nestingControlsPanel.Controls.Clear(); nestingControlsPanel.Controls.Add(_views[newView]); nestingControlsPanel.Controls[0].Dock = DockStyle.Fill; nestingControlsPanel.AutoScrollMinSize = new System.Drawing.Size(_views[newView].MinimumSize.Width, _views[newView].MinimumSize.Height); optionsHeader.Title = choosePanelUserControl.SelectedCategory; }
void changeView(object sender, BackupTaskViewsEnum newView) { if (_selectedButton != null) { _selectedButton.BackColor = _normalButtonColor; } Button newCurrentButton = ((Button)sender); newCurrentButton.BackColor = _selectedButtonColor; _selectedButton = newCurrentButton; if (ViewChanged != null) { ViewChanged.Invoke(newView); } }
public BackUserControl RegisterControl(BackupTaskViewsEnum view, BackUserControl control) { _controls.Add(view, control); return(control); }