Ejemplo n.º 1
0
        void Work()
        {
            while (true)
            {
                if (state == State.Working)
                {
                    if (works.Count > 0)
                    {
                        Page pg = works.Dequeue();

                        act_work = pg.final_url.str;
                        Crawler pp = new Crawler(ref data, pg);
                    }
                    else
                    {
                        Thread.Sleep(100);
                        continue;
                    }
                }
                else if (state == State.Pausing)
                {
                    state = State.Paused;
                    try {
                        Thread.CurrentThread.Join();
                    } catch (Exception) {
                        data.Log2("Deteniendo " + thread.Name);
                    }
                }
            }
        }    //Work
Ejemplo n.º 2
0
 void UpdateDataSec(object obj)
 {
     try {
         Invoke(new UpdateDataCb(UpdateData));
     } catch (Exception) {
         data.Log2("Error al actualizar UI");
     }
 }