Exemple #1
0
        public VsSolution(DteSolution dteSolution, ISolutionManager solutionManager, IVsPackageManager packageManager)
        {
            _name = String.Format(
                CultureInfo.CurrentCulture,
                Strings.Label_Solution,
                dteSolution.GetName());
            _solution       = solutionManager;
            _packageManager = packageManager;

            var repo = (SharedPackageRepository)packageManager.LocalRepository;

            _installedSolutionLevelPackages = new CoreInteropInstalledPackagesList(
                new PackageReferenceRepository(repo.PackageReferenceFile.FullPath, repo));

            DteSolution = dteSolution;

            // Add V2-related interop features
            AddFeature(() => packageManager.LocalRepository);
            AddFeature <IPackageManager>(() => packageManager);
            AddFeature <IPackageCacheRepository>(() => MachineCache.Default);

            // the source repository of the local repo of the solution
            AddFeature <SourceRepository>(() =>
            {
                var localRepo = new NuGet.Client.Interop.V2SourceRepository(
                    null,
                    packageManager.LocalRepository,
                    "");
                return(localRepo);
            });

            // Add PowerShell feature
            AddFeature <PowerShellScriptExecutor>(() =>
                                                  new VsPowerShellScriptExecutor(ServiceLocator.GetInstance <IScriptExecutor>()));
        }
Exemple #2
0
        public VsSolution(DteSolution dteSolution, ISolutionManager solutionManager, IVsPackageManager packageManager)
        {
            _name = String.Format(
                CultureInfo.CurrentCulture,
                Strings.Label_Solution,
                dteSolution.GetName());
            _solution = solutionManager;
            _packageManager = packageManager;

            var repo = (SharedPackageRepository)packageManager.LocalRepository;
            _installedSolutionLevelPackages = new CoreInteropInstalledPackagesList(
                new PackageReferenceRepository(repo.PackageReferenceFile.FullPath, repo));

            DteSolution = dteSolution;

            // Add V2-related interop features
            AddFeature(() => packageManager.LocalRepository);
            AddFeature<IPackageManager>(() => packageManager);
            AddFeature<IPackageCacheRepository>(() => MachineCache.Default);

            // the source repository of the local repo of the solution
            AddFeature<SourceRepository>(() =>
            {
                var localRepo = new NuGet.Client.Interop.V2SourceRepository(
                    null,
                    packageManager.LocalRepository,
                    "");
                return localRepo;
            });

            // Add PowerShell feature
            AddFeature<PowerShellScriptExecutor>(() =>
                new VsPowerShellScriptExecutor(ServiceLocator.GetInstance<IScriptExecutor>()));
        }