DynamicActivity クラス

定義

ICustomTypeDescriptorを使用して WF デザイナーおよびランタイムと動的にインターフェイスするアクティビティを構築できるオブジェクト モデルを提供します。

public ref class DynamicActivity sealed : System::Activities::Activity, System::ComponentModel::ICustomTypeDescriptor
[System.Windows.Markup.ContentProperty("Implementation")]
public sealed class DynamicActivity : System.Activities.Activity, System.ComponentModel.ICustomTypeDescriptor
[<System.Windows.Markup.ContentProperty("Implementation")>]
type DynamicActivity = class
    inherit Activity
    interface ICustomTypeDescriptor
Public NotInheritable Class DynamicActivity
Inherits Activity
Implements ICustomTypeDescriptor
継承
DynamicActivity
属性
実装

次の例は、 DynamicActivityを作成する方法を示しています。

// Variables
var iterationVariable = new DelegateInArgument<int>() { Name = "iterationVariable" };
var accumulator = new Variable<int>() { Default = 0, Name = "accumulator" };

// Define the Input and Output arguments that the DynamicActivity binds to
var numbers = new InArgument<List<int>>();
var average = new OutArgument<double>();

var result = new Variable<double>() { Name = "result" };

return new DynamicActivity()
{
    DisplayName = "Find average",
    Properties =
    {
        // Input argument
        new DynamicActivityProperty
        {
            Name = "Numbers",
            Type = typeof(InArgument<List<int>>),
            Value = numbers
        },
        // Output argument
        new DynamicActivityProperty
        {
            Name = "Average",
            Type = typeof(OutArgument<double>),
            Value = average
        }
    },
    Implementation = () =>
        new Sequence
        {
            Variables = { result, accumulator },
            Activities =
            {
                new ForEach<int>
                {
                    Values =  new ArgumentValue<IEnumerable<int>> { ArgumentName = "Numbers" },
                    Body = new ActivityAction<int>
                    {
                        Argument = iterationVariable,
                        Handler = new Assign<int>
                        {
                            To = accumulator,
                            Value = new InArgument<int>(env => iterationVariable.Get(env) +  accumulator.Get(env))
                        }
                    }
                },

                // Calculate the average and assign to the output argument.
                new Assign<double>
                {
                    To = new ArgumentReference<double> { ArgumentName = "Average" },
                    Value = new InArgument<double>(env => accumulator.Get(env) / numbers.Get(env).Count<int>())
                },
            }
        }

コンストラクター

名前 説明
DynamicActivity()

DynamicActivity クラスの新しいインスタンスを作成します。

プロパティ

名前 説明
Attributes

動的に生成されたアクティビティの属性のコレクションを取得します。

CacheId

ワークフロー定義のスコープ内で一意であるキャッシュの識別子を取得します。

(継承元 Activity)
Constraints

DynamicActivityの検証を提供するように構成されているConstraintアクティビティのコレクションを返します。

DisplayName

デバッグ、検証、例外処理、追跡に使用されるオプションのフレンドリ名を取得または設定します。

(継承元 Activity)
Id

ワークフロー定義のスコープ内で一意の識別子を取得します。

(継承元 Activity)
Implementation

アクティビティの実行ロジックを取得または設定します。

ImplementationVersion

アクティビティの実装バージョンを取得または設定します。

Name

ワークフロー デザイナーでアクティビティに表示される名前。

Properties

動的に生成されたアクティビティの引数にマップされるプロパティのコレクションを取得します。

メソッド

名前 説明
CacheMetadata(ActivityMetadata)

アクティビティの引数、変数、子アクティビティ、およびアクティビティ デリゲートの説明を作成して検証します。

(継承元 Activity)
Equals(Object)

指定したオブジェクトが現在のオブジェクトと等しいかどうかを判断します。

(継承元 Object)
GetHashCode()

既定のハッシュ関数として機能します。

(継承元 Object)
GetType()

現在のインスタンスの Type を取得します。

(継承元 Object)
MemberwiseClone()

現在の Objectの簡易コピーを作成します。

(継承元 Object)
OnCreateDynamicUpdateMap(UpdateMapMetadata, Activity)

動的更新マップを作成するときにイベントを発生させます。

(継承元 Activity)
ShouldSerializeDisplayName()

DisplayName プロパティをシリアル化する必要があるかどうかを示します。

(継承元 Activity)
ToString()

StringIdDisplayNameを含むActivityを返します。

(継承元 Activity)

明示的なインターフェイスの実装

名前 説明
ICustomTypeDescriptor.GetAttributes()

動的アクティビティの属性のコレクションを返します。

ICustomTypeDescriptor.GetClassName()

動的アクティビティのクラス名を返します。

ICustomTypeDescriptor.GetComponentName()

動的アクティビティのコンポーネント名を返します。

ICustomTypeDescriptor.GetConverter()

動的アクティビティの型コンバーターを返します。

ICustomTypeDescriptor.GetDefaultEvent()

動的アクティビティの既定のイベントを返します。

ICustomTypeDescriptor.GetDefaultProperty()

動的アクティビティの既定のプロパティを返します。

ICustomTypeDescriptor.GetEditor(Type)

指定した基本型のエディターを返します。

ICustomTypeDescriptor.GetEvents()

動的アクティビティのイベントのコレクションを返します。

ICustomTypeDescriptor.GetEvents(Attribute[])

指定した属性配列をフィルターとして使用して、動的アクティビティのイベントのコレクションを返します。

ICustomTypeDescriptor.GetProperties()

動的アクティビティのプロパティのコレクションを返します。

ICustomTypeDescriptor.GetProperties(Attribute[])

指定した属性配列をフィルターとして使用して、動的アクティビティのプロパティのコレクションを返します。

ICustomTypeDescriptor.GetPropertyOwner(PropertyDescriptor)

DynamicActivity クラスのこのインスタンスを返します。

適用対象