void StartFilling() { Diagnostics.Log(String.Format("StartFilling ResourceType: {0}", resourceType)); doWaitCB("Please wait, loading object catalog..."); listView1.Visible = false; listView1.Items.Clear(); this.listView1.ListViewItemSorter = null; FillThread ft = new FillThread(this, resourceType, Add, updateProgressCB, stopFilling, OnFillingComplete); FillingComplete += new EventHandler <MainForm.BoolEventArgs>(ObjectChooser_FillingComplete); fillThread = new Thread(new ThreadStart(ft.Fill)); filling = true; fillThread.Start(); }
void StartFilling() { Diagnostics.Log(String.Format("StartFilling ResourceType: {0}", resourceType)); doWaitCB("Please wait, loading object catalog..."); listView1.Visible = false; listView1.Items.Clear(); this.listView1.ListViewItemSorter = null; FillThread ft = new FillThread(this, resourceType, Add, updateProgressCB, stopFilling, OnFillingComplete); FillingComplete += new EventHandler<MainForm.BoolEventArgs>(ObjectChooser_FillingComplete); fillThread = new Thread(new ThreadStart(ft.Fill)); filling = true; fillThread.Start(); }
public void StopThread() { this._fillThread.StopThread(true); this._fillThread = null; }
public void BeginThread() { if (this._fillThread == null) { this._fillThread = new FillThread(); this._fillThread.Container = this; this._fillThread.BeginThread(); } }
void _scanBarcodeForm_FormClosed(object sender, FormClosedEventArgs e) { this._scanBarcodeForm = null; this._fillThread.StopThread(true); this._fillThread = null; this.ScanMode = false; }
// 装载方式 扫入册条码 private void button_load_scanBarcode_Click(object sender, EventArgs e) { if (this._scanBarcodeForm == null) { this._scanBarcodeForm = new ScanBarcodeForm(); MainForm.SetControlFont(this._scanBarcodeForm, this.Font, false); this._scanBarcodeForm.BarcodeScaned += new ScanedEventHandler(_scanBarcodeForm_BarcodeScaned); this._scanBarcodeForm.FormClosed += new FormClosedEventHandler(_scanBarcodeForm_FormClosed); this._scanBarcodeForm.Show(this); } else { if (this._scanBarcodeForm.WindowState == FormWindowState.Minimized) this._scanBarcodeForm.WindowState = FormWindowState.Normal; } this.ScanMode = true; if (this._fillThread == null) { this._fillThread = new FillThread(); this._fillThread.Container = this; this._fillThread.BeginThread(); } }