public static async Task InitializeAsync(AsyncPackage package) { var commandService = await package.GetServiceAsync(typeof(IMenuCommandService)) as OleMenuCommandService; var dte = await package.GetServiceAsync(typeof(DTE)) as DTE2; Instance = new DiffFilesCommand(commandService, dte); }
/// <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 DiffFilesCommand's constructor requires // the UI thread. await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(package.DisposalToken); OleMenuCommandService commandService = await package.GetServiceAsync(typeof(IMenuCommandService)) as OleMenuCommandService; Instance = new DiffFilesCommand(package, commandService); }
public static void Initialize(Package package) { Instance = new DiffFilesCommand(package); }
protected override async Task InitializeAsync(CancellationToken cancellationToken, IProgress <ServiceProgressData> progress) { await JoinableTaskFactory.SwitchToMainThreadAsync(); await DiffFilesCommand.InitializeAsync(this); }
protected override async Task InitializeAsync(CancellationToken cancellationToken, IProgress <ServiceProgressData> progress) { await DiffFilesCommand.Initialize(this); }
protected override void Initialize() { DiffFilesCommand.Initialize(this); base.Initialize(); }
private static void SetInstance(DiffFilesCommand value) { instance = value; }