We have a similar constructor in all our other widget classes so that we can find and construct any type of widget dynamically.
其他所有窗口小部件中都有相似的构造函数,以便动态查找和构造任何类型的窗口小部件。
But you cannot use a type parameter to access a constructor because, at compile time, you don't know what class is being constructed and therefore what constructors are available.
但是您不能使用类型参数访问构造函数,因为在编译的时候还不知道要构造什么类,因此也就不知道使用什么构造函数。
In Listing 3, the name and content type of the input document is specified by the constructor.
在清单3中,输入文档的名称和内容类型由构造函数指定。
This type actually defines the signature of a constructor for the specified class and a matching sequence of values.
该类型实际定义了指定用于类和值的匹配序列的构造器的签名。
The runtime will stop any exceptions trying to leave a type constructor and wrap the exception inside of a new TypeInitializationException object.
运行库将停止任何尝试保留类型构造函数的异常,并将该异常包装到一个新的TypeInitializationException对象内。
To instantiate a Dictionary object, you need to pass a type string and a DictionaryIO object to its constructor.
要实例化Dictionary对象,需要将类型字符串和DictionaryIO 对象传递给它的构造函数。
Without beforefieldinit, the runtime must run the type constructor at a precise time-just before the first access to static or instance fields and methods of the type.
如果没有beforefieldinit,运行库就必须在某个精确时间运行类型构造函数,即,恰好在第一次访问该类型的静态或实例字段和方法之前。
Figure 1 shows a constructor with two arguments of type Point and a destructor modeled for the DrawingSurface class of the sample application used here for illustration purposes.
图1展示了为示例应用程序(在这里用于举例)的drawingsurface类建模的带有两个Point类型参数的构造方法和一个析构方法。
As a concrete example, consider Listing 3, which declares a generic type Box and invokes the Box constructor.
作为具体示例,请考虑清单3,声明了通用类型Box并调用了Box结构函数。
The object sharedmem1 is of type shared_memory_object (declared and defined in Boost headers) and takes three arguments in its constructor
sharedmem1对象的类型是 shared_memory_object(在Boost头文件中声明并定义),它的构造函数有三个参数
Use assignment context, as in the simple scheme, and also use the type of constructor arguments (call this complex).
使用赋值上下文,如简单架构中那样,还使用构造函数参数的类型(称为复杂结构)。
When you want to create an atomic value of one of the time-oriented data types, use a type-constructor function and provide the string representation as an argument.
如果需要创建与时间相关的数据类型的单个值,可以使用类型构造器函数并提供时间的字符串表示形式作为参数。
Normally, the type checker ensures that these super-constructor calls will succeed by looking up the superclass and making sure that a matching super-constructor exists.
通常,通过查找超类并确保存在匹配的超级构造函数,类型检查器确保这些超级构造函数调用会成功。
The constructor function has no parameters and returns an instance of the type with all of its attributes set to null values.
构造函数没有参数,并且返回的类型实例中的所有属性都为空。
When you create a structured type, DB2 automatically creates a constructor function for the type and creates both mutator and observer methods for the attributes of the type.
当您创建结构化类型时,DB 2为类型自动创建一个构造函数,并为类型的属性创建mutator方法和observer方法。
The core of the listing is the defnode macro that takes a node type and a vector of field names, and creates a constructor function for creating maps of that type.
这个清单的核心是defnode宏,它获取一个节点类型和一个字段名矢量,并创建一个构造函数来创建该类型的映射。
When an explicit type constructor is present, the compilers will not mark the type with beforefieldinit, and the precise timing restrictions lead to the performance drop hinted at by FxCop.
当存在显式类型构造函数时,编译器不会用beforefieldinit标记该类型,精确的计时限制会导致FxCop所暗示的性能下降。
Initializers execute before the base class constructor for your type executes, and they are executed in the order the variables are declared in your class.
初始化器在基类构造函数执行前被执行,它们被执行的顺序就是在类里被声明的顺序。
Type parameters can also be declared within method and constructor signatures to create generic methods and generic constructors.
泛型参数也可以允许在方法和构造中定义,-这时方法和构造就被称之谓泛型方法和泛型参数。
The two constructors both need a reference of an object, and the second constructor needs one more, a parameter of boolean type to indicate whether we need to track the resurrection of the object.
此二构造函数都需要一个对象的引用,第二个构造函数还需要一个布尔值参数来表示我们是否需要跟踪对象的重生。
This essentially means locate the class type, allocate an object and run the specified constructor.
这实际上意味着查找类的类型,分配一个对象,并运行指定的构造方法。
The programming language compiler added a default static constructor to your type and did not make it private.
编程语言编译器已向您的类型中添加默认静态构造函数,但未将其设置为私有。
A constructor is a function you call to instantiate and initialize a particular type of object. You invoke a constructor with the new keyword. Here are a few examples of using constructors.
一个构造器是一个函数,你可以调用它实例化和初始化一个特殊的对象类型。
Creates an instance of the type whose name is specified in the specified remote domain, using the named assembly file and the constructor that best matches the specified parameters.
使用指定的程序集文件和与指定参数匹配程度最高的构造函数来创建指定名称的类型的实例。
The number, type, and order of elements in the parameters array should be identical to the number, type, and order of parameters for the constructor reflected by this instance.
参数阵列中元素的数目、型别和顺序应该和由这个执行个体所反映的建构函式参数的数目、型别和顺序相同。
When a struct contains a reference type as a member, the default constructor of the member must be invoked explicitly, otherwise the member remains unassigned and the struct cannot be used.
当结构包含引用类型作为成员时,必须显式调用该成员的默认构造函数,否则该成员将保持未赋值状态且该结构不可用。
A type that implements interfaces does not necessarily expose a constructor, and depending on the access level of a constructor, the code within the generic type might not be able to access it.
实现接口的类型不必公开构造函数,并且受构造函数的访问级别限制,泛型类型中的代码可能无法访问该构造函数。
Because public constructors create instances of a type, and you cannot create instances of an abstract type, an abstract type that has a public constructor is incorrectly designed.
因为公用建构函式会建立型别的执行个体,而且您无法建立抽象型别的执行个体,因此具有公用建构函式的抽象型别设计不正确。
Returns a runtime method handle for the method or constructor identified by the specified metadata token, specifying the generic type arguments of the type and method where the token is in scope.
返回由指定元数据标记标识的类型的运行时类型句柄,指定标记所在范围内的类型和方法的泛型类型参数。
Returns a runtime method handle for the method or constructor identified by the specified metadata token, specifying the generic type arguments of the type and method where the token is in scope.
返回由指定元数据标记标识的类型的运行时类型句柄,指定标记所在范围内的类型和方法的泛型类型参数。
应用推荐