예제 #1
0
        public void packageBuilder_Progress(object sender, ProgressEventArgs e)
        {
            e.Cancel = this.canceled;

            this.SuspendLayout();
            this.progressMessage.Text = e.Message;
            this.progressBar.Value = e.Current;
            this.progressBar.Maximum = e.UpperBound;
            this.Refresh();
            this.ResumeLayout();

            //System.Threading.Thread.Sleep(2000);
        }
예제 #2
0
        /// <summary>
        /// Sends a proress message to the client
        /// </summary>
        /// <param name="current">Current progress.</param>
        /// <param name="upperBound">Upper bound of the progress bar.</param>
        /// <param name="message">Progress message.</param>
        /// <returns>True if the client wants to continue, false to cancel progress.</returns>
        private bool OnProgress(int current, int upperBound, string message)
        {
            bool cancel = false;

            if (this.Progress != null)
            {
                ProgressEventArgs e = new ProgressEventArgs(current, upperBound, message);
                this.Progress(this, e);

                cancel = e.Cancel;
            }

            return !cancel;
        }