예제 #1
0
        private void PSBWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            tabControl.Enabled = true;

            SearchingForm.Hide();
            var           product        = (Product)e.Result;
            string        ProductNumber  = product.ProductNumber;
            List <string> ProceduresList = product.DocumentList;

            PSFilenameTextbox.Text = ProductNumber;
            PSSerialEntryComboBox.Focus();

            if (!ProceduresList.Any())
            {
                Logger.Log($"No process sheets found for {ProductNumber}", rt, true);
                return;
            }

            foreach (var p in ProceduresList)
            {
                var f = new FileInfo(p);
                PSResultsListBox.Items.Add(f);
            }

            PSResultsListBox.SelectedItem = PSResultsListBox.Items[0];
            Logger.Log($"Found process sheet for {ProductNumber}", rt, true);
        }
예제 #2
0
        private void Main_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (!tabControl.Enabled)
            {
                return;
            }

            if (tabControl.SelectedTab.Text == "Test Procedures")
            {
                if (e.KeyChar == '[')
                {
                    e.KeyChar = (char)Keys.None;
                    e.Handled = true;
                }
                if (TPSerialEntryComboBox.Focused && e.KeyChar == (char)Keys.Enter)
                {
                    TPSearchButton.PerformClick();
                    e.Handled = true;
                    return;
                }
                if (!TPSerialEntryComboBox.Focused && e.KeyChar != (char)Keys.Enter)
                {
                    TPSerialEntryComboBox.Focus();
                    TPSerialEntryComboBox.Text           = e.KeyChar.ToString();
                    TPSerialEntryComboBox.SelectionStart = TPSerialEntryComboBox.Text.Length;
                    e.Handled = true;
                    return;
                }
                if (e.KeyChar == ']')
                {
                    e.KeyChar = (char)Keys.None;
                    TPSearchButton.PerformClick();
                    return;
                }
            }

            if (tabControl.SelectedTab.Text == "Process Sheets")
            {
                if (e.KeyChar == '[')
                {
                    e.KeyChar = (char)Keys.None;
                    e.Handled = true;
                }
                if (PSSerialEntryComboBox.Focused && e.KeyChar == (char)Keys.Enter)
                {
                    PSSearchButton.PerformClick();
                    e.Handled = true;
                    return;
                }
                if (!PSSerialEntryComboBox.Focused && e.KeyChar != (char)Keys.Enter)
                {
                    PSSerialEntryComboBox.Focus();
                    PSSerialEntryComboBox.Text           = e.KeyChar.ToString();
                    PSSerialEntryComboBox.SelectionStart = PSSerialEntryComboBox.Text.Length;
                    e.Handled = true;
                    return;
                }
                if (e.KeyChar == ']')
                {
                    e.KeyChar = (char)Keys.None;
                    PSSearchButton.PerformClick();
                    return;
                }
            }
        }