ActiveDatabaseSoftware.ActiveQueryBuilder Namespace > QueryBuilder Class : QueryAwake Event |
'Declaration Public Event QueryAwake As QueryAwakeEventHandler
'Usage Dim instance As QueryBuilder Dim handler As QueryAwakeEventHandler AddHandler instance.QueryAwake, handler
public event QueryAwakeEventHandler QueryAwake
public: __event QueryAwakeEventHandler* QueryAwake
This situation may happen when visual query building is combined with direct SQL text editing. Suppose that the user wrote an unsupported SQL statement in the text editor by hand, so the visual query builder fall into the "Sleep mode", and the user started to build a query visually after that. Obviously the visual query builder have to "awake" in response to user actions and start to generate SQL text, so the hand-written query will be lost. This event allows to prevent occasional awakening of the component and lets the user to save the hand-written query prior to building a new one.
Set the abort parameter to true to deny awakening of the component.
private void queryBuilder_QueryAwake(object sender, ref bool abort) { if (MessageBox.Show("You are about to build a new SELECT statement. " + "Current query in the text editor will be replaced. Are you sure?", "Active Query Builder .NET Demo", MessageBoxButtons.YesNo) == DialogResult.No) { abort = true; } }