Example #1
0
        private bool OpenExternalEditorDialog()
        {
            var cfg    = new Settings();
            var dialog = new ExternalEditorDialog
            {
                Owner = this,
                ExternalEditorPath = cfg.ExternalEditorPath,
                CommandLineStyle   = cfg.ExternalEditorCommandLineStyle
            };

            if (dialog.CommandLineStyle == "Custom")
            {
                dialog.CommandLinePattern = cfg.ExternalEditorCommandLinePattern;
            }
            if (dialog.ShowDialog() == true)
            {
                cfg.ExternalEditorPath               = dialog.ExternalEditorPath;
                cfg.ExternalEditorCommandLineStyle   = dialog.CommandLineStyle;
                cfg.ExternalEditorCommandLinePattern = dialog.CommandLinePattern;
                cfg.Save();

                _externalEditorPath = cfg.ExternalEditorPath;
                _externalEditorCommandLinePattern = ExternalEditorDialog.NameToPattern(cfg.ExternalEditorCommandLineStyle,
                                                                                       cfg.ExternalEditorCommandLinePattern);

                return(true);
            }

            return(false);
        }
Example #2
0
        public MainWindow()
        {
            ShowInExplorerCommand = new RelayCommand(ShowInExplorer_OnClick);
            OpenLangFileCommand   = new RelayCommand(OpenLangFile_OnClick);
            ByFileCommand         = new RelayCommand(_ =>
            {
                TemplateName = "ByFileTemplate";
            });
            ByIdCommand = new RelayCommand(_ =>
            {
                TemplateName = "ByIdTemplate";
            });
            ToggleDialogPreview = new RelayCommand(ToggleDialogPreview_OnClick);

            ReplaceTextInAll       = new RelayCommand(CurrentString_ReplaceTextInAll_OnClick);
            ReplaceIdentifierInAll = new RelayCommand(CurrentString_ReplaceIdentifierInAll_OnClick);
            InsertAfterInAll       = new RelayCommand(CurrentString_InsertAfterInAll_OnClick);
            InsertIntoAllMissing   = new RelayCommand(CurrentString_InsertIntoAllMissing_OnClick);

            var cfg = new Settings();

            _externalEditorPath = cfg.ExternalEditorPath;
            _externalEditorCommandLinePattern = ExternalEditorDialog.NameToPattern(cfg.ExternalEditorCommandLineStyle, cfg.ExternalEditorCommandLinePattern);
            _dialogPreviewEnabled             = cfg.DialogPreview;

            InitializeComponent();
        }