MJW Posted September 25, 2016 Share Posted September 25, 2016 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.) Quote 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.