Пример #1
0
 private void OnVbeSelectionChanged(object sender, EventArgs e)
 {
     Task.Run(() =>
     {
         var selectedDeclaration = _selectedDeclarationProvider.SelectedDeclaration();
         var eventArgs           = new DeclarationChangedEventArgs(_vbe, selectedDeclaration);
         DispatchSelectedDeclaration(eventArgs);
     });
 }
        protected override Declaration FindTargetDeclaration(QualifiedSelection targetSelection)
        {
            var selectedDeclaration = _selectedDeclarationProvider.SelectedDeclaration(targetSelection);

            var isInvalidSelection = selectedDeclaration == null ||
                                     selectedDeclaration.DeclarationType != DeclarationType.Variable ||
                                     selectedDeclaration.ParentScopeDeclaration.DeclarationType.HasFlag(DeclarationType.Member);

            return(isInvalidSelection ? null : selectedDeclaration);
        }
Пример #3
0
        private Declaration FindTarget(object parameter)
        {
            if (parameter is Declaration declaration)
            {
                return(declaration);
            }

            var selectedDeclaration = _selectedDeclarationProvider.SelectedDeclaration();

            return(selectedDeclaration);
        }
Пример #4
0
        protected override Declaration FindTargetDeclaration(QualifiedSelection targetSelection)
        {
            var selectedDeclaration = _selectedDeclarationProvider.SelectedDeclaration(targetSelection);

            if (selectedDeclaration == null ||
                selectedDeclaration.DeclarationType != DeclarationType.Variable)
            {
                return(null);
            }

            return(selectedDeclaration);
        }
        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 (selectedDeclaration == null ||
                selectedDeclaration.DeclarationType != DeclarationType.Variable ||
                selectedDeclaration.ParentScopeDeclaration.DeclarationType.HasFlag(DeclarationType.Member))
            {
                return(null);
            }

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

            if (selectedDeclaration == null ||
                selectedDeclaration.DeclarationType != DeclarationType.Variable ||
                selectedDeclaration.ParentScopeDeclaration.DeclarationType.HasFlag(DeclarationType.Member))
            {
                return(null);
            }

            return(selectedDeclaration);
        }
Пример #8
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);
        }
        private Declaration GetTarget()
        {
            var selectedDeclaration = _selectedDeclarationProvider.SelectedDeclaration();

            if (selectedDeclaration == null ||
                (selectedDeclaration.DeclarationType != DeclarationType.Variable &&
                 selectedDeclaration.DeclarationType != DeclarationType.Constant) ||
                !selectedDeclaration.References.Any())
            {
                return(null);
            }

            return(selectedDeclaration);
        }
 private Declaration GetTarget()
 {
     return(_selectedDeclarationProvider.SelectedDeclaration());
 }
Пример #11
0
 private Declaration FindCodePaneTarget()
 {
     return(_selectedDeclarationProvider.SelectedDeclaration());
 }
 protected override Declaration FindTargetDeclaration(QualifiedSelection targetSelection)
 {
     return(_selectedDeclarationProvider.SelectedDeclaration(targetSelection));
 }
Пример #13
0
 protected override Declaration GetTarget()
 {
     return(_selectedDeclarationProvider.SelectedDeclaration());
 }
 private Declaration FindTargetDeclaration()
 {
     return(_selectedDeclarationProvider.SelectedDeclaration()
            ?? ActiveProjectDeclaration());
 }