'宣言 Public ReadOnly Property EventManager As DockEventManager
public DockEventManager EventManager {get;}
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)) { // ... } }