次の方法で共有


CodeTypeParameter.HasConstructorConstraint プロパティ

定義

型パラメーターにコンストラクター制約があるかどうかを示す値を取得または設定します。

public:
 property bool HasConstructorConstraint { bool get(); void set(bool value); };
public bool HasConstructorConstraint { get; set; }
member this.HasConstructorConstraint : bool with get, set
Public Property HasConstructorConstraint As Boolean

プロパティ値

true 型パラメーターにコンストラクター制約がある場合。それ以外の場合は false。 既定値は、false です。

次のコード例は、型パラメーターにコンストラクター制約があるかどうかを判断する際に、 HasConstructorConstraint プロパティを使用する方法を示しています。 この例は、 CodeTypeParameter クラスに提供されるより大きな例の一部です。

kType.HasConstructorConstraint = true;
kType.HasConstructorConstraint = True

注釈

コンストラクター制約は、型パラメーターが既定のパブリック コンストラクター (パラメーターのないパブリック コンストラクター) を公開することをコンパイラに示します。

適用対象