Ejemplo n.º 1
0
 private void start_com_barcode_scaner()
 {
     if (MainStaticClass.Use_Usb_to_Com_Barcode_Scaner)
     {
         MainStaticClass.continue_to_read_the_data_from_a_port = true;
         rd           = new Read_Data_From_Com_Port();
         workerThread = new Thread(rd.to_read_the_data_from_a_port);
         workerThread.Start();
         timer.Start();
     }
 }
Ejemplo n.º 2
0
 private void first_start_com_barcode_scaner()
 {
     if (MainStaticClass.Use_Usb_to_Com_Barcode_Scaner)
     {
         MainStaticClass.continue_to_read_the_data_from_a_port = true;
         rd           = new Read_Data_From_Com_Port();
         workerThread = new Thread(rd.to_read_the_data_from_a_port);
         workerThread.Start();
         timer          = new System.Windows.Forms.Timer();
         timer.Interval = 200;
         timer.Start();
         timer.Tick += new EventHandler(timer_Tick);
     }
 }
Ejemplo n.º 3
0
        //private void input_barcode_timer_Tick(object sender, EventArgs e)
        //{
        //    input_barcode_timer.Stop();
        //    execute_enter(input_barcode.Text);
        //}

        #region com_barcode_scaner


        protected override void OnClosing(CancelEventArgs e)
        {
            if (MainStaticClass.Use_Usb_to_Com_Barcode_Scaner)
            {
                this.timer.Stop();
                this.timer = null;
                MainStaticClass.continue_to_read_the_data_from_a_port = false;
                if (rd.mySerial != null)
                {
                    if (rd.mySerial.IsOpen)
                    {
                        rd.mySerial.Close();
                    }
                }
                workerThread.Join();
                rd = null;
                GC.Collect();
            }
        }