CPF/CPF.ReoGrid/Drawing/CPFPen.cs
2024-06-24 10:15:59 +08:00

70 lines
1008 B
C#

using System;
using CPF.Drawing;
namespace CPF.ReoGrid.Drawing
{
public class CPFPen : IDisposable
{
public CPFPen(Color color, float w)
{
this.Stroke = new Stroke(w);
this.Brush = new SolidColorBrush(color);
}
public DashStyles DashStyle
{
get
{
return this.Stroke.DashStyle;
}
set
{
Stroke stroke = this.Stroke;
stroke.DashStyle = value;
this.Stroke = stroke;
}
}
public CapStyles LineCap
{
get
{
return this.Stroke.StrokeCap;
}
set
{
Stroke stroke = this.Stroke;
stroke.StrokeCap = value;
this.Stroke = stroke;
}
}
public float Width
{
get
{
return this.Stroke.Width;
}
set
{
Stroke stroke = this.Stroke;
stroke.Width = value;
this.Stroke = stroke;
}
}
public Stroke Stroke { get; set; }
public Brush Brush { get; set; }
public void Dispose()
{
bool flag = this.Brush != null;
if (flag)
{
((IDisposable)this.Brush).Dispose();
}
}
}
}