言語

Expression.MakeTry メソッド

定義

指定した要素を持つ try ブロックを表す TryExpression を作成します。

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

パラメーター

type
Type

try 式の結果の型。 null の場合、body とすべてのハンドラーは同じ型である必要があります。

body
Expression

try ブロックの本体。

finally
Expression

finally ブロックの本体。 try ブロックに finally ブロックが関連付けられていない場合は null を渡します。

fault
Expression

障害ブロックの本体。 try ブロックにエラー ブロックが関連付けられていない場合は null を渡します。

handlers
IEnumerable<CatchBlock>

try ブロックに関連付ける catch ステートメントを表す CatchBlockのコレクション。

返品

作成された TryExpression

適用対象