Skip to content

Format System types XML files #9505

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -308,8 +308,8 @@
</summary>
<returns>The resulting set which combines the current instance's classifications and the other ones.</returns>
<remarks>
This method doesn't modify the two input sets, it creates a new set.
</remarks>
This method doesn't modify the two input sets, it creates a new set.
</remarks>
</Docs>
</Member>
</Members>
Expand Down
46 changes: 23 additions & 23 deletions xml/System/Action.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,38 +63,38 @@
<Docs>
<summary>Encapsulates a method that has no parameters and does not return a value.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
You can use this delegate to pass a method as a parameter without explicitly declaring a custom delegate. The encapsulated method must correspond to the method signature that is defined by this delegate. This means that the encapsulated method must have no parameters and no return value. (In C#, the method must return `void`. In F# the function or method must return `unit`. In Visual Basic, it must be defined by the `Sub`…`End Sub` construct. It can also be a method that returns a value that is ignored.) Typically, such a method is used to perform an operation.
<format type="text/markdown"><![CDATA[

## Remarks
You can use this delegate to pass a method as a parameter without explicitly declaring a custom delegate. The encapsulated method must correspond to the method signature that is defined by this delegate. This means that the encapsulated method must have no parameters and no return value. (In C#, the method must return `void`. In F# the function or method must return `unit`. In Visual Basic, it must be defined by the `Sub`…`End Sub` construct. It can also be a method that returns a value that is ignored.) Typically, such a method is used to perform an operation.

> [!NOTE]
> To reference a method that has no parameters and returns a value, use the generic <xref:System.Func%601> delegate instead.
When you use the <xref:System.Action> delegate, you do not have to explicitly define a delegate that encapsulates a parameterless procedure. For example, the following code explicitly declares a delegate named `ShowValue` and assigns a reference to the `Name.DisplayToWindow` instance method to its delegate instance.
> To reference a method that has no parameters and returns a value, use the generic <xref:System.Func%601> delegate instead.

When you use the <xref:System.Action> delegate, you do not have to explicitly define a delegate that encapsulates a parameterless procedure. For example, the following code explicitly declares a delegate named `ShowValue` and assigns a reference to the `Name.DisplayToWindow` instance method to its delegate instance.

:::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR_System/system.action.delegate/cpp/delegate.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System/Action/Overview/delegate1.cs" id="Snippet1":::
:::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Action/fs/Delegate.fs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_System/system.action.delegate/vb/delegate.vb" id="Snippet1":::
The following example simplifies this code by instantiating the <xref:System.Action> delegate instead of explicitly defining a new delegate and assigning a named method to it.
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_System/system.action.delegate/vb/delegate.vb" id="Snippet1":::

The following example simplifies this code by instantiating the <xref:System.Action> delegate instead of explicitly defining a new delegate and assigning a named method to it.

:::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR_System/system.Action/cpp/action.cpp" id="Snippet2":::
:::code language="csharp" source="~/snippets/csharp/System/Action/Overview/Action.cs" id="Snippet2":::
:::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Action/fs/Action.fs" id="Snippet2":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_System/system.Action/vb/Action.vb" id="Snippet2":::
You can also use the <xref:System.Action> delegate with anonymous methods in C#, as the following example illustrates. (For an introduction to anonymous methods, see [Anonymous Methods](/dotnet/csharp/programming-guide/statements-expressions-operators/anonymous-methods).)
:::code language="csharp" source="~/snippets/csharp/System/Action/Overview/Anon.cs" id="Snippet3":::
You can also assign a lambda expression to an <xref:System.Action> delegate instance, as the following example illustrates. (For an introduction to lambda expressions, see [Lambda Expressions (C#)](/dotnet/csharp/programming-guide/statements-expressions-operators/lambda-expressions) or [Lambda Expressions (F#)](/dotnet/fsharp/language-reference/functions/lambda-expressions-the-fun-keyword).)
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_System/system.Action/vb/Action.vb" id="Snippet2":::

You can also use the <xref:System.Action> delegate with anonymous methods in C#, as the following example illustrates. (For an introduction to anonymous methods, see [Anonymous Methods](/dotnet/csharp/programming-guide/statements-expressions-operators/anonymous-methods).)

:::code language="csharp" source="~/snippets/csharp/System/Action/Overview/Anon.cs" id="Snippet3":::

You can also assign a lambda expression to an <xref:System.Action> delegate instance, as the following example illustrates. (For an introduction to lambda expressions, see [Lambda Expressions (C#)](/dotnet/csharp/programming-guide/statements-expressions-operators/lambda-expressions) or [Lambda Expressions (F#)](/dotnet/fsharp/language-reference/functions/lambda-expressions-the-fun-keyword).)

:::code language="csharp" source="~/snippets/csharp/System/Action/Overview/Lambda.cs" id="Snippet4":::
:::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Action/fs/Lambda.fs" id="Snippet4":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_System/system.Action/vb/lambda.vb" id="Snippet4":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_System/system.Action/vb/lambda.vb" id="Snippet4":::

]]></format>
</remarks>
<altmember cref="T:System.Func`1" />
Expand Down
62 changes: 31 additions & 31 deletions xml/System/Action`1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,49 +67,49 @@
<param name="obj">The parameter of the method that this delegate encapsulates.</param>
<summary>Encapsulates a method that has a single parameter and does not return a value.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
You can use the <xref:System.Action%601> delegate to pass a method as a parameter without explicitly declaring a custom delegate. The encapsulated method must correspond to the method signature that is defined by this delegate. This means that the encapsulated method must have one parameter that is passed to it by value, and it must not return a value. (In C#, the method must return `void`. In Visual Basic, it must be defined by the `Sub`…`End Sub` construct. It can also be a method that returns a value that is ignored.) Typically, such a method is used to perform an operation.
<format type="text/markdown"><![CDATA[

## Remarks
You can use the <xref:System.Action%601> delegate to pass a method as a parameter without explicitly declaring a custom delegate. The encapsulated method must correspond to the method signature that is defined by this delegate. This means that the encapsulated method must have one parameter that is passed to it by value, and it must not return a value. (In C#, the method must return `void`. In Visual Basic, it must be defined by the `Sub`…`End Sub` construct. It can also be a method that returns a value that is ignored.) Typically, such a method is used to perform an operation.

> [!NOTE]
> To reference a method that has one parameter and returns a value, use the generic <xref:System.Func%602> delegate instead.
When you use the <xref:System.Action%601> delegate, you do not have to explicitly define a delegate that encapsulates a method with a single parameter. For example, the following code explicitly declares a delegate named `DisplayMessage` and assigns a reference to either the <xref:System.Console.WriteLine%2A> method or the `ShowWindowsMessage` method to its delegate instance.
> To reference a method that has one parameter and returns a value, use the generic <xref:System.Func%602> delegate instead.

When you use the <xref:System.Action%601> delegate, you do not have to explicitly define a delegate that encapsulates a method with a single parameter. For example, the following code explicitly declares a delegate named `DisplayMessage` and assigns a reference to either the <xref:System.Console.WriteLine%2A> method or the `ShowWindowsMessage` method to its delegate instance.

:::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR_System/system.Action~1/cpp/delegate.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System/ActionT/Overview/Delegate.cs" id="Snippet1":::
:::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Action~1/fs/Delegate.fs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_System/system.Action~1/vb/Delegate.vb" id="Snippet1":::
The following example simplifies this code by instantiating the <xref:System.Action%601> delegate instead of explicitly defining a new delegate and assigning a named method to it.
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_System/system.Action~1/vb/Delegate.vb" id="Snippet1":::

The following example simplifies this code by instantiating the <xref:System.Action%601> delegate instead of explicitly defining a new delegate and assigning a named method to it.

:::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR_System/system.Action~1/cpp/action`1.cpp" id="Snippet2":::
:::code language="csharp" source="~/snippets/csharp/System/ActionT/Overview/Action1.cs" id="Snippet2":::
:::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Action~1/fs/Action1.fs" id="Snippet2":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_System/system.Action~1/vb/Action1.vb" id="Snippet2":::
You can also use the <xref:System.Action%601> delegate with anonymous methods in C#, as the following example illustrates. (For an introduction to anonymous methods, see [Anonymous Methods](/dotnet/csharp/programming-guide/statements-expressions-operators/anonymous-methods).)
:::code language="csharp" source="~/snippets/csharp/System/ActionT/Overview/Anon.cs" id="Snippet3":::
You can also assign a lambda expression to an <xref:System.Action%601> delegate instance, as the following example illustrates. (For an introduction to lambda expressions, see [Lambda Expressions](/dotnet/csharp/programming-guide/statements-expressions-operators/lambda-expressions).)
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_System/system.Action~1/vb/Action1.vb" id="Snippet2":::

You can also use the <xref:System.Action%601> delegate with anonymous methods in C#, as the following example illustrates. (For an introduction to anonymous methods, see [Anonymous Methods](/dotnet/csharp/programming-guide/statements-expressions-operators/anonymous-methods).)

:::code language="csharp" source="~/snippets/csharp/System/ActionT/Overview/Anon.cs" id="Snippet3":::

You can also assign a lambda expression to an <xref:System.Action%601> delegate instance, as the following example illustrates. (For an introduction to lambda expressions, see [Lambda Expressions](/dotnet/csharp/programming-guide/statements-expressions-operators/lambda-expressions).)

:::code language="csharp" source="~/snippets/csharp/System/ActionT/Overview/Lambda.cs" id="Snippet4":::
:::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Action~1/fs/Lambda.fs" id="Snippet4":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_System/system.Action~1/vb/lambda.vb" id="Snippet4":::
The <xref:System.Collections.Generic.List%601.ForEach%2A> and <xref:System.Array.ForEach%2A> methods each take an <xref:System.Action%601> delegate as a parameter. The method encapsulated by the delegate allows you to perform an action on each element in the array or list. The example uses the <xref:System.Collections.Generic.List%601.ForEach%2A> method to provide an illustration.
## Examples
The following example demonstrates the use of the <xref:System.Action%601> delegate to print the contents of a <xref:System.Collections.Generic.List%601> object. In this example, the `Print` method is used to display the contents of the list to the console. In addition, the C# example also demonstrates the use of anonymous methods to display the contents to the console. Note that the example does not explicitly declare an <xref:System.Action%601> variable. Instead, it passes a reference to a method that takes a single parameter and that does not return a value to the <xref:System.Collections.Generic.List%601.ForEach%2A?displayProperty=nameWithType> method, whose single parameter is an <xref:System.Action%601> delegate. Similarly, in the C# example, an <xref:System.Action%601> delegate is not explicitly instantiated because the signature of the anonymous method matches the signature of the <xref:System.Action%601> delegate that is expected by the <xref:System.Collections.Generic.List%601.ForEach%2A?displayProperty=nameWithType> method.
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_System/system.Action~1/vb/lambda.vb" id="Snippet4":::

The <xref:System.Collections.Generic.List%601.ForEach%2A> and <xref:System.Array.ForEach%2A> methods each take an <xref:System.Action%601> delegate as a parameter. The method encapsulated by the delegate allows you to perform an action on each element in the array or list. The example uses the <xref:System.Collections.Generic.List%601.ForEach%2A> method to provide an illustration.



## Examples
The following example demonstrates the use of the <xref:System.Action%601> delegate to print the contents of a <xref:System.Collections.Generic.List%601> object. In this example, the `Print` method is used to display the contents of the list to the console. In addition, the C# example also demonstrates the use of anonymous methods to display the contents to the console. Note that the example does not explicitly declare an <xref:System.Action%601> variable. Instead, it passes a reference to a method that takes a single parameter and that does not return a value to the <xref:System.Collections.Generic.List%601.ForEach%2A?displayProperty=nameWithType> method, whose single parameter is an <xref:System.Action%601> delegate. Similarly, in the C# example, an <xref:System.Action%601> delegate is not explicitly instantiated because the signature of the anonymous method matches the signature of the <xref:System.Action%601> delegate that is expected by the <xref:System.Collections.Generic.List%601.ForEach%2A?displayProperty=nameWithType> method.

:::code language="csharp" source="~/snippets/csharp/System/ActionT/Overview/action.cs" interactive="try-dotnet-method" id="Snippet01":::
:::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Action_PrintExample/fs/action.fs" id="Snippet01":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_System/system.Action_PrintExample/vb/action.vb" id="Snippet01":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_System/system.Action_PrintExample/vb/action.vb" id="Snippet01":::

]]></format>
</remarks>
<altmember cref="T:System.Func`2" />
Expand Down
18 changes: 9 additions & 9 deletions xml/System/Action`10.xml
Original file line number Diff line number Diff line change
Expand Up @@ -139,16 +139,16 @@
<param name="arg10">The tenth parameter of the method that this delegate encapsulates.</param>
<summary>Encapsulates a method that has 10 parameters and does not return a value.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
You can use the <xref:System.Action%6010> delegate to pass a method as a parameter without explicitly declaring a custom delegate. The encapsulated method must correspond to the method signature that is defined by this delegate. This means that the encapsulated method must have 10 parameters that are all passed to it by value, and it must not return a value. (In C#, the method must return `void`. In Visual Basic, it must be defined by the `Sub`…`End Sub` construct. It can also be a method that returns a value that is ignored.) Typically, such a method is used to perform an operation.
<format type="text/markdown"><![CDATA[

## Remarks
You can use the <xref:System.Action%6010> delegate to pass a method as a parameter without explicitly declaring a custom delegate. The encapsulated method must correspond to the method signature that is defined by this delegate. This means that the encapsulated method must have 10 parameters that are all passed to it by value, and it must not return a value. (In C#, the method must return `void`. In Visual Basic, it must be defined by the `Sub`…`End Sub` construct. It can also be a method that returns a value that is ignored.) Typically, such a method is used to perform an operation.

> [!NOTE]
> To reference a method that has 10 parameters and returns a value, use the generic <xref:System.Func%6011> delegate instead.
You can also use the <xref:System.Action%6010> delegate with anonymous methods and lambda expressions.
> To reference a method that has 10 parameters and returns a value, use the generic <xref:System.Func%6011> delegate instead.

You can also use the <xref:System.Action%6010> delegate with anonymous methods and lambda expressions.

]]></format>
</remarks>
<altmember cref="T:System.Func`11" />
Expand Down
18 changes: 9 additions & 9 deletions xml/System/Action`11.xml
Original file line number Diff line number Diff line change
Expand Up @@ -147,16 +147,16 @@
<param name="arg11">The eleventh parameter of the method that this delegate encapsulates.</param>
<summary>Encapsulates a method that has 11 parameters and does not return a value.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
You can use the <xref:System.Action%6011> delegate to pass a method as a parameter without explicitly declaring a custom delegate. The encapsulated method must correspond to the method signature that is defined by this delegate. This means that the encapsulated method must have 11 parameters that are all passed to it by value, and it must not return a value. (In C#, the method must return `void`. In Visual Basic, it must be defined by the `Sub`…`End Sub` construct. It can also be a method that returns a value that is ignored.) Typically, such a method is used to perform an operation.
<format type="text/markdown"><![CDATA[

## Remarks
You can use the <xref:System.Action%6011> delegate to pass a method as a parameter without explicitly declaring a custom delegate. The encapsulated method must correspond to the method signature that is defined by this delegate. This means that the encapsulated method must have 11 parameters that are all passed to it by value, and it must not return a value. (In C#, the method must return `void`. In Visual Basic, it must be defined by the `Sub`…`End Sub` construct. It can also be a method that returns a value that is ignored.) Typically, such a method is used to perform an operation.

> [!NOTE]
> To reference a method that has 11 parameters and returns a value, use the generic <xref:System.Func%6012> delegate instead.
You can also use the <xref:System.Action%6011> delegate with anonymous methods and lambda expressions.
> To reference a method that has 11 parameters and returns a value, use the generic <xref:System.Func%6012> delegate instead.

You can also use the <xref:System.Action%6011> delegate with anonymous methods and lambda expressions.

]]></format>
</remarks>
<altmember cref="T:System.Func`12" />
Expand Down
Loading