public void SetStatusText(string value = null)
        {
            var text = value ?? RubberduckUI.ResourceManager.GetString("ParserState_" + _state.Status);

            _logger.Debug("RubberduckCommandBar status text changes to '{0}'.", text);
            UiDispatcher.Invoke(() => _statusButton.Caption = text);
        }
        public void SetSelectionText(Declaration declaration)
        {
            if (declaration == null && _vbe.ActiveCodePane != null)
            {
                var selection = _vbe.ActiveCodePane.GetQualifiedSelection();
                if (selection.HasValue)
                {
                    SetSelectionText(selection.Value);
                }
                _selectionButton.TooltipText = _selectionButton.Caption;
            }
            else if (declaration == null && _vbe.ActiveCodePane == null)
            {
                UiDispatcher.Invoke(() => _selectionButton.Caption = string.Empty);
            }
            else if (declaration != null && !declaration.IsBuiltIn && declaration.DeclarationType != DeclarationType.ClassModule && declaration.DeclarationType != DeclarationType.ProceduralModule)
            {
                var typeName = declaration.HasTypeHint
                    ? Declaration.TypeHintToTypeName[declaration.TypeHint]
                    : declaration.AsTypeName;

                _selectionButton.Caption = string.Format("{0}|{1}: {2} ({3}{4})",
                                                         declaration.QualifiedSelection.Selection,
                                                         declaration.QualifiedName.QualifiedModuleName,
                                                         declaration.IdentifierName,
                                                         RubberduckUI.ResourceManager.GetString("DeclarationType_" + declaration.DeclarationType, Settings.Settings.Culture),
                                                         string.IsNullOrEmpty(declaration.AsTypeName) ? string.Empty : ": " + typeName);

                _selectionButton.TooltipText = string.IsNullOrEmpty(declaration.DescriptionString)
                    ? _selectionButton.Caption
                    : declaration.DescriptionString;
            }
            else if (declaration != null)
            {
                // todo: confirm this is what we want, and then refator
                var selection = _vbe.ActiveCodePane.GetQualifiedSelection();
                if (selection.HasValue)
                {
                    var typeName = declaration.HasTypeHint
                        ? Declaration.TypeHintToTypeName[declaration.TypeHint]
                        : declaration.AsTypeName;

                    _selectionButton.Caption = string.Format("{0}|{1}: {2} ({3}{4})",
                                                             selection.Value.Selection,
                                                             declaration.QualifiedName.QualifiedModuleName,
                                                             declaration.IdentifierName,
                                                             RubberduckUI.ResourceManager.GetString("DeclarationType_" + declaration.DeclarationType, Settings.Settings.Culture),
                                                             string.IsNullOrEmpty(declaration.AsTypeName) ? string.Empty : ": " + typeName);
                }
                _selectionButton.TooltipText = string.IsNullOrEmpty(declaration.DescriptionString)
                    ? _selectionButton.Caption
                    : declaration.DescriptionString;
            }
        }
 private void SetSelectionText(QualifiedSelection selection)
 {
     UiDispatcher.Invoke(() => _selectionButton.Caption = selection.ToString());
 }
        public void SetStatusText(string value = null)
        {
            var text = value ?? RubberduckUI.ResourceManager.GetString("ParserState_" + _state.Status, Settings.Settings.Culture);

            UiDispatcher.Invoke(() => _statusButton.Caption = text);
        }