protected override async Task <IDialController> TryCreateControllerAsyncOverride(IAsyncServiceProvider provider, CancellationToken cancellationToken)
        {
            string iconFilePath = VsHelpers.GetFileInVsix(@"Providers\Customizable\icon.png");
            var    menuItem     = await CreateMenuItemAsync(Moniker, iconFilePath);

            var dte = await provider.GetDteAsync(cancellationToken);

            return(new CustomizableController(menuItem, dte));
        }
        protected override async Task <IDialController> TryCreateControllerAsyncOverride(IAsyncServiceProvider provider, CancellationToken cancellationToken)
        {
            string iconFilePath = VsHelpers.GetFileInVsix(@"Providers\Find\icon.png");
            var    menuItem     = await CreateMenuItemAsync(Moniker, iconFilePath);

            var dte = await provider.GetDteAsync(cancellationToken);

            //IVsTextManager textManager = await provider.GetServiceAsync<SVsTextManager, IVsTextManager>(cancellationToken);
            return(new FindController(menuItem, dte));
        }
        protected override async Task <IDialController> TryCreateControllerAsyncOverride(IAsyncServiceProvider provider, CancellationToken cancellationToken)
        {
            string iconFilePath = VsHelpers.GetFileInVsix("Providers\\Bookmarks\\icon.png");
            var    menuItem     = await CreateMenuItemAsync(Moniker, iconFilePath);

            var dte = await provider.GetDteAsync(cancellationToken);

            await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken);

            return(new BookmarksController(menuItem, dte));
        }
Ejemplo n.º 4
0
        public static async Task InitializeAsync(IAsyncServiceProvider provider, JoinableTask optionsLoadTask, CancellationToken cancellationToken)
        {
            var dte = await provider.GetDteAsync(cancellationToken);

            var compositionService = await provider.GetServiceAsync <SComponentModel, IComponentModel>(cancellationToken);

            Instance = new DialControllerHost(provider, dte, compositionService);
            var mainWindow = dte.DTE.MainWindow;
            await Task.WhenAll(
                ThreadHelper.JoinableTaskFactory.StartOnIdle(Instance.CreateStatusBarItem).JoinAsync(),
                ThreadHelper.JoinableTaskFactory.StartOnIdle(new Action(() => controllersMapping.Add(mainWindow, Instance.CreateController(mainWindow)))).JoinAsync());

            await optionsLoadTask;
            await Instance.ImportProvidersAsync(cancellationToken);
        }