Could you post some code and/or give some more details?
The following is an example for the issue I am having:
public class applicationWindow {
public event ToolClickEventHandler ToolClicked;
private UltraToolbarsManager _toolbarsManager;
private ToolSecurityManager _toolSecurityManager;
//the following object as the event ToolClick
public UltraToolbarsManager ToolbarsManager {
get { return this._toolbarsManager; }
}
//the following has the event CanClickTool
public ToolSecurityManager ToolSecurityManager {
get { return _toolSecurityManager; }
}
this._toolbarsManager.ToolClick += new
Infragistics.Win.UltraWinToolbars.ToolClickEventHandler(this.OnInternalToolClicked);
//EXECUTES FIRST
private void OnInternalToolClicked(object sender,
Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e) {
try
{
// enforce tool security by confirming that the tool can indeed be
clicked by asking the tool security manager first
if (!_toolSecurityManager.CanClick(e.Tool, new object[] {}))
return;
//other code processing if not false from
....
}
......
}
public bool CanClick(ToolBase tool, params object[] args)
{
this.AssertValidTool(tool);
ToolCancelEventArgs e = new ToolCancelEventArgs(false, tool,
args);
this.OnCanClickTool(this, e);
return !e.Cancel;
}
}
Public Class AuthenticationSnapIn {
InitializeComponent {
AddHandler _applicationWindow.ToolSecurityManager.CanClickTool,
AddressOf _applicationWindowSnapIn_ToolSecurityManager_CanClickTool
}
Private Sub
_applicationWindow_ToolSecurityManager_CanClickTool(ByVal sender As
Object, ByVal e As ApplicationWindow.ToolCancelEventArgs)
If Not ValidUser() Then
e.Cancel = True
'THIS IS WHERE I WOULD LIKE TO CANCEL THE HANDLER FOR
ProviderSnapIn (below)
End If
End Sub
}
Public Class ProviderSnapIn {
InitializeComponent {
AddHandler _applicationWindow.ToolbarsManager.ToolClick, AddressOf
_applicationWindowSnapIn_ToolbarsManager_ToolClick
}
Private Sub _applicationWindow_ToolbarsManager_ToolClick()
....
End Sub
}