Browse Source

FxCop

reports
Peter Forstmeier 12 years ago
parent
commit
415e13d541
  1. 8
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/DataManager/Listhandling/CollectionDataSource.cs
  2. 2
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/DataSource/Comparer/GroupComparer.cs
  3. 2
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Exporter/Visitors/AbstractVisitor.cs
  4. 3
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Exporter/Visitors/ExpressionVisitor.cs
  5. 2
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Expressions/ExpressionHelper.cs
  6. 3
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Expressions/Irony/ExpressionEvaluator.cs
  7. 6
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Expressions/TypeNormalizer.cs
  8. 2
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Globals/GlobalEnums.cs
  9. 8
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Globals/StandardFormatter.cs
  10. 4
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Pdf/PdfExtensions.cs
  11. 1
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Pdf/PdfVisitor.cs
  12. 1
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/ReportingFactory.cs
  13. 18
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Wpf/Visitor/CanvasExtension.cs
  14. 2
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Wpf/Visitor/Graphics/ExtendedLine.cs
  15. 2
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Wpf/Visitor/WpfVisitor.cs

8
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/DataManager/Listhandling/CollectionDataSource.cs

@ -29,7 +29,7 @@ namespace ICSharpCode.Reporting.DataManager.Listhandling @@ -29,7 +29,7 @@ namespace ICSharpCode.Reporting.DataManager.Listhandling
{
readonly DataCollection<object> baseList;
readonly ReportSettings reportSettings;
readonly Type elementType;
// readonly Type elementType;
readonly PropertyDescriptorCollection listProperties;
@ -60,7 +60,7 @@ namespace ICSharpCode.Reporting.DataManager.Listhandling @@ -60,7 +60,7 @@ namespace ICSharpCode.Reporting.DataManager.Listhandling
CurrentList = baseList;
this.elementType = elementType;
// this.elementType = elementType;
this.reportSettings = reportSettings;
this.listProperties = this.baseList.GetItemProperties(null);
@ -155,8 +155,8 @@ namespace ICSharpCode.Reporting.DataManager.Listhandling @@ -155,8 +155,8 @@ namespace ICSharpCode.Reporting.DataManager.Listhandling
#region Fill
public void Fill (List<IPrintableObject> collection, object toFill) {
Current = toFill;
public void Fill (List<IPrintableObject> collection, object current) {
Current = current;
foreach (var element in collection) {
var container = element as ReportContainer;
if (container != null) {

2
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/DataSource/Comparer/GroupComparer.cs

@ -24,6 +24,6 @@ namespace ICSharpCode.Reporting.DataSource.Comparer @@ -24,6 +24,6 @@ namespace ICSharpCode.Reporting.DataSource.Comparer
IndexList = new IndexList();
}
public IndexList IndexList {get;set;}
public IndexList IndexList {get;private set;}
}
}

2
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Exporter/Visitors/AbstractVisitor.cs

@ -67,7 +67,7 @@ namespace ICSharpCode.Reporting.Exporter.Visitors @@ -67,7 +67,7 @@ namespace ICSharpCode.Reporting.Exporter.Visitors
}
protected bool ShouldSetBackcolor (ExportColumn exportColumn) {
protected static bool ShouldSetBackcolor (ExportColumn exportColumn) {
return exportColumn.BackColor != Color.White;
}

3
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Exporter/Visitors/ExpressionVisitor.cs

@ -2,6 +2,7 @@ @@ -2,6 +2,7 @@
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using System.Collections.Generic;
using System.Globalization;
using ICSharpCode.Reporting.Expressions;
using ICSharpCode.Reporting.Expressions.Irony;
using ICSharpCode.Reporting.Expressions.Irony.Ast;
@ -51,7 +52,7 @@ namespace ICSharpCode.Reporting.Exporter.Visitors @@ -51,7 +52,7 @@ namespace ICSharpCode.Reporting.Exporter.Visitors
object result = Evaluate(exportColumn);
exportColumn.Text = result.ToString();
} catch (Exception e) {
var s = String.Format("SharpReport.Expressions -> {0} for {1}",e.Message,exportColumn.Text);
var s = String.Format(CultureInfo.CurrentCulture,"SharpReport.Expressions -> {0} for {1}",e.Message,exportColumn.Text);
Console.WriteLine(s);
}
}

2
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Expressions/ExpressionHelper.cs

@ -30,7 +30,7 @@ namespace ICSharpCode.Reporting.Expressions @@ -30,7 +30,7 @@ namespace ICSharpCode.Reporting.Expressions
public static string ComposeAstNodeError (string branch,AstNode node) {
return String.Format ("Missing {0} <{1}>",branch,node.AsString);
return String.Format (CultureInfo.CurrentCulture,"Missing {0} <{1}>",branch,node.AsString);
}
}
}

3
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Expressions/Irony/ExpressionEvaluator.cs

@ -46,12 +46,13 @@ namespace ICSharpCode.Reporting.Expressions.Irony @@ -46,12 +46,13 @@ namespace ICSharpCode.Reporting.Expressions.Irony
public object Evaluate() {
return App.Evaluate();
}
/*
public void ClearOutput() {
App.ClearOutputBuffer();
}
public string GetOutput() {
return App.GetOutput();
}
*/
}
}

6
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Expressions/TypeNormalizer.cs

@ -8,9 +8,9 @@ namespace ICSharpCode.Reporting.Expressions @@ -8,9 +8,9 @@ namespace ICSharpCode.Reporting.Expressions
/// <summary>
/// Description of TypeNormalizer.
/// </summary>
public class TypeNormalizer
public class TypeNormalizer
{
/*
public static void NormalizeTypes(ref object left,ref object right)
{
NormalizeTypes(ref left,ref right,0);
@ -59,7 +59,7 @@ namespace ICSharpCode.Reporting.Expressions @@ -59,7 +59,7 @@ namespace ICSharpCode.Reporting.Expressions
values[i] = EnsureType(values[i],targetType,nullValue);
}
}
*/
public static T EnsureType<T>(object value)
{
return EnsureType<T>(value, default(T));

2
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Globals/GlobalEnums.cs

@ -13,7 +13,7 @@ namespace ICSharpCode.Reporting.Globals @@ -13,7 +13,7 @@ namespace ICSharpCode.Reporting.Globals
/// <summary>
/// Description of GlobalEnums.
/// </summary>
public class GlobalEnums
public sealed class GlobalEnums
{
private GlobalEnums() {
}

8
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Globals/StandardFormatter.cs

@ -93,8 +93,8 @@ namespace ICSharpCode.Reporting.Globals @@ -93,8 +93,8 @@ namespace ICSharpCode.Reporting.Globals
CultureInfo.CurrentCulture.NumberFormat);
str = number.ToString (format,CultureInfo.CurrentCulture);
} catch (System.FormatException e) {
throw e;
} catch (FormatException e) {
throw ;
}
return str;
} else {
@ -114,8 +114,8 @@ namespace ICSharpCode.Reporting.Globals @@ -114,8 +114,8 @@ namespace ICSharpCode.Reporting.Globals
CultureInfo.CurrentCulture.NumberFormat);
str = dec.ToString (format,CultureInfo.CurrentCulture);
} catch (System.FormatException e) {
throw e;
} catch (FormatException e) {
throw ;
}
return str;
} else {

4
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Pdf/PdfExtensions.cs

@ -28,8 +28,8 @@ namespace ICSharpCode.Reporting.Pdf @@ -28,8 +28,8 @@ namespace ICSharpCode.Reporting.Pdf
}
public static float ToPoint (this int integer) {
return Convert(integer);
public static float ToPoint (this int value) {
return Convert(value);
}

1
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Pdf/PdfVisitor.cs

@ -27,7 +27,6 @@ namespace ICSharpCode.Reporting.Pdf @@ -27,7 +27,6 @@ namespace ICSharpCode.Reporting.Pdf
public override void Visit(ExportPage page)
{
var pageSize = page.Size.ToXSize();
PdfPage = pdfDocument.AddPage();
gfx = XGraphics.FromPdfPage(PdfPage);
textFormatter = new XTextFormatter(gfx);

1
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/ReportingFactory.cs

@ -32,6 +32,7 @@ namespace ICSharpCode.Reporting @@ -32,6 +32,7 @@ namespace ICSharpCode.Reporting
return builder;
}
[Obsolete("Use public IReportCreator ReportCreator (Stream stream,IEnumerable list")]
public IReportCreator ReportCreator (Stream stream,Type listType,IEnumerable list)
{

18
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Wpf/Visitor/CanvasExtension.cs

@ -13,27 +13,27 @@ namespace ICSharpCode.Reporting.WpfReportViewer.Visitor @@ -13,27 +13,27 @@ namespace ICSharpCode.Reporting.WpfReportViewer.Visitor
public static class CanvasExtension
{
public static void AddChild<T>(this Canvas canvas, T element)
public static void AddChild<T>(this Panel panel, T element)
{
var uiElement = element as UIElement;
if (uiElement != null && !canvas.Children.Contains(uiElement))
canvas.Children.Add(uiElement);
if (uiElement != null && !panel.Children.Contains(uiElement))
panel.Children.Add(uiElement);
}
public static void RemoveChild<T>(this Canvas canvas, T element)
public static void RemoveChild<T>(this Panel panel, T element)
{
var uiElement = element as UIElement;
if (uiElement != null && canvas.Children.Contains(uiElement))
canvas.Children.Remove(uiElement);
if (uiElement != null && panel.Children.Contains(uiElement))
panel.Children.Remove(uiElement);
}
public static void InsertChild<T>(this Canvas canvas, int index, T element)
public static void InsertChild<T>(this Panel panel, int index, T element)
{
var uiElement = element as UIElement;
if (uiElement != null && !canvas.Children.Contains(uiElement))
canvas.Children.Insert(index, uiElement);
if (uiElement != null && !panel.Children.Contains(uiElement))
panel.Children.Insert(index, uiElement);
}
}

2
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Wpf/Visitor/Graphics/ExtendedLine.cs

@ -44,7 +44,7 @@ namespace ICSharpCode.Reporting.WpfReportViewer.Visitor.Graphics @@ -44,7 +44,7 @@ namespace ICSharpCode.Reporting.WpfReportViewer.Visitor.Graphics
protected override Visual GetVisualChild(int index){
if (index < 0 || index >= children.Count)
{
throw new ArgumentOutOfRangeException();
throw new ArgumentOutOfRangeException("index");
}
return children[index];

2
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Wpf/Visitor/WpfVisitor.cs

@ -128,7 +128,7 @@ namespace ICSharpCode.Reporting.WpfReportViewer.Visitor @@ -128,7 +128,7 @@ namespace ICSharpCode.Reporting.WpfReportViewer.Visitor
UIElement = m;
}
Point CalcRad(System.Drawing.Size size) {
static Point CalcRad(System.Drawing.Size size) {
return new Point(size.Width /2,size.Height /2);
}

Loading…
Cancel
Save