Ejemplo n.º 1
0
            public void ConnectAndBind()
            {
                if (this.host.ActiveSection == null)
                {
                    EventHandler activeSectionChanged = null;
                    activeSectionChanged = (o, e) =>
                    {
                        this.host.ActiveSectionChanged -= activeSectionChanged;
                        this.WhenNotBusy(this.Start);
                    };
                    this.host.ActiveSectionChanged += activeSectionChanged;
                }
                else
                {
                    this.WhenNotBusy(this.Start);
                }

                // Navigating at this point will work in both cases - if there's no active section
                // we will navigate and the ActiveSectionChanged event will be triggered.
                // If there's an active section will navigate (activate TE) and show the connecting/binding process.
                // We drive the process via the ActiveSection, so this step is mandatory
                ITeamExplorerController teController = this.host.GetMefService <ITeamExplorerController>();

                if (teController != null)
                {
                    teController.ShowSonarQubePage();
                }
                else
                {
                    Debug.Fail("Cannot find ITeamExplorerController");
                }
            }
Ejemplo n.º 2
0
        public void Initialize(ITeamExplorerController teamExplorerController, IProjectPropertyManager projectPropertyManager)
        {
            // Buttons
            this.RegisterCommand((int)PackageCommandId.ManageConnections, new ManageConnectionsCommand(teamExplorerController));
            this.RegisterCommand((int)PackageCommandId.ProjectExcludePropertyToggle, new ProjectExcludePropertyToggleCommand(projectPropertyManager));
            this.RegisterCommand((int)PackageCommandId.ProjectTestPropertyAuto, new ProjectTestPropertySetCommand(projectPropertyManager, null));
            this.RegisterCommand((int)PackageCommandId.ProjectTestPropertyTrue, new ProjectTestPropertySetCommand(projectPropertyManager, true));
            this.RegisterCommand((int)PackageCommandId.ProjectTestPropertyFalse, new ProjectTestPropertySetCommand(projectPropertyManager, false));

            // Menus
            this.RegisterCommand((int)PackageCommandId.ProjectSonarLintMenu, new ProjectSonarLintMenuCommand(projectPropertyManager));
        }
        internal SonarQubeNavigationItem([Import] ITeamExplorerController controller)
        {
            if (controller == null)
            {
                throw new ArgumentNullException(nameof(controller));
            }

            this.controller = controller;

            this.Text = Strings.TeamExplorerPageTitle;
            this.IsVisible = true;
            this.IsEnabled = true;

            var image = ResourceHelper.Get<DrawingImage>("SonarQubeServerIcon");
            this.m_icon = image != null ? new DrawingBrush(image.Drawing) : null;

            this.m_defaultArgbColorBrush = ResourceHelper.Get<SolidColorBrush>("SQForegroundBrush");
        }
        internal SonarQubeNavigationItem([Import] ITeamExplorerController controller)
        {
            if (controller == null)
            {
                throw new ArgumentNullException(nameof(controller));
            }

            this.controller = controller;

            this.Text      = Strings.TeamExplorerPageTitle;
            this.IsVisible = true;
            this.IsEnabled = true;

            var image = ResourceHelper.Get <DrawingImage>("SonarQubeServerIcon");

            this.m_icon = image != null ? new DrawingBrush(image.Drawing) : null;

            this.m_defaultArgbColorBrush = ResourceHelper.Get <SolidColorBrush>("SQForegroundBrush");
        }
 public ManageConnectionsCommand(ITeamExplorerController teamExplorer)
 {
     this.teamExplorer = teamExplorer;
 }
 public ManageConnectionsCommand(IServiceProvider serviceProvider)
     : base(serviceProvider)
 {
     this.teamExplorer = this.ServiceProvider.GetMefService<ITeamExplorerController>();
     Debug.Assert(this.teamExplorer != null, "Couldn't get Team Explorer controller from MEF");
 }
 public ManageConnectionsCommand(IServiceProvider serviceProvider)
     : base(serviceProvider)
 {
     this.teamExplorer = this.ServiceProvider.GetMefService <ITeamExplorerController>();
     Debug.Assert(this.teamExplorer != null, "Couldn't get Team Explorer controller from MEF");
 }