Equivalent of the C++ "friend" class modifier

  • Thread starter Thread starter Quimbly
  • Start date Start date
Q

Quimbly

Is there such a thing in C#?

I know of the
internal
class modifier, but I want to grant "friend"-like access to a
particular class from a different assembly. The reasons why I need
this are long an involved, and the company I work for won't budge on
the issue, so I need to find a way to make this work.

Any ideas?

Thanks.
 
"internal" is similar to "friend", only difference is that internal can't
specify which classes have access, like friend can.
 
Not according to this :
http://msdn.microsoft.com/library/d...ro7/html/vxorilanguageequivalentskeywords.asp

One thing you could do, if you have access to both assemblies, is to create
a public class in the one you need access TO, and then use that as a
doorway. That would of course mean that everybody can get access to the
internal class, but if the company won't budge you don't have many options
that I can see.

Steve

Quimbly said:
Is there such a thing in C#?

I know of the
internal
class modifier, but I want to grant "friend"-like access to a
particular class from a different assembly. The reasons why I need
this are long an involved, and the company I work for won't budge on
the issue, so I need to find a way to make this work.

Any ideas?

Thanks.
 
this are long an involved, and the company I work for won't budge on
the issue, so I need to find a way to make this work.

They'd better get over it, because with reflection in trusted code the
access modifiers don't mean jack.
 
Back
Top