FastReport
403 строки · 11.5 Кб
1using System;2using System.Collections.Generic;3using System.Text;4using FastReport.Data;5using FastReport.Export;6using System.Data.Common;7using System.ComponentModel;8
9namespace FastReport10{
11/// <summary>12/// Provides data for the <see cref="FastReport.Report.LoadBaseReport"/> event.13/// </summary>14public class CustomLoadEventArgs : EventArgs15{16private string fileName;17private Report report;18
19/// <summary>20/// Gets a name of the file to load the report from.21/// </summary>22public string FileName23{24get { return fileName; }25}26
27/// <summary>28/// The reference to a report.29/// </summary>30public Report Report31{32get { return report; }33}34
35/// <summary>36/// Initializes a new instance of the <see cref="CustomLoadEventArgs"/> class using the specified37/// 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>41public CustomLoadEventArgs(string fileName, Report report)42{43this.fileName = fileName;44this.report = report;45}46}47
48/// <summary>49/// Provides data for the <see cref="FastReport.Report.CustomCalc"/> event.50/// </summary>51public class CustomCalcEventArgs : EventArgs52{53private string expr;54private object @object;55private Report report;56
57/// <summary>58/// Gets an expression.59/// </summary>60public string Expression61{62get { return expr; }63}64
65/// <summary>66/// Gets or sets a object.67/// </summary>68public object CalculatedObject69{70get { return @object; }71set { @object = value; }72}73
74/// <summary>75/// The reference to a report.76/// </summary>77public Report Report78{79get { return report; }80}81
82/// <summary>83/// Initializes a new instance of the <see cref="CustomLoadEventArgs"/> class using the specified84/// 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>89public CustomCalcEventArgs(string expression, object Object, Report report)90{91expr = expression;92@object = Object;93this.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>102public 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>109public delegate void CustomCalcEventHandler(object sender, CustomCalcEventArgs e);110
111/// <summary>112/// Provides data for the Progress event.113/// </summary>114public class ProgressEventArgs115{116private string message;117private int progress;118private int total;119
120/// <summary>121/// Gets a progress message.122/// </summary>123public string Message124{125get { return message; }126}127
128/// <summary>129/// Gets the current page number.130/// </summary>131public int Progress132{133get { return progress; }134}135
136/// <summary>137/// Gets the number of total pages.138/// </summary>139public int Total140{141get { return total; }142}143
144/// <summary>145/// Initializes a new instance of the <see cref="ProgressEventArgs"/> class using the specified146/// 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>151public ProgressEventArgs(string message, int progress, int total)152{153this.message = message;154this.progress = progress;155this.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>164public delegate void ProgressEventHandler(object sender, ProgressEventArgs e);165
166
167/// <summary>168/// Provides data for the DatabaseLogin event.169/// </summary>170public class DatabaseLoginEventArgs171{172private string connectionString;173private string userName;174private string password;175
176/// <summary>177/// Gets or sets the connection string.178/// </summary>179public string ConnectionString180{181get { return connectionString; }182set { connectionString = value; }183}184
185/// <summary>186/// Gets or sets an user name.187/// </summary>188public string UserName189{190get { return userName; }191set { userName = value; }192}193
194/// <summary>195/// Gets or sets a password.196/// </summary>197public string Password198{199get { return password; }200set { password = value; }201}202
203/// <summary>204/// Initializes a new instance of the <see cref="DatabaseLoginEventArgs"/> class using the specified205/// connection string.206/// </summary>207/// <param name="connectionString">The connection string.</param>208public DatabaseLoginEventArgs(string connectionString)209{210this.connectionString = connectionString;211userName = "";212password = "";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>222public delegate void DatabaseLoginEventHandler(object sender, DatabaseLoginEventArgs e);223
224
225/// <summary>226/// Provides data for the AfterDatabaseLogin event.227/// </summary>228public class AfterDatabaseLoginEventArgs229{230private DbConnection connection;231
232/// <summary>233/// Gets the <b>DbConnection</b> object.234/// </summary>235public DbConnection Connection236{237get { return connection; }238}239
240/// <summary>241/// Initializes a new instance of the <see cref="AfterDatabaseLoginEventArgs"/> class using242/// the specified connection.243/// </summary>244/// <param name="connection">The connection object.</param>245public AfterDatabaseLoginEventArgs(DbConnection connection)246{247this.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>256public delegate void AfterDatabaseLoginEventHandler(object sender, AfterDatabaseLoginEventArgs e);257
258
259/// <summary>260/// Provides data for the FilterProperties event.261/// </summary>262public class FilterPropertiesEventArgs263{264private PropertyDescriptor property;265private bool skip;266
267/// <summary>268/// Gets the property descriptor.269/// </summary>270public PropertyDescriptor Property271{272get { return property; }273set { property = value; }274}275
276/// <summary>277/// Gets or sets a value that indicates whether this property should be skipped.278/// </summary>279public bool Skip280{281get { return skip; }282set { skip = value; }283}284
285internal FilterPropertiesEventArgs(PropertyDescriptor property)286{287this.property = property;288skip = 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>297public delegate void FilterPropertiesEventHandler(object sender, FilterPropertiesEventArgs e);298
299
300/// <summary>301/// Provides data for the GetPropertyKind event.302/// </summary>303public class GetPropertyKindEventArgs304{305private string propertyName;306private Type propertyType;307private PropertyKind propertyKind;308
309/// <summary>310/// Gets the property name.311/// </summary>312public string PropertyName313{314get { return propertyName; }315}316
317/// <summary>318/// Gets the property type.319/// </summary>320public Type PropertyType321{322get { return propertyType; }323}324
325/// <summary>326/// Gets or sets the kind of property.327/// </summary>328public PropertyKind PropertyKind329{330get { return propertyKind; }331set { propertyKind = value; }332}333
334internal GetPropertyKindEventArgs(string propertyName, Type propertyType, PropertyKind propertyKind)335{336this.propertyName = propertyName;337this.propertyType = propertyType;338this.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>347public delegate void GetPropertyKindEventHandler(object sender, GetPropertyKindEventArgs e);348
349
350/// <summary>351/// Provides data for the GetTypeInstance event.352/// </summary>353public class GetTypeInstanceEventArgs354{355private Type type;356private object instance;357
358/// <summary>359/// Gets the type.360/// </summary>361public Type Type362{363get { return type; }364}365
366/// <summary>367/// Gets or sets the instance of type.368/// </summary>369public object Instance370{371get { return instance; }372set { instance = value; }373}374
375internal GetTypeInstanceEventArgs(Type type)376{377this.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>386public delegate void GetTypeInstanceEventHandler(object sender, GetTypeInstanceEventArgs e);387
388/// <summary>389/// Event arguments for custom Export parameters390/// </summary>391public class ExportParametersEventArgs : EventArgs392{393/// <summary>394/// Used to set custom export parameters395/// </summary>396public readonly ExportBase Export;397
398public ExportParametersEventArgs(ExportBase export)399{400this.Export = export;401}402}403}
404