private void addThread_Click(object sender, EventArgs e) { CircleTemlate circleTemlate = new CircleTemlate(colorDialog1.Color, (int)nudRadius.Value); CircleDrawer circleDrawer = new CircleDrawer(circleTemlate, (int)nudRefreshInt.Value, CreateGraphics()); _drawers.Add(circleDrawer); circleDrawer.Start(); }
private void resumeButton_Click(object sender, EventArgs e) { var selectedDrawer = listOfThreads.SelectedItem; if (selectedDrawer != null) { CircleDrawer drawer = selectedDrawer as CircleDrawer; drawer.Resume(); } }
private void nudRefreshInt_ValueChanged(object sender, EventArgs e) { var selectedDrawer = listOfThreads.SelectedItem; if (selectedDrawer != null) { CircleDrawer drawer = selectedDrawer as CircleDrawer; drawer.ChangeRef((int)nudRefreshInt.Value); } }
private void comboBox1_SelectedValueChanged(object sender, EventArgs e) { var selectedDrawer = listOfThreads.SelectedItem; if (selectedDrawer != null) { CircleDrawer drawer = selectedDrawer as CircleDrawer; ThreadPriority priority = (ThreadPriority)comboBox1.SelectedItem; drawer.Priority = priority; } }
private void removeThread_Click(object sender, EventArgs e) { var selectedDrawer = listOfThreads.SelectedItem; if (selectedDrawer != null) { CircleDrawer drawer = selectedDrawer as CircleDrawer; drawer.End(); drawer.WaitEnd(); _drawers.Remove(drawer); } }
private void colorButton_BackColorChanged(object sender, EventArgs e) { var selectedDrawer = listOfThreads.SelectedItem; if (selectedDrawer != null) { CircleDrawer drawer = selectedDrawer as CircleDrawer; Color color = colorButton.BackColor; drawer.ChangeColor(color); //drawer.Name = drawer._circleTemplate.Colour.ToString(); } }
private void listOfThreads_SelectedValueChanged(object sender, EventArgs e) { var selectedDrawer = listOfThreads.SelectedItem; if (selectedDrawer != null) { CircleDrawer drawer = selectedDrawer as CircleDrawer; comboBox1.SelectedItem = drawer.Priority; nudRadius.Value = drawer.GetRadius(); nudRefreshInt.Value = drawer.GetRef(); colorButton.BackColor = drawer.GetColor(); } }