Browse Source

FxCop

reports
Peter Forstmeier 12 years ago
parent
commit
6d84ea5c35
  1. 6
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Collections.cs
  2. 5
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/DataManager/Listhandling/CollectionDataSource.cs
  3. 2
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Expressions/ExpressionHelper.cs
  4. 7
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Expressions/TypeNormalizer.cs
  5. 6
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Globals/StandardFormatter.cs

6
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Collections.cs

@ -29,7 +29,7 @@ namespace ICSharpCode.Reporting @@ -29,7 +29,7 @@ namespace ICSharpCode.Reporting
throw new ArgumentNullException("columnName");
}
return this.FirstOrDefault(x => 0 == String.Compare(x.ColumnName,columnName,true,CultureInfo.InvariantCulture));
return this.FirstOrDefault(x => 0 == String.Compare(x.ColumnName,columnName,StringComparison.OrdinalIgnoreCase));
}
@ -54,7 +54,7 @@ namespace ICSharpCode.Reporting @@ -54,7 +54,7 @@ namespace ICSharpCode.Reporting
throw new ArgumentNullException("columnName");
}
return this.FirstOrDefault(x => 0 == String.Compare(x.ColumnName,columnName,true,CultureInfo.InvariantCulture));
return this.FirstOrDefault(x => 0 == String.Compare(x.ColumnName,columnName,StringComparison.OrdinalIgnoreCase));
}
}
@ -71,7 +71,7 @@ namespace ICSharpCode.Reporting @@ -71,7 +71,7 @@ namespace ICSharpCode.Reporting
if (String.IsNullOrEmpty(parameterName)) {
throw new ArgumentNullException("parameterName");
}
return this.FirstOrDefault(x => 0 == String.Compare(x.ParameterName,parameterName,true,CultureInfo.InvariantCulture));
return this.FirstOrDefault(x => 0 == String.Compare(x.ParameterName,parameterName,StringComparison.OrdinalIgnoreCase));
}

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

@ -257,14 +257,14 @@ namespace ICSharpCode.Reporting.DataManager.Listhandling @@ -257,14 +257,14 @@ namespace ICSharpCode.Reporting.DataManager.Listhandling
throw new NotImplementedException();
}
DataCollection<object> CreateBaseList(IEnumerable source, Type elementType)
static DataCollection<object> CreateBaseList(IEnumerable source, Type elementType)
{
var list = new DataCollection<object>(elementType);
list.AddRange(source);
return list;
}
/*
PropertyDescriptorCollection GetItemProperties(PropertyDescriptor[] listAccessors){
if (listAccessors != null && listAccessors.Length > 0){
var t = this.elementType;
@ -277,5 +277,6 @@ namespace ICSharpCode.Reporting.DataManager.Listhandling @@ -277,5 +277,6 @@ namespace ICSharpCode.Reporting.DataManager.Listhandling
}
return ExtendedTypeDescriptor.GetProperties(elementType);
}
*/
}
}

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

@ -22,7 +22,7 @@ namespace ICSharpCode.Reporting.Expressions @@ -22,7 +22,7 @@ namespace ICSharpCode.Reporting.Expressions
public static bool CanEvaluate (string expression)
{
if ((!String.IsNullOrEmpty(expression)) && (expression.StartsWith("=",StringComparison.InvariantCultureIgnoreCase))) {
if ((!String.IsNullOrEmpty(expression)) && (expression.StartsWith("=",StringComparison.OrdinalIgnoreCase))) {
return true;
}
return false;

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

@ -1,6 +1,7 @@ @@ -1,6 +1,7 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using System.Globalization;
namespace ICSharpCode.Reporting.Expressions
{
@ -27,13 +28,13 @@ namespace ICSharpCode.Reporting.Expressions @@ -27,13 +28,13 @@ namespace ICSharpCode.Reporting.Expressions
try
{
right = Convert.ChangeType(right,left.GetType());
right = Convert.ChangeType(right,left.GetType(),CultureInfo.CurrentCulture);
}
catch
{
try
{
left = Convert.ChangeType(left, right.GetType());
left = Convert.ChangeType(left, right.GetType(),CultureInfo.CurrentCulture);
}
catch
{
@ -92,7 +93,7 @@ namespace ICSharpCode.Reporting.Expressions @@ -92,7 +93,7 @@ namespace ICSharpCode.Reporting.Expressions
return value;
try {
return Convert.ChangeType(value, targetType);
return Convert.ChangeType(value, targetType,CultureInfo.CurrentCulture);
} catch (Exception e) {
Console.WriteLine("TypeNormalizer {0} - {1}",value.ToString(),e.Message);

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

@ -51,7 +51,7 @@ namespace ICSharpCode.Reporting.Globals @@ -51,7 +51,7 @@ namespace ICSharpCode.Reporting.Globals
retValue = FormatDate(valueToFormat,format);
break;
case TypeCode.Boolean:
retValue = FormatBool (valueToFormat,format);
retValue = FormatBool (valueToFormat);
break;
case TypeCode.Decimal:
retValue = FormatDecimal (valueToFormat,format);
@ -74,7 +74,7 @@ namespace ICSharpCode.Reporting.Globals @@ -74,7 +74,7 @@ namespace ICSharpCode.Reporting.Globals
}
private static string FormatBool (string toFormat, string format)
private static string FormatBool (string toFormat)
{
if (CheckValue(toFormat)) {
bool b = bool.Parse (toFormat);
@ -142,7 +142,7 @@ namespace ICSharpCode.Reporting.Globals @@ -142,7 +142,7 @@ namespace ICSharpCode.Reporting.Globals
CultureInfo.CurrentCulture,
out time);
if (valid) {
return time.ToString("g");
return time.ToString("g",DateTimeFormatInfo.CurrentInfo);
}
return toFormat;
}

Loading…
Cancel
Save