System.Threading.Thread.Abort C# (CSharp) Метод

Abort() публичный Метод

public Abort ( object stateInfo ) : void
stateInfo object
Результат void
        public void Abort(object stateInfo)
        {
        }

Same methods

Thread::Abort ( ) : void

Usage Example

Пример #1
0
 public void ScanFile(IWin32Window ParentForm, string FileName)
 {
     lock (this.FSD) {
     if (FileName != null && File.Exists(FileName)) {
       this.FSD = new FileScanDialog();
       var T = new Thread(() => {
     try {
       Application.DoEvents();
       while (!this.FSD.Visible) {
         Thread.Sleep(0);
         Application.DoEvents();
       }
       this.FSD.Invoke(new AnonymousMethod(() => this.FSD.ResetProgress()));
       this.FileContents = FileType.LoadAll(FileName, (msg, pct) => this.FSD.Invoke(new AnonymousMethod(() => this.FSD.SetProgress(msg, pct))));
       this.FSD.Invoke(new AnonymousMethod(() => this.FSD.Finish()));
     } catch {
       this.FileContents = null;
     }
       });
       T.CurrentUICulture = Thread.CurrentThread.CurrentUICulture;
       T.Start();
       if (this.FSD.ShowDialog(ParentForm) == DialogResult.Abort) {
     this.FSD.Finish();
     this.FileContents = null;
       }
       if (T.IsAlive)
     T.Abort();
       this.FSD.Dispose();
       this.FSD = null;
     }
       }
 }
All Usage Examples Of System.Threading.Thread::Abort