Jump to content

Some thoughts on Plugin Info


midora
 Share

Recommended Posts

Especially on the new external PluginBrowser Effect Plugin and the PluginSupportInfo used by this effect and by Paint.NET 4 to show the menu tooltips.

 

1) PluginBrowser should not use AssemblyConfiguration to look for keywords. AssemblyConfiguration is used typically to distinguish between "Debug" and "Release" configurations. If the keywords should be stored in the assembly then I would prefer to define a new attribute:

AssemblyKeywordsAttribute.cs:

namespace System.Reflection
{
    [AttributeUsage(AttributeTargets.Assembly, Inherited = false)]
    public sealed class AssemblyKeywordsAttribute : Attribute
    {
        public string Keywords
        {
            get;
            private set;
        }
        public AssemblyKeywordsAttribute() : this(string.Empty) { }
        public AssemblyKeywordsAttribute(string keywords) { Keywords = keywords; }
    }
}

This allows you to use the attribute in AssemblyInfo.cs

[assembly: AssemblyKeywords("One; Two; Three; Eins; Zwei; Drei")]

I'm using AssemblyCompanyHomeAttribute to store the URI in the assembly for a long time now w/o any issue.

 

2) Allow semicolon as separator instead of comma.

 

3) There are two other issues which can be solved only by using/extending PluginSupportInfo (IMHO).

First is about multiple effects in one assembly and second is about multiple languages support.

 

A simple solution may be to add a Keywords property to PluginSupportInfo as soon as possible. Already now developers can bind an individual PluginSupportInfo to an effect class. This interface may deliver language specific keywords. Or a method may be provided to get all keywords or only the keywords for a specific language.

 

4) For the future a mechanism which allows Paint.NEt to check for updates of installed plugins would be fine.

 

 

 

midoras signature.gif

Link to comment
Share on other sites

I agree the using AssemblyConfiguration is the wrong attribute to use for keywords.

 

As for adding anything to PluginSupportInfo "as soon as possible," it'll have to wait until September at least. There won't be any updates until then. I'm goin' on break.</mitch hedberg>

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
Share on other sites

Yes. When the Dwarf Horde approached me about plugin browser, I just did a quick look around and decided to use AssemblyConfiguration for the list of keywords.

I knew that it wasn't the intended purpose for the field. But, I also knew that CodeLab always produces Release builds. AND, it was the option that caused me to write the least amount of code. ;)

We can always change it. I'm not opposed to that.

In fact, I'd like to change it to something that is more flexible than AssemblyConfiguration. As we're doing it now, every effect in the same dll must have the same set of keywords and description. Only the display name can be changed. I'd like to fix that.

Click to play:
j.pngs.pngd.pnga.pngp.png
Download: BoltBait's Plugin Pack | CodeLab | and how about a Computer Dominos Game

Link to comment
Share on other sites

We didn't 'approach' you - we sneaked up from behind and press-ganged you :mrgreen:

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