private Declaration GetTarget() { var selectedDeclaration = _selectedDeclarationProvider.SelectedDeclaration(); if (!ValidDeclarationTypes.Contains(selectedDeclaration.DeclarationType)) { return(selectedDeclaration.DeclarationType == DeclarationType.Parameter ? _selectedDeclarationProvider.SelectedMember() : null); } return(selectedDeclaration); }
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); }
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); }