Source/AdvTree/Display/NodeSelectionDisplay.cs
(开头部分) 6KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System.Drawing;
using DevComponents.WinForms.Drawing;
namespace DevComponents.AdvTree.Display
{
/// <summary>
/// Represent class that paints selection around node.
/// </summary>
internal class NodeSelectionDisplay
{
public void PaintSelection(SelectionRendererEventArgs info)
{
if (info.SelectionBoxStyle == eSelectionStyle.HighlightCells)
PaintHighlightCellsSelectionStyle(info);
else if (info.SelectionBoxStyle == eSelectionStyle.FullRowSelect)
PaintFullRowSelectSelectionStyle(info);
else if (info.SelectionBoxStyle == eSelectionStyle.NodeMarker)
PaintNodeMarkerSelectionStyle(info);
}
public void PaintHotTracking(SelectionRendererEventArgs info)
{
// Full row is just a rectangle with the background...
Shape[] fullRowShapes = GetHotTrackingShapes();
Graphics g = info.Graphics;
Rectangle bounds = info.Bounds;
bounds.Width--;
bounds.Height--;
foreach (Shape shape in fullRowShapes)
{
shape.Paint(g, bounds);
}
}
private void PaintFullRowSelectSelectionStyle(SelectionRendererEventArgs info)
{
// Full row is just a rectangle with the background...
Shape[] fullRowShapes = GetFullRowShapes(info.TreeActive);
Graphics g = info.Graphics;
Rectangle bounds = info.Bounds;
//bounds.Width--;
//bounds.Height--;
foreach (Shape shape in fullRowShapes)
{
shape.Paint(g, bounds);
}
}
Shape[] _FullRowShapes = null;
private Shape[] GetFullRowShapes(bool treeActive)
{
if (_FullRowShapes == null)
{
_FullRowShapes = new Shape[1];
_FullRowShapes[0] = new RectangleShape();
}
RectangleShape shape = (RectangleShape)_FullRowShapes[0];
SelectionColorTable colors = treeActive ? _SelectionColors.FullRowSelect : _SelectionColors.FullRowSelectInactive;
后面还有 124 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。