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);
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, body y todos los controladores deben tener un tipo idéntico.

body
Expression

Cuerpo del bloque try.

finally
Expression

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

fault
Expression

Cuerpo del bloque de error. Pase null si el bloque try no tiene ningún bloque de error asociado.

handlers
IEnumerable<CatchBlock>

Colección de CatchBlocks que representa las instrucciones catch que se van a asociar al bloque try.

Devoluciones

Objeto creado TryExpression.

Se aplica a