using System;
using System.Collections.Generic;
using System.Text;
using FastReport.Data;
using FastReport.Export;
using System.Data.Common;
using System.ComponentModel;
namespace FastReport
{
///
/// Provides data for the event.
///
public class CustomLoadEventArgs : EventArgs
{
private string fileName;
private Report report;
///
/// Gets a name of the file to load the report from.
///
public string FileName
{
get { return fileName; }
}
///
/// The reference to a report.
///
public Report Report
{
get { return report; }
}
///
/// Initializes a new instance of the class using the specified
/// file name and the report.
///
/// The name of the file to load the report from.
/// The report.
public CustomLoadEventArgs(string fileName, Report report)
{
this.fileName = fileName;
this.report = report;
}
}
///
/// Provides data for the event.
///
public class CustomCalcEventArgs : EventArgs
{
private string expr;
private object @object;
private Report report;
///
/// Gets an expression.
///
public string Expression
{
get { return expr; }
}
///
/// Gets or sets a object.
///
public object CalculatedObject
{
get { return @object; }
set { @object = value; }
}
///
/// The reference to a report.
///
public Report Report
{
get { return report; }
}
///
/// Initializes a new instance of the class using the specified
/// file name and the report.
///
/// The text of expression.
/// The name of the file to load the report from.
/// The report.
public CustomCalcEventArgs(string expression, object Object, Report report)
{
expr = expression;
@object = Object;
this.report = report;
}
}
///
/// Represents the method that will handle the event.
///
/// The source of the event.
/// The event data.
public delegate void CustomLoadEventHandler(object sender, CustomLoadEventArgs e);
///
/// Represents the method that will handle the event.
///
/// The source of the event.
/// The event data.
public delegate void CustomCalcEventHandler(object sender, CustomCalcEventArgs e);
///
/// Provides data for the Progress event.
///
public class ProgressEventArgs
{
private string message;
private int progress;
private int total;
///
/// Gets a progress message.
///
public string Message
{
get { return message; }
}
///
/// Gets the current page number.
///
public int Progress
{
get { return progress; }
}
///
/// Gets the number of total pages.
///
public int Total
{
get { return total; }
}
///
/// Initializes a new instance of the class using the specified
/// message, page number and total number of pages.
///
/// The progress message.
/// Current page number.
/// Number of total pages.
public ProgressEventArgs(string message, int progress, int total)
{
this.message = message;
this.progress = progress;
this.total = total;
}
}
///
/// Represents the method that will handle the Progress event.
///
/// The source of the event.
/// The event data.
public delegate void ProgressEventHandler(object sender, ProgressEventArgs e);
///
/// Provides data for the DatabaseLogin event.
///
public class DatabaseLoginEventArgs
{
private string connectionString;
private string userName;
private string password;
///
/// Gets or sets the connection string.
///
public string ConnectionString
{
get { return connectionString; }
set { connectionString = value; }
}
///
/// Gets or sets an user name.
///
public string UserName
{
get { return userName; }
set { userName = value; }
}
///
/// Gets or sets a password.
///
public string Password
{
get { return password; }
set { password = value; }
}
///
/// Initializes a new instance of the class using the specified
/// connection string.
///
/// The connection string.
public DatabaseLoginEventArgs(string connectionString)
{
this.connectionString = connectionString;
userName = "";
password = "";
}
}
///
/// Represents the method that will handle the DatabaseLogin event.
///
/// The source of the event.
/// The event data.
public delegate void DatabaseLoginEventHandler(object sender, DatabaseLoginEventArgs e);
///
/// Provides data for the AfterDatabaseLogin event.
///
public class AfterDatabaseLoginEventArgs
{
private DbConnection connection;
///
/// Gets the DbConnection object.
///
public DbConnection Connection
{
get { return connection; }
}
///
/// Initializes a new instance of the class using
/// the specified connection.
///
/// The connection object.
public AfterDatabaseLoginEventArgs(DbConnection connection)
{
this.connection = connection;
}
}
///
/// Represents the method that will handle the AfterDatabaseLogin event.
///
/// The source of the event.
/// The event data.
public delegate void AfterDatabaseLoginEventHandler(object sender, AfterDatabaseLoginEventArgs e);
///
/// Provides data for the FilterProperties event.
///
public class FilterPropertiesEventArgs
{
private PropertyDescriptor property;
private bool skip;
///
/// Gets the property descriptor.
///
public PropertyDescriptor Property
{
get { return property; }
set { property = value; }
}
///
/// Gets or sets a value that indicates whether this property should be skipped.
///
public bool Skip
{
get { return skip; }
set { skip = value; }
}
internal FilterPropertiesEventArgs(PropertyDescriptor property)
{
this.property = property;
skip = false;
}
}
///
/// Represents the method that will handle the FilterProperties event.
///
/// The source of the event.
/// The event data.
public delegate void FilterPropertiesEventHandler(object sender, FilterPropertiesEventArgs e);
///
/// Provides data for the GetPropertyKind event.
///
public class GetPropertyKindEventArgs
{
private string propertyName;
private Type propertyType;
private PropertyKind propertyKind;
///
/// Gets the property name.
///
public string PropertyName
{
get { return propertyName; }
}
///
/// Gets the property type.
///
public Type PropertyType
{
get { return propertyType; }
}
///
/// Gets or sets the kind of property.
///
public PropertyKind PropertyKind
{
get { return propertyKind; }
set { propertyKind = value; }
}
internal GetPropertyKindEventArgs(string propertyName, Type propertyType, PropertyKind propertyKind)
{
this.propertyName = propertyName;
this.propertyType = propertyType;
this.propertyKind = propertyKind;
}
}
///
/// Represents the method that will handle the GetPropertyKind event.
///
/// The source of the event.
/// The event data.
public delegate void GetPropertyKindEventHandler(object sender, GetPropertyKindEventArgs e);
///
/// Provides data for the GetTypeInstance event.
///
public class GetTypeInstanceEventArgs
{
private Type type;
private object instance;
///
/// Gets the type.
///
public Type Type
{
get { return type; }
}
///
/// Gets or sets the instance of type.
///
public object Instance
{
get { return instance; }
set { instance = value; }
}
internal GetTypeInstanceEventArgs(Type type)
{
this.type = type;
}
}
///
/// Represents the method that will handle the GetPropertyKind event.
///
/// The source of the event.
/// The event data.
public delegate void GetTypeInstanceEventHandler(object sender, GetTypeInstanceEventArgs e);
///
/// Event arguments for custom Export parameters
///
public class ExportParametersEventArgs : EventArgs
{
///
/// Used to set custom export parameters
///
public readonly ExportBase Export;
public ExportParametersEventArgs(ExportBase export)
{
this.Export = export;
}
}
}