I watched this training video on QActions
I am trying to replicate the Generic Code function, but it doesn't work trying to call my Generic Code from another QAction with the error: "QAction_5005.cs(110,32): error CS1061: 'SLProtocol' does not contain a definition for 'LookupISI' and no accessible extension method 'LookupISI' accepting a first argument of type 'SLProtocol' could be found (are you missing a using directive or an assembly reference?)"
I cannot see where I have strayed from the video and failing to find the right documentation to help me.
This is my generic code:
This is the QAction I call it from
This is where I call it with the DIS Validator error:
Hi Sam,
When defining an extension method, the "this" keyword should be put in front of the frist argument (public static string LookupISI(this SLProtocolExt, int id)
Side note: If you are working solution-based (i.e., the protocol you're working in is a VS solution and not a plain XML file), you'll need to add a project reference in the project where you use the extension method to the project/QAction that defines this extension method (DIS will automatically add the dllImport attribute when creating an XML out of the solution). If you are working XML-based, then the dllImport attribute as in the screenshot looks OK.