protected virtual void PrepareFrame() { ActualHeight = classItemContainer.GetAbsoluteContentHeight(); if (Container != null) { return; } shadowpath = new GraphicsPath(); if (RoundedCorners) { int radius = CornerRadius; shadowpath.AddArc(ActualWidth - radius + 4, 3, radius, radius, 300, 60); shadowpath.AddArc(ActualWidth - radius + 4, ActualHeight - radius + 3, radius, radius, 0, 90); shadowpath.AddArc(4, ActualHeight - radius + 3, radius, radius, 90, 45); shadowpath.AddArc(ActualWidth - radius, ActualHeight - radius, radius, radius, 90, -90); } else { shadowpath.AddPolygon(new PointF[] { new PointF(ActualWidth, 3), new PointF(ActualWidth + 4, 3), new PointF(ActualWidth + 4, ActualHeight + 3), new PointF(4, ActualHeight + 3), new PointF(4, ActualHeight), new PointF(ActualWidth, ActualHeight) }); } shadowpath.CloseFigure(); }
// вычисление положения точки для начала соединяющей линии public void OffsetPointTo() { if (dataNode.LinkedToNodes.Count == 0) { return; } int line = 0; float offsetY = (!classItemHeaderedContent.Collapsed) ? titles.GetAbsoluteContentHeight() + 5 : 0; foreach (var item in items) { if (!classItemHeaderedContent.Collapsed) { offsetY += item.GetAbsoluteContentHeight() + items.Spacing; } SetPointTo(++line, offsetY); } }