void OnProgress(object sender, WuAgent.ProgressArgs args) { if (args.TotalUpdates == -1) { progTotal.Style = ProgressBarStyle.Marquee; progTotal.MarqueeAnimationSpeed = 30; } else { progTotal.Style = ProgressBarStyle.Continuous; progTotal.MarqueeAnimationSpeed = 0; progTotal.Value = args.TotalPercent; } }
void OnProgress(object sender, WuAgent.ProgressArgs args) { string Status = ""; switch (agent.CurOperation()) { case WuAgent.AgentOperation.CheckingUpdates: Status = "Checking for Updates"; break; case WuAgent.AgentOperation.PreparingCheck: Status = "Preparing Check"; break; case WuAgent.AgentOperation.PreparingUpdates: case WuAgent.AgentOperation.DownloadingUpdates: Status = "Downloading Updates"; break; case WuAgent.AgentOperation.InstallingUpdates: Status = "Installing Updates"; break; case WuAgent.AgentOperation.RemoveingUpdtes: Status = "Removing Updates"; break; } if (args.TotalUpdates == -1) { progTotal.Style = ProgressBarStyle.Marquee; progTotal.MarqueeAnimationSpeed = 30; Status += "..."; } else { progTotal.Style = ProgressBarStyle.Continuous; progTotal.MarqueeAnimationSpeed = 0; progTotal.Value = args.TotalPercent; if (args.TotalUpdates > 1) { Status += " " + args.CurrentIndex + "/" + args.TotalUpdates + " "; } //if (args.UpdatePercent != 0) // Status += " " + args.UpdatePercent + "%"; } lblStatus.Text = Status; toolTip.SetToolTip(lblStatus, args.Info); UpdateState(); }