|
|
|
@ -17,6 +17,7 @@ |
|
|
|
// DEALINGS IN THE SOFTWARE.
|
|
|
|
// DEALINGS IN THE SOFTWARE.
|
|
|
|
|
|
|
|
|
|
|
|
using System; |
|
|
|
using System; |
|
|
|
|
|
|
|
using System.Collections.Generic; |
|
|
|
using System.Windows; |
|
|
|
using System.Windows; |
|
|
|
using System.Windows.Controls; |
|
|
|
using System.Windows.Controls; |
|
|
|
using System.Windows.Documents; |
|
|
|
using System.Windows.Documents; |
|
|
|
@ -117,7 +118,6 @@ namespace ICSharpCode.Reporting.WpfReportViewer.Visitor |
|
|
|
} |
|
|
|
} |
|
|
|
var dragingElement = new DrawingElement(visual); |
|
|
|
var dragingElement = new DrawingElement(visual); |
|
|
|
UIElement = dragingElement; |
|
|
|
UIElement = dragingElement; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -140,34 +140,32 @@ namespace ICSharpCode.Reporting.WpfReportViewer.Visitor |
|
|
|
var border = CreateBorder(exportRectangle); |
|
|
|
var border = CreateBorder(exportRectangle); |
|
|
|
border.CornerRadius = new CornerRadius(Convert.ToDouble(exportRectangle.CornerRadius)); |
|
|
|
border.CornerRadius = new CornerRadius(Convert.ToDouble(exportRectangle.CornerRadius)); |
|
|
|
CanvasHelper.SetPosition(border, new Point(0,0)); |
|
|
|
CanvasHelper.SetPosition(border, new Point(0,0)); |
|
|
|
var panel = new StackPanel(); |
|
|
|
var containerCanvas = CreateItemsInContainer(exportRectangle.ExportedItems); |
|
|
|
panel.Orientation = Orientation.Horizontal; |
|
|
|
border.Child = containerCanvas; |
|
|
|
foreach (var element in exportRectangle.ExportedItems) { |
|
|
|
|
|
|
|
var acceptor = element as IAcceptor; |
|
|
|
|
|
|
|
acceptor.Accept(this); |
|
|
|
|
|
|
|
panel.Children.Add(UIElement); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
border.Child = panel; |
|
|
|
|
|
|
|
UIElement = border; |
|
|
|
UIElement = border; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public override void Visit(ExportCircle exportCircle) |
|
|
|
public override void Visit(ExportCircle exportCircle) |
|
|
|
{ |
|
|
|
{ |
|
|
|
var containerCanvas = new Canvas(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var drawingElement = CircleVisual(exportCircle); |
|
|
|
var drawingElement = CircleVisual(exportCircle); |
|
|
|
|
|
|
|
var containerCanvas = CreateItemsInContainer(exportCircle.ExportedItems); |
|
|
|
containerCanvas.Children.Add(drawingElement); |
|
|
|
containerCanvas.Children.Insert(0,drawingElement); |
|
|
|
foreach (var element in exportCircle.ExportedItems) { |
|
|
|
|
|
|
|
var acceptor = element as IAcceptor; |
|
|
|
|
|
|
|
acceptor.Accept(this); |
|
|
|
|
|
|
|
containerCanvas.Children.Add(UIElement); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
UIElement = containerCanvas; |
|
|
|
UIElement = containerCanvas; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Canvas CreateItemsInContainer (List<IExportColumn> items) { |
|
|
|
|
|
|
|
var canvas = new Canvas(); |
|
|
|
|
|
|
|
foreach (var element in items) { |
|
|
|
|
|
|
|
var acceptor = element as IAcceptor; |
|
|
|
|
|
|
|
acceptor.Accept(this); |
|
|
|
|
|
|
|
canvas.Children.Add(UIElement); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return canvas; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool IsGraphicsContainer (IExportColumn column) { |
|
|
|
bool IsGraphicsContainer (IExportColumn column) { |
|
|
|
return column is GraphicsContainer; |
|
|
|
return column is GraphicsContainer; |
|
|
|
} |
|
|
|
} |
|
|
|
@ -196,21 +194,22 @@ namespace ICSharpCode.Reporting.WpfReportViewer.Visitor |
|
|
|
|
|
|
|
|
|
|
|
Border CreateBorder(IExportColumn exportColumn) |
|
|
|
Border CreateBorder(IExportColumn exportColumn) |
|
|
|
{ |
|
|
|
{ |
|
|
|
double bT; |
|
|
|
|
|
|
|
var gc = IsGraphicsContainer(exportColumn); |
|
|
|
|
|
|
|
if (!IsGraphicsContainer(exportColumn)) { |
|
|
|
|
|
|
|
bT = 1; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
bT = Convert.ToDouble(((GraphicsContainer)exportColumn).Thickness); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
var border = new Border(); |
|
|
|
var border = new Border(); |
|
|
|
border.BorderThickness = new Thickness(bT); |
|
|
|
border.BorderThickness = Thickness(exportColumn); |
|
|
|
border.BorderBrush = FixedDocumentCreator.ConvertBrush(exportColumn.ForeColor); |
|
|
|
border.BorderBrush = FixedDocumentCreator.ConvertBrush(exportColumn.ForeColor); |
|
|
|
border.Background = FixedDocumentCreator.ConvertBrush(exportColumn.BackColor); |
|
|
|
border.Background = FixedDocumentCreator.ConvertBrush(exportColumn.BackColor); |
|
|
|
border.Width = exportColumn.Size.Width; |
|
|
|
border.Width = exportColumn.Size.Width; |
|
|
|
border.Height = exportColumn.Size.Height; |
|
|
|
border.Height = exportColumn.Size.Height; |
|
|
|
return border; |
|
|
|
return border; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Thickness Thickness(IExportColumn exportColumn) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
double bT; |
|
|
|
|
|
|
|
bT = !IsGraphicsContainer(exportColumn) ? 1 : Convert.ToDouble(((GraphicsContainer)exportColumn).Thickness); |
|
|
|
|
|
|
|
return new Thickness(bT); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static Point CalcRadius(System.Drawing.Size size) { |
|
|
|
static Point CalcRadius(System.Drawing.Size size) { |
|
|
|
|