Reputation: 11
We are attempting to create a FogBugz plugin & have started naturally with the Hello World example [Wiki 38].
We are using Visual Studio 2005 and VB.Net.
However, whenever we add "Implements IPluginExtraMenus" to our class AND implement the appropriate function, Visual Studio reports that
Class 'xxxx' must implement Function ExtrasMenuLinks() as UI.CNavMenuLink()
for interface FogCreek.FogBugz.Plugins.InterfacesIPluginExtrasMenu
Here is an example:
Public Class DaysRemaining
Inherits Plugin
Inherits IPluginPagedisplay
Inherits IPluginExtrasMenu
Public Function ExtrasMenuLinks() As UI.CNavMenuLink
dim vMenu as CNavMenuLink
vMenu = new CNavMenuLink("", "", "", "")
Return vMenu
End Function
End Class
Also, if we try and add an "Implements IPluginExtrasMenu.ExtrasMenuLinks" keyword in the function definition, Visual Studio reports that
'ExtrasMenuLinks' cannot implement 'ExtrasMenuLinks' because there is
no matching function on interface
FogCreek.FogBugz.Plugins.InterfacesIPluginExtrasMenu
We are importing all of the correct namespaces etc.
Any assistance will be greatly appreciated e.g. pointing where we have gone wrong, pointing us in the direction of other VB.Net examples, etc.
Upvotes: 1
Views: 45
Reputation: 11067
It looks like Visual Studio is complaining because interface expects ExtrasMenuLinks to return an array of UI.CNavMenuLink objects, whereas your implementation only returns a single UI.CNavMenuLink.
I believe the modification you need to make to match the interface is:
Public Function ExtrasMenuLinks() As UI.CNavMenuLink()
You'll also need to modify the function body to return an array.
Upvotes: 2