tailieunhanh - microsoft press windows workflow foundation step by step phần 5

Tham khảo tài liệu 'microsoft press windows workflow foundation step by step phần 5', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | 142 Part II Working with Activities 2. Click the View Fault Handlers button to activate the fault handlers visual designer. The View Fault Handlers button is the right button of the three-button group at the lower-left corner of the designer window. The designer should appear as you see here Workflow Exceptions laultHandlersActivityl I FaultHandlerActivity H. I - DiOp FaultHandlerActivit y Here 3. Select the FaultHandler activity from the Toolbox drag it over the workflow designer s fault handler surface and drop it between the blue arrows. Workflow Exceptions faultH andlersActi vityl Q Fault HandlerActiv. a Your designer surface should now look like this Workflow Exceptions o faultHandlersActivityl g H o . . J---------Ơ faultHandlerActivityl I. Drop Activities Here L X J s 4. As with other activities we have some properties to set to make this fault handler fully operational. The first property we ll set is the FaultType property. Select the FaultType Chapter 7 Basic Activity Operations 143 property in Visual Studio s Properties pane and click the browse button the button with the three dots to activate the Browse And Select A .NET Type dialog box. 5. With the Browse And Select A .NET Type dialog box active select the Type tab if it s not already selected and then expand the mscorlib tree node. From there select System for the System assembly and scroll down the resulting list in the right pane until you find the list item Exception in the Type Name column. Select this by clicking the Exception line in the right pane s ListView control. This places the text in the Type Name edit control. Click OK to accept as the exception type and dismiss the dialog box. You should find the value has been assigned to the FaultType property. 3 Note It s no coincidence that the exception we re asking this FaultHandler activity to use is the same as the exception type thrown by the Throw activity we used earlier in the chapter. They

TỪ KHÓA LIÊN QUAN