Skip to content
This repository was archived by the owner on Oct 16, 2020. It is now read-only.

Commit 8247fde

Browse files
Cleanup - FxCop
1 parent d4ca990 commit 8247fde

17 files changed

Lines changed: 54 additions & 77 deletions

src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Designer/ReportRootDesigner.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
using System.Drawing;
2525
using System.Drawing.Design;
2626
using System.Drawing.Printing;
27+
using System.Globalization;
2728
using System.Windows.Forms;
2829
using System.Windows.Forms.Design;
2930
using ICSharpCode.Core;
@@ -217,7 +218,6 @@ void OnComponentAdded(object sender, ComponentEventArgs ce)
217218
if (section != null) {
218219
sections.Add(section);
219220
section.SizeChanged += new EventHandler( OnSectionSizeChanged);
220-
Console.Write("reportRootDesigner:OnComponentAdded");
221221
foreach (Control ctrl in section.Controls) {
222222
AddToHost(ctrl);
223223
host.Container.Add(ctrl);
@@ -240,7 +240,7 @@ void AddToHost (Control ctrl)
240240
private void OnComponentChanged(object sender, ComponentChangedEventArgs ce)
241241
{
242242
LoggingService.InfoFormatted("RootDesigner:OnComponentChanged");
243-
String str = String.Format("RootDesigner:OnComponentChanged <{0}> from <{1}> to <{2}>",ce.Component.ToString(),ce.OldValue,ce.NewValue);
243+
var str = String.Format(CultureInfo.CurrentCulture,"RootDesigner:OnComponentChanged <{0}> from <{1}> to <{2}>",ce.Component.ToString(),ce.OldValue,ce.NewValue);
244244
LoggingService.InfoFormatted(str);
245245

246246
var section = ce.Component as BaseSection;

src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Globals/StringWriterWithEncoding.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ namespace ICSharpCode.Reporting.Addin.Globals
1616
/// </summary>
1717
class StringWriterWithEncoding:System.IO.StringWriter
1818
{
19-
private readonly Encoding encoding;
19+
readonly Encoding encoding;
2020

2121
public StringWriterWithEncoding(Encoding encoding)
2222
{

src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/TypeProvider/AbstractItemTypeProvider.cs

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,26 +22,20 @@ public AbstractItemTypeProvider() : base(TypeDescriptor.GetProvider(typeof(Abst
2222
{
2323
}
2424

25-
// public AbstractItemTypeProvider(TypeDescriptionProvider parent): base(parent)
26-
// {
27-
// }
28-
2925

3026
public override ICustomTypeDescriptor GetTypeDescriptor(Type objectType, object instance)
3127
{
3228
ICustomTypeDescriptor td = base.GetTypeDescriptor(objectType, instance);
33-
return new AbstractItemTypeDescriptor(td, instance);
29+
return new AbstractItemTypeDescriptor(td);
3430
}
3531
}
3632

37-
internal class AbstractItemTypeDescriptor : CustomTypeDescriptor
33+
class AbstractItemTypeDescriptor : CustomTypeDescriptor
3834
{
39-
// private AbstractItem _instance;
4035

41-
public AbstractItemTypeDescriptor(ICustomTypeDescriptor parent, object instance)
36+
public AbstractItemTypeDescriptor(ICustomTypeDescriptor parent)
4237
: base(parent)
4338
{
44-
// _instance = instance as AbstractItem;
4539
}
4640

4741

@@ -54,8 +48,8 @@ public override PropertyDescriptorCollection GetProperties()
5448

5549
public override PropertyDescriptorCollection GetProperties(Attribute[] attributes)
5650
{
57-
PropertyDescriptorCollection props = base.GetProperties(attributes);
58-
List<PropertyDescriptor> allProperties = new List<PropertyDescriptor>();
51+
var props = base.GetProperties(attributes);
52+
var allProperties = new List<PropertyDescriptor>();
5953

6054
foreach (PropertyDescriptor p in props)
6155
{

src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/TypeProvider/CircleItemTypeProvider.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ public CircleItemTypeProvider(): base(TypeDescriptor.GetProvider(typeof(Abstrac
2626
public override ICustomTypeDescriptor GetTypeDescriptor(Type objectType, object instance)
2727
{
2828
ICustomTypeDescriptor td = base.GetTypeDescriptor(objectType,instance);
29-
return new CircleItemTypeDescriptor(td, instance);
29+
return new CircleItemTypeDescriptor(td);
3030
}
3131
}
3232

3333

3434
class CircleItemTypeDescriptor : CustomTypeDescriptor
3535
{
3636

37-
public CircleItemTypeDescriptor(ICustomTypeDescriptor parent, object instance): base(parent)
37+
public CircleItemTypeDescriptor(ICustomTypeDescriptor parent): base(parent)
3838
{
3939
}
4040

@@ -48,7 +48,7 @@ public override PropertyDescriptorCollection GetProperties()
4848
public override PropertyDescriptorCollection GetProperties(Attribute[] attributes)
4949
{
5050
PropertyDescriptorCollection props = base.GetProperties(attributes);
51-
List<PropertyDescriptor> allProperties = new List<PropertyDescriptor>();
51+
var allProperties = new List<PropertyDescriptor>();
5252

5353
TypeProviderHelper.AddDefaultProperties(allProperties,props);
5454
TypeProviderHelper.AddGraphicProperties(allProperties,props);

src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/TypeProvider/DataItemTypeProvider.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public DataItemTypeProvider() : base(TypeDescriptor.GetProvider(typeof(Abstract
2727
public override ICustomTypeDescriptor GetTypeDescriptor(Type objectType, object instance)
2828
{
2929
ICustomTypeDescriptor td = base.GetTypeDescriptor(objectType,instance);
30-
return new DataItemTypeDescriptor(td, instance);
30+
return new DataItemTypeDescriptor(td);
3131
}
3232
}
3333

@@ -36,7 +36,7 @@ public override ICustomTypeDescriptor GetTypeDescriptor(Type objectType, object
3636
class DataItemTypeDescriptor : CustomTypeDescriptor
3737
{
3838

39-
public DataItemTypeDescriptor(ICustomTypeDescriptor parent, object instance)
39+
public DataItemTypeDescriptor(ICustomTypeDescriptor parent)
4040
: base(parent)
4141
{
4242
}
@@ -50,8 +50,8 @@ public override PropertyDescriptorCollection GetProperties()
5050

5151
public override PropertyDescriptorCollection GetProperties(Attribute[] attributes)
5252
{
53-
PropertyDescriptorCollection props = base.GetProperties(attributes);
54-
List<PropertyDescriptor> allProperties = new List<PropertyDescriptor>();
53+
var props = base.GetProperties(attributes);
54+
var allProperties = new List<PropertyDescriptor>();
5555

5656
TypeProviderHelper.AddDefaultProperties(allProperties,props);
5757
TypeProviderHelper.AddTextBasedProperties(allProperties,props);

src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/TypeProvider/GroupedRowTypeProvider.cs

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ public GroupedRowTypeProvider() : base(TypeDescriptor.GetProvider(typeof(Abstra
2626
public override ICustomTypeDescriptor GetTypeDescriptor(Type objectType, object instance)
2727
{
2828
ICustomTypeDescriptor td = base.GetTypeDescriptor(objectType,instance);
29-
return new GroupedRowItemTypeDescriptor(td, instance);
29+
return new GroupedRowItemTypeDescriptor(td);
3030
}
3131
}
3232

3333

3434
class GroupedRowItemTypeDescriptor : CustomTypeDescriptor
3535
{
36-
public GroupedRowItemTypeDescriptor(ICustomTypeDescriptor parent, object instance)
36+
public GroupedRowItemTypeDescriptor(ICustomTypeDescriptor parent)
3737
: base(parent)
3838
{
3939
}
@@ -47,8 +47,8 @@ public override PropertyDescriptorCollection GetProperties()
4747

4848
public override PropertyDescriptorCollection GetProperties(Attribute[] attributes)
4949
{
50-
PropertyDescriptorCollection props = base.GetProperties(attributes);
51-
List<PropertyDescriptor> allProperties = new List<PropertyDescriptor>();
50+
var props = base.GetProperties(attributes);
51+
var allProperties = new List<PropertyDescriptor>();
5252

5353
TypeProviderHelper.AddDefaultProperties(allProperties,props);
5454

@@ -69,16 +69,9 @@ public override PropertyDescriptorCollection GetProperties(Attribute[] attribute
6969
prop = props.Find("Controls",true);
7070
allProperties.Add(prop);
7171

72-
// prop = props.Find("AlternateBackColor",true);
73-
// allProperties.Add(prop);
74-
//
75-
// prop = props.Find("ChangeBackColorEveryNRow",true);
76-
// allProperties.Add(prop);
77-
7872
prop = props.Find("PageBreakOnGroupChange",true);
7973
allProperties.Add(prop);
8074

81-
8275
return new PropertyDescriptorCollection(allProperties.ToArray());
8376
}
8477
}

src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/TypeProvider/LineItemTypeProvider.cs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public LineItemTypeProvider() : base(TypeDescriptor.GetProvider(typeof(Abstract
2525
public override ICustomTypeDescriptor GetTypeDescriptor(Type objectType, object instance)
2626
{
2727
ICustomTypeDescriptor td = base.GetTypeDescriptor(objectType,instance);
28-
return new LineItemTypeDescriptor(td, instance);
28+
return new LineItemTypeDescriptor(td);
2929
}
3030
}
3131

@@ -35,7 +35,7 @@ class LineItemTypeDescriptor : CustomTypeDescriptor
3535
{
3636

3737

38-
public LineItemTypeDescriptor(ICustomTypeDescriptor parent, object instance)
38+
public LineItemTypeDescriptor(ICustomTypeDescriptor parent)
3939
: base(parent)
4040
{
4141

@@ -50,8 +50,8 @@ public override PropertyDescriptorCollection GetProperties()
5050

5151
public override PropertyDescriptorCollection GetProperties(Attribute[] attributes)
5252
{
53-
PropertyDescriptorCollection props = base.GetProperties(attributes);
54-
List<PropertyDescriptor> allProperties = new List<PropertyDescriptor>();
53+
var props = base.GetProperties(attributes);
54+
var allProperties = new List<PropertyDescriptor>();
5555

5656
TypeProviderHelper.AddDefaultProperties(allProperties,props);
5757

@@ -71,9 +71,6 @@ public override PropertyDescriptorCollection GetProperties(Attribute[] attribute
7171
prop = props.Find("EndLineCap",true);
7272
allProperties.Add(prop);
7373

74-
// prop = props.Find("DashLineCap",true);
75-
// allProperties.Add(prop);
76-
7774
prop = props.Find("DashStyle",true);
7875
allProperties.Add(prop);
7976

src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/TypeProvider/RectangleItemTypeProvider.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ public RectangleItemTypeProvider(): base(TypeDescriptor.GetProvider(typeof(Abst
2525
public override ICustomTypeDescriptor GetTypeDescriptor(Type objectType, object instance)
2626
{
2727
ICustomTypeDescriptor td = base.GetTypeDescriptor(objectType,instance);
28-
return new RectangleItemTypeDescriptor(td, instance);
28+
return new RectangleItemTypeDescriptor(td);
2929
}
3030
}
3131

3232

3333
class RectangleItemTypeDescriptor : CustomTypeDescriptor
3434
{
3535

36-
public RectangleItemTypeDescriptor(ICustomTypeDescriptor parent, object instance)
36+
public RectangleItemTypeDescriptor(ICustomTypeDescriptor parent)
3737
: base(parent)
3838
{
3939
}
@@ -47,8 +47,8 @@ public override PropertyDescriptorCollection GetProperties()
4747

4848
public override PropertyDescriptorCollection GetProperties(Attribute[] attributes)
4949
{
50-
PropertyDescriptorCollection props = base.GetProperties(attributes);
51-
List<PropertyDescriptor> allProperties = new List<PropertyDescriptor>();
50+
var props = base.GetProperties(attributes);
51+
var allProperties = new List<PropertyDescriptor>();
5252

5353
TypeProviderHelper.AddDefaultProperties(allProperties,props);
5454
TypeProviderHelper.AddGraphicProperties(allProperties,props);

src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/TypeProvider/RowItemTypeProvider.cs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ public RowItemTypeProvider() : base(TypeDescriptor.GetProvider(typeof(AbstractI
2626
public override ICustomTypeDescriptor GetTypeDescriptor(Type objectType, object instance)
2727
{
2828
ICustomTypeDescriptor td = base.GetTypeDescriptor(objectType,instance);
29-
return new RowItemTypeDescriptor(td, instance);
29+
return new RowItemTypeDescriptor(td);
3030
}
3131
}
3232

3333

3434
internal class RowItemTypeDescriptor : CustomTypeDescriptor
3535
{
36-
public RowItemTypeDescriptor(ICustomTypeDescriptor parent, object instance)
36+
public RowItemTypeDescriptor(ICustomTypeDescriptor parent)
3737
: base(parent)
3838
{
3939
}
@@ -47,8 +47,8 @@ public override PropertyDescriptorCollection GetProperties()
4747

4848
public override PropertyDescriptorCollection GetProperties(Attribute[] attributes)
4949
{
50-
PropertyDescriptorCollection props = base.GetProperties(attributes);
51-
List<PropertyDescriptor> allProperties = new List<PropertyDescriptor>();
50+
var props = base.GetProperties(attributes);
51+
var allProperties = new List<PropertyDescriptor>();
5252

5353
TypeProviderHelper.AddDefaultProperties(allProperties,props);
5454

@@ -69,12 +69,6 @@ public override PropertyDescriptorCollection GetProperties(Attribute[] attribute
6969
prop = props.Find("Controls",true);
7070
allProperties.Add(prop);
7171

72-
// prop = props.Find("AlternateBackColor",true);
73-
// allProperties.Add(prop);
74-
//
75-
// prop = props.Find("ChangeBackColorEveryNRow",true);
76-
// allProperties.Add(prop);
77-
7872
return new PropertyDescriptorCollection(allProperties.ToArray());
7973
}
8074
}

src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/TypeProvider/SectionItemTypeProvider.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public SectionItemTypeProvider() : base(TypeDescriptor.GetProvider(typeof(Abstr
2626
public override ICustomTypeDescriptor GetTypeDescriptor(Type objectType, object instance)
2727
{
2828
ICustomTypeDescriptor td = base.GetTypeDescriptor(objectType,instance);
29-
return new SectionItemDescriptor(td, instance);
29+
return new SectionItemDescriptor(td);
3030
}
3131
}
3232

@@ -35,7 +35,7 @@ class SectionItemDescriptor : CustomTypeDescriptor
3535
{
3636

3737

38-
public SectionItemDescriptor(ICustomTypeDescriptor parent, object instance)
38+
public SectionItemDescriptor(ICustomTypeDescriptor parent)
3939
: base(parent)
4040
{
4141
}

0 commit comments

Comments
 (0)