指定初始化方法 (designated initializer)就是指能确保所有实例变量都能被初始化的方法, 这种方法是初始化的核心,类的非初始化方法会调用指定初始化方法完成初始化。
基于20个网页-相关网页
方法. validate要做进一步的检查,以确保初始化实例所用的对象属于. _ order中指定的相应类。
The method.validate performs some further checks to make sure that the objects the instance was initialized with belong to the corresponding classes specified in._order.
清单 1 中显示了 onLoad 方法的代码片段,它指定该方法初始化和加载 iWidget 操作所需的所有依赖项。
The code snippet shown in Listing 1 for the onLoad method specifies that this method initializes and loads all dependencies that are required for the operation of the iWidget.
一般的XAML规则是类型不按照初始化文本(或由XAML 2009年度的工厂方法)传递的成员必须能够以任意顺序指定。
The general XAML rule is that members of a type that are not passed as initialization text (or by a factory method in XAML 2009) must be able to be assigned in any order.
应用推荐