Active Query Builder 2 .NET Edition reference
QueryAwake Event
Example 



Occurs when the component is currently in the "Sleep" mode and the user starts to build a query visually.
Syntax
'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
Remarks

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.

Example
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;
    }
}
See Also

Reference

QueryBuilder Class
QueryBuilder Members
AllowSleepMode Property
SleepModeChanged Event

 

 


© Copyright 2005-2012 ActiveDBSoft. All rights reserved.

Send Feedback