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

Commit 2240ff4

Browse files
Cleanup
1 parent d0f98e5 commit 2240ff4

6 files changed

Lines changed: 22 additions & 55 deletions

File tree

src/AddIns/Analysis/CodeQuality/Reporting/DependencyReport.srd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@
113113
<CanGrow>False</CanGrow>
114114
<CanShrink>False</CanShrink>
115115
<RTL>No</RTL>
116-
<Text>=Today()</Text>
116+
<Text>=Today</Text>
117117
<DrawBorder>False</DrawBorder>
118118
<FrameColor>Black</FrameColor>
119119
<ForeColor>ControlText</ForeColor>

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,8 @@ public CollectionDataSource(IEnumerable list, Type elementType, ReportSettings r
7272
throw new ArgumentNullException("reportSettings");
7373

7474
baseList = CreateBaseList(list);
75-
7675
CurrentList = baseList;
77-
78-
// this.elementType = elementType;
7976
this.reportSettings = reportSettings;
80-
8177
this.listProperties = this.baseList.GetItemProperties(null);
8278
OrderGroup = OrderGroup.AsIs;
8379
}
@@ -130,7 +126,6 @@ IEnumerable<object> SortInternal (){
130126
var sortProperty = listProperties.Find(reportSettings.SortColumnsCollection[0].ColumnName,true);
131127
if(reportSettings.SortColumnsCollection.Count == 1) {
132128
sortedList = baseList.OrderBy(o => o.GetType().GetProperty(sortProperty.Name).GetValue(o, null) );
133-
134129
}
135130
return sortedList;
136131
}
@@ -145,7 +140,7 @@ void Group()
145140
OrderGroup = OrderGroup.Grouped;
146141
GroupedList = GroupInternal();
147142
}
148-
143+
149144

150145
IEnumerable<IGrouping<object, object>> GroupInternal () {
151146
var groupProperty = listProperties.Find(reportSettings.GroupColumnsCollection[0].ColumnName,true);
@@ -160,6 +155,7 @@ IEnumerable<IGrouping<object, object>> GroupInternal () {
160155
return groupedList;
161156
}
162157

158+
163159
#endregion
164160

165161
public void Bind()

src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Expressions/Irony/ReportingLanguageRuntime.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ public override void Init()
3838
base.Init();
3939
//add built-in methods, special form IIF, import Math and Environment methods
4040
// BuiltIns.AddMethod(BuiltInPrintMethod, "print");
41-
// BuiltIns.AddMethod(BuiltInFormatMethod, "format");
42-
http://irony.codeplex.com/discussions/446823
41+
// BuiltIns.AddMethod(BuiltInFormatMethod, "format");
4342
BuiltIns.AddSpecialForm(SpecialFormsLibrary.Iif, "iif", 3, 3);
4443
BuiltIns.ImportStaticMembers(typeof(System.Math));
4544
BuiltIns.ImportStaticMembers(typeof(Environment));

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ private static string FormatDecimal(string toFormat, string format)
123123
CultureInfo.CurrentCulture.NumberFormat);
124124
str = dec.ToString (format,CultureInfo.CurrentCulture);
125125

126-
} catch (FormatException e) {
126+
} catch (FormatException) {
127127
throw ;
128128
}
129129
return str;

src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/PageBuilder/BasePageBuilder.cs

Lines changed: 17 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ namespace ICSharpCode.Reporting.PageBuilder
4040
public class BasePageBuilder:IReportCreator
4141
{
4242

43-
public BasePageBuilder(IReportModel reportModel)
44-
{
43+
public BasePageBuilder(IReportModel reportModel){
4544
if (reportModel == null) {
4645
throw new ArgumentNullException("reportModel");
4746
}
@@ -52,8 +51,7 @@ public BasePageBuilder(IReportModel reportModel)
5251

5352
#region create Report Sections
5453

55-
void BuildReportHeader()
56-
{
54+
void BuildReportHeader(){
5755
if (Pages.Count == 0) {
5856
var header = CreateSection(ReportModel.ReportHeader,CurrentLocation);
5957
var r = new Rectangle(header.Location.X, header.Location.Y, header.Size.Width, header.Size.Height);
@@ -63,8 +61,7 @@ void BuildReportHeader()
6361
}
6462

6563

66-
void BuildPageHeader()
67-
{
64+
void BuildPageHeader(){
6865
var pageHeader = CreateSection(ReportModel.PageHeader,CurrentLocation);
6966
DetailStart = new Point(ReportModel.ReportSettings.LeftMargin,pageHeader.Location.Y + pageHeader.DesiredSize.Height +1);
7067
AddSectionToPage(pageHeader);
@@ -76,38 +73,26 @@ void BuildPageFooter(){
7673
ReportModel.ReportSettings.PageSize.Height - ReportModel.ReportSettings.BottomMargin - ReportModel.PageFooter.Size.Height);
7774

7875

79-
var pageFooter = CreateSection(ReportModel.PageFooter,CurrentLocation);
80-
81-
Console.WriteLine("pagefooter at {0} ehight {1}",CurrentLocation, pageFooter.Size);
82-
83-
pageFooter.BackColor = System.Drawing.Color.LightGray;
84-
76+
var pageFooter = CreateSection(ReportModel.PageFooter,CurrentLocation);
8577
DetailEnds = new Point(pageFooter.Location.X + pageFooter.Size.Width,pageFooter.Location.Y -1);
8678
AddSectionToPage(pageFooter);
8779
}
8880

8981

90-
void AddSectionToPage(IExportContainer header)
91-
{
82+
void AddSectionToPage(IExportContainer header){
9283
header.Parent = CurrentPage;
9384
CurrentPage.ExportedItems.Add(header);
9485
}
9586

9687

97-
protected void BuildReportFooter()
98-
{
88+
protected void BuildReportFooter(){
9989
var lastSection = CurrentPage.ExportedItems.Last();
100-
// CurrentLocation = new Point(ReportModel.ReportSettings.LeftMargin,
101-
// lastSection.Location.Y - lastSection.Size.Height - 1);
102-
//
103-
CurrentLocation = new Point(ReportModel.ReportSettings.LeftMargin,
90+
CurrentLocation = new Point(ReportModel.ReportSettings.LeftMargin,
10491
lastSection.Location.Y - ReportModel.ReportFooter.Size.Height - 2);
105-
var reportFooter = CreateSection(ReportModel.ReportFooter,CurrentLocation);
106-
reportFooter.BackColor = Color.Red;
107-
Console.WriteLine("reportfooter {0} - {1} ",reportFooter.Location,reportFooter.Size);
108-
// if (reportFooter.ExportedItems.Any()) {
92+
var reportFooter = CreateSection(ReportModel.ReportFooter,CurrentLocation);
93+
if (reportFooter.ExportedItems.Any()) {
10994
AddSectionToPage(reportFooter);
110-
// }
95+
}
11196
}
11297

11398

@@ -119,17 +104,12 @@ protected void WriteStandardSections() {
119104

120105

121106
protected bool PageFull(IExportContainer container) {
122-
if (container.DisplayRectangle.Bottom > DetailEnds.Y) {
123-
return true;
124-
}
125-
return false;
107+
return container.DisplayRectangle.Bottom > DetailEnds.Y;
126108
}
127109

128110
#endregion
129111

130-
131-
protected IExportContainer CreateSection(IReportContainer container,Point location)
132-
{
112+
protected IExportContainer CreateSection(IReportContainer container,Point location){
133113
var containerConverter = new ContainerConverter(location);
134114
var convertedContainer = containerConverter.ConvertToExportContainer(container);
135115

@@ -151,8 +131,7 @@ protected Size MeasureElement (IExportColumn element) {
151131
}
152132

153133

154-
protected static void ArrangeContainer(IExportContainer exportContainer)
155-
{
134+
protected static void ArrangeContainer(IExportContainer exportContainer){
156135
var exportArrange = exportContainer.GetArrangeStrategy();
157136
exportArrange.Arrange(exportContainer);
158137
}
@@ -161,8 +140,7 @@ protected static void ArrangeContainer(IExportContainer exportContainer)
161140

162141
#region Pagehandling
163142

164-
IPageInfo CreatePageInfo()
165-
{
143+
IPageInfo CreatePageInfo(){
166144
var pi = new PageInfo();
167145
pi.PageNumber = Pages.Count +1;
168146
pi.ReportName = ReportModel.ReportSettings.ReportName;
@@ -176,8 +154,7 @@ ExportPage InitNewPage(){
176154
}
177155

178156

179-
protected virtual ExportPage CreateNewPage()
180-
{
157+
protected virtual ExportPage CreateNewPage(){
181158
var page = InitNewPage();
182159
CurrentLocation = new Point(ReportModel.ReportSettings.LeftMargin,ReportModel.ReportSettings.TopMargin);
183160
return page;
@@ -191,8 +168,7 @@ protected virtual void AddPage(ExportPage page) {
191168
}
192169

193170

194-
public virtual void BuildExportList()
195-
{
171+
public virtual void BuildExportList(){
196172
Pages.Clear();
197173
CurrentPage = CreateNewPage ();
198174
WriteStandardSections();
@@ -215,8 +191,7 @@ protected void SetupExpressionRunner (ReportSettings reportsettings,CollectionDa
215191
}
216192

217193

218-
protected void RunDebugVisitor()
219-
{
194+
protected void RunDebugVisitor(){
220195
var debugExporter = new DebugExporter(Pages);
221196
debugExporter.Run();
222197
}

src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/PageBuilder/DataPageBuilder.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,6 @@ void BuildSortedDetails(IContainerConverter converter,Point startPosition){
159159
sectionContainer.Location = pagePosition;
160160
}
161161

162-
// sectionContainer.ExportedItems.AddRange(convertedItems);
163-
// MeasureAndArrangeContainer(sectionContainer);
164-
165162
exportRows.Add(sectionContainer);
166163
pagePosition = new Point(CurrentSection.Location.X, pagePosition.Y + sectionContainer.DesiredSize.Height + 1);
167164
}

0 commit comments

Comments
 (0)