Beispiel #1
0
        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;
                }
            }
        }
Beispiel #2
0
        private void InitializeLocalization()
        {
            _localizationManager = new LocalizationManager("Language");
            _localizationManager.ApplyResource(lblFileSelection, "Text", "FileSelectionCaption");
            _localizationManager.ApplyResource(btnChooseFiles, "Text", "SelectFiles");
            _localizationManager.ApplyResource(btnOpenFileList, "Text", "OpenFileList");
            _localizationManager.ApplyResource(lblFileList, "Text", "FileListCaption");
            _localizationManager.ApplyResource(boxFileList, "Text", "EmptyFileList");
            _localizationManager.ApplyResource(btnClearFileList, "Text", "ClearFileList");
            _localizationManager.ApplyResource(btnSaveFileList, "Text", "SaveFileList");
            _localizationManager.ApplyResource(btnRegexStageNext, "Text", "RegexStageNext");

            _localizationManager.ApplyResource(btnFileSelectionStagePrev, "Text", "FileSelectionStagePrev");

            _localizationManager.ApplyResource(btnRegexStagePrev, "Text", "RegexStagePrev");
            _localizationManager.ApplyResource(btnCancel, "Text", "Cancel");
        }