コード例 #1
0
        public NuGetProjectContext()
        {
            packageManagementEvents = PackageManagementServices.PackageManagementEvents;
            var commonOperations = new MonoDevelopCommonOperations();

            executionContext = new IDEExecutionContext(commonOperations);
        }
コード例 #2
0
        protected NuGetPowerShellBaseCommand()
        {
            _sourceRepositoryProvider = ServiceLocator.GetInstance <ISourceRepositoryProvider>();
            ConfigSettings            = ServiceLocator.GetInstance <Configuration.ISettings>();
            VsSolutionManager         = ServiceLocator.GetInstance <IVsSolutionManager>();
            DTE = ServiceLocator.GetInstance <DTE>();
            SourceControlManagerProvider = ServiceLocator.GetInstance <ISourceControlManagerProvider>();
            _commonOperations            = ServiceLocator.GetInstance <ICommonOperations>();
            PackageRestoreManager        = ServiceLocator.GetInstance <IPackageRestoreManager>();
            _deleteOnRestartManager      = ServiceLocator.GetInstance <IDeleteOnRestartManager>();

            var logger = new LoggerAdapter(this);

            PackageExtractionContext = new PackageExtractionContext(
                PackageSaveMode.Defaultv2,
                PackageExtractionBehavior.XmlDocFileSaveMode,
                ClientPolicyContext.GetClientPolicy(ConfigSettings, logger),
                logger);

            if (_commonOperations != null)
            {
                ExecutionContext = new IDEExecutionContext(_commonOperations);
            }

            ActivityCorrelationId.StartNew();
        }
コード例 #3
0
        protected NuGetPowerShellBaseCommand()
        {
            var componentModel = NuGetUIThreadHelper.JoinableTaskFactory.Run(ServiceLocator.GetComponentModelAsync);

            _sourceRepositoryProvider    = componentModel.GetService <ISourceRepositoryProvider>();
            ConfigSettings               = componentModel.GetService <ISettings>();
            VsSolutionManager            = componentModel.GetService <IVsSolutionManager>();
            SourceControlManagerProvider = componentModel.GetService <ISourceControlManagerProvider>();
            _commonOperations            = componentModel.GetService <ICommonOperations>();
            PackageRestoreManager        = componentModel.GetService <IPackageRestoreManager>();
            _deleteOnRestartManager      = componentModel.GetService <IDeleteOnRestartManager>();
            _nuGetProgressReporter       = componentModel.GetService <IRestoreProgressReporter>();
            DTE = ServiceLocator.GetInstance <DTE>();

            var logger = new LoggerAdapter(this);

            PackageExtractionContext = new PackageExtractionContext(
                PackageSaveMode.Defaultv2,
                PackageExtractionBehavior.XmlDocFileSaveMode,
                ClientPolicyContext.GetClientPolicy(ConfigSettings, logger),
                logger);

            if (_commonOperations != null)
            {
                ExecutionContext = new IDEExecutionContext(_commonOperations);
            }

            ActivityCorrelationId.StartNew();
        }
コード例 #4
0
        public NuGetProjectContext(ISettings settings)
        {
            this.settings           = settings;
            packageManagementEvents = PackageManagementServices.PackageManagementEvents;
            var commonOperations = new MonoDevelopCommonOperations();

            executionContext = new IDEExecutionContext(commonOperations);
        }
コード例 #5
0
 public NuGetUIProjectContext(INuGetUILogger logger, ISourceControlManagerProvider sourceControlManagerProvider, ICommonOperations commonOperations)
 {
     _logger       = logger;
     _uiDispatcher = Dispatcher.CurrentDispatcher;
     SourceControlManagerProvider = sourceControlManagerProvider;
     CommonOperations             = commonOperations;
     if (commonOperations != null)
     {
         ExecutionContext = new IDEExecutionContext(commonOperations);
     }
 }
コード例 #6
0
 public NuGetUIProjectContext(INuGetUILogger logger, ISourceControlManagerProvider sourceControlManagerProvider, ICommonOperations commonOperations)
 {
     _logger = logger;
     _uiDispatcher = Dispatcher.CurrentDispatcher;
     _sourceControlManagerProvider = sourceControlManagerProvider;
     _commonOperations = commonOperations;
     if (commonOperations != null)
     {
         ExecutionContext = new IDEExecutionContext(commonOperations);
     }
 }
コード例 #7
0
 /// <summary>
 /// Preprocess to get resourceRepositoryProvider and solutionManager from packageManagementContext.
 /// </summary>
 protected virtual void Preprocess()
 {
     _packageManagementContext = (PackageManagementContext)GetPropertyValueFromHost(PackageManagementContextKey);
     if (_packageManagementContext != null)
     {
         _resourceRepositoryProvider = _packageManagementContext.SourceRepositoryProvider;
         _solutionManager            = _packageManagementContext.VsSolutionManager;
         _settings         = _packageManagementContext.Settings;
         _commonOperations = _packageManagementContext.CommonOperations;
         if (_commonOperations != null)
         {
             ExecutionContext = new IDEExecutionContext(_commonOperations);
         }
     }
     _dte = (DTE)GetPropertyValueFromHost(DTEKey);
 }
コード例 #8
0
        protected NuGetPowerShellBaseCommand()
        {
            _sourceRepositoryProvider = ServiceLocator.GetInstance <ISourceRepositoryProvider>();
            ConfigSettings            = ServiceLocator.GetInstance <Configuration.ISettings>();
            VsSolutionManager         = ServiceLocator.GetInstance <IVsSolutionManager>();
            DTE = ServiceLocator.GetInstance <DTE>();
            SourceControlManagerProvider = ServiceLocator.GetInstance <ISourceControlManagerProvider>();
            _commonOperations            = ServiceLocator.GetInstance <ICommonOperations>();
            PackageRestoreManager        = ServiceLocator.GetInstance <IPackageRestoreManager>();
            _deleteOnRestartManager      = ServiceLocator.GetInstance <IDeleteOnRestartManager>();

            if (_commonOperations != null)
            {
                ExecutionContext = new IDEExecutionContext(_commonOperations);
            }

            ActivityCorrelationId.StartNew();
        }
コード例 #9
0
        public NuGetUIProjectContext(
            ICommonOperations commonOperations,
            INuGetUILogger logger,
            ISourceControlManagerProvider sourceControlManagerProvider)
        {
            if (logger == null)
            {
                throw new ArgumentNullException(nameof(logger));
            }

            if (sourceControlManagerProvider == null)
            {
                throw new ArgumentNullException(nameof(sourceControlManagerProvider));
            }

            _logger = logger;
            SourceControlManagerProvider = sourceControlManagerProvider;

            if (commonOperations != null)
            {
                ExecutionContext = new IDEExecutionContext(commonOperations);
            }
        }