There is no such thing as friendship in C#. The closest you can come is to use the internal modifier. Internal variables are public within the assembly, but private or protected outside the assembly.
Of course, if friendship is necessary, C++ compiles to the CLR as well. :-) Peter > -----Original Message----- > From: David Ferguson [mailto:[EMAIL PROTECTED]] > Posted At: Monday, May 06, 2002 10:05 AM > Posted To: DOTNET > Conversation: [DOTNET] How do you declare friendship in C#? > Subject: [DOTNET] How do you declare friendship in C#? > > How do you declare friendship in C#? > > In C++ I am use assigning friendship to other classes like this: > > class Child; > > class Parent > { > friend Child; > ... > }; > > Now the class Child can access all of the private fields of Parent. > I have poured over the C# documentation and can't see how to do > this in C#. > > Thanks...David > > You can read messages from the DOTNET archive, unsubscribe from DOTNET, or > subscribe to other DevelopMentor lists at http://discuss.develop.com. You can read messages from the DOTNET archive, unsubscribe from DOTNET, or subscribe to other DevelopMentor lists at http://discuss.develop.com.