Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagecsharp
titleIQFunctionPlugin
linenumberstrue
    /// <summary>
    /// Defines a method to be called by Quaestor.
    /// </summary>
    public interface IQFunctionPlugin
    {
        /// <summary>
        /// Defines a function to be executed by Quaestor.
        /// The KE must inform the developer about the return type and the order and types of the input values
        /// </summary>
        /// <param name="errorMessage"></param>
        /// <param name="inputValues">Contains the input values; it can contain only string and double.
        /// The order and type are specified by the KE.</param>
        /// <returns>The result of the calculation. It can be only string or double.</returns>
        object Compute(out string errorMessage, List<object> inputValues);
    }

Implementation

Steps in implementing a Quaestor plug-in:

  1. Create a class library project in Visual Studio
  2. Add reference to the QInterfaces.dll (soon available via the nuGet manager)
  3. Add reference to System.ComponentModel.Composition
  4. Create a class that will implement the method called by Quaestor
  5. Add the Export and ExportMetadata attributes to the class
  6. (optional) Create as many classes as needed to be called by Quaestor; create a GUI project to test the classes

Each new function needs to be implemented in a separate class that inherits from the IQFunctionPlugin interface.

...