protected RefactorCommandBase(IRefactoring refactoring, IRefactoringFailureNotifier failureNotifier, IParserStatusProvider parserStatusProvider)
        {
            Refactoring          = refactoring;
            ParserStatusProvider = parserStatusProvider;
            FailureNotifier      = failureNotifier;

            AddToCanExecuteEvaluation(SpecialEvaluateCanExecute);
        }
        protected RefactorCodePaneCommandBase(
            IRefactoring refactoring,
            IRefactoringFailureNotifier failureNotifier,
            ISelectionProvider selectionProvider,
            IParserStatusProvider parserStatusProvider)
            : base(refactoring, failureNotifier, parserStatusProvider)
        {
            SelectionProvider = selectionProvider;

            AddToCanExecuteEvaluation(SpecializedEvaluateCanExecute);
        }
 protected CodeExplorerInteractiveRefactoringCommandBase(
     IRefactoringAction <TModel> refactoringAction,
     IRefactoringUserInteraction <TModel> refactoringUserInteraction,
     IRefactoringFailureNotifier failureNotifier,
     IParserStatusProvider parserStatusProvider,
     IVbeEvents vbeEvents)
     : base(refactoringAction, failureNotifier, parserStatusProvider, vbeEvents)
 {
     _refactoringUserInteraction = refactoringUserInteraction;
     _refactoringAction          = refactoringAction;
     _failureNotifier            = failureNotifier;
 }
예제 #4
0
        public RenameCommand(
            RenameRefactoring refactoring,
            RenameFailedNotifier renameFailedNotifier,
            IParserStatusProvider parserStatusProvider,
            IVbeEvents vbeEvents)
            : base(vbeEvents)
        {
            _refactoring          = refactoring;
            _failureNotifier      = renameFailedNotifier;
            _parserStatusProvider = parserStatusProvider;

            AddToCanExecuteEvaluation(SpecialEvaluateCanExecute);
        }
예제 #5
0
        protected CodeExplorerRefactoringCommandBase(
            IRefactoringAction <TModel> refactoringAction,
            IRefactoringFailureNotifier failureNotifier,
            IParserStatusProvider parserStatusProvider,
            IVbeEvents vbeEvents)
            : base(vbeEvents)
        {
            _refactoringAction = refactoringAction;
            _failureNotifier   = failureNotifier;

            _parserStatusProvider = parserStatusProvider;

            AddToCanExecuteEvaluation(SpecialEvaluateCanExecute);
        }
예제 #6
0
        public AnnotateDeclarationCommand(
            AnnotateDeclarationRefactoringAction annotateAction,
            AnnotateDeclarationFailedNotifier failureNotifier,
            RefactoringUserInteraction <IAnnotateDeclarationPresenter, AnnotateDeclarationModel> userInteraction,
            IVbeEvents vbeEvents,
            RubberduckParserState state)
            : base(vbeEvents)
        {
            _annotateAction  = annotateAction;
            _failureNotifier = failureNotifier;
            _userInteraction = userInteraction;
            _state           = state;

            AddToCanExecuteEvaluation(SpecialEvaluateCanExecute);
        }
        protected CodeExplorerMoveToFolderCommandBase(
            MoveMultipleFoldersRefactoringAction moveFolders,
            MoveMultipleToFolderRefactoringAction moveToFolder,
            MoveToFolderRefactoringFailedNotifier failureNotifier,
            IParserStatusProvider parserStatusProvider,
            IVbeEvents vbeEvents,
            RubberduckParserState state)
            : base(vbeEvents)
        {
            _moveFolders  = moveFolders;
            _moveToFolder = moveToFolder;

            _parserStatusProvider = parserStatusProvider;
            _state           = state;
            _failureNotifier = failureNotifier;

            AddToCanExecuteEvaluation(SpecialEvaluateCanExecute);
        }
 private static void ExecuteRefactoringAction <TModel>(
     TModel model,
     object parameter,
     Action <TModel> initialModelValidation,
     Func <TModel, object, TModel> modelModification,
     IRefactoringAction <TModel> refactoringAction,
     IRefactoringFailureNotifier failureNotifier)
     where TModel : class, IRefactoringModel
 {
     try
     {
         initialModelValidation(model);
         var modifiedModel = modelModification(model, parameter);
         refactoringAction.Refactor(modifiedModel);
     }
     catch (RefactoringAbortedException)
     {}
     catch (RefactoringException exception)
     {
         failureNotifier.Notify(exception);
     }
 }
 protected RefactorDeclarationCommandBase(IRefactoring refactoring, IRefactoringFailureNotifier failureNotifier, IParserStatusProvider parserStatusProvider)
     : base(refactoring, failureNotifier, parserStatusProvider)
 {
 }