//public const string PackageGuidString = "14261379-f70d-4d2a-b69f-653605fb158f"; protected override async Task InitializeAsync(CancellationToken cancellationToken, IProgress <ServiceProgressData> progress) { await this.JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken); await TypeScriptHtmlSwitchCommand.InitializeAsync(this); await NgServeCommand.InitializeAsync(this); await OpenInCmdCommand.InitializeAsync(this); }
/// <summary> /// Initializes the singleton instance of the command. /// </summary> /// <param name="package">Owner package, not null.</param> public static async Task InitializeAsync(AsyncPackage package) { // Switch to the main thread - the call to AddCommand in TypeScriptHtmlSwitchCommand's constructor requires // the UI thread. await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(package.DisposalToken); var dte = package.GetServiceAsync(typeof(EnvDTE.DTE)).Result as EnvDTE.DTE; dte.Events.WindowEvents.WindowActivated += WindowEvents_WindowActivated;; OleMenuCommandService commandService = await package.GetServiceAsync((typeof(IMenuCommandService))) as OleMenuCommandService; Instance = new TypeScriptHtmlSwitchCommand(package, commandService); }