2 * Firebird ADO.NET Data provider for .NET and Mono
4 * The contents of this file are subject to the Initial
5 * Developer's Public License Version 1.0 (the "License");
6 * you may not use this file except in compliance with the
7 * License. You may obtain a copy of the License at
8 * http://www.firebirdsql.org/index.php?op=doc&id=idpl
10 * Software distributed under the License is distributed on
11 * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
12 * express or implied. See the License for the specific
13 * language governing rights and limitations under the License.
15 * Copyright (c) 2003, 2004 Abel Eduardo Pereira
16 * All Rights Reserved.
20 using FirebirdSql.Data.Firebird;
22 namespace FirebirdSql.Data.Firebird.Isql
27 /// The event handler type trigged before a SQL statement execution.
29 public delegate void CommandExecutingEventHandler(object sender, CommandExecutingEventArgs e);
34 /// CommandExecutingEventArgs encapsulates the events arguments for the event trigged
35 /// from the <see cref="FbBatchExecution"/> during the execution.
40 public class CommandExecutingEventArgs: EventArgs
44 private FbCommand sqlCommand;
51 /// Returns the <see cref="FbCommand"/> instance that created for the SQL statement that goes
54 public FbCommand SqlCommand
56 get { return this.sqlCommand; }
60 /// Returns the <see cref="SqlStatementType"/> of the current <see cref="SqlCommand"/>.
62 public SqlStatementType StatementType
64 get { return FbBatchExecution.GetStatementType(this.SqlCommand.CommandText); }
72 /// Creates an instance of CommandExecutingEventArgs class.
74 /// <param name="sqlCommand">The FbCommand properly instanciated.</param>
75 /// <remarks>The <b>sqlCommand</b> should be proper instanciated with a valid
76 /// <see cref="FbCommand"/> and with the SQL statement loaded in <see cref="FbCommand.CommandText"/>.
78 public CommandExecutingEventArgs(FbCommand sqlCommand)
80 this.sqlCommand = sqlCommand;
88 /// Overrided. Returns the SQL statement that goes for execution.
90 /// <returns>The SQL statement that will be executed.</returns>
91 public override string ToString()
93 return this.sqlCommand.CommandText;