Прочетете на английски Редактиране

Споделяне чрез


CodeConditionStatement Constructors

Definition

Initializes a new instance of the CodeConditionStatement class.

Overloads

CodeConditionStatement()

Initializes a new instance of the CodeConditionStatement class.

CodeConditionStatement(CodeExpression, CodeStatement[])

Initializes a new instance of the CodeConditionStatement class using the specified condition and statements.

CodeConditionStatement(CodeExpression, CodeStatement[], CodeStatement[])

Initializes a new instance of the CodeConditionStatement class using the specified condition and statements.

CodeConditionStatement()

Source:
CodeConditionStatement.cs
Source:
CodeConditionStatement.cs
Source:
CodeConditionStatement.cs
Source:
CodeConditionStatement.cs
Source:
CodeConditionStatement.cs

Initializes a new instance of the CodeConditionStatement class.

C#
public CodeConditionStatement();

Applies to

.NET 10 (package-provided) и други версии
Продукт Версии
.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

CodeConditionStatement(CodeExpression, CodeStatement[])

Source:
CodeConditionStatement.cs
Source:
CodeConditionStatement.cs
Source:
CodeConditionStatement.cs
Source:
CodeConditionStatement.cs
Source:
CodeConditionStatement.cs

Initializes a new instance of the CodeConditionStatement class using the specified condition and statements.

C#
public CodeConditionStatement(System.CodeDom.CodeExpression condition, params System.CodeDom.CodeStatement[] trueStatements);

Parameters

condition
CodeExpression

A CodeExpression that indicates the expression to evaluate.

trueStatements
CodeStatement[]

An array of type CodeStatement containing the statements to execute if the condition is true.

See also

Applies to

.NET 10 (package-provided) и други версии
Продукт Версии
.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

CodeConditionStatement(CodeExpression, CodeStatement[], CodeStatement[])

Source:
CodeConditionStatement.cs
Source:
CodeConditionStatement.cs
Source:
CodeConditionStatement.cs
Source:
CodeConditionStatement.cs
Source:
CodeConditionStatement.cs

Initializes a new instance of the CodeConditionStatement class using the specified condition and statements.

C#
public CodeConditionStatement(System.CodeDom.CodeExpression condition, System.CodeDom.CodeStatement[] trueStatements, System.CodeDom.CodeStatement[] falseStatements);

Parameters

condition
CodeExpression

A CodeExpression that indicates the condition to evaluate.

trueStatements
CodeStatement[]

An array of type CodeStatement containing the statements to execute if the condition is true.

falseStatements
CodeStatement[]

An array of type CodeStatement containing the statements to execute if the condition is false.

See also

Applies to

.NET 10 (package-provided) и други версии
Продукт Версии
.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