IndexerReference<TOperand,TItem> クラス

定義

式の l 値として使用できるオブジェクト インデクサーによって参照される要素を表します。

generic <typename TOperand, typename TItem>
public ref class IndexerReference sealed : System::Activities::CodeActivity<System::Activities::Location<TItem> ^>
[System.Windows.Markup.ContentProperty("Indices")]
public sealed class IndexerReference<TOperand,TItem> : System.Activities.CodeActivity<System.Activities.Location<TItem>>
[<System.Windows.Markup.ContentProperty("Indices")>]
type IndexerReference<'Operand, 'Item> = class
    inherit CodeActivity<Location<'Item>>
Public NotInheritable Class IndexerReference(Of TOperand, TItem)
Inherits CodeActivity(Of Location(Of TItem))

型パラメーター

TOperand

インデクサーを含む型。

TItem

インデクサー配列の型。

継承
IndexerReference<TOperand,TItem>
属性

次のコード例では、IndexerReference<TOperand,TItem> アクティビティのAssignを使用して、インデックス [1,2] のオブジェクト項目に整数値を割り当て、項目の値をコンソールに出力します。 Assign アクティビティは、インデクサーを実装するオブジェクトを使用する場合、次のステートメントと同じです。 myObj[1,2] = 4;

Note

IndexerReference<TOperand,TItem> l 値式アクティビティを直接インスタンス化する代わりに、ConvertReferenceを呼び出すように強くお勧めします。これにより、より高い抽象化レベルが提供され、ワークフローをより直感的に実装できます。

// Define a class with a multi-dimensional indexer.
public class ObjectWithIndexer
{
    private int[,] array = new int[10,10];
    public int this[int i, int j]
    {
        get { return array[i,j]; }
        set { array[i,j] = value; }
    }
}

public static void IndexerReferenceSample()
{
    // Create a variable of type ObjectWithIndexer to store the object item.
    var oivar = new Variable<ObjectWithIndexer>("oivar", new ObjectWithIndexer());

    Activity myActivity = new Sequence
    {
        Variables = { oivar },
        Activities =
        {
            // Create an Assign activity with a reference for the object at index [1,2].
            new Assign<int>
            {
                To = new IndexerReference<ObjectWithIndexer, int>
                {
                    Operand = oivar,
                    Indices =
                    {
                        new InArgument<int>(1),
                        new InArgument<int>(2)
                    }
                },
                // Assign an integer value to the object at index [1,2].
                Value = 4,
            },
            // Print the new item value to the console.
            new WriteLine()
            {
                Text = ExpressionServices.Convert<string>(ctx => oivar.Get(ctx)[1, 2].ToString()),
            }
        }
    };

    // Invoke the Sequence activity.
    WorkflowInvoker.Invoke(myActivity);
}

コンストラクター

名前 説明
IndexerReference<TOperand,TItem>()

IndexerReference<TOperand,TItem> クラスの新しいインスタンスを初期化します。

プロパティ

名前 説明
CacheId

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

(継承元 Activity)
Constraints

Constraintの検証を提供するように構成できるActivity アクティビティのコレクションを取得します。

(継承元 Activity)
DisplayName

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

(継承元 Activity)
Id

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

(継承元 Activity)
Implementation

サポートされていません。

(継承元 CodeActivity<TResult>)
ImplementationVersion

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

(継承元 CodeActivity<TResult>)
Indices

インデクサー配列内の要素のインデックスを表す引数のコレクションを取得します。

Operand

インデクサーを含むオブジェクトを取得または設定します。

Result

Activity<TResult>の結果引数を取得または設定します。

(継承元 Activity<TResult>)
ResultType

派生クラスで実装された場合、アクティビティ OutArgumentの型を取得します。

(継承元 ActivityWithResult)

メソッド

名前 説明
CacheMetadata(ActivityMetadata)

実装されていません。 CacheMetadata(CodeActivityMetadata) を代わりに使用します。

(継承元 CodeActivity<TResult>)
CacheMetadata(CodeActivityMetadata)

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

(継承元 CodeActivity<TResult>)
Equals(Object)

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

(継承元 Object)
Execute(CodeActivityContext)

派生クラスで実装された場合は、アクティビティの実行を実行します。

(継承元 CodeActivity<TResult>)
GetHashCode()

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

(継承元 Object)
GetType()

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

(継承元 Object)
MemberwiseClone()

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

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

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

(継承元 CodeActivity<TResult>)
ShouldSerializeDisplayName()

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

(継承元 Activity)
ToString()

StringIdDisplayNameを含むActivityを返します。

(継承元 Activity)

適用対象