private RestoreOnBuildCommand(Package package, OleMenuCommandService commandService)
        {
            _package        = package;
            _componentModel = VsHelpers.GetService <SComponentModel, IComponentModel>();

            var cmdId = new CommandID(PackageGuids.guidLibraryManagerPackageCmdSet, PackageIds.RestoreOnBuild);
            var cmd   = new OleMenuCommand(ExecuteHandlerAsync, cmdId);

            cmd.BeforeQueryStatus += BeforeQueryStatusHandlerAsync;
            commandService.AddCommand(cmd);
        }
Пример #2
0
        private RestoreOnBuildCommand(AsyncPackage package, OleMenuCommandService commandService, IDependenciesFactory dependenciesFactory)
        {
            _package             = package;
            _componentModel      = VsHelpers.GetService <SComponentModel, IComponentModel>();
            _dependenciesFactory = dependenciesFactory;

            var cmdId = new CommandID(PackageGuids.guidLibraryManagerPackageCmdSet, PackageIds.RestoreOnBuild);
            var cmd   = new OleMenuCommand((s, e) => _package.JoinableTaskFactory.RunAsync(() => ExecuteAsync(s, e)),
                                           cmdId);

            cmd.BeforeQueryStatus += (s, e) => _package.JoinableTaskFactory.RunAsync(() => BeforeQueryStatusAsync(s, e));
            commandService.AddCommand(cmd);
        }