internal class MyCustomDrawnEntity : DefaultDrawnEntity
{
public MyCustomDrawnEntity(string Text, DrawnOrgChart chart) : base(Text, chart) { }
protected override void Render(Graphics g, Rectangle rect)
{
Rectangle rectNoLocation = new Rectangle(0, 0, rect.Width, rect.Height);
// Offset so fill will begin at the box's correct position. Rectangle is set to
// 0/0 X/Y. This is so that any brushes will have the correct point of origin
Matrix LastTransform = g.Transform;
g.TranslateTransform(rect.X, rect.Y, MatrixOrder.Append);
g.FillEllipse(FillBrush, rectNoLocation);
g.DrawEllipse(BorderPen, rectNoLocation);
g.Transform = LastTransform;
StringFormat f = new StringFormat();
f.Alignment = StringAlignment.Center;
f.LineAlignment = StringAlignment.Center;
g.DrawString("Title Here", TitleFont, TitleBrush, rect, f);
}
public override IEntity Clone()
{
IEntity newEntity = new MyCustomDrawnEntity(Title, Chart);
CopySettings(newEntity);
return newEntity;
}
}