Sign in to follow this  

C# Class visibility question

This topic is 3626 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
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

This topic is 3626 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this