0

Possible Duplicate:
What is the difference between ‘protected’ and ‘protected internal’?

I have seen a lot of controversy over the true meaning of declaring a member protected internal.

Under this context is the member's access modifier either "protected or internal" or "protected and internal"?

Community
  • 1
  • 1
JBone
  • 3,163
  • 11
  • 36
  • 47

1 Answers1

2

The documentation is clear that it is "protected or internal".

That is - a member is accessible both within the assembly and any subtype.

protected internal The type or member can be accessed by any code in the assembly in which it is declared, or from within a derived class in another assembly. Access from another assembly must take place within a class declaration that derives from the class in which the protected internal element is declared, and it must take place through an instance of the derived class type.

Oded
  • 489,969
  • 99
  • 883
  • 1,009
  • 1
    "The documentation is clear"...but i saw that ninja edit where you switched "and" to "or". :) – cHao Oct 18 '12 at 13:50
  • ...if you inherit from the class, into a different assembly, you will not have access to the member, even though it is protected. – Steve Wellens Oct 18 '12 at 13:50
  • @cHao - Aye. [Dangers of copy-paste](http://stackoverflow.com/q/2490884/1583) :( – Oded Oct 18 '12 at 13:52