FastReport

Форк
0
/
ReportEventArgs.cs 
403 строки · 11.5 Кб
1
using System;
2
using System.Collections.Generic;
3
using System.Text;
4
using FastReport.Data;
5
using FastReport.Export;
6
using System.Data.Common;
7
using System.ComponentModel;
8

9
namespace FastReport
10
{
11
    /// <summary>
12
    /// Provides data for the <see cref="FastReport.Report.LoadBaseReport"/> event.
13
    /// </summary>
14
    public class CustomLoadEventArgs : EventArgs
15
    {
16
        private string fileName;
17
        private Report report;
18

19
        /// <summary>
20
        /// Gets a name of the file to load the report from.
21
        /// </summary>
22
        public string FileName
23
        {
24
            get { return fileName; }
25
        }
26

27
        /// <summary>
28
        /// The reference to a report.
29
        /// </summary>
30
        public Report Report
31
        {
32
            get { return report; }
33
        }
34

35
        /// <summary>
36
        /// Initializes a new instance of the <see cref="CustomLoadEventArgs"/> class using the specified
37
        /// file name and the report.
38
        /// </summary>
39
        /// <param name="fileName">The name of the file to load the report from.</param>
40
        /// <param name="report">The report.</param>
41
        public CustomLoadEventArgs(string fileName, Report report)
42
        {
43
            this.fileName = fileName;
44
            this.report = report;
45
        }
46
    }
47

48
    /// <summary>
49
    /// Provides data for the <see cref="FastReport.Report.CustomCalc"/> event.
50
    /// </summary>
51
    public class CustomCalcEventArgs : EventArgs
52
    {
53
        private string expr;
54
        private object @object;
55
        private Report report;
56

57
        /// <summary>
58
        /// Gets an expression.
59
        /// </summary>
60
        public string Expression
61
        {
62
            get { return expr; }
63
        }
64

65
        /// <summary>
66
        /// Gets or sets a object.
67
        /// </summary>
68
        public object CalculatedObject
69
        {
70
            get { return @object; }
71
            set { @object = value; }
72
        }
73

74
        /// <summary>
75
        /// The reference to a report.
76
        /// </summary>
77
        public Report Report
78
        {
79
            get { return report; }
80
        }
81

82
        /// <summary>
83
        /// Initializes a new instance of the <see cref="CustomLoadEventArgs"/> class using the specified
84
        /// file name and the report.
85
        /// </summary>
86
        /// <param name="expression">The text of expression.</param>
87
        /// <param name="Object">The name of the file to load the report from.</param>
88
        /// <param name="report">The report.</param>
89
        public CustomCalcEventArgs(string expression, object Object, Report report)
90
        {
91
            expr = expression;
92
            @object = Object;
93
            this.report = report;
94
        }
95
    }
96

97
    /// <summary>
98
    /// Represents the method that will handle the <see cref="Report.LoadBaseReport"/> event.
99
    /// </summary>
100
    /// <param name="sender">The source of the event.</param>
101
    /// <param name="e">The event data.</param>
102
    public delegate void CustomLoadEventHandler(object sender, CustomLoadEventArgs e);
103

104
    /// <summary>
105
    /// Represents the method that will handle the event.
106
    /// </summary>
107
    /// <param name="sender">The source of the event.</param>
108
    /// <param name="e">The event data.</param>
109
    public delegate void CustomCalcEventHandler(object sender, CustomCalcEventArgs e);
110

111
    /// <summary>
112
    /// Provides data for the Progress event.
113
    /// </summary>
114
    public class ProgressEventArgs
115
    {
116
        private string message;
117
        private int progress;
118
        private int total;
119

120
        /// <summary>
121
        /// Gets a progress message.
122
        /// </summary>
123
        public string Message
124
        {
125
            get { return message; }
126
        }
127

128
        /// <summary>
129
        /// Gets the current page number.
130
        /// </summary>
131
        public int Progress
132
        {
133
            get { return progress; }
134
        }
135

136
        /// <summary>
137
        /// Gets the number of total pages.
138
        /// </summary>
139
        public int Total
140
        {
141
            get { return total; }
142
        }
143

144
        /// <summary>
145
        /// Initializes a new instance of the <see cref="ProgressEventArgs"/> class using the specified
146
        /// message, page number and total number of pages.
147
        /// </summary>
148
        /// <param name="message">The progress message.</param>
149
        /// <param name="progress">Current page number.</param>
150
        /// <param name="total">Number of total pages.</param>
151
        public ProgressEventArgs(string message, int progress, int total)
152
        {
153
            this.message = message;
154
            this.progress = progress;
155
            this.total = total;
156
        }
157
    }
158

159
    /// <summary>
160
    /// Represents the method that will handle the Progress event.
161
    /// </summary>
162
    /// <param name="sender">The source of the event.</param>
163
    /// <param name="e">The event data.</param>
164
    public delegate void ProgressEventHandler(object sender, ProgressEventArgs e);
165

166

167
    /// <summary>
168
    /// Provides data for the DatabaseLogin event.
169
    /// </summary>
170
    public class DatabaseLoginEventArgs
171
    {
172
        private string connectionString;
173
        private string userName;
174
        private string password;
175

176
        /// <summary>
177
        /// Gets or sets the connection string.
178
        /// </summary>
179
        public string ConnectionString
180
        {
181
            get { return connectionString; }
182
            set { connectionString = value; }
183
        }
184

185
        /// <summary>
186
        /// Gets or sets an user name.
187
        /// </summary>
188
        public string UserName
189
        {
190
            get { return userName; }
191
            set { userName = value; }
192
        }
193

194
        /// <summary>
195
        /// Gets or sets a password.
196
        /// </summary>
197
        public string Password
198
        {
199
            get { return password; }
200
            set { password = value; }
201
        }
202

203
        /// <summary>
204
        /// Initializes a new instance of the <see cref="DatabaseLoginEventArgs"/> class using the specified
205
        /// connection string.
206
        /// </summary>
207
        /// <param name="connectionString">The connection string.</param>
208
        public DatabaseLoginEventArgs(string connectionString)
209
        {
210
            this.connectionString = connectionString;
211
            userName = "";
212
            password = "";
213
        }
214
    }
215

216

217
    /// <summary>
218
    /// Represents the method that will handle the DatabaseLogin event.
219
    /// </summary>
220
    /// <param name="sender">The source of the event.</param>
221
    /// <param name="e">The event data.</param>
222
    public delegate void DatabaseLoginEventHandler(object sender, DatabaseLoginEventArgs e);
223

224

225
    /// <summary>
226
    /// Provides data for the AfterDatabaseLogin event.
227
    /// </summary>
228
    public class AfterDatabaseLoginEventArgs
229
    {
230
        private DbConnection connection;
231

232
        /// <summary>
233
        /// Gets the <b>DbConnection</b> object.
234
        /// </summary>
235
        public DbConnection Connection
236
        {
237
            get { return connection; }
238
        }
239

240
        /// <summary>
241
        /// Initializes a new instance of the <see cref="AfterDatabaseLoginEventArgs"/> class using 
242
        /// the specified connection.
243
        /// </summary>
244
        /// <param name="connection">The connection object.</param>
245
        public AfterDatabaseLoginEventArgs(DbConnection connection)
246
        {
247
            this.connection = connection;
248
        }
249
    }
250

251
    /// <summary>
252
    /// Represents the method that will handle the AfterDatabaseLogin event.
253
    /// </summary>
254
    /// <param name="sender">The source of the event.</param>
255
    /// <param name="e">The event data.</param>
256
    public delegate void AfterDatabaseLoginEventHandler(object sender, AfterDatabaseLoginEventArgs e);
257

258

259
    /// <summary>
260
    /// Provides data for the FilterProperties event.
261
    /// </summary>
262
    public class FilterPropertiesEventArgs
263
    {
264
        private PropertyDescriptor property;
265
        private bool skip;
266

267
        /// <summary>
268
        /// Gets the property descriptor.
269
        /// </summary>
270
        public PropertyDescriptor Property
271
        {
272
            get { return property; }
273
            set { property = value; }
274
        }
275

276
        /// <summary>
277
        /// Gets or sets a value that indicates whether this property should be skipped.
278
        /// </summary>
279
        public bool Skip
280
        {
281
            get { return skip; }
282
            set { skip = value; }
283
        }
284

285
        internal FilterPropertiesEventArgs(PropertyDescriptor property)
286
        {
287
            this.property = property;
288
            skip = false;
289
        }
290
    }
291

292
    /// <summary>
293
    /// Represents the method that will handle the FilterProperties event.
294
    /// </summary>
295
    /// <param name="sender">The source of the event.</param>
296
    /// <param name="e">The event data.</param>
297
    public delegate void FilterPropertiesEventHandler(object sender, FilterPropertiesEventArgs e);
298

299

300
    /// <summary>
301
    /// Provides data for the GetPropertyKind event.
302
    /// </summary>
303
    public class GetPropertyKindEventArgs
304
    {
305
        private string propertyName;
306
        private Type propertyType;
307
        private PropertyKind propertyKind;
308

309
        /// <summary>
310
        /// Gets the property name.
311
        /// </summary>
312
        public string PropertyName
313
        {
314
            get { return propertyName; }
315
        }
316

317
        /// <summary>
318
        /// Gets the property type.
319
        /// </summary>
320
        public Type PropertyType
321
        {
322
            get { return propertyType; }
323
        }
324

325
        /// <summary>
326
        /// Gets or sets the kind of property.
327
        /// </summary>
328
        public PropertyKind PropertyKind
329
        {
330
            get { return propertyKind; }
331
            set { propertyKind = value; }
332
        }
333

334
        internal GetPropertyKindEventArgs(string propertyName, Type propertyType, PropertyKind propertyKind)
335
        {
336
            this.propertyName = propertyName;
337
            this.propertyType = propertyType;
338
            this.propertyKind = propertyKind;
339
        }
340
    }
341

342
    /// <summary>
343
    /// Represents the method that will handle the GetPropertyKind event.
344
    /// </summary>
345
    /// <param name="sender">The source of the event.</param>
346
    /// <param name="e">The event data.</param>
347
    public delegate void GetPropertyKindEventHandler(object sender, GetPropertyKindEventArgs e);
348

349

350
    /// <summary>
351
    /// Provides data for the GetTypeInstance event.
352
    /// </summary>
353
    public class GetTypeInstanceEventArgs
354
    {
355
        private Type type;
356
        private object instance;
357

358
        /// <summary>
359
        /// Gets the type.
360
        /// </summary>
361
        public Type Type
362
        {
363
            get { return type; }
364
        }
365

366
        /// <summary>
367
        /// Gets or sets the instance of type.
368
        /// </summary>
369
        public object Instance
370
        {
371
            get { return instance; }
372
            set { instance = value; }
373
        }
374

375
        internal GetTypeInstanceEventArgs(Type type)
376
        {
377
            this.type = type;
378
        }
379
    }
380

381
    /// <summary>
382
    /// Represents the method that will handle the GetPropertyKind event.
383
    /// </summary>
384
    /// <param name="sender">The source of the event.</param>
385
    /// <param name="e">The event data.</param>
386
    public delegate void GetTypeInstanceEventHandler(object sender, GetTypeInstanceEventArgs e);
387

388
    /// <summary>
389
    /// Event arguments for custom Export parameters
390
    /// </summary>
391
    public class ExportParametersEventArgs : EventArgs
392
    {
393
        /// <summary>
394
        /// Used to set custom export parameters
395
        /// </summary>
396
        public readonly ExportBase Export;
397

398
        public ExportParametersEventArgs(ExportBase export)
399
        {
400
            this.Export = export;
401
        }
402
    }
403
}
404

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.