midora Posted March 5, 2014 Share Posted March 5, 2014 Do you like to provide more detailed information about your plugin to the user of Paint.NET 4?If the answer is 'yes' then you should continue to read.All plugins which are not built-in to Paint.NET 4 are showing a small puzzle image to the right of the menu entry.If the user hovers the mouse over the plugin menu entry then a tool tip pops up showing information aboutthe plugin. If the plugin does not offer additional information you will just see the location of the pluginin the file system.To offer additional information your plugin has to add and implement the IPluginSupportInfo interface.Add the interface to your effect class: [PluginSupportInfo(typeof(MyEffect))] public sealed class MyEffect : PropertyBasedEffect, IPluginSupportInfo Compiling your code will throw errors that some methods of the interface are not implemented: DisplayName, Version, Author, Copyright, WebsiteUriHere is an example of an implementation which takes some information out of the assembly. To access the assembly using System.Reflection; has to be added. And now the methods: public string DisplayName { get { return ((AssemblyProductAttribute)base.GetType().Assembly.GetCustomAttributes(typeof(AssemblyProductAttribute), false)[0]).Product; } } public Version Version { get { return base.GetType().Assembly.GetName().Version; } } public string Author { get { return "Barbarella"; } } public string Copyright { get { return ((AssemblyCopyrightAttribute)base.GetType().Assembly.GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false)[0]).Copyright; } } public Uri WebsiteUri { get { return new Uri("http://forums.getpaint.net/index.php?/forum/7-plugins-publishing-only/"); } } An other way to implement the plugin info is to use a seperate class: public class MyPluginSupportInfo : IPluginSupportInfo { public string DisplayName { get { return ((AssemblyProductAttribute)base.GetType().Assembly.GetCustomAttributes(typeof(AssemblyProductAttribute), false)[0]).Product; } } public Version Version { get { return base.GetType().Assembly.GetName().Version; } } public string Author { get { return "Barbarella"; } } public string Copyright { get { return ((AssemblyCopyrightAttribute)base.GetType().Assembly.GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false)[0]).Copyright; } } public Uri WebsiteUri { get { return new Uri("http://forums.getpaint.net/index.php?/forum/7-plugins-publishing-only/"); } } } In this case you have to add a reference to this class and not to the effect class. [PluginSupportInfo(typeof(MyPluginSupportInfo))] So now let your plugin tell us more about it... Quote Link to comment Share on other sites More sharing options...
BoltBait Posted March 5, 2014 Share Posted March 5, 2014 CodeLab does this for you automatically with the information you enter on the "Save as DLL" screen. This was added in version 1.0 of CodeLab which was published on April 28, 2008. Quote Click to play: Download: BoltBait's Plugin Pack | CodeLab | and how about a Computer Dominos Game Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.