为什么要把它们存放到数据库里去呢?point是支持ISerializable那样不是更方面吗?
解决方案 »
- 一个界面有很多的控件,以什么方式存到数据库比较方便
- C# 实现保存报表查询条件
- 请朋友帮我写一个正则表达式。
- 新手请教高手!DataGridView中不显示数据的问题?
- 背景音乐??
- 主题:怎样调用类库 SharpZipLib.dll
- 2005怎么没有closing事件
- 假如我把字符串(AAA)以Image的数据类型存入道SQL数据库中,再从数据库中读出该字符串(AAA),把该字符串(AAA)添加到ComboBox控件的It
- 你们都用C#开发过什么样的项目?当中用到了哪些技术?处于何等层次的开发?
- C#
- 安装vs.net中文正式企业版时,有什么需要注意的地方?
- datatable列标题问题!!
using System.Drawing;
using System.Runtime.Serialization;namespace MyCSharp
{
public interface IShape
{
void Draw(Graphics g);
} [Serializable]
public class Line : IShape
{
Point startPoint, endPoint;
public Line(Point startPoint, Point endPoint)
{
this.startPoint = startPoint;
this.endPoint = endPoint;
}
public void Draw(Graphics g)
{
g.DrawLine(Pens.Black, startPoint, endPoint);
}
} [Serializable]
public class Rect : IShape
{
Rectangle rect;
public Rect(Rectangle rect)
{
this.rect = rect;
}
public void Draw(Graphics g)
{
g.DrawRectangle(Pens.Black, rect);
}
} [Serializable]
public class Ellipse : IShape
{
Rectangle rect;
public Ellipse(Rectangle rect)
{
this.rect = rect;
}
public void Draw(Graphics g)
{
g.DrawEllipse(Pens.Black, rect);
}
}}