类型构造函数也称为类型初始值设定项。
类型在两种情况下会获取类型初始值设定项。
第二种情况是,类型具有一个用于静态字段的初始值设定项,在这种情况下,编译器会在后台添加类型构造函数。
The second scenario is when a type has a initializer for a static field, in which case the compiler adds a type constructor behind the scenes.
数值初始值设定项现在可支持类型引用,这样大大减少了代码量。
Array initializers now support type inference, significantly reducing the amount of code that needs to be typed.
此程序还演示了静态字段初始值设定项如何在显式类型构造函数中的代码之前执行。
This program also demonstrates how static field initializers execute before the code inside an explicit type constructor.
正如您在前面看到的那样,静态字段初始值设定项的代码在隐式类型构造函数的内部执行。
As you saw earlier, the code for a static field initializer executes inside an implicit type constructor.
用于声明匿名类型实例的格式类似于在使用对象初始值设定项声明命名类型实例时使用的格式。
The format you use to declare an instance of an anonymous type resembles the format you use when you declare an instance of a named type by using an object initializer.
编译器使用变量的初始值设定项,在编译时确定变量的类型,以生成早期绑定代码。
The compiler USES a variable's initializer to determine the variable's type at compile time to produce early-bound code.
此错误指示您尝试在泛型类型中修改初始值设定项。
This error indicates that you tried to modify an initializer in a generic type.
以声明方式初始化类型的对象,而无需显式调用该类型的构造函数,您可以使用对象初始值设定项。
You can use object initializers to initialize type objects in a declarative manner without explicitly invoking a constructor for the type.
匿名类型必须用对象初始值设定项加以声明。
Anonymous types must be declared with an object initializer.
查询表达式经常使用匿名类型,而这些类型只能使用对象初始值设定项进行初始化。
Query expressions make frequent use of anonymous types, which can only be initialized with an object initializer.
查询表达式经常使用匿名类型,而这些类型只能使用对象初始值设定项进行初始化。
Query expressions make frequent use of anonymous types, which can only be initialized with an object initializer.
应用推荐