private Declaration GetTarget()
        {
            var selectedDeclaration = _selectedDeclarationProvider.SelectedDeclaration();

            if (!ValidDeclarationTypes.Contains(selectedDeclaration.DeclarationType))
            {
                return(selectedDeclaration.DeclarationType == DeclarationType.Parameter
                    ? _selectedDeclarationProvider.SelectedMember()
                    : null);
            }

            return(selectedDeclaration);
        }
Esempio n. 2
0
        protected override Declaration FindTargetDeclaration(QualifiedSelection targetSelection)
        {
            var selectedDeclaration = _selectedDeclarationProvider.SelectedDeclaration(targetSelection);

            if (!ValidDeclarationTypes.Contains(selectedDeclaration.DeclarationType))
            {
                return(selectedDeclaration.DeclarationType == DeclarationType.Parameter
                    ? _selectedDeclarationProvider.SelectedMember(targetSelection)
                    : null);
            }

            return(selectedDeclaration);
        }
Esempio n. 3
0
        protected override ReorderParametersModel InitializeModel(Declaration target)
        {
            if (target == null)
            {
                throw new TargetDeclarationIsNullException();
            }

            if (!ValidDeclarationTypes.Contains(target.DeclarationType))
            {
                throw new InvalidDeclarationTypeException(target);
            }

            var model = DerivedTarget(new ReorderParametersModel(target));

            return(model);
        }