namespace Yw.WinFrmUI.HydroL2d
|
{
|
/// <summary>
|
/// 管道
|
/// </summary>
|
public class Pipe : Link
|
{
|
/// <summary>
|
/// 线色
|
/// </summary>
|
public Color? LineColor { get; set; }
|
|
/// <summary>
|
/// 线宽
|
/// </summary>
|
public float? LineWidth { get; set; }
|
|
/// <summary>
|
/// 绘制
|
/// </summary>
|
public override void Draw(Graphics g)
|
{
|
var fromCachePen = true;
|
var pen = CacheHelper.PipeLinePen;
|
if (this.LineColor.HasValue && this.LineWidth.HasValue)
|
{
|
pen = new Pen(this.LineColor.Value, this.LineWidth.Value);
|
fromCachePen = false;
|
}
|
g.DrawLines(pen, this.Positions.ToArray());
|
if (!fromCachePen)
|
{
|
pen.Dispose();
|
}
|
}
|
|
|
}
|
}
|