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

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

DisplayName

デバッグ、検証、例外処理、および追跡に使用する省略可能な表示名を取得または設定します。

(継承元 Activity)
Id

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

(継承元 Activity)
Implementation

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

ImplementationVersion

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

ImplementationVersion

使用される実装のバージョンを取得または設定します。

(継承元 Activity)
Name

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

Properties

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

メソッド

CacheMetadata(ActivityMetadata)

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

(継承元 Activity)
Equals(Object)

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

(継承元 Object)
GetHashCode()

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

(継承元 Object)
GetType()

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

(継承元 Object)
MemberwiseClone()

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

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

動的な更新のマップを作成するとイベントが発生します。

(継承元 Activity)
ShouldSerializeDisplayName()

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

(継承元 Activity)
ToString()

StringId および DisplayName を含む 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 クラスのインスタンスを返します。

適用対象