Source/AdvTree/Drawing/SolidBorder.cs
(开头部分) 2KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Text;
using System.Drawing;
using System.ComponentModel;
namespace DevComponents.WinForms.Drawing
{
public class SolidBorder : Border
{
#region Constructor
/// <summary>
/// Initializes a new instance of the SolidBorder class.
/// </summary>
/// <param name="color"></param>
/// <param name="width"></param>
public SolidBorder(Color color, int width)
{
_Color = color;
_Width = width;
}
/// <summary>
/// Initializes a new instance of the SolidBorder class.
/// </summary>
/// <param name="color"></param>
public SolidBorder(Color color)
{
_Color = color;
}
/// <summary>
/// Initializes a new instance of the SolidBorder class.
/// </summary>
public SolidBorder()
{
}
#endregion
#region Internal Implementation
/// <summary>
/// Creates the pen for the border.
/// </summary>
/// <returns>Returns pen or null if pen cannot be created.</returns>
public override Pen CreatePen()
{
if (!CanCreatePen()) return null;
return new Pen(_Color, _Width);
}
private bool CanCreatePen()
{
return !_Color.IsEmpty && _Width > 0;
}
private Color _Color = Color.Empty;
/// <summary>
/// Gets or sets the fill color.
/// </summary>
[Description("Indicates the fill color.")]
public Color Color
后面还有 26 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。