Ejemplo n.º 1
0
        public async Task <IDialController> TryCreateControllerAsync(IDialControllerHost host, IAsyncServiceProvider provider, CancellationToken cancellationToken)
        {
            string iconFilePath = VsHelpers.GetFileInVsix(@"Providers\Errors\icon.png");
            await host.AddMenuItemAsync(Moniker, iconFilePath);

            return(new ErrorsController(host));
        }
        public async Task <IDialController> TryCreateControllerAsync(IDialControllerHost host, IAsyncServiceProvider provider, CancellationToken cancellationToken)
        {
            string iconFilePath = VsHelpers.GetFileInVsix(@"Providers\Zoom\icon.png");
            await host.AddMenuItemAsync(Moniker, iconFilePath);

            IVsTextManager textManager = await provider.GetServiceAsync <SVsTextManager, IVsTextManager>(cancellationToken);

            return(new ZoomController(host, textManager));
        }
        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));
        }