How to make a class member protected and internal? [duplicate]
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()
{
}
精彩评论