Esempio n. 1
0
        private void testTree_AfterSelect(object sender, TreeViewEventArgs e)
        {
            // If the selected node is a leaf node...
            if (e.Node.Tag is SymbologyTestItem)
            {
                // Save any pending changes
                CommitChanges();

                // Identify the test item and group
                SymbologyTestItem  testItem  = (SymbologyTestItem)e.Node.Tag;
                SymbologyTestGroup testGroup = (SymbologyTestGroup)e.Node.Parent.Tag;

                // Update the current item
                testSymbology.SelectedIndex = ((int)testGroup.Symbology) - 1;
                barcodeLabel.Text           = testItem.Barcode;
                RefreshBarcode();
                _testChangesPending = false;
                _symbologyChanged   = false;
                _barcodeTextChanged = false;
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Adds the test case.
        /// </summary>
        /// <param name="symbology">The symbology.</param>
        /// <param name="text">The text.</param>
        public void AddTestCase(BarcodeSymbology symbology, string text)
        {
            // We cannot add unknown symbology to test-case list
            if (symbology == BarcodeSymbology.Unknown)
            {
                throw new ArgumentException("symbology");
            }

            // Insert into existing group if we have one
            foreach (SymbologyTestGroup group in GroupTests)
            {
                if (group.Symbology == symbology)
                {
                    group.AddTestCase(text);
                    return;
                }
            }

            // Create new group as required.
            SymbologyTestGroup newGroup = new SymbologyTestGroup(symbology);

            newGroup.AddTestCase(text);
            GroupTests.Add(newGroup);
        }
Esempio n. 3
0
        /// <summary>
        /// Adds the test case.
        /// </summary>
        /// <param name="symbology">The symbology.</param>
        /// <param name="text">The text.</param>
        public void AddTestCase(BarcodeSymbology symbology, string text)
        {
            // We cannot add unknown symbology to test-case list
            if (symbology == BarcodeSymbology.Unknown)
            {
                throw new ArgumentException ("symbology");
            }

            // Insert into existing group if we have one
            foreach (SymbologyTestGroup group in GroupTests)
            {
                if (group.Symbology == symbology)
                {
                    group.AddTestCase (text);
                    return;
                }
            }

            // Create new group as required.
            SymbologyTestGroup newGroup = new SymbologyTestGroup (symbology);
            newGroup.AddTestCase (text);
            GroupTests.Add (newGroup);
        }