Hi,
You could use a compound pen to draw the double line. The extra texts could be implemented using attached nodes that follow the moved / resized triangle node:
DiagramNode TriangleWithLabels(RectangleF bounds)
{
float xl = bounds.Left;
float xr = bounds.Right;
float xm = xl + 3f * bounds.Width / 5f;
float yt = bounds.Top;
float yb = bounds.Bottom;
float ym = yt + 2f * bounds.Height / 5f;
var triangle = diagram.Factory.CreateShapeNode(
xl, ym, xm - xl, yb - ym - 2, Shapes.Merge);
triangle.Brush = new MindFusion.Drawing.SolidBrush(Color.Transparent);
triangle.ShadowBrush = triangle.Brush;
triangle.Pen = new MindFusion.Drawing.Pen(Color.Black, 2f);
triangle.Pen.CompoundArray = new[] { 0.0f, 0.1f, 0.9f, 1f };
triangle.Text = "1";
var topText = diagram.Factory.CreateShapeNode(
xl, yt, xm - xl, ym - yt, Shapes.Rectangle);
topText.Transparent = true;
topText.EnabledHandles = AdjustmentHandles.None;
// or .Locked = true
topText.Text = "text";
var bar = diagram.Factory.CreateShapeNode(
xm + 1, yt, 2, bounds.Height, Shapes.Rectangle);
bar.Brush = new MindFusion.Drawing.SolidBrush(Color.Black);
bar.ShadowBrush = triangle.ShadowBrush;
bar.EnabledHandles = AdjustmentHandles.None;
// or .Locked = true
var topRightText = diagram.Factory.CreateShapeNode(
xm + 2, yt, xr - xm, ym - yt, Shapes.Rectangle);
topRightText.Transparent = true;
topRightText.EnabledHandles = AdjustmentHandles.None;
// or .Locked = true
topRightText.Text = "text";
var bottomRightText = diagram.Factory.CreateShapeNode(
xm + 2, ym, xr - xm, yb - ym, Shapes.Rectangle);
bottomRightText.Transparent = true;
bottomRightText.EnabledHandles = AdjustmentHandles.None;
// or .Locked = true
bottomRightText.Text = "text";
topText.AttachTo(triangle, AttachToNode.TopRight);
topRightText.AttachTo(triangle, AttachToNode.TopRight);
bottomRightText.AttachTo(triangle, AttachToNode.BottomRight);
bar.AttachTo(triangle,
GroupAnchorStyles.Top | GroupAnchorStyles.Bottom | GroupAnchorStyles.Right);
return triangle;
}
If you prefer rendering all that in a single node object, you could custom-draw it with the System.Drawing API, either by using standard ShapeNode and handling DrawNode event, or in a custom class that overrides the DrawLocal method. That should also be possible to implement via a CompositeNode that contains ShapeComponents for triangle and bar, and TextComponents for the labels.
Regards,
Slavcho
Mindfusion