Expression.MakeTry Methode

Definition

Erstellt einen TryExpression Try-Block mit den angegebenen Elementen.

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. Wenn NULL, textkörper und alle Handler identischen Typ aufweisen müssen.

body
Expression

Der Textkörper des Try-Blocks.

finally
Expression

Der Textkörper des letzten Blocks. Übergeben Sie NULL, wenn der Try-Block keinem endgültigen Block zugeordnet ist.

fault
Expression

Der Textkörper des Fehlerblocks. Übergeben Sie NULL, wenn dem Try-Block kein Fehlerblock zugeordnet ist.

handlers
IEnumerable<CatchBlock>

Eine Sammlung von CatchBlockZeichenfolgen, die die Catch-Anweisungen darstellen, die dem Try-Block zugeordnet werden sollen.

Gibt zurück

Die erstellte TryExpression.

Gilt für: