Ejemplo n.º 1
0
        private void btnStart_Click(object sender, EventArgs e)
        {
            graphics.Clear(Color.LightGray);
            BaseElement element = Activator.CreateInstance(currentElementType) as BaseElement;

            element.Rect    = new Rectangle(location, new Size(sideLength, sideLength));
            currentBehavior = Activator.CreateInstance(currentBehaviorType, new object[] { element, graphics }) as BaseBehavior;
            currentBehavior.Start();
            btnStop.Enabled  = true;
            btnStart.Enabled = false;
        }