/*
* Firebird ADO.NET Data provider for .NET and Mono
*
* The contents of this file are subject to the Initial
* Developer's Public License Version 1.0 (the "License");
* you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
* http://www.firebirdsql.org/index.php?op=doc&id=idpl
*
* Software distributed under the License is distributed on
* an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
* express or implied. See the License for the specific
* language governing rights and limitations under the License.
*
* Copyright (c) 2003, 2005 Abel Eduardo Pereira
* All Rights Reserved.
*/
using System;
using FirebirdSql.Data.Firebird;
namespace FirebirdSql.Data.Firebird.Isql
{
#region Delegates
///
/// The event handler type trigged before a SQL statement execution.
///
public delegate void CommandExecutingEventHandler(object sender, CommandExecutingEventArgs e);
#endregion
///
/// CommandExecutingEventArgs encapsulates the events arguments for the event trigged
/// from the during the execution.
///
///
///
///
public class CommandExecutingEventArgs: EventArgs
{
#region Private
private FbCommand sqlCommand;
#endregion
#region Properties
///
/// Returns the instance that created for the SQL statement that goes
/// for execution.
///
public FbCommand SqlCommand
{
get { return this.sqlCommand; }
}
///
/// Returns the of the current .
///
public SqlStatementType StatementType
{
get { return FbBatchExecution.GetStatementType(this.SqlCommand.CommandText); }
}
#endregion
#region Constructors
///
/// Creates an instance of CommandExecutingEventArgs class.
///
/// The FbCommand properly instanciated.
/// The sqlCommand should be proper instanciated with a valid
/// and with the SQL statement loaded in .
///
public CommandExecutingEventArgs(FbCommand sqlCommand)
{
this.sqlCommand = sqlCommand;
}
#endregion
#region Methods
///
/// Overrided. Returns the SQL statement that goes for execution.
///
/// The SQL statement that will be executed.
public override string ToString()
{
return this.sqlCommand.CommandText;
}
#endregion
}
}