Jump to content
  • Advertisement
Sign in to follow this  
d000hg

C# Class visibility question

This topic is 3878 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

If you declare a class as internal in C#, it is only visible within that namespace... but does that mean child namespaces can't see it? Say I have namespace my.name.space containing interface IFoo, and I want to put implementations of IFoo in my.name.space.foo, and IFoo and it's implementations are only used by classes within my.name.space. Is there a way to do this? Or do the two namespaces count as unrelated to C#?

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by d000hg
If you declare a class as internal in C#, it is only visible within that namespace... but does that mean child namespaces can't see it?



This is incorrect. internal restricts visibility to the assembly not the namespace. As long as your interface/classes are within the same assembly (MSVC project), you're good to go.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!