开发者

Inconsistent accessibility

What is the following error :

开发者_运维技巧

Inconsistent accessibility: parameter type '----.Messagetypes' is less

accessible than method '---.MessageBox---.Messagetypes, string)'

my code :

public partial class Global
{
    private  enum Messagetypes { Error };

    public  void MessageBox(Messagetypes MessageDisplay, string MessageError)
    {

    }
}

What is the correct code


Messagetypes is private, but is a parameter to a public function. The only people that would ever be able to call it are other private members. Either change your function to private, or change your enum to public.


You can't have Messagetype be private since apparently your application is trying to use it outside of the Global class. Change it to public and it should work.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜