示例#1
0
        private void buttonCreateOrAddNodesToTree_Click(object sender, EventArgs e)
        {
            int    countOfNodes;
            Random random = new Random();

            try
            {
                countOfNodes = Convert.ToInt32(textBoxCountOfNodes.Text);
                for (int i = 0; i < countOfNodes; i++)
                {
                    workingTree.AddData(random.Next(0, 100), Comparer <int> .Default);
                }
                WriteWorkingTreeToFile();
                UpdateLabelCountOfTrees();
                toolStripStatusLabel1.Text = "В рабочее дерево добавлено " + countOfNodes + " элементов";
            }
            catch (Exception ee)
            {
                MessageBox.Show(ee.Message, "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                toolStripStatusLabel1.Text = ee.Message;
                UpdateLabelCountOfTrees();
            }
        }