void creator_Progress( object sender, ProgressEventArgs e ) {
			if ( e.Action != null ) {
				if ( !this.InvokeRequired ) {
					labelStatus.Text = e.Action;
					labelStatus.Refresh();
				} else {
					this.Invoke( new SetLabelDelegate( SetLabelStatus ), e.Action );
				}
			}

			if ( e.Maximum != -1 ) {
				if ( !this.InvokeRequired ) {
					progressBar.Maximum = e.Maximum;
				} else {
					this.Invoke( new SetNumericValueDelegate( SetProgressMaximum ), e.Maximum );
				}
			}

			if ( !this.InvokeRequired ) {
				progressBar.Value = ( e.Current <= progressBar.Maximum ) ? e.Current : progressBar.Maximum;
			} else {
				int value = ( e.Current <= progressBar.Maximum ) ? e.Current : progressBar.Maximum;
				this.Invoke( new SetNumericValueDelegate( SetProgressValue ), value );
			}
		}
Example #2
0
		void creator_Progress( object sender, ProgressEventArgs e ) {
			if ( this.Progress != null ) {
				this.Progress( sender, e );
			}
		}