Version

InProgress(DockManagerEventIds) Method

Indicates whether the event identified by the eventid is in progress.
Syntax
'Declaration
 
Public Overloads Function InProgress( _
   ByVal eventid As DockManagerEventIds _
) As Boolean
public bool InProgress( 
   DockManagerEventIds eventid
)

Parameters

eventid
Identifies the event to check.

Return Value

True if event in progress, false otherwise.
Remarks

To determine if a specific event is processing its event code at the current point in time, use the InProgress method. You should always check whehter and event is processing before disabling it.

Caution Do not disable an event before it has finished processing. Disabling an event while it is still processing can produce unpredictable results.

Example
The following sample code illustrates how to use the UltraDockManager's event manager

Imports Infragistics.Shared
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinDock

Private Sub btnEventManager_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnEventManager.Click

    ' Get the dockmanager components's event manager.
    ' The event manager is used to temporarily disable events
    ' to prevent them from being raised. This can be very
    ' convenient in a situation where one or more properties
    ' are being set in code and the events they would normally 
    ' raise would cause unnecessary or counter-productive
    ' code to be executed.
    '
    ' Note: All events are enabled by default.

    Dim eventManager As DockEventManager

    ' The 'EventManager' property returns the instance
    ' used to manage the component event firing
    eventManager = Me.ultraDockManager1.EventManager

    ' Disable the BeforeToggleDockState event
    eventManager.SetEnabled(DockManagerEventIds.BeforeToggleDockState, False)

    ' There is also an overload to disable a group of events
    ' for example, you can disable all the 'Before' events
    ' eventManager.SetEnabled(DockManagerEventGroups.BeforeEvents, True)

    ' Call the ToggleDockState of the pane to toggle its 'DockedState'
    ' Note: This would normally cause the 'BeforeToggleDockState' event to 
    ' be raised. However, since the above code disabled the event
    ' it won't be.
    Me.ultraDockManager1.DockAreas(0).ToggleDockState()

    ' Re-enable the BeforeToggleDockState event
    eventManager.SetEnabled(DockManagerEventIds.BeforeToggleDockState, True)

    ' The 'AllEventsEnabled' property lets you enable/disable
    ' all events will a single line of code. If any event is 
    ' disabled the 'AllEventsEnabled' property returns false.
    If Not eventManager.AllEventsEnabled Then
        eventManager.AllEventsEnabled = True
    End If

    ' The event manager also exposes an 'IsEnabled' method
    ' to see if an event is enabled or disbled.
    If Not eventManager.IsEnabled(DockManagerEventIds.BeforeSplitterDrag) Then
        eventManager.SetEnabled(DockManagerEventIds.BeforeSplitterDrag, True)
    End If

    ' The 'InProgress' method will return true if the 
    ' specified event is currently being raised. This
    ' is often helpful in methods that can be called
    ' from various points in an application to determine
    ' what is triggering the call.
    If eventManager.InProgress(DockManagerEventIds.PaneActivate) Then
        ' ... 
    End If

End Sub
using Infragistics.Shared;
using Infragistics.Win;
using Infragistics.Win.UltraWinDock;
using System.Diagnostics;

private void btnEventManager_Click(object sender, System.EventArgs e)
{

	// Get the dockmanager components's event manager.
	// The event manager is used to temporarily disable events
	// to prevent them from being raised. This can be very
	// convenient in a situation where one or more properties
	// are being set in code and the events they would normally 
	// raise would cause unnecessary or counter-productive
	// code to be executed.

	// Note: All events are enabled by default.

	// The 'EventManager'property returns the instance
	// used to manage the component event firing
	DockEventManager eventManager = this.ultraDockManager1.EventManager;

	// Disable the BeforeToggleDockState event
	eventManager.SetEnabled(DockManagerEventIds.BeforeToggleDockState, false);
	// there is also an overload to disable a group of events
	// for example, you can disable all the 'Before' events
	// eventManager.SetEnabled(DockManagerEventGroups.BeforeEvents, True)

	// Call the ToggleDockState of the pane to toggle its 'DockedState'
	// Note: This would normally cause the 'BeforeToggleDockState' event to 
	// be raised. However, since the above code disabled the event
	// it won't be.
	this.ultraDockManager1.DockAreas[0].ToggleDockState();

	// Re-enable the BeforeToggleDockState event
	eventManager.SetEnabled(DockManagerEventIds.BeforeToggleDockState, true);

	// The 'AllEventsEnabled' property lets you enable/disable
	// all events will a single line of code. If any event is 
	// disabled the 'AllEventsEnabled' property returns false.
	if (!eventManager.AllEventsEnabled)
		eventManager.AllEventsEnabled = true;

	// The event manager also exposes an 'IsEnabled// method
	// to see if an event is enabled or disbled.
	if (!eventManager.IsEnabled(DockManagerEventIds.BeforeSplitterDrag))
		eventManager.SetEnabled(DockManagerEventIds.BeforeSplitterDrag, true);

	// The 'InProgress// method will return true if the 
	// specified event is currently being raised. This
	// is often helpful in methods that can be called
	// from various points in an application to determine
	// what is triggering the call.
	if (eventManager.InProgress(DockManagerEventIds.PaneActivate))
	{
		// ... 
	}

}
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also