Example #1
0
        /// <summary>
        /// Add the self tests defined in the specified test list the specified <c>ListBox</c> control.
        /// </summary>
        /// <param name="listBox">The <c>ListBox</c> to which the items are to be added.</param>
        /// <param name="testListRecord">The test list that is to be added to the <c>ListBox</c> control.</param>
        private void TestItemAddRange(ListBox listBox, TestListRecord testListRecord)
        {
            // Skip, if the Dispose() method has been called.
            if (IsDisposed)
            {
                return;
            }

            Cursor = Cursors.WaitCursor;

            listBox.Items.Clear();
            listBox.SuspendLayout();

            TestItem_t testItem;
            short      selfTestIdentifier, selfTestNumber;

            for (int index = 0; index < testListRecord.SelfTestRecordList.Count; index++)
            {
                testItem                    = new TestItem_t();
                selfTestIdentifier          = testListRecord.SelfTestRecordList[index].Identifier;
                selfTestNumber              = testListRecord.SelfTestRecordList[index].SelfTestNumber;
                testItem.SelfTestIdentifier = selfTestIdentifier;
                testItem.SelfTestNumber     = selfTestNumber;
                testItem.Added              = true;
                listBox.Items.Add(testItem);
            }

            listBox.PerformLayout();
            Cursor = Cursors.Default;
        }
Example #2
0
        /// <summary>
        /// Instantiate and initialize a new array of <c>TestItem_t</c> structures based upon the tests that are defined in the <c>SELFTEST</c> table of the data
        /// dictionary.
        /// </summary>
        /// <returns>An array of <c>TestItem_t</c> structures based upon the self tests defined in the <c>SELFTEST</c> table of the data dictionary.</returns>
        private TestItem_t[] ConstructTestItemArray()
        {
            // Instantiate and initialize a new array of TestItem_t structures.
            TestItem_t[] testItems = new TestItem_t[Lookup.SelfTestTable.RecordList.Count];

            // Skip, if the Dispose() method has been called.
            if (IsDisposed)
            {
                return(testItems);
            }

            TestItem_t     testItem;
            SelfTestRecord selfTestRecord;

            for (short selfTestIdentifier = 0; selfTestIdentifier < Lookup.SelfTestTable.RecordList.Count; selfTestIdentifier++)
            {
                testItem = new TestItem_t();
                testItem.SelfTestIdentifier = selfTestIdentifier;
                testItem.Added = false;

                try
                {
                    selfTestRecord = Lookup.SelfTestTable.Items[selfTestIdentifier];

                    if (selfTestRecord == null)
                    {
                        testItem.Exists = false;
                    }
                    else
                    {
                        testItem.Exists         = true;
                        testItem.SelfTestNumber = selfTestRecord.SelfTestNumber;
                    }
                }
                catch (Exception)
                {
                    testItem.Exists = false;
                }

                testItems[selfTestIdentifier] = testItem;
            }

            return(testItems);
        }
        /// <summary>
        /// Instantiate and initialize a new array of <c>TestItem_t</c> structures based upon the tests that are defined in the <c>SELFTEST</c> table of the data 
        /// dictionary.
        /// </summary>
        /// <returns>An array of <c>TestItem_t</c> structures based upon the self tests defined in the <c>SELFTEST</c> table of the data dictionary.</returns>
        private TestItem_t[] ConstructTestItemArray()
        {
            // Instantiate and initialize a new array of TestItem_t structures.
            TestItem_t[] testItems = new TestItem_t[Lookup.SelfTestTable.RecordList.Count];

            // Skip, if the Dispose() method has been called.
            if (IsDisposed)
            {
                return testItems;
            }

            TestItem_t testItem;
            SelfTestRecord selfTestRecord;
            for (short selfTestIdentifier = 0; selfTestIdentifier < Lookup.SelfTestTable.RecordList.Count; selfTestIdentifier++)
            {
                testItem = new TestItem_t();
                testItem.SelfTestIdentifier = selfTestIdentifier;
                testItem.Added = false;

                try
                {
                    selfTestRecord = Lookup.SelfTestTable.Items[selfTestIdentifier];

                    if (selfTestRecord == null)
                    {
                        testItem.Exists = false;
                    }
                    else
                    {
                        testItem.Exists = true;
                        testItem.SelfTestNumber = selfTestRecord.SelfTestNumber;
                    }
                }
                catch (Exception)
                {
                    testItem.Exists = false;
                }

                testItems[selfTestIdentifier] = testItem;
            }

            return (testItems);
        }
        /// <summary>
        /// Add the self tests defined in the specified test list the specified <c>ListBox</c> control.
        /// </summary>
        /// <param name="listBox">The <c>ListBox</c> to which the items are to be added.</param>
        /// <param name="testListRecord">The test list that is to be added to the <c>ListBox</c> control.</param>
        private void TestItemAddRange(ListBox listBox, TestListRecord testListRecord)
        {
            // Skip, if the Dispose() method has been called.
            if (IsDisposed)
            {
                return;
            }

            Cursor = Cursors.WaitCursor;

            listBox.Items.Clear();
            listBox.SuspendLayout();

            TestItem_t testItem;
            short selfTestIdentifier, selfTestNumber;
            for (int index = 0; index < testListRecord.SelfTestRecordList.Count; index++)
            {
                testItem = new TestItem_t();
                selfTestIdentifier = testListRecord.SelfTestRecordList[index].Identifier;
                selfTestNumber = testListRecord.SelfTestRecordList[index].SelfTestNumber;
                testItem.SelfTestIdentifier = selfTestIdentifier;
                testItem.SelfTestNumber = selfTestNumber;
                testItem.Added = true;
                listBox.Items.Add(testItem);
            }

            listBox.PerformLayout();
            Cursor = Cursors.Default;
        }