Browse Source

Cleanup - FxCop

pull/520/merge
Peter Forstmeier 11 years ago
parent
commit
ca0e99d417
  1. 4
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignerBinding/DesignerBinding.cs
  2. 4
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Factory/CreateFormSheetFromModel.cs
  3. 6
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/XML/ReportDefinitionParser.cs
  4. 8
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/ICSharpCode.Reporting.csproj
  5. 12
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Collections.cs
  6. 3
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/DataManager/DataCollection.cs
  7. 22
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/DataManager/Listhandling/CollectionDataSource.cs
  8. 33
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/DataManager/Listhandling/IndexList.cs
  9. 102
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/DataSource/Comparer/BaseComparer.cs
  10. 39
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/DataSource/Comparer/GroupComparer.cs
  11. 115
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/DataSource/Comparer/SortComparer.cs
  12. 42
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/DataSource/Comparer/SortExtension.cs
  13. 3
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/DataSource/ExtendedPropertyDescriptor.cs
  14. 8
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/DataSource/ExtendedTypeDescriptor.cs
  15. 2
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/DataSource/PropertyMemberAccessore.cs
  16. 8
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Factories/ExportColumnFactory.cs
  17. 1
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Factories/ReportCreatorFactory.cs
  18. 5
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Factories/ReportModelFactory.cs
  19. 6
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Globals/CreateGraphics.cs
  20. 1
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Globals/MeasurementService.cs
  21. 13
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Globals/StandardFormatter.cs
  22. 2
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Globals/TypeHelper.cs
  23. 1
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Interfaces/Data/IDataSource.cs
  24. 2
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Items/BaseRowItem.cs
  25. 2
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Items/GroupColumn.cs
  26. 2
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/ReportingFactory.cs

4
src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignerBinding/DesignerBinding.cs

@ -47,9 +47,7 @@ namespace ICSharpCode.Reporting.Addin.DesignerBinding { @@ -47,9 +47,7 @@ namespace ICSharpCode.Reporting.Addin.DesignerBinding {
if (file.IsDirty) {
var reportModel = ReportModelFactory.Create();
var reportFactory = new CreateFormSheetFromModel();
var xml = reportFactory.ToXml(reportModel);
var xml = CreateFormSheetFromModel.ToXml(reportModel);
var doc = new XmlDocument();
doc.LoadXml(xml.ToString());

4
src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Factory/CreateFormSheetFromModel.cs

@ -19,10 +19,10 @@ namespace ICSharpCode.Reporting.Addin.Factory @@ -19,10 +19,10 @@ namespace ICSharpCode.Reporting.Addin.Factory
/// <summary>
/// Description of CreateFormSheetReport.
/// </summary>
class CreateFormSheetFromModel
static class CreateFormSheetFromModel
{
public StringWriter ToXml(IReportModel reportModel) {
public static StringWriter ToXml(IReportModel reportModel) {
int locY = reportModel.ReportSettings.TopMargin;
foreach (var section in reportModel.SectionCollection)

6
src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/XML/ReportDefinitionParser.cs

@ -22,6 +22,7 @@ using System.ComponentModel; @@ -22,6 +22,7 @@ using System.ComponentModel;
using System.Diagnostics;
using System.Reflection;
using System.Xml;
using System.Xml.XPath;
using ICSharpCode.Reporting.Xml;
@ -102,8 +103,7 @@ namespace ICSharpCode.Reporting.Addin.XML @@ -102,8 +103,7 @@ namespace ICSharpCode.Reporting.Addin.XML
Type t=parent.GetType();
// children of a class must always be properties
foreach(XmlNode child in node.ChildNodes)
{
foreach(XmlNode child in node.ChildNodes){
if (child is XmlElement)
{
string pname=child.LocalName;
@ -220,7 +220,7 @@ namespace ICSharpCode.Reporting.Addin.XML @@ -220,7 +220,7 @@ namespace ICSharpCode.Reporting.Addin.XML
}
}
void SetPropertyToString(object obj, PropertyInfo pi, string value)
static void SetPropertyToString(object obj, PropertyInfo pi, string value)
{
// it's string, so use a type converter.
TypeConverter tc=TypeDescriptor.GetConverter(pi.PropertyType);

8
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/ICSharpCode.Reporting.csproj

@ -91,13 +91,8 @@ @@ -91,13 +91,8 @@
<Compile Include="Src\BaseClasses\TextDrawer.cs" />
<Compile Include="Src\Collections.cs" />
<Compile Include="Src\Configuration\AssemblyInfo.cs" />
<Compile Include="Src\DataManager\DataCollection.cs" />
<Compile Include="Src\DataManager\Listhandling\CollectionDataSource.cs" />
<Compile Include="Src\DataManager\Listhandling\IndexList.cs" />
<Compile Include="Src\DataSource\Comparer\BaseComparer.cs" />
<Compile Include="Src\DataSource\Comparer\GroupComparer.cs" />
<Compile Include="Src\DataSource\Comparer\SortComparer.cs" />
<Compile Include="Src\DataSource\Comparer\SortExtension.cs" />
<Compile Include="Src\DataSource\DataCollection.cs" />
<Compile Include="Src\DataSource\ExtendedPropertyDescriptor.cs" />
<Compile Include="Src\DataSource\ExtendedTypeDescriptor.cs" />
<Compile Include="Src\DataSource\FieldMemberAccessor.cs" />
@ -196,7 +191,6 @@ @@ -196,7 +191,6 @@
<Compile Include="Src\Xml\MycroParser.cs" />
</ItemGroup>
<ItemGroup>
<Folder Include="Src\DataSource\Comparer" />
<Folder Include="Src\Exporter\Visitors" />
<Folder Include="Src\Expressions\Irony" />
<Folder Include="Src\Expressions\Irony\Ast" />

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

@ -52,9 +52,6 @@ namespace ICSharpCode.Reporting @@ -52,9 +52,6 @@ namespace ICSharpCode.Reporting
public class GroupColumnCollection: SortColumnCollection
{
public GroupColumnCollection()
{
}
public new AbstractColumn Find (string columnName)
{
@ -67,12 +64,7 @@ namespace ICSharpCode.Reporting @@ -67,12 +64,7 @@ namespace ICSharpCode.Reporting
}
public class ParameterCollection: Collection<BasicParameter>{
public ParameterCollection()
{
}
public class ParameterCollection: Collection<BasicParameter>{
public BasicParameter Find (string parameterName)
{
@ -85,7 +77,7 @@ namespace ICSharpCode.Reporting @@ -85,7 +77,7 @@ namespace ICSharpCode.Reporting
public static CultureInfo Culture
{
get { return System.Globalization.CultureInfo.CurrentCulture; }
get { return CultureInfo.CurrentCulture; }
}

3
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/DataSource/DataCollection.cs → src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/DataManager/DataCollection.cs

@ -24,8 +24,9 @@ using System.ComponentModel; @@ -24,8 +24,9 @@ using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using ICSharpCode.Reporting.DataSource;
namespace ICSharpCode.Reporting.DataSource
namespace ICSharpCode.Reporting.DataManager
{
/// <summary>
/// Description of DataCollection.

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

@ -44,7 +44,6 @@ namespace ICSharpCode.Reporting.DataManager.Listhandling @@ -44,7 +44,6 @@ namespace ICSharpCode.Reporting.DataManager.Listhandling
{
readonly DataCollection<object> baseList;
readonly ReportSettings reportSettings;
// readonly Type elementType;
readonly PropertyDescriptorCollection listProperties;
@ -61,24 +60,7 @@ namespace ICSharpCode.Reporting.DataManager.Listhandling @@ -61,24 +60,7 @@ namespace ICSharpCode.Reporting.DataManager.Listhandling
this.listProperties = this.baseList.GetItemProperties(null);
OrderGroup = OrderGroup.AsIs;
}
[Obsolete("use public CollectionDataSource(IEnumerable list, ReportSettings reportSettings")]
public CollectionDataSource(IEnumerable list, Type elementType, ReportSettings reportSettings)
{
if (list == null)
throw new ArgumentNullException("list");
if (reportSettings == null)
throw new ArgumentNullException("reportSettings");
baseList = CreateBaseList(list);
CurrentList = baseList;
this.reportSettings = reportSettings;
this.listProperties = this.baseList.GetItemProperties(null);
OrderGroup = OrderGroup.AsIs;
}
public Collection<AbstractColumn> AvailableFields {
get {
@ -176,7 +158,7 @@ namespace ICSharpCode.Reporting.DataManager.Listhandling @@ -176,7 +158,7 @@ namespace ICSharpCode.Reporting.DataManager.Listhandling
public void Fill (List<IPrintableObject> collection, object current) {
Current = current;
foreach (var element in collection) {
foreach (var element in collection) {
var container = element as ReportContainer;
if (container != null) {
FillFromList(container.Items);

33
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/DataManager/Listhandling/IndexList.cs

@ -1,33 +0,0 @@ @@ -1,33 +0,0 @@
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.Collections.Generic;
using ICSharpCode.Reporting.DataSource.Comparer;
namespace ICSharpCode.Reporting.DataManager.Listhandling
{
/// <summary>
/// Description of IndexList.
/// </summary>
public class IndexList :List<BaseComparer>
{
public int CurrentPosition {get;set;}
}
}

102
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/DataSource/Comparer/BaseComparer.cs

@ -1,102 +0,0 @@ @@ -1,102 +0,0 @@
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.Collections.ObjectModel;
using ICSharpCode.Reporting.BaseClasses;
namespace ICSharpCode.Reporting.DataSource.Comparer
{
/// <summary>
/// Description of BaseComparer.
/// </summary>
public class BaseComparer : IComparable {
private int listIndex;
private object[] objectArray;
/// <summary>
/// Default constructor - initializes all fields to default values
/// </summary>
public BaseComparer(Collection<AbstractColumn> columnCollection , int listIndex, object[] values) {
this.ColumnCollection = columnCollection;
this.listIndex = listIndex;
this.objectArray = values;
}
/// <summary>
/// Interface method from IComparable
/// </summary>
/// <remarks>
/// Interface method from IComparable
///
/// </remarks>
/// <param name='obj'>a <see cref="BaseComparer"></see></param>
public virtual int CompareTo(object obj) {
return 0;
}
/// <summary>
/// Ausgeben der Werte als Pseudo-CSV
/// </summary>
public override string ToString()
{
System.Text.StringBuilder builder = new System.Text.StringBuilder();
builder.AppendFormat("{0};", this.listIndex);
foreach (object value in objectArray)
{
if (value == null || value == DBNull.Value)
{
builder.AppendFormat("<NULL>");
}
else if (value.GetType() == typeof(string))
{
builder.AppendFormat("\"{0}\"", (string)value);
}
else if (value is IFormattable)
{
builder.AppendFormat("{0}", ((IFormattable)value).ToString("g", System.Globalization.CultureInfo.InvariantCulture));
}
else
{
builder.AppendFormat("[{0}]", value.ToString());
}
builder.Append(';');
}
return builder.ToString();
}
public int ListIndex {
get {
return listIndex;
}
}
public object[] ObjectArray {
get {
return objectArray;
}
}
public Collection<AbstractColumn> ColumnCollection {get;private set;}
}
}

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

@ -1,39 +0,0 @@ @@ -1,39 +0,0 @@
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.Collections.ObjectModel;
using ICSharpCode.Reporting.BaseClasses;
using ICSharpCode.Reporting.DataManager.Listhandling;
namespace ICSharpCode.Reporting.DataSource.Comparer
{
/// <summary>
/// Description of GroupComparer.
/// </summary>
public class GroupComparer :SortComparer
{
public GroupComparer (Collection<AbstractColumn> owner, int listIndex, object[] values):base(owner,listIndex,values)
{
IndexList = new IndexList();
}
public IndexList IndexList {get;private set;}
}
}

115
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/DataSource/Comparer/SortComparer.cs

@ -1,115 +0,0 @@ @@ -1,115 +0,0 @@
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Globalization;
using ICSharpCode.Reporting.BaseClasses;
using ICSharpCode.Reporting.Items;
namespace ICSharpCode.Reporting.DataSource.Comparer
{
/// <summary>
/// Description of SortComparer.
/// </summary>
public class SortComparer : BaseComparer {
public SortComparer(Collection<AbstractColumn> owner, int listIndex, object[] values):base(owner,listIndex,values)
{
}
internal int CompareTo(SortComparer value)
{
// we shouldn't get to this point
if (value == null)
throw new ArgumentNullException("value");
if (value.ObjectArray.Length != base.ObjectArray.Length)
throw new InvalidOperationException();
int compare = 0;
for (int index = 0; index < base.ObjectArray.Length; index++)
{
object leftValue = base.ObjectArray[index];
object rightValue = value.ObjectArray[index];
// Indizes sind hier deckungsgleich
SortColumn sortColumn = (SortColumn)base.ColumnCollection[index];
bool descending = (sortColumn.SortDirection == ListSortDirection.Descending);
// null means equl
if (leftValue == null || leftValue == System.DBNull.Value)
{
if (rightValue != null && rightValue != System.DBNull.Value)
{
return (descending) ? 1 : -1;
}
// Beide Null
continue;
}
if (rightValue == null || rightValue == System.DBNull.Value)
{
return (descending) ? -1 : 1;
}
if (leftValue.GetType() != rightValue.GetType()){
string s = String.Format(CultureInfo.CurrentCulture,
"{0} {1} {2}",this.GetType().ToString(),
leftValue.GetType().ToString(),
rightValue.GetType().ToString());
throw new ArgumentException(s);
}
if (leftValue.GetType() == typeof(string))
{
compare = String.Compare((string)leftValue, (string)rightValue,
!sortColumn.CaseSensitive, CultureInfo.CurrentCulture);
}
else
{
compare = ((IComparable)leftValue).CompareTo(rightValue);
}
// Sind ungleich, tauschen je nach Richtung
if (compare != 0)
{
return (descending) ? -compare : compare;
}
}
// Gleich Werte, dann Index bercksichtigen
return this.ListIndex.CompareTo(value.ListIndex);
}
public override int CompareTo(object obj) {
base.CompareTo(obj);
return this.CompareTo((SortComparer)obj);
}
}
}

42
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/DataSource/Comparer/SortExtension.cs

@ -1,42 +0,0 @@ @@ -1,42 +0,0 @@
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.Linq;
namespace ICSharpCode.Reporting.DataSource.Comparer
{
/// <summary>
/// Description of SortExtension.
/// </summary>
internal static class SortExtension
{
public static IOrderedQueryable<BaseComparer> AscendingOrder(this IQueryable<BaseComparer> source )
{
return source.OrderBy(x => x.ObjectArray[0]);
}
public static IOrderedQueryable<BaseComparer> DescendingOrder(this IQueryable<BaseComparer> source )
{
return source.OrderByDescending(x => x.ObjectArray[0]);
}
}
}

3
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/DataSource/ExtendedPropertyDescriptor.cs

@ -20,6 +20,7 @@ using System; @@ -20,6 +20,7 @@ using System;
using System.Collections;
using System.ComponentModel;
using System.Reflection;
using ICSharpCode.Reporting.DataManager;
namespace ICSharpCode.Reporting.DataSource
{
@ -30,7 +31,7 @@ namespace ICSharpCode.Reporting.DataSource @@ -30,7 +31,7 @@ namespace ICSharpCode.Reporting.DataSource
{
Type componentType;
Type propertyType;
readonly Type propertyType;
PropertyInfo prop;
public ExtendedPropertyDescriptor (string name, Type componentType, Type propertyType)

8
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/DataSource/ExtendedTypeDescriptor.cs

@ -28,9 +28,9 @@ namespace ICSharpCode.Reporting.DataSource @@ -28,9 +28,9 @@ namespace ICSharpCode.Reporting.DataSource
/// </summary>
class ExtendedTypeDescriptor
{
private static Hashtable collections = new Hashtable();
static Hashtable collections = new Hashtable();
private static bool IsAllowedProperty(string name)
static bool IsAllowedProperty(string name)
{
return true; // alle erlaubt
}
@ -57,7 +57,7 @@ namespace ICSharpCode.Reporting.DataSource @@ -57,7 +57,7 @@ namespace ICSharpCode.Reporting.DataSource
}
}
PropertyDescriptor[] descriptors = new PropertyDescriptor[l];
var descriptors = new PropertyDescriptor[l];
int j = 0;
foreach(PropertyInfo pinfo in allProps)
@ -67,7 +67,7 @@ namespace ICSharpCode.Reporting.DataSource @@ -67,7 +67,7 @@ namespace ICSharpCode.Reporting.DataSource
descriptors[j++] = new ExtendedPropertyDescriptor(pinfo.Name, memberType, pinfo.PropertyType);
}
}
PropertyDescriptorCollection result = new PropertyDescriptorCollection(descriptors);
var result = new PropertyDescriptorCollection(descriptors);
collections.Add(memberType, result);
return result;
}

2
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/DataSource/PropertyMemberAccessore.cs

@ -33,7 +33,7 @@ namespace ICSharpCode.Reporting.DataSource @@ -33,7 +33,7 @@ namespace ICSharpCode.Reporting.DataSource
public class PropertyMemberAccessor : IMemberAccessor
{
private readonly PropertyInfo _prop;
readonly PropertyInfo _prop;
public PropertyMemberAccessor(PropertyInfo prop)
{

8
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Factories/ExportColumnFactory.cs

@ -17,22 +17,16 @@ @@ -17,22 +17,16 @@
// DEALINGS IN THE SOFTWARE.
using System;
using ICSharpCode.Reporting.BaseClasses;
using ICSharpCode.Reporting.Interfaces;
using ICSharpCode.Reporting.Interfaces.Export;
using ICSharpCode.Reporting.Items;
using ICSharpCode.Reporting.PageBuilder.ExportColumns;
namespace ICSharpCode.Reporting.Factories
{
/// <summary>
/// Description of ExportColumnFactory.
/// </summary>
internal class ExportColumnFactory
class ExportColumnFactory
{
public ExportColumnFactory()
{
}
public static IExportColumn CreateItem (IPrintableObject item) {
var export = item.CreateExportColumn();

1
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Factories/ReportCreatorFactory.cs

@ -19,7 +19,6 @@ @@ -19,7 +19,6 @@
using System;
using ICSharpCode.Reporting.Globals;
using ICSharpCode.Reporting.Interfaces;
using ICSharpCode.Reporting.Items;
using ICSharpCode.Reporting.PageBuilder;
namespace ICSharpCode.Reporting.Factories

5
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Factories/ReportModelFactory.cs

@ -21,8 +21,9 @@ namespace ICSharpCode.Reporting.Factories @@ -21,8 +21,9 @@ namespace ICSharpCode.Reporting.Factories
public static ReportModel Create()
{
var reportModel = new ReportModel();
foreach (var sec in Enum.GetValues(typeof(GlobalEnums.ReportSection))) {
reportModel.SectionCollection.Add (SectionFactory.Create(sec.ToString()));
foreach (var section in Enum.GetValues(typeof(GlobalEnums.ReportSection))) {
reportModel.SectionCollection.Add (SectionFactory.Create(section.ToString()));
}
foreach (var section in reportModel.SectionCollection) {

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

@ -24,13 +24,13 @@ namespace ICSharpCode.Reporting.Globals @@ -24,13 +24,13 @@ namespace ICSharpCode.Reporting.Globals
/// <summary>
/// Description of CreateGraphics.
/// </summary>
internal class CreateGraphics
static class CreateGraphics
{
public static Graphics FromSize (Size size){
if (size == null) {
if (size == Size.Empty) {
throw new ArgumentNullException("size");
}
Bitmap bitmap = new Bitmap(size.Width,size.Height);
var bitmap = new Bitmap(size.Width,size.Height);
var graphics = Graphics.FromImage(bitmap);
return graphics;
}

1
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Globals/MeasurementService.cs

@ -28,7 +28,6 @@ namespace ICSharpCode.Reporting.Globals @@ -28,7 +28,6 @@ namespace ICSharpCode.Reporting.Globals
static class MeasurementService
{
public static Size Measure (IExportText item,Graphics graphics) {
if (!item.CanGrow) {
return item.Size;

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

@ -53,7 +53,7 @@ namespace ICSharpCode.Reporting.Globals @@ -53,7 +53,7 @@ namespace ICSharpCode.Reporting.Globals
// private static string FormatItem (string valueToFormat,string format,
// TypeCode typeCode,string nullValue)
private static string FormatItem (string valueToFormat,string format,
static string FormatItem (string valueToFormat,string format,
TypeCode typeCode)
{
string retValue = String.Empty;
@ -90,7 +90,7 @@ namespace ICSharpCode.Reporting.Globals @@ -90,7 +90,7 @@ namespace ICSharpCode.Reporting.Globals
}
private static string FormatBool (string toFormat)
static string FormatBool (string toFormat)
{
if (CheckValue(toFormat)) {
bool b = bool.Parse (toFormat);
@ -99,7 +99,8 @@ namespace ICSharpCode.Reporting.Globals @@ -99,7 +99,8 @@ namespace ICSharpCode.Reporting.Globals
return toFormat;
}
private static string FormatIntegers(string toFormat, string format)
static string FormatIntegers(string toFormat, string format)
{
string str = String.Empty;
if (CheckValue (toFormat)) {
@ -113,7 +114,7 @@ namespace ICSharpCode.Reporting.Globals @@ -113,7 +114,7 @@ namespace ICSharpCode.Reporting.Globals
}
private static string FormatDecimal(string toFormat, string format)
static string FormatDecimal(string toFormat, string format)
{
string str = String.Empty;
if (CheckValue (toFormat)) {
@ -135,7 +136,7 @@ namespace ICSharpCode.Reporting.Globals @@ -135,7 +136,7 @@ namespace ICSharpCode.Reporting.Globals
// http://stackoverflow.com/questions/4710455/i-need-code-to-validate-any-time-in-c-sharp-in-hhmmss-format
private static string FormatDate(string toFormat, string format)
static string FormatDate(string toFormat, string format)
{
DateTime date;
if (DateTime.TryParse(toFormat, out date))
@ -157,7 +158,7 @@ namespace ICSharpCode.Reporting.Globals @@ -157,7 +158,7 @@ namespace ICSharpCode.Reporting.Globals
}
private static bool CheckValue (string toFormat)
static bool CheckValue (string toFormat)
{
if (String.IsNullOrEmpty(toFormat)) {
return false;

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

@ -25,7 +25,7 @@ namespace ICSharpCode.Reporting.Globals @@ -25,7 +25,7 @@ namespace ICSharpCode.Reporting.Globals
/// <summary>
/// Description of TypeHelper.
/// </summary>
class TypeHelper
static class TypeHelper
{
public static DbType DbTypeFromStringRepresenation(string type)
{

1
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Interfaces/Data/IDataSource.cs

@ -17,7 +17,6 @@ @@ -17,7 +17,6 @@
// DEALINGS IN THE SOFTWARE.
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;

2
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Items/BaseRowItem.cs

@ -41,7 +41,5 @@ namespace ICSharpCode.Reporting.Items @@ -41,7 +41,5 @@ namespace ICSharpCode.Reporting.Items
};
return er;
}
}
}

2
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Items/GroupColumn.cs

@ -33,7 +33,7 @@ namespace ICSharpCode.Reporting.Items @@ -33,7 +33,7 @@ namespace ICSharpCode.Reporting.Items
public GroupColumn(string columnName,int groupLevel, ListSortDirection sortDirection):base(columnName,sortDirection)
{
if (GroupLevel < 0) {
if (groupLevel < 0) {
throw new ArgumentException("groupLevel");
}
this.GroupLevel = groupLevel;

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

@ -35,8 +35,6 @@ namespace ICSharpCode.Reporting @@ -35,8 +35,6 @@ namespace ICSharpCode.Reporting
public class ReportingFactory
{
public IReportCreator ReportCreator (Stream stream,IEnumerable list)
{
ReportModel = LoadReportModel (stream);

Loading…
Cancel
Save