Esempio n. 1
0
    protected override void OnPaint(PaintEventArgs a)
    {
        Graphics displayarea = a.Graphics;

        if (redlight.getIsFlashing())
        {
            if (redlight.getIsOn())
            {
                DrawCircle(displayarea, lightpen, (int)lightx, (int)lighty, lightradius);
                FillCircle(displayarea, onbrush, (int)lightx, (int)lighty, lightradius);
            }
            else
            {
                DrawCircle(displayarea, lightpen, (int)lightx, (int)lighty, lightradius);
                FillCircle(displayarea, offbrush, (int)lightx, (int)lighty, lightradius);
            }
        }
        else
        {
            DrawCircle(displayarea, lightpen, (int)lightx, (int)lighty, lightradius);
            FillCircle(displayarea, offbrush, (int)lightx, (int)lighty, lightradius);
        }

        base.OnPaint(a);
    }