private void BtnResetClick(object sender, EventArgs e) { pnlSteps.Controls.Clear(); settings = new UpdateSettings(); var ctrl = new RoleSelectionControl(rManager.Roles, settings) { Width = Width, Height = Height - 50, Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top }; pnlSteps.Controls.Add(ctrl); btnPrevious.Visible = false; btnReset.Visible = false; btnNext.Enabled = true; currentStep = 2; }
private void BtnNextClick(object sender, EventArgs e) { switch (currentStep) { case 1: { pnlSteps.Visible = true; btnPrevious.Visible = true; btnReset.Visible = true; btnNext.Visible = true; // Adds the role selection control in main form var ctrl = new RoleSelectionControl(rManager.Roles, settings) { Width = Width, Height = Height - 70, Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top }; pnlSteps.Controls.Add(ctrl); currentStep = 2; } break; case 2: { settings.SelectedRoles = ((RoleSelectionControl)pnlSteps.Controls[0]).SelectedRoles; if (settings.SelectedRoles == null) return; pnlSteps.Visible = true; btnPrevious.Visible = true; btnReset.Visible = true; pnlSteps.Controls[0].Dispose(); pnlSteps.Controls.Clear(); var ctrl = new PrivilegeLevelSelectionControl(rManager, entities, settings) { Width = Width, Height = Height - 50, Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top }; ctrl.SettingsApplied += CtrlSettingsApplied; pnlSteps.Controls.Add(ctrl); currentStep = 3; } break; case 3: { pnlSteps.Visible = true; btnNext.Enabled = false; btnPrevious.Visible = true; btnReset.Visible = true; ((PrivilegeLevelSelectionControl)pnlSteps.Controls[0]).ApplyChanges(); } break; } }
private void BtnPreviousClick(object sender, EventArgs e) { switch (currentStep) { case 2: { pnlSteps.Visible = false; pnlSteps.Controls.Clear(); currentStep = 1; btnNext.Visible = false; btnPrevious.Visible = false; btnReset.Visible = false; } break; case 3: { pnlSteps.Visible = true; btnNext.Visible = true; btnPrevious.Visible = true; btnReset.Visible = true; // Adds the role selection control in main form pnlSteps.Controls[0].Dispose(); pnlSteps.Controls.Clear(); var ctrl = new RoleSelectionControl(rManager.Roles, settings) { Width = Width, Height = Height - 50, Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top }; pnlSteps.Controls.Add(ctrl); currentStep = 2; } break; case 4: { pnlSteps.Visible = true; btnNext.Visible = true; btnNext.Enabled = true; btnPrevious.Visible = true; btnReset.Visible = true; pnlSteps.Controls[0].Dispose(); pnlSteps.Controls.Clear(); var ctrl = new PrivilegeLevelSelectionControl(rManager, entities, settings) { Width = Width, Height = Height - 50, Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top }; pnlSteps.Controls.Add(ctrl); currentStep = 3; } break; } }