IWaitingBar Interface
Name | Description | |
---|---|---|
SetCaption(string) | Sets the caption of the active waiting bar to the specified value. | |
SetDescription(string) | Sets the description of the active waiting bar to the specified value. | |
StartProcess(string, string) | Starts notifying a new process. It doesn't stop an existing process. | |
StartProcess(string, bool, int) | Starts notifying a new process. It optionally stops an existing process. | |
StopAllProcesses() | Stops all started processes and closes the waiting bar. | |
StopProcess() | Stops the last started process, if any. |
The progress notification is useful for longer operations. Such operations may be divided in multiple processes. A process is just a logical unit of work. However, it's absolutely normal to have just one process.
You can obtain an instance of this interface from QdvManager.WaitingBar property.
The following example demonstrates how to slowly enumerate all global variables and display the progress.
// Get the waiting bar used in QDV. var waitBar = context.QdvManager.WaitingBar; try { // Enumerate all global variables and display the progress. if (waitBar != null) { waitBar.StartProcess(""); waitBar.SetCaption("Enumerating global variables..."); } var globalVars = es.CurrentVersion.GlobalVariables; foreach (var variable in globalVars.GetGlobalVariableNames()) { // Display the progress. string progressText = variable; progressText += " = "; progressText += Convert.ToString(globalVars.GetVariableValue(variable)); if (waitBar != null) { waitBar.SetDescription(progressText); } // Simulate a long lasting operation. System.Threading.Thread.Sleep(100); } } finally { // Close the progress bar. if (waitBar != null) { waitBar.StopAllProcesses(); } }
This language is not supported or no code example is available.
Available since QDV 7.23.1050.