Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
45
Help with SCSF and UltraWinToolBars
posted

Greetings all,

I have a CAB project using the UltraWinToolBarManager that has three blank toolbars (Main/LaunchBar/ToolBar).  I want to add/remove/hide buttons based on workitem, and permissions.  When I tried to load my first view, and wire up the click event I get the following error:

Unable to access the specified event for the specified invoker.

OK, so here's my setup:

In my Infrastructure.Interface.WorkItemController class I have the following:

protected void AddLaunchBarItem(string commandName, System.Drawing.Image moduleIcon, string moduleTitle, string

toolTipText)

{

 

 

ButtonTool button = new ButtonTool (commandName);

button.CustomizedImage = moduleIcon;

button.CustomizedCaption = moduleTitle;

button.SharedProps.ToolTipText = toolTipText;

WorkItem.UIExtensionSites[Constants.

 

UIExtensionSiteNames

.MainLaunchBar].Add(button);

WorkItem.Commands[commandName].AddInvoker(button,

 

"Click"

);

 

 

which is called from my ModuleController:

 

 

 

private void

ExtendLanchBar()

{

AddLaunchBarItem(

 

CommandNames.HLAXBROWSER, Properties.Resources.HLAxBrowser.ToBitmap(), Properties.Resources.ModuleTitle, Properties.Resources

.ModuleTitle);

where I also have a command handler registered:

 

 

 

 

[

CommandHandler(CommandNames.HLAXBROWSER)]

 

 

public void onHLAXBrowserClick(object sender, EventArgs

e)

{

 

 

Cursor.Current = Cursors

.WaitCursor;

ShowViewInWorkspace<

 

HLAxBrowserView>(Infrastructure.Interface.Constants.WorkspaceNames

.MainWorkspace);

 

 

Cursor.Current = Cursors

.Default;

 

 

 

 

 

Could someone tell me what I am doing wrong?

Parents
No Data
Reply
  • 2077
    Offline posted

    Mark Rooney said:

    WorkItem.Commands[commandName].AddInvoker(button, "Click");

    The ButtonTool class doesn't contain a definition for the Click event. The event you are looking for is ToolClick:

    WorkItem.Commands[commandName].AddInvoker(button, "ToolClick");

    This way it should work.

    HTH,

    Emanuel

Children
No Data