コード例 #1
0
		public void ShowPackageDetails ()
		{
			ProjectPackage package = (ProjectPackage)CurrentNode.DataItem;
			
			// package.ParsePackage ();
			
			PackageDetails details = new PackageDetails (package);
			details.Show ();
		}
コード例 #2
0
 /// <summary>
 /// This drops any data from the object that isn't minimally neccessary for 
 /// the smooth running of the package manager.
 /// </summary>
 internal void DropDetails() {
     // drop the package details. If it's needed again, there should be a delegate to grab it 
     // from the MSI or Feed.
     _packageDetails = null;
     Cache<PackageDetails>.Value.Clear(CanonicalName);
 }
コード例 #3
0
 public void PackageDetails(CanonicalName canonicalName, PackageDetails details)
 {
     var result = Package.GetPackage(canonicalName);
     result.PackageDetails = details;
     result.IsPackageDetailsStale = false;
 }
コード例 #4
0
        public async Task<IDictionary<string, PackageDetails>> GetPackageDetails()
        {
            using (SqlConnection connection = new SqlConnection(ConnectionString))
            {
                connection.Open();

                SqlCommand command = new SqlCommand(@"
                    SELECT StagePackage.[Id], StagePackage.[Version]
                    FROM StagePackage
                    INNER JOIN Stage ON StagePackage.StageKey = Stage.[Key]
                    INNER JOIN StageOwner ON Stage.[Key] = StageOwner.StageKey
                    INNER JOIN Owner ON Owner.[Key] = StageOwner.OwnerKey
                    WHERE Owner.Name = @OwnerName
                      AND Stage.Name = @StageName
                ", connection);

                command.Parameters.AddWithValue("OwnerName", OwnerName);
                command.Parameters.AddWithValue("StageName", StageName);

                SqlDataReader reader = await command.ExecuteReaderAsync();

                IDictionary<string, PackageDetails> result = new Dictionary<string, PackageDetails>(StringComparer.OrdinalIgnoreCase);

                while (reader.Read())
                {
                    string id = reader.GetString(0);
                    string version = reader.GetString(1);

                    PackageDetails packageDetails;
                    if (!result.TryGetValue(id, out packageDetails))
                    {
                        packageDetails = new PackageDetails(id);
                        result.Add(id, packageDetails);
                    }

                    packageDetails.Versions.Add(version);
                }

                return result;
            }
        }