CodeParameterDeclarationExpression Constructors

Definition

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Initializes a new instance of the CodeParameterDeclarationExpression class.

Overloads

CodeParameterDeclarationExpression()

Initializes a new instance of the CodeParameterDeclarationExpression class.

CodeParameterDeclarationExpression(CodeTypeReference, String)

Initializes a new instance of the CodeParameterDeclarationExpression class using the specified parameter type and name.

CodeParameterDeclarationExpression(String, String)

Initializes a new instance of the CodeParameterDeclarationExpression class using the specified parameter type and name.

CodeParameterDeclarationExpression(Type, String)

Initializes a new instance of the CodeParameterDeclarationExpression class using the specified parameter type and name.

CodeParameterDeclarationExpression()

Source:
CodeParameterDeclarationExpression.cs
Source:
CodeParameterDeclarationExpression.cs
Source:
CodeParameterDeclarationExpression.cs
Source:
CodeParameterDeclarationExpression.cs
Source:
CodeParameterDeclarationExpression.cs

Initializes a new instance of the CodeParameterDeclarationExpression class.

C#
public CodeParameterDeclarationExpression();

Applies to

.NET 10 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

CodeParameterDeclarationExpression(CodeTypeReference, String)

Source:
CodeParameterDeclarationExpression.cs
Source:
CodeParameterDeclarationExpression.cs
Source:
CodeParameterDeclarationExpression.cs
Source:
CodeParameterDeclarationExpression.cs
Source:
CodeParameterDeclarationExpression.cs

Initializes a new instance of the CodeParameterDeclarationExpression class using the specified parameter type and name.

C#
public CodeParameterDeclarationExpression(System.CodeDom.CodeTypeReference type, string name);

Parameters

type
CodeTypeReference

An object that indicates the type of the parameter to declare.

name
String

The name of the parameter to declare.

Applies to

.NET 10 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

CodeParameterDeclarationExpression(String, String)

Source:
CodeParameterDeclarationExpression.cs
Source:
CodeParameterDeclarationExpression.cs
Source:
CodeParameterDeclarationExpression.cs
Source:
CodeParameterDeclarationExpression.cs
Source:
CodeParameterDeclarationExpression.cs

Initializes a new instance of the CodeParameterDeclarationExpression class using the specified parameter type and name.

C#
public CodeParameterDeclarationExpression(string type, string name);

Parameters

type
String

The type of the parameter to declare.

name
String

The name of the parameter to declare.

Remarks

If the type parameter references a generic type, it must follow the syntax conventions for generic types. Generic types are formatted as follows: the name of the type, followed by a grave accent ("`"), followed by a count of the generic type arguments, followed by the parameters delimited with brackets.

Note

You must use square brackets ([]) and not the C# angle brackets (<>) to delimit generic parameters.

To avoid the possibility of making a syntactic mistake, consider using the CodeParameterDeclarationExpression(Type, String) constructor that takes a type instead of a string as a parameter.

Applies to

.NET 10 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

CodeParameterDeclarationExpression(Type, String)

Source:
CodeParameterDeclarationExpression.cs
Source:
CodeParameterDeclarationExpression.cs
Source:
CodeParameterDeclarationExpression.cs
Source:
CodeParameterDeclarationExpression.cs
Source:
CodeParameterDeclarationExpression.cs

Initializes a new instance of the CodeParameterDeclarationExpression class using the specified parameter type and name.

C#
public CodeParameterDeclarationExpression(Type type, string name);

Parameters

type
Type

The type of the parameter to declare.

name
String

The name of the parameter to declare.

Applies to

.NET 10 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10