Re: C# 2.0 Language Enhancements
От: TK Лес кывт.рф
Дата: 21.06.05 12:01
Оценка: 13 (3)
Hello, "Smarty"
>
> 1. Friend assemblies
> Provides access to non-public types
> Declared with InternalsVisibleToAttribute
>
> 2. Fixed size buffers
> Allows fixed-size struct with embedded array
>

fixed позволяет сохранить данные внутри структуры, а не по ссылке.
public struct MyArray // This code must appear in an unsafe block
{
    public fixed char pathName[128]; // это будет не ссылка, а inplace 
массив в структуре
}



> 3. Additional extern functionality

> Use different versions of same component within a single assembly
>

Например, у тебя есть две сборки и в каждой сборке есть класс с именем
SomeAssembly.MyClass сейчас компилятор не даст использовать эти два класса в
одном проекте (имя-то одинаковое). Новый вариант extern позволяет это
делать.

To reference two assemblies with the same fully-qualified type names, an
alias must be specified on the command line, as follows:
/r:GridV1=grid.dll

/r:GridV2=grid20.dll

This creates the external aliases GridV1 and GridV2. To use these aliases
from within a program, reference them using the extern keyword. For example:

extern alias GridV1;

extern alias GridV2;

In the above example, GridV1::Grid would be the grid control from grid.dll,
and GridV2::Grid would be the grid control from grid20.dll.

> Ну с номером 1 усе ясно. Но о чем говорится в пп. 2 и 3??
Posted via RSDN NNTP Server 1.9
Если у Вас нет паранойи, то это еще не значит, что они за Вами не следят.
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.