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.
初始化指组件新实例的初始化时刻。
应用推荐