the pattern should be a static member in the class.
则模式应是类中的静态成员。
Using a static member through an instance variable should be discouraged.
不鼓励通过实例变量来使用静态成员。
In addition, Visual Basic.net allows you to touch a static member through an instance of a type, even a derived type, as you can see in the code in Figure 12.
另外,Visual Basic . NET允许您通过类型的实例、甚至派生类型的实例来触及静态成员,如图12中的代码所示。
Always provide a static constructor when providing static member variables.
当提供静态成员变量时,总是提供一个静态构造函数。
This is a static member that is invoked directly without creating an instance of the class.
这是一个静态成员,在未创建类的实例的情况下直接调用。
The static member is callable on a class even when no instance of the class has been created.
即使没有创建类的实例,也可以调用该类中的静态成员。
Only one copy of a static member exists, regardless of how many instances of the class are created.
无论对一个类创建多少个实例,它的静态成员都只有一个副本。
An assignment operator shall be implemented by a non-static member function with exactly one parameter.
赋值操作符应该实现为带一个参数的非静态成员函数。
When you have more complicated logic to initialize static member variables, create a static constructor.
当你有更复杂的逻辑来初始化静态成员变量时,请创建静态构造函数。
You know that you should initialize static member variables in a type before you create any instances of that type.
在创建一个类型的任何实例之前,应该初始化其中的静态成员变量。
If the function was intended to be a static member function, rename it so it doesn't conflict with the base class virtual function.
如果函数用作静态成员函数,则重命名该函数,以便不与基类虚函数冲突。
Static members are initialized before the static member is accessed for the first time and before the static constructor, if there is one, is called.
静态成员会在第一次受到存取前,以及静态建构函式(如果有)受到呼叫之前进行初始化。
Static members are initialized before the static member is accessed for the first time and before the static constructor, if there is one, is called.
静态成员会在第一次受到存取前,以及静态建构函式(如果有)受到呼叫之前进行初始化。
应用推荐