📄 shape.cs
字号:
using System;
using System.Drawing ;
namespace CsharpPats
{
/// <summary>
/// Summary description for Shape.
/// </summary>
public abstract class Shape {
protected int height, width;
protected int xpos, ypos;
protected Pen bPen;
//-----
public Shape(int x, int y, int h, int w) {
width = w;
height = h;
xpos = x;
ypos = y;
bPen = new Pen(Color.Black );
}
//-----
public abstract void draw(Graphics g);
//-----
public virtual float getArea() {
return height * width;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -