Aurelia.DotNet.VSIX.Commands.GenerateAttribute.InitializeAsync C# (CSharp) Method

InitializeAsync() public static method

Initializes the singleton instance of the command.
public static InitializeAsync ( AsyncPackage package ) : System.Threading.Tasks.Task
package AsyncPackage Owner package, not null.
return System.Threading.Tasks.Task
        public static async Task InitializeAsync(AsyncPackage package)
        {
            // Switch to the main thread - the call to AddCommand in Command1's constructor requires
            // the UI thread.
            await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(package.DisposalToken);
            var dte = await package.GetServiceAsync(typeof(DTE)) as DTE2;

            OleMenuCommandService commandService = await package.GetServiceAsync(typeof(IMenuCommandService)) as OleMenuCommandService;
            Instance = new GenerateAttribute(package, commandService, dte);
        }