อ่านในภาษาอังกฤษ แก้ไข

แชร์ผ่าน


IActivityTemplateFactory.Create(DependencyObject) Method

Definition

Creates an instance of the Activity class that represents a predefined design pattern for the specified target object.

C#
public System.Activities.Activity Create(System.Windows.DependencyObject target);

Parameters

target
DependencyObject

The dependency object used by this instance of an IActivityTemplateFactory.

Returns

A workflow Activity.

Examples

Create a template that configures a Delay activity with a duration of ten seconds.

C#
public sealed class MyDelayActivity : IActivityTemplateFactory  

{  
     public Activity Create(DependencyObject target)  
     {  
         return new System.Activities.Statements.Delay  
         {  
             DisplayName = "DelayActivityTemplate",  
             Duration = new TimeSpan(0,0,10)  

         };  
     }  
 }  

Remarks

Use this to create and configure the activity instances used in a custom activity template.

Applies to

ผลิตภัณฑ์ เวอร์ชัน
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1