using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using FastReport.Data;
namespace FastReport.Design
{
///
/// Provides a data for the designer ReportLoaded event.
///
public class ReportLoadedEventArgs
{
///
/// The current report.
///
public Report Report { get; }
internal ReportLoadedEventArgs(Report report)
{
this.Report = report;
}
}
///
/// Represents the method that will handle the designer ReportLoaded event.
///
/// The source of the event.
/// The event data.
public delegate void ReportLoadedEventHandler(object sender, ReportLoadedEventArgs e);
///
/// Provides a data for the designer ObjectInserted event.
///
public class ObjectInsertedEventArgs
{
///
/// Gets the inserted object.
///
public Base Object { get; }
///
/// Gets the source where the object is inserted from.
///
public InsertFrom InsertSource { get; }
internal ObjectInsertedEventArgs(Base obj, InsertFrom source)
{
Object = obj;
InsertSource = source;
}
}
///
/// Represents the method that will handle the designer ObjectInserted event.
///
/// The source of the event.
/// The event data.
public delegate void ObjectInsertedEventHandler(object sender, ObjectInsertedEventArgs e);
///
/// Provides a data for the designer's custom dialog events.
///
public class OpenSaveDialogEventArgs
{
///
/// Gets or sets a file name.
///
///
/// This property contains the location of a report. If you work with files (like the
/// standard "Open" and "Save" dialogs do), treat this property as a file name.
///
public string FileName { get; set; }
///
/// Gets or sets a value indicating that the dialog was cancelled.
///
///
/// This property is used to tell the designer that the user was cancelled the dialog.
///
public bool Cancel { get; set; }
///
/// Gets or sets the custom data that is shared across events.
///
///
/// You may set the Data in the OpenDialog event and use it later in the OpenReport event.
///
public object Data { get; set; }
///
/// Gets a report designer.
///
public Designer Designer { get; }
internal bool IsPlugin { get; set; }
internal OpenSaveDialogEventArgs(Designer designer)
{
this.Designer = designer;
FileName = "";
}
}
///
/// Represents the method that will handle the designer's custom dialogs event.
///
/// The source of the event.
/// The event data.
public delegate void OpenSaveDialogEventHandler(object sender, OpenSaveDialogEventArgs e);
///
/// Provides a data for the designer's custom dialog events.
///
public class OpenSaveReportEventArgs
{
///
/// Gets a report.
///
///
/// Use this report in the load/save operations.
///
public Report Report { get; }
///
/// Gets a file name.
///
///
/// This property contains the location of a report that was selected by the user in the
/// open/save dialogs. If you work with files (like the standard "Open" and "Save" dialogs do),
/// treat this property as a file name.
///
public string FileName { get; } = "";
///
/// Gets the custom data that was set in the OpenDialog event.
///
public object Data { get; }
internal bool IsPlugin { get; }
internal OpenSaveReportEventArgs(Report report, string fileName, object data, bool isPlugin)
{
this.Report = report;
this.FileName = fileName;
this.Data = data;
this.IsPlugin = isPlugin;
}
}
///
/// Represents the method that will handle the designer's custom dialogs event.
///
/// The source of the event.
/// The event data.
public delegate void OpenSaveReportEventHandler(object sender, OpenSaveReportEventArgs e);
///
/// Provides data for the FilterConnectionTables event.
///
public class FilterConnectionTablesEventArgs
{
///
/// Gets the Connection object.
///
public DataConnectionBase Connection { get; }
///
/// Gets the table name.
///
public string TableName { get; }
///
/// Gets or sets a value that indicates whether this table should be skipped.
///
public bool Skip { get; set; }
internal FilterConnectionTablesEventArgs(DataConnectionBase connection, string tableName)
{
this.Connection = connection;
this.TableName = tableName;
}
}
///
/// Represents the method that will handle the FilterConnectionTables event.
///
/// The source of the event.
/// The event data.
public delegate void FilterConnectionTablesEventHandler(object sender, FilterConnectionTablesEventArgs e);
///
/// Provides data for the CustomQueryBuilder event.
///
public class CustomQueryBuilderEventArgs
{
///
/// Gets the Connection object.
///
public DataConnectionBase Connection { get; }
///
/// Gets or sets the query text.
///
public string SQL { get; set; }
///
/// Gets or sets the query parameters.
///
public CommandParameterCollection Parameters { get; set; }
internal CustomQueryBuilderEventArgs(DataConnectionBase connection, string sql)
{
this.Connection = connection;
SQL = sql;
}
internal CustomQueryBuilderEventArgs(DataConnectionBase connection, string sql, CommandParameterCollection parameters) : this(connection, sql)
{
this.Parameters = parameters;
}
}
///
/// Represents the method that will handle the CustomQueryBuilder event.
///
/// The source of the event.
/// The event data.
public delegate void CustomQueryBuilderEventHandler(object sender, CustomQueryBuilderEventArgs e);
}