Working with and creating Ynote Plugins

Ynote Classic supports plugins using MEF. To install a plugin, Ynote uses a .ynoteplugin file.

Installing Plugins

A Plugin can be installed the following ways -

1. Using Plugin Manager -> Settings->Plugin Manager. Click on Install Plugin and navigate to the .ynoteplugin file provided and restart if installed.

2. Manually -> Copy the Plugin file to the {ynotedir}\Plugins directory and the dependencies to the {ynotedir} directory.

Building Plugins

Every Application needs Plugins.Ynote Classic depends on MEF for Plugins under the namespace System.ComponentModel.Composition. Ynote has two types of Plugins =>

Both inherit the IPlugin interface. The IYnotePlugin interface is like :

  public interface IYnotePlugin : IPlugin {   

        void Init();   

        IYnoteHost Host { get; set; }   

        IEnumerable<ToolStripMenuItem> MenuItems { get; }   

        AddTo AddTo { get; }

  }

Parameters

  • Init -> Initializes the Plugin
  • Host ->The Host of the Plugin ( Ynote )
  • MenuItems -> The MenuItems to be added to the Main menu item of IPlugin.Name
  • AddTo -> Where to Add the Plugin menuitem

You can find more about FastColoredTextBox here.

Plugin Installation

A .ynoteplugin file is used for the installation of a plugin. I decided to use this because a plugin made in .NET has some dependencies. One can find it difficult to copy and save them in different locations. Thus, the ynoteplugin installation file format was born. The extension is .ynoteplugin. The Plugin is Installed by using the Plugin Manager located in Settings-Plugin Manager. The format of a Plugin Installation File is as follows :

<?xml version="1.0"?>
<YnotePlugin>
<Install>
<PluginFile><!--The Plugin File Name --></PluginFile>
<Dependencies><!--Example of another node of dependency--></Dependencies> </Install>
</YnotePlugin>

Last edited Oct 30, 2013 at 12:47 PM by samarjeet27, version 2

Comments

No comments yet.