Jump to content

PluginSupportInfo question


MJW
 Share

Recommended Posts

I'm confused by something. If I define a PluginSupportInfoClass the following way, the effect's Tooltip has all the correct information:

 

Define a base class as:

 public class PluginSupportInfoBase : 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://forums.getpaint.net/index.php?/topic/BaseClass/");
            }
        }
    }

Then define a derived class as:

 public class PluginSupportInfo : PluginSupportInfoBase, IPluginSupportInfo
 {
 }

 

If I add a do-nothing, no-argument constructor call to the derived class, as follows, the Tooltip no longer contains the plugin information.

 public class PluginSupportInfo : PluginSupportInfoBase, IPluginSupportInfo
 {
     PluginSupportInfo() : base()
     {         
     }
 }

For anyone with a firm understating of constructors (i.e., not me), it's probably obvious, but I don't see why the first works and the second doesn't.

 

(I intend to pass arguments in the base constructor eventually, but I wanted to test the simplest case first.)

 

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