コード例 #1
0
        /// <summary>
        /// This static helper method returns the unique name on the project if present
        /// Otherwise, returns the name. If name is not present, it will throw
        /// </summary>
        /// <param name="nuGetProject"></param>
        /// <returns></returns>
        public static string GetUniqueNameOrName(NuGetProject nuGetProject)
        {
            if (nuGetProject == null)
            {
                throw new ArgumentNullException(nameof(nuGetProject));
            }

            string nuGetProjectName;

            if (!nuGetProject.TryGetMetadata(NuGetProjectMetadataKeys.UniqueName, out nuGetProjectName))
            {
                // Unique name is not set, simply return the name
                nuGetProjectName = nuGetProject.GetMetadata <string>(NuGetProjectMetadataKeys.Name);
            }

            return(nuGetProjectName);
        }
コード例 #2
0
 public PackageEventArgs(NuGetProject project, PackageIdentity identity, string installPath)
 {
     Identity    = identity;
     InstallPath = installPath;
     Project     = project;
 }
 public string GetNuGetProjectSafeName(NuGet.ProjectManagement.NuGetProject nuGetProject)
 {
     throw new NotImplementedException();
 }