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 de tentativa. Se nulo, corpo e todos os tratadores devem ter o mesmo tipo.

body
Expression

O corpo do bloqueio de ensaio.

finally
Expression

O corpo do bloco final. Passe nulo se o bloco try não tiver um bloqueio finally associado a ele.

fault
Expression

O corpo do bloco de falha. Passe nulo se o bloco try não tiver bloqueio de falha associado.

handlers
IEnumerable<CatchBlock>

Uma coleção de CatchBlocks representando as instruções de captura a associar ao bloco try.

Devoluções

O criou TryExpression.

Aplica-se a