Esempio n. 1
0
        private void InitBW()
        {
            mBW = new BackgroundWorker(this);
            mBW.ProgressChanged
                += new ProgressChangedEventHandler(mBW_ProgressChanged);
            ThreadClass thrClass = ThreadClass.Instance;
            mBW.DoWork += new DoWorkEventHandler(thrClass.mBW_DoWork);
            mBW.WorkerReportsProgress = true;
            mBW.WorkerSupportsCancellation = false;

            //mBW.RunWorkerCompleted +=
            //  new RunWorkerCompletedEventHandler(mBW_RunWorkerCompleted);
        }
Esempio n. 2
0
 private void AfisareMainThread(BackgroundWorker bw,int userState,int ParametrunrScanariNesinc,bool connectat, string message)
 {
     try
     {
         bw.ReportProgress(userState, new WorkerArgs(ParametrunrScanariNesinc, connectat, message));  // update UI nrScanari + deconectat!!
     }
     catch (Exception)
     {
     }
 }