private void SwitchUIStage(ReplacerStages stage) { Control visibleLayout = null; switch (stage) { case ReplacerStages.FilesSelection: visibleLayout = FilesSelectionStageLayout; break; case ReplacerStages.RegexInput: visibleLayout = RegexStageLayout; break; case ReplacerStages.Preview: visibleLayout = PreviewStageLayout; _localizationManager.ApplyResource(btnCancel, "Text", "Cancel"); btnCancel.Enabled = true; _localizationManager.ApplyResource(btnRegexStagePrev, "Text", "RegexStagePrev"); btnRegexStagePrev.Enabled = false; break; case ReplacerStages.Replacing: //break; default: //visibleLayout = FilesSelectionStageLayout; break; } foreach (var controlObj in Controls) { var control = controlObj as Control; if (control == null) { continue; } if (control.Name.Contains("StageLayout")) { control.Visible = control == visibleLayout; } } }
private void SwitchUIStage(ReplacerStages stage) { Control visibleLayout = null; switch (stage) { case ReplacerStages.FilesSelection: visibleLayout = FilesSelectionStageLayout; break; case ReplacerStages.RegexInput: visibleLayout = RegexStageLayout; break; case ReplacerStages.Preview: visibleLayout = PreviewStageLayout; _localizationManager.ApplyResource(btnCancel, "Text", "Cancel"); btnCancel.Enabled = true; _localizationManager.ApplyResource(btnRegexStagePrev, "Text", "RegexStagePrev"); btnRegexStagePrev.Enabled = false; break; case ReplacerStages.Replacing: //break; default: //visibleLayout = FilesSelectionStageLayout; break; } foreach (var controlObj in Controls) { var control = controlObj as Control; if (control == null) continue; if (control.Name.Contains("StageLayout")) { control.Visible = control == visibleLayout; } } }