Dim UICommand As IpfcUICommand Dim UICommandActionListener As IpfcUICommandActionListener Dim UICommandAccessListener As IpfcUICommandAccessListener Dim AsyncActionListener As IpfcAsyncActionListener '整个过程与Toolkit添加菜单按钮的过程类似 '创建IpfcUICommandActionListener对象 UICommandActionListener = New MyUICommandActionListener() '添加Command UICommand = asyncConnection.Session.UICreateCommand("TEST1", UICommandActionListener) '创建UICommandAccessListener UICommandAccessListener = New MyUICommandAccessListener(asyncConnection) '判断按钮是否可用 UICommand.AddActionListener(UICommandAccessListener) '添加自定义菜单按钮 asyncConnection.Session.UIAddButton(UICommand, "Windows", Nothing, "MyPushButton", "MyPushButtonHelp", Msg_file) '设定IpfcAsyncConnection层级的listener,必须有,不然会死 AsyncActionListener = New MyAsyncActionListener() asyncConnection.AddActionListener(AsyncActionListener)
Dim UICommand As IpfcUICommand Dim UICommandActionListener As IpfcUICommandActionListener Dim PopupmenuListener As IpfcPopupmenuListener Dim UICommandAccessListener As IpfcUICommandAccessListener Dim AsyncActionListener As IpfcAsyncActionListener '整个过程与Toolkit添加右键菜单按钮的过程类似 '以下添加按钮,各函数的参数与toolkit的ProMenubarmenuPushbuttonAdd类似 UICommandActionListener = New MyUICommandActionListener() '添加Command UICommand = asyncConnection.Session.UICreateCommand("TEST2", UICommandActionListener) '创建UICommandAccessListener UICommandAccessListener = New MyUICommandAccessListener(asyncConnection) '判断按钮是否可用 UICommand.AddActionListener(UICommandAccessListener) '添加自定义菜单按钮 asyncConnection.Session.UIAddButton(UICommand, "ActionMenu", Nothing, "MyPopupButton", "MyPopupButtonHelp", Msg_file) '添加右键菜单菜弹出规则 PopupmenuListener = New MyPopupmenuListener(asyncConnection) asyncConnection.Session.AddActionListener(PopupmenuListener) '设定IpfcAsyncConnection层级的listener,必须有,不然会死 AsyncActionListener = New MyAsyncActionListener() asyncConnection.AddActionListener(AsyncActionListener)