Expression.MakeTry Metod
Definition
Viktigt
En del information gäller för förhandsversionen av en produkt och kan komma att ändras avsevärt innan produkten blir allmänt tillgänglig. Microsoft lämnar inga garantier, uttryckliga eller underförstådda, avseende informationen som visas här.
Skapar ett TryExpression försöksblock som representerar ett försöksblock med de angivna 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
Parametrar
- type
- Type
Resultattypen för try-uttrycket. Om null måste brödtexten och alla hanterare ha identisk typ.
- body
- Expression
Brödtexten i try-blocket.
- finally
- Expression
Brödtexten i det sista blocket. Skicka null om try-blocket inte har något äntligen associerat block med det.
- fault
- Expression
Brödtexten i felblocket. Skicka null om try-blocket inte har något felblock associerat med det.
- handlers
- IEnumerable<CatchBlock>
En samling med CatchBlocks som representerar catch-uttrycken som ska associeras med try-blocket.
Returer
Den skapade TryExpression.