Version

SetEnabled(DockManagerEventGroups,Boolean) Method

Enables or disables all the events associated with the specified group.
Syntax
'Declaration
 
Public Overloads Sub SetEnabled( _
   ByVal group As DockManagerEventGroups, _
   ByVal enabled As Boolean _
) 
public void SetEnabled( 
   DockManagerEventGroups group,
   bool enabled
)

Parameters

group
One of the DockManagerEventGroups containing the events for which you want to set the enabled state.
enabled
The state that will be assigned to each event in the group. Specify True to enable all of the group's events, or False to disable all of the group's events.
Remarks

The EventManager is used to selectively enable and disable events for the control. UltraDockManager events are categorized into groups to simplify the enabling and disabling of blocks of related events. This method lets you set the enabled state for all of the events in a group at one time.

Caution Do not disable an event before it has finished processing. Disabling an event while it is still processing can produce unpredictable results. You should use the InProgress(DockManagerEventIds) method to check whether an event is currently processing code before disabling the event.

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