Hi:
Is there an equivalent instruction to a 'friend' class in C++ available
under C#?
I have a class that I want, basically, readonly access to, except for
one class that would have total access to all its fields, public and
private.
TIA,
MartinH.
Oliver Sturm - 29 Jul 2005 11:09 GMT
> Is there an equivalent instruction to a 'friend' class in C++ available
> under C#?
Not in C# 1, but in C# 2 you can use the InternalsVisibleToAttribute to
do a similar thing, at least for some purposes. See the MSDN docs here:
http://tinyurl.com/88s8e
Oliver Sturm

Signature
omnibus ex nihilo ducendis sufficit unum
Spaces inserted to prevent google email destruction:
MSN oliver @ sturmnet.org Jabber sturm @ amessage.de
ICQ 27142619 http://www.sturmnet.org/blog
Martin Hart - 29 Jul 2005 11:25 GMT
Oliver:
Very interesting, we are currently planning the migration to .NET 2,
this is just another argument to do so.
Thanks for your insight and sharing your knowledge.
Regards,
Martin.
Oliver Sturm escribió:
>> Is there an equivalent instruction to a 'friend' class in C++
>> available under C#?
[quoted text clipped - 5 lines]
>
> Oliver Sturm
Lloyd Dupont - 29 Jul 2005 14:54 GMT
there is also another option 1.0 & + option
the 'internal' protection attributes make all your whatever accessible to
anything in the same assembly.

Signature
There are 10 kinds of people in this world. Those who understand binary and
those who don't.
> Hi:
>
[quoted text clipped - 6 lines]
> TIA,
> MartinH.