} } return myList ; }//public GetFileNames()
#region 处理用户界面的代码群 ************************************************************** public delegate void SetLabelTextHandler( System.Windows.Forms.Label lbl , string Text ); public delegate void SetProgressBarHandler( System.Windows.Forms.ProgressBar pb , int vMaxValue , int vValue);
private void InvokeSetProgress( System.Windows.Forms.ProgressBar pb , int vMaxValue , int vValue) { this.Invoke( new SetProgressBarHandler( this.SetProgressBar ) , new object[]{ pb , vMaxValue , vValue }); } private void InvokeSetLabelText( System.Windows.Forms.Label lbl , string Text ) { this.Invoke( new SetLabelTextHandler( this.SetLabelText ) , new object[]{ lbl , Text }); } private void SetLabelText( System.Windows.Forms.Label lbl , string Text ) { lbl.Text = Text ; lbl.Refresh(); } private void SetProgressBar ( System.Windows.Forms.ProgressBar pb , int vMaxValue , int vValue) { if( pb.Maximum != vMaxValue ) pb.Maximum = vMaxValue ; if( vValue >= 0 && vValue <= vMaxValue ) pb.Value = vValue ; } private void EndProcess( object sender , System.EventArgs e ) { txtOutPath.Enabled = true; cmdStart.Enabled = true; cmdStop.Enabled = false; cmdPose.Enabled = false; } private void cmdStart_Click(object sender, System.EventArgs e) { cmdStart.Enabled = false; txtOutPath.Enabled = false; cmdStop.Enabled = true; cmdPose.Enabled = true; System.Threading.ThreadStart st = new System.Threading.ThreadStart( this.MsdnOut ); |