Expression.MakeTry Methode
Definitie
Belangrijk
Bepaalde informatie heeft betrekking op een voorlopige productversie die aanzienlijk kan worden gewijzigd voordat deze wordt uitgebracht. Microsoft biedt geen enkele expliciete of impliciete garanties met betrekking tot de informatie die hier wordt verstrekt.
Hiermee maakt u een TryExpression try-blok met de opgegeven 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
Parameters
- type
- Type
Het resultaattype van de try-expressie. Als null, hoofdtekst en alle handlers hetzelfde type moeten hebben.
- body
- Expression
De hoofdtekst van het try-blok.
- finally
- Expression
Het lichaam van het laatste blok. Geef null door als aan het try-blok geen definitief blok is gekoppeld.
- fault
- Expression
De hoofdtekst van het foutblok. Geef null door als aan het try-blok geen foutblok is gekoppeld.
- handlers
- IEnumerable<CatchBlock>
Een verzameling CatchBlockdie de catch-instructies vertegenwoordigt die aan het try-blok moeten worden gekoppeld.
Retouren
De gemaakte TryExpression.