这个错误我该怎么办? [英] What Shall I Do With This Error ?

查看:106
本文介绍了这个错误我该怎么办?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我该怎么办?



错误2可访问性不一致:参数类型'SimpleCryptographer.ProgressEventArgs'比委托'SimpleCryptographer.Form1.ProgressEventHandler'D更难访问:\ SimpleCryptographer \Form1.cs 15 30 SimpleCryptographer

what shall i do ??

Error 2 Inconsistent accessibility: parameter type 'SimpleCryptographer.ProgressEventArgs' is less accessible than delegate 'SimpleCryptographer.Form1.ProgressEventHandler' D:\SimpleCryptographer\Form1.cs 15 30 SimpleCryptographer

推荐答案

你要做什么?你应该解决它。如果从同一程序集中定义的类派生某个类,则需要使用与基类相同的访问修饰符。如果您对它们仍然没有信心,请了解访问说明符:

http:/ /msdn.microsoft.com/en-us/library/ms173121.aspx [ ^ ],

http ://msdn.microsoft.com/en-us/library/wxh6fsc7.aspx [ ^ ]。



如果你使用的基类来自汇编而不是你的派生类class,你可以有更多的自由并减少派生类的可访问性,这通常是有意义的。



-SA
What shall you do? You should fix it. If you derive some class from the class defined in the same assembly, you need to use the same access modifier as the one of the base class. Learn about access specifiers if you are still not confident with them:
http://msdn.microsoft.com/en-us/library/ms173121.aspx[^],
http://msdn.microsoft.com/en-us/library/wxh6fsc7.aspx[^].

If the base class you use is from the assembly other than the one of your derived class, you can have more freedom and reduce the accessibility of the derived class, which often make sense.

—SA


这篇关于这个错误我该怎么办?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆