这个建构函式允许初始化事件资料。
这个属性在建构函式中设定。
静态类别和结构也可以拥有建构函式。
以下是一个类别使用私用建构函式的范例。
The following is an example of a class using a private constructor.
请注意,原始程序码中没有预设建构函式。
Notice that there is no default constructor in the source code.
基底类别的建构函式必须在衍生类别中呼叫。
The constructor for the base class must be called in the derived class.
空的建构函式宣告防止自动产生预设建构函式。
The declaration of the empty constructor prevents the automatic generation of a default constructor.
静态建构函式并不使用存取修饰词,也没有参数。
A static constructor does not take access modifiers or have parameters.
使用者无法控制程序中静态建构函式执行的时间。
The user has no control on when the static constructor is executed in the program.
否则当您尝试使用建构函式时,会掷回例外状况。
If you do, an exception is thrown when you try to use the constructor.
每当建立类别或结构时,就会呼叫它的建构函式。
Whenever a class or struct is created, its constructor is called.
这个呼叫所传回的方法阵列中并不包含建构函式。
Constructors are not included in the array of methods returned by this call.
转换运算子和建构函式已经定义为产生相同的转换。
A conversion operator and a constructor have been defined making the same conversion.
例如,属性无法在建构函式的初始化清单中初始化。
A property cannot be initialized, for example, in a constructor's initialization list.
或是可以在所有建构函式呼叫的初始设定方法中宣告。
Or you could declare it in an initialization method that is called by all constructors.
读取伫列时,最常用的是具有目标型别参数的建构函式。
The constructors with target type parameters are most frequently used when reading from the queue.
否则,新项目也可以透过其公用预设建构函式自动建立。
Otherwise, the new item is automatically created through its public default constructor.
平台叫用无法用于依照值传回包含建构函式的结构或类别。
Platform invoke cannot be used to return structures or classes by value if they contain a constructor.
当您想要传递错误讯息给使用者时,可以使用此建构函式。
Use this constructor when you want to pass an error message to the user.
取得或设定值,指出型别参数是否具有建构函式条件约束。
Gets or sets a value indicating whether the type parameter has a constructor constraint.
描述动态类别之建构函式的定义、所用的属性,以及其限制。
Describes the definition of constructors for dynamic classes, the attributes used, and limitations.
如果您为动态型别定义了建构函式,则不会提供预设建构函式。
If you define a constructor for your dynamic type, a default constructor is not provided.
执行个体建构函式也可以用来呼叫基底类别的执行个体建构函式。
Instance constructors can also be used to call the instance constructors of base classes.
这可用来建立完整的功能表结构,并指派到功能表项目的建构函式。
This enables you to create complete menu structures and assign them to the constructor for the menu item.
在这种情况下,应用程序可以使用其中一个接受识别项值的建构函式。
In this case, the application can use one of the constructors that takes an identifier value.
当阵列在建构函式的成员初始设定清单中时,阵列元素将预设为初始化。
When an array is in a constructor's member initialization list, the elements of the array will be default initialized.
这些引数也称为位置引数,因为它们会当做位置参数提供给属性建构函式。
These are also known as positional arguments because they are supplied to attribute constructors as positional parameters.
此规则会检查每个建构函式参数,以查看您是否已为它们定义对应的属性。
This rule checks that for each constructor parameter, you have defined the corresponding property.
如果其他建构函式在此存取任何成员或呼叫成员函式,结果会是未定义的。
If those other constructors access any members or call member functions on this, the result will be undefined.
因此,如果您的提供者控制项有多个回呼方法,这个建构函式多载会很有用。
Therefore, this overload of the constructor is useful if you have multiple callback methods in your provider control.
应用推荐