Source/AdvTree/Display/NodeExpandDisplay.cs
(开头部分) 5KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System.Drawing;
using System.Drawing.Drawing2D;
using DevComponents.DotNetBar;
namespace DevComponents.AdvTree
{
namespace Display
{
/// <summary>
/// Base class for node expand button display.
/// </summary>
public abstract class NodeExpandDisplay
{
/// <summary>Creates new instance of the class</summary>
public NodeExpandDisplay()
{
}
/// <summary>Draws expand button.</summary>
/// <param name="e">Context parameters for drawing expand button.</param>
public abstract void DrawExpandButton(NodeExpandPartRendererEventArgs e);
protected Pen GetBorderPen(NodeExpandPartRendererEventArgs e)
{
if(!e.BorderColor.IsEmpty)
return new Pen(e.BorderColor,1);
if (_ColorTable != null)
{
bool expanded = e.Node.Expanded;
TreeExpandColorTable ct = GetExpandColorTable(e);
if (ct == null) return null;
if (expanded)
{
// Collapse node colors
if (!e.IsMouseOver && ct.CollapseBorder != null)
return ct.CollapseBorder.CreatePen();
else if (e.IsMouseOver && ct.CollapseMouseOverBorder != null)
return ct.CollapseMouseOverBorder.CreatePen();
}
else
{
// Expand node colors
if (!e.IsMouseOver && ct.ExpandBorder != null)
return ct.ExpandBorder.CreatePen();
else if (e.IsMouseOver && ct.ExpandMouseOverBorder != null)
return ct.ExpandMouseOverBorder.CreatePen();
}
}
return null;
}
private TreeExpandColorTable GetExpandColorTable(NodeExpandPartRendererEventArgs e)
{
TreeExpandColorTable ct = null;
if (e.ExpandButtonType == eExpandButtonType.Rectangle)
ct = _ColorTable.ExpandRectangle;
else if (e.ExpandButtonType == eExpandButtonType.Triangle)
ct = _ColorTable.ExpandTriangle;
else if (e.ExpandButtonType == eExpandButtonType.Ellipse)
ct = _ColorTable.ExpandEllipse;
后面还有 79 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。