How to hide classes to external namespaces? Something like the package-protected modifier in Java

Posted by devoured elysium on Stack Overflow See other posts from Stack Overflow or by devoured elysium
Published on 2010-05-02T22:52:08Z Indexed on 2010/05/02 22:58 UTC
Read the original article Hit count: 137

Filed under:
|

In java is easy to "hide" classes from outside your package(namespace), as you can define them as package-protected. There seems to be no equivalent keyword modifier in C#. Is there any way I could mimic that behaviour in C#? I have a couple of classes that I really wouldn't like the rest of the assembly to know of. It is ok for classes in the same namespace to know of, but I'd like them to be hidden from the rest of the library/application.

I know of the internal keyword, but that only hiddes classes if you try to access them from outside your assembly. That is not really my case, as I'd like to keep everything glued in just one .DLL/.EXE.

Thanks

© Stack Overflow or respective owner

Related posts about c#

Related posts about namespaces