As with instance initialization, you can use the initializer syntax as an alternative to the static constructor.
和实例初始化一样,可以使用初始化器语法作为静态构造函数的变体。
To do this, add an instance of the offline service helper and an initialization method to the class you created previously as shown in listing 2.
要实现此目的,可以向之前所创建的类中添加离线服务帮助器的一个实例和一个初始化方法,如清单2所示。
Initialization occurs whenever you instantiate a new instance of a component.
初始化指组件新实例的初始化时刻。
The Log object could require its own initialization, to be performed by an init() instance method.
Log对象可以要求其自己的、由init()实例方法执行的初始化。
Its constructor takes two arguments: initialization properties and a pre-configured logger instance. Properties object contains the following.
其构造函数含有两个参数:初始化属性和预配置的记录器(logger)实例。
Create is called at the beginning of the instantiation phase and triggers the creation of a new business component instance and the initialization of needed resources.
Create在实例化的初始阶段调用,触发一个新业务组件示例的创建和所需资源的实例化。
Although no data was serialized, the sample must implement this method to cover the component initialization when the instance is created as part of a template.
尽管未对数据执行序列化,但是当作为模板的一部分创建实例时,样例必须实现这个方法来涵盖组件初始化。
You can create a TADDMApi instance with the Web service endpoint address as the initialization parameter.
您可以使用Web服务端点创建一个TADDMApi实例作为初始化参数。
Prior to starting a test, the information for creating the file should be specified and the PerformanceLogger INSTANCE initialized. The initialization code might look like this.
在开始一项测试之前,应该先指定创建文件的信息,并且初始化performancelogger INSTANCE。
Initialization occurs lazily, so creating an instance of the context is not enough to cause initialization to happen.
初始化是延迟加载的,所以创建一个实例的是不完全满足初始化发生的条件的。
When notified by this method, server controls must perform any initialization steps that are required to create and set up an instance.
当被这个方法通知时,伺服器控制项必须执行建立并设定执行个体所需的任何初始化步骤。
Server controls should perform any initialization steps that are required to create and set up an instance.
服务器控件应执行任何创建和设置实例所需的初始化步骤。
When you use an object initializer to create an instance of a named type, the default constructor for the class is called, followed by initialization of designated members in the order you specify.
当您使用物件初始设定式来建立具名型别的执行个体时,会呼叫类别的预设建构函式,接著按照您指定的顺序初始化指定的成员。
When you use an object initializer to create an instance of a named type, the default constructor for the class is called, followed by initialization of designated members in the order you specify.
当您使用物件初始设定式来建立具名型别的执行个体时,会呼叫类别的预设建构函式,接著按照您指定的顺序初始化指定的成员。
应用推荐