public ImportRuleViewModel(ImportRuleInfo importRuleInfo)
        {
            ImportRuleInfo = importRuleInfo;

            WarningHeader = $"Rule '{importRuleInfo.NewRegexRule.RuleName}' Already Exists";
            WarningBody   = "Do you want to update the existing rule, rename it, or skip this import?";

            ReplaceAllCommand  = new ReplaceAllCommand(this);
            ReplaceRuleCommand = new ReplaceRuleCommand(this);
            RenameAllCommand   = new RenameAllCommand(this);
            RenameRuleCommand  = new RenameRuleCommand(this);
            SkipAllCommand     = new SkipAllCommand(this);
            SkipRuleCommand    = new SkipRuleCommand(this);
        }
Exemple #2
0
        void RenameFiles()
        {
            if (!_renamerModel.Clashes)
            {
                RenameAllCommand renameAllCommand = new RenameAllCommand(_renamerModel.GenerateRenameCommands(), showDialog);

                renameAllCommand.Run();

                if (renameAllCommand.Successful)
                {
                    MessageBox.Show("Files renamed.");
                }
                else
                {
                    MessageBox.Show("File renaming cancelled.");
                }

                Application.Current.Shutdown();
            }
            else
            {
                MessageBox.Show("Cannot rename files since some clash.");
            }
        }