Jump to content

PluginSupportInfo properties


MJW
 Share

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.)

 

 

 

Link to comment
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.

Link to comment
Share on other sites

That makes sense. I don't have a company to put in there, and the description is more valuable info. I'm convinced!

Link to comment
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.

 Share

×
×
  • Create New...