Esempio n. 1
0
        /// <summary>
        /// 添加扫描枪
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void AddCom_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                ComWindow addcom = new ComWindow();
                addcom.Owner         = this;
                addcom.ShowInTaskbar = false;

                //addcom.Show();
                if (addcom.ShowDialog().Value)
                {
                    App.DateCom.ListProt[App.DateCom.Name].DataReceived += ComPort_DataReceived1;
                    if (indexRowColmn <= 4)
                    {
                        CreateControl(indexRowColmn, App.DateCom.Name, App.DateCom.Notes);
                        indexRowColmn++;
                        if (indexRowColmn == 4)
                        {
                            indexRowColmn = 0;
                        }
                    }
                }
                else
                {
                    //MessageBox.Show("0000");
                }
            }
            catch (Exception ee)
            {
                MessageBox.Show(ee.Message);
            }
        }
Esempio n. 2
0
        private void Button_Click_2(object sender, RoutedEventArgs e)
        {
            ComWindow _ComWindow = new ComWindow();

            if (_ComWindow.ShowDialog().Value)
            {
                // App.DateCom.ComPort.DataReceived += ComPort_DataReceived;
                NumCodeTxt.IsEnabled = true;
                BrCodeTxt.IsEnabled  = true;
                CribTxt.IsEnabled    = true;
                ButBind.IsEnabled    = true;
            }
        }