Share via


ControlFlowBuilder.AddCatchRegion 方法

定義

新增 catch 區域。

public:
 void AddCatchRegion(System::Reflection::Metadata::Ecma335::LabelHandle tryStart, System::Reflection::Metadata::Ecma335::LabelHandle tryEnd, System::Reflection::Metadata::Ecma335::LabelHandle handlerStart, System::Reflection::Metadata::Ecma335::LabelHandle handlerEnd, System::Reflection::Metadata::EntityHandle catchType);
public void AddCatchRegion (System.Reflection.Metadata.Ecma335.LabelHandle tryStart, System.Reflection.Metadata.Ecma335.LabelHandle tryEnd, System.Reflection.Metadata.Ecma335.LabelHandle handlerStart, System.Reflection.Metadata.Ecma335.LabelHandle handlerEnd, System.Reflection.Metadata.EntityHandle catchType);
member this.AddCatchRegion : System.Reflection.Metadata.Ecma335.LabelHandle * System.Reflection.Metadata.Ecma335.LabelHandle * System.Reflection.Metadata.Ecma335.LabelHandle * System.Reflection.Metadata.Ecma335.LabelHandle * System.Reflection.Metadata.EntityHandle -> unit
Public Sub AddCatchRegion (tryStart As LabelHandle, tryEnd As LabelHandle, handlerStart As LabelHandle, handlerEnd As LabelHandle, catchType As EntityHandle)

參數

tryStart
LabelHandle

標記 try 區塊第一個指示的標籤。

tryEnd
LabelHandle

標記緊接在 try 區塊之後指示的標籤。

handlerStart
LabelHandle

標記處理常式第一個指示的標籤。

handlerEnd
LabelHandle

標記緊接在處理常式之後指示的標籤。

catchType
EntityHandle

要攔截的例外狀況類型:TypeDefinitionHandleTypeReferenceHandleTypeSpecificationHandle

例外狀況

與此建立器相關聯的指令編碼器未定義標籤。

-或-

catchType 不是有效的類型控制代碼。

標籤具有預設值。

適用於