Creating a plugin or extension
Create a project in Visual Studio for your custom plugin or extension, add references to assemblies, and develop your plugin or extension with the help of the samples provided.
Before you begin
Procedure
- Start Visual Studio.
- Create a new project of type Class Library (.NET Standard) in C# and give it a name, say, MyCustomPluginLibrary.
- In project view, select Project > Add Reference.
A Reference Manager dialog opens.
- Select the Browse option and browse to the IntegrationLibraries\ folder of the unpacked ZIP file.
- Select the .NET assembly for the plugin SDK, Trisoft.InfoShare.Plugins.SDK.dll. It has an accompanying documentation resource file called Trisoft.InfoShare.Plugins.SDK.xml.
- Repeat steps 3-5 above to add the .NET assembly for the plugin common helper, Trisoft.InfoShare.Plugins.Common.dll, which has an accompanying documentation resource file Trisoft.InfoShare.Plugins.Common.xml.
- Do not add any of the non-trisoft .NET assemblies in this folder (the files that start with another string than
Trisoft). Instead, install those assemblies as NuGet packages. Explore file IntegrationLibraries\Trisoft.InfoShare.API25.deps.json in order to see the needed NuGet package version and dependencies between NuGet packages. - Also install the .NET assembly System.ComponentModel.Composition.dll, making sure it has the same version as the one used by the
PluginSamplesproject (as found in its Manage Package for Solutions screen, accessible from Tools > NuGet Package Manager > Manage NuGet Packages for Solution). - Use the samples in the PluginSamples\ folder of the unpacked ZIP file as the basis for your plugin or extension. There are separate subfolders for the following types of plugin or extension:
- BackgroundTasks\ for custom background task handlers
- Extensions\ for custom extensions
- PublishPlugins\ for custom publish plugins
- WritePlugins\ for custom write plugins
- Develop your plugin or extension using the samples provided.
- In your plugin or extension class source file, add a summary at the top in a
<summary>element (in comments) in which you describe the functionality of this plugin or extension. - Just below your
<summary>element, also in comments, add an<example>element that contains a sample configuration for your plugin or extension. Here's an example of such a sample configuration:// <example> // <code lang="xml"><![CDATA[ // <plugin name="CustomDocumentObjWritePlugin" handler="CustomDocumentObjWritePlugin" ishcondition="EDT='EDTXML'"> // <description>My custom plugin</description> // <workingset> // <ishfields> // <ishfield name="FTITLE" level="logical" /> // </ishfields> // </workingset> // <initialize> // <parameters> // <parameter name="NodeXPath">/topic/title</parameter> // </parameters> // </initialize> // </plugin> // ]]></code> // </example> - Develop unit tests to try out the plugin. There are samples available both for .NET Core 6.0 (in the PluginSamples.Core.UnitTests\ folder) and for .NET Framework 4.8 (in the PluginSamples.UnitTests\ folder).