internal CopyFavoriteCommand(IPersistence persistence, Func<InputBoxResult> copyPrompt = null)
        {
            this.favorites = persistence.Favorites;
            var renameService = new RenameCopyService(persistence.Favorites);
            renameService.RenameAction = this.AddIfValid; // property injection
            this.renameCommand = new FavoriteRenameCommand(persistence, renameService);

            if (copyPrompt != null)
                this.copyPrompt = copyPrompt;
            else
                this.copyPrompt = () => InputBox.Show("Enter new name:", "Duplicate selected favorite as ...");
        }
예제 #2
0
        internal CopyFavoriteCommand(IPersistence persistence, Func <InputBoxResult> copyPrompt = null)
        {
            this.favorites = persistence.Favorites;
            var renameService = new RenameCopyService(persistence.Favorites);

            renameService.RenameAction = this.AddIfValid; // property injection
            this.renameCommand         = new FavoriteRenameCommand(persistence, renameService);

            if (copyPrompt != null)
            {
                this.copyPrompt = copyPrompt;
            }
            else
            {
                this.copyPrompt = () => InputBox.Show("Enter new name:", "Duplicate selected favorite as ...");
            }
        }