开发者

How to make a class member protected and internal? [duplicate]

This question already has answers here: Closed 11 years ago.

Possible Duplicate:

How to make prot开发者_运维百科ected AND internal?

i.e. it is an internal member, and can only be accessed from a class deriving from this class.


All these answers are backwards: protected internal is available to derived classes OR other objects in the same (or InternalsVisibleTo) assembly. What you want is not possible and as Eric Lippert points out, not really useful, or at the least, something you shouldn't expect anytime soon: http://blogs.msdn.com/b/ericlippert/archive/2008/04/24/why-can-t-i-access-a-protected-member-from-a-derived-class-part-three.aspx


using protected internal Access Modifier - http://msdn.microsoft.com/en-us/library/ms173121.aspx


there is a protected internal access identifier. You can use that.


Just use both access specifiers..

    protected internal void method()
    {
    }
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜