diff --git a/src/AddIns/Analysis/CodeQuality/Reporting/OverviewReport.cs b/src/AddIns/Analysis/CodeQuality/Reporting/OverviewReport.cs index 5cd0fd5d72..f066ae6c70 100644 --- a/src/AddIns/Analysis/CodeQuality/Reporting/OverviewReport.cs +++ b/src/AddIns/Analysis/CodeQuality/Reporting/OverviewReport.cs @@ -81,9 +81,9 @@ namespace ICSharpCode.CodeQuality.Reporting if (sectionName == ReportSectionNames.ReportHeader) { var param1 = (BaseTextItem)e.Section.Items.FirstOrDefault(n => n.Name == "Param1"); - FileInfo fi =new FileInfo(FileNames[0]); +// FileInfo fi =new FileInfo(FileNames[0]); // var s = fi..Directory + fi.Name; - param1.Text = fi.Name; + param1.Text = FileNames[0]; var param2 = (BaseTextItem)e.Section.Items.FirstOrDefault(n => n.Name == "Param2"); param2.Text = list.Count.ToString(); } diff --git a/src/AddIns/Analysis/CodeQuality/Reporting/Overviewreport.srd b/src/AddIns/Analysis/CodeQuality/Reporting/Overviewreport.srd index 63e1c3de29..c4af8af2bd 100644 --- a/src/AddIns/Analysis/CodeQuality/Reporting/Overviewreport.srd +++ b/src/AddIns/Analysis/CodeQuality/Reporting/Overviewreport.srd @@ -116,12 +116,12 @@ 139, 91 - 438, 20 + 377, 20 White Segoe UI, 9pt None TopLeft - False + True False No Parameters!param1 diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Wpf/Visitor/FixedDocumentCreator.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Wpf/Visitor/FixedDocumentCreator.cs index 743549ca3d..3e12f16f93 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Wpf/Visitor/FixedDocumentCreator.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Wpf/Visitor/FixedDocumentCreator.cs @@ -59,7 +59,7 @@ namespace ICSharpCode.Reporting.WpfReportViewer.Visitor return canvas; } - + /* public static TextBlock CreateTextBlock(ExportText exportText,bool setBackcolor){ var textBlock = new TextBlock(); @@ -79,8 +79,9 @@ namespace ICSharpCode.Reporting.WpfReportViewer.Visitor MeasureTextBlock (textBlock,exportText); return textBlock; } + */ - + /* static void CheckForNewLine(TextBlock textBlock,ExportText exportText) { string [] inlines = exportText.Text.Split(Environment.NewLine.ToCharArray()); for (int i = 0; i < inlines.Length; i++) { @@ -101,22 +102,15 @@ namespace ICSharpCode.Reporting.WpfReportViewer.Visitor textBlock.Height = wpfSize.Height; } + */ + /* static Size MeasureTextInWpf(ExportText exportText){ if (exportText.CanGrow) { - var formattedText = new FormattedText(exportText.Text, - CultureInfo.CurrentCulture, - FlowDirection.LeftToRight, - new Typeface(exportText.Font.FontFamily.Name), - exportText.Font.Size, - new SolidColorBrush(exportText.ForeColor.ToWpf()), - null, - TextFormattingMode.Display); + var formattedText = NewMethod(exportText); formattedText.MaxTextWidth = exportText.DesiredSize.Width * 96.0 / 72.0; -// ft.MaxTextHeight = exportText.DesiredSize.Height + 5 * 96.0 / 72.0; -// ft.MaxTextHeight = Double.MaxValue ; formattedText.SetFontSize(Math.Floor(exportText.Font.Size * 96.0 / 72.0)); @@ -127,6 +121,34 @@ namespace ICSharpCode.Reporting.WpfReportViewer.Visitor } return new Size(exportText.Size.Width,exportText.Size.Height); } + + */ + + + public static FormattedText CreateFormattedText(ExportText exportText) + { + var formattedText = new FormattedText(exportText.Text, + CultureInfo.CurrentCulture, + FlowDirection.LeftToRight, + new Typeface(exportText.Font.FontFamily.Name), + exportText.Font.Size, + new SolidColorBrush(exportText.ForeColor.ToWpf()), null, TextFormattingMode.Display); + + formattedText.MaxTextWidth = exportText.DesiredSize.Width * 96.0 / 72.0; + formattedText.SetFontSize(Math.Floor(exportText.Font.Size * 96.0 / 72.0)); + + var td = new TextDecorationCollection() ; + CheckUnderline(td,exportText); + formattedText.SetTextDecorations(td); + return formattedText; + } + + static void CheckUnderline(TextDecorationCollection td, ExportText exportText) + { + if (exportText.Font.Underline) { + td.Add(new TextDecoration{Location = TextDecorationLocation.Underline}); + } + } static Canvas CreateCanvas(ExportContainer container){ @@ -158,7 +180,7 @@ namespace ICSharpCode.Reporting.WpfReportViewer.Visitor FixedPage.SetTop(element,exportColumn.Location.Y); } - + /* static void SetFont(TextBlock textBlock,IExportText exportText){ textBlock.FontFamily = new FontFamily(exportText.Font.FontFamily.Name); @@ -180,7 +202,7 @@ namespace ICSharpCode.Reporting.WpfReportViewer.Visitor CreateStrikeout(textBlock,exportText); } } - + */ static void SetContentAlignment(TextBlock textBlock,ExportText exportText) { @@ -244,7 +266,7 @@ namespace ICSharpCode.Reporting.WpfReportViewer.Visitor textBlock.TextDecorations.Add(strikeOut); } - + /* static void CreateUnderline(TextBlock textBlock,IExportText exportColumn){ if (exportColumn == null) throw new ArgumentNullException("exportColumn"); @@ -256,7 +278,7 @@ namespace ICSharpCode.Reporting.WpfReportViewer.Visitor underLine.PenThicknessUnit = TextDecorationUnit.FontRecommended; textBlock.TextDecorations.Add(underLine); } - + */ public static Pen CreateWpfPen(IReportObject exportColumn){ if (exportColumn == null) @@ -264,6 +286,7 @@ namespace ICSharpCode.Reporting.WpfReportViewer.Visitor var pen = new Pen(); pen.Brush = ConvertBrush(exportColumn.ForeColor); pen.Thickness = 1; + var exportGraphics = exportColumn as IExportGraphics; if (exportGraphics != null) { pen.Thickness = exportGraphics.Thickness; diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Wpf/Visitor/WpfVisitor.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Wpf/Visitor/WpfVisitor.cs index 252b728591..56ec9d9b69 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Wpf/Visitor/WpfVisitor.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Wpf/Visitor/WpfVisitor.cs @@ -79,12 +79,28 @@ namespace ICSharpCode.Reporting.WpfReportViewer.Visitor public override void Visit(ExportText exportColumn){ + /* var textBlock = FixedDocumentCreator.CreateTextBlock((ExportText)exportColumn,ShouldSetBackcolor(exportColumn)); CanvasHelper.SetPosition(textBlock,new Point(exportColumn.Location.X,exportColumn.Location.Y)); UIElement = textBlock; + */ + + var ft = FixedDocumentCreator.CreateFormattedText((ExportText)exportColumn); + var visual = new DrawingVisual(); + var location = new Point(exportColumn.Location.X,exportColumn.Location.Y); + using (var dc = visual.RenderOpen()){ + if (ShouldSetBackcolor(exportColumn)) { + dc.DrawRectangle(FixedDocumentCreator.ConvertBrush(exportColumn.BackColor), + null, + new Rect(location,new Size(exportColumn.Size.Width,exportColumn.Size.Height))); + } + dc.DrawText(ft,location); + } + var dragingElement = new DrawingElement(visual); + UIElement = dragingElement; + } - - + public override void Visit(ExportLine exportGraphics) { @@ -111,8 +127,8 @@ namespace ICSharpCode.Reporting.WpfReportViewer.Visitor new Rect(exportRectangle.Location.X,exportRectangle.Location.Y, exportRectangle.Size.Width,exportRectangle.Size.Height)); } - DrawingElement m = new DrawingElement(visual); - UIElement = m; + var dragingElement = new DrawingElement(visual); + UIElement = dragingElement; } public override void Visit(ExportCircle exportCircle) @@ -132,8 +148,8 @@ namespace ICSharpCode.Reporting.WpfReportViewer.Visitor } - DrawingElement m = new DrawingElement(visual); - UIElement = m; + var dragingElement = new DrawingElement(visual); + UIElement = dragingElement; } static Point CalcRad(System.Drawing.Size size) {