コード例 #1
0
        private void ClearButton_Click(object sender, EventArgs e)
        {
            switch (TabControl.SelectedIndex)
            {
            case 0:
                BST_Reset(BST.Root);
                BST = DefaultTrees.BST();
                RBT_Reset(RBT.Root);
                RBT  = DefaultTrees.RBT();
                DekT = DefaultTrees.DekT();
                ComboBox_TextChanged(sender, e);
                TimeResultTB.ResetText();
                AddTB.Text = RemoveTB.Text = SearchTB.Text = TimeResultTB.Text;
                Refresh();
                break;

            case 1:
                ResultTB.ResetText();
                TimeResultLabel.Text = ResultTB.Text;
                ValueTB.Text         = "<Введите значение>";
                ValueTB.ForeColor    = Color.Silver;
                KeyTB.Text           = "<Введите ключ>";
                KeyTB.ForeColor      = Color.Silver;
                Table = Default_HT.Table();
                ShowHT(Table);
                break;
            }
        }
コード例 #2
0
 private void ShowHT(HashTable Table)
 {
     ResultTB.ResetText();
     foreach (KeyValuePair <int, List <Item> > item in Table.Items)
     {
         ResultTB.Text += (ResultTB.Text != "" ? "\r\n" : "") + "Хэш = " + item.Key.ToString() + "\r\n";
         foreach (var value in item.Value)
         {
             ResultTB.Text += value.Key + " - " + value.Value + "\r\n";
         }
     }
 }