public override void Visit(ExportContainer exportContainer) { sectionCanvas = FixedDocumentCreator.CreateContainer(exportContainer); sectionCanvas.Name = exportContainer.Name; CanvasHelper.SetPosition(sectionCanvas, new Point(exportContainer.Location.X, exportContainer.Location.Y)); PerformList(sectionCanvas, exportContainer.ExportedItems); }
public override void Visit(ExportRectangle exportRectangle) { Canvas containerCanvas = FixedDocumentCreator.CreateContainer(exportRectangle); Canvas elementCanvas = null; var border = CreateBorder(exportRectangle); border.CornerRadius = new CornerRadius(Convert.ToDouble(exportRectangle.CornerRadius)); CanvasHelper.SetPosition(border, new Point(0, 0)); foreach (var element in exportRectangle.ExportedItems) { if (IsGraphicsContainer(element)) { elementCanvas = RenderGraphicsContainer(element); containerCanvas.Children.Add(elementCanvas); } else { AsAcceptor(element).Accept(this); containerCanvas.Children.Add(UIElement); } containerCanvas.UpdateLayout(); } border.Child = containerCanvas; UIElement = border; }
Canvas RenderGraphicsContainer(IExportColumn column) { var graphicsContainer = column as GraphicsContainer; var graphCanvas = FixedDocumentCreator.CreateContainer(graphicsContainer); CanvasHelper.SetPosition(graphCanvas, column.Location.ToWpf()); graphCanvas.Background = FixedDocumentCreator.ConvertBrush(column.BackColor); if (graphicsContainer != null) { var rect = column as ExportRectangle; if (rect != null) { Visit(rect); } var circle = column as ExportCircle; if (circle != null) { Visit(circle); } graphCanvas.Children.Add(UIElement); } return(graphCanvas); }
Canvas RenderDataRow(ExportContainer row) { var rowCanvas = FixedDocumentCreator.CreateContainer(row); var childCanvas = CreateItemsInContainer(row.ExportedItems); rowCanvas.Children.Add(childCanvas); return(rowCanvas); }
Canvas RenderSectionContainer(ExportContainer container) { var canvas = FixedDocumentCreator.CreateContainer(container); foreach (var element in container.ExportedItems) { if (IsContainer(element)) { RenderRow(canvas, (IExportContainer)element); } else { AsAcceptor(element).Accept(this); canvas.Children.Add(UIElement); } } canvas.Background = FixedDocumentCreator.ConvertBrush(container.BackColor); return(canvas); }
void PerformList(Canvas myCanvas, System.Collections.Generic.List <IExportColumn> exportedItems) { foreach (var element in exportedItems) { var container = element as ExportContainer; if (container != null) { var containerCanvas = FixedDocumentCreator.CreateContainer(container); CanvasHelper.SetPosition(containerCanvas, new Point(container.Location.X, container.Location.Y)); myCanvas.Children.Add(containerCanvas); PerformList(containerCanvas, container.ExportedItems); } else { var acceptor = element as IAcceptor; acceptor.Accept(this); myCanvas.Children.Add(UIElement); } } }
public override void Visit(ExportContainer exportContainer) { sectionCanvas = FixedDocumentCreator.CreateContainer(exportContainer); sectionCanvas = RenderSectionContainer(exportContainer); }