c# - Inconsistent Accessibility Error #2 -
help i'm getting error:
error 1 inconsistent accessibility: parameter type 'sharpupdate.sharpupdatexml' less accessible method 'sharpupdate.sharpupdateinfoform.sharpupdateinfoform(sharpupdate.isharpupdateable, sharpupdate.sharpupdatexml)'
from code:
namespace sharpupdate { public class sharpupdateinfoform : form { public sharpupdateinfoform( isharpupdateable applicationinfo, sharpupdatexml updateinfo) { initializecomponent(); if (applicationinfo.applicationicon != null) this.icon = applicationinfo.applicationicon; this.text = applicationinfo.applicationname + "- update info"; this.lblversions.text = string.format( "current version: {0}\nupdate version: {1}", applicationinfo.applicationassembly.getname().version.tostring(), updateinfo.version.tostring()); this.txtdescription.text = updateinfo.description; } } }
i've tried changing public
internal
, private
, error remained same.
your error self-explanatory. boils down following:
parameter type sharpupdatexml less accessible method sharpupdateinfoform
the sharpupdateinfoform
of course constructor of form. constructor public , sharpupdatexml
class passsed constructor less accessible (either private or internal). have make sharpupdatexml
class public or sharpupdateinfoform
internal (or private if sharpupdatexml
private).
in current scenario expose sharpupdateinfoform
(public) initialize have use sharpupdatexml
not available (private/internal). user of classes can try initialize form may not allowed use sharpupdatexml
makes whole setup bit useless.
Comments
Post a Comment