AIMS/DrawGraph/BoardPack/DottedLinePackObj.cs
2022-12-29 21:57:18 +08:00

52 lines
985 B
C#

using Newtonsoft.Json;
using System;
using System.Drawing;
using System.Drawing.Drawing2D;
namespace DrawGraph
{
[JsonObject(MemberSerialization.OptOut)]
[Serializable]
public class DottedLinePackObj : PackObjBase
{
private Color lineColor = Color.Black;
public Color LineColor
{
get
{
return this.lineColor;
}
set
{
this.lineColor = value;
}
}
public DottedLinePackObj(ZedGraphControl zgc, PackObjManager poManager) : base(zgc, poManager)
{
this.baseZed = zgc;
base.PackText = "虚线" + this.index.ToString();
}
public override void Draw()
{
bool flag = this.baseZed == null;
if (!flag)
{
this.Clear();
Color red = this.lineColor;
bool isSelect = base.IsSelect;
if (isSelect)
{
red = Color.Red;
}
ZUtil.DrawLine((double)base.RealX, (double)base.RealY, (double)base.RealEndX, (double)base.RealEndY, this.baseZed, base.PackTag, red, DashStyle.Dot);
base.Refresh();
}
}
}
}