예제 #1
0
        // at this point should be on UI thread
        private void WorkerProgressChanged(object sender, ProgressChangedEventArgs e)
        {
            NugetProgressItem nugetProgress = (NugetProgressItem)e.UserState;
            NugetProgressArgs args          = new NugetProgressArgs();

            args.nugetProgress = nugetProgress;
            ProgressChanged(this, args);
        }
예제 #2
0
        private void HandleProgressChanged(object sender, NugetProgressArgs e)
        {
            NugetProgressItem progress = e.nugetProgress;
            Nuget             nuget    = progress.nuget;
            string            key      = nuget.GetFileName();
            GroupBox          infoBox;

            if (!progressDict.ContainsKey(key))
            {
                infoBox = CreateNewProgressBox(key);
                progressDict.Add(key, infoBox);
                tlpDownloads.Controls.Add(infoBox);
                panDownloads.ScrollControlIntoView(infoBox);
            }
            else
            {
                infoBox = progressDict[key];
            }
            ProgressBar bar = (ProgressBar)infoBox.Controls.Find(PROGRESS_BAR_NAME, false)[0];

            bar.Value = progress.downloadPercent;
        }