Пример #1
0
        protected override async Task InitializeAsync(CancellationToken cancellationToken,
                                                      IProgress <ServiceProgressData> progress)
        {
            // When initialized asynchronously, the current thread may be a background thread at this point.
            // Do any initialization that requires the UI thread after switching to the UI thread.
            await JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken);

            await Lighthouse.InitializeAsync(this);
        }
Пример #2
0
        public static async Task InitializeAsync(AsyncPackage package)
        {
            await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(package.DisposalToken);

            OleMenuCommandService commandService =
                await package.GetServiceAsync(typeof(IMenuCommandService)) as OleMenuCommandService;

            Instance = new Lighthouse(package, commandService);

            output = package.GetOutputPane(new Guid("25E5EFF8-A5E5-48E1-B607-B1C9410BFC04"), title);

            Init();
        }