Exemple #1
0
        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();
        }
Exemple #2
0
        private void resumeButton_Click(object sender, EventArgs e)
        {
            var selectedDrawer = listOfThreads.SelectedItem;

            if (selectedDrawer != null)
            {
                CircleDrawer drawer = selectedDrawer as CircleDrawer;
                drawer.Resume();
            }
        }
Exemple #3
0
        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);
            }
        }
Exemple #4
0
        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;
            }
        }
Exemple #5
0
        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);
            }
        }
Exemple #6
0
        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();
            }
        }
Exemple #7
0
        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();
            }
        }