private WebResourcePublishCommand(AsyncPackage package, OleMenuCommandService commandService, IVsSettingsManager vsSettingsManager)
        {
            m_token     = new CancellationToken();
            m_pane      = new Guid("A8E3D03E-28C9-4900-BD48-CEEDEC35E7E6");
            m_service   = new DteService(vsSettingsManager);
            m_package   = package ?? throw new ArgumentNullException(nameof(package));
            m_telemetry = new TelemetryWrapper(m_service.Version, VersionHelper.GetVersionFromManifest());

            if (commandService != null)
            {
                var deployMenuCommandID = new CommandID(CommandSet, DeployCommandId);
                var deployMenuItem      = new OleMenuCommand(DeployMenuItemCallback, deployMenuCommandID);
                deployMenuItem.BeforeQueryStatus += HandleDeployMenuState;
                commandService.AddCommand(deployMenuItem);

                var initializeMenuCommandId = new CommandID(CommandSet, InitCommandId);
                var initMenuItem            = new OleMenuCommand(InitMenuItemCallback, initializeMenuCommandId);
                initMenuItem.BeforeQueryStatus += HandleInitMenuState;
                commandService.AddCommand(initMenuItem);

                var singeDeplotMenuCommandId = new CommandID(CommandSet, SingleDeployCommandId);
                var initSingleDeploy         = new OleMenuCommand(SingleDeployMenuItemCallback, singeDeplotMenuCommandId);
                initSingleDeploy.BeforeQueryStatus += HandleSingleDeployMenuState;
                commandService.AddCommand(initSingleDeploy);

                // Fix for enable/disable states
                HandleInitMenuState(initMenuItem, null);
                HandleDeployMenuState(deployMenuItem, null);
            }
        }
 public NewPublishSettingsPageViewModel(DteService service, TelemetryWrapper telemetry)
 {
     SaveConfigurationCommand = new RelayCommand <DialogWindow>((w) => Save(w));
     NavigateToPatGuide       = new RelayCommand(() => NavigateToUrl());
     Configuration            = new DeployConfigurationModelFacade();
     m_service   = service;
     m_telemetry = telemetry;
 }
Beispiel #3
0
 public NewPublishSettingsPage(DteService dteService, TelemetryWrapper telemetry)
 {
     InitializeComponent();
     DataContext = new NewPublishSettingsPageViewModel(dteService, telemetry);
 }