Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
128 changes: 64 additions & 64 deletions xml/System.Activities.Expressions/IndexerReference`2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,66 +31,66 @@
<typeparam name="TItem">The type of the indexer array.</typeparam>
<summary>Represents an element referenced by an object indexer that can be used as an l-value in an expression.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following code example uses <xref:System.Activities.Expressions.IndexerReference%602> in an `Assign` activity to assign an integer value to the object item at index [1,2] and prints the item value to the console. The `Assign` activity is equivalent to the following statement when using an object that implements an indexer. `myObj[1,2] = 4;` .
<format type="text/markdown"><![CDATA[

## Examples
The following code example uses <xref:System.Activities.Expressions.IndexerReference%602> in an `Assign` activity to assign an integer value to the object item at index [1,2] and prints the item value to the console. The `Assign` activity is equivalent to the following statement when using an object that implements an indexer. `myObj[1,2] = 4;` .

> [!NOTE]
> Instead of instantiating the <xref:System.Activities.Expressions.IndexerReference%602> l-value expression activity directly, it is strongly recommended that you call <xref:System.Activities.Expressions.ExpressionServices.ConvertReference%2A>, which provides a higher level of abstraction and enables you to implement your workflow more intuitively.
```csharp
// 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);
}
```
> Instead of instantiating the <xref:System.Activities.Expressions.IndexerReference%602> l-value expression activity directly, it is strongly recommended that you call <xref:System.Activities.Expressions.ExpressionServices.ConvertReference%2A>, which provides a higher level of abstraction and enables you to implement your workflow more intuitively.

```csharp

// 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);
}

```

]]></format>
</remarks>
</Docs>
Expand Down Expand Up @@ -196,11 +196,11 @@ public static void IndexerReferenceSample()
<summary>Gets a collection of arguments that represent the indices of the element in the indexer array.</summary>
<value>The indices of the element in the indexer array.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Activities.Expressions.IndexerReference%602.Indices%2A> property is read-only, but the items in the collection can be modified and the indices can be changed.
<format type="text/markdown"><![CDATA[

## Remarks
The <xref:System.Activities.Expressions.IndexerReference%602.Indices> property is read-only, but the items in the collection can be modified and the indices can be changed.

]]></format>
</remarks>
</Docs>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,51 +29,51 @@
<typeparam name="TItem">The type of elements in the array.</typeparam>
<summary>Represents an element in a multidimensional array that can be used as an l-value in an expression.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following code example uses <xref:System.Activities.Expressions.MultidimensionalArrayItemReference%601> in an `Assign` activity to assign an integer value to the array element at row 1 and column 2 and prints the value of the array element to the console. The `Assign` activity is equivalent to the following statement when using arrays: `array[1, 2] = 1;`.
<format type="text/markdown"><![CDATA[

## Examples
The following code example uses <xref:System.Activities.Expressions.MultidimensionalArrayItemReference%601> in an `Assign` activity to assign an integer value to the array element at row 1 and column 2 and prints the value of the array element to the console. The `Assign` activity is equivalent to the following statement when using arrays: `array[1, 2] = 1;`.

> [!NOTE]
> Instead of instantiating the <xref:System.Activities.Expressions.MultidimensionalArrayItemReference%601> l-value expression activity directly, it is strongly recommended that you call <xref:System.Activities.Expressions.ExpressionServices.ConvertReference%2A>, which provides a higher level of abstraction and enables you to implement your workflow more intuitively.
```csharp
public static void MultidimensionalArrayItemReferenceSample()
{
// Create a variable to store a multidimensional array.
var arrayvar = new Variable<int[,]>("arrayvar", new int[4, 5]);
Activity myActivity = new Sequence
{
Variables = { arrayvar },
Activities =
{
// Create an Assign activity to assign a value to the array item at index [1,2].
new Assign<int>
{
To = new MultidimensionalArrayItemReference<int>
{
Array = arrayvar,
Indices = {1, 2}
},
// Assign an integer value to the array item at row 1 column 2.
Value = 1,
},
// Print the array item value to the console.
new WriteLine()
{
Text = ExpressionServices.Convert<string>(ctx => arrayvar.Get(ctx)[1, 2].ToString()),
}
}
};
// Invoke the Sequence activity.
WorkflowInvoker.Invoke(myActivity);
}
```
> Instead of instantiating the <xref:System.Activities.Expressions.MultidimensionalArrayItemReference%601> l-value expression activity directly, it is strongly recommended that you call <xref:System.Activities.Expressions.ExpressionServices.ConvertReference%2A>, which provides a higher level of abstraction and enables you to implement your workflow more intuitively.

```csharp

public static void MultidimensionalArrayItemReferenceSample()
{
// Create a variable to store a multidimensional array.
var arrayvar = new Variable<int[,]>("arrayvar", new int[4, 5]);

Activity myActivity = new Sequence
{
Variables = { arrayvar },
Activities =
{
// Create an Assign activity to assign a value to the array item at index [1,2].
new Assign<int>
{
To = new MultidimensionalArrayItemReference<int>
{
Array = arrayvar,
Indices = {1, 2}
},
// Assign an integer value to the array item at row 1 column 2.
Value = 1,
},
// Print the array item value to the console.
new WriteLine()
{
Text = ExpressionServices.Convert<string>(ctx => arrayvar.Get(ctx)[1, 2].ToString()),
}
}
};

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

```

]]></format>
</remarks>
</Docs>
Expand Down Expand Up @@ -214,11 +214,11 @@ public static void MultidimensionalArrayItemReferenceSample()
<summary>Gets a collection of arguments that represent the indices of the element in the array.</summary>
<value>The indices of the element in the array.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Activities.Expressions.MultidimensionalArrayItemReference%601.Indices%2A> property is read-only, but the items in the collection can be modified and the indices can be changed.
<format type="text/markdown"><![CDATA[

## Remarks
The <xref:System.Activities.Expressions.MultidimensionalArrayItemReference%601.Indices> property is read-only, but the items in the collection can be modified and the indices can be changed.

]]></format>
</remarks>
</Docs>
Expand Down
10 changes: 5 additions & 5 deletions xml/System.Activities.Expressions/PropertyReference`2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@
<typeparam name="TResult">The type of the result.</typeparam>
<summary>A reference to a property.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
If a reference is created that refers to properties on the root activity of the activity that contains this property, the activity will not be able to be deserialized into an <xref:System.Activities.ActivityBuilder> unless that activity is compatible with its <xref:System.Activities.ActivityBuilder.Properties%2A> property.
<format type="text/markdown"><![CDATA[

## Remarks
If a reference is created that refers to properties on the root activity of the activity that contains this property, the activity will not be able to be deserialized into an <xref:System.Activities.ActivityBuilder> unless that activity is compatible with its <xref:System.Activities.ActivityBuilder.Properties> property.

]]></format>
</remarks>
</Docs>
Expand Down
Loading
Loading