Exemplo n.º 1
0
        /// <summary>
        /// Return all possibly valid project names in the current solution. This includes all
        /// unique names and safe names.
        /// </summary>
        /// <returns></returns>
        private IEnumerable <string> GetAllValidProjectNames()
        {
            var nugetProjects = VsSolutionManager.GetNuGetProjects();
            var safeNames     = nugetProjects?.Select(p => VsSolutionManager.GetNuGetProjectSafeName(p));
            var uniqueNames   = nugetProjects?.Select(p => NuGetProject.GetUniqueNameOrName(p));

            return(uniqueNames.Concat(safeNames).Distinct());
        }
Exemplo n.º 2
0
 protected override void Preprocess()
 {
     base.Preprocess();
     if (string.IsNullOrEmpty(ProjectName))
     {
         ProjectName = VsSolutionManager.DefaultNuGetProjectName;
     }
     // Get the projects in the solution that's not the current default or specified project to sync the package identity to.
     Projects = VsSolutionManager.GetNuGetProjects()
                .Where(p => !StringComparer.OrdinalIgnoreCase.Equals(p.GetMetadata <string>(NuGetProjectMetadataKeys.Name), ProjectName))
                .ToList();
 }
Exemplo n.º 3
0
 protected override void Preprocess()
 {
     base.Preprocess();
     ParseUserInputForVersion();
     if (!_projectSpecified)
     {
         Projects = VsSolutionManager.GetNuGetProjects().ToList();
     }
     else
     {
         Projects = new List <NuGetProject>()
         {
             Project
         };
     }
 }
Exemplo n.º 4
0
        private void Preprocess()
        {
            UseRemoteSourceOnly = ListAvailable.IsPresent || (!String.IsNullOrEmpty(Source) && !Updates.IsPresent);
            UseRemoteSource     = ListAvailable.IsPresent || Updates.IsPresent || !String.IsNullOrEmpty(Source);
            CollapseVersions    = !AllVersions.IsPresent;
            UpdateActiveSourceRepository(Source);
            GetNuGetProject(ProjectName);

            // When ProjectName is not specified, get all of the projects in the solution
            if (string.IsNullOrEmpty(ProjectName))
            {
                Projects = VsSolutionManager.GetNuGetProjects().ToList();
            }
            else
            {
                Projects = new List <NuGetProject> {
                    Project
                };
            }
        }
Exemplo n.º 5
0
        protected override void Preprocess()
        {
            base.Preprocess();
            ParseUserInputForVersion();
            if (!_projectSpecified)
            {
                Projects = VsSolutionManager.GetNuGetProjects().ToList();
            }
            else
            {
                Projects = new List <NuGetProject> {
                    Project
                };
            }

            if (Reinstall)
            {
                ActionType = NuGetActionType.Reinstall;
            }
            else
            {
                ActionType = NuGetActionType.Update;
            }
        }