Version

EventManager Property

The object that enables, disables and controls firing of specific component events.
Syntax
'Declaration
 
Public ReadOnly Property EventManager As UltraExplorerBarEventManager
public UltraExplorerBarEventManager EventManager {get;}
Remarks

The EventManager provides a high degree of control over how the control invokes event procedures. You can use it to selectively enable and disable event procedures depending on the context of your application. You can also use the event manager to return information about the state of the control's events.

The event manager's methods are used to determine the enabled state of an event (UltraExplorerBarEventManager.IsEnabled), to selectively enable or disable events (UltraExplorerBarEventManager.SetEnabled), and to determine whether an event procedure is currently being processed (UltraExplorerBarEventManager.InProgress).

Example
The following code demonstrates how to use the Event Manager to manage event firing.

Imports System.Diagnostics
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinExplorerBar


	Private Sub button94_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button94.Click

		' Get UltraExplorerBar'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 UltraExplorerBarEventManager = Me.ultraExplorerBar1.EventManager


		' Disable the ActiveGroupChanged/ActiveGroupChanging events
		eventManager.SetEnabled(UltraExplorerBarEventIds.ActiveGroupChanged, False)
		eventManager.SetEnabled(UltraExplorerBarEventIds.ActiveGroupChanging, False)


		' The event manager exposes an 'IsEnabled' method to see if an event
		' is enabled or disbled.  Display the enabled status of the
		' ActiveGroupChanged/ActiveGroupChanging events to verify that they are disabled.
		Debug.WriteLine(String.Format("IsEnabled returns '{0}' for the ActiveGroupChanged event", eventManager.IsEnabled(UltraExplorerBarEventIds.ActiveGroupChanged).ToString()))
		Debug.WriteLine(String.Format("IsEnabled returns '{0}' for the ActiveGroupChanging event", eventManager.IsEnabled(UltraExplorerBarEventIds.ActiveGroupChanging).ToString()))


		' Re-enable the ActiveGroupChanged/ActiveGroupChanging events
		eventManager.SetEnabled(UltraExplorerBarEventIds.ActiveGroupChanging, True)
		eventManager.SetEnabled(UltraExplorerBarEventIds.ActiveGroupChanged, True)


		' Display the enabled status of the ActiveGroupChanged/ActiveGroupChanging events
		' to verif that they have been re-enabled.
		Debug.WriteLine(String.Format("IsEnabled returns '{0}' for the ActiveGroupChanged event", eventManager.IsEnabled(UltraExplorerBarEventIds.ActiveGroupChanged).ToString()))
		Debug.WriteLine(String.Format("IsEnabled returns '{0}' for the ActiveGroupChanging event", eventManager.IsEnabled(UltraExplorerBarEventIds.ActiveGroupChanging).ToString()))


		' 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 = False) Then
			eventManager.AllEventsEnabled = True
		End If


		' The event manager also exposes overloaded 
		' 'IsEnabled' and 'SetEnabled' methods that take an  
		' event group so that, for example all 'before' or all
		' 'after' events can be enabled/disabled. If any event
		' in the group is disabled the 'IsEnabled' method returns
		' false.
		eventManager.SetEnabled(UltraExplorerBarEventGroups.AfterEvents, False)

		Debug.WriteLine(String.Format("IsEnabled returns '{0}' for the 'before' events", eventManager.IsEnabled(UltraExplorerBarEventGroups.BeforeEvents).ToString()))
		Debug.WriteLine(String.Format("IsEnabled returns '{0}' for the 'after' events", eventManager.IsEnabled(UltraExplorerBarEventGroups.AfterEvents).ToString()))

		eventManager.SetEnabled(UltraExplorerBarEventGroups.AfterEvents, 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(UltraExplorerBarEventIds.GroupAdding)) Then
			' ... 
		End If
	End Sub
using System.Diagnostics;
using Infragistics.Win;
using Infragistics.Win.UltraWinExplorerBar;


		private void button94_Click(object sender, System.EventArgs e)
		{
			// Get UltraExplorerBar'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.
			UltraExplorerBarEventManager eventManager = this.ultraExplorerBar1.EventManager;


			// Disable the ActiveGroupChanged/ActiveGroupChanging events
			eventManager.SetEnabled(UltraExplorerBarEventIds.ActiveGroupChanged, false );
			eventManager.SetEnabled(UltraExplorerBarEventIds.ActiveGroupChanging, false );


			// The event manager exposes an 'IsEnabled' method to see if an event
			// is enabled or disbled.  Display the enabled status of the
			// ActiveGroupChanged/ActiveGroupChanging events to verify that they are disabled.
			Debug.WriteLine(string.Format("IsEnabled returns '{0}' for the ActiveGroupChanged event", eventManager.IsEnabled(UltraExplorerBarEventIds.ActiveGroupChanged).ToString()));
			Debug.WriteLine(string.Format("IsEnabled returns '{0}' for the ActiveGroupChanging event", eventManager.IsEnabled(UltraExplorerBarEventIds.ActiveGroupChanging).ToString()));


			// Re-enable the ActiveGroupChanged/ActiveGroupChanging events
			eventManager.SetEnabled(UltraExplorerBarEventIds.ActiveGroupChanging, true );
			eventManager.SetEnabled(UltraExplorerBarEventIds.ActiveGroupChanged, true );


			// Display the enabled status of the ActiveGroupChanged/ActiveGroupChanging events
			// to verif that they have been re-enabled.
			Debug.WriteLine(string.Format("IsEnabled returns '{0}' for the ActiveGroupChanged event", eventManager.IsEnabled(UltraExplorerBarEventIds.ActiveGroupChanged).ToString()));
			Debug.WriteLine(string.Format("IsEnabled returns '{0}' for the ActiveGroupChanging event", eventManager.IsEnabled(UltraExplorerBarEventIds.ActiveGroupChanging).ToString()));


			// 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 overloaded 
			// 'IsEnabled' and 'SetEnabled' methods that take an  
			// event group so that, for example all 'before' or all
			// 'after' events can be enabled/disabled. If any event
			// in the group is disabled the 'IsEnabled' method returns
			// false.
			eventManager.SetEnabled(UltraExplorerBarEventGroups.AfterEvents, false);

			Debug.WriteLine(string.Format("IsEnabled returns '{0}' for the 'before' events", eventManager.IsEnabled(UltraExplorerBarEventGroups.BeforeEvents).ToString()));
			Debug.WriteLine(string.Format("IsEnabled returns '{0}' for the 'after' events", eventManager.IsEnabled(UltraExplorerBarEventGroups.AfterEvents).ToString()));

			eventManager.SetEnabled(UltraExplorerBarEventGroups.AfterEvents, 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(UltraExplorerBarEventIds.GroupAdding))
			{
				// ... 
			}
		}
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