protected override void Initialize()
        {
            base.Initialize();

            var menus = ServiceProvider.GetExportedValue <IMenuProvider>();

            foreach (var menu in menus.Menus)
            {
                ServiceProvider.AddTopLevelMenuItem(menu.Guid, menu.CmdId, (s, e) => menu.Activate());
            }

            foreach (var menu in menus.DynamicMenus)
            {
                ServiceProvider.AddDynamicMenuItem(menu.Guid, menu.CmdId, menu.CanShow, menu.Activate);
            }
        }
        protected override void Initialize()
        {
            ServiceProvider.AddTopLevelMenuItem(GuidList.guidGitHubCmdSet, PkgCmdIDList.addConnectionCommand, (s, e) => StartFlow(UIControllerFlow.Authentication));
            ServiceProvider.AddTopLevelMenuItem(GuidList.guidGitHubCmdSet, PkgCmdIDList.showGitHubPaneCommand, (s, e) =>
            {
                var window = FindToolWindow(typeof(GitHubPane), 0, true);
                if (window?.Frame == null)
                {
                    throw new NotSupportedException("Cannot create tool window");
                }

                var windowFrame = (IVsWindowFrame)window.Frame;
                ErrorHandler.ThrowOnFailure(windowFrame.Show());
            });
            base.Initialize();
        }
Example #3
0
        public override void Initialize(IServiceProvider serviceProvider)
        {
            base.Initialize(serviceProvider);

            var disp = ServiceProvider.GetExportedValue <IUIProvider>().GetService <IExportFactoryProvider>().UIControllerFactory.CreateExport();

            disposables.Add(disp);
            uiController = disp.Value;

            ServiceProvider.AddTopLevelMenuItem(GuidList.guidGitHubToolbarCmdSet, PkgCmdIDList.pullRequestCommand,
                                                (s, e) => {});

            ServiceProvider.AddTopLevelMenuItem(GuidList.guidGitHubToolbarCmdSet, PkgCmdIDList.backCommand,
                                                (s, e) => { });

            ServiceProvider.AddTopLevelMenuItem(GuidList.guidGitHubToolbarCmdSet, PkgCmdIDList.forwardCommand,
                                                (s, e) => { });

            ServiceProvider.AddTopLevelMenuItem(GuidList.guidGitHubToolbarCmdSet, PkgCmdIDList.refreshCommand,
                                                (s, e) => { });
        }