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

Commit f52b389

Browse files
Better structure of ReportSettings in PropertyGrid
1 parent 3069706 commit f52b389

1 file changed

Lines changed: 45 additions & 26 deletions

File tree

src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Items/ReportSettings.cs

Lines changed: 45 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -65,33 +65,34 @@ void BaseValues()
6565
// this.GraphicsUnit = GraphicsUnit.Pixel;
6666
// this.Padding = new Padding(5);
6767
// this.DefaultFont = GlobalValues.DefaultFont;
68-
this.ReportType = GlobalEnums.ReportType.FormSheet;
68+
ReportType = GlobalEnums.ReportType.FormSheet;
6969
//
7070
this.DataModel = GlobalEnums.PushPullModel.FormSheet;
7171
//
7272
// this.CommandType = System.Data.CommandType.Text;
7373
// this.ConnectionString = String.Empty;
7474
// this.CommandText = String.Empty;
7575
//
76-
this.TopMargin = GlobalValues.DefaultPageMargin.Left;
77-
this.BottomMargin = GlobalValues.DefaultPageMargin.Bottom;
78-
this.LeftMargin = GlobalValues.DefaultPageMargin.Left;
79-
this.RightMargin = GlobalValues.DefaultPageMargin.Right;
76+
TopMargin = GlobalValues.DefaultPageMargin.Left;
77+
BottomMargin = GlobalValues.DefaultPageMargin.Bottom;
78+
LeftMargin = GlobalValues.DefaultPageMargin.Left;
79+
RightMargin = GlobalValues.DefaultPageMargin.Right;
8080
//
8181
// this.availableFields = new AvailableFieldsCollection();
82-
// this.groupingsCollection = new GroupColumnCollection();
83-
this.SortColumnsCollection = new SortColumnCollection();
84-
this.GroupColumnsCollection = new GroupColumnCollection();
82+
83+
SortColumnsCollection = new SortColumnCollection();
84+
GroupColumnsCollection = new GroupColumnCollection();
8585
// this.sqlParameters = new SqlParameterCollection();
8686
ParameterCollection = new ParameterCollection();
8787
// this.NoDataMessage = "No Data for this Report";
8888
}
8989

90+
#region BaseSettings
9091

9192
private string reportName;
9293

93-
// [Category("Base Settings")]
94-
// [DefaultValueAttribute ("")]
94+
[Category("Base Settings")]
95+
[DefaultValueAttribute ("")]
9596
public string ReportName
9697
{
9798
get {
@@ -101,15 +102,14 @@ public string ReportName
101102
return reportName;
102103
}
103104
set {
104-
if (reportName != value) {
105-
reportName = value;
106-
}
105+
reportName = value;
107106
}
108107
}
109108

110-
private string fileName;
111-
// [Category("Base Settings")]
112-
// [XmlIgnoreAttribute]
109+
string fileName;
110+
111+
[Category("Base Settings")]
112+
[XmlIgnoreAttribute]
113113
public string FileName
114114
{
115115
get {
@@ -124,25 +124,39 @@ public string FileName
124124
}
125125

126126

127-
// [Category("Page Settings")]
127+
[Browsable(true), Category("Base Settings")]
128+
public GlobalEnums.ReportType ReportType {get;set;}
129+
130+
131+
[Browsable(true), Category("Base Settings")]
132+
public GlobalEnums.PushPullModel DataModel {get;set;}
133+
134+
#endregion
135+
136+
137+
#region Pagesettings
138+
139+
[Category("Page Settings")]
128140
public int BottomMargin {get;set;}
129141

130142

131-
// [Category("Page Settings")]
143+
[Category("Page Settings")]
132144
public int TopMargin {get;set;}
133145

134146

135147

136-
// [Category("Page Settings")]
148+
[Category("Page Settings")]
137149
public int LeftMargin {get;set;}
138150

139151

140152

141-
// [Category("Page Settings")]
153+
[Category("Page Settings")]
142154
public int RightMargin {get;set;}
143155

156+
144157
private Size pageSize;
145158

159+
[Category("Page Settings")]
146160
public Size PageSize {
147161
get {
148162
if (!Landscape) {
@@ -154,18 +168,21 @@ public Size PageSize {
154168
set { pageSize = value; }
155169
}
156170

157-
// [Category("Page Settings")]
158-
// public Size PageSize {get;set;}
159171

160-
// [Category("Page Settings")]
172+
[Category("Page Settings")]
161173
public bool Landscape {get;set;}
162174

175+
176+
#endregion
177+
178+
#region
179+
180+
163181
// [Category("Data")]
164-
public GlobalEnums.PushPullModel DataModel {get;set;}
165182

166183

167-
// [Browsable(true), Category("Base Settings")]
168-
public GlobalEnums.ReportType ReportType {get;set;}
184+
185+
169186

170187

171188
// [Category("Parameters")]
@@ -177,5 +194,7 @@ public Size PageSize {
177194
public SortColumnCollection SortColumnsCollection {get;private set;}
178195

179196
public GroupColumnCollection GroupColumnsCollection {get;private set;}
197+
198+
#endregion
180199
}
181200
}

0 commit comments

Comments
 (0)