コード例 #1
0
        private void btnAddShape_Click(object sender, System.EventArgs e)
        {
            int   X, Y, Width;
            Color aColor;

            X      = Convert.ToInt32(txtXPos.Text);
            Y      = Convert.ToInt32(txtYPos.Text);
            Width  = Convert.ToInt32(txtWidth.Text);
            aColor = lblColor.BackColor;

            AnyShape aShape;

            if (rbSquare.Checked)
            {
                aShape = new AnySquare(X, Y, aColor, Width);
            }
            else
            {
                aShape = new AnyCircle(X, Y, aColor, Width);
            }
            myModel.AddShape(aShape);
        }
コード例 #2
0
ファイル: ViewForm3.cs プロジェクト: thomknot/PseudoGPS
        private void btnAddShape_Click(object sender, System.EventArgs e)
        {
            int X, Y, Width;
            Color aColor;
            X = Convert.ToInt32(txtXPos.Text);
            Y = Convert.ToInt32(txtYPos.Text);
            Width = Convert.ToInt32(txtWidth.Text);
            aColor = lblColor.BackColor;

            AnyShape aShape;
            if (rbSquare.Checked)
            {
                aShape = new AnySquare(X, Y, aColor, Width);
            }
            else
            {
                aShape = new AnyCircle(X, Y, aColor, Width);
            }
            myModel.AddShape(aShape);
        }