using System.Drawing;
using System.Drawing.Drawing2D;
namespace DevComponents.Tree
{
namespace Display
{
///
/// Base class for node expand button display.
///
public abstract class NodeExpandDisplay
{
/// Creates new instance of the class
public NodeExpandDisplay()
{
}
/// Draws expand button.
/// Context parameters for drawing expand button.
public abstract void DrawExpandButton(NodeExpandPartRendererEventArgs e);
protected Pen GetBorderPen(NodeExpandPartRendererEventArgs e)
{
return new Pen(e.BorderColor, Dpi.Width1);
}
protected Pen GetExpandPen(NodeExpandPartRendererEventArgs e)
{
return new Pen(e.ExpandLineColor,Dpi.Width1);
}
protected Brush GetBackgroundBrush(NodeExpandPartRendererEventArgs e)
{
if(e.BackColor.IsEmpty && e.BackColor2.IsEmpty)
return null;
if(e.BackColor2.IsEmpty)
return new SolidBrush(e.BackColor);
System.Drawing.Drawing2D.LinearGradientBrush brush=DisplayHelp.CreateLinearGradientBrush(e.ExpandPartBounds,e.BackColor,e.BackColor2,e.BackColorGradientAngle);
//brush.SetSigmaBellShape(0.8f);
return brush;
}
}
}
}