rectangle.cs

来自「c#设计模式随书源码 c#设计模式随书源码」· CS 代码 · 共 24 行

CS
24
字号
using System;
using System.Drawing ;
namespace CsharpPats
{
	/// <summary>
	/// Draws a rectangle using a supplied Graphics object
	/// </summary>
	public class Rectangle	{
		private int x, y, w, h;
		protected Pen rpen;
		public Rectangle(int x_, int y_, int w_, int h_) 		{
			x = x_;
			y = y_;
			w = w_;
			h = h_;
			rpen = new Pen(Color.Black);
		}
		//-----------------
		public void draw(Graphics g) {
		  g.DrawRectangle (rpen, x, y, w, h);
		}
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?