Expression.MakeTry Método

Definición

Crea un objeto TryExpression que representa un bloque try con los elementos especificados.

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

Parámetros

type
Type

Tipo de resultado de la expresión try. Si es null, el cuerpo y todos los controladores deben tener un tipo idéntico.

body
Expression

Cuerpo del bloque try.

finally
Expression

Cuerpo del bloque finally. Pasa null si el bloque try no tiene ningún bloque finally asociado.

fault
Expression

Cuerpo del bloque fault. Pasa null si el bloque try no tiene ningún bloque fault asociado.

handlers
IEnumerable<CatchBlock>

Colección de objetos CatchBlock que representa las instrucciones Catch que se van a asociar al bloque try.

Devoluciones

Objeto TryExpression creado.

Se aplica a