Não foi possível encontrar esta entrada. Mostrando resultados aproximados. Verifique a ortografia ou proponha a adição deste termo ao dicionário.
静态构造函数
a static constructor is not allowed to have a member initializer list
静态构造函数不允许有成员初始值设定项列表
Listing 25 is an example of a class with a static constructor.
调用它。 一 个类只能有一个静态构造函数。
Use of the static constructor ensures that memory for the shared instance is not allocated until some portion of the application requires it.
使用静态构造函数可以确保在应用程序的某个部分需要该共享实例之前,不会为该实例分配内存。
A static readonly field cannot be assigned to (except in a static constructor or a variable initializer)
无法对静态只读字段赋值(在静态构造函数或变量初始值设定项中除外)
Initialize all static fields in {0} when those fields are declared and remove the explicit static constructor.
声明 {0} 中的静态字段时应初始化所有这些字段,并移除显式静态构造函数。
a static constructor may not be a member template
静态构造函数不能是成员模板
a static constructor must have private accessibility; changing to private access
静态构造函数必须具有专用可访问性;更改为专用访问
a static constructor may not have parameters
静态构造函数不能带有参数
Do not declare explicit static constructors on value types. Initializing static data in explicit static constructors results in a value type that is not marked in metadata as 'beforefieldinit'. In this case, the static constructor is not always guaranteed to be called before instance members on the value type are called.
Non-private static constructors can cause unexpected behaviors, particularly when executed multiple times. This violation can occur if a type declares static data but has not explicitly declared a static constructor. In this case, some compilers will generate an externally visible static constructor.
A static constructor can not be a parameterized constructor.
所以,我们最好给父类A提供一个无参数的构造函数。
A static constructor is used to initialize any static data, or to perform a particular action that needs performed once only.
静态构造函数是实现对一个类进行初始化的方法成员。 它一般用于对静态数据的初始化。
Conteúdo potencialmente sensível ou impróprio
Os exemplos servem apenas como ajuda na tradução da palavra ou da expressão procurada. Eles não são selecionados ou validados por nós e podem conter linguagem inapropriada. Pedimos que reporte exemplos que devem ser modificados ou que não devem ser exibidos. As traduções potencialmente sensivéis, impróprias ou coloquiais geralmente são marcadas em vermelho ou em laranja.