Sign in to follow this  
MJW

PluginSupportInfo properties

Recommended Posts

In looking more closely at the PluginSupportInfo properties, I'm a little confused. In one of my plugins it is:

[assembly: AssemblyTitle("HsvEraser Plugin for Paint.NET")]
[assembly: AssemblyDescription("Erase pixels of selected HSV value.")]
[assembly: AssemblyConfiguration("hsv erase")]
[assembly: AssemblyCompany("MJW")]
[assembly: AssemblyProduct("HsvEraser")]
[assembly: AssemblyCopyright("Copyright © MJW")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: AssemblyVersion("1.0.*")]

namespace HsvEraserEffect
{
    public class PluginSupportInfo : IPluginSupportInfo
    {
        public string Author
        {
            get
            {
                return ((AssemblyCopyrightAttribute)base.GetType().Assembly.GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false)[0]).Copyright;
            }
        }
        public string Copyright
        {
            get
            {
                return ((AssemblyDescriptionAttribute)base.GetType().Assembly.GetCustomAttributes(typeof(AssemblyDescriptionAttribute), false)[0]).Description;
            }
        }

        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 Uri WebsiteUri
        {
            get
            {
                return new Uri("http://www.getpaint.net/redirect/plugins.html");
            }
        }
    }

I've looked at other plugins, such as BoltBait's HueSatPlus, and it seems to be the same.

 

I find it odd that Author returns the Copyright attribute, and Copyright returns the Description attribute. I'd expect Author to return AssemblyCompany, and Copyright to return AssemblyCopyright.

 

Also, as an added bonus comment, I assume there's no appropriate Assembly property for the URI, but it'd be nice if there were. (I don't know much about the Assembly attributes -- to say the least.)

 

 

 

Share this post


Link to post
Share on other sites

I designed these to return the information based on how paint.net 4.0 shows the tooltip when you hover over a plugin entry in the Effects menu instead of the proper definitions.

 

ToolTip.png

  • Upvote 1

Share this post


Link to post
Share on other sites

Thanks, BoltBait. I'll leave them as they are then. I'd never bothered looking at he stuff before, and it seemed slightly weird.

Share this post


Link to post
Share on other sites

Here's how I use these fields

public class PluginSupportInfo : IPluginSupportInfo
    {
            public string Author
            {
                get
                {
                    return "Your Name";
                }
            }
            public string Copyright
            {
                get
                {
                    return "© 2016 Your Name / Companyname";
                }
            }

            public string DisplayName
            {
                get
                {
                    return "The name of your plugin goes here";
                }
            }

            public Version Version
            {
                get
                {
                    return base.GetType().Assembly.GetName().Version;
                }
            }

            public Uri WebsiteUri
            {
                get
                {
                    return new Uri("http://www.getpaint.net/redirect/plugins.html");
                }
            }
     }

 

If you have a website which supports your plugins, or a github repository, the URI can replace the standard forum URI.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this