CodeTypeParameter.HasConstructorConstraint Property

Gets or sets a value indicating whether the type parameter has a constructor constraint.

Namespace: System.CodeDom
Assembly: System (in system.dll)

public bool HasConstructorConstraint { get; set; }
/** @property */
public boolean get_HasConstructorConstraint ()

/** @property */
public void set_HasConstructorConstraint (boolean value)

public function get HasConstructorConstraint () : boolean

public function set HasConstructorConstraint (value : boolean)

Not applicable.

Property Value

true if the type parameter has a constructor constraint; otherwise, false. The default is false.

A constructor constraint indicates to the compiler that the type parameter exposes a default public constructor (a public constructor with no parameters).

The following code example shows the use of the HasConstructorConstraint property in determining if the type parameter has a constructor constraint. This example is part of a larger example provided for the CodeTypeParameter class.

kType.HasConstructorConstraint = true;

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0