/// <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 OpenConfig's constructor requires // the UI thread. await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(package.DisposalToken); OleMenuCommandService commandService = await package.GetServiceAsync(typeof(IMenuCommandService)) as OleMenuCommandService; Instance = new OpenConfig(package, commandService); }
public void Opened() { try { JoinableTaskFactory.RunAsync(async() => { await Config.Instance.VerifyConfigAsync(); await AutoFetch.InitializeAsync(this); await OpenConfig.InitializeAsync(this); }); } catch (Exception ex) { throw ex; } }