Expression.MakeTry Methode

Definition

Erstellt eine TryExpression, die einen Try-Block mit den angegebenen Elementen darstellt.

public:
 static System::Linq::Expressions::TryExpression ^ MakeTry(Type ^ type, System::Linq::Expressions::Expression ^ body, System::Linq::Expressions::Expression ^ finally, System::Linq::Expressions::Expression ^ fault, System::Collections::Generic::IEnumerable<System::Linq::Expressions::CatchBlock ^> ^ handlers);
public static System.Linq.Expressions.TryExpression MakeTry (Type type, System.Linq.Expressions.Expression body, System.Linq.Expressions.Expression finally, System.Linq.Expressions.Expression fault, System.Collections.Generic.IEnumerable<System.Linq.Expressions.CatchBlock> handlers);
public static System.Linq.Expressions.TryExpression MakeTry (Type? type, System.Linq.Expressions.Expression body, System.Linq.Expressions.Expression? finally, System.Linq.Expressions.Expression? fault, System.Collections.Generic.IEnumerable<System.Linq.Expressions.CatchBlock>? handlers);
static member MakeTry : Type * System.Linq.Expressions.Expression * System.Linq.Expressions.Expression * System.Linq.Expressions.Expression * seq<System.Linq.Expressions.CatchBlock> -> System.Linq.Expressions.TryExpression
Public Shared Function MakeTry (type As Type, body As Expression, finally As Expression, fault As Expression, handlers As IEnumerable(Of CatchBlock)) As TryExpression

Parameter

type
Type

Der Ergebnistyp des Try-Ausdrucks. Bei NULL müssen Text und alle Handler vom selben Typ sein.

body
Expression

Der Text des Try-Blocks.

finally
Expression

Der Text des Finally-Blocks. Übergeben Sie NULL, wenn dem Try-Block kein Finally-Block zugeordnet ist.

fault
Expression

Der Text des Fault-Blocks. Übergeben Sie NULL, wenn dem Try-Block kein Fault-Block zugeordnet ist.

handlers
IEnumerable<CatchBlock>

Eine Auflistung von CatchBlocks, die die dem Try-Block zugeordneten Catch-Anweisungen darstellen.

Gibt zurück

Der erstellte TryExpression.

Gilt für: