Prev | Current Page 382 | Next

Jon Skeet

"C# in Depth: What you need to master C# 2 and 3"

Stackbased
structures don??™t have this problem, of course.
I??™m not going to claim that fixed-size buffers are a hugely important feature in
C# 2??”at least, they??™re not important to most people. I??™ve included them for completeness,
however, and doubtless someone, somewhere will find them invaluable.
Our final feature can barely be called a C# 2 language feature at all??”but it just about
counts, so I??™ve included it for completeness.
7.7 Exposing internal members to selected assemblies
There are some features that are obviously in the language??”iterator blocks, for example.
There are some features that obviously belong to the runtime, such as JIT compiler
optimizations. There are some that clearly sit in both camps, like generics. This
last feature has a toe in each but is sufficiently odd that it doesn??™t merit a mention in
either specification. In addition, it uses a term that has different meanings in C++ and
VB.NET??”adding a third meaning to the mix. To be fair, all the terms are used in the
context of access permissions, but they have different effects.
7.7.1 Friend assemblies in the simple case
In .NET 1.1 it was entirely accurate to say that something defined to be internal
(whether a type, a method, a property, a variable, or an event) could only be
accessed within the same assembly in which it was declared.3 In .NET 2.0 that??™s still
mostly true, but there??™s a new attribute to let you bend the rules slightly: Internals-
VisibleToAttribute, usually referred to as just InternalsVisibleTo.


Pages:
370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394