コード例 #1
0
 private void hardware_button_Click(object sender, EventArgs e)
 {
     _parent._RESET_INACTIVITY();
     button1.Visible   = true;
     VIEW_MODE         = "Hardware";
     detail_group.Text = VIEW_MODE;
     detail_list.Items.Clear();
     hardware_button.BackColor = Color.LightBlue;
     software_button.BackColor = Color.FromKnownColor(KnownColor.Control);
     change_button.BackColor   = Color.FromKnownColor(KnownColor.Control);
     if (HARDWARE.Count > 0)
     {
         int    index_value = 1;
         string HW          = "";
         foreach (string HW2 in HARDWARE)
         {
             if (HW2.Length > 0)
             {
                 HW = HW2.StartsWith("`I`") ? HW2.Substring(3) : HW2;
                 string detail_line = "";
                 if (index_value < 10)
                 {
                     detail_line = (HARDWARE.Count < 100 ? "0" : "00");
                 }
                 else if (index_value < 100)
                 {
                     detail_line = (HARDWARE.Count < 100 ? "" : "0");
                 }
                 detail_line = detail_line + index_value.ToString() + ")  ";
                 detail_list.Items.Add((detail_line + (HW.Contains("DateStamp") ? (VIEW_TIME_STAMPS ? HW : HW.Substring(0, HW.LastIndexOf("DateStamp") - 2)) : HW)));
                 index_value++;
             }
         }
     }
 }
コード例 #2
0
        public void Task5(int a, string expected)
        {
            string actual = HW2.task5(a);

            Assert.AreEqual(expected, actual);
        }
コード例 #3
0
 public void Task3(int a, int b, int c, int[] expected)
 {
     int[] actual = HW2.task3(a, b, c);
     Assert.AreEqual(expected, actual);
 }
コード例 #4
0
 public void Task4(double a, double b, double c, double[] expected)
 {
     double[] actual = HW2.task4(a, b, c);
     Assert.AreEqual(expected[0], actual[0], 0.001d);
     Assert.AreEqual(expected[1], actual[1], 0.001d);
 }
コード例 #5
0
        public void Task2(double a, double b, double expected)
        {
            double actual = HW2.task2(a, b);

            Assert.AreEqual(expected, actual);
        }