Activity 類別

定義

警告

The System.Workflow.* types are deprecated. Instead, please use the new types from System.Activities.*

表示工作流程的基本建置組塊。 Activity 是所有活動的基類。

public ref class Activity : System::Workflow::ComponentModel::DependencyObject
[System.Drawing.ToolboxBitmap(typeof(System.Workflow.ComponentModel.Activity), "Design.Resources.Activity.png")]
[System.Workflow.ComponentModel.Compiler.ActivityCodeGenerator(typeof(System.Workflow.ComponentModel.Compiler.ActivityCodeGenerator))]
[System.Workflow.ComponentModel.Compiler.ActivityValidator(typeof(System.Workflow.ComponentModel.Compiler.ActivityValidator))]
[System.Workflow.ComponentModel.Serialization.RuntimeNameProperty("Name")]
public class Activity : System.Workflow.ComponentModel.DependencyObject
[System.Drawing.ToolboxBitmap(typeof(System.Workflow.ComponentModel.Activity), "Design.Resources.Activity.png")]
[System.Workflow.ComponentModel.Compiler.ActivityCodeGenerator(typeof(System.Workflow.ComponentModel.Compiler.ActivityCodeGenerator))]
[System.Workflow.ComponentModel.Compiler.ActivityValidator(typeof(System.Workflow.ComponentModel.Compiler.ActivityValidator))]
[System.Workflow.ComponentModel.Serialization.RuntimeNameProperty("Name")]
[System.Obsolete("The System.Workflow.* types are deprecated.  Instead, please use the new types from System.Activities.*")]
public class Activity : System.Workflow.ComponentModel.DependencyObject
[<System.Drawing.ToolboxBitmap(typeof(System.Workflow.ComponentModel.Activity), "Design.Resources.Activity.png")>]
[<System.Workflow.ComponentModel.Compiler.ActivityCodeGenerator(typeof(System.Workflow.ComponentModel.Compiler.ActivityCodeGenerator))>]
[<System.Workflow.ComponentModel.Compiler.ActivityValidator(typeof(System.Workflow.ComponentModel.Compiler.ActivityValidator))>]
[<System.Workflow.ComponentModel.Serialization.RuntimeNameProperty("Name")>]
type Activity = class
    inherit DependencyObject
[<System.Drawing.ToolboxBitmap(typeof(System.Workflow.ComponentModel.Activity), "Design.Resources.Activity.png")>]
[<System.Workflow.ComponentModel.Compiler.ActivityCodeGenerator(typeof(System.Workflow.ComponentModel.Compiler.ActivityCodeGenerator))>]
[<System.Workflow.ComponentModel.Compiler.ActivityValidator(typeof(System.Workflow.ComponentModel.Compiler.ActivityValidator))>]
[<System.Workflow.ComponentModel.Serialization.RuntimeNameProperty("Name")>]
[<System.Obsolete("The System.Workflow.* types are deprecated.  Instead, please use the new types from System.Activities.*")>]
type Activity = class
    inherit DependencyObject
Public Class Activity
Inherits DependencyObject
繼承
衍生
屬性

備註

Note

此數據會討論已過時的類型和命名空間。 欲了解更多資訊,請參閱 Windows Workflow Foundation 4.5 中的 Deprecated Types。

An Activity 是工作流程的基本建構組件。 An Activity 定義一組屬性與事件,例如任何類別,以及定義該活動執行時行為的執行邏輯。 一組額外的元件可以與 相關聯。Activity 這些包括但不限於驗證器、程式碼產生器、自訂序列化器以及設計器。

所有活動共享基 Activity 底類別定義的共同屬性集合。 每個類別 Activity 可依其需求宣告額外性質,透過擴充此類別。 由於 Activity 源自 DependencyObject,屬性可定義為標準 CLR 性質與依賴性質。

執行 Activity 邏輯滿足了與工作流程 Activity 執行時間之間的契約。 你必須以功能層面記錄任何 Activity 執行邏輯,讓使用該 Activity 流程的開發者知道它的行為。 執行邏輯本身對工作流開發者隱藏,因為執行邏輯是工作流執行時 Activity與 . 之間嚴格存在的合約的一部分。

建構函式

名稱 Description
Activity()
已淘汰.

初始化 Activity 類別的新執行個體。

Activity(String)
已淘汰.

初始化類別的新實例 Activity ,同時初始化 Name

欄位

名稱 Description
ActivityContextGuidProperty
已淘汰.

DependencyProperty代表GuidActivityExecutionContext與 相關聯Activity的 。

CancelingEvent
已淘汰.

代表針對該DependencyProperty事件的目標Canceling

ClosedEvent
已淘汰.

代表針對該DependencyProperty事件的目標Closed

CompensatingEvent
已淘汰.

代表針對該DependencyProperty事件的目標Compensating

ExecutingEvent
已淘汰.

代表針對DependencyProperty該事件的 ,Executing該事件發生於執行該活動時。

FaultingEvent
已淘汰.

DependencyProperty代表事件。Faulting

StatusChangedEvent
已淘汰.

代表針對該DependencyProperty事件的目標StatusChanged

屬性

名稱 Description
Description
已淘汰.

取得或設定 Activity的使用者定義描述。

DesignMode
已淘汰.

取得值,這個值表示這個實例處於設計或運行時間模式。

(繼承來源 DependencyObject)
Enabled
已淘汰.

取得或設定值,這個值表示是否啟用這個實例來執行和驗證。

ExecutionResult
已淘汰.

取得上次執行這個實例之嘗試 ActivityExecutionResult

ExecutionStatus
已淘汰.

取得這個實例目前的 ActivityExecutionStatus

IsDynamicActivity
已淘汰.

取得活動是否在工作流程實例的預設 ActivityExecutionContext 內執行的相關信息。

Name
已淘汰.

取得或設定這個實例的名稱。 此名稱必須符合工作流程專案中所使用之程式設計語言的變數命名慣例。

Parent
已淘汰.

取得包含這個 CompositeActivityActivity

ParentDependencyObject
已淘汰.

取得 DependencyObject 圖形中的父 DependencyObject

(繼承來源 DependencyObject)
QualifiedName
已淘汰.

取得活動的限定名稱。 限定的活動名稱在工作流程實例中一律是唯一的。

Site
已淘汰.

取得或設定 SiteDependencyObject 元件的參考。

(繼承來源 DependencyObject)
UserData
已淘汰.

取得將自定義數據與這個類別實例產生關聯的 IDictionary

(繼承來源 DependencyObject)
WorkflowInstanceId
已淘汰.

取得與 實例相關聯的 Guid

方法

名稱 Description
AddHandler(DependencyProperty, Object)
已淘汰.

DependencyObject的事件新增處理程式。

(繼承來源 DependencyObject)
Cancel(ActivityExecutionContext)
已淘汰.

由工作流程運行時間呼叫,以取消目前正在執行的活動執行。

Clone()
已淘汰.

建立 Activity的深層複本。

Dispose()
已淘汰.

釋放 DependencyObject所使用的所有資源。

(繼承來源 DependencyObject)
Dispose(Boolean)
已淘汰.

釋放 Unmanaged 資源,並選擇性釋放 DependencyObject所使用的受控資源。

(繼承來源 DependencyObject)
Equals(Object)
已淘汰.

判斷指定的物件是否等於目前的物件。

(繼承來源 Object)
Execute(ActivityExecutionContext)
已淘汰.

由工作流程運行時間呼叫以執行活動。

GetActivityByName(String, Boolean)
已淘汰.

如果第二個參數是 ActivityActivity,而且在第二個參數是 false,則傳回 Activity 的名稱是從 true 根目錄下的所有活動集合要求之 Activity 的實例。

GetActivityByName(String)
已淘汰.

傳回 Activity 的實例,其名稱是從此實例根活動下執行的所有活動集要求,也就是工作流程內。

GetBinding(DependencyProperty)
已淘汰.

提供與特定 ActivityBind相關聯之 DependencyProperty 的存取權。

(繼承來源 DependencyObject)
GetBoundValue(ActivityBind, Type)
已淘汰.

擷取 Object主旨的 ActivityBind

(繼承來源 DependencyObject)
GetHashCode()
已淘汰.

做為預設哈希函式。

(繼承來源 Object)
GetInvocationList<T>(DependencyProperty)
已淘汰.

取得陣列,其中包含指定之 DependencyProperty的委派。

(繼承來源 DependencyObject)
GetType()
已淘汰.

取得目前實例的 Type

(繼承來源 Object)
GetValue(DependencyProperty)
已淘汰.

提供指定之 DependencyProperty值的存取權。

(繼承來源 DependencyObject)
GetValueBase(DependencyProperty)
已淘汰.

提供 DependencyProperty 系結物件的存取權,並略過 GetValue(DependencyProperty) 覆寫。

(繼承來源 DependencyObject)
HandleFault(ActivityExecutionContext, Exception)
已淘汰.

當這個實例執行的內容中引發例外狀況時呼叫。

Initialize(IServiceProvider)
已淘汰.

由工作流程運行時間呼叫,以在建構新的工作流程實例期間初始化活動。 在建構動態 ActivityExecutionContext時,會呼叫這個方法。

InitializeProperties()
已淘汰.

在衍生類別中覆寫時,對相依性屬性執行初始化。

(繼承來源 DependencyObject)
Invoke<T>(EventHandler<T>, T)
已淘汰.

訂閱 EventHandler 並叫用該委派。

Invoke<T>(IActivityEventListener<T>, T)
已淘汰.

訂閱 IActivityEventListener<T> 並叫用該委派。

IsBindingSet(DependencyProperty)
已淘汰.

指出 DependencyProperty 的值是否設定為系結。 參見 SetBinding(DependencyProperty, ActivityBind)

(繼承來源 DependencyObject)
Load(Stream, Activity, IFormatter)
已淘汰.

用自訂Activity的反序列化工具載入Stream一個 IFormatter 的實例。

Load(Stream, Activity)
已淘汰.

從 . 載入 的 ActivityStream實例。

MemberwiseClone()
已淘汰.

建立目前 Object的淺層複本。

(繼承來源 Object)
MetaEquals(DependencyObject)
已淘汰.

判斷這個 metapropertiesDependencyObject 是否等於參數化 metapropertiesDependencyObject

(繼承來源 DependencyObject)
OnActivityExecutionContextLoad(IServiceProvider)
已淘汰.

每當載入 ActivityExecutionContext 時,工作流程運行時間就會呼叫。 例如,在建立 ActivityExecutionContext 期間以及每次從永續性記憶體載入工作流程實例時,都會重新產生 ActivityExecutionContext 時呼叫這個方法。

OnActivityExecutionContextUnload(IServiceProvider)
已淘汰.

每當卸除 ActivityExecutionContext 時,工作流程運行時間就會呼叫。 例如,在完成 ActivityExecutionContext 期間以及每次保存工作流程實例時卸除 ActivityExecutionContext 時,都會呼叫這個方法。

OnClosed(IServiceProvider)
已淘汰.

由工作流程運行時間呼叫,做為活動轉換至已關閉狀態的一部分。

RaiseEvent(DependencyProperty, Object, EventArgs)
已淘汰.

引發與指定相依性屬性相關聯的 Event

RaiseGenericEvent<T>(DependencyProperty, Object, T)
已淘汰.

引發與參考 DependencyProperty相關聯的事件。

RegisterForStatusChange(DependencyProperty, IActivityEventListener<ActivityExecutionStatusChangedEventArgs>)
已淘汰.

註冊狀態變更事件的指定 DependencyProperty

RemoveHandler(DependencyProperty, Object)
已淘汰.

從相關聯的 EventHandler移除 DependencyProperty

(繼承來源 DependencyObject)
RemoveProperty(DependencyProperty)
已淘汰.

DependencyProperty移除 DependencyObject

(繼承來源 DependencyObject)
Save(Stream, IFormatter)
已淘汰.

使用針對串行化提供的自定義 Activity,將 Stream 寫入至持續性 IFormatter

Save(Stream)
已淘汰.

Activity 寫入 Stream 以進行持續性。

SetBinding(DependencyProperty, ActivityBind)
已淘汰.

設定指定之 ActivityBindDependencyProperty

(繼承來源 DependencyObject)
SetBoundValue(ActivityBind, Object)
已淘汰.

設定目標 ActivityBind的值。

(繼承來源 DependencyObject)
SetReadOnlyPropertyValue(DependencyProperty, Object)
已淘汰.

設定 DependencyProperty的值,這是唯讀的。

(繼承來源 DependencyObject)
SetValue(DependencyProperty, Object)
已淘汰.

DependencyProperty 的值設定為物件。

(繼承來源 DependencyObject)
SetValueBase(DependencyProperty, Object)
已淘汰.

DependencyProperty 的值設定為指定的 Object,略過 SetValue(DependencyProperty, Object)

(繼承來源 DependencyObject)
ToString()
已淘汰.

提供表示這個實例的字串。

TrackData(Object)
已淘汰.

通知運行時間追蹤基礎結構擱置的追蹤資訊。

TrackData(String, Object)
已淘汰.

通知運行時間追蹤基礎結構擱置的追蹤資訊。

Uninitialize(IServiceProvider)
已淘汰.

在衍生類別中覆寫時,為活動提供服務提供者未初始化。

UnregisterForStatusChange(DependencyProperty, IActivityEventListener<ActivityExecutionStatusChangedEventArgs>)
已淘汰.

取消註冊狀態變更事件的指定 DependencyProperty

事件

名稱 Description
Canceling
已淘汰.

發生於取消活動執行時。

Closed
已淘汰.

發生於 Activity 已完成執行時。

Compensating
已淘汰.

Activity上執行補償方法時發生。

Executing
已淘汰.

執行 Activity 時發生。

Faulting
已淘汰.

在實例執行期間引發例外狀況時發生。

StatusChanged
已淘汰.

發生於執行中 ActivityExecutionStatusActivity 變更時。

明確介面實作

名稱 Description
IComponent.Disposed
已淘汰.

表示處理元件 Disposed 事件的方法。

(繼承來源 DependencyObject)

適用於