开发者

Inconsistent accessibility

开发者 https://www.devze.com 2023-03-25 23:46 出处:网络
What is the following error : 开发者_运维技巧 Inconsistent accessibility: parameter type \'----.Messagetypes\' is less

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

精彩评论

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