コード例 #1
0
        protected override async Task InitializeAsync(CancellationToken cancellationToken, IProgress <ServiceProgressData> progress)
        {
            await base.InitializeAsync(cancellationToken, progress);

            await JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken);

            await ApplyCustomTool.InitializeAsync(this);
        }
コード例 #2
0
        public static async Task InitializeAsync(AsyncPackage package)
        {
            await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(package.DisposalToken);

            dte = await package.GetServiceAsync(typeof(DTE)) as DTE ??
                  throw new ServiceUnavailableException(typeof(DTE));

            var commandService = await package.GetServiceAsync(typeof(IMenuCommandService)) as OleMenuCommandService ??
                                 throw new ServiceUnavailableException(typeof(OleMenuCommandService));

            Instance = new ApplyCustomTool(package, commandService);
        }