Partilhar via


Expression.MakeTry Método

Definição

Cria um TryExpression que representa um bloco try com os 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

O tipo de resultado da expressão try. Se for null, o corpo e todos os manipuladores devem ter tipo idêntico.

body
Expression

O corpo do bloco try.

finally
Expression

O corpo do bloco finally. Passe null se o bloco try não tem bloco finally associado a ele.

fault
Expression

O corpo do bloco de falha. Passe null se o bloco try não tem bloco fault associado a ele.

handlers
IEnumerable<CatchBlock>

Uma coleção de CatchBlocks representando as instruções catch a serem associados com o bloco try.

Retornos

O TryExpression criado.

Aplica-se a