#Sample ManicTime Client Tag source
This is a sample plugin which shows how to write a plugin to import tags from other systems into ManicTime.
To test it:
- Clone the repository and build it.
- Go to bin/(Debug or Release)/Packages folder. In it, there should be a folder named ManicTime.TagSource.SampleWeb. Copy this whole folder to c:\Users<user>\AppData\Local\Finkit\ManicTime\Plugins\Packages\
- Restart ManicTime.
- Go to Tag editor and under "Tag sources -> Add" you should see "Tags from Web"
Package folder is created in a post-build event
What's in the package folder:
- The dll of the plugin as well as any other dll not included in the .Net installation.
- There is also a PluginSpec.json file:
- Id must be the same as the folder name
- Name and Description are used in ManicTime when the plugin is shown
- Type needs to be TagSource
- AssemblyName is the dll of the plugin.
##How it works When the plugin is first created, it will look for a class derived from TagSourceSettingsViewModel. The view will be presented to the user, use it to collect the necessary information like username, password, service url and anything else you need for your plugin to work.
When the user presses Ok, the settings will be saved.
Then the plugin will be created by calling CreateServerTagSourceInstance in class SampleWebTagSource. Any plugin can have more than one instance, you could for example load tags from GitHub from multiple accounts.
Most of the work in your plugin is done by the Update function in SampleWebTagSourceInstance. In this function you can use the settings to connect to the remote service and get the list of tags.
ManicTime will then present them in Add tag window.