Browse Source

Line in WpfVisitor.cs

reports
Peter Forstmeier 12 years ago
parent
commit
41ae6a3795
  1. 31
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/ExportRenderer/FixedDocumentCreator.cs
  2. 18
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Exporter/Visitors/WpfVisitor.cs

31
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/ExportRenderer/FixedDocumentCreator.cs

@ -266,12 +266,41 @@ namespace ICSharpCode.Reporting.ExportRenderer
} }
Brush ConvertBrush(System.Drawing.Color color){ public Brush ConvertBrush(System.Drawing.Color color){
if (brushConverter.IsValid(color.Name)){ if (brushConverter.IsValid(color.Name)){
return brushConverter.ConvertFromString(color.Name) as SolidColorBrush; return brushConverter.ConvertFromString(color.Name) as SolidColorBrush;
} else{ } else{
return brushConverter.ConvertFromString("Black") as SolidColorBrush; return brushConverter.ConvertFromString("Black") as SolidColorBrush;
} }
} }
/*
public DashStyle DashStyle (IExportGraphics exportGraphics) {
switch (exportGraphics.DashStyle) {
case System.Drawing.Drawing2D.DashStyle.Solid:
break;
case System.Drawing.Drawing2D.DashStyle.Dash:
break;
case System.Drawing.Drawing2D.DashStyle.Dot:
break;
case System.Drawing.Drawing2D.DashStyle.DashDot:
break;
case System.Drawing.Drawing2D.DashStyle.DashDotDot:
break;
case System.Drawing.Drawing2D.DashStyle.Custom:
break;
default:
throw new Exception("Invalid value for DashStyle");
}
return DashStyle.Solid();
}
*/
} }
} }

18
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Exporter/Visitors/WpfVisitor.cs

@ -10,6 +10,7 @@ using System;
using System.Windows; using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
using System.Windows.Documents; using System.Windows.Documents;
using System.Windows.Media;
using ICSharpCode.Reporting.ExportRenderer; using ICSharpCode.Reporting.ExportRenderer;
using ICSharpCode.Reporting.Interfaces.Export; using ICSharpCode.Reporting.Interfaces.Export;
@ -81,11 +82,26 @@ namespace ICSharpCode.Reporting.Exporter.Visitors
} }
public override void Visit(ExportLine exportGraphics) public override void Visit(ExportLine exportGraphics)
{ {
// base.Visit(exportGraphics); var line = new System.Windows.Shapes.Line();
line.Stroke = documentCreator.ConvertBrush(exportGraphics.ForeColor);
line.StrokeStartLineCap = PenLineCap.Round;
line.StrokeEndLineCap = PenLineCap.Round;
line.StrokeThickness = exportGraphics.Thickness;
line.X1 = exportGraphics.Location.X;
line.Y1 = exportGraphics.Location.Y;
line.X2 = exportGraphics.Size.Width;
line.Y2 = exportGraphics.Location.Y;
UIElement = line;
} }
protected UIElement UIElement {get;private set;} protected UIElement UIElement {get;private set;}

Loading…
Cancel
Save