private void button11_Click(object sender, EventArgs e) // скопировать { d2 = new Deq(d.array.Length); d.array.CopyTo(d2.array, 0); d.Draw(this, pictureBox1, g, false); d2.Draw(this, pictureBox1, g, true); }
private void button13_Click(object sender, EventArgs e) //объединить в 1 { try { d1 = new Deq(d.array.Length + d2.array.Length); d1.array = d.array.Concat(d2.array).ToArray(); d = d1; d2 = null; d.Draw(this, pictureBox1, g, false); } catch (Exception ex) { MessageBox.Show("Ошибка при объединении! Нужно задать второй список", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void button1_Click(object sender, EventArgs e) // создать список { d = new Deq(); d.Draw(this, pictureBox1, g, false); button10.Enabled = true; button11.Enabled = true; button12.Enabled = true; button14.Enabled = true; button13.Enabled = true; button4.Enabled = true; button2.Enabled = true; button9.Enabled = true; button7.Enabled = true; button6.Enabled = true; button8.Enabled = true; }
private void button14_Click(object sender, EventArgs e) //удалить список { Array.Resize(ref d.array, 0); d.Draw(this, pictureBox1, g, false); button10.Enabled = false; button11.Enabled = false; button12.Enabled = false; button14.Enabled = false; button13.Enabled = false; button4.Enabled = false; button2.Enabled = false; button9.Enabled = false; button7.Enabled = false; button6.Enabled = false; button8.Enabled = false; }
private void button12_Click(object sender, EventArgs e) //разбить на 2 { int size = d.array.Length / 2; d1 = new Deq(size); for (int i = 0; i < size; i++) { d1.array[i] = d.array[i]; } d2 = new Deq(d.array.Length - size); for (int i = 0; i < d.array.Length - size; i++) { d2.array[i] = d.array[i + size]; } d = d1; d.Draw(this, pictureBox1, g, false); d2.Draw(this, pictureBox1, g, true); }