diff --git a/xml/System.Activities.Expressions/Add`3.xml b/xml/System.Activities.Expressions/Add`3.xml index 224d9f3e2be..ded73372698 100644 --- a/xml/System.Activities.Expressions/Add`3.xml +++ b/xml/System.Activities.Expressions/Add`3.xml @@ -104,11 +104,11 @@ if the addition executes in a checked context; otherwise, . The default is . - activity executes in a checked context and throws an if the addition causes an overflow. - + activity executes in a checked context and throws an if the addition causes an overflow. + ]]> diff --git a/xml/System.Activities.Expressions/Cast`2.xml b/xml/System.Activities.Expressions/Cast`2.xml index 00fabb1b6f6..ee9ef26bf87 100644 --- a/xml/System.Activities.Expressions/Cast`2.xml +++ b/xml/System.Activities.Expressions/Cast`2.xml @@ -102,11 +102,11 @@ if the cast operation executes in a checked context; otherwise, . The default is . - activity executes in a checked context and throws an if the cast operation causes an overflow. - + activity executes in a checked context and throws an if the cast operation causes an overflow. + ]]> diff --git a/xml/System.Activities.Expressions/ExpressionServices.xml b/xml/System.Activities.Expressions/ExpressionServices.xml index b25ab0fccc0..4de7ee34a41 100644 --- a/xml/System.Activities.Expressions/ExpressionServices.xml +++ b/xml/System.Activities.Expressions/ExpressionServices.xml @@ -16,103 +16,103 @@ A transformation API used to convert environment aware expressions to an activity tree. - are designed to work with variables and constants defined inside the workflow, or passed into the workflow via arguments. - - - -## Examples - The following code example calls to compute the sum of the array element at index 0 and the array element at index 1. Next, the resulting sum is assigned to a variable and is printed to the console. - -```csharp - -public static void ComputeSumWithConvert() -{ - var arrayvar = new Variable("arrayvar", new int[] { 1, 2 }); - var intvar = new Variable("intvar"); - - // Use ExpressionServices.Convert() to convert the composite lambda expression - // that represents the sum of array elements at index 0 and 1. - Activity activity1 = ExpressionServices.Convert(ctx => arrayvar.Get(ctx)[0] + arrayvar.Get(ctx)[1]); - - Activity seq = new Sequence - { - Variables = { arrayvar, intvar }, - Activities = - { - // Get the sum value. - new Assign - { - To = intvar, - Value = activity1, - }, - // Print the sum value of 3 to the console. - new WriteLine - { - Text = new InArgument(ctx => intvar.Get(ctx).ToString()), - }, - } - }; - - WorkflowInvoker.Invoke(seq); - -} - -``` - - The following code example is provided for comparison purposes. This second example shows how to compute the sum by instantiating the expression activity. The two examples are functionally equivalent but as you can see the second approach involves more coding and is not as straightforward as calling . Therefore the first example is recommended. - -```csharp - -public static void ComputeSumWithExpressionActivity() -{ - var arrayvar = new Variable("arrayvar", new int[] { 1, 2 }); - var intvar = new Variable("intvar"); - - // Create an Add activity to compute the sum of array elements at index 0 and 1. - Activity activity1 = new Add - { - Left = new ArrayItemValue - { - Array = arrayvar, - Index = 0, - }, - Right = new ArrayItemValue - { - Array = arrayvar, - Index = 1, - } - }; - - Activity seq = new Sequence - { - Variables = { arrayvar, intvar }, - Activities = - { - // Get the sum value. - new Assign - { - To = intvar, - Value = activity1, - }, - // Print the sum value of 3 to the console. - new WriteLine - { - Text = new InArgument(ctx => intvar.Get(ctx).ToString()), - }, - } - }; - - WorkflowInvoker.Invoke(seq); - -} - -``` - + are designed to work with variables and constants defined inside the workflow, or passed into the workflow via arguments. + + + +## Examples + The following code example calls to compute the sum of the array element at index 0 and the array element at index 1. Next, the resulting sum is assigned to a variable and is printed to the console. + +```csharp + +public static void ComputeSumWithConvert() +{ + var arrayvar = new Variable("arrayvar", new int[] { 1, 2 }); + var intvar = new Variable("intvar"); + + // Use ExpressionServices.Convert() to convert the composite lambda expression + // that represents the sum of array elements at index 0 and 1. + Activity activity1 = ExpressionServices.Convert(ctx => arrayvar.Get(ctx)[0] + arrayvar.Get(ctx)[1]); + + Activity seq = new Sequence + { + Variables = { arrayvar, intvar }, + Activities = + { + // Get the sum value. + new Assign + { + To = intvar, + Value = activity1, + }, + // Print the sum value of 3 to the console. + new WriteLine + { + Text = new InArgument(ctx => intvar.Get(ctx).ToString()), + }, + } + }; + + WorkflowInvoker.Invoke(seq); + +} + +``` + + The following code example is provided for comparison purposes. This second example shows how to compute the sum by instantiating the expression activity. The two examples are functionally equivalent but as you can see the second approach involves more coding and is not as straightforward as calling . Therefore the first example is recommended. + +```csharp + +public static void ComputeSumWithExpressionActivity() +{ + var arrayvar = new Variable("arrayvar", new int[] { 1, 2 }); + var intvar = new Variable("intvar"); + + // Create an Add activity to compute the sum of array elements at index 0 and 1. + Activity activity1 = new Add + { + Left = new ArrayItemValue + { + Array = arrayvar, + Index = 0, + }, + Right = new ArrayItemValue + { + Array = arrayvar, + Index = 1, + } + }; + + Activity seq = new Sequence + { + Variables = { arrayvar, intvar }, + Activities = + { + // Get the sum value. + new Assign + { + To = intvar, + Value = activity1, + }, + // Print the sum value of 3 to the console. + new WriteLine + { + Text = new InArgument(ctx => intvar.Get(ctx).ToString()), + }, + } + }; + + WorkflowInvoker.Invoke(seq); + +} + +``` + ]]> @@ -144,13 +144,13 @@ public static void ComputeSumWithExpressionActivity() Converts a workflow environment-aware expression to an activity tree. The converted expression. - , see . - - The conversion methods in are designed to work with variables and constants defined inside the workflow, or passed into the workflow via arguments. - + , see . + + The conversion methods in are designed to work with variables and constants defined inside the workflow, or passed into the workflow via arguments. + ]]> @@ -182,90 +182,90 @@ public static void ComputeSumWithExpressionActivity() Converts a reference to a workflow environment-aware expression to an activity tree. The converted expression. - are designed to work with variables and constants defined inside the workflow, or passed into the workflow via arguments. - - - -## Examples - The following two code examples illustrate the use of and . The first code example uses in an `Assign` activity to convert a lambda expression into a string property that is assigned a value. Next, is called to convert a lambda expression into a string property value that is printed to the console in the `WriteLine` activity. - -```csharp - -// Define a struct with a property named AProperty. -struct StructWithProperty -{ - public string AProperty { get; set; } -} - -public static void ConvertReferenceForValueTypePropertyReferenceSample() -{ - // Create a variable of type StructWithProperty to store the property. - var swpvar = new Variable("swpvar", new StructWithProperty()); - - Activity myActivity = new Sequence - { - Variables = { swpvar }, - Activities = - { - // Create an Assign activity to assign a value to the AProperty property. - new Assign - { - To = ExpressionServices.ConvertReference(ctx => swpvar.Get(ctx).AProperty), - // Assign a string literal to AProperty. - Value = "Hello", - }, - // Print the new property value to the console. - new WriteLine() - { - Text = ExpressionServices.Convert(ctx => swpvar.Get(ctx).AProperty), - } - } - }; - - // Invoke the Sequence activity. - WorkflowInvoker.Invoke(myActivity); -} - -``` - - The following code example is like the previous one except that the expression to convert is a reference to an item in a multidimensional array. - -```csharp - -public static void ConvertReferenceForMultidimensionalArrayItemReferenceSample() -{ - // Create a variable to store a multidimensional array. - var arrayvar = new Variable("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 - { - To = ExpressionServices.ConvertReference(ctx => arrayvar.Get(ctx)[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(ctx => arrayvar.Get(ctx)[1, 2].ToString()), - } - } - }; - - // Invoke the Sequence activity. - WorkflowInvoker.Invoke(myActivity); -} - -``` - + are designed to work with variables and constants defined inside the workflow, or passed into the workflow via arguments. + + + +## Examples + The following two code examples illustrate the use of and . The first code example uses in an `Assign` activity to convert a lambda expression into a string property that is assigned a value. Next, is called to convert a lambda expression into a string property value that is printed to the console in the `WriteLine` activity. + +```csharp + +// Define a struct with a property named AProperty. +struct StructWithProperty +{ + public string AProperty { get; set; } +} + +public static void ConvertReferenceForValueTypePropertyReferenceSample() +{ + // Create a variable of type StructWithProperty to store the property. + var swpvar = new Variable("swpvar", new StructWithProperty()); + + Activity myActivity = new Sequence + { + Variables = { swpvar }, + Activities = + { + // Create an Assign activity to assign a value to the AProperty property. + new Assign + { + To = ExpressionServices.ConvertReference(ctx => swpvar.Get(ctx).AProperty), + // Assign a string literal to AProperty. + Value = "Hello", + }, + // Print the new property value to the console. + new WriteLine() + { + Text = ExpressionServices.Convert(ctx => swpvar.Get(ctx).AProperty), + } + } + }; + + // Invoke the Sequence activity. + WorkflowInvoker.Invoke(myActivity); +} + +``` + + The following code example is like the previous one except that the expression to convert is a reference to an item in a multidimensional array. + +```csharp + +public static void ConvertReferenceForMultidimensionalArrayItemReferenceSample() +{ + // Create a variable to store a multidimensional array. + var arrayvar = new Variable("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 + { + To = ExpressionServices.ConvertReference(ctx => arrayvar.Get(ctx)[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(ctx => arrayvar.Get(ctx)[1, 2].ToString()), + } + } + }; + + // Invoke the Sequence activity. + WorkflowInvoker.Invoke(myActivity); +} + +``` + ]]> @@ -300,11 +300,11 @@ public static void ConvertReferenceForMultidimensionalArrayItemReferenceSample() if the expression can be converted; otherwise, . - are designed to work with variables and constants defined inside the workflow, or passed into the workflow via arguments. - + are designed to work with variables and constants defined inside the workflow, or passed into the workflow via arguments. + ]]> @@ -339,11 +339,11 @@ public static void ConvertReferenceForMultidimensionalArrayItemReferenceSample() if the expression can be converted; otherwise, . - are designed to work with variables and constants defined inside the workflow, or passed into the workflow via arguments. - + are designed to work with variables and constants defined inside the workflow, or passed into the workflow via arguments. + ]]> diff --git a/xml/System.Activities.Expressions/IndexerReference`2.xml b/xml/System.Activities.Expressions/IndexerReference`2.xml index 59bc3b9b617..ba1a13eac8d 100644 --- a/xml/System.Activities.Expressions/IndexerReference`2.xml +++ b/xml/System.Activities.Expressions/IndexerReference`2.xml @@ -34,10 +34,10 @@ 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;` . + The following code example uses 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 l-value expression activity directly, it is strongly recommended that you call , which provides a higher level of abstraction and enables you to implement your workflow more intuitively. +> Instead of instantiating the l-value expression activity directly, it is strongly recommended that you call , which provides a higher level of abstraction and enables you to implement your workflow more intuitively. ```csharp @@ -199,7 +199,7 @@ public static void IndexerReferenceSample() property is read-only, but the items in the collection can be modified and the indices can be changed. + The property is read-only, but the items in the collection can be modified and the indices can be changed. ]]> diff --git a/xml/System.Activities.Expressions/LambdaReference`1.xml b/xml/System.Activities.Expressions/LambdaReference`1.xml index 5f6d93ec665..82a021651e6 100644 --- a/xml/System.Activities.Expressions/LambdaReference`1.xml +++ b/xml/System.Activities.Expressions/LambdaReference`1.xml @@ -33,13 +33,13 @@ The type of value returned by the expression. Represents a lambda expression used as an l-value, which supports binding of arguments. - is used for lambda expressions specified in code and cannot be serialized to XAML. If an attempt to serialize a workflow that contains a is made, a is thrown. If the containing workflow requires XAML serialization, use or use to convert the to a format that can be serialized. - - This activity uses the LINQ to Entity provider to evaluate LINQ expressions. Any LINQ expressions used with this activity must be evaluatable by the ADO.Net Entity Data Model. For example, LINQ expressions cannot be used to reference activities, variables, or arguments of the workflow itself. - + is used for lambda expressions specified in code and cannot be serialized to XAML. If an attempt to serialize a workflow that contains a is made, a is thrown. If the containing workflow requires XAML serialization, use or use to convert the to a format that can be serialized. + + This activity uses the LINQ to Entity provider to evaluate LINQ expressions. Any LINQ expressions used with this activity must be evaluatable by the ADO.Net Entity Data Model. For example, LINQ expressions cannot be used to reference activities, variables, or arguments of the workflow itself. + ]]> @@ -115,11 +115,11 @@ This method always returns and is used in conjunction with to provide descriptive error messages when an attempt is made to serialize this activity to XAML. This method always returns . - is used for lambda expressions specified in code and cannot be serialized to XAML. If an attempt to serialize a workflow that contains a is made, a is thrown. If the containing workflow requires XAML serialization, use or use to convert the to a format that can be serialized. - + is used for lambda expressions specified in code and cannot be serialized to XAML. If an attempt to serialize a workflow that contains a is made, a is thrown. If the containing workflow requires XAML serialization, use or use to convert the to a format that can be serialized. + ]]> @@ -150,11 +150,11 @@ Throws a and is used in conjunction with to provide descriptive error messages when an attempt is made to serialize this activity to XAML. This method throws a when called. - is used for lambda expressions specified in code and cannot be serialized to XAML. If an attempt to serialize a workflow that contains a is made, a is thrown. If the containing workflow requires XAML serialization, use or use to convert the to a format that can be serialized. - + is used for lambda expressions specified in code and cannot be serialized to XAML. If an attempt to serialize a workflow that contains a is made, a is thrown. If the containing workflow requires XAML serialization, use or use to convert the to a format that can be serialized. + ]]> diff --git a/xml/System.Activities.Expressions/LambdaSerializationException.xml b/xml/System.Activities.Expressions/LambdaSerializationException.xml index e0e7fe6a7b7..ce6d9640f73 100644 --- a/xml/System.Activities.Expressions/LambdaSerializationException.xml +++ b/xml/System.Activities.Expressions/LambdaSerializationException.xml @@ -22,11 +22,11 @@ The exception that is thrown when a XAML serialization attempt is made on a or . - and are used for lambda expressions specified in code and are not XAML serializable. If an attempt is made to serialize a workflow that contains a or , a is thrown. If the containing workflow requires XAML serialization, use or , or use to convert the or to a serializable format. - + and are used for lambda expressions specified in code and are not XAML serializable. If an attempt is made to serialize a workflow that contains a or , a is thrown. If the containing workflow requires XAML serialization, use or , or use to convert the or to a serializable format. + ]]> diff --git a/xml/System.Activities.Expressions/LambdaValue`1.xml b/xml/System.Activities.Expressions/LambdaValue`1.xml index d8248d73c53..acc89a0424b 100644 --- a/xml/System.Activities.Expressions/LambdaValue`1.xml +++ b/xml/System.Activities.Expressions/LambdaValue`1.xml @@ -33,13 +33,13 @@ The type of value returned by the expression. Represents a lambda expression used as an r-value, which supports binding of arguments. - is used for lambda expressions specified in code and cannot be serialized to XAML. If an attempt to serialize a workflow that contains a is made, a is thrown. If the containing workflow requires XAML serialization, use or use to convert the to a format that can be serialized. - - This activity uses the LINQ to Entity provider to evaluate LINQ expressions. Any LINQ expressions used with this activity must be evaluatable by the ADO.Net Entity Data Model. For example, LINQ expressions cannot be used to reference activities, variables, or arguments of the workflow itself. - + is used for lambda expressions specified in code and cannot be serialized to XAML. If an attempt to serialize a workflow that contains a is made, a is thrown. If the containing workflow requires XAML serialization, use or use to convert the to a format that can be serialized. + + This activity uses the LINQ to Entity provider to evaluate LINQ expressions. Any LINQ expressions used with this activity must be evaluatable by the ADO.Net Entity Data Model. For example, LINQ expressions cannot be used to reference activities, variables, or arguments of the workflow itself. + ]]> @@ -115,11 +115,11 @@ This method always returns and is used in conjunction with to provide descriptive error messages when an attempt is made to serialize this activity to XAML. This method always returns . - is used for lambda expressions specified in code and cannot be serialized to XAML. If an attempt to serialize a workflow that contains a is made, a is thrown. If the containing workflow requires XAML serialization, use or use to convert the to a format that can be serialized. - + is used for lambda expressions specified in code and cannot be serialized to XAML. If an attempt to serialize a workflow that contains a is made, a is thrown. If the containing workflow requires XAML serialization, use or use to convert the to a format that can be serialized. + ]]> @@ -150,11 +150,11 @@ Throws a , and is used in conjunction with to provide descriptive error messages when an attempt is made to serialize this activity to XAML. Throws a when called. - is used for lambda expressions specified in code and cannot be serialized to XAML. If an attempt to serialize a workflow that contains a is made, a is thrown. If the containing workflow requires XAML serialization, use or use to convert the to a format that can be serialized. - + is used for lambda expressions specified in code and cannot be serialized to XAML. If an attempt to serialize a workflow that contains a is made, a is thrown. If the containing workflow requires XAML serialization, use or use to convert the to a format that can be serialized. + ]]> diff --git a/xml/System.Activities.Expressions/MultidimensionalArrayItemReference`1.xml b/xml/System.Activities.Expressions/MultidimensionalArrayItemReference`1.xml index 295a216a2cc..93ce8d20dfd 100644 --- a/xml/System.Activities.Expressions/MultidimensionalArrayItemReference`1.xml +++ b/xml/System.Activities.Expressions/MultidimensionalArrayItemReference`1.xml @@ -32,10 +32,10 @@ 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;`. + The following code example uses 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 l-value expression activity directly, it is strongly recommended that you call , which provides a higher level of abstraction and enables you to implement your workflow more intuitively. +> Instead of instantiating the l-value expression activity directly, it is strongly recommended that you call , which provides a higher level of abstraction and enables you to implement your workflow more intuitively. ```csharp @@ -217,7 +217,7 @@ public static void MultidimensionalArrayItemReferenceSample() property is read-only, but the items in the collection can be modified and the indices can be changed. + The property is read-only, but the items in the collection can be modified and the indices can be changed. ]]> diff --git a/xml/System.Activities.Expressions/Multiply`3.xml b/xml/System.Activities.Expressions/Multiply`3.xml index 75b1ddb656e..36938d59799 100644 --- a/xml/System.Activities.Expressions/Multiply`3.xml +++ b/xml/System.Activities.Expressions/Multiply`3.xml @@ -104,11 +104,11 @@ if the multiplication executes in a checked context; otherwise, . The default is . - activity executes in a checked context and throws an if the multiplication causes an overflow. - + activity executes in a checked context and throws an if the multiplication causes an overflow. + ]]> diff --git a/xml/System.Activities.Expressions/Subtract`3.xml b/xml/System.Activities.Expressions/Subtract`3.xml index bfeb2c5af10..d2b421bee46 100644 --- a/xml/System.Activities.Expressions/Subtract`3.xml +++ b/xml/System.Activities.Expressions/Subtract`3.xml @@ -104,11 +104,11 @@ if the subtraction executes in a checked context; otherwise, . The default is . - activity executes in a checked context and throws an if the subtraction causes an overflow. - + activity executes in a checked context and throws an if the subtraction causes an overflow. + ]]> diff --git a/xml/System.Activities.Expressions/ValueTypeFieldReference`2.xml b/xml/System.Activities.Expressions/ValueTypeFieldReference`2.xml index 633e447ec40..1362e44cd13 100644 --- a/xml/System.Activities.Expressions/ValueTypeFieldReference`2.xml +++ b/xml/System.Activities.Expressions/ValueTypeFieldReference`2.xml @@ -25,57 +25,57 @@ The field type. Represents a field on a value type that can be used as an l-value in an expression. - in an `Assign` activity to assign an integer value to a field and prints the field value to the console. The `Assign` activity is equivalent to the following statement when using the `struct` defined in the following example. `myStructVariable.AField = 1;`. - + in an `Assign` activity to assign an integer value to a field and prints the field value to the console. The `Assign` activity is equivalent to the following statement when using the `struct` defined in the following example. `myStructVariable.AField = 1;`. + > [!NOTE] -> Instead of instantiating the l-value expression activity directly, it is strongly recommended that you call , which provides a higher level of abstraction and enables you to implement your workflow more intuitively. - -```csharp - -// Define a struct with a field named AField. -struct StructWithField -{ - public int AField; -} - -public static void ValueTypeFieldReferenceSample() -{ - // Create a variable of type StructWithField to store the property. - var swfvar = new Variable("swfvar", new StructWithField()); - - Activity myActivity = new Sequence - { - Variables = { swfvar }, - Activities = - { - // Create an Assign activity to assign a value to the AField field. - new Assign - { - To = new ValueTypeFieldReference() - { - OperandLocation = swfvar, - FieldName = "AField", - }, - // Assign an integer value to AField. - Value = 1, - }, - // Print the new field value to the console. - new WriteLine() - { - Text = ExpressionServices.Convert(ctx => swfvar.Get(ctx).AField.ToString()), - } - } - }; - - // Invoke the Sequence activity. - WorkflowInvoker.Invoke(myActivity); -} - -``` - +> Instead of instantiating the l-value expression activity directly, it is strongly recommended that you call , which provides a higher level of abstraction and enables you to implement your workflow more intuitively. + +```csharp + +// Define a struct with a field named AField. +struct StructWithField +{ + public int AField; +} + +public static void ValueTypeFieldReferenceSample() +{ + // Create a variable of type StructWithField to store the property. + var swfvar = new Variable("swfvar", new StructWithField()); + + Activity myActivity = new Sequence + { + Variables = { swfvar }, + Activities = + { + // Create an Assign activity to assign a value to the AField field. + new Assign + { + To = new ValueTypeFieldReference() + { + OperandLocation = swfvar, + FieldName = "AField", + }, + // Assign an integer value to AField. + Value = 1, + }, + // Print the new field value to the console. + new WriteLine() + { + Text = ExpressionServices.Convert(ctx => swfvar.Get(ctx).AField.ToString()), + } + } + }; + + // Invoke the Sequence activity. + WorkflowInvoker.Invoke(myActivity); +} + +``` + ]]> diff --git a/xml/System.Activities.Expressions/ValueTypeIndexerReference`2.xml b/xml/System.Activities.Expressions/ValueTypeIndexerReference`2.xml index a6ee7b34b48..91fe6747dbc 100644 --- a/xml/System.Activities.Expressions/ValueTypeIndexerReference`2.xml +++ b/xml/System.Activities.Expressions/ValueTypeIndexerReference`2.xml @@ -34,10 +34,10 @@ in an `Assign` activity to assign a `string` value to the `struct` element at index 1 and prints the element value to the console. The `Assign` activity is equivalent to the following statement when using the `struct` defined in the following example: `myStructVariable[1] = "Hello";`. + The following code example uses in an `Assign` activity to assign a `string` value to the `struct` element at index 1 and prints the element value to the console. The `Assign` activity is equivalent to the following statement when using the `struct` defined in the following example: `myStructVariable[1] = "Hello";`. > [!NOTE] -> Instead of instantiating the l-value expression activity directly, it is strongly recommended that you call , which provides a higher level of abstraction and enables you to implement your workflow more intuitively. +> Instead of instantiating the l-value expression activity directly, it is strongly recommended that you call , which provides a higher level of abstraction and enables you to implement your workflow more intuitively. ```csharp @@ -195,7 +195,7 @@ property is read-only, but the items in the collection can be modified and the indices can be changed. + The property is read-only, but the items in the collection can be modified and the indices can be changed. ]]> diff --git a/xml/System.Activities.Expressions/ValueTypePropertyReference`2.xml b/xml/System.Activities.Expressions/ValueTypePropertyReference`2.xml index f45ce265135..bfbcec5808a 100644 --- a/xml/System.Activities.Expressions/ValueTypePropertyReference`2.xml +++ b/xml/System.Activities.Expressions/ValueTypePropertyReference`2.xml @@ -25,58 +25,58 @@ The property type. Represents a property on a value type that can be used as an l-value in an expression. - in an `Assign` activity to assign a `string` value to a property and prints the property value to the console. The `Assign` activity is equivalent to the following statement when using the `struct` defined in the following example: `myStructVariable.AProperty = "Hello";`. - + in an `Assign` activity to assign a `string` value to a property and prints the property value to the console. The `Assign` activity is equivalent to the following statement when using the `struct` defined in the following example: `myStructVariable.AProperty = "Hello";`. + > [!NOTE] -> Instead of instantiating the l-value expression activity directly, it is strongly recommended that you call , which provides a higher level of abstraction and enables you to implement your workflow more intuitively. - -```csharp - -// Define a struct with a property named AProperty. -struct StructWithProperty -{ - public string AProperty { get; set; } -} - -public static void ValueTypePropertyReferenceSample() -{ - // Create a variable of type StructWithProperty to store the property. - var swpvar = new Variable("swpvar", new StructWithProperty()); - - // Create the top-level activity to be invoked later. - Activity myActivity = new Sequence - { - Variables = { swpvar }, - Activities = - { - // Create an Assign activity for a property named AProperty. - new Assign - { - To = new ValueTypePropertyReference - { - OperandLocation = swpvar, - PropertyName = "AProperty", - }, - // Assign a string literal to AProperty. - Value = "Hello", - }, - // Create a WriteLine activity to write the value of AProperty to the console. - new WriteLine() - { - Text = ExpressionServices.Convert(ctx => swpvar.Get(ctx).AProperty), - } - } - }; - - // Invoke the Sequence activity. - WorkflowInvoker.Invoke(myActivity); -} - -``` - +> Instead of instantiating the l-value expression activity directly, it is strongly recommended that you call , which provides a higher level of abstraction and enables you to implement your workflow more intuitively. + +```csharp + +// Define a struct with a property named AProperty. +struct StructWithProperty +{ + public string AProperty { get; set; } +} + +public static void ValueTypePropertyReferenceSample() +{ + // Create a variable of type StructWithProperty to store the property. + var swpvar = new Variable("swpvar", new StructWithProperty()); + + // Create the top-level activity to be invoked later. + Activity myActivity = new Sequence + { + Variables = { swpvar }, + Activities = + { + // Create an Assign activity for a property named AProperty. + new Assign + { + To = new ValueTypePropertyReference + { + OperandLocation = swpvar, + PropertyName = "AProperty", + }, + // Assign a string literal to AProperty. + Value = "Hello", + }, + // Create a WriteLine activity to write the value of AProperty to the console. + new WriteLine() + { + Text = ExpressionServices.Convert(ctx => swpvar.Get(ctx).AProperty), + } + } + }; + + // Invoke the Sequence activity. + WorkflowInvoker.Invoke(myActivity); +} + +``` + ]]> diff --git a/xml/System.Activities.Expressions/VariableReference`1.xml b/xml/System.Activities.Expressions/VariableReference`1.xml index 429bb516aac..d1af9ff6ebd 100644 --- a/xml/System.Activities.Expressions/VariableReference`1.xml +++ b/xml/System.Activities.Expressions/VariableReference`1.xml @@ -177,7 +177,7 @@ property has been set then the string representation consists of the variable's name; otherwise, it consists of the activity ID and name. + If the property has been set then the string representation consists of the variable's name; otherwise, it consists of the activity ID and name. ]]> diff --git a/xml/System.Activities.Expressions/VariableValue`1.xml b/xml/System.Activities.Expressions/VariableValue`1.xml index e6b439216c0..658a5c17f98 100644 --- a/xml/System.Activities.Expressions/VariableValue`1.xml +++ b/xml/System.Activities.Expressions/VariableValue`1.xml @@ -177,7 +177,7 @@ property has been set then the string representation consists of the variable's name; otherwise, it consists of the activity ID and name. + If the property has been set then the string representation consists of the variable's name; otherwise, it consists of the activity ID and name. ]]> diff --git a/xml/System.Activities.Hosting/WorkflowInstance+WorkflowInstanceControl.xml b/xml/System.Activities.Hosting/WorkflowInstance+WorkflowInstanceControl.xml index aa1a7d27768..6309293f249 100644 --- a/xml/System.Activities.Hosting/WorkflowInstance+WorkflowInstanceControl.xml +++ b/xml/System.Activities.Hosting/WorkflowInstance+WorkflowInstanceControl.xml @@ -25,11 +25,11 @@ Aborts the . - is called, most APIs except throw an . - + is called, most APIs except throw an . + ]]> @@ -53,11 +53,11 @@ Aborts the . - is called, most APIs except throw an . - + is called, most APIs except throw an . + ]]> @@ -84,11 +84,11 @@ The reason for aborting the . Aborts the using the specified exception. - is called, most APIs except throw an . - + is called, most APIs except throw an . + ]]> @@ -670,11 +670,11 @@ Schedules the cancellation of the . - . - + . + ]]> diff --git a/xml/System.Activities.Hosting/WorkflowInstance.xml b/xml/System.Activities.Hosting/WorkflowInstance.xml index 1b7337adf65..80f8f1b8efd 100644 --- a/xml/System.Activities.Hosting/WorkflowInstance.xml +++ b/xml/System.Activities.Hosting/WorkflowInstance.xml @@ -23,21 +23,21 @@ ## Remarks is single threaded and assumes that the host synchronizes all access to it. An attempt to call multiple APIs simultaneously will result in an being thrown. - Internally, a has two states: Running and Paused. The only way to cause the runtime to transition from paused to running is to call . All actions (except Pause) can only be taken while the runtime is Paused. The runtime will become spontaneously Paused in the following situations: + Internally, a has two states: Running and Paused. The only way to cause the runtime to transition from paused to running is to call . All actions (except Pause) can only be taken while the runtime is Paused. The runtime will become spontaneously Paused in the following situations: -- An error fatal to the runtime has occurred. The host will be signaled through (which does not signal a transition to Paused) and then notified through . +- An error fatal to the runtime has occurred. The host will be signaled through (which does not signal a transition to Paused) and then notified through . -- An exception in the workflow was uncaught and escaped the root. The host will be notified through the method. +- An exception in the workflow was uncaught and escaped the root. The host will be notified through the method. -- The scheduler has run out of work items and is now . The host will be notified through the method. Note that the scheduler could have run out of work items because the instance is idle or because the instance is complete. The value of the property can be used to differentiate between the two. +- The scheduler has run out of work items and is now . The host will be notified through the method. Note that the scheduler could have run out of work items because the instance is idle or because the instance is complete. The value of the property can be used to differentiate between the two. - The host can request a change from Running to Paused by calling the or methods of the instance returned by the property. This request should not be considered to have a specific response meaning that the host should not attempt to correlate an OnNotify* or with a specific call to pause. In response to a pause request, the runtime may transition to Paused and call while the scheduler still has pending work items. The value of the property can be used to determine whether the scheduler has no more work or was interrupted by a request to pause. + The host can request a change from Running to Paused by calling the or methods of the instance returned by the property. This request should not be considered to have a specific response meaning that the host should not attempt to correlate an OnNotify* or with a specific call to pause. In response to a pause request, the runtime may transition to Paused and call while the scheduler still has pending work items. The value of the property can be used to determine whether the scheduler has no more work or was interrupted by a request to pause. - The method of the instance returned by the property is the only method that can be called while the is in the Running state. All other methods will throw an if called.Given the rules for how transitions from one state to another, the public notion of Running and Paused can be defined as follows: + The method of the instance returned by the property is the only method that can be called while the is in the Running state. All other methods will throw an if called.Given the rules for how transitions from one state to another, the public notion of Running and Paused can be defined as follows: -- Running - The state between a call to and the next WorkflowInstance.OnNotify*. +- Running - The state between a call to and the next WorkflowInstance.OnNotify*. -- Paused - The state between the last WorkflowInstance.OnNotify* and the next call to . +- Paused - The state between the last WorkflowInstance.OnNotify* and the next call to . ]]> @@ -351,7 +351,7 @@ returns `true`, an is thrown. + If this property is set after the workflow instance is initialized and returns `true`, an is thrown. ]]> @@ -802,7 +802,7 @@ is called, most APIs except will throw an . It is expected that after is called a host will trend toward a state in which it can satisfy the abort. + Once is called, most APIs except will throw an . It is expected that after is called a host will trend toward a state in which it can satisfy the abort. ]]> @@ -833,7 +833,7 @@ use the runtime type of the object as the type key. Extensions providers added through use the decared type T of the Func\ as the type key. Extension providers contributed by activities through the various *ActivityMetadata.AddDefaultExtensionProvider methods are dropped if a host extension exists for the declared type or if there is a broader type provided through AddDefaultExtensionProvider (ex. if Func\ is provided and Func\ is provided, only Func\ will be kept). If an extension does not exist in the collection that is required by an activity (expressed by calling *ActivityMetadata.RequireExtension) a is thrown. + Extensions are keyed by type, and a host provided extension will always be used if provided. Extensions added through use the runtime type of the object as the type key. Extensions providers added through use the decared type T of the Func\ as the type key. Extension providers contributed by activities through the various *ActivityMetadata.AddDefaultExtensionProvider methods are dropped if a host extension exists for the declared type or if there is a broader type provided through AddDefaultExtensionProvider (ex. if Func\ is provided and Func\ is provided, only Func\ will be kept). If an extension does not exist in the collection that is required by an activity (expressed by calling *ActivityMetadata.RequireExtension) a is thrown. ]]> @@ -889,7 +889,7 @@ returns `true`, an is thrown. + If this property is set after the workflow instance is initialized and returns `true`, an is thrown. ]]> @@ -917,7 +917,7 @@ returns `true`, then an is thrown. + If returns `true`, then an is thrown. ]]> diff --git a/xml/System.Activities.Hosting/WorkflowInstanceExtensionManager.xml b/xml/System.Activities.Hosting/WorkflowInstanceExtensionManager.xml index 58ddf0bc9a6..a2d1970cbda 100644 --- a/xml/System.Activities.Hosting/WorkflowInstanceExtensionManager.xml +++ b/xml/System.Activities.Hosting/WorkflowInstanceExtensionManager.xml @@ -63,13 +63,13 @@ The extension to add. Adds the specified extension to the collection of extensions. - overload. - - If any of the overloads are called after , an is thrown. - + overload. + + If any of the overloads are called after , an is thrown. + ]]> @@ -104,13 +104,13 @@ The method that creates the extension. Registers a that is used to provide an instance of an extension when requested by a workflow instance. - overload. - - If any of the overloads are called after , an is thrown. - + overload. + + If any of the overloads are called after , an is thrown. + ]]> @@ -134,11 +134,11 @@ Marks the collection of extensions as read-only. - overloads are called after , an is thrown. - + overloads are called after , an is thrown. + ]]> diff --git a/xml/System.Activities.Hosting/WorkflowInstanceProxy.xml b/xml/System.Activities.Hosting/WorkflowInstanceProxy.xml index e2a9c9065d2..52c6218ab76 100644 --- a/xml/System.Activities.Hosting/WorkflowInstanceProxy.xml +++ b/xml/System.Activities.Hosting/WorkflowInstanceProxy.xml @@ -56,11 +56,11 @@ Resumes a workflow from a bookmark asynchronously using the specified bookmark, value, callback method, and user-provided state data. A reference to the asynchronous operation. - . can be called from inside or outside of the callback method. If is called before the resume operation completes, it blocks until the resume operation completes. - + . can be called from inside or outside of the callback method. If is called before the resume operation completes, it blocks until the resume operation completes. + ]]> @@ -96,11 +96,11 @@ Resumes a workflow from a bookmark asynchronously using the specified bookmark, value, time-out interval, callback method, and user-provided state. A reference to the asynchronous operation. - . can be called from inside or outside of the callback method. If is called before the resume operation completes, it blocks until the resume operation completes. By default, the resume operation must complete in 30 seconds or a is thrown from . - + . can be called from inside or outside of the callback method. If is called before the resume operation completes, it blocks until the resume operation completes. By default, the resume operation must complete in 30 seconds or a is thrown from . + ]]> @@ -128,11 +128,11 @@ Waits for the pending asynchronous to complete. Returns . - operation was successful. If called before the resume operation completes, it blocks until the resume operation is complete. - + operation was successful. If called before the resume operation completes, it blocks until the resume operation is complete. + ]]> diff --git a/xml/System.Activities.Persistence/PersistenceParticipant.xml b/xml/System.Activities.Persistence/PersistenceParticipant.xml index 1ae66988556..845392836fe 100644 --- a/xml/System.Activities.Persistence/PersistenceParticipant.xml +++ b/xml/System.Activities.Persistence/PersistenceParticipant.xml @@ -16,38 +16,38 @@ This class allows both and to participate in persistence process. A persistence participant derives from the class or the class (derived class of the class), implements abstract methods, and then add an instance of the class as a workflow instance extension. The and look for such extensions when persisting an instance and invoke appropriate methods at appropriate times. - to the persistence provider. - -4. Performs I/O under the persistence transaction. - - A host completes a stage before beginning the next stage. For example when persisting, the host collects values from all the persistence participants before moving to the second stage. In the second stage, the host provides all the values collected in the first stage to all persistence participants in the second stage for mapping. In the third stage, the host provides all the collected values in the first and second stages to the persistence provider when invoking the . Then in the fourth stage, the host provides all the collected values to all the persistence IO participants under the persistence transaction. - - A host executes the following stages when loading a persistence instance: - -1. Issues the and to the persistence provider. - -2. Performs I/O under the persistence transaction. - -3. Publishes the loaded values. - - At the highest level, workflow instance extensions that derive from the class can participate in the first (Collect) and second (Map) stages of persisting process and the third stage (Publish) of loading process. Workflow instance extensions deriving from the PersistenceIOParticipant class can additionally participate in the fourth stage of the persisting process and the second stage of the loading process (I/O). - - - -## Examples - The following code sample demonstrates creating a class that derives from . This example is from the [Hiring Process](/dotnet/framework/windows-workflow-foundation/samples/hiring-process) sample. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_hiringrequestprocess/cs/hiringrequestservice/hiringrequestpersistenceparticipant.cs" id="Snippet1"::: - + to the persistence provider. + +4. Performs I/O under the persistence transaction. + + A host completes a stage before beginning the next stage. For example when persisting, the host collects values from all the persistence participants before moving to the second stage. In the second stage, the host provides all the values collected in the first stage to all persistence participants in the second stage for mapping. In the third stage, the host provides all the collected values in the first and second stages to the persistence provider when invoking the . Then in the fourth stage, the host provides all the collected values to all the persistence IO participants under the persistence transaction. + + A host executes the following stages when loading a persistence instance: + +1. Issues the and to the persistence provider. + +2. Performs I/O under the persistence transaction. + +3. Publishes the loaded values. + + At the highest level, workflow instance extensions that derive from the class can participate in the first (Collect) and second (Map) stages of persisting process and the third stage (Publish) of loading process. Workflow instance extensions deriving from the PersistenceIOParticipant class can additionally participate in the fourth stage of the persisting process and the second stage of the loading process (I/O). + + + +## Examples + The following code sample demonstrates creating a class that derives from . This example is from the [Hiring Process](/dotnet/framework/windows-workflow-foundation/samples/hiring-process) sample. + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_hiringrequestprocess/cs/hiringrequestservice/hiringrequestpersistenceparticipant.cs" id="Snippet1"::: + ]]> @@ -73,13 +73,13 @@ Initializes an instance of the class. - . This example is from the [Hiring Process](/dotnet/framework/windows-workflow-foundation/samples/hiring-process) sample. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_hiringrequestprocess/cs/hiringrequestservice/hiringrequestpersistenceparticipant.cs" id="Snippet1"::: - + . This example is from the [Hiring Process](/dotnet/framework/windows-workflow-foundation/samples/hiring-process) sample. + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_hiringrequestprocess/cs/hiringrequestservice/hiringrequestpersistenceparticipant.cs" id="Snippet1"::: + ]]> @@ -108,21 +108,21 @@ The write-only values to be persisted. A host invokes this method on a custom persistence participant to collect read-write values and write-only values, to be persisted. - objects of an collection, and packages write-only values in the second dictionary as objects with and flags set. For more information, see . - + objects of an collection, and packages write-only values in the second dictionary as objects with and flags set. For more information, see . + > [!IMPORTANT] -> Each value provided by implementations of across all persistence participants within one persistence episode must have a unique XName. - - - -## Examples - The following code sample demonstrates using CollectValues in a class that derives from . This example is from the [Persistence Participants](/dotnet/framework/windows-workflow-foundation/persistence-participants) sample. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_persistenceparticipants/cs/stepcountextension.cs" id="Snippet2"::: - +> Each value provided by implementations of across all persistence participants within one persistence episode must have a unique XName. + + + +## Examples + The following code sample demonstrates using CollectValues in a class that derives from . This example is from the [Persistence Participants](/dotnet/framework/windows-workflow-foundation/persistence-participants) sample. + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_persistenceparticipants/cs/stepcountextension.cs" id="Snippet2"::: + ]]> @@ -152,18 +152,18 @@ A host invokes this method after it is done with collecting the values in the first stage. The host forwards two read-only dictionaries of values it collected from all persistence participants during the first stage (CollectValues stage) to this method for mapping. The host adds values in the dictionary returned by this method to the collection of write-only values. A dictionary containing additional write-only values to be persisted. - methods across all persistence participants including all the values collected in the first stage (CollectValues stage) must have a unique XName. - - - -## Examples - The following code sample demonstrates using MapValues in a class that derives from . This example is from the [Corporate Purchase Process](/dotnet/framework/windows-workflow-foundation/samples/corporate-purchase-process) sample. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_purchaseprocess/cs/xmlpersistenceparticipant.cs" id="Snippet2"::: - + methods across all persistence participants including all the values collected in the first stage (CollectValues stage) must have a unique XName. + + + +## Examples + The following code sample demonstrates using MapValues in a class that derives from . This example is from the [Corporate Purchase Process](/dotnet/framework/windows-workflow-foundation/samples/corporate-purchase-process) sample. + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_purchaseprocess/cs/xmlpersistenceparticipant.cs" id="Snippet2"::: + ]]> @@ -190,13 +190,13 @@ The read-write values that were loaded from the persistence store. This dictionary corresponds to the dictionary of read-write values persisted in the most recent persistence episode. The host invokes this method and passes all the loaded values in the collection (filled by the or ) as a dictionary parameter. - . This example is from the [Persistence Participants](/dotnet/framework/windows-workflow-foundation/persistence-participants) sample. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_persistenceparticipants/cs/stepcountextension.cs" id="Snippet2"::: - + . This example is from the [Persistence Participants](/dotnet/framework/windows-workflow-foundation/persistence-participants) sample. + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_persistenceparticipants/cs/stepcountextension.cs" id="Snippet2"::: + ]]> diff --git a/xml/System.Activities.Presentation.Converters/ModelToObjectValueConverter.xml b/xml/System.Activities.Presentation.Converters/ModelToObjectValueConverter.xml index 22100cbbb2e..bce32b95955 100644 --- a/xml/System.Activities.Presentation.Converters/ModelToObjectValueConverter.xml +++ b/xml/System.Activities.Presentation.Converters/ModelToObjectValueConverter.xml @@ -20,11 +20,11 @@ Converts a to the value of the inner object. - @@ -118,11 +118,11 @@ Returns the specified value, unmodified. An object that contains the unmodified value. - can accept the value without modification. - + can accept the value without modification. + ]]> diff --git a/xml/System.Activities.Presentation.Metadata/AttributeCallback.xml b/xml/System.Activities.Presentation.Metadata/AttributeCallback.xml index 3597e3fdb7e..8d7803c79c2 100644 --- a/xml/System.Activities.Presentation.Metadata/AttributeCallback.xml +++ b/xml/System.Activities.Presentation.Metadata/AttributeCallback.xml @@ -22,13 +22,13 @@ An that can be used to add attributes. Called when attributes are needed for a type. - method of the class. - - objects can build attributes only for the type that is requesting metadata. - + method of the class. + + objects can build attributes only for the type that is requesting metadata. + ]]> diff --git a/xml/System.Activities.Presentation.Metadata/AttributeCallbackBuilder.xml b/xml/System.Activities.Presentation.Metadata/AttributeCallbackBuilder.xml index 0a3fae3801a..e87d1375521 100644 --- a/xml/System.Activities.Presentation.Metadata/AttributeCallbackBuilder.xml +++ b/xml/System.Activities.Presentation.Metadata/AttributeCallbackBuilder.xml @@ -16,11 +16,11 @@ Provides access to add attributes for one specific type to one specific . - is queried for attributes for a type, if the was populated using for that type, the delegate is passed a . The removes the callback reference and adds any attribute information provided by calls to . - + is queried for attributes for a type, if the was populated using for that type, the delegate is passed a . The removes the callback reference and adds any attribute information provided by calls to . + ]]> @@ -33,13 +33,13 @@ Adds the contents of the provided attributes to the attribute table that created this builder. - . - + . + ]]> @@ -73,13 +73,13 @@ The attributes that are added to the table. Adds the contents of the provided attributes to the attribute table that created this builder. - . - + . + ]]> @@ -117,13 +117,13 @@ The attributes that are added to the table. Adds the contents of the provided attributes to the attribute table that created this builder. - . - + . + ]]> @@ -161,13 +161,13 @@ The attributes that are added to the table. Adds the contents of the provided attributes to the attribute table that created this builder. - . - + . + ]]> @@ -205,13 +205,13 @@ The attributes that are added to the table. Adds the contents of the provided attributes to the attribute table that created this builder. - . - + . + ]]> @@ -249,13 +249,13 @@ The attributes that are added to the table. Adds the contents of the provided attributes to the attribute table that created this builder. - . - + . + ]]> @@ -287,11 +287,11 @@ The type to which attributes will be added. The type to which attributes will be added. - diff --git a/xml/System.Activities.Presentation.Metadata/AttributeTableBuilder.xml b/xml/System.Activities.Presentation.Metadata/AttributeTableBuilder.xml index a064c894fb4..0c81b093c66 100644 --- a/xml/System.Activities.Presentation.Metadata/AttributeTableBuilder.xml +++ b/xml/System.Activities.Presentation.Metadata/AttributeTableBuilder.xml @@ -16,11 +16,11 @@ Creates and populates an that is used by the to provide attribute lookup and registration. - , , and to populate the builder, then call to acquire an containing the desired collection of attributes. - + , , and to populate the builder, then call to acquire an containing the desired collection of attributes. + ]]> @@ -66,11 +66,11 @@ The callback method. Specifies a callback that will be invoked when metadata for the given type is needed. - returned by is queried for attributes for `type`, `callback` is called to provide the metadata information. - + returned by is queried for attributes for `type`, `callback` is called to provide the metadata information. + ]]> @@ -83,13 +83,13 @@ Adds the contents of the provided attributes to this builder. - to defer the work of creating attributes until they are needed. - + to defer the work of creating attributes until they are needed. + ]]> @@ -125,13 +125,13 @@ The attributes that are added to the builder. Adds the contents of the provided attributes to this builder. - to defer the work of creating attributes until they are needed. - + to defer the work of creating attributes until they are needed. + ]]> @@ -171,13 +171,13 @@ The attributes that are added to the builder. Adds the contents of the provided attributes to this builder. - to defer the work of creating attributes until they are needed. - + to defer the work of creating attributes until they are needed. + ]]> @@ -217,13 +217,13 @@ The attributes that are added to the builder. Adds the contents of the provided attributes to this builder. - to defer the work of creating attributes until they are needed. - + to defer the work of creating attributes until they are needed. + ]]> @@ -263,13 +263,13 @@ The attributes that are added to the builder. Adds the contents of the provided attributes to this builder. - to defer the work of creating attributes until they are needed. - + to defer the work of creating attributes until they are needed. + ]]> @@ -309,13 +309,13 @@ The attributes that are added to the builder. Adds the contents of the provided attributes to this builder. - to defer the work of creating attributes until they are needed. - + to defer the work of creating attributes until they are needed. + ]]> @@ -344,11 +344,11 @@ The source attribute table. Adds the contents of the provided attribute table to this builder. - @@ -375,13 +375,13 @@ Creates an attribute table that contains all of the attribute definitions provided through calls. An that can be passed to the metadata store. - calls are not included in the table. - - If callback methods were used to declare attributes, those methods will not be evaluated during . Instead, the table will contain those callbacks and will evaluate them as needed. - + calls are not included in the table. + + If callback methods were used to declare attributes, those methods will not be evaluated during . Instead, the table will contain those callbacks and will evaluate them as needed. + ]]> @@ -405,11 +405,11 @@ Verifies that the attribute table that is being built contains valid attribute information. - cannot validate that values passed to their parameters represent valid members on classes. verifies that all custom attribute information corresponds to actual members. This method can take a long time to complete and is not recommended unless validation is explicitly needed. - + cannot validate that values passed to their parameters represent valid members on classes. verifies that all custom attribute information corresponds to actual members. This method can take a long time to complete and is not recommended unless validation is explicitly needed. + ]]> the state of the table is invalid. diff --git a/xml/System.Activities.Presentation.Metadata/IRegisterMetadata.xml b/xml/System.Activities.Presentation.Metadata/IRegisterMetadata.xml index b7e50a4181b..ddabd0b1165 100644 --- a/xml/System.Activities.Presentation.Metadata/IRegisterMetadata.xml +++ b/xml/System.Activities.Presentation.Metadata/IRegisterMetadata.xml @@ -13,11 +13,11 @@ Specifies a class that will add extra attributes to the metadata store. - types provide a way to encapsulate the association of design-time attributes to run-time types in a loosely coupled fashion. An application hosting the Windows Workflow Designer can use the interface to register the attributes for the activity. For instance, Visual Studio 2010 searches for types that implement when assemblies that contain these types are loaded in addition to also looking for types in the *.design assemblies. - + types provide a way to encapsulate the association of design-time attributes to run-time types in a loosely coupled fashion. An application hosting the Windows Workflow Designer can use the interface to register the attributes for the activity. For instance, Visual Studio 2010 searches for types that implement when assemblies that contain these types are loaded in addition to also looking for types in the *.design assemblies. + ]]> @@ -41,11 +41,11 @@ Adds additional metadata to the metadata store upon initialization of the designer. - to add data to the metadata store. - + to add data to the metadata store. + ]]> diff --git a/xml/System.Activities.Presentation.Model/AttachedProperty.xml b/xml/System.Activities.Presentation.Model/AttachedProperty.xml index 87bf605c418..d7213787771 100644 --- a/xml/System.Activities.Presentation.Model/AttachedProperty.xml +++ b/xml/System.Activities.Presentation.Model/AttachedProperty.xml @@ -16,11 +16,11 @@ Used in order to associate or attach additional information to the instance of an object. - is useful as items in the `View` can bind to the values and react to changes. For instance, this is the way that the selected item template is displayed (it keys off of an attached property for selection). - + is useful as items in the `View` can bind to the values and react to changes. For instance, this is the way that the selected item template is displayed (it keys off of an attached property for selection). + ]]> @@ -97,11 +97,11 @@ if the is browsable; otherwise, . - will be discoverable within the collection of the to which it is attached. - + will be discoverable within the collection of the to which it is attached. + ]]> diff --git a/xml/System.Activities.Presentation.Model/ModelEditingScope.xml b/xml/System.Activities.Presentation.Model/ModelEditingScope.xml index 51c289841c6..7241e2a8c64 100644 --- a/xml/System.Activities.Presentation.Model/ModelEditingScope.xml +++ b/xml/System.Activities.Presentation.Model/ModelEditingScope.xml @@ -20,11 +20,11 @@ Represents a group of changes to the editing store. Change groups are transactional. The changes made under an editing scope can be committed or aborted as a unit. - method is called, or the editing scope is disposed of before is called, the editing scope will instead reverse the changes made to the underlying objects, reapplying state from the editing store. This provides a solid basis for an undo mechanism. - + method is called, or the editing scope is disposed of before is called, the editing scope will instead reverse the changes made to the underlying objects, reapplying state from the editing store. This provides a solid basis for an undo mechanism. + ]]> @@ -161,11 +161,11 @@ Disposes of this object by aborting changes unless the editing scope has already been completed or reverted. - with the input parameter set to `true`. - + with the input parameter set to `true`. + ]]> @@ -192,11 +192,11 @@ Determines whether the changes should be reverted as part of an undo operation or because the object is being finalized. Disposes of this object by aborting changes. - if `disposing` is set to `true`. - + if `disposing` is set to `true`. + ]]> @@ -246,11 +246,11 @@ if the exception is handled; otherwise, . - and methods call this method to handle exceptions. - + and methods call this method to handle exceptions. + ]]> @@ -298,11 +298,11 @@ Abandons the changes made during the editing scope. - with the input parameter set to `false`. - + with the input parameter set to `false`. + ]]> The group of changes has already been committed. diff --git a/xml/System.Activities.Presentation.Model/ModelItem.xml b/xml/System.Activities.Presentation.Model/ModelItem.xml index e597ae5abe6..e9d88bea663 100644 --- a/xml/System.Activities.Presentation.Model/ModelItem.xml +++ b/xml/System.Activities.Presentation.Model/ModelItem.xml @@ -23,12 +23,12 @@ collection and make changes to the values of the properties. + You can access the item's properties through its collection and make changes to the values of the properties. - A is a wrapper around the underlying data model of the designer. You can access the underlying model through the method. + A is a wrapper around the underlying data model of the designer. You can access the underlying model through the method. > [!NOTE] -> Any changes you make to an object returned from the method will not be reflected by the serialization and undo systems of the designer. +> Any changes you make to an object returned from the method will not be reflected by the serialization and undo systems of the designer. @@ -58,7 +58,7 @@ public class Location ``` - Secondly, create an instance of that `Animal` and a that is a proxy for it. The object can then be retrieved by calling . The following code also shows how to use other properties defined by . + Secondly, create an instance of that `Animal` and a that is a proxy for it. The object can then be retrieved by calling . The following code also shows how to use other properties defined by . ```csharp @@ -324,7 +324,7 @@ Assert.AreEqual(root.Properties["Residence"], location.Source, "sources point to method can return either an existing or new cloned instance of the object. + You can inspect this object, but you should not make any changes to it. Changes made to the object returned will not be incorporated into the designer. The method can return either an existing or new cloned instance of the object. ]]> @@ -373,7 +373,7 @@ Assert.AreEqual(root.Properties["Residence"], location.Source, "sources point to on an item. If the of this item declares a `RuntimeNamePropertyAttribute`, the property is a direct mapping to the property dictated by that attribute. + Not all items need to have names, so this might return `null`. Depending on the type of item and where it sits in the hierarchy, it might not always be legal to set the on an item. If the of this item declares a `RuntimeNamePropertyAttribute`, the property is a direct mapping to the property dictated by that attribute. ]]> diff --git a/xml/System.Activities.Presentation.Model/ModelItemCollection.xml b/xml/System.Activities.Presentation.Model/ModelItemCollection.xml index a63f88c88fd..f1162457c12 100644 --- a/xml/System.Activities.Presentation.Model/ModelItemCollection.xml +++ b/xml/System.Activities.Presentation.Model/ModelItemCollection.xml @@ -319,7 +319,7 @@ session. If an object is added to the during a session, the value will not be updated until the session exits. + This value is not updated during an session. If an object is added to the during a session, the value will not be updated until the session exits. ]]> diff --git a/xml/System.Activities.Presentation.Model/ModelProperty.xml b/xml/System.Activities.Presentation.Model/ModelProperty.xml index f3ca4eb240e..e9a0b48c164 100644 --- a/xml/System.Activities.Presentation.Model/ModelProperty.xml +++ b/xml/System.Activities.Presentation.Model/ModelProperty.xml @@ -16,11 +16,11 @@ A represents a property on a . Model properties are associated with an instance of an item, which allows them to have simple Value get/set properties instead of using the more cumbersome GetValue/SetValue mechanism of . - may come from a locally set value, or it may be inherited from somewhere higher up in the element hierarchy. Use the property of the value returned by to determine the source of the property value. - + may come from a locally set value, or it may be inherited from somewhere higher up in the element hierarchy. Use the property of the value returned by to determine the source of the property value. + ]]> @@ -109,11 +109,11 @@ Clears the local value for the property. - instead. - + instead. + ]]> @@ -137,11 +137,11 @@ Returns cast as a . Returns the property value as a , or . - @@ -186,11 +186,11 @@ Returns the type converter to use with this property. Returns a for use with this property. - objects. When performing a conversion to a particular value, the type converter's return type is not wrapped. Type converters that return standard values also return values as objects. - + objects. When performing a conversion to a particular value, the type converter's return type is not wrapped. Type converters that return standard values also return values as objects. + ]]> @@ -559,14 +559,14 @@ Sets a local value on a property. Returns as a . - , it is wrapped in a , which is returned to the caller. It is valid to set `value` to `null`, in which case will be `null`. This is different from calling . - + , it is wrapped in a , which is returned to the caller. It is valid to set `value` to `null`, in which case will be `null`. This is different from calling . + > [!NOTE] -> Using this method, the value will not be set on the underlying property until the editing context completes. To update the underlying property immediately, use . - +> Using this method, the value will not be set on the underlying property until the editing context completes. To update the underlying property immediately, use . + ]]> @@ -590,11 +590,11 @@ Returns the value set into this property. Returns the property value as a , or . - is not `this`. If no value has ever been set for the property will return `null`. - + is not `this`. If no value has ever been set for the property will return `null`. + ]]> diff --git a/xml/System.Activities.Presentation.Model/ModelPropertyCollection.xml b/xml/System.Activities.Presentation.Model/ModelPropertyCollection.xml index 0db5da74aac..7e2f0783156 100644 --- a/xml/System.Activities.Presentation.Model/ModelPropertyCollection.xml +++ b/xml/System.Activities.Presentation.Model/ModelPropertyCollection.xml @@ -20,11 +20,11 @@ Contains an enumeration of properties. - . - + . + ]]> diff --git a/xml/System.Activities.Presentation.PropertyEditing/DialogPropertyValueEditor.xml b/xml/System.Activities.Presentation.PropertyEditing/DialogPropertyValueEditor.xml index 66a2199c30e..f8bee37e5f8 100644 --- a/xml/System.Activities.Presentation.PropertyEditing/DialogPropertyValueEditor.xml +++ b/xml/System.Activities.Presentation.PropertyEditing/DialogPropertyValueEditor.xml @@ -131,7 +131,7 @@ method is called instead. + If this property returns `null`, the method is called instead. ]]> diff --git a/xml/System.Activities.Presentation.PropertyEditing/ExtendedPropertyValueEditor.xml b/xml/System.Activities.Presentation.PropertyEditing/ExtendedPropertyValueEditor.xml index 87c577a18f2..92571e6501d 100644 --- a/xml/System.Activities.Presentation.PropertyEditing/ExtendedPropertyValueEditor.xml +++ b/xml/System.Activities.Presentation.PropertyEditing/ExtendedPropertyValueEditor.xml @@ -91,7 +91,7 @@ is set to a . + When used, its is set to a . ]]> @@ -129,7 +129,7 @@ is set to a . + Its is set to a . ]]> diff --git a/xml/System.Activities.Presentation.PropertyEditing/PropertyValue.xml b/xml/System.Activities.Presentation.PropertyEditing/PropertyValue.xml index 0b96b96df30..8c8f6d7430d 100644 --- a/xml/System.Activities.Presentation.PropertyEditing/PropertyValue.xml +++ b/xml/System.Activities.Presentation.PropertyEditing/PropertyValue.xml @@ -85,11 +85,11 @@ if exceptions are caught; if exceptions are propagated to the caller. - event. - + event. + ]]> @@ -228,11 +228,11 @@ if the type supports sub-properties; otherwise, . - to verify whether sub-properties exist. - + to verify whether sub-properties exist. + ]]> @@ -301,11 +301,11 @@ if multiple objects contain this property; otherwise, . - will return null and will return . - + will return null and will return . + ]]> diff --git a/xml/System.Activities.Presentation.Toolbox/ToolboxCategory.xml b/xml/System.Activities.Presentation.Toolbox/ToolboxCategory.xml index 275c6177dad..7bfc0f74b90 100644 --- a/xml/System.Activities.Presentation.Toolbox/ToolboxCategory.xml +++ b/xml/System.Activities.Presentation.Toolbox/ToolboxCategory.xml @@ -32,9 +32,9 @@ collection contains items of type that are added and removed from an instance of the collection using the and methods. + The collection contains items of type that are added and removed from an instance of the collection using the and methods. - The class implements the interface. This allows the collection that is storing the toolbox items to provide notifications when properties like the property are changed and methods like and are used to change the contents of the collection. + The class implements the interface. This allows the collection that is storing the toolbox items to provide notifications when properties like the property are changed and methods like and are used to change the contents of the collection. ]]> @@ -95,7 +95,7 @@ collection can be an empty `string`. This is the value assigned by the parameterless constructor, . + The name assigned to the collection can be an empty `string`. This is the value assigned by the parameterless constructor, . ]]> @@ -396,7 +396,7 @@ ## Remarks Enumerators can be used to read the data in a collection, but they cannot be used to modify the underlying collection. - Initially, the enumerator is positioned before the first element in the collection. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is no longer valid and its behavior is undefined. + Initially, the enumerator is positioned before the first element in the collection. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is no longer valid and its behavior is undefined. The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread-safe procedure. diff --git a/xml/System.Activities.Presentation.Toolbox/ToolboxCategoryItems.xml b/xml/System.Activities.Presentation.Toolbox/ToolboxCategoryItems.xml index a31125f7fc3..78c46e39a03 100644 --- a/xml/System.Activities.Presentation.Toolbox/ToolboxCategoryItems.xml +++ b/xml/System.Activities.Presentation.Toolbox/ToolboxCategoryItems.xml @@ -243,7 +243,7 @@ ## Remarks Enumerators can be used to read the data in a collection, but they cannot be used to modify the underlying collection. - Initially, the enumerator is positioned before the first element in the collection. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is no longer valid and its behavior is undefined. + Initially, the enumerator is positioned before the first element in the collection. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is no longer valid and its behavior is undefined. The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread-safe procedure. @@ -509,7 +509,7 @@ ## Remarks Enumerators can be used to read the data in a collection, but they cannot be used to modify the underlying collection. - Initially, the enumerator is positioned before the first element in the collection. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is no longer valid and its behavior is undefined. + Initially, the enumerator is positioned before the first element in the collection. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is no longer valid and its behavior is undefined. The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread-safe procedure. diff --git a/xml/System.Activities.Presentation.Toolbox/ToolboxControl.xml b/xml/System.Activities.Presentation.Toolbox/ToolboxControl.xml index f6c8095b6cf..a10ebc1d1c9 100644 --- a/xml/System.Activities.Presentation.Toolbox/ToolboxControl.xml +++ b/xml/System.Activities.Presentation.Toolbox/ToolboxControl.xml @@ -36,7 +36,7 @@ This class provides support for representing the toolbox controls when re-hosting the Windows Workflow Designer outside of Visual Studio. It implements . The contains a collection of toolbox categories that hold various categories of tools that can be accessed with the property. It also is able to retrieve the with which it is associated using the property. > [!WARNING] -> For activities to load properly in the toolbox, the assembly that contains the activities must be loaded first. Use to load the activity type if it is contained in a different assembly; using instead will cause an exception to be thrown. +> For activities to load properly in the toolbox, the assembly that contains the activities must be loaded first. Use to load the activity type if it is contained in a different assembly; using instead will cause an exception to be thrown. ]]> @@ -232,7 +232,7 @@ method is invoked by the method. implements , which, in turn, implements . + The method is invoked by the method. implements , which, in turn, implements . ]]> diff --git a/xml/System.Activities.Presentation.Toolbox/ToolboxItemWrapper.xml b/xml/System.Activities.Presentation.Toolbox/ToolboxItemWrapper.xml index 95ba4035fe8..62772811743 100644 --- a/xml/System.Activities.Presentation.Toolbox/ToolboxItemWrapper.xml +++ b/xml/System.Activities.Presentation.Toolbox/ToolboxItemWrapper.xml @@ -56,7 +56,7 @@ , , , and properties with an empty `string`. + The parameterless constructor initializes the , , , and properties with an empty `string`. ]]> @@ -84,7 +84,7 @@ and properties can be extracted from the `toolType` parameter. The and properties are each initialized with an empty `string`. + The and properties can be extracted from the `toolType` parameter. The and properties are each initialized with an empty `string`. ]]> @@ -114,7 +114,7 @@ and properties can be extracted from the `toolType` parameter. The property is initialized with an empty `string`. + The and properties can be extracted from the `toolType` parameter. The property is initialized with an empty `string`. ]]> @@ -146,7 +146,7 @@ and properties can be extracted from the `toolType` parameter. + The and properties can be extracted from the `toolType` parameter. ]]> diff --git a/xml/System.Activities.Presentation.View/DesignerView.xml b/xml/System.Activities.Presentation.View/DesignerView.xml index 47d88d733e8..185a31a6c84 100644 --- a/xml/System.Activities.Presentation.View/DesignerView.xml +++ b/xml/System.Activities.Presentation.View/DesignerView.xml @@ -1326,7 +1326,7 @@ method to set this property to a representation of a . + Call the method to set this property to a representation of a . ]]> diff --git a/xml/System.Activities.Presentation.View/ExpressionTextBox.xml b/xml/System.Activities.Presentation.View/ExpressionTextBox.xml index 596197f7853..8630405beab 100644 --- a/xml/System.Activities.Presentation.View/ExpressionTextBox.xml +++ b/xml/System.Activities.Presentation.View/ExpressionTextBox.xml @@ -35,54 +35,54 @@ Describes a control that enables the user to edit an expression in an activity designer. - provides features such as IntelliSense when editing an expression. Such features are provided by a component called the hostable editor. The expression editing interface is extensible and the editor used for editing expressions can be replaced. - + provides features such as IntelliSense when editing an expression. Such features are provided by a component called the hostable editor. The expression editing interface is extensible and the editor used for editing expressions can be replaced. + > [!NOTE] -> This component is not available for use in applications that are being re-hosted outside Visual Studio. - - **ExpressionTextBlock** works in the following manner when you edit an expression. - -1. When you click on an **ExpressionTextBox**, an object is created and a hostable editor session is instantiated in Visual Studio. - -2. When you type inside a hostable editor, note that the features have two sorts of availability. - - 1. IntelliSense, completion and colorization support is available immediately. - - 2. Validation is called in the background and is available only after a short interval of time elapses. Then, if your expression is invalid, the hosted compiler reports the error and the red error icon displays to the right of your expression. - -3. Press the **Enter** key when the **ExpressionTextBox** has the focus to insert new lines in the object. This causes a line commit to occur inside the hostable editor, which triggers a pretty listing and the display of squiggles. - -4. The editor instance is destroyed when the **ExpressionTextBox** loses the focus, and the display reverts to a **TextBlock**. If you are on the designer surface or in the property grid, the change to the model item is committed and all controls displaying that same expression are synchronized. However, if you are in a dialog box, the change to the model item is not committed until you click OK. When the model item is committed, is invoked and the entire workflow is validated. - -5. When you click on the **ExpressionTextBox** again, a new editor instance is created. In the hostable editor, pretty listing, colorization, and squiggling occurs before you begin editing. - - To bind the expression text box to **OwnerActivity**, use to set the data context correctly. The following code sample demonstrates setting the data context correctly for binding to **OwnerActivity**. - -``` - - - - - - - -``` - - For more information, see and . Also see the [Using the ExpressionTextBox in a Custom Activity Designer](/dotnet/framework/windows-workflow-foundation/samples/using-the-expressiontextbox-in-a-custom-activity-designer) sample topic. - - - +> This component is not available for use in applications that are being re-hosted outside Visual Studio. + + **ExpressionTextBlock** works in the following manner when you edit an expression. + +1. When you click on an **ExpressionTextBox**, an object is created and a hostable editor session is instantiated in Visual Studio. + +2. When you type inside a hostable editor, note that the features have two sorts of availability. + + 1. IntelliSense, completion and colorization support is available immediately. + + 2. Validation is called in the background and is available only after a short interval of time elapses. Then, if your expression is invalid, the hosted compiler reports the error and the red error icon displays to the right of your expression. + +3. Press the **Enter** key when the **ExpressionTextBox** has the focus to insert new lines in the object. This causes a line commit to occur inside the hostable editor, which triggers a pretty listing and the display of squiggles. + +4. The editor instance is destroyed when the **ExpressionTextBox** loses the focus, and the display reverts to a **TextBlock**. If you are on the designer surface or in the property grid, the change to the model item is committed and all controls displaying that same expression are synchronized. However, if you are in a dialog box, the change to the model item is not committed until you click OK. When the model item is committed, is invoked and the entire workflow is validated. + +5. When you click on the **ExpressionTextBox** again, a new editor instance is created. In the hostable editor, pretty listing, colorization, and squiggling occurs before you begin editing. + + To bind the expression text box to **OwnerActivity**, use to set the data context correctly. The following code sample demonstrates setting the data context correctly for binding to **OwnerActivity**. + +``` + + + + + + + +``` + + For more information, see and . Also see the [Using the ExpressionTextBox in a Custom Activity Designer](/dotnet/framework/windows-workflow-foundation/samples/using-the-expressiontextbox-in-a-custom-activity-designer) sample topic. + + + ## Examples The is usually used declaratively when creating custom activity designers. - + ]]> @@ -308,11 +308,11 @@ The is usually used Occurs when the expression editor loses logical focus. - @@ -398,11 +398,11 @@ The is usually used Gets or sets the expression. The expression. - is always required. When using the declaratively to bind to arguments, you must always use the to bind the expression to the argument, setting the `ConverterParameter` to `In` or `Out` depending on the direction of the argument. - + is always required. When using the declaratively to bind to arguments, you must always use the to bind the expression to the argument, setting the `ConverterParameter` to `In` or `Out` depending on the direction of the argument. + ]]> @@ -534,11 +534,11 @@ The is usually used Gets or sets the expression type. The expression type. - , you can't use the to bind to delegate types and you do not get validation from the hosted compiler. This compiler validation checks to see if the type of the entered expression matches the expected type, and displays a red box around the **ExpressionTextBox** when invalid data is entered into it on an activity designer. - + , you can't use the to bind to delegate types and you do not get validation from the hosted compiler. This compiler validation checks to see if the type of the entered expression matches the expected type, and displays a red box around the **ExpressionTextBox** when invalid data is entered into it on an activity designer. + ]]> @@ -717,11 +717,11 @@ The is usually used Initializes this form. - @@ -1077,9 +1077,9 @@ The is usually used Gets or sets the owner activity. The owner activity. - @@ -1254,11 +1254,11 @@ The is usually used The target. Attaches events and names to compiled content. - @@ -1322,11 +1322,11 @@ The is usually used if this instance uses the location expression; otherwise, . - to an `Out` argument, you would set this property to `True`. - + to an `Out` argument, you would set this property to `True`. + ]]> diff --git a/xml/System.Activities.Presentation.View/IExpressionEditorInstance.xml b/xml/System.Activities.Presentation.View/IExpressionEditorInstance.xml index 29661609847..7b83c6be057 100644 --- a/xml/System.Activities.Presentation.View/IExpressionEditorInstance.xml +++ b/xml/System.Activities.Presentation.View/IExpressionEditorInstance.xml @@ -13,11 +13,11 @@ Represents an expression editor instance. - . - + . + ]]> @@ -575,11 +575,11 @@ if the editor instance has aggregate focus; otherwise, . - or any other control created by the has focus. - + or any other control created by the has focus. + ]]> @@ -667,11 +667,11 @@ Represents an event that is raised when the expression editor instance loses aggregate focus. - and every control created by the loose focus. - + and every control created by the loose focus. + ]]> diff --git a/xml/System.Activities.Presentation.View/Selection.xml b/xml/System.Activities.Presentation.View/Selection.xml index c909c8f6bdc..93836e84838 100644 --- a/xml/System.Activities.Presentation.View/Selection.xml +++ b/xml/System.Activities.Presentation.View/Selection.xml @@ -16,11 +16,11 @@ Defines a selection of objects that are published as a in the . - . - + . + ]]> @@ -77,11 +77,11 @@ A parameter array of objects that should be selected. Creates a object with the specified objects selected. - @@ -105,11 +105,11 @@ An enumeration of objects that should be selected. Creates a object with the specified objects selected. - If is . @@ -134,11 +134,11 @@ An enumeration of objects that should be selected. Creates a object with the specified objects selected. - If is . @@ -165,11 +165,11 @@ The criteria for including objects. Only those objects in that match the predicate will be added to the selection. Creates a object with the specified objects selected. - If or is . @@ -196,11 +196,11 @@ The criteria for including objects. Only those objects in that match the predicate will be added to the selection. Creates a object with the specified objects selected. - If or is . @@ -225,11 +225,11 @@ Returns the item type for this editing context item. Returns typeof(). - . When you create a derived class, override this property to return the of the derived type. - + . When you create a derived class, override this property to return the of the derived type. + ]]> diff --git a/xml/System.Activities.Presentation.View/ViewStateService.xml b/xml/System.Activities.Presentation.View/ViewStateService.xml index a0db4e13f23..85c2b6f3bf7 100644 --- a/xml/System.Activities.Presentation.View/ViewStateService.xml +++ b/xml/System.Activities.Presentation.View/ViewStateService.xml @@ -19,7 +19,7 @@ is an abstract class. Derived classes must store view states when is called, and retrieve them when is called. + This is useful so that the state can keep being retrieved when control of the application goes and comes with postbacks. is an abstract class. Derived classes must store view states when is called, and retrieve them when is called. ]]> @@ -102,7 +102,7 @@ to initially store view state information so that it can be retrieved. + Call to initially store view state information so that it can be retrieved. ]]> @@ -136,7 +136,7 @@ to initially store view state information so that it can be retrieved. + Call to initially store view state information so that it can be retrieved. ]]> @@ -171,7 +171,7 @@ and passing the same values for `modelItem` and `key`. + You can retrieve the stored object by calling and passing the same values for `modelItem` and `key`. ]]> @@ -206,7 +206,7 @@ and passing the same values for `modelItem` and `key`. + You can retrieve the stored object by calling and passing the same values for `modelItem` and `key`. ]]> diff --git a/xml/System.Activities.Presentation.View/VirtualizedContainerService.xml b/xml/System.Activities.Presentation.View/VirtualizedContainerService.xml index f7bf68567bc..2ba5afe254d 100644 --- a/xml/System.Activities.Presentation.View/VirtualizedContainerService.xml +++ b/xml/System.Activities.Presentation.View/VirtualizedContainerService.xml @@ -16,12 +16,12 @@ Represents a virtual container service associated with an editing context and design view. The virtual container service is used to customize the UI virtualization behavior. - @@ -97,11 +97,11 @@ Attempts to get a value for the Hint Size Name property. The destination for the value. - does not throw an exception if the property is not found in the store. - + does not throw an exception if the property is not found in the store. + ]]> @@ -151,11 +151,11 @@ Provides a XAML type system identifier. - type plus "HintSize". - + type plus "HintSize". + ]]> @@ -184,11 +184,11 @@ The value set. Attempts to set a value for the Hint Size Name property. - object; therefore the string must be formatted using en-us culture. - + object; therefore the string must be formatted using en-us culture. + ]]> diff --git a/xml/System.Activities.Presentation/ActivityDesigner.xml b/xml/System.Activities.Presentation/ActivityDesigner.xml index b55cd542db7..9ec016aa068 100644 --- a/xml/System.Activities.Presentation/ActivityDesigner.xml +++ b/xml/System.Activities.Presentation/ActivityDesigner.xml @@ -19,7 +19,7 @@ and properties of the activity). + This type provides the basic look-and-feel functionality for other activity designers and allows a developer to add additional capabilities to an activity designer surface. This is typically done in order to either display additional interesting information to the user of the activity, create a better on canvas editing experience (for example, using the `ExpressionTextBox` on an `If` activity designer), or to allow contained elements to be edited (again, consider the and properties of the activity). The inherits from and primarily adds the default styling, as well as the ability to customize the icon via the property. It should be used whenever you are creating a designer for a type that derives from . When associated with an type, the property will point to the ModelItem hierarchy describing the instance of that type being edited. diff --git a/xml/System.Activities.Presentation/ArgumentAccessor.xml b/xml/System.Activities.Presentation/ArgumentAccessor.xml index 8c7df9eabe3..a2353e8d453 100644 --- a/xml/System.Activities.Presentation/ArgumentAccessor.xml +++ b/xml/System.Activities.Presentation/ArgumentAccessor.xml @@ -75,11 +75,11 @@ Gets or sets the method to set an argument into an activity instance. The method to set an argument into an activity instance. - will set the value in the editing context, which will not update the underlying value until the editing context completes. - + will set the value in the editing context, which will not update the underlying value until the editing context completes. + ]]> diff --git a/xml/System.Activities.Presentation/CachedResourceDictionaryExtension.xml b/xml/System.Activities.Presentation/CachedResourceDictionaryExtension.xml index 6f4c7c1fed3..7a31cf4ae3a 100644 --- a/xml/System.Activities.Presentation/CachedResourceDictionaryExtension.xml +++ b/xml/System.Activities.Presentation/CachedResourceDictionaryExtension.xml @@ -22,11 +22,11 @@ Provides a cached dictionary that associates resource dictionaries with their URIs. - class that provides XAML markup extensions. Markup extensions return objects based on string attribute values or markup elements in XAML. The method of each extension can use an object at run time that can provide context. - + class that provides XAML markup extensions. Markup extensions return objects based on string attribute values or markup elements in XAML. The method of each extension can use an object at run time that can provide context. + ]]> @@ -77,11 +77,11 @@ Returns an object that is set as the value of the target property for this markup extension. The value to set on the property where the extension is applied. - method of each extension can use an object at run time that can provide context. - + method of each extension can use an object at run time that can provide context. + ]]> diff --git a/xml/System.Activities.Presentation/ContextItemManager.xml b/xml/System.Activities.Presentation/ContextItemManager.xml index 6d3fd0e87e1..f3747a4ed9e 100644 --- a/xml/System.Activities.Presentation/ContextItemManager.xml +++ b/xml/System.Activities.Presentation/ContextItemManager.xml @@ -115,7 +115,7 @@ method, which must be implemented for this method to provide the type checking functionality. + This generic method invokes the abstract method, which must be implemented for this method to provide the type checking functionality. ]]> @@ -231,7 +231,7 @@ method, which must be implemented for this method to provide the get type functionality. + This generic method invokes the abstract method, which must be implemented for this method to provide the get type functionality. ]]> @@ -295,7 +295,7 @@ method. + Use this method in your implementations of the method. ]]> diff --git a/xml/System.Activities.Presentation/EditingContext.xml b/xml/System.Activities.Presentation/EditingContext.xml index 5476f395cca..81304a6ac72 100644 --- a/xml/System.Activities.Presentation/EditingContext.xml +++ b/xml/System.Activities.Presentation/EditingContext.xml @@ -20,11 +20,11 @@ Contains contextual state information for a designer, such as the . This includes permanent state information, such as the list of services running in the designer. It also includes transient state consisting of context items including the set of currently selected objects as well as the editing tool being used to manipulate objects on the design surface. - represents the communication boundary that is shared between the hosting application and the Windows Workflow Designer. The was implemented as a concrete class for ease of use. Override and to use customized managers derived from and . - + represents the communication boundary that is shared between the hosting application and the Windows Workflow Designer. The was implemented as a concrete class for ease of use. Override and to use customized managers derived from and . + ]]> @@ -72,11 +72,11 @@ Creates an instance of the context item manager that is returned by the property. An instance of the context item manager that is returned by the property. - that supports delayed activation of design editor managers through the declaration of a attribute on the design editor manager. - + that supports delayed activation of design editor managers through the declaration of a attribute on the design editor manager. + ]]> @@ -101,11 +101,11 @@ Creates an instance of the service manager to be returned from the property. A object. - that supports delayed activation of design editor managers through the declaration of a attribute on the design editor manager. - + that supports delayed activation of design editor managers through the declaration of a attribute on the design editor manager. + ]]> @@ -208,11 +208,11 @@ Returns the local collection of context items stored by the current editing context. The collection of objects used in this editing context. - collection is for data that is shared between a host and the designer. This data provides the mechanism needed to hook into subscription and change notification. - + collection is for data that is shared between a host and the designer. This data provides the mechanism needed to hook into subscription and change notification. + ]]> @@ -236,11 +236,11 @@ Returns the service manager used in the current editing context. The used in this editing context. - represent functionality that is either provided by the host for the designer to use or that is used by the designer to make functionality available to all designers within the editor. - + represent functionality that is either provided by the host for the designer to use or that is used by the designer to make functionality available to all designers within the editor. + ]]> diff --git a/xml/System.Activities.Presentation/IModalService.xml b/xml/System.Activities.Presentation/IModalService.xml index 2023c4f38de..2dc55ffad1a 100644 --- a/xml/System.Activities.Presentation/IModalService.xml +++ b/xml/System.Activities.Presentation/IModalService.xml @@ -13,17 +13,17 @@ Enables notification to a host application that a modal dialog is displayed. - interface provides an interface to communicate the current modal status. - - The Windows Workflow Designer calls the method. When the `isModal` parameter is set to `true`, the host is notified that a modal dialog is displayed. - - This is an optional service. If a host application does not care about the modal status, you need not use the service. - - In the current implementation, if a Windows Presentation Foundation (WPF) message box (which is a modal dialog) is invoked, the is not called. If the host application requires this information, another workaround must be created. - + interface provides an interface to communicate the current modal status. + + The Windows Workflow Designer calls the method. When the `isModal` parameter is set to `true`, the host is notified that a modal dialog is displayed. + + This is an optional service. If a host application does not care about the modal status, you need not use the service. + + In the current implementation, if a Windows Presentation Foundation (WPF) message box (which is a modal dialog) is invoked, the is not called. If the host application requires this information, another workaround must be created. + ]]> diff --git a/xml/System.Activities.Presentation/ServiceManager.xml b/xml/System.Activities.Presentation/ServiceManager.xml index 05908bafc2a..802cf6f6bb8 100644 --- a/xml/System.Activities.Presentation/ServiceManager.xml +++ b/xml/System.Activities.Presentation/ServiceManager.xml @@ -29,7 +29,7 @@ represent functionality that is either provided by the host for the designer to use or that is used by the designer to make functionality available to all designers within the editor. It is obtained from the by the property. + represent functionality that is either provided by the host for the designer to use or that is used by the designer to make functionality available to all designers within the editor. It is obtained from the by the property. ]]> @@ -163,7 +163,7 @@ , this method throws a if the service is not available. + Unlike , this method throws a if the service is not available. ]]> diff --git a/xml/System.Activities.Presentation/WorkflowDesigner.xml b/xml/System.Activities.Presentation/WorkflowDesigner.xml index c6cc7fff951..97eac5a5dae 100644 --- a/xml/System.Activities.Presentation/WorkflowDesigner.xml +++ b/xml/System.Activities.Presentation/WorkflowDesigner.xml @@ -67,7 +67,7 @@ - Use , which executes whenever the model is assigned to, or when the value the property points to is updated. -- Subscribe to the dependency property's availability using . +- Subscribe to the dependency property's availability using . ]]> @@ -396,7 +396,7 @@ to convert the current workflow to text. After setting this value, call to load the XAML into the workflow. + Before getting this value, call to convert the current workflow to text. After setting this value, call to load the XAML into the workflow. ]]> diff --git a/xml/System.Activities.Presentation/WorkflowItemsPresenter.xml b/xml/System.Activities.Presentation/WorkflowItemsPresenter.xml index 2f3411fec79..ead88c42324 100644 --- a/xml/System.Activities.Presentation/WorkflowItemsPresenter.xml +++ b/xml/System.Activities.Presentation/WorkflowItemsPresenter.xml @@ -448,7 +448,7 @@ is based on a vertically oriented `StackPanel`. As an illustration, the `ItemsPanel` for the designer of activities is based on a horizontally oriented `StackPanel`. + By providing a custom panel template, you can customize and control the layout of the contained items. The default is based on a vertically oriented `StackPanel`. As an illustration, the `ItemsPanel` for the designer of activities is based on a horizontally oriented `StackPanel`. @@ -635,7 +635,7 @@ , it is removed. + If `modelItem` is in , it is removed. ]]> diff --git a/xml/System.Activities.Statements/Catch`1.xml b/xml/System.Activities.Statements/Catch`1.xml index 1a470c6545a..3dec4e310b0 100644 --- a/xml/System.Activities.Statements/Catch`1.xml +++ b/xml/System.Activities.Statements/Catch`1.xml @@ -30,18 +30,18 @@ The type of exception that the block is handling. Contains the actions to be executed after an exception is raised in the corresponding Try block of a activity. - activities cannot be reordered in the designer. To reorder the collection of activities, either delete and re-add them in the correct order, or use the xaml (code) view for the workflow. - - - -## Examples - The following code sample demonstrates creating a activity. This example is from the [Fault Handling in a Flowchart Activity Using TryCatch](/dotnet/framework/windows-workflow-foundation/samples/fault-handling-in-a-flowchart-activity-using-trycatch) sample. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_flowchartwithfaulthandling/cs/program.cs" id="Snippet1"::: - + activities cannot be reordered in the designer. To reorder the collection of activities, either delete and re-add them in the correct order, or use the xaml (code) view for the workflow. + + + +## Examples + The following code sample demonstrates creating a activity. This example is from the [Fault Handling in a Flowchart Activity Using TryCatch](/dotnet/framework/windows-workflow-foundation/samples/fault-handling-in-a-flowchart-activity-using-trycatch) sample. + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_flowchartwithfaulthandling/cs/program.cs" id="Snippet1"::: + ]]> @@ -67,13 +67,13 @@ Creates a new instance of the class. - activity. This example is from the [Fault Handling in a Flowchart Activity Using TryCatch](/dotnet/framework/windows-workflow-foundation/samples/fault-handling-in-a-flowchart-activity-using-trycatch) sample. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_flowchartwithfaulthandling/cs/program.cs" id="Snippet1"::: - + activity. This example is from the [Fault Handling in a Flowchart Activity Using TryCatch](/dotnet/framework/windows-workflow-foundation/samples/fault-handling-in-a-flowchart-activity-using-trycatch) sample. + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_flowchartwithfaulthandling/cs/program.cs" id="Snippet1"::: + ]]> @@ -111,18 +111,18 @@ The handler for the exception being caught. The activity action. - object. - - - -## Examples - The following code sample demonstrates assigning the Action property of a activity. This example is from the [Fault Handling in a Flowchart Activity Using TryCatch](/dotnet/framework/windows-workflow-foundation/samples/fault-handling-in-a-flowchart-activity-using-trycatch) sample. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_flowchartwithfaulthandling/cs/program.cs" id="Snippet1"::: - + object. + + + +## Examples + The following code sample demonstrates assigning the Action property of a activity. This example is from the [Fault Handling in a Flowchart Activity Using TryCatch](/dotnet/framework/windows-workflow-foundation/samples/fault-handling-in-a-flowchart-activity-using-trycatch) sample. + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_flowchartwithfaulthandling/cs/program.cs" id="Snippet1"::: + ]]> diff --git a/xml/System.Activities.Statements/CompensableActivity.xml b/xml/System.Activities.Statements/CompensableActivity.xml index 972ec998bf7..6312c87920d 100644 --- a/xml/System.Activities.Statements/CompensableActivity.xml +++ b/xml/System.Activities.Statements/CompensableActivity.xml @@ -25,11 +25,11 @@ An activity that supports compensation of its child activities. - allows a developer to specify a activity that defines a long-running task that performs their core business logic. It also allows the developer to optionally specify a compensation and confirmation activity to schedule appropriate business logic in the event of errors or successful completion of the . Compensation and confirmation of a is invoked by using the returned by the . is an opaque, typed object returned after successful completion of a activity's . This is used by the and activities to explicitly invoke confirmation and compensation of a . can be composed in a nested hierarchical fashion in the workflow. For more information, see [Compensation Programming Model](/previous-versions/dd489415(v=vs.100)). - + allows a developer to specify a activity that defines a long-running task that performs their core business logic. It also allows the developer to optionally specify a compensation and confirmation activity to schedule appropriate business logic in the event of errors or successful completion of the . Compensation and confirmation of a is invoked by using the returned by the . is an opaque, typed object returned after successful completion of a activity's . This is used by the and activities to explicitly invoke confirmation and compensation of a . can be composed in a nested hierarchical fashion in the workflow. For more information, see [Compensation Programming Model](/previous-versions/dd489415(v=vs.100)). + ]]> @@ -88,11 +88,11 @@ Gets or sets the activity that is scheduled when the executes. The activity that is scheduled when the executes. - is thrown. - + is thrown. + ]]> @@ -182,13 +182,13 @@ Gets or sets the activity that is scheduled when the activity is canceled. The activity that is scheduled when the activity is canceled. - can be used to specify custom cancellation logic for the of the . - - This property is read-only at runtime. If the value is set at runtime, an is thrown. - + can be used to specify custom cancellation logic for the of the . + + This property is read-only at runtime. If the value is set at runtime, an is thrown. + ]]> @@ -251,13 +251,13 @@ Gets or sets the activity that is scheduled when compensation is performed on the . The activity that is scheduled when compensation is performed on the . - can be used to specify custom compensation logic for the of the . - - This property is read-only at runtime. If the value is set at runtime, an is thrown. - + can be used to specify custom compensation logic for the of the . + + This property is read-only at runtime. If the value is set at runtime, an is thrown. + ]]> @@ -299,13 +299,13 @@ Gets or sets the activity that is scheduled when confirmation is performed for this . The activity that is scheduled when confirmation is performed for this . - can be used to specify custom confirmation logic for the of the . - - This property is read-only at runtime. If the value is set at runtime, an is thrown. - + can be used to specify custom confirmation logic for the of the . + + This property is read-only at runtime. If the value is set at runtime, an is thrown. + ]]> diff --git a/xml/System.Activities.Statements/Compensate.xml b/xml/System.Activities.Statements/Compensate.xml index b4024a717c5..3b6a4c5395e 100644 --- a/xml/System.Activities.Statements/Compensate.xml +++ b/xml/System.Activities.Statements/Compensate.xml @@ -140,13 +140,13 @@ Gets or sets the that contains the for this activity. A that contains the for this . - of the is specified, the activity explicitly invokes the compensation handler of , which returns the . When the of the is not specified, the activity invokes the default compensation for any child activities in the reverse order of successful completion. An is thrown if the refers to a that was previously confirmed or compensated. - - This property is read-only at runtime. If the value is set at runtime, an is raised. - + of the is specified, the activity explicitly invokes the compensation handler of , which returns the . When the of the is not specified, the activity invokes the default compensation for any child activities in the reverse order of successful completion. An is thrown if the refers to a that was previously confirmed or compensated. + + This property is read-only at runtime. If the value is set at runtime, an is raised. + ]]> diff --git a/xml/System.Activities.Statements/Confirm.xml b/xml/System.Activities.Statements/Confirm.xml index b00de42f12d..457a62857fb 100644 --- a/xml/System.Activities.Statements/Confirm.xml +++ b/xml/System.Activities.Statements/Confirm.xml @@ -136,13 +136,13 @@ Gets or sets the that contains the for this activity. The that contains the for this activity. - of the is specified, the activity explicitly invokes the confirmation handler of the , which returns the . When the of the is not specified, the activity executes the default confirmation for any child activities in the reverse order of successful completion. An is thrown if the refers to a that was previously confirmed or compensated. - - This property is read-only at runtime. If the value is set at runtime, an is raised. - + of the is specified, the activity explicitly invokes the confirmation handler of the , which returns the . When the of the is not specified, the activity executes the default confirmation for any child activities in the reverse order of successful completion. An is thrown if the refers to a that was previously confirmed or compensated. + + This property is read-only at runtime. If the value is set at runtime, an is raised. + ]]> diff --git a/xml/System.Activities.Statements/FlowSwitch`1.xml b/xml/System.Activities.Statements/FlowSwitch`1.xml index b249cd1c95c..263fc9f06f6 100644 --- a/xml/System.Activities.Statements/FlowSwitch`1.xml +++ b/xml/System.Activities.Statements/FlowSwitch`1.xml @@ -26,13 +26,13 @@ The type of the expression to evaluate against cases. A specialized that allows modeling a switch construct, with one expression and one outcome for each match. - node. This example is from the [Fault Handling in a Flowchart Activity Using TryCatch](/dotnet/framework/windows-workflow-foundation/samples/fault-handling-in-a-flowchart-activity-using-trycatch) sample. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_flowchartwithfaulthandling/cs/program.cs" id="Snippet5"::: - + node. This example is from the [Fault Handling in a Flowchart Activity Using TryCatch](/dotnet/framework/windows-workflow-foundation/samples/fault-handling-in-a-flowchart-activity-using-trycatch) sample. + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_flowchartwithfaulthandling/cs/program.cs" id="Snippet5"::: + ]]> @@ -52,13 +52,13 @@ Creates a new instance of the class. - node. This example is from the [Fault Handling in a Flowchart Activity Using TryCatch](/dotnet/framework/windows-workflow-foundation/samples/fault-handling-in-a-flowchart-activity-using-trycatch) sample. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_flowchartwithfaulthandling/cs/program.cs" id="Snippet5"::: - + node. This example is from the [Fault Handling in a Flowchart Activity Using TryCatch](/dotnet/framework/windows-workflow-foundation/samples/fault-handling-in-a-flowchart-activity-using-trycatch) sample. + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_flowchartwithfaulthandling/cs/program.cs" id="Snippet5"::: + ]]> @@ -88,18 +88,18 @@ Gets a dictionary of cases to be processed by the element. The collection of cases. - and a corresponding to execute. - - - -## Examples - The following code sample demonstrates setting the Cases property of a node. This example is from the [Fault Handling in a Flowchart Activity Using TryCatch](/dotnet/framework/windows-workflow-foundation/samples/fault-handling-in-a-flowchart-activity-using-trycatch) sample. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_flowchartwithfaulthandling/cs/program.cs" id="Snippet5"::: - + and a corresponding to execute. + + + +## Examples + The following code sample demonstrates setting the Cases property of a node. This example is from the [Fault Handling in a Flowchart Activity Using TryCatch](/dotnet/framework/windows-workflow-foundation/samples/fault-handling-in-a-flowchart-activity-using-trycatch) sample. + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_flowchartwithfaulthandling/cs/program.cs" id="Snippet5"::: + ]]> @@ -137,13 +137,13 @@ The to be executed if no elements in the collection match the result of the evaluation of the . The default to execute. - node. This example is from the [Fault Handling in a Flowchart Activity Using TryCatch](/dotnet/framework/windows-workflow-foundation/samples/fault-handling-in-a-flowchart-activity-using-trycatch) sample. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_flowchartwithfaulthandling/cs/program.cs" id="Snippet5"::: - + node. This example is from the [Fault Handling in a Flowchart Activity Using TryCatch](/dotnet/framework/windows-workflow-foundation/samples/fault-handling-in-a-flowchart-activity-using-trycatch) sample. + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_flowchartwithfaulthandling/cs/program.cs" id="Snippet5"::: + ]]> @@ -208,13 +208,13 @@ The expression to evaluate against the collection of . The expression to evaluate. - node. This example is from the [Fault Handling in a Flowchart Activity Using TryCatch](/dotnet/framework/windows-workflow-foundation/samples/fault-handling-in-a-flowchart-activity-using-trycatch) sample. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_flowchartwithfaulthandling/cs/program.cs" id="Snippet5"::: - + node. This example is from the [Fault Handling in a Flowchart Activity Using TryCatch](/dotnet/framework/windows-workflow-foundation/samples/fault-handling-in-a-flowchart-activity-using-trycatch) sample. + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_flowchartwithfaulthandling/cs/program.cs" id="Snippet5"::: + ]]> diff --git a/xml/System.Activities.Statements/Flowchart.xml b/xml/System.Activities.Statements/Flowchart.xml index f46e96ce6d1..0ccfd6f128a 100644 --- a/xml/System.Activities.Statements/Flowchart.xml +++ b/xml/System.Activities.Statements/Flowchart.xml @@ -22,18 +22,18 @@ Represents the models workflows using the familiar flowchart paradigm. - activity allows free-form creation of a workflow using nodes and links. - - - -## Examples - The following code sample demonstrates creating a activity. This example is from the [Fault Handling in a Flowchart Activity Using TryCatch](/dotnet/framework/windows-workflow-foundation/samples/fault-handling-in-a-flowchart-activity-using-trycatch) sample. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_flowchartwithfaulthandling/cs/program.cs" id="Snippet2"::: - + activity allows free-form creation of a workflow using nodes and links. + + + +## Examples + The following code sample demonstrates creating a activity. This example is from the [Fault Handling in a Flowchart Activity Using TryCatch](/dotnet/framework/windows-workflow-foundation/samples/fault-handling-in-a-flowchart-activity-using-trycatch) sample. + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_flowchartwithfaulthandling/cs/program.cs" id="Snippet2"::: + ]]> @@ -53,13 +53,13 @@ Creates a new instance of the class. - activity. This example is from the [Fault Handling in a Flowchart Activity Using TryCatch](/dotnet/framework/windows-workflow-foundation/samples/fault-handling-in-a-flowchart-activity-using-trycatch) sample. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_flowchartwithfaulthandling/cs/program.cs" id="Snippet2"::: - + activity. This example is from the [Fault Handling in a Flowchart Activity Using TryCatch](/dotnet/framework/windows-workflow-foundation/samples/fault-handling-in-a-flowchart-activity-using-trycatch) sample. + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_flowchartwithfaulthandling/cs/program.cs" id="Snippet2"::: + ]]> @@ -137,13 +137,13 @@ Gets or sets the collection of objects contained by the flowchart. A collection of objects. - activity. This example is from the [Fault Handling in a Flowchart Activity Using TryCatch](/dotnet/framework/windows-workflow-foundation/samples/fault-handling-in-a-flowchart-activity-using-trycatch) sample. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_flowchartwithfaulthandling/cs/program.cs" id="Snippet2"::: - + activity. This example is from the [Fault Handling in a Flowchart Activity Using TryCatch](/dotnet/framework/windows-workflow-foundation/samples/fault-handling-in-a-flowchart-activity-using-trycatch) sample. + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_flowchartwithfaulthandling/cs/program.cs" id="Snippet2"::: + ]]> @@ -207,18 +207,18 @@ Gets or sets the to be executed when the flowchart starts. The starting node. - . - - - -## Examples - The following code sample demonstrates configuring the StartNode of a activity. This example is from the [Fault Handling in a Flowchart Activity Using TryCatch](/dotnet/framework/windows-workflow-foundation/samples/fault-handling-in-a-flowchart-activity-using-trycatch) sample. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_flowchartwithfaulthandling/cs/program.cs" id="Snippet2"::: - + . + + + +## Examples + The following code sample demonstrates configuring the StartNode of a activity. This example is from the [Fault Handling in a Flowchart Activity Using TryCatch](/dotnet/framework/windows-workflow-foundation/samples/fault-handling-in-a-flowchart-activity-using-trycatch) sample. + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_flowchartwithfaulthandling/cs/program.cs" id="Snippet2"::: + ]]> @@ -294,13 +294,13 @@ Gets or sets the collection of objects associated with the , which are available to share state across the child activities contained within the Flowchart. The collection of variables. - activity. This example is from the [Fault Handling in a Flowchart Activity Using TryCatch](/dotnet/framework/windows-workflow-foundation/samples/fault-handling-in-a-flowchart-activity-using-trycatch) sample. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_flowchartwithfaulthandling/cs/program.cs" id="Snippet2"::: - + activity. This example is from the [Fault Handling in a Flowchart Activity Using TryCatch](/dotnet/framework/windows-workflow-foundation/samples/fault-handling-in-a-flowchart-activity-using-trycatch) sample. + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_flowchartwithfaulthandling/cs/program.cs" id="Snippet2"::: + ]]> diff --git a/xml/System.Activities.Statements/ForEach`1.xml b/xml/System.Activities.Statements/ForEach`1.xml index 3ca6d9323c6..286d1719898 100644 --- a/xml/System.Activities.Statements/ForEach`1.xml +++ b/xml/System.Activities.Statements/ForEach`1.xml @@ -26,17 +26,17 @@ The type of the values provided in the collection. Executes an activity action once for each value provided in the collection. - is similar to the keyword `foreach` but is implemented as an activity rather than a language statement. Note that unlike `foreach` in C#, the activity uses , rather than . - + is similar to the keyword `foreach` but is implemented as an activity rather than a language statement. Note that unlike `foreach` in C#, the activity uses , rather than . + ## Examples -The following code sample demonstrates creating a activity. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_dynamicactivitycreation/cs/program.cs" id="Snippet1"::: - +The following code sample demonstrates creating a activity. + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_dynamicactivitycreation/cs/program.cs" id="Snippet1"::: + ]]> @@ -56,14 +56,14 @@ The following code sample demonstrates creating a Creates a new instance of the class. - activity. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_dynamicactivitycreation/cs/program.cs" id="Snippet1"::: - +The following code sample demonstrates creating a activity. + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_dynamicactivitycreation/cs/program.cs" id="Snippet1"::: + ]]> @@ -101,14 +101,14 @@ The following code sample demonstrates creating a The to be executed for each item in the collection. The action to be executed. - activity. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_dynamicactivitycreation/cs/program.cs" id="Snippet1"::: - +The following code sample demonstrates setting the Body property of a activity. + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_dynamicactivitycreation/cs/program.cs" id="Snippet1"::: + ]]> @@ -224,14 +224,14 @@ The following code sample demonstrates setting the Body property of a The activity's collection of inputs for the execution of the activity action. The collection of values. - activity. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_dynamicactivitycreation/cs/program.cs" id="Snippet1"::: - +The following code sample demonstrates setting the Values property of a activity. + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_dynamicactivitycreation/cs/program.cs" id="Snippet1"::: + ]]> diff --git a/xml/System.Activities.Statements/Parallel.xml b/xml/System.Activities.Statements/Parallel.xml index 4e517cf163d..5010d898b96 100644 --- a/xml/System.Activities.Statements/Parallel.xml +++ b/xml/System.Activities.Statements/Parallel.xml @@ -25,7 +25,7 @@ activity operates by simultaneously scheduling each in its collection at the start. It completes when all of its complete or when its property evaluates to `true`. While all the objects run asynchronously, they do not execute on separate threads, so each successive activity only executes when the previously scheduled activity completes or goes idle. If none of the child activities of this activity go idle, this activity execute in the same way that a activity does. + A activity operates by simultaneously scheduling each in its collection at the start. It completes when all of its complete or when its property evaluates to `true`. While all the objects run asynchronously, they do not execute on separate threads, so each successive activity only executes when the previously scheduled activity completes or goes idle. If none of the child activities of this activity go idle, this activity execute in the same way that a activity does. @@ -197,7 +197,7 @@ The following code sample demonstrates setting the Branches property of a collection are canceled. If this property is not set, all objects in the collection execute until completion. + If this property evaluates to `true`, then the other scheduled elements in the collection are canceled. If this property is not set, all objects in the collection execute until completion. ## Examples diff --git a/xml/System.Activities.Statements/ParallelForEach`1.xml b/xml/System.Activities.Statements/ParallelForEach`1.xml index 1c5337609f0..37597f27f0e 100644 --- a/xml/System.Activities.Statements/ParallelForEach`1.xml +++ b/xml/System.Activities.Statements/ParallelForEach`1.xml @@ -26,18 +26,18 @@ The type of the values provided in the collection. Enumerates the elements of a collection and executes an embedded statement for each element of the collection in parallel. - , or activities that derive from ), they do not run on separate threads, so each successive activity will only execute when the previously scheduled activity completes or goes idle. If none of the child activities of this activity are asynchronous or go idle, this activity execute in the same way that a activity does. - - - -## Examples - The following code sample demonstrates creating a activity. This example is from the [Corporate Purchase Process](/dotnet/framework/windows-workflow-foundation/samples/corporate-purchase-process) sample. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_purchaseprocess/cs/purchaseprocessworkflow.cs" id="Snippet1"::: - + , or activities that derive from ), they do not run on separate threads, so each successive activity will only execute when the previously scheduled activity completes or goes idle. If none of the child activities of this activity are asynchronous or go idle, this activity execute in the same way that a activity does. + + + +## Examples + The following code sample demonstrates creating a activity. This example is from the [Corporate Purchase Process](/dotnet/framework/windows-workflow-foundation/samples/corporate-purchase-process) sample. + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_purchaseprocess/cs/purchaseprocessworkflow.cs" id="Snippet1"::: + ]]> @@ -63,13 +63,13 @@ Creates a new instance of the class. - activity. This example is from the [Corporate Purchase Process](/dotnet/framework/windows-workflow-foundation/samples/corporate-purchase-process) sample. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_purchaseprocess/cs/purchaseprocessworkflow.cs" id="Snippet1"::: - + activity. This example is from the [Corporate Purchase Process](/dotnet/framework/windows-workflow-foundation/samples/corporate-purchase-process) sample. + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_purchaseprocess/cs/purchaseprocessworkflow.cs" id="Snippet1"::: + ]]> @@ -107,13 +107,13 @@ The that is executed once for every value contained in the collection. The contained activity action. - activity. This example is from the [Corporate Purchase Process](/dotnet/framework/windows-workflow-foundation/samples/corporate-purchase-process) sample. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_purchaseprocess/cs/purchaseprocessworkflow.cs" id="Snippet1"::: - + activity. This example is from the [Corporate Purchase Process](/dotnet/framework/windows-workflow-foundation/samples/corporate-purchase-process) sample. + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_purchaseprocess/cs/purchaseprocessworkflow.cs" id="Snippet1"::: + ]]> @@ -175,11 +175,11 @@ Evaluated after each iteration completes. The completion expression. - @@ -271,13 +271,13 @@ The collection of values used as parameters for each iteration of the activity contained in the . The collection of values. - activity. This example is from the [Corporate Purchase Process](/dotnet/framework/windows-workflow-foundation/samples/corporate-purchase-process) sample. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_purchaseprocess/cs/purchaseprocessworkflow.cs" id="Snippet1"::: - + activity. This example is from the [Corporate Purchase Process](/dotnet/framework/windows-workflow-foundation/samples/corporate-purchase-process) sample. + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_purchaseprocess/cs/purchaseprocessworkflow.cs" id="Snippet1"::: + ]]> diff --git a/xml/System.Activities.Statements/Pick.xml b/xml/System.Activities.Statements/Pick.xml index 854295bd3f5..6e0ac0d779e 100644 --- a/xml/System.Activities.Statements/Pick.xml +++ b/xml/System.Activities.Statements/Pick.xml @@ -22,16 +22,16 @@ Provides event-based control flow modeling. - in that it executes only one of several activities in response to events. The action chosen to be executed is defined by an event, chosen from a set of events. - -## Examples - The following code sample demonstrates creating a activity. This example is from the [Using the Pick Activity](/dotnet/framework/windows-workflow-foundation/samples/using-the-pick-activity) sample. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_pick/cs/program.cs" id="Snippet1"::: - + in that it executes only one of several activities in response to events. The action chosen to be executed is defined by an event, chosen from a set of events. + +## Examples + The following code sample demonstrates creating a activity. This example is from the [Using the Pick Activity](/dotnet/framework/windows-workflow-foundation/samples/using-the-pick-activity) sample. + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_pick/cs/program.cs" id="Snippet1"::: + ]]> @@ -51,13 +51,13 @@ Creates a new instance of the class. - activity. This example is from the [Using the Pick Activity](/dotnet/framework/windows-workflow-foundation/samples/using-the-pick-activity) sample. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_pick/cs/program.cs" id="Snippet1"::: - + activity. This example is from the [Using the Pick Activity](/dotnet/framework/windows-workflow-foundation/samples/using-the-pick-activity) sample. + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_pick/cs/program.cs" id="Snippet1"::: + ]]> @@ -81,13 +81,13 @@ The collection of objects that the activity potentially executes one of, based on incoming events. The branch collection. - activity. This example is from the [Using the Pick Activity](/dotnet/framework/windows-workflow-foundation/samples/using-the-pick-activity) sample. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_pick/cs/program.cs" id="Snippet1"::: - + activity. This example is from the [Using the Pick Activity](/dotnet/framework/windows-workflow-foundation/samples/using-the-pick-activity) sample. + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_pick/cs/program.cs" id="Snippet1"::: + ]]> diff --git a/xml/System.Activities.Statements/PickBranch.xml b/xml/System.Activities.Statements/PickBranch.xml index ce8c4035730..9d351be39b2 100644 --- a/xml/System.Activities.Statements/PickBranch.xml +++ b/xml/System.Activities.Statements/PickBranch.xml @@ -22,18 +22,18 @@ A potential path of execution within a activity. - contains a and an . At the beginning of a element's execution, all the trigger activities from all elements are scheduled. When the first (leftmost) activity completes, the corresponding action activity is scheduled, and all other trigger activities are canceled. - - - -## Examples - The following code sample demonstrates creating a activity. This example is from the [Using the Pick Activity](/dotnet/framework/windows-workflow-foundation/samples/using-the-pick-activity) sample. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_pick/cs/program.cs" id="Snippet1"::: - + contains a and an . At the beginning of a element's execution, all the trigger activities from all elements are scheduled. When the first (leftmost) activity completes, the corresponding action activity is scheduled, and all other trigger activities are canceled. + + + +## Examples + The following code sample demonstrates creating a activity. This example is from the [Using the Pick Activity](/dotnet/framework/windows-workflow-foundation/samples/using-the-pick-activity) sample. + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_pick/cs/program.cs" id="Snippet1"::: + ]]> @@ -53,13 +53,13 @@ Creates a new instance of the activity. - activity. This example is from the [Using the Pick Activity](/dotnet/framework/windows-workflow-foundation/samples/using-the-pick-activity) sample. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_pick/cs/program.cs" id="Snippet1"::: - + activity. This example is from the [Using the Pick Activity](/dotnet/framework/windows-workflow-foundation/samples/using-the-pick-activity) sample. + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_pick/cs/program.cs" id="Snippet1"::: + ]]> @@ -101,13 +101,13 @@ The to execute if this branch is triggered for execution. The activity to execute. - activity. This example is from the [Using the Pick Activity](/dotnet/framework/windows-workflow-foundation/samples/using-the-pick-activity) sample. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_pick/cs/program.cs" id="Snippet1"::: - + activity. This example is from the [Using the Pick Activity](/dotnet/framework/windows-workflow-foundation/samples/using-the-pick-activity) sample. + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_pick/cs/program.cs" id="Snippet1"::: + ]]> @@ -184,13 +184,13 @@ The activity whose completion activates this pick branch. The triggering activity. - activity. This example is from the [Using the Pick Activity](/dotnet/framework/windows-workflow-foundation/samples/using-the-pick-activity) sample. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_pick/cs/program.cs" id="Snippet1"::: - + activity. This example is from the [Using the Pick Activity](/dotnet/framework/windows-workflow-foundation/samples/using-the-pick-activity) sample. + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_pick/cs/program.cs" id="Snippet1"::: + ]]> diff --git a/xml/System.Activities.Statements/StateMachine.xml b/xml/System.Activities.Statements/StateMachine.xml index 1946005d3b9..61c4c71ea26 100644 --- a/xml/System.Activities.Statements/StateMachine.xml +++ b/xml/System.Activities.Statements/StateMachine.xml @@ -114,11 +114,11 @@ Gets or sets the start state of the . Returns . - . - + . + ]]> diff --git a/xml/System.Activities.Statements/Switch`1.xml b/xml/System.Activities.Statements/Switch`1.xml index ceadfbab4fa..1c58e168268 100644 --- a/xml/System.Activities.Statements/Switch`1.xml +++ b/xml/System.Activities.Statements/Switch`1.xml @@ -29,11 +29,11 @@ dictionary consists of a value (serving as the key for the dictionary) and an activity (serving as the value for the dictionary). The is evaluated and compared against the keys in the dictionary. If a match is found, the corresponding activity is executed. Every key in the dictionary must be unique according to the dictionary's equality comparer. + Each case in the dictionary consists of a value (serving as the key for the dictionary) and an activity (serving as the value for the dictionary). The is evaluated and compared against the keys in the dictionary. If a match is found, the corresponding activity is executed. Every key in the dictionary must be unique according to the dictionary's equality comparer. ## Examples -The following code sample demonstrates creating a activity. +The following code sample demonstrates creating a activity. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_procedurals/cs/program.cs" id="Snippet1"::: @@ -53,7 +53,7 @@ The following code sample demonstrates creating a activity. +The following code sample demonstrates creating a activity. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_procedurals/cs/program.cs" id="Snippet1"::: @@ -86,7 +86,7 @@ The following code sample demonstrates creating a activity. +The following code sample demonstrates creating a activity. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_procedurals/cs/program.cs" id="Snippet1"::: @@ -207,7 +207,7 @@ The following code sample demonstrates creating a activity. +The following code sample demonstrates setting the Cases property of a activity. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_procedurals/cs/program.cs" id="Snippet1"::: @@ -318,7 +318,7 @@ The following code sample demonstrates setting the Cases property of a activity. +The following code sample demonstrates setting the Expression property of a activity. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_procedurals/cs/program.cs" id="Snippet1"::: diff --git a/xml/System.Activities.Statements/TerminateWorkflow.xml b/xml/System.Activities.Statements/TerminateWorkflow.xml index f308e9081d5..c9250c71ad6 100644 --- a/xml/System.Activities.Statements/TerminateWorkflow.xml +++ b/xml/System.Activities.Statements/TerminateWorkflow.xml @@ -101,7 +101,7 @@ is a if only is set. If only is set, that exception is passed to . If both and are set, a is passed with the specified , and is set as the exception's property. If neither is set, a default is created. + The exception that is passed to is a if only is set. If only is set, that exception is passed to . If both and are set, a is passed with the specified , and is set as the exception's property. If neither is set, a default is created. ]]> @@ -167,7 +167,7 @@ is a if only is set. If only is set, that exception is passed to . If both and are set, a is passed with the specified , and is set as the exception's property. If neither is set, a default is created. + The exception that is passed to is a if only is set. If only is set, that exception is passed to . If both and are set, a is passed with the specified , and is set as the exception's property. If neither is set, a default is created. ]]> diff --git a/xml/System.Activities.Statements/TransactionScope.xml b/xml/System.Activities.Statements/TransactionScope.xml index 18e11f99980..1323edb131f 100644 --- a/xml/System.Activities.Statements/TransactionScope.xml +++ b/xml/System.Activities.Statements/TransactionScope.xml @@ -22,20 +22,20 @@ An activity that demarcates a transaction boundary. - is started if one does not already exist. The transaction commits when the activity and all other participants in the transaction have completed successfully. - + is started if one does not already exist. The transaction commits when the activity and all other participants in the transaction have completed successfully. + > [!NOTE] -> The activity member of a activity that is the child of a will not execute if an unhandled exception propagates past the boundary. +> The activity member of a activity that is the child of a will not execute if an unhandled exception propagates past the boundary. ## Examples The following code sample demonstrates creating a activity. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_nestedtransactionscope/cs/program.cs" id="Snippet1"::: - + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_nestedtransactionscope/cs/program.cs" id="Snippet1"::: + ]]> @@ -55,14 +55,14 @@ The following code sample demonstrates creating a Initializes a new instance of the class. - activity. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_nestedtransactionscope/cs/program.cs" id="Snippet1"::: - + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_nestedtransactionscope/cs/program.cs" id="Snippet1"::: + ]]> @@ -97,11 +97,11 @@ The following code sample demonstrates creating a if the workflow should be aborted. - is thrown. - + is thrown. + ]]> @@ -139,11 +139,11 @@ The following code sample demonstrates creating a Gets or sets the activity that is scheduled when the executes. The activity that is scheduled when the executes. - is thrown. - + is thrown. + ]]> @@ -246,11 +246,11 @@ The following code sample demonstrates creating a Gets or sets the for this . The for this . - is thrown. - + is thrown. + ]]> @@ -338,17 +338,17 @@ The following code sample demonstrates creating a Gets or sets the that indicates the timeout period for the transaction used for this . The that indicates the timeout period for the transaction used for this . - is thrown. ## Examples The following code sample demonstrates setting the Timeout property of a activity. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_nestedtransactionscope/cs/program.cs" id="Snippet1"::: - + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_nestedtransactionscope/cs/program.cs" id="Snippet1"::: + ]]> diff --git a/xml/System.Activities.Statements/TryCatch.xml b/xml/System.Activities.Statements/TryCatch.xml index 0455c2490b8..d94e6bbaea2 100644 --- a/xml/System.Activities.Statements/TryCatch.xml +++ b/xml/System.Activities.Statements/TryCatch.xml @@ -16,13 +16,13 @@ Contains activities to be executed by the workflow runtime in an exception handling block. - [!NOTE] -> The activity member of a activity that is the child of a will not execute if an unhandled exception propagates past the boundary. - +> The activity member of a activity that is the child of a will not execute if an unhandled exception propagates past the boundary. + ]]> @@ -117,13 +117,13 @@ The collection of elements to be checked when the activity throws an exception. The catch collection. - activity is executed. If no exact match is found, the with the closest matching is executed. - + activity is executed. If no exact match is found, the with the closest matching is executed. + Once placed in the designer, activities cannot be reordered in the designer. To reorder the collection of activities, either delete and re-add them in the correct order, or use the XAML (code) view for the workflow. - + ]]> diff --git a/xml/System.Activities.Statements/WriteLine.xml b/xml/System.Activities.Statements/WriteLine.xml index 64e8e434ef8..aee24474435 100644 --- a/xml/System.Activities.Statements/WriteLine.xml +++ b/xml/System.Activities.Statements/WriteLine.xml @@ -163,11 +163,11 @@ The to write the to. The text writer. - activity writes its to the console. - + activity writes its to the console. + ]]> diff --git a/xml/System.Activities.Tracking/ActivityInfo.xml b/xml/System.Activities.Tracking/ActivityInfo.xml index b620d459ace..84cd76d4b95 100644 --- a/xml/System.Activities.Tracking/ActivityInfo.xml +++ b/xml/System.Activities.Tracking/ActivityInfo.xml @@ -103,11 +103,11 @@ Gets the run-time ID of the activity instance. The instance ID of the activity. - contains the ID of the activity and does not change while the contains the ID of the specific instance of the activity. The is different for each specific instance. For example, an activity that is processed in a loop would have a different for each cycle through the loop while the would remain the same. - + contains the ID of the activity and does not change while the contains the ID of the specific instance of the activity. The is different for each specific instance. For example, an activity that is processed in a loop would have a different for each cycle through the loop while the would remain the same. + ]]> diff --git a/xml/System.Activities.Tracking/ImplementationVisibility.xml b/xml/System.Activities.Tracking/ImplementationVisibility.xml index 79fb6c27076..69688bce5e7 100644 --- a/xml/System.Activities.Tracking/ImplementationVisibility.xml +++ b/xml/System.Activities.Tracking/ImplementationVisibility.xml @@ -15,11 +15,11 @@ Describes the visibility modes within a tracking profile. - . - + . + ]]> diff --git a/xml/System.Activities.Tracking/TrackingParticipant.xml b/xml/System.Activities.Tracking/TrackingParticipant.xml index c6bfa835b3d..9fde09f0c57 100644 --- a/xml/System.Activities.Tracking/TrackingParticipant.xml +++ b/xml/System.Activities.Tracking/TrackingParticipant.xml @@ -16,11 +16,11 @@ The base class for workflow extensions that interact with the workflow tracking infrastructure and access tracking records. - @@ -77,11 +77,11 @@ When implemented in a derived class, begins asynchronous processing of the tracking record. The result of the operation. - that the workflow runtime uses to wait for completion. The default implementation is to call and return a Completed status. - + that the workflow runtime uses to wait for completion. The default implementation is to call and return a Completed status. + ]]> @@ -108,11 +108,11 @@ The status of the operation. When implemented in a derived class, represents the end of an asynchronous tracking operation. - @@ -141,11 +141,11 @@ The time period after which the provider aborts the attempt. When implemented in a derived class, used to synchronously process the tracking record. - @@ -179,11 +179,11 @@ The tracking profile object used by the tracking participant. Before adding the tracking participant to the workflow extensions, the tracking profile is set on the participant. The tracking profile. - diff --git a/xml/System.Activities.Validation/ActivityValidationServices.xml b/xml/System.Activities.Validation/ActivityValidationServices.xml index dc9bb16d301..193dc24a240 100644 --- a/xml/System.Activities.Validation/ActivityValidationServices.xml +++ b/xml/System.Activities.Validation/ActivityValidationServices.xml @@ -53,11 +53,11 @@ Verifies that a workflow activity is correctly configured according to the validation logic. This logic can be the method of the activities to validate, or build and policy constraints. - override. Any exceptions that are thrown from are not treated as validation errors. These exceptions will escape from the call to and must be handled by the caller. - + override. Any exceptions that are thrown from are not treated as validation errors. These exceptions will escape from the call to and must be handled by the caller. + ]]> @@ -85,11 +85,11 @@ Verifies that a workflow activity is correctly configured according to the validation logic. This logic can be the method of the activities to validate, or build and policy constraints. A collection of validation errors, each of which can contain the name of the validated activity, a descriptive message, an error code, and other information. - override. Any exceptions that are thrown from are not treated as validation errors. These exceptions will escape from the call to and must be handled by the caller. - + override. Any exceptions that are thrown from are not treated as validation errors. These exceptions will escape from the call to and must be handled by the caller. + ]]> @@ -119,11 +119,11 @@ Verifies that a workflow activity is correctly configured according to the validation logic. This logic can be the cacheMetadata method of the activities to validate, or build and policy constraints. A collection of validation errors, each of which can contain the name of the activity that is configured incorrectly, a descriptive message, an error or warning code , and other information. - override. Any exceptions that are thrown from are not treated as validation errors. These exceptions will escape from the call to and must be handled by the caller. - + override. Any exceptions that are thrown from are not treated as validation errors. These exceptions will escape from the call to and must be handled by the caller. + ]]> diff --git a/xml/System.Activities.Validation/ValidationSettings.xml b/xml/System.Activities.Validation/ValidationSettings.xml index ecb5625961e..e0cd5c4dff8 100644 --- a/xml/System.Activities.Validation/ValidationSettings.xml +++ b/xml/System.Activities.Validation/ValidationSettings.xml @@ -134,11 +134,11 @@ if the additional constraints are to be used exclusively; otherwise, . - is called whenever a workflow is executed, and any resulting errors will cause a to be thrown. - + is called whenever a workflow is executed, and any resulting errors will cause a to be thrown. + ]]> diff --git a/xml/System.Activities/Activity.xml b/xml/System.Activities/Activity.xml index 0114a8abd1d..2d5d2ab640d 100644 --- a/xml/System.Activities/Activity.xml +++ b/xml/System.Activities/Activity.xml @@ -22,17 +22,17 @@ An abstract base class used to create composite activities from pre-existing objects. - is the base class in the activity type hierarchy. All other activity types such as , , , , and derive from this class. - - - -## Examples - The following example shows a simple implementation of an derived class. - - + is the base class in the activity type hierarchy. All other activity types such as , , , , and derive from this class. + + + +## Examples + The following example shows a simple implementation of an derived class. + + ]]> @@ -103,11 +103,11 @@ The activity's metadata that encapsulates the activity's arguments, variables, child activities, and activity delegates. Creates and validates a description of the activity's arguments, variables, child activities, and activity delegates. - to ensure correct construction of a workflow as well as to manage runtime relationships and lifetime rules. The default implementation of examines the public properties of the activity type using the type's . These public members are of type , , `IEnumerable`, , `IEnumerable`, or . You can override this method to customize the building of the activity's run-time description and to provide custom validation logic. - + to ensure correct construction of a workflow as well as to manage runtime relationships and lifetime rules. The default implementation of examines the public properties of the activity type using the type's . These public members are of type , , `IEnumerable`, , `IEnumerable`, or . You can override this method to customize the building of the activity's run-time description and to provide custom validation logic. + ]]> @@ -152,11 +152,11 @@ Gets or sets an optional friendly name that is used for debugging, validation, exception handling, and tracking. A friendly name that is used for debugging, validation, exception handling, and tracking. - @@ -180,11 +180,11 @@ Gets an identifier that is unique in the scope of the workflow definition. An identifier that is unique in the scope of the workflow definition. - is used in tracking and validation. - + is used in tracking and validation. + ]]> @@ -234,11 +234,11 @@ Gets or sets the delegate that returns an that contains the execution logic. The delegate that contains the execution logic. - diff --git a/xml/System.Activities/ActivityAction.xml b/xml/System.Activities/ActivityAction.xml index 31649679497..5941e185e44 100644 --- a/xml/System.Activities/ActivityAction.xml +++ b/xml/System.Activities/ActivityAction.xml @@ -16,13 +16,13 @@ Defines an activity delegate that has no in arguments and does not return a value. - activity that requires an iteration variable or the activity that requires an . - - There are multiple generic versions of this type that take from 1 to 16 arguments for the activity that is called. There are also types for delegates that return values. - + activity that requires an iteration variable or the activity that requires an . + + There are multiple generic versions of this type that take from 1 to 16 arguments for the activity that is called. There are also types for delegates that return values. + ]]> diff --git a/xml/System.Activities/ActivityDelegate.xml b/xml/System.Activities/ActivityDelegate.xml index ceb67e00ae6..d33dbf95fce 100644 --- a/xml/System.Activities/ActivityDelegate.xml +++ b/xml/System.Activities/ActivityDelegate.xml @@ -22,11 +22,11 @@ Represents an activity-based callback. - is used for invoking activities that do not have a return value, and is used for invoking activities that do have a return value. Activity delegates are useful in scenarios where a child activity must be constrained to having a certain signature. - + is used for invoking activities that do not have a return value, and is used for invoking activities that do have a return value. Activity delegates are useful in scenarios where a child activity must be constrained to having a certain signature. + ]]> @@ -73,11 +73,11 @@ Gets or sets an optional friendly name that is used for debugging, validation, exception handling, and tracking. A friendly name that is used for debugging, validation, exception handling, and tracking. - is thrown. - + is thrown. + ]]> @@ -137,11 +137,11 @@ Gets or sets the activity that is represented by this . The activity that is represented by this . - is thrown. - + is thrown. + ]]> @@ -168,11 +168,11 @@ The list to be populated with runtime arguments. Supplies a list of runtime arguments for the . - . - + . + ]]> @@ -204,11 +204,11 @@ , if the property value should be serialized; otherwise, . - returns `true` if the was explicitly set on the . - + returns `true` if the was explicitly set on the . + ]]> diff --git a/xml/System.Activities/ActivityFunc`1.xml b/xml/System.Activities/ActivityFunc`1.xml index 05e786d1468..dc27257bcd2 100644 --- a/xml/System.Activities/ActivityFunc`1.xml +++ b/xml/System.Activities/ActivityFunc`1.xml @@ -20,13 +20,13 @@ The type of the out argument of the activity delegate. Defines an activity delegate with no arguments and one argument of type Tresult. - enables activity authors to expose callbacks with specific signatures that users of the activity can provide activity-based handlers for. is an that returns a value. The signature of the is specified as generic type arguments. - - There are multiple generic versions of this type that take from 1 to 16 in arguments, plus the `out` argument, for the activity that is called. There are also **ActivityAction** types for activity delegates that do not return values. - + enables activity authors to expose callbacks with specific signatures that users of the activity can provide activity-based handlers for. is an that returns a value. The signature of the is specified as generic type arguments. + + There are multiple generic versions of this type that take from 1 to 16 in arguments, plus the `out` argument, for the activity that is called. There are also **ActivityAction** types for activity delegates that do not return values. + ]]> diff --git a/xml/System.Activities/ActivityFunc`10.xml b/xml/System.Activities/ActivityFunc`10.xml index 0b3c4d7f082..f3df2c956ac 100644 --- a/xml/System.Activities/ActivityFunc`10.xml +++ b/xml/System.Activities/ActivityFunc`10.xml @@ -38,13 +38,13 @@ The type of the out argument of the activity delegate. Defines an activity delegate with nine in arguments of type T and one out argument of type TResult. - enables activity authors to expose callbacks with specific signatures that users of the activity can provide activity-based handlers for. is an that returns a value. The signature of the is specified as generic type arguments. - - There are multiple generic versions of this type that take from 1 to 16 in arguments, plus the `out` argument, for the activity that is called. There are also **ActivityAction** types for activity delegates that do not return values. - + enables activity authors to expose callbacks with specific signatures that users of the activity can provide activity-based handlers for. is an that returns a value. The signature of the is specified as generic type arguments. + + There are multiple generic versions of this type that take from 1 to 16 in arguments, plus the `out` argument, for the activity that is called. There are also **ActivityAction** types for activity delegates that do not return values. + ]]> diff --git a/xml/System.Activities/ActivityFunc`11.xml b/xml/System.Activities/ActivityFunc`11.xml index 476ccfcc79d..b037c08d483 100644 --- a/xml/System.Activities/ActivityFunc`11.xml +++ b/xml/System.Activities/ActivityFunc`11.xml @@ -40,13 +40,13 @@ The type of the out argument of the activity delegate. Defines an activity delegate with one in argument of type T and one out argument of type TResult. - enables activity authors to expose callbacks with specific signatures that users of the activity can provide activity-based handlers for. is an that returns a value. The signature of the is specified as generic type arguments. - - There are multiple generic versions of this type that take from 1 to 16 in arguments, plus an `out` argument, for the activity that is called. There are also **ActivityAction** types for activity delegates that do not return values. - + enables activity authors to expose callbacks with specific signatures that users of the activity can provide activity-based handlers for. is an that returns a value. The signature of the is specified as generic type arguments. + + There are multiple generic versions of this type that take from 1 to 16 in arguments, plus an `out` argument, for the activity that is called. There are also **ActivityAction** types for activity delegates that do not return values. + ]]> diff --git a/xml/System.Activities/ActivityFunc`12.xml b/xml/System.Activities/ActivityFunc`12.xml index 27603ddec98..92f54ecfa00 100644 --- a/xml/System.Activities/ActivityFunc`12.xml +++ b/xml/System.Activities/ActivityFunc`12.xml @@ -42,13 +42,13 @@ The type of the out argument of the activity delegate. Defines an activity delegate with one in argument of type T and one out argument of type TResult. - enables activity authors to expose callbacks with specific signatures that users of the activity can provide activity-based handlers for. is an that returns a value. The signature of the is specified as generic type arguments. - - There are multiple generic versions of this type that take from 1 to 16 in arguments, plus the `out` argument, for the activity that is called. There are also **ActivityAction** types for activity delegates that do not return values. - + enables activity authors to expose callbacks with specific signatures that users of the activity can provide activity-based handlers for. is an that returns a value. The signature of the is specified as generic type arguments. + + There are multiple generic versions of this type that take from 1 to 16 in arguments, plus the `out` argument, for the activity that is called. There are also **ActivityAction** types for activity delegates that do not return values. + ]]> diff --git a/xml/System.Activities/ActivityFunc`13.xml b/xml/System.Activities/ActivityFunc`13.xml index 9ce059d53a9..e1cf8bbdc03 100644 --- a/xml/System.Activities/ActivityFunc`13.xml +++ b/xml/System.Activities/ActivityFunc`13.xml @@ -44,13 +44,13 @@ The type of the out argument of the activity delegate. Defines an activity delegate with one in argument of type T and one out argument of type TResult. - enables activity authors to expose callbacks with specific signatures that users of the activity can provide activity-based handlers for. is an that returns a value. The signature of the is specified as generic type arguments. - - There are multiple generic versions of this type that take from 1 to 16 in arguments, plus the `out` argument, for the activity that is called. There are also **ActivityAction** types for activity delegates that do not return values. - + enables activity authors to expose callbacks with specific signatures that users of the activity can provide activity-based handlers for. is an that returns a value. The signature of the is specified as generic type arguments. + + There are multiple generic versions of this type that take from 1 to 16 in arguments, plus the `out` argument, for the activity that is called. There are also **ActivityAction** types for activity delegates that do not return values. + ]]> diff --git a/xml/System.Activities/ActivityFunc`14.xml b/xml/System.Activities/ActivityFunc`14.xml index 8ad985b1a42..bdde911ceb3 100644 --- a/xml/System.Activities/ActivityFunc`14.xml +++ b/xml/System.Activities/ActivityFunc`14.xml @@ -46,13 +46,13 @@ The type of the out argument of the activity delegate. Defines an activity delegate with one in argument of type T and one out argument of type TResult. - enables activity authors to expose callbacks with specific signatures that users of the activity can provide activity-based handlers for. is an that returns a value. The signature of the is specified as generic type arguments. - - There are multiple generic versions of this type that take from 1 to 16 in arguments, plus the `out` argument, for the activity that is called. There are also **ActivityAction** types for activity delegates that do not return values. - + enables activity authors to expose callbacks with specific signatures that users of the activity can provide activity-based handlers for. is an that returns a value. The signature of the is specified as generic type arguments. + + There are multiple generic versions of this type that take from 1 to 16 in arguments, plus the `out` argument, for the activity that is called. There are also **ActivityAction** types for activity delegates that do not return values. + ]]> diff --git a/xml/System.Activities/ActivityFunc`15.xml b/xml/System.Activities/ActivityFunc`15.xml index b6a918f1b7b..43334f6fd46 100644 --- a/xml/System.Activities/ActivityFunc`15.xml +++ b/xml/System.Activities/ActivityFunc`15.xml @@ -48,13 +48,13 @@ The type of the out argument of the activity delegate. Defines an activity delegate with one in argument of type T and one out argument of type TResult. - enables activity authors to expose callbacks with specific signatures that users of the activity can provide activity-based handlers for. is an that returns a value. The signature of the is specified as generic type arguments. - - There are multiple generic versions of this type that take from 1 to 16 in arguments, plus the `out` argument, for the activity that is called. There are also **ActivityAction** types for activity delegates that do not return values. - + enables activity authors to expose callbacks with specific signatures that users of the activity can provide activity-based handlers for. is an that returns a value. The signature of the is specified as generic type arguments. + + There are multiple generic versions of this type that take from 1 to 16 in arguments, plus the `out` argument, for the activity that is called. There are also **ActivityAction** types for activity delegates that do not return values. + ]]> diff --git a/xml/System.Activities/ActivityFunc`16.xml b/xml/System.Activities/ActivityFunc`16.xml index b8ad4a8241d..cc8cd42ddd3 100644 --- a/xml/System.Activities/ActivityFunc`16.xml +++ b/xml/System.Activities/ActivityFunc`16.xml @@ -50,13 +50,13 @@ The type of the out argument of the activity delegate. Defines an activity delegate with one in argument of type T and one out argument of type TResult. - enables activity authors to expose callbacks with specific signatures that users of the activity can provide activity-based handlers for. is an that returns a value. The signature of the is specified as generic type arguments. - - There are multiple generic versions of this type that take from 1 to 16 in arguments, plus the `out` argument, for the activity that is called. There are also **ActivityAction** types for activity delegates that do not return values. - + enables activity authors to expose callbacks with specific signatures that users of the activity can provide activity-based handlers for. is an that returns a value. The signature of the is specified as generic type arguments. + + There are multiple generic versions of this type that take from 1 to 16 in arguments, plus the `out` argument, for the activity that is called. There are also **ActivityAction** types for activity delegates that do not return values. + ]]> diff --git a/xml/System.Activities/ActivityFunc`17.xml b/xml/System.Activities/ActivityFunc`17.xml index a2221ed68f1..80efd86a004 100644 --- a/xml/System.Activities/ActivityFunc`17.xml +++ b/xml/System.Activities/ActivityFunc`17.xml @@ -52,13 +52,13 @@ The type of the out argument of the activity delegate. Defines an activity delegate with one in argument of type T and one out argument of type TResult. - enables activity authors to expose callbacks with specific signatures that users of the activity can provide activity-based handlers for. is an that returns a value. The signature of the is specified as generic type arguments. - - There are multiple generic versions of this type that take from 1 to 16 in arguments, plus the `out` argument, for the activity that is called. There are also **ActivityAction** types for activity delegates that do not return values. - + enables activity authors to expose callbacks with specific signatures that users of the activity can provide activity-based handlers for. is an that returns a value. The signature of the is specified as generic type arguments. + + There are multiple generic versions of this type that take from 1 to 16 in arguments, plus the `out` argument, for the activity that is called. There are also **ActivityAction** types for activity delegates that do not return values. + ]]> diff --git a/xml/System.Activities/ActivityFunc`2.xml b/xml/System.Activities/ActivityFunc`2.xml index 74eb1148d03..a93ad399800 100644 --- a/xml/System.Activities/ActivityFunc`2.xml +++ b/xml/System.Activities/ActivityFunc`2.xml @@ -22,13 +22,13 @@ The type of the argument of the activity delegate. Defines an activity delegate with one in argument of type and one argument of type . - enables activity authors to expose callbacks with specific signatures that users of the activity can provide activity-based handlers for. is an that returns a value. The signature of the is specified as generic type arguments. - - There are multiple generic versions of this type that take from 1 to 16 in arguments, plus the `out` argument, for the activity that is called. There are also **ActivityAction** types for activity delegates that do not return values. - + enables activity authors to expose callbacks with specific signatures that users of the activity can provide activity-based handlers for. is an that returns a value. The signature of the is specified as generic type arguments. + + There are multiple generic versions of this type that take from 1 to 16 in arguments, plus the `out` argument, for the activity that is called. There are also **ActivityAction** types for activity delegates that do not return values. + ]]> diff --git a/xml/System.Activities/ActivityFunc`3.xml b/xml/System.Activities/ActivityFunc`3.xml index f5f68cf82d2..97961be9fe3 100644 --- a/xml/System.Activities/ActivityFunc`3.xml +++ b/xml/System.Activities/ActivityFunc`3.xml @@ -24,13 +24,13 @@ The type of the out argument of the activity delegate. Defines an activity delegate with one in argument of type T and one argument of type TResult. - enables activity authors to expose callbacks with specific signatures that users of the activity can provide activity-based handlers for. is an that returns a value. The signature of the is specified as generic type arguments. - - There are multiple generic versions of this type that take from 1 to 16 in arguments, plus the `out` argument, for the activity that is called. There are also **ActivityAction** types for activity delegates that do not return values. - + enables activity authors to expose callbacks with specific signatures that users of the activity can provide activity-based handlers for. is an that returns a value. The signature of the is specified as generic type arguments. + + There are multiple generic versions of this type that take from 1 to 16 in arguments, plus the `out` argument, for the activity that is called. There are also **ActivityAction** types for activity delegates that do not return values. + ]]> diff --git a/xml/System.Activities/ActivityFunc`4.xml b/xml/System.Activities/ActivityFunc`4.xml index e641e08b2d5..bac6ff103eb 100644 --- a/xml/System.Activities/ActivityFunc`4.xml +++ b/xml/System.Activities/ActivityFunc`4.xml @@ -26,13 +26,13 @@ The type of the out argument of the activity delegate. Defines an activity delegate with three in arguments of type T and one argument of type TResult. - enables activity authors to expose callbacks with specific signatures that users of the activity can provide activity-based handlers for. is an that returns a value. The signature of the is specified as generic type arguments. - - There are multiple generic versions of this type that take from 1 to 16 in arguments, plus the `out` argument, for the activity that is called. There are also **ActivityAction** types for activity delegates that do not return values. - + enables activity authors to expose callbacks with specific signatures that users of the activity can provide activity-based handlers for. is an that returns a value. The signature of the is specified as generic type arguments. + + There are multiple generic versions of this type that take from 1 to 16 in arguments, plus the `out` argument, for the activity that is called. There are also **ActivityAction** types for activity delegates that do not return values. + ]]> diff --git a/xml/System.Activities/ActivityFunc`5.xml b/xml/System.Activities/ActivityFunc`5.xml index 1c7c8d4401f..a5b0cfbdf7a 100644 --- a/xml/System.Activities/ActivityFunc`5.xml +++ b/xml/System.Activities/ActivityFunc`5.xml @@ -28,13 +28,13 @@ The type of the out argument of the activity delegate. Defines an activity delegate with four in arguments of type T and one argument of type TResult. - enables activity authors to expose callbacks with specific signatures that users of the activity can provide activity-based handlers for. is an that returns a value. The signature of the is specified as generic type arguments. - - There are multiple generic versions of this type that take from 1 to 16 in arguments, plus the `out` argument, for the activity that is called. There are also **ActivityAction** types for activity delegates that do not return values. - + enables activity authors to expose callbacks with specific signatures that users of the activity can provide activity-based handlers for. is an that returns a value. The signature of the is specified as generic type arguments. + + There are multiple generic versions of this type that take from 1 to 16 in arguments, plus the `out` argument, for the activity that is called. There are also **ActivityAction** types for activity delegates that do not return values. + ]]> diff --git a/xml/System.Activities/ActivityFunc`6.xml b/xml/System.Activities/ActivityFunc`6.xml index a9e84d22646..0e25e2023a0 100644 --- a/xml/System.Activities/ActivityFunc`6.xml +++ b/xml/System.Activities/ActivityFunc`6.xml @@ -30,13 +30,13 @@ The type of the out argument of the activity delegate. Defines an activity delegate with five in arguments of type T and one out argument of type TResult. - enables activity authors to expose callbacks with specific signatures that users of the activity can provide activity-based handlers for. is an that returns a value. The signature of the is specified as generic type arguments. - - There are multiple generic versions of this type that take from 1 to 16 in arguments, plus the `out` argument, for the activity that is called. There are also **ActivityAction** types for activity delegates that do not return values. - + enables activity authors to expose callbacks with specific signatures that users of the activity can provide activity-based handlers for. is an that returns a value. The signature of the is specified as generic type arguments. + + There are multiple generic versions of this type that take from 1 to 16 in arguments, plus the `out` argument, for the activity that is called. There are also **ActivityAction** types for activity delegates that do not return values. + ]]> diff --git a/xml/System.Activities/ActivityFunc`7.xml b/xml/System.Activities/ActivityFunc`7.xml index 6b4fdf8c30c..82d19ab263d 100644 --- a/xml/System.Activities/ActivityFunc`7.xml +++ b/xml/System.Activities/ActivityFunc`7.xml @@ -32,13 +32,13 @@ The type of the out argument of the activity delegate. Defines an activity delegate with six in arguments of type T and one out argument of type TResult. - enables activity authors to expose callbacks with specific signatures that users of the activity can provide activity-based handlers for. is an that returns a value. The signature of the is specified as generic type arguments. - - There are multiple generic versions of this type that take from 1 to 16 in arguments, plus the `out` argument, for the activity that is called. There are also **ActivityAction** types for activity delegates that do not return values. - + enables activity authors to expose callbacks with specific signatures that users of the activity can provide activity-based handlers for. is an that returns a value. The signature of the is specified as generic type arguments. + + There are multiple generic versions of this type that take from 1 to 16 in arguments, plus the `out` argument, for the activity that is called. There are also **ActivityAction** types for activity delegates that do not return values. + ]]> diff --git a/xml/System.Activities/ActivityFunc`8.xml b/xml/System.Activities/ActivityFunc`8.xml index 40ec7ba6274..d473a622cef 100644 --- a/xml/System.Activities/ActivityFunc`8.xml +++ b/xml/System.Activities/ActivityFunc`8.xml @@ -34,13 +34,13 @@ The type of the out argument of the activity delegate. Defines an activity delegate with seven in arguments of type T and one out argument of type TResult. - enables activity authors to expose callbacks with specific signatures that users of the activity can provide activity-based handlers for. is an that returns a value. The signature of the is specified as generic type arguments. - - There are multiple generic versions of this type that take from 1 to 16 in arguments, plus the `out` argument, for the activity that is called. There are also **ActivityAction** types for activity delegates that do not return values. - + enables activity authors to expose callbacks with specific signatures that users of the activity can provide activity-based handlers for. is an that returns a value. The signature of the is specified as generic type arguments. + + There are multiple generic versions of this type that take from 1 to 16 in arguments, plus the `out` argument, for the activity that is called. There are also **ActivityAction** types for activity delegates that do not return values. + ]]> diff --git a/xml/System.Activities/ActivityFunc`9.xml b/xml/System.Activities/ActivityFunc`9.xml index 88dac981ddc..24fc3a45fab 100644 --- a/xml/System.Activities/ActivityFunc`9.xml +++ b/xml/System.Activities/ActivityFunc`9.xml @@ -36,13 +36,13 @@ The type of the out argument of the activity delegate. Defines an activity delegate with eight in arguments of type T and one out argument of type TResult. - enables activity authors to expose callbacks with specific signatures that users of the activity can provide activity-based handlers for. is an that returns a value. The signature of the is specified as generic type arguments. - - There are multiple generic versions of this type that take from 1 to 16 in arguments, plus the `out` argument, for the activity that is called. There are also **ActivityAction** types for activity delegates that do not return values. - + enables activity authors to expose callbacks with specific signatures that users of the activity can provide activity-based handlers for. is an that returns a value. The signature of the is specified as generic type arguments. + + There are multiple generic versions of this type that take from 1 to 16 in arguments, plus the `out` argument, for the activity that is called. There are also **ActivityAction** types for activity delegates that do not return values. + ]]> diff --git a/xml/System.Activities/ActivityMetadata.xml b/xml/System.Activities/ActivityMetadata.xml index df068c36a44..4601578e401 100644 --- a/xml/System.Activities/ActivityMetadata.xml +++ b/xml/System.Activities/ActivityMetadata.xml @@ -72,11 +72,11 @@ The function that returns the extension. Adds the specified extension provider to the collection of default extension providers for the activity. - @@ -112,11 +112,11 @@ The activity to add. Adds the specified activity to the metadata's list of imported child activities. - @@ -178,11 +178,11 @@ The delegate to add. Adds the specified delegate to the metadata's list of imported delegates. - is an that the parent activity does not invoke directly. Rather, the parent uses this to configure some other child activity. - + is an that the parent activity does not invoke directly. Rather, the parent uses this to configure some other child activity. + ]]> @@ -221,11 +221,11 @@ Adds a validation error to the metadata's collection of validation errors. - @@ -252,11 +252,11 @@ For more information, see [Imperative Code-Based Validation](/dotnet/framework/w The validation error to add. Adds the specified validation error to the metadata's collection of validation errors. - @@ -283,11 +283,11 @@ For more information, see [Imperative Code-Based Validation](/dotnet/framework/w A message that describes the validation error. Adds a validation error to the metadata's collection of validation errors using the specified description. - @@ -323,11 +323,11 @@ For more information, see [Imperative Code-Based Validation](/dotnet/framework/w The variable to add. Adds the specified variable to the metadata's collection of variables. - adds the variables in its collection using this method. An activity's implementation cannot access variables added using this method. Activities added through (and any of their non-implementation child activities) can access variables added using this method. For example, adds its collection in this manner. - + adds the variables in its collection using this method. An activity's implementation cannot access variables added using this method. Activities added through (and any of their non-implementation child activities) can access variables added using this method. For example, adds its collection in this manner. + ]]> @@ -457,11 +457,11 @@ For more information, see [Imperative Code-Based Validation](/dotnet/framework/w Returns a collection of arguments obtained by using reflection. A collection of arguments. - to examine all public properties of type and returns them in a collection. - + to examine all public properties of type and returns them in a collection. + ]]> @@ -508,11 +508,11 @@ For more information, see [Imperative Code-Based Validation](/dotnet/framework/w Returns a collection of imported child activities using reflection. A collection of imported child activities. - to examine all public properties of type , or `IList` or `ICollection` where `T` derives from , and returns them in a collection. - + to examine all public properties of type , or `IList` or `ICollection` where `T` derives from , and returns them in a collection. + ]]> @@ -537,11 +537,11 @@ For more information, see [Imperative Code-Based Validation](/dotnet/framework/w Returns a collection of delegates using reflection. A collection of delegates. - to examine all public properties of type , or `IList` or `ICollection` where `T` derives from , and returns them in a collection. - + to examine all public properties of type , or `IList` or `ICollection` where `T` derives from , and returns them in a collection. + ]]> @@ -566,11 +566,11 @@ For more information, see [Imperative Code-Based Validation](/dotnet/framework/w Returns a collection of variables using reflection. A collection of variables. - to examine all public properties of type , or `IList` or `ICollection` where `T` derives from , and returns them in a collection. - + to examine all public properties of type , or `IList` or `ICollection` where `T` derives from , and returns them in a collection. + ]]> @@ -675,11 +675,11 @@ For more information, see [Imperative Code-Based Validation](/dotnet/framework/w The type of the extension. Specifies that the activity requires an extension of the specified type at runtime. - @@ -711,11 +711,11 @@ For more information, see [Imperative Code-Based Validation](/dotnet/framework/w The type of the extension. Specifies that the activity requires an extension of the specified generic type at runtime. - @@ -766,11 +766,11 @@ For more information, see [Imperative Code-Based Validation](/dotnet/framework/w The activities to add. Adds the specified collection as imported child activities of the activity. - for each item in the collection. - + for each item in the collection. + ]]> @@ -797,11 +797,11 @@ For more information, see [Imperative Code-Based Validation](/dotnet/framework/w The delegates to add. Adds the specified collection as imported delegates of the activity. - for each item in the collection. - + for each item in the collection. + ]]> diff --git a/xml/System.Activities/Activity`1.xml b/xml/System.Activities/Activity`1.xml index 3797dde88cf..5c58391e1fb 100644 --- a/xml/System.Activities/Activity`1.xml +++ b/xml/System.Activities/Activity`1.xml @@ -30,18 +30,18 @@ The type of the return value of the activity. An abstract base class used to create composite activities from pre-existing objects, which specifies a result type using the activity's type specifier. - is the base class in the activity type hierarchy. All other activity types with generic type definitions such as , , , and derive from this class. - - - -## Examples - The following example shows how to derive a class from . - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/helloworld/cs/appendstring.cs" id="Snippet0"::: - + is the base class in the activity type hierarchy. All other activity types with generic type definitions such as , , , and derive from this class. + + + +## Examples + The following example shows how to derive a class from . + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/helloworld/cs/appendstring.cs" id="Snippet0"::: + ]]> @@ -126,11 +126,11 @@ Returns a expression that evaluates to the given . A workflow expression that evaluates to the given variable. - is not compatible with the type of the , then an is thrown. - + is not compatible with the type of the , then an is thrown. + ]]> @@ -189,11 +189,11 @@ Returns a expression that evaluates to the given . A workflow expression that evaluates to the given variable. - is not compatible with the type of the , then an is thrown. - + is not compatible with the type of the , then an is thrown. + ]]> @@ -293,11 +293,11 @@ Gets or sets the result argument for the . The result argument for the . - is thrown. - + is thrown. + ]]> diff --git a/xml/System.Activities/Argument.xml b/xml/System.Activities/Argument.xml index fbbdaca8fc2..69f7470964f 100644 --- a/xml/System.Activities/Argument.xml +++ b/xml/System.Activities/Argument.xml @@ -159,11 +159,11 @@ Gets or sets a zero-based value that specifies the order in which the argument is evaluated. A zero-based value that specifies the order in which the argument is evaluated. - value. Set to a value greater or equal to zero to specify an evaluation order for this argument. Windows Workflow Foundation evaluates arguments with a specified evaluation order in ascending order. Note that arguments with an unspecified evaluation order are evaluated before those with a specified evaluation order. - + value. Set to a value greater or equal to zero to specify an evaluation order for this argument. Windows Workflow Foundation evaluates arguments with a specified evaluation order in ascending order. Note that arguments with an unspecified evaluation order are evaluated before those with a specified evaluation order. + ]]> The value is less than zero and not equal to . @@ -311,11 +311,11 @@ Represents the constant value of "Result", which corresponds to the name of the property of type in the expression base class . - diff --git a/xml/System.Activities/ArgumentDirection.xml b/xml/System.Activities/ArgumentDirection.xml index abb1c89ff1d..a38d330c8bd 100644 --- a/xml/System.Activities/ArgumentDirection.xml +++ b/xml/System.Activities/ArgumentDirection.xml @@ -15,15 +15,15 @@ Specifies the direction of data flow for an . - of type is created using the method of the class. - -```csharp -Argument a = Argument.Create(typeof(string), ArgumentDirection.In); -``` - + of type is created using the method of the class. + +```csharp +Argument a = Argument.Create(typeof(string), ArgumentDirection.In); +``` + ]]> diff --git a/xml/System.Activities/AsyncCodeActivity.xml b/xml/System.Activities/AsyncCodeActivity.xml index 133d7b61437..26fdae7c423 100644 --- a/xml/System.Activities/AsyncCodeActivity.xml +++ b/xml/System.Activities/AsyncCodeActivity.xml @@ -16,13 +16,13 @@ Manages asynchronous code activity execution from start to completion. This is an abstract class. - to create a custom activity. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/async/cs/filewriter.cs" id="Snippet0"::: - + to create a custom activity. + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/async/cs/filewriter.cs" id="Snippet0"::: + ]]> @@ -77,13 +77,13 @@ When implemented in a derived class and using the specified execution context, callback method, and user state, enqueues an asynchronous activity in a run-time workflow. The object that saves variable information for an instance of an asynchronous activity. - method in a custom activity. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/async/cs/filewriter.cs" id="Snippet1"::: - + method in a custom activity. + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/async/cs/filewriter.cs" id="Snippet1"::: + ]]> @@ -96,11 +96,11 @@ Serves as a virtual method and converts information obtained by cache reflection into arguments for an asynchronous activity. - override. Any exceptions that are thrown from are not treated as validation errors. These exceptions will escape from the call to and must be handled by the caller. - + override. Any exceptions that are thrown from are not treated as validation errors. These exceptions will escape from the call to and must be handled by the caller. + ]]> @@ -152,11 +152,11 @@ object that contains data for a set of asynchronous activity arguments. Serves as a virtual method and converts information obtained by cache reflection into arguments for an asynchronous activity. - override. Any exceptions that are thrown from are not treated as validation errors. These exceptions will escape from the call to and must be handled by the caller. - + override. Any exceptions that are thrown from are not treated as validation errors. These exceptions will escape from the call to and must be handled by the caller. + ]]> @@ -209,13 +209,13 @@ The implemented that returns the status of an asynchronous activity when execution ends. When implemented in a derived class and using the specified execution environment information, notifies the workflow runtime that the associated asynchronous activity operation has completed. - method in a custom activity. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/async/cs/filewriter.cs" id="Snippet2"::: - + method in a custom activity. + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/async/cs/filewriter.cs" id="Snippet2"::: + ]]> diff --git a/xml/System.Activities/AsyncCodeActivity`1.xml b/xml/System.Activities/AsyncCodeActivity`1.xml index 743ea9cb025..f65849baf89 100644 --- a/xml/System.Activities/AsyncCodeActivity`1.xml +++ b/xml/System.Activities/AsyncCodeActivity`1.xml @@ -85,11 +85,11 @@ Serves as a virtual method and converts information obtained by cache reflection into arguments for an asynchronous activity. - override. Any exceptions that are thrown from are not treated as validation errors. These exceptions will escape from the call to and must be handled by the caller. - + override. Any exceptions that are thrown from are not treated as validation errors. These exceptions will escape from the call to and must be handled by the caller. + ]]> @@ -141,11 +141,11 @@ object that contains data for a set of asynchronous activity arguments. Serves as a virtual method and converts information obtained by reflection on a cache into arguments for an asynchronous activity. - override. Any exceptions that are thrown from are not treated as validation errors. These exceptions will escape from the call to and must be handled by the caller. - + override. Any exceptions that are thrown from are not treated as validation errors. These exceptions will escape from the call to and must be handled by the caller. + ]]> diff --git a/xml/System.Activities/Bookmark.xml b/xml/System.Activities/Bookmark.xml index 157c706537c..cdc508e69fa 100644 --- a/xml/System.Activities/Bookmark.xml +++ b/xml/System.Activities/Bookmark.xml @@ -26,110 +26,110 @@ Represents a point at which a workflow or activity can passively wait to be resumed. - , it becomes idle and waits for the to be resumed. If there are other activities in parallel with the activity that created the , they will be scheduled for execution. - - Bookmarks can be resumed by the host application using one of the overloads. - + , it becomes idle and waits for the to be resumed. If there are other activities in parallel with the activity that created the , they will be scheduled for execution. + + Bookmarks can be resumed by the host application using one of the overloads. + For more information about bookmarks, see [Using WorkflowInvoker and WorkflowApplication](/dotnet/framework/windows-workflow-foundation/using-workflowinvoker-and-workflowapplication) and [Bookmarks](/dotnet/framework/windows-workflow-foundation/bookmarks). - -## Examples - In the following example, a `ReadLine` activity is created. When executed, the `ReadLine` activity creates a , registers a callback, and then waits for the to be resumed. When it is resumed, the `ReadLine` activity assigns the data that was passed with the to its argument. - -```csharp -public sealed class ReadLine : NativeActivity -{ - [RequiredArgument] - public InArgument BookmarkName { get; set; } - - protected override void Execute(NativeActivityContext context) - { - // Create a Bookmark and wait for it to be resumed. - context.CreateBookmark(BookmarkName.Get(context), - new BookmarkCallback(OnResumeBookmark)); - } - - // NativeActivity derived activities that do asynchronous operations by calling - // one of the CreateBookmark overloads defined on System.Activities.NativeActivityContext - // must override the CanInduceIdle property and return true. - protected override bool CanInduceIdle - { - get { return true; } - } - - public void OnResumeBookmark(NativeActivityContext context, Bookmark bookmark, object obj) - { - // When the Bookmark is resumed, assign its value to - // the Result argument. - Result.Set(context, (string)obj); - } -} -``` - - In the following example, a workflow is created that uses the `ReadLine` activity to gather the user's name and display it to the console window. The host application performs the actual work of gathering the input and passes it to the workflow by resuming the . - -```csharp -Variable name = new Variable -{ - Name = "name" -}; - -Activity wf = new Sequence -{ - Variables = - { - name - }, - Activities = - { - new WriteLine() - { - Text = "What is your name?" - }, - new ReadLine() - { - BookmarkName = "UserName", - Result = name - }, - new WriteLine() - { - Text = new InArgument((env) => "Hello, " + name.Get(env)) - } - } -}; - -AutoResetEvent syncEvent = new AutoResetEvent(false); - -// Create the WorkflowApplication using the desired -// workflow definition. -WorkflowApplication wfApp = new WorkflowApplication(wf); - -// Handle the desired lifecycle events. -wfApp.Completed = delegate(WorkflowApplicationCompletedEventArgs e) -{ - // Signal the host that the workflow is complete. - syncEvent.Set(); -}; - -// Start the workflow. -wfApp.Run(); - -// Collect the user's name and resume the bookmark. -// Bookmark resumption only occurs when the workflow -// is idle. If a call to ResumeBookmark is made and the workflow -// is not idle, ResumeBookmark blocks until the workflow becomes -// idle before resuming the bookmark. -wfApp.ResumeBookmark("UserName", Console.ReadLine()); - -// Wait for Completed to arrive and signal that -// the workflow is complete. -syncEvent.WaitOne(); -``` - - When the `ReadLine` activity is executed, it creates a named `UserName` and then waits for the bookmark to be resumed. The host collects the desired data and then resumes the . The workflow resumes, displays the name, and then completes. Note that no synchronization code is required with regard to resuming the bookmark. A can only be resumed when the workflow is idle, and if the workflow is not idle, the call to blocks until the workflow becomes idle. - + +## Examples + In the following example, a `ReadLine` activity is created. When executed, the `ReadLine` activity creates a , registers a callback, and then waits for the to be resumed. When it is resumed, the `ReadLine` activity assigns the data that was passed with the to its argument. + +```csharp +public sealed class ReadLine : NativeActivity +{ + [RequiredArgument] + public InArgument BookmarkName { get; set; } + + protected override void Execute(NativeActivityContext context) + { + // Create a Bookmark and wait for it to be resumed. + context.CreateBookmark(BookmarkName.Get(context), + new BookmarkCallback(OnResumeBookmark)); + } + + // NativeActivity derived activities that do asynchronous operations by calling + // one of the CreateBookmark overloads defined on System.Activities.NativeActivityContext + // must override the CanInduceIdle property and return true. + protected override bool CanInduceIdle + { + get { return true; } + } + + public void OnResumeBookmark(NativeActivityContext context, Bookmark bookmark, object obj) + { + // When the Bookmark is resumed, assign its value to + // the Result argument. + Result.Set(context, (string)obj); + } +} +``` + + In the following example, a workflow is created that uses the `ReadLine` activity to gather the user's name and display it to the console window. The host application performs the actual work of gathering the input and passes it to the workflow by resuming the . + +```csharp +Variable name = new Variable +{ + Name = "name" +}; + +Activity wf = new Sequence +{ + Variables = + { + name + }, + Activities = + { + new WriteLine() + { + Text = "What is your name?" + }, + new ReadLine() + { + BookmarkName = "UserName", + Result = name + }, + new WriteLine() + { + Text = new InArgument((env) => "Hello, " + name.Get(env)) + } + } +}; + +AutoResetEvent syncEvent = new AutoResetEvent(false); + +// Create the WorkflowApplication using the desired +// workflow definition. +WorkflowApplication wfApp = new WorkflowApplication(wf); + +// Handle the desired lifecycle events. +wfApp.Completed = delegate(WorkflowApplicationCompletedEventArgs e) +{ + // Signal the host that the workflow is complete. + syncEvent.Set(); +}; + +// Start the workflow. +wfApp.Run(); + +// Collect the user's name and resume the bookmark. +// Bookmark resumption only occurs when the workflow +// is idle. If a call to ResumeBookmark is made and the workflow +// is not idle, ResumeBookmark blocks until the workflow becomes +// idle before resuming the bookmark. +wfApp.ResumeBookmark("UserName", Console.ReadLine()); + +// Wait for Completed to arrive and signal that +// the workflow is complete. +syncEvent.WaitOne(); +``` + + When the `ReadLine` activity is executed, it creates a named `UserName` and then waits for the bookmark to be resumed. The host collects the desired data and then resumes the . The workflow resumes, displays the name, and then completes. Note that no synchronization code is required with regard to resuming the bookmark. A can only be resumed when the workflow is idle, and if the workflow is not idle, the call to blocks until the workflow becomes idle. + ]]> diff --git a/xml/System.Activities/BookmarkOptions.xml b/xml/System.Activities/BookmarkOptions.xml index 8fe18cd2084..7606af0c09a 100644 --- a/xml/System.Activities/BookmarkOptions.xml +++ b/xml/System.Activities/BookmarkOptions.xml @@ -21,14 +21,14 @@ Specifies the options for a . - , , and . +By default, the workflow runtime removes a pending bookmark from its bookmarks table when resuming the bookmark. However if the bookmark is specified as `MultipleResume`, the bookmark is not removed from the table, and the same bookmark can be resumed multiple times. An example usage of `MultipleResume` is by looping activities such as , , and . + +By default, the workflow runtime does not consider an activity to have completed execution if it has pending bookmarks. However, if a bookmark is specified as `NonBlocking` at creation time, the workflow runtime allows the activity to complete execution even if it has pending `NonBlocking` bookmarks, provided it has no other pending work. -By default, the workflow runtime does not consider an activity to have completed execution if it has pending bookmarks. However, if a bookmark is specified as `NonBlocking` at creation time, the workflow runtime allows the activity to complete execution even if it has pending `NonBlocking` bookmarks, provided it has no other pending work. - ]]> diff --git a/xml/System.Activities/CodeActivity.xml b/xml/System.Activities/CodeActivity.xml index b330e126613..376a175467f 100644 --- a/xml/System.Activities/CodeActivity.xml +++ b/xml/System.Activities/CodeActivity.xml @@ -16,13 +16,13 @@ An abstract class for creating a custom activity with imperative behavior defined with the method, which gives access to variable and argument resolution and extensions. - -derived activity. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/activityaction/cs/messagebox.cs" id="Snippet0"::: - + -derived activity. + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/activityaction/cs/messagebox.cs" id="Snippet0"::: + ]]> @@ -58,11 +58,11 @@ Creates and validates a description of the activity's arguments, variables, child activities, and activity delegates. - override. Any exceptions that are thrown from are not treated as validation errors. These exceptions will escape from the call to and must be handled by the caller. - + override. Any exceptions that are thrown from are not treated as validation errors. These exceptions will escape from the call to and must be handled by the caller. + ]]> @@ -89,11 +89,11 @@ Not implemented. Not implemented. Use instead. - override. Any exceptions that are thrown from are not treated as validation errors. These exceptions will escape from the call to and must be handled by the caller. - + override. Any exceptions that are thrown from are not treated as validation errors. These exceptions will escape from the call to and must be handled by the caller. + ]]> @@ -120,11 +120,11 @@ The activity's metadata that encapsulates the activity's arguments, variables, child activities, and activity delegates. Creates and validates a description of the activity's arguments, variables, child activities, and activity delegates. - to ensure correct construction of a workflow as well as to manage runtime relationships and lifetime rules. The default implementation of examines the public members of the activity type using the type's . These public members are of type , , [IEnumerable\](xref:System.Collections.Generic.IEnumerable%601), , [IEnumerable\](xref:System.Collections.Generic.IEnumerable%601), or . You can override this method to customize the building of the activity's run-time description and to provide custom validation logic. Any exceptions that are thrown from are not treated as validation errors. These exceptions will escape from the call to and must be handled by the caller. - + to ensure correct construction of a workflow as well as to manage runtime relationships and lifetime rules. The default implementation of examines the public members of the activity type using the type's . These public members are of type , , [IEnumerable\](xref:System.Collections.Generic.IEnumerable`1), , [IEnumerable\](xref:System.Collections.Generic.IEnumerable`1), or . You can override this method to customize the building of the activity's run-time description and to provide custom validation logic. Any exceptions that are thrown from are not treated as validation errors. These exceptions will escape from the call to and must be handled by the caller. + ]]> @@ -178,11 +178,11 @@ The workflow runtime uses the default implementation of Not supported. Always returns . - . does not allow defining the execution logic as an activity. Instead the execution logic must be defined in the method. - + . does not allow defining the execution logic as an activity. Instead the execution logic must be defined in the method. + ]]> diff --git a/xml/System.Activities/CodeActivity`1.xml b/xml/System.Activities/CodeActivity`1.xml index b56625bfad3..0a4d1dd9561 100644 --- a/xml/System.Activities/CodeActivity`1.xml +++ b/xml/System.Activities/CodeActivity`1.xml @@ -23,18 +23,18 @@ The result returned by the activity. An abstract class for creating a custom activity with imperative behavior defined in the method, giving access to variable and argument resolution and extensions. - . - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/workflowinvoker/cs/add.cs" id="Snippet0"::: - + . + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/workflowinvoker/cs/add.cs" id="Snippet0"::: + ]]> @@ -70,11 +70,11 @@ Creates and validates a description of the activity's arguments, variables, child activities, and activity delegates. - override. Any exceptions that are thrown from are not treated as validation errors. These exceptions will escape from the call to and must be handled by the caller. - + override. Any exceptions that are thrown from are not treated as validation errors. These exceptions will escape from the call to and must be handled by the caller. + ]]> @@ -101,11 +101,11 @@ Not implemented. Not implemented. Use instead. - override. Any exceptions that are thrown from are not treated as validation errors. These exceptions will escape from the call to and must be handled by the caller. - + override. Any exceptions that are thrown from are not treated as validation errors. These exceptions will escape from the call to and must be handled by the caller. + ]]> @@ -132,10 +132,10 @@ The activity's metadata that encapsulates the activity's arguments, variables, child activities, and activity delegates. Creates and validates a description of the activity's arguments, variables, child activities, and activity delegates. - to ensure correct construction of a workflow as well as to manage run-time relationships and lifetime rules. The default implementation of examines the public members of the activity type using the type's . These public members are of type , , [IEnumerable\](xref:System.Collections.Generic.IEnumerable%601), , [IEnumerable\](xref:System.Collections.Generic.IEnumerable%601), or . You can override this method to customize the building of the activity's run-time description and to provide custom validation logic. Any exceptions that are thrown from are not treated as validation errors. These exceptions will escape from the call to and must be handled by the caller. + to ensure correct construction of a workflow as well as to manage run-time relationships and lifetime rules. The default implementation of examines the public members of the activity type using the type's . These public members are of type , , [IEnumerable\](xref:System.Collections.Generic.IEnumerable`1), , [IEnumerable\](xref:System.Collections.Generic.IEnumerable`1), or . You can override this method to customize the building of the activity's run-time description and to provide custom validation logic. Any exceptions that are thrown from are not treated as validation errors. These exceptions will escape from the call to and must be handled by the caller. ]]> @@ -191,11 +191,11 @@ Not supported. Always returns . - . does not allow defining the execution logic as an activity. Instead the execution logic must be defined in the method. - + . does not allow defining the execution logic as an activity. Instead the execution logic must be defined in the method. + ]]> diff --git a/xml/System.Activities/DynamicActivity`1.xml b/xml/System.Activities/DynamicActivity`1.xml index 295b7422925..5640762cb41 100644 --- a/xml/System.Activities/DynamicActivity`1.xml +++ b/xml/System.Activities/DynamicActivity`1.xml @@ -33,11 +33,11 @@ The result returned by the activity. Provides an approach that is consistent with the document object model (DOM), which constructs activities dynamically that interface with the WF designer and workflow runtime using . - you can create new activities without creating new types. with its associated XAML support in allows new arguments to be defined in XAML and bound by the host without requiring XAML to be compiled. - + you can create new activities without creating new types. with its associated XAML support in allows new arguments to be defined in XAML and bound by the host without requiring XAML to be compiled. + ]]> @@ -258,11 +258,11 @@ Returns a collection of attributes of the dynamic activity. The attributes of the dynamic activity. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -290,11 +290,11 @@ Returns the class name of the dynamic activity. The class name. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -322,11 +322,11 @@ Returns the component name of the dynamic activity. The component name. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -354,11 +354,11 @@ Returns a type converter for the dynamic activity. A type converter for this dynamic activity instance. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -386,11 +386,11 @@ Returns the default event for the dynamic activity. The default event. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -418,11 +418,11 @@ Returns the default property for the dynamic activity. The default property. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -453,11 +453,11 @@ Returns an editor with the specified base type. An instance of the editor that can be cast to the specified editor type, or if no editor of the requested type can be found. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -494,11 +494,11 @@ Returns the collection of events of the dynamic activity. The collection of events. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -529,11 +529,11 @@ Returns the collection of events of the dynamic activity using a specified array of attributes as a filter. The collection of events that match the specified attributes. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -570,11 +570,11 @@ Returns the collection of properties of the dynamic activity. The collection of properties. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -605,11 +605,11 @@ Returns the collection of properties of the dynamic activity using a specified array of attributes as a filter. The collection of properties that match the specified attributes. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -640,13 +640,13 @@ Returns this instance of the class. This instance of . - interface. - - This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. - + interface. + + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. + ]]> diff --git a/xml/System.Activities/ExecutionProperties.xml b/xml/System.Activities/ExecutionProperties.xml index 03bd21ab6e8..a1b6e98dbc7 100644 --- a/xml/System.Activities/ExecutionProperties.xml +++ b/xml/System.Activities/ExecutionProperties.xml @@ -23,15 +23,15 @@ Represents the collection of properties at a particular scope. - @@ -134,11 +134,11 @@ Returns the nearest property of the given name. The nearest property of the given name. - finds the nearest visible property using hierarchical scoping. If two properties have the same name, the closest property at the parent scope is returned. - + finds the nearest visible property using hierarchical scoping. If two properties have the same name, the closest property at the parent scope is returned. + ]]> @@ -220,11 +220,11 @@ if the property was unregistered; otherwise, . - diff --git a/xml/System.Activities/Handle.xml b/xml/System.Activities/Handle.xml index 91c6eea15fc..6e2c1cdc03b 100644 --- a/xml/System.Activities/Handle.xml +++ b/xml/System.Activities/Handle.xml @@ -22,11 +22,11 @@ Represents a type that has its lifetime controlled by the workflow runtime. - have their lifetimes controlled by the workflow runtime. For workflow variables of handle types, the runtime uses the required parameterless constructor to create an instance of the type, assigns it to the , and calls when initializing the environment. When the variable goes out of scope, is called. - + have their lifetimes controlled by the workflow runtime. For workflow variables of handle types, the runtime uses the required parameterless constructor to create an instance of the type, assigns it to the , and calls when initializing the environment. When the variable goes out of scope, is called. + ]]> @@ -46,11 +46,11 @@ Initializes a new instance of the class. - must provide a parameterless constructor. - + must provide a parameterless constructor. + ]]> @@ -170,11 +170,11 @@ Throws an if the has not been initialized. - gives custom handle derived class authors a convenient method to call from any methods or properties of the derived class that are not valid if the is uninitialized. - + gives custom handle derived class authors a convenient method to call from any methods or properties of the derived class that are not valid if the is uninitialized. + ]]> diff --git a/xml/System.Activities/InArgument`1.xml b/xml/System.Activities/InArgument`1.xml index 12bb01c3d5b..99b2231d58f 100644 --- a/xml/System.Activities/InArgument`1.xml +++ b/xml/System.Activities/InArgument`1.xml @@ -34,21 +34,21 @@ The data type of the . A binding terminal that represents the flow of data into an activity. - activity. The activity has an named . The host application creates an instance of the workflow and passes a string, which maps to the argument of the and is used by the activity. - -```csharp -Activity wf = new WriteLine(); - -Dictionary wfParams = new Dictionary(); -wfParams.Add("Text", "Hello World!"); - -WorkflowInvoker.Invoke(wf, wfParams); - -``` - + activity. The activity has an named . The host application creates an instance of the workflow and passes a string, which maps to the argument of the and is used by the activity. + +```csharp +Activity wf = new WriteLine(); + +Dictionary wfParams = new Dictionary(); +wfParams.Add("Text", "Hello World!"); + +WorkflowInvoker.Invoke(wf, wfParams); + +``` + ]]> @@ -182,11 +182,11 @@ WorkflowInvoker.Invoke(wf, wfParams); The value of the argument. Initializes a new instance of the class using the specified value. - ` was provided as a `constValue` and three instances were created then all three instances would be accessing the same `List`. - + ` was provided as a `constValue` and three instances were created then all three instances would be accessing the same `List`. + ]]> diff --git a/xml/System.Activities/InOutArgument`1.xml b/xml/System.Activities/InOutArgument`1.xml index 315ab1f239a..525fca89a3a 100644 --- a/xml/System.Activities/InOutArgument`1.xml +++ b/xml/System.Activities/InOutArgument`1.xml @@ -34,57 +34,57 @@ The data type of the . A binding terminal that represents the flow of data into and out of an activity. - of type named `N1`. This argument is used to receive the value to be operated on and is also used to pass the result of the operation back out. - -```csharp -class Square : CodeActivity -{ - public Square() : base() { } - - public InOutArgument N1 - { - get; - - set; - } - - protected override void Execute(CodeActivityContext context) - { - context.SetValue(N1, N1.Get(context) * N1.Get(context)); - } -} -``` - - In the following example, the `Square` activity is hosted in a workflow. A value is passed into the activity and the result is then displayed to the console window by a activity. - -```csharp -Variable n1 = new Variable() { Default = 25 }; - -Activity activity1 = new Sequence() -{ - Variables = - { - n1 - }, - Activities = - { - new Square() - { - N1 = new InOutArgument(n1) - }, - new WriteLine() - { - Text = new InArgument(ctx => "Squared result: " + n1.Get(ctx)) - } - } -}; - -WorkflowInvoker.Invoke(activity1); -``` - + of type named `N1`. This argument is used to receive the value to be operated on and is also used to pass the result of the operation back out. + +```csharp +class Square : CodeActivity +{ + public Square() : base() { } + + public InOutArgument N1 + { + get; + + set; + } + + protected override void Execute(CodeActivityContext context) + { + context.SetValue(N1, N1.Get(context) * N1.Get(context)); + } +} +``` + + In the following example, the `Square` activity is hosted in a workflow. A value is passed into the activity and the result is then displayed to the console window by a activity. + +```csharp +Variable n1 = new Variable() { Default = 25 }; + +Activity activity1 = new Sequence() +{ + Variables = + { + n1 + }, + Activities = + { + new Square() + { + N1 = new InOutArgument(n1) + }, + new WriteLine() + { + Text = new InArgument(ctx => "Squared result: " + n1.Get(ctx)) + } + } +}; + +WorkflowInvoker.Invoke(activity1); +``` + ]]> diff --git a/xml/System.Activities/InvokeCompletedEventArgs.xml b/xml/System.Activities/InvokeCompletedEventArgs.xml index afb3664f7e6..b5e075df468 100644 --- a/xml/System.Activities/InvokeCompletedEventArgs.xml +++ b/xml/System.Activities/InvokeCompletedEventArgs.xml @@ -16,11 +16,11 @@ Provides data for the event. - overloads in , workflow host authors can handle to get data from the completed workflow, or exception data if the workflow failed to complete. - + overloads in , workflow host authors can handle to get data from the completed workflow, or exception data if the workflow failed to complete. + ]]> @@ -50,11 +50,11 @@ Gets an of the root activity's output argument values from the completed workflow. A dictionary of the root activity's output argument values from the completed workflow. - diff --git a/xml/System.Activities/Location.xml b/xml/System.Activities/Location.xml index f4044032d8e..83769872bd0 100644 --- a/xml/System.Activities/Location.xml +++ b/xml/System.Activities/Location.xml @@ -101,11 +101,11 @@ Gets or sets the value of the referenced object. The value of the object. - to get and set the value, which is implemented in derived classes. - + to get and set the value, which is implemented in derived classes. + ]]> diff --git a/xml/System.Activities/Location`1.xml b/xml/System.Activities/Location`1.xml index e0b82ab3d6c..22c29ace909 100644 --- a/xml/System.Activities/Location`1.xml +++ b/xml/System.Activities/Location`1.xml @@ -92,11 +92,11 @@ Returns the string representation of the value of the referenced object. The value of the referenced object. - ". - + ". + ]]> @@ -151,11 +151,11 @@ Gets or sets the value of the referenced object. The value of the referenced object. - to get and set the value, which is implemented in derived classes. - + to get and set the value, which is implemented in derived classes. + ]]> diff --git a/xml/System.Activities/NativeActivity.xml b/xml/System.Activities/NativeActivity.xml index ee7232fedad..5d4c7026cbd 100644 --- a/xml/System.Activities/NativeActivity.xml +++ b/xml/System.Activities/NativeActivity.xml @@ -16,79 +16,79 @@ Abstract base class for custom activities that implement execution logic using the method, which has full access to the runtime's features. - . This example is from the [Custom Composite using Native Activity](/dotnet/framework/windows-workflow-foundation/samples/custom-composite-using-native-activity) sample. - + . This example is from the [Custom Composite using Native Activity](/dotnet/framework/windows-workflow-foundation/samples/custom-composite-using-native-activity) sample. + ```csharp -public sealed class MySequence : NativeActivity -{ - Collection children; - Collection variables; - Variable currentIndex; - CompletionCallback onChildComplete; - - public MySequence() - : base() - { - this.children = new Collection(); - this.variables = new Collection(); - this.currentIndex = new Variable(); - } - - public Collection Activities - { - get - { - return this.children; - } - } - public Collection Variables - { - get - { - return this.variables; - } - } - protected override void CacheMetadata(NativeActivityMetadata metadata) - { - //call base.CacheMetadata to add the Activities and Variables to this activity's metadata - base.CacheMetadata(metadata); - //add the private implementation variable: currentIndex - metadata.AddImplementationVariable(this.currentIndex); - } - - protected override void Execute(NativeActivityContext context) - { - InternalExecute(context, null); - } - void InternalExecute(NativeActivityContext context, ActivityInstance instance) - { - //grab the index of the current Activity - int currentActivityIndex = this.currentIndex.Get(context); - if (currentActivityIndex == Activities.Count) - { - //if the currentActivityIndex is equal to the count of MySequence's Activities - //MySequence is complete - return; - } - - if (this.onChildComplete == null) - { - //on completion of the current child, have the runtime call back on this method - this.onChildComplete = new CompletionCallback(InternalExecute); - } - //grab the next Activity in MySequence.Activities and schedule it - Activity nextChild = Activities[currentActivityIndex]; - context.ScheduleActivity(nextChild, this.onChildComplete); - - //increment the currentIndex - this.currentIndex.Set(context, ++currentActivityIndex); - } -} -``` - +public sealed class MySequence : NativeActivity +{ + Collection children; + Collection variables; + Variable currentIndex; + CompletionCallback onChildComplete; + + public MySequence() + : base() + { + this.children = new Collection(); + this.variables = new Collection(); + this.currentIndex = new Variable(); + } + + public Collection Activities + { + get + { + return this.children; + } + } + public Collection Variables + { + get + { + return this.variables; + } + } + protected override void CacheMetadata(NativeActivityMetadata metadata) + { + //call base.CacheMetadata to add the Activities and Variables to this activity's metadata + base.CacheMetadata(metadata); + //add the private implementation variable: currentIndex + metadata.AddImplementationVariable(this.currentIndex); + } + + protected override void Execute(NativeActivityContext context) + { + InternalExecute(context, null); + } + void InternalExecute(NativeActivityContext context, ActivityInstance instance) + { + //grab the index of the current Activity + int currentActivityIndex = this.currentIndex.Get(context); + if (currentActivityIndex == Activities.Count) + { + //if the currentActivityIndex is equal to the count of MySequence's Activities + //MySequence is complete + return; + } + + if (this.onChildComplete == null) + { + //on completion of the current child, have the runtime call back on this method + this.onChildComplete = new CompletionCallback(InternalExecute); + } + //grab the next Activity in MySequence.Activities and schedule it + Activity nextChild = Activities[currentActivityIndex]; + context.ScheduleActivity(nextChild, this.onChildComplete); + + //increment the currentIndex + this.currentIndex.Set(context, ++currentActivityIndex); + } +} +``` + ]]> @@ -114,13 +114,13 @@ public sealed class MySequence : NativeActivity When implemented in a derived class, creates a new instance of the derived class. - . This example is from the [Custom Composite using Native Activity](/dotnet/framework/windows-workflow-foundation/samples/custom-composite-using-native-activity) sample. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_customcompositenativeactivity/cs/mysequence.cs" id="Snippet1"::: - + . This example is from the [Custom Composite using Native Activity](/dotnet/framework/windows-workflow-foundation/samples/custom-composite-using-native-activity) sample. + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_customcompositenativeactivity/cs/mysequence.cs" id="Snippet1"::: + ]]> @@ -157,11 +157,11 @@ public sealed class MySequence : NativeActivity Creates and validates a description of the activity's arguments, variables, child activities, and activity delegates. - override. Any exceptions that are thrown from are not treated as validation errors. These exceptions will escape from the call to and must be handled by the caller. - + override. Any exceptions that are thrown from are not treated as validation errors. These exceptions will escape from the call to and must be handled by the caller. + ]]> @@ -188,11 +188,11 @@ public sealed class MySequence : NativeActivity Not implemented. Not implemented. Use the method instead. - override. Any exceptions that are thrown from are not treated as validation errors. These exceptions will escape from the call to and must be handled by the caller. - + override. Any exceptions that are thrown from are not treated as validation errors. These exceptions will escape from the call to and must be handled by the caller. + ]]> @@ -219,18 +219,18 @@ public sealed class MySequence : NativeActivity The activity's metadata that encapsulates the activity's arguments, variables, child activities, and activity delegates. Creates and validates a description of the activity's arguments, variables, child activities, and activity delegates. - to ensure correct construction of a workflow as well as to manage run-time relationships and lifetime rules. The default implementation of examines the public members of the activity type using the type's . These public members are of type , , [IEnumerable\](xref:System.Collections.Generic.IEnumerable%601), , [IEnumerable\](xref:System.Collections.Generic.IEnumerable%601), or . You can override this method to customize the building of the activity's run-time description and to provide custom validation logic. Any exceptions that are thrown from are not treated as validation errors. These exceptions will escape from the call to and must be handled by the caller. - - - -## Examples - The following code sample demonstrates using CacheMetadata in a class that inherits from . This example is from the [Custom Composite using Native Activity](/dotnet/framework/windows-workflow-foundation/samples/custom-composite-using-native-activity) sample. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_customcompositenativeactivity/cs/mysequence.cs" id="Snippet2"::: - + to ensure correct construction of a workflow as well as to manage run-time relationships and lifetime rules. The default implementation of examines the public members of the activity type using the type's . These public members are of type , , [IEnumerable\](xref:System.Collections.Generic.IEnumerable`1), , [IEnumerable\](xref:System.Collections.Generic.IEnumerable`1), or . You can override this method to customize the building of the activity's run-time description and to provide custom validation logic. Any exceptions that are thrown from are not treated as validation errors. These exceptions will escape from the call to and must be handled by the caller. + + + +## Examples + The following code sample demonstrates using CacheMetadata in a class that inherits from . This example is from the [Custom Composite using Native Activity](/dotnet/framework/windows-workflow-foundation/samples/custom-composite-using-native-activity) sample. + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_customcompositenativeactivity/cs/mysequence.cs" id="Snippet2"::: + ]]> @@ -257,13 +257,13 @@ public sealed class MySequence : NativeActivity The execution context in which the activity executes. When implemented in a derived class, runs logic to cause graceful early completion of the activity. - . This example is from the [Non-Generic ParallelForEach](/dotnet/framework/windows-workflow-foundation/samples/non-generic-parallelforeach) sample. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_nongenericparallelforeach/cs/parallelforeach/parallelforeach.cs" id="Snippet2"::: - + . This example is from the [Non-Generic ParallelForEach](/dotnet/framework/windows-workflow-foundation/samples/non-generic-parallelforeach) sample. + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_nongenericparallelforeach/cs/parallelforeach/parallelforeach.cs" id="Snippet2"::: + ]]> @@ -312,13 +312,13 @@ public sealed class MySequence : NativeActivity The execution context in which the activity executes. When implemented in a derived class, runs the activity's execution logic. - . This example is from the [Non-Generic ParallelForEach](/dotnet/framework/windows-workflow-foundation/samples/non-generic-parallelforeach) sample. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_nongenericparallelforeach/cs/parallelforeach/parallelforeach.cs" id="Snippet2"::: - + . This example is from the [Non-Generic ParallelForEach](/dotnet/framework/windows-workflow-foundation/samples/non-generic-parallelforeach) sample. + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_nongenericparallelforeach/cs/parallelforeach/parallelforeach.cs" id="Snippet2"::: + ]]> diff --git a/xml/System.Activities/NativeActivityAbortContext.xml b/xml/System.Activities/NativeActivityAbortContext.xml index 8317ba52199..d4f8f4a9a5d 100644 --- a/xml/System.Activities/NativeActivityAbortContext.xml +++ b/xml/System.Activities/NativeActivityAbortContext.xml @@ -16,11 +16,11 @@ Represents the execution environment of an activity that is being aborted. - can override to take action in response to being aborted. For example, an activity that interacts with might want to call if the activity is being aborted. - + can override to take action in response to being aborted. For example, an activity that interacts with might want to call if the activity is being aborted. + ]]> diff --git a/xml/System.Activities/NativeActivityContext.xml b/xml/System.Activities/NativeActivityContext.xml index 2cfed7d6e15..7ef798fc7e1 100644 --- a/xml/System.Activities/NativeActivityContext.xml +++ b/xml/System.Activities/NativeActivityContext.xml @@ -16,11 +16,11 @@ The execution context for a . - is provided access to the advanced capabilities of the WF runtime via , which is passed as a parameter to the activity's method. - + is provided access to the advanced capabilities of the WF runtime via , which is passed as a parameter to the activity's method. + ]]> @@ -313,13 +313,13 @@ Creates the point at which a can passively wait to be resumed, with the specified method to execute when notification of the resume operation completes and with the specified option that governs how the bookmark is used during the execution of the current . A bookmark that includes the callback method and the bookmark execution option. - , and . - - Bookmark callbacks can operate without bookmark options but bookmark options must always be paired with a callback because the options do not apply in situations where there is no callback method. - + , and . + + Bookmark callbacks can operate without bookmark options but bookmark options must always be paired with a callback because the options do not apply in situations where there is no callback method. + ]]> @@ -384,11 +384,11 @@ Creates the point at which a can passively wait to be resumed with the specified name, the specified method to execute when notification of the resume operation completes, and the specified option that governs how the bookmark is used during the execution of the current . A bookmark that includes the name of the bookmark, the callback method, and the bookmark execution option. - @@ -426,11 +426,11 @@ Creates the point at which a can passively wait to be resumed with the specified name, the specified method to execute when notification of the resume operation completes, and the specified scope of the bookmark. A bookmark that includes the name of the bookmark, the callback method, and the scope of the bookmark. - @@ -464,11 +464,11 @@ Creates the point at which a can passively wait to be resumed with the specified name, the specified method to execute when notification of the resume operation completes, the specified scope of the bookmark, and the specified option that governs how the bookmark is used during the execution of the current . A bookmark that includes the name of the bookmark, the callback method, the scope of the bookmark, and the bookmark execution option. - diff --git a/xml/System.Activities/NativeActivityMetadata.xml b/xml/System.Activities/NativeActivityMetadata.xml index 4994dc0db18..1002a111cd7 100644 --- a/xml/System.Activities/NativeActivityMetadata.xml +++ b/xml/System.Activities/NativeActivityMetadata.xml @@ -73,11 +73,11 @@ The activity to add. Adds the specified activity to the metadata's list of child activities. - is a child activity that the parent activity can schedule directly. These activities are to be provided by the consumer of the activity. An example of this is the collection of a activity. These activities (and any activities they add using or ) have access to variables added through . - + is a child activity that the parent activity can schedule directly. These activities are to be provided by the consumer of the activity. An example of this is the collection of a activity. These activities (and any activities they add using or ) have access to variables added through . + ]]> @@ -138,11 +138,11 @@ The function that returns the extension. Adds the specified extension provider to the collection of default extension providers for the activity. - @@ -228,11 +228,11 @@ The activity to add. Adds the specified activity to the metadata's list of implementation activities. - is a child activity that the parent activity can schedule directly. These activities are implementation details of the activity. These activities (and any activities they add using or ) have access to this activity's arguments as well as variables added through . - + is a child activity that the parent activity can schedule directly. These activities are implementation details of the activity. These activities (and any activities they add using or ) have access to this activity's arguments as well as variables added through . + ]]> @@ -316,11 +316,11 @@ The activity to add. Adds the specified activity to the metadata's list of imported child activities. - @@ -418,11 +418,11 @@ Adds a validation error to the metadata' collection of validation errors. - @@ -449,11 +449,11 @@ For more information, see [Imperative Code-Based Validation](/dotnet/framework/w The validation error to add. Adds the specified validation error to the metadata's collection of validation errors. - @@ -480,11 +480,11 @@ For more information, see [Imperative Code-Based Validation](/dotnet/framework/w A message that describes the validation error. Adds a validation error to the metadata's collection of validation errors using the specified description. - @@ -520,11 +520,11 @@ For more information, see [Imperative Code-Based Validation](/dotnet/framework/w The variable to add. Adds the specified variable to the metadata's collection of variables. - or (and any of their non-implementation child activities) can access variables added using this method. - + or (and any of their non-implementation child activities) can access variables added using this method. + ]]> @@ -654,11 +654,11 @@ For more information, see [Imperative Code-Based Validation](/dotnet/framework/w Returns a collection of arguments obtained by using reflection. A collection of arguments. - to examine all public properties of type and returns them in a collection. - + to examine all public properties of type and returns them in a collection. + ]]> @@ -683,11 +683,11 @@ For more information, see [Imperative Code-Based Validation](/dotnet/framework/w Returns a collection of child activities using reflection. A collection of child activities. - to examine all public properties of type , or `IList` or `ICollection` where `T` derives from , and returns them in a collection. - + to examine all public properties of type , or `IList` or `ICollection` where `T` derives from , and returns them in a collection. + ]]> @@ -712,11 +712,11 @@ For more information, see [Imperative Code-Based Validation](/dotnet/framework/w Returns a collection of delegates using reflection. A collection of delegates. - to examine all public properties of type , or `IList` or `ICollection` where `T` derives from , and returns them in a collection. - + to examine all public properties of type , or `IList` or `ICollection` where `T` derives from , and returns them in a collection. + ]]> @@ -763,11 +763,11 @@ For more information, see [Imperative Code-Based Validation](/dotnet/framework/w Returns a collection of variables using reflection. A collection of variables. - to examine all public properties of type , or `IList` or `ICollection` where `T` derives from , and returns them in a collection. - + to examine all public properties of type , or `IList` or `ICollection` where `T` derives from , and returns them in a collection. + ]]> @@ -872,11 +872,11 @@ For more information, see [Imperative Code-Based Validation](/dotnet/framework/w The type of the extension. Specifies that the activity requires an extension of the specified type at runtime. - @@ -908,11 +908,11 @@ For more information, see [Imperative Code-Based Validation](/dotnet/framework/w The type of the extension. Specifies that the activity requires an extension of the specified generic type at runtime. - @@ -963,11 +963,11 @@ For more information, see [Imperative Code-Based Validation](/dotnet/framework/w The activities to add. Adds the specified collection as child activities of the activity. - for each item in the collection. - + for each item in the collection. + ]]> @@ -994,11 +994,11 @@ For more information, see [Imperative Code-Based Validation](/dotnet/framework/w The delegates to add. Adds the specified collection as delegates of the activity. - for each item in the collection. - + for each item in the collection. + ]]> @@ -1025,11 +1025,11 @@ For more information, see [Imperative Code-Based Validation](/dotnet/framework/w The activities to add. Adds the specified collection as implementation child activities of the activity. - for each item in the collection. - + for each item in the collection. + ]]> @@ -1056,11 +1056,11 @@ For more information, see [Imperative Code-Based Validation](/dotnet/framework/w The delegates to add. Adds the specified collection as implementation delegates of the activity. - for each item in the collection. - + for each item in the collection. + ]]> @@ -1087,11 +1087,11 @@ For more information, see [Imperative Code-Based Validation](/dotnet/framework/w The delegates to add. Adds the specified collection as implementation variables of the activity. - for each item in the collection. - + for each item in the collection. + ]]> @@ -1118,11 +1118,11 @@ For more information, see [Imperative Code-Based Validation](/dotnet/framework/w The activities to add. Adds the specified collection as imported child activities of the activity. - for each item in the collection. - + for each item in the collection. + ]]> @@ -1149,11 +1149,11 @@ For more information, see [Imperative Code-Based Validation](/dotnet/framework/w The delegates to add. Adds the specified collection as imported delegates of the activity. - for each item in the collection. - + for each item in the collection. + ]]> diff --git a/xml/System.Activities/NativeActivity`1.xml b/xml/System.Activities/NativeActivity`1.xml index 9ad27e34b4d..0b0c832f945 100644 --- a/xml/System.Activities/NativeActivity`1.xml +++ b/xml/System.Activities/NativeActivity`1.xml @@ -23,14 +23,14 @@ The result returned by the activity. Abstract base class for custom activities that implement execution logic using the method, that has full access to the runtime's features. - . This example is from the [How to: Create an Activity](/dotnet/framework/windows-workflow-foundation/how-to-create-an-activity) step of the [Getting Started Tutorial [.NET Framework 4.5]](/dotnet/framework/windows-workflow-foundation/getting-started-tutorial). - + . This example is from the [How to: Create an Activity](/dotnet/framework/windows-workflow-foundation/how-to-create-an-activity) step of the [Getting Started Tutorial [.NET Framework 4.5]](/dotnet/framework/windows-workflow-foundation/getting-started-tutorial). + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_wf_gettingstarted/cs/readint.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CFX/cfx_wf_gettingstarted/vb/readint.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CFX/cfx_wf_gettingstarted/vb/readint.vb" id="Snippet1"::: + ]]> @@ -90,11 +90,11 @@ Creates and validates a description of the activity's arguments, variables, child activities, and activity delegates. - override. Any exceptions that are thrown from are not treated as validation errors. These exceptions will escape from the call to and must be handled by the caller. - + override. Any exceptions that are thrown from are not treated as validation errors. These exceptions will escape from the call to and must be handled by the caller. + ]]> @@ -121,11 +121,11 @@ Not implemented. Not implemented. Use instead. - override. Any exceptions that are thrown from are not treated as validation errors. These exceptions will escape from the call to and must be handled by the caller. - + override. Any exceptions that are thrown from are not treated as validation errors. These exceptions will escape from the call to and must be handled by the caller. + ]]> @@ -152,18 +152,18 @@ The activity's metadata that encapsulates the activity's arguments, variables, child activities, and activity delegates. Creates and validates a description of the activity's arguments, variables, child activities, and activity delegates. - to ensure correct construction of a workflow as well as to manage run-time relationships and lifetime rules. The default implementation of examines the public members of the activity type using the type's . These public members are of type , , [IEnumerable\](xref:System.Collections.Generic.IEnumerable%601), , [IEnumerable\](xref:System.Collections.Generic.IEnumerable%601), or . You can override this method to customize the building of the activity's run-time description and to provide custom validation logic. Any exceptions that are thrown from are not treated as validation errors. These exceptions will escape from the call to and must be handled by the caller. - - - -## Examples - The following code sample demonstrates using CacheMetadata in a class that inherits from . This example is from the [Custom Composite using Native Activity](/dotnet/framework/windows-workflow-foundation/samples/custom-composite-using-native-activity) sample. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_customcompositenativeactivity/cs/mysequence.cs" id="Snippet2"::: - + to ensure correct construction of a workflow as well as to manage run-time relationships and lifetime rules. The default implementation of examines the public members of the activity type using the type's . These public members are of type , , [IEnumerable\](xref:System.Collections.Generic.IEnumerable`1), , [IEnumerable\](xref:System.Collections.Generic.IEnumerable`1), or . You can override this method to customize the building of the activity's run-time description and to provide custom validation logic. Any exceptions that are thrown from are not treated as validation errors. These exceptions will escape from the call to and must be handled by the caller. + + + +## Examples + The following code sample demonstrates using CacheMetadata in a class that inherits from . This example is from the [Custom Composite using Native Activity](/dotnet/framework/windows-workflow-foundation/samples/custom-composite-using-native-activity) sample. + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_customcompositenativeactivity/cs/mysequence.cs" id="Snippet2"::: + ]]> @@ -190,13 +190,13 @@ The execution context in which the activity executes. When implemented in a derived class, runs logic to cause graceful early completion of the activity. - . This example is from the [Non-Generic ParallelForEach](/dotnet/framework/windows-workflow-foundation/samples/non-generic-parallelforeach) sample. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_nongenericparallelforeach/cs/parallelforeach/parallelforeach.cs" id="Snippet2"::: - + . This example is from the [Non-Generic ParallelForEach](/dotnet/framework/windows-workflow-foundation/samples/non-generic-parallelforeach) sample. + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_nongenericparallelforeach/cs/parallelforeach/parallelforeach.cs" id="Snippet2"::: + ]]> @@ -221,14 +221,14 @@ if the activity can cause the workflow to become idle, otherwise . This value is by default. - . - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_waitforinput/cs/waitforinput/waitforinput.cs" id="Snippet1"::: - +The following code sample demonstrates using CanInduceIdle in a class that inherits from . + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_waitforinput/cs/waitforinput/waitforinput.cs" id="Snippet1"::: + ]]> @@ -255,13 +255,13 @@ The following code sample demonstrates using CanInduceIdle in a class that inher The execution context in which the activity executes. When implemented in a derived class, runs the activity's execution logic. - . This example is from the [Non-Generic ParallelForEach](/dotnet/framework/windows-workflow-foundation/samples/non-generic-parallelforeach) sample. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_nongenericparallelforeach/cs/parallelforeach/parallelforeach.cs" id="Snippet1"::: - + . This example is from the [Non-Generic ParallelForEach](/dotnet/framework/windows-workflow-foundation/samples/non-generic-parallelforeach) sample. + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_nongenericparallelforeach/cs/parallelforeach/parallelforeach.cs" id="Snippet1"::: + ]]> diff --git a/xml/System.Activities/OutArgument`1.xml b/xml/System.Activities/OutArgument`1.xml index dea86242f7d..954f09c16a3 100644 --- a/xml/System.Activities/OutArgument`1.xml +++ b/xml/System.Activities/OutArgument`1.xml @@ -34,27 +34,27 @@ The data type of the . A binding terminal that represents the flow of data out of an activity. - is used to flow data out of an activity. If the activity is the root activity of a workflow, then it is also used to flow data out of the workflow to the workflow host. In this example, a custom `Divide` activity that has two input arguments and one output argument is used as the root activity of a workflow. The host application passes two values into the workflow and then retrieves the result of the division after the workflow completes. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowinvokerexample/cs/program.cs" id="Snippet20"::: - - The `Divide` activity uses arguments to receive the input values and to provide the computed result values. The `Remainder` is used to pass out the remainder of the division, and the output argument provided by derived activities is used to pass out the quotient. - + is used to flow data out of an activity. If the activity is the root activity of a workflow, then it is also used to flow data out of the workflow to the workflow host. In this example, a custom `Divide` activity that has two input arguments and one output argument is used as the root activity of a workflow. The host application passes two values into the workflow and then retrieves the result of the division after the workflow completes. + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowinvokerexample/cs/program.cs" id="Snippet20"::: + + The `Divide` activity uses arguments to receive the input values and to provide the computed result values. The `Remainder` is used to pass out the remainder of the division, and the output argument provided by derived activities is used to pass out the quotient. + > [!NOTE] -> If your custom activity is derived from the generic with an as its generic type argument, when you invoke the activity with the Invoke method, it returns an value. In Addition, the method will return an value instead of `void` and you do not need to set a return value. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet120"::: - - - -## Examples - The following code sample demonstrates creating an . This example is from the Formatter sample. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_formatter/cs/program.cs" id="Snippet1"::: - +> If your custom activity is derived from the generic with an as its generic type argument, when you invoke the activity with the Invoke method, it returns an value. In Addition, the method will return an value instead of `void` and you do not need to set a return value. + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet120"::: + + + +## Examples + The following code sample demonstrates creating an . This example is from the Formatter sample. + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_formatter/cs/program.cs" id="Snippet1"::: + ]]> @@ -83,13 +83,13 @@ Initialize a new instance of the class using default values. - . This example is from the Formatter sample. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_formatter/cs/program.cs" id="Snippet1"::: - + . This example is from the Formatter sample. + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wfs_formatter/cs/program.cs" id="Snippet1"::: + ]]> @@ -398,11 +398,11 @@ Initializes and returns a new constructed using the specified . The new argument. - diff --git a/xml/System.Activities/OverloadGroupAttribute.xml b/xml/System.Activities/OverloadGroupAttribute.xml index aa611072865..33e67e484a3 100644 --- a/xml/System.Activities/OverloadGroupAttribute.xml +++ b/xml/System.Activities/OverloadGroupAttribute.xml @@ -22,17 +22,17 @@ Provides a method for indicating which combinations of arguments are valid in an activity. - is `false`. Overload groups can overlap but it is an error if the intersection of the groups contains all the required arguments of one or both the overload groups. - - An overload group is considered bound if all the arguments in the group are bound. If a group has zero arguments and at least one argument bound, then the group is considered bound. It is an error if none of the groups are bound unless one overload group has no arguments in it. Binding arguments from more than one overload group is not permitted. It is an error to have more than one overload group bound, that is, all required arguments in one overload group are bound and any argument in another overload group is also bound. - - Any violation of the preceding rules results in a being thrown when the containing activity is prepared for execution. - - The is set to `true` if the is applied to an argument. - + is `false`. Overload groups can overlap but it is an error if the intersection of the groups contains all the required arguments of one or both the overload groups. + + An overload group is considered bound if all the arguments in the group are bound. If a group has zero arguments and at least one argument bound, then the group is considered bound. It is an error if none of the groups are bound unless one overload group has no arguments in it. Binding arguments from more than one overload group is not permitted. It is an error to have more than one overload group bound, that is, all required arguments in one overload group are bound and any argument in another overload group is also bound. + + Any violation of the preceding rules results in a being thrown when the containing activity is prepared for execution. + + The is set to `true` if the is applied to an argument. + ]]> diff --git a/xml/System.Activities/PersistableIdleAction.xml b/xml/System.Activities/PersistableIdleAction.xml index 3125c5c1b71..bc2d222856c 100644 --- a/xml/System.Activities/PersistableIdleAction.xml +++ b/xml/System.Activities/PersistableIdleAction.xml @@ -15,11 +15,11 @@ Specifies the action that occurs when a workflow becomes idle when persistence is allowed. - function is invoked when the scheduler has no more pending work items and the workflow runtime can persist. Note that the function is invoked when persistence is not allowed, and both and are invoked in that order when persistence is allowed. None is the default action if no handler is provided. - + function is invoked when the scheduler has no more pending work items and the workflow runtime can persist. Note that the function is invoked when persistence is not allowed, and both and are invoked in that order when persistence is allowed. None is the default action if no handler is provided. + ]]> diff --git a/xml/System.Activities/RuntimeArgument.xml b/xml/System.Activities/RuntimeArgument.xml index 5dbb0b9bcd5..84e88633a5a 100644 --- a/xml/System.Activities/RuntimeArgument.xml +++ b/xml/System.Activities/RuntimeArgument.xml @@ -153,15 +153,15 @@ The names of the overload groups that apply to this . Initializes a new instance of the class with a name, data type, argument direction, whether the is required to be bound to a value, and a list of overload group names. - is set to `true` if the is applied to an argument. - - Overload groups can be set on arguments through the . - + is set to `true` if the is applied to an argument. + + Overload groups can be set on arguments through the . + ]]> @@ -298,11 +298,11 @@ if the is required to be bound to a value; otherwise, . - is thrown when the containing activity is prepared for execution, unless overload groups are used and the required arguments of an overload group are bound. For more information, see . - + is thrown when the containing activity is prepared for execution, unless overload groups are used and the required arguments of an overload group are bound. For more information, see . + ]]> @@ -353,17 +353,17 @@ Gets a list of the overload groups that this belongs to. A list of overload group names. - identifies the overload groups to which this argument belongs. An overload group cannot be a subset or an equivalent set of another overload group. The only exception to this rule is a subset that contains only arguments where is `false`. Overload groups can overlap but it is an error if the intersection of the groups contains all the required arguments of one or both the overload groups. - - An overload group is considered bound if all the arguments in the group are bound. If a group has zero arguments and at least one argument bound, then the group is considered bound. It is an error if none of the groups are bound unless one overload group has no arguments in it. Binding arguments from more than one overload group is not permitted. It is an error to have more than one overload group bound, that is, all required arguments in one overload group are bound and any argument in another overload group is also bound. - - Any violation of the preceding rules results in a being thrown when the containing activity is prepared for execution. - - For more information, see . - + identifies the overload groups to which this argument belongs. An overload group cannot be a subset or an equivalent set of another overload group. The only exception to this rule is a subset that contains only arguments where is `false`. Overload groups can overlap but it is an error if the intersection of the groups contains all the required arguments of one or both the overload groups. + + An overload group is considered bound if all the arguments in the group are bound. If a group has zero arguments and at least one argument bound, then the group is considered bound. It is an error if none of the groups are bound unless one overload group has no arguments in it. Binding arguments from more than one overload group is not permitted. It is an error to have more than one overload group bound, that is, all required arguments in one overload group are bound and any argument in another overload group is also bound. + + Any violation of the preceding rules results in a being thrown when the containing activity is prepared for execution. + + For more information, see . + ]]> diff --git a/xml/System.Activities/RuntimeTransactionHandle.xml b/xml/System.Activities/RuntimeTransactionHandle.xml index 83b64d05599..9c9fa218bb4 100644 --- a/xml/System.Activities/RuntimeTransactionHandle.xml +++ b/xml/System.Activities/RuntimeTransactionHandle.xml @@ -104,11 +104,11 @@ if the workflow instance should be aborted if the transaction fails; otherwise, . - is `false`, transaction failure results in the exception that causes the failure to be propagated as normal. The default value for is `true`. - + is `false`, transaction failure results in the exception that causes the failure to be propagated as normal. The default value for is `true`. + ]]> @@ -360,11 +360,11 @@ An optional user-provided state that contains information about the request. Initiates the creation of a for use with a new transaction. - @@ -401,11 +401,11 @@ An optional user-provided state that contains information about the request. Initiates the creation of a for use with an existing transaction. - and the subsequent callback. Calling again before the first call completes is not allowed and all calls after the first call result in exceptions. This method allows transactions flowed in from the host to be provided to the runtime without risking an intermediate persistence point. The state object that can be serialized is not necessary because the instance is guaranteed not to persist when this method is used. - + and the subsequent callback. Calling again before the first call completes is not allowed and all calls after the first call result in exceptions. This method allows transactions flowed in from the host to be provided to the runtime without risking an intermediate persistence point. The state object that can be serialized is not necessary because the instance is guaranteed not to persist when this method is used. + ]]> diff --git a/xml/System.Activities/UnhandledExceptionAction.xml b/xml/System.Activities/UnhandledExceptionAction.xml index c8dc7d42aa2..02b36c703b6 100644 --- a/xml/System.Activities/UnhandledExceptionAction.xml +++ b/xml/System.Activities/UnhandledExceptionAction.xml @@ -15,26 +15,26 @@ Specifies the action that occurs when an exception escapes the root of a workflow. - function is invoked if an exception escapes the root of the workflow. The provides access to the exception as well as a pointer to the that generated the exception. Terminate is the default action if no handler is specified. - - - + function is invoked if an exception escapes the root of the workflow. The provides access to the exception as well as a pointer to the that generated the exception. Terminate is the default action if no handler is specified. + + + ## Examples -The following example invokes a workflow that throws an exception. The exception is unhandled by the workflow and the handler is invoked. The are inspected to provide information about the exception, and the workflow is terminated. - -:::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet6"::: +The following example invokes a workflow that throws an exception. The exception is unhandled by the workflow and the handler is invoked. The are inspected to provide information about the exception, and the workflow is terminated. + +:::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet6"::: + +The following example invokes a workflow that throws an exception. The exception is unhandled by the workflow and the handler is invoked. The are inspected to provide information about the exception, and the workflow is aborted. + +:::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet7"::: -The following example invokes a workflow that throws an exception. The exception is unhandled by the workflow and the handler is invoked. The are inspected to provide information about the exception, and the workflow is aborted. - -:::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet7"::: +The following example invokes a workflow that throws an exception. The exception is unhandled by the workflow and the handler is invoked. The are inspected to provide information about the exception, and the workflow is cancelled. -The following example invokes a workflow that throws an exception. The exception is unhandled by the workflow and the handler is invoked. The are inspected to provide information about the exception, and the workflow is cancelled. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet8"::: + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet8"::: ]]> diff --git a/xml/System.Activities/Variable`1.xml b/xml/System.Activities/Variable`1.xml index 4a5681d5e38..d3565a05844 100644 --- a/xml/System.Activities/Variable`1.xml +++ b/xml/System.Activities/Variable`1.xml @@ -20,31 +20,31 @@ The of the . Represents a variable in a workflow. - is used to hold a message string. This message is written to the console window by a activity. - -```csharp -Variable msg = - new Variable() { Default = "Hello World!" }; - -Activity wf = new Sequence() -{ - Variables = - { - msg - }, - Activities = - { - new WriteLine() - { - Text = msg - } - } -}; -``` - + is used to hold a message string. This message is written to the console window by a activity. + +```csharp +Variable msg = + new Variable() { Default = "Hello World!" }; + +Activity wf = new Sequence() +{ + Variables = + { + msg + }, + Activities = + { + new WriteLine() + { + Text = msg + } + } +}; +``` + ]]> @@ -192,11 +192,11 @@ Activity wf = new Sequence() Gets or sets the that represents the default value for this . The default value for this . - is thrown. - + is thrown. + ]]> diff --git a/xml/System.Activities/WorkflowApplication.xml b/xml/System.Activities/WorkflowApplication.xml index a232e48fd0c..1b5502e7213 100644 --- a/xml/System.Activities/WorkflowApplication.xml +++ b/xml/System.Activities/WorkflowApplication.xml @@ -16,41 +16,41 @@ Provides a host for a single instance of a workflow. - class provides a host for a single workflow instance. It is a proxy to the actual workflow instance that is managed by the workflow runtime. Users of can instruct the workflow runtime to perform actions on a workflow instance by calling the appropriate methods on a object. If a requested action is not valid, an exception is thrown. - - Using you can perform the following tasks: - -1. Create a new workflow instance, or load a workflow instance from an instance store. - -2. Provide extensions to be used by activities within a workflow instance. - -3. Control the execution of a workflow instance. - -4. Resume a bookmark created by an activity within a workflow instance. - -5. Persist or unload a workflow instance. - -6. Be notified of workflow instance lifecycle events. - - - -## Examples - The following example hosts a workflow using . A instance is constructed using the specified workflow definition, the desired workflow lifecycle events are handled, and the workflow is invoked with a call to . When the workflow is completed, the following output is displayed to the console. - -```Output -Starting the workflow. -Workflow 593976e8-558d-4989-94d6-50a14b34fd7b Idle. -Ending the workflow. -Workflow 593976e8-558d-4989-94d6-50a14b34fd7b Completed -Workflow 593976e8-558d-4989-94d6-50a14b34fd7b Unloaded. - -``` - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet9"::: - + class provides a host for a single workflow instance. It is a proxy to the actual workflow instance that is managed by the workflow runtime. Users of can instruct the workflow runtime to perform actions on a workflow instance by calling the appropriate methods on a object. If a requested action is not valid, an exception is thrown. + + Using you can perform the following tasks: + +1. Create a new workflow instance, or load a workflow instance from an instance store. + +2. Provide extensions to be used by activities within a workflow instance. + +3. Control the execution of a workflow instance. + +4. Resume a bookmark created by an activity within a workflow instance. + +5. Persist or unload a workflow instance. + +6. Be notified of workflow instance lifecycle events. + + + +## Examples + The following example hosts a workflow using . A instance is constructed using the specified workflow definition, the desired workflow lifecycle events are handled, and the workflow is invoked with a call to . When the workflow is completed, the following output is displayed to the console. + +```Output +Starting the workflow. +Workflow 593976e8-558d-4989-94d6-50a14b34fd7b Idle. +Ending the workflow. +Workflow 593976e8-558d-4989-94d6-50a14b34fd7b Completed +Workflow 593976e8-558d-4989-94d6-50a14b34fd7b Unloaded. + +``` + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet9"::: + ]]> @@ -83,21 +83,21 @@ Workflow 593976e8-558d-4989-94d6-50a14b34fd7b Unloaded. The workflow definition. Creates a new instance of the class with the specified workflow definition. - . A instance is constructed using a workflow definition consisting of a single `DiceRoll` activity. The `DiceRoll` activity has two output arguments that represent the results of the dice roll operation. When the workflow completes, the outputs are retrieved in the handler, and the following output is displayed to the console. - -```Output -Workflow aae3fb48-7229-4737-b969-d63e131b96b3 Completed. -The two dice are 1 and 5. - -``` - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet130"::: - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet21"::: - + . A instance is constructed using a workflow definition consisting of a single `DiceRoll` activity. The `DiceRoll` activity has two output arguments that represent the results of the dice roll operation. When the workflow completes, the outputs are retrieved in the handler, and the following output is displayed to the console. + +```Output +Workflow aae3fb48-7229-4737-b969-d63e131b96b3 Completed. +The two dice are 1 and 5. + +``` + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet130"::: + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet21"::: + ]]> @@ -146,22 +146,22 @@ The two dice are 1 and 5. The values for arguments defined on the root activity of the workflow definition, keyed by argument name. Creates a new instance of the class that uses the specified workflow definition and argument values. - . A instance is constructed using a workflow definition consisting of a single `Divide` activity that takes two input arguments, and a dictionary of input arguments containing the two values to be passed, keyed by argument name. The desired workflow lifecycle events are handled, and the workflow is invoked with a call to . When the workflow is completed, the following output is displayed to the console. - -```Output -Workflow 8dc844c1-bbf8-4b21-a9a2-05f89e416055 Completed -500 / 36 = 13 Remainder 32 -Workflow 8dc844c1-bbf8-4b21-a9a2-05f89e416055 Unloaded. - -``` - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet120"::: - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet10"::: - + . A instance is constructed using a workflow definition consisting of a single `Divide` activity that takes two input arguments, and a dictionary of input arguments containing the two values to be passed, keyed by argument name. The desired workflow lifecycle events are handled, and the workflow is invoked with a call to . When the workflow is completed, the following output is displayed to the console. + +```Output +Workflow 8dc844c1-bbf8-4b21-a9a2-05f89e416055 Completed +500 / 36 = 13 Remainder 32 +Workflow 8dc844c1-bbf8-4b21-a9a2-05f89e416055 Unloaded. + +``` + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet120"::: + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet10"::: + ]]> @@ -199,11 +199,11 @@ Workflow 8dc844c1-bbf8-4b21-a9a2-05f89e416055 Unloaded. Notifies the workflow runtime that this workflow instance should abort. - is aborted, the handler is invoked and the handler is not invoked. - + is aborted, the handler is invoked and the handler is not invoked. + ]]> @@ -227,27 +227,27 @@ Workflow 8dc844c1-bbf8-4b21-a9a2-05f89e416055 Unloaded. Notifies the workflow runtime that this workflow instance should abort. - is aborted, the handler is invoked and the handler is not invoked. - - - -## Examples - The following example hosts a workflow using . A instance is constructed using the specified workflow definition, the desired workflow lifecycle events are handled, and the workflow is invoked with a call to . After the workflow is started, is called. When the workflow is aborted, the following output is displayed to the console. - -```Output -Starting the workflow. -Workflow 3b76d562-516a-4a52-b17c-0f2ce531ad93 Idle. -Workflow 3b76d562-516a-4a52-b17c-0f2ce531ad93 Aborted -Exception: System.Activities.WorkflowApplicationAbortedException -The workflow has been aborted. - -``` - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet11"::: - + is aborted, the handler is invoked and the handler is not invoked. + + + +## Examples + The following example hosts a workflow using . A instance is constructed using the specified workflow definition, the desired workflow lifecycle events are handled, and the workflow is invoked with a call to . After the workflow is started, is called. When the workflow is aborted, the following output is displayed to the console. + +```Output +Starting the workflow. +Workflow 3b76d562-516a-4a52-b17c-0f2ce531ad93 Idle. +Workflow 3b76d562-516a-4a52-b17c-0f2ce531ad93 Aborted +Exception: System.Activities.WorkflowApplicationAbortedException +The workflow has been aborted. + +``` + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet11"::: + ]]> @@ -274,27 +274,27 @@ The workflow has been aborted. The reason for the request to abort. Notifies the workflow runtime that this workflow instance should abort for the specified reason. - is aborted, the handler is invoked and the handler is not invoked. - - - -## Examples - The following example hosts a workflow using . A instance is constructed using the specified workflow definition, the desired workflow lifecycle events are handled, and the workflow is invoked with a call to . After the workflow is started, is called. When the workflow is aborted, the following output is displayed to the console. - -```Output -Starting the workflow. -Workflow 607b042e-98db-4bbe-abe8-f4d750feec41 Idle. -Workflow 607b042e-98db-4bbe-abe8-f4d750feec41 Aborted -Exception: System.Activities.WorkflowApplicationAbortedException -The reason for aborting the workflow. - -``` - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet11"::: - + is aborted, the handler is invoked and the handler is not invoked. + + + +## Examples + The following example hosts a workflow using . A instance is constructed using the specified workflow definition, the desired workflow lifecycle events are handled, and the workflow is invoked with a call to . After the workflow is started, is called. When the workflow is aborted, the following output is displayed to the console. + +```Output +Starting the workflow. +Workflow 607b042e-98db-4bbe-abe8-f4d750feec41 Idle. +Workflow 607b042e-98db-4bbe-abe8-f4d750feec41 Aborted +Exception: System.Activities.WorkflowApplicationAbortedException +The reason for aborting the workflow. + +``` + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet11"::: + ]]> @@ -324,18 +324,18 @@ The reason for aborting the workflow. Gets or sets the that is invoked when the workflow instance is aborted. The action that is invoked when the workflow instance is aborted. - is aborted, the handler is invoked and the handler is not invoked. - - - -## Examples - The following code example inspects the passed into the handler of a instance and displays information about why workflow was aborted. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet5"::: - + is aborted, the handler is invoked and the handler is not invoked. + + + +## Examples + The following code example inspects the passed into the handler of a instance and displays information about why workflow was aborted. + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet5"::: + ]]> @@ -372,11 +372,11 @@ The reason for aborting the workflow. Cancels a workflow asynchronously using the asynchronous design pattern. - @@ -406,13 +406,13 @@ The reason for aborting the workflow. Cancels a workflow instance asynchronously using the specified and user-provided state. A reference to the asynchronous cancel operation. - . can be called from inside or outside of the `callback` method. If is called before the cancel operation completes, it blocks until the cancel operation completes. By default, the cancel operation must complete in 30 seconds or a is thrown from . - - This method cancels a workflow asynchronously using the asynchronous design pattern. For more information, see [Asynchronous Programming Overview](/dotnet/standard/asynchronous-programming-patterns/asynchronous-programming-model-apm). - + . can be called from inside or outside of the `callback` method. If is called before the cancel operation completes, it blocks until the cancel operation completes. By default, the cancel operation must complete in 30 seconds or a is thrown from . + + This method cancels a workflow asynchronously using the asynchronous design pattern. For more information, see [Asynchronous Programming Overview](/dotnet/standard/asynchronous-programming-patterns/asynchronous-programming-model-apm). + ]]> @@ -444,13 +444,13 @@ The reason for aborting the workflow. Cancels a workflow instance asynchronously using the specified time-out interval, , and user-provided state. A reference to the asynchronous cancel operation. - . can be called from inside or outside of the method specified in the `callback` parameter. If is called before the cancel operation completes, it blocks until the cancel operation completes. If the cancel operation does not complete in the interval specified by the `timeOut` parameter, a is thrown from . - - This method cancels a workflow asynchronously using the asynchronous design pattern. For more information, see [Asynchronous Programming Overview](/dotnet/standard/asynchronous-programming-patterns/asynchronous-programming-model-apm). - + . can be called from inside or outside of the method specified in the `callback` parameter. If is called before the cancel operation completes, it blocks until the cancel operation completes. If the cancel operation does not complete in the interval specified by the `timeOut` parameter, a is thrown from . + + This method cancels a workflow asynchronously using the asynchronous design pattern. For more information, see [Asynchronous Programming Overview](/dotnet/standard/asynchronous-programming-patterns/asynchronous-programming-model-apm). + ]]> @@ -751,11 +751,11 @@ The reason for aborting the workflow. Loads a workflow asynchronously from an instance store using the asynchronous design pattern. - @@ -952,11 +952,11 @@ The reason for aborting the workflow. Initiates the asynchronous process of loading a runnable workflow instance from the . - @@ -986,15 +986,15 @@ The reason for aborting the workflow. Initiates an operation to load a runnable workflow instance from the . A reference to the asynchronous operation. - . can be called from inside or outside of the `callback` method. If is called before the resume operation completes, it blocks until the resume operation completes. By default, the resume operation must complete in 30 seconds or else a is thrown from . - - This method loads a workflow asynchronously using the asynchronous design pattern. For more information, see [Asynchronous Programming Overview](/dotnet/standard/asynchronous-programming-patterns/asynchronous-programming-model-apm). - + . can be called from inside or outside of the `callback` method. If is called before the resume operation completes, it blocks until the resume operation completes. By default, the resume operation must complete in 30 seconds or else a is thrown from . + + This method loads a workflow asynchronously using the asynchronous design pattern. For more information, see [Asynchronous Programming Overview](/dotnet/standard/asynchronous-programming-patterns/asynchronous-programming-model-apm). + ]]> @@ -1026,15 +1026,15 @@ The reason for aborting the workflow. Initiates an operation to load a runnable workflow instance from the using the specified time-out interval. A reference to the asynchronous operation. - . can be called from inside or outside of the `callback` method. If is called before the resume operation completes, it blocks until the resume operation completes. If the load operation does not complete within the specified time-out interval a is thrown from . - - This method loads a workflow asynchronously using the asynchronous design pattern. For more information, see [Asynchronous Programming Overview](/dotnet/standard/asynchronous-programming-patterns/asynchronous-programming-model-apm). - + . can be called from inside or outside of the `callback` method. If is called before the resume operation completes, it blocks until the resume operation completes. If the load operation does not complete within the specified time-out interval a is thrown from . + + This method loads a workflow asynchronously using the asynchronous design pattern. For more information, see [Asynchronous Programming Overview](/dotnet/standard/asynchronous-programming-patterns/asynchronous-programming-model-apm). + ]]> @@ -1047,13 +1047,13 @@ The reason for aborting the workflow. Persists a workflow instance to an instance store asynchronously using the asynchronous design pattern. - used to load the workflow is used for persistence. If the workflow was created and has not yet been persisted, then an must be configured before calling this method or else an is thrown when this method is called. - + used to load the workflow is used for persistence. If the workflow was created and has not yet been persisted, then an must be configured before calling this method or else an is thrown when this method is called. + ]]> @@ -1083,15 +1083,15 @@ The reason for aborting the workflow. Persists a workflow instance to an instance store asynchronously using the specified callback method and user-provided state. A reference to the asynchronous persist operation. - . can be called from inside or outside of the method referenced in the `callback` parameter. If is called before the persist operation completes, it blocks until the persist operation completes. If the persist operation does not complete within 30 seconds, a is thrown from . - - If the workflow instance was previously loaded from persistence, then the same used to load the workflow is used for persistence. If the workflow was created and has not yet been persisted, then an must be configured before calling this method or else an is thrown when this method is called. - - This method persists a workflow asynchronously using the asynchronous design pattern. For more information, see [Asynchronous Programming Overview](/dotnet/standard/asynchronous-programming-patterns/asynchronous-programming-model-apm). - + . can be called from inside or outside of the method referenced in the `callback` parameter. If is called before the persist operation completes, it blocks until the persist operation completes. If the persist operation does not complete within 30 seconds, a is thrown from . + + If the workflow instance was previously loaded from persistence, then the same used to load the workflow is used for persistence. If the workflow was created and has not yet been persisted, then an must be configured before calling this method or else an is thrown when this method is called. + + This method persists a workflow asynchronously using the asynchronous design pattern. For more information, see [Asynchronous Programming Overview](/dotnet/standard/asynchronous-programming-patterns/asynchronous-programming-model-apm). + ]]> @@ -1123,15 +1123,15 @@ The reason for aborting the workflow. Persists a workflow instance to an instance store asynchronously using the specified time-out interval, callback method, and user-provided state. A reference to the asynchronous persist operation. - . can be called from inside or outside of the method referenced in the `callback` parameter. If is called before the persist operation completes, it blocks until the persist operation completes. If the persist operation does not complete within the specified time-out interval, a is thrown from . - - If the workflow instance was previously loaded from persistence, then the same used to load the workflow is used for persistence. If the workflow was created and has not yet been persisted, then an must be configured before calling this method or else an is thrown when this method is called. - - This method persists a workflow instance asynchronously using the asynchronous design pattern. For more information, see [Asynchronous Programming Overview](/dotnet/standard/asynchronous-programming-patterns/asynchronous-programming-model-apm). - + . can be called from inside or outside of the method referenced in the `callback` parameter. If is called before the persist operation completes, it blocks until the persist operation completes. If the persist operation does not complete within the specified time-out interval, a is thrown from . + + If the workflow instance was previously loaded from persistence, then the same used to load the workflow is used for persistence. If the workflow was created and has not yet been persisted, then an must be configured before calling this method or else an is thrown when this method is called. + + This method persists a workflow instance asynchronously using the asynchronous design pattern. For more information, see [Asynchronous Programming Overview](/dotnet/standard/asynchronous-programming-patterns/asynchronous-programming-model-apm). + ]]> @@ -1174,13 +1174,13 @@ The reason for aborting the workflow. Initiates an operation to resume a bookmark using the specified value, callback method, and state. A reference to the asynchronous bookmark resume operation. - . can be called from inside or outside of the `callback` method. If is called before the resume operation completes, it blocks until the resume operation completes. By default, the resume operation must complete in 30 seconds or else a is thrown from . - - This method resumes a bookmark asynchronously using the asynchronous design pattern. For more information, see [Asynchronous Programming Overview](/dotnet/standard/asynchronous-programming-patterns/asynchronous-programming-model-apm). - + . can be called from inside or outside of the `callback` method. If is called before the resume operation completes, it blocks until the resume operation completes. By default, the resume operation must complete in 30 seconds or else a is thrown from . + + This method resumes a bookmark asynchronously using the asynchronous design pattern. For more information, see [Asynchronous Programming Overview](/dotnet/standard/asynchronous-programming-patterns/asynchronous-programming-model-apm). + ]]> @@ -1214,11 +1214,11 @@ The reason for aborting the workflow. Initiates an asynchronous operation to resume the bookmark with the specified name, using the specified value, callback method, and state. The bookmark to be resumed is previously created by an activity within the workflow instance. The result of the bookmark resumption operation. - @@ -1254,13 +1254,13 @@ The reason for aborting the workflow. Initiates an operation to resume a bookmark using the specified value, time-out interval, callback method, and state. A reference to the asynchronous bookmark resume operation. - . can be called from inside or outside of the `callback` method. If is called before the resume operation completes, it blocks until the resume operation completes. If the resume operation does not complete within the specified time-out interval a is thrown from . - - This method resumes a bookmark asynchronously using the asynchronous design pattern. For more information, see [Asynchronous Programming Overview](/dotnet/standard/asynchronous-programming-patterns/asynchronous-programming-model-apm). - + . can be called from inside or outside of the `callback` method. If is called before the resume operation completes, it blocks until the resume operation completes. If the resume operation does not complete within the specified time-out interval a is thrown from . + + This method resumes a bookmark asynchronously using the asynchronous design pattern. For more information, see [Asynchronous Programming Overview](/dotnet/standard/asynchronous-programming-patterns/asynchronous-programming-model-apm). + ]]> @@ -1296,11 +1296,11 @@ The reason for aborting the workflow. Initiates an asynchronous operation to resume the bookmark with the specified name, using the specified value, time-out interval, callback method, and state. The bookmark to be resumed is previously created by an activity within the workflow instance. The result of the bookmark resumption operation. - @@ -1313,11 +1313,11 @@ The reason for aborting the workflow. Starts or resumes a workflow instance asynchronously using the asynchronous design pattern. - @@ -1347,13 +1347,13 @@ The reason for aborting the workflow. Starts or resumes a workflow instance asynchronously using the specified callback method and user-provided state. A reference to the asynchronous run operation. - . can be called from inside or outside of the method referenced in the `callback` parameter. If is called before the resume operation completes, it blocks until the resume operation completes. By default, the resume operation must complete in 30 seconds or a is thrown from . - - This method starts or resumes a workflow asynchronously using the asynchronous design pattern. For more information, see [Asynchronous Programming Overview](/dotnet/standard/asynchronous-programming-patterns/asynchronous-programming-model-apm). - + . can be called from inside or outside of the method referenced in the `callback` parameter. If is called before the resume operation completes, it blocks until the resume operation completes. By default, the resume operation must complete in 30 seconds or a is thrown from . + + This method starts or resumes a workflow asynchronously using the asynchronous design pattern. For more information, see [Asynchronous Programming Overview](/dotnet/standard/asynchronous-programming-patterns/asynchronous-programming-model-apm). + ]]> @@ -1391,13 +1391,13 @@ The reason for aborting the workflow. Starts or resumes a workflow instance asynchronously using the specified time-out interval, callback method, and user-provided state. A reference to the asynchronous run operation. - . can be called from inside or outside of the method reference in the `callback` parameter. If is called before the resume operation completes, it blocks until the resume operation completes. If the resume operation does not complete within the specified time-out interval a is thrown from . - - This method starts or resumes a workflow asynchronously using the asynchronous design pattern. For more information, see [Asynchronous Programming Overview](/dotnet/standard/asynchronous-programming-patterns/asynchronous-programming-model-apm). - + . can be called from inside or outside of the method reference in the `callback` parameter. If is called before the resume operation completes, it blocks until the resume operation completes. If the resume operation does not complete within the specified time-out interval a is thrown from . + + This method starts or resumes a workflow asynchronously using the asynchronous design pattern. For more information, see [Asynchronous Programming Overview](/dotnet/standard/asynchronous-programming-patterns/asynchronous-programming-model-apm). + ]]> @@ -1410,11 +1410,11 @@ The reason for aborting the workflow. Terminates a workflow instance asynchronously using the asynchronous design pattern. - @@ -1446,15 +1446,15 @@ The reason for aborting the workflow. Terminates a workflow instance asynchronously using the specified exception, callback method, and user-provided state. A reference to the current operation. - handle. - - To determine whether the operation was successful, call . can be called from inside or outside of the method referenced in the `callback` parameter. If is called before the operation completes, it blocks until the operation completes. By default, the operation must complete in 30 seconds or a is thrown from . - - This method terminates a workflow asynchronously using the asynchronous design pattern. For more information, see [Asynchronous Programming Overview](/dotnet/standard/asynchronous-programming-patterns/asynchronous-programming-model-apm). - + handle. + + To determine whether the operation was successful, call . can be called from inside or outside of the method referenced in the `callback` parameter. If is called before the operation completes, it blocks until the operation completes. By default, the operation must complete in 30 seconds or a is thrown from . + + This method terminates a workflow asynchronously using the asynchronous design pattern. For more information, see [Asynchronous Programming Overview](/dotnet/standard/asynchronous-programming-patterns/asynchronous-programming-model-apm). + ]]> @@ -1486,15 +1486,15 @@ The reason for aborting the workflow. Terminates a workflow instance asynchronously using the specified error message, callback method, and user-provided state. A reference to the current operation. - handle. - - To determine whether the operation was successful, call . can be called from inside or outside of the method reference in the `callback` parameter. If is called before the operation completes, it blocks until the operation completes. By default, the operation must complete in 30 seconds or a is thrown from . - - This method terminates a workflow instance asynchronously using the asynchronous design pattern. For more information, see [Asynchronous Programming Overview](/dotnet/standard/asynchronous-programming-patterns/asynchronous-programming-model-apm). - + handle. + + To determine whether the operation was successful, call . can be called from inside or outside of the method reference in the `callback` parameter. If is called before the operation completes, it blocks until the operation completes. By default, the operation must complete in 30 seconds or a is thrown from . + + This method terminates a workflow instance asynchronously using the asynchronous design pattern. For more information, see [Asynchronous Programming Overview](/dotnet/standard/asynchronous-programming-patterns/asynchronous-programming-model-apm). + ]]> @@ -1528,15 +1528,15 @@ The reason for aborting the workflow. Terminates a workflow instance asynchronously using the specified exception, time-out interval, callback method, and user-provided state. A reference to the current operation. - handle. - - To determine whether the operation was successful, call . can be called from inside or outside of the `callback` method. If is called before the operation completes, it blocks until the operation completes. If the operation does not complete within the specified time-out interval a is thrown. This or any other exceptions that occur during the process is thrown from . - - This method terminates a workflow asynchronously using the asynchronous design pattern. For more information, see [Asynchronous Programming Overview](/dotnet/standard/asynchronous-programming-patterns/asynchronous-programming-model-apm). - + handle. + + To determine whether the operation was successful, call . can be called from inside or outside of the `callback` method. If is called before the operation completes, it blocks until the operation completes. If the operation does not complete within the specified time-out interval a is thrown. This or any other exceptions that occur during the process is thrown from . + + This method terminates a workflow asynchronously using the asynchronous design pattern. For more information, see [Asynchronous Programming Overview](/dotnet/standard/asynchronous-programming-patterns/asynchronous-programming-model-apm). + ]]> @@ -1570,15 +1570,15 @@ The reason for aborting the workflow. Terminates a workflow instance asynchronously using the specified error message, time-out interval, callback method, and user-provided state. A reference to the asynchronous operation. - handle. - - To determine whether the operation was successful, call . can be called from inside or outside of the method reference in the `callback` parameter. If is called before the operation completes, it blocks until the operation completes. If the operation does not complete within the specified time-out interval a is thrown from . - - This method terminates a workflow instance asynchronously using the asynchronous design pattern. For more information, see [Asynchronous Programming Overview](/dotnet/standard/asynchronous-programming-patterns/asynchronous-programming-model-apm). - + handle. + + To determine whether the operation was successful, call . can be called from inside or outside of the method reference in the `callback` parameter. If is called before the operation completes, it blocks until the operation completes. If the operation does not complete within the specified time-out interval a is thrown from . + + This method terminates a workflow instance asynchronously using the asynchronous design pattern. For more information, see [Asynchronous Programming Overview](/dotnet/standard/asynchronous-programming-patterns/asynchronous-programming-model-apm). + ]]> @@ -1591,13 +1591,13 @@ The reason for aborting the workflow. Persists and disposes a workflow instance asynchronously using the asynchronous design pattern. - used to load the workflow is used for persistence. If the workflow was created and has not yet been persisted, then an must be configured before calling this method or else an is thrown when this method is called. - + used to load the workflow is used for persistence. If the workflow was created and has not yet been persisted, then an must be configured before calling this method or else an is thrown when this method is called. + ]]> @@ -1627,15 +1627,15 @@ The reason for aborting the workflow. Persists and disposes a workflow instance asynchronously using the specified callback method and user-provided state. A reference to the asynchronous operation. - operation was successful, call . can be called from inside or outside of the method reference in the `callback` parameter. If is called before the operation completes, it blocks until the operation completes. By default, the operation must complete in 30 seconds or a is thrown from . - - If the workflow instance was previously loaded from persistence, then the same used to load the workflow is used for persistence. If the workflow was created and has not yet been persisted, then an must be configured before calling this method or else an is thrown when this method is called. - - This method persists and disposes a workflow instance asynchronously using the asynchronous design pattern. For more information, see [Asynchronous Programming Overview](/dotnet/standard/asynchronous-programming-patterns/asynchronous-programming-model-apm). - + operation was successful, call . can be called from inside or outside of the method reference in the `callback` parameter. If is called before the operation completes, it blocks until the operation completes. By default, the operation must complete in 30 seconds or a is thrown from . + + If the workflow instance was previously loaded from persistence, then the same used to load the workflow is used for persistence. If the workflow was created and has not yet been persisted, then an must be configured before calling this method or else an is thrown when this method is called. + + This method persists and disposes a workflow instance asynchronously using the asynchronous design pattern. For more information, see [Asynchronous Programming Overview](/dotnet/standard/asynchronous-programming-patterns/asynchronous-programming-model-apm). + ]]> @@ -1667,15 +1667,15 @@ The reason for aborting the workflow. Persists and disposes a workflow instance asynchronously using the specified time-out interval, callback method, and user-provided state. A reference to the asynchronous operation. - operation was successful, call . can be called from inside or outside of the method reference in the `callback` parameter. If is called before the operation completes, it blocks until the operation completes. If the operation does not complete within the specified time-out interval a is thrown from . - - If the workflow instance was previously loaded from persistence, then the same used to load the workflow is used for persistence. If the workflow was created and has not yet been persisted, then an must be configured before calling this method or else an is thrown when this method is called. - - This method persists and unloads a workflow instance asynchronously using the asynchronous design pattern. For more information, see [Asynchronous Programming Overview](/dotnet/standard/asynchronous-programming-patterns/asynchronous-programming-model-apm). - + operation was successful, call . can be called from inside or outside of the method reference in the `callback` parameter. If is called before the operation completes, it blocks until the operation completes. If the operation does not complete within the specified time-out interval a is thrown from . + + If the workflow instance was previously loaded from persistence, then the same used to load the workflow is used for persistence. If the workflow was created and has not yet been persisted, then an must be configured before calling this method or else an is thrown when this method is called. + + This method persists and unloads a workflow instance asynchronously using the asynchronous design pattern. For more information, see [Asynchronous Programming Overview](/dotnet/standard/asynchronous-programming-patterns/asynchronous-programming-model-apm). + ]]> @@ -1688,13 +1688,13 @@ The reason for aborting the workflow. Cancels the workflow instance. - handle. - - By default, the cancel operation must complete in 30 seconds or a is thrown. - + handle. + + By default, the cancel operation must complete in 30 seconds or a is thrown. + ]]> @@ -1718,28 +1718,28 @@ The reason for aborting the workflow. Cancels the workflow instance. - handler. - - By default, the cancel operation must complete in 30 seconds or a is thrown. - - - -## Examples - The following example hosts a workflow using . A instance is constructed using the specified workflow definition, the desired workflow lifecycle events are handled, and the workflow is invoked with a call to . After the workflow is started, is called. When the workflow is cancelled, the following output is displayed to the console. - -```Output -Starting the workflow. -Workflow bcce00c2-d323-42c2-8c25-19ff0c4b6dac Idle. -Workflow bcce00c2-d323-42c2-8c25-19ff0c4b6dac Canceled -Workflow bcce00c2-d323-42c2-8c25-19ff0c4b6dac Unloaded. - -``` - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet13"::: - + handler. + + By default, the cancel operation must complete in 30 seconds or a is thrown. + + + +## Examples + The following example hosts a workflow using . A instance is constructed using the specified workflow definition, the desired workflow lifecycle events are handled, and the workflow is invoked with a call to . After the workflow is started, is called. When the workflow is cancelled, the following output is displayed to the console. + +```Output +Starting the workflow. +Workflow bcce00c2-d323-42c2-8c25-19ff0c4b6dac Idle. +Workflow bcce00c2-d323-42c2-8c25-19ff0c4b6dac Canceled +Workflow bcce00c2-d323-42c2-8c25-19ff0c4b6dac Unloaded. + +``` + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet13"::: + ]]> @@ -1766,26 +1766,26 @@ Workflow bcce00c2-d323-42c2-8c25-19ff0c4b6dac Unloaded. The interval in which the cancel operation must complete before the operation is canceled and a is thrown. Cancels the workflow instance using the specified time-out interval. - handler. - - - -## Examples - The following example hosts a workflow using . A instance is constructed using the specified workflow definition, the desired workflow lifecycle events are handled, and the workflow is invoked with a call to . After the workflow is started, is called. When the workflow is cancelled, the following output is displayed to the console. - -```Output -Starting the workflow. -Workflow bcce00c2-d323-42c2-8c25-19ff0c4b6dac Idle. -Workflow bcce00c2-d323-42c2-8c25-19ff0c4b6dac Canceled -Workflow bcce00c2-d323-42c2-8c25-19ff0c4b6dac Unloaded. - -``` - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet13"::: - + handler. + + + +## Examples + The following example hosts a workflow using . A instance is constructed using the specified workflow definition, the desired workflow lifecycle events are handled, and the workflow is invoked with a call to . After the workflow is started, is called. When the workflow is cancelled, the following output is displayed to the console. + +```Output +Starting the workflow. +Workflow bcce00c2-d323-42c2-8c25-19ff0c4b6dac Idle. +Workflow bcce00c2-d323-42c2-8c25-19ff0c4b6dac Canceled +Workflow bcce00c2-d323-42c2-8c25-19ff0c4b6dac Unloaded. + +``` + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet13"::: + ]]> @@ -1815,13 +1815,13 @@ Workflow bcce00c2-d323-42c2-8c25-19ff0c4b6dac Unloaded. Gets or sets the that is invoked when the workflow instance completes. The action that is invoked when the workflow instance is complete. - passed into the handler of a instance and displays information about how the workflow completed. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet4"::: - + passed into the handler of a instance and displays information about how the workflow completed. + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet4"::: + ]]> @@ -1974,13 +1974,13 @@ Workflow bcce00c2-d323-42c2-8c25-19ff0c4b6dac Unloaded. The asynchronous cancel operation. Waits for the pending asynchronous cancel operation to complete. - operation was successful. If called before the cancel operation completes, it blocks until the cancel operation is complete. - - This method completes the asynchronous cancel operation using the asynchronous design pattern. For more information, see [Asynchronous Programming Overview](/dotnet/standard/asynchronous-programming-patterns/asynchronous-programming-model-apm). - + operation was successful. If called before the cancel operation completes, it blocks until the cancel operation is complete. + + This method completes the asynchronous cancel operation using the asynchronous design pattern. For more information, see [Asynchronous Programming Overview](/dotnet/standard/asynchronous-programming-patterns/asynchronous-programming-model-apm). + ]]> @@ -2105,13 +2105,13 @@ Workflow bcce00c2-d323-42c2-8c25-19ff0c4b6dac Unloaded. The asynchronous load operation. Waits for the pending asynchronous load operation to complete. - asynchronous design pattern. For more information, see [Asynchronous Programming Overview](/dotnet/standard/asynchronous-programming-patterns/asynchronous-programming-model-apm). - + asynchronous design pattern. For more information, see [Asynchronous Programming Overview](/dotnet/standard/asynchronous-programming-patterns/asynchronous-programming-model-apm). + ]]> @@ -2138,13 +2138,13 @@ Workflow bcce00c2-d323-42c2-8c25-19ff0c4b6dac Unloaded. A reference to the asynchronous load operation. Waits for the asynchronous load runnable instance operation to complete. - operation was successful. If called before the load operation completes, it blocks until the operation is complete. - - This method loads workflows asynchronously using the asynchronous design pattern. For more information, see [Asynchronous Programming Overview](/dotnet/standard/asynchronous-programming-patterns/asynchronous-programming-model-apm). - + operation was successful. If called before the load operation completes, it blocks until the operation is complete. + + This method loads workflows asynchronously using the asynchronous design pattern. For more information, see [Asynchronous Programming Overview](/dotnet/standard/asynchronous-programming-patterns/asynchronous-programming-model-apm). + ]]> @@ -2171,13 +2171,13 @@ Workflow bcce00c2-d323-42c2-8c25-19ff0c4b6dac Unloaded. The asynchronous persist operation. Waits for the pending asynchronous persist operation to complete. - operation was successful. If called before the persist operation completes, it blocks until the persist operation is complete. - - This method completes the asynchronous persist operation using the asynchronous design pattern. For more information, see [Asynchronous Programming Overview](/dotnet/standard/asynchronous-programming-patterns/asynchronous-programming-model-apm). - + operation was successful. If called before the persist operation completes, it blocks until the persist operation is complete. + + This method completes the asynchronous persist operation using the asynchronous design pattern. For more information, see [Asynchronous Programming Overview](/dotnet/standard/asynchronous-programming-patterns/asynchronous-programming-model-apm). + ]]> @@ -2205,13 +2205,13 @@ Workflow bcce00c2-d323-42c2-8c25-19ff0c4b6dac Unloaded. Waits for a bookmark resume operation to complete. One of the enumeration values that indicates the results of a bookmark resumption operation. - operation was successful. If called before the load operation completes, it blocks until the operation is complete. - - This method resumes a bookmark asynchronously using the asynchronous design pattern. For more information, see [Asynchronous Programming Overview](/dotnet/standard/asynchronous-programming-patterns/asynchronous-programming-model-apm). - + operation was successful. If called before the load operation completes, it blocks until the operation is complete. + + This method resumes a bookmark asynchronously using the asynchronous design pattern. For more information, see [Asynchronous Programming Overview](/dotnet/standard/asynchronous-programming-patterns/asynchronous-programming-model-apm). + ]]> @@ -2238,13 +2238,13 @@ Workflow bcce00c2-d323-42c2-8c25-19ff0c4b6dac Unloaded. The asynchronous run operation. Waits for the pending asynchronous run operation to complete. - operation was successful. If called before the resume operation completes, it blocks until the resume operation is complete. - - This method completes an asynchronous run operation using the asynchronous design pattern. For more information, see [Asynchronous Programming Overview](/dotnet/standard/asynchronous-programming-patterns/asynchronous-programming-model-apm). - + operation was successful. If called before the resume operation completes, it blocks until the resume operation is complete. + + This method completes an asynchronous run operation using the asynchronous design pattern. For more information, see [Asynchronous Programming Overview](/dotnet/standard/asynchronous-programming-patterns/asynchronous-programming-model-apm). + ]]> @@ -2271,13 +2271,13 @@ Workflow bcce00c2-d323-42c2-8c25-19ff0c4b6dac Unloaded. The asynchronous terminate operation. Waits for the pending asynchronous terminate operation to complete. - operation was successful. If called before the terminate operation completes, it blocks until the operation is complete. - - This method completes an asynchronous operation using the asynchronous design pattern. For more information, see [Asynchronous Programming Overview](/dotnet/standard/asynchronous-programming-patterns/asynchronous-programming-model-apm). - + operation was successful. If called before the terminate operation completes, it blocks until the operation is complete. + + This method completes an asynchronous operation using the asynchronous design pattern. For more information, see [Asynchronous Programming Overview](/dotnet/standard/asynchronous-programming-patterns/asynchronous-programming-model-apm). + ]]> @@ -2304,13 +2304,13 @@ Workflow bcce00c2-d323-42c2-8c25-19ff0c4b6dac Unloaded. The asynchronous unload operation. Waits for the pending asynchronous unload operation to complete. - operation was successful. If called before the unload operation completes, it blocks until the operation is complete. - - This method completes an asynchronous operation using the asynchronous design pattern. For more information, see [Asynchronous Programming Overview](/dotnet/standard/asynchronous-programming-patterns/asynchronous-programming-model-apm). - + operation was successful. If called before the unload operation completes, it blocks until the operation is complete. + + This method completes an asynchronous operation using the asynchronous design pattern. For more information, see [Asynchronous Programming Overview](/dotnet/standard/asynchronous-programming-patterns/asynchronous-programming-model-apm). + ]]> @@ -2365,28 +2365,28 @@ Workflow bcce00c2-d323-42c2-8c25-19ff0c4b6dac Unloaded. Returns the collection of bookmarks for the workflow instance. A read-only collection of bookmarks for the workflow instance. - is thrown. - - - -## Examples - The following example creates a workflow that uses a `ReadLine` activity that creates a . The workflow is started, and once the is created and the workflow goes idle, is called. When the workflow is completed, the following output is displayed to the console. - -```Output -What is your name? -BookmarkName: UserName - OwnerDisplayName: ReadLine -Steve -Hello, Steve - -``` - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet15"::: - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet14"::: - + is thrown. + + + +## Examples + The following example creates a workflow that uses a `ReadLine` activity that creates a . The workflow is started, and once the is created and the workflow goes idle, is called. When the workflow is completed, the following output is displayed to the console. + +```Output +What is your name? +BookmarkName: UserName - OwnerDisplayName: ReadLine +Steve +Hello, Steve + +``` + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet15"::: + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet14"::: + ]]> @@ -2414,23 +2414,23 @@ Hello, Steve Returns the collection of bookmarks for the workflow instance using the specified time-out interval. A read-only collection of bookmarks for the workflow instance. - . The workflow is started, and once the is created and the workflow goes idle, is called. When the workflow is completed, the following output is displayed to the console. - -```Output -What is your name? -BookmarkName: UserName - OwnerDisplayName: ReadLine -Steve -Hello, Steve - -``` - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet15"::: - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet14"::: - + . The workflow is started, and once the is created and the workflow goes idle, is called. When the workflow is completed, the following output is displayed to the console. + +```Output +What is your name? +BookmarkName: UserName - OwnerDisplayName: ReadLine +Steve +Hello, Steve + +``` + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet15"::: + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet14"::: + ]]> @@ -2580,13 +2580,13 @@ Hello, Steve Gets the 128-bit GUID identifier of the current workflow application instance. A 128-bit GUID identifier. - instance and then displays the value to the console. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet28"::: - + instance and then displays the value to the console. + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet28"::: + ]]> @@ -2616,17 +2616,17 @@ Hello, Steve Gets or sets the that is invoked when the current workflow instance becomes idle. An action that executes when a workflow instance becomes idle. - passed into the handler of a instance. In this example the workflow going idle has one with a name of `EnterGuess`, owned by an activity named `ReadInt`. This code example is based off of [How to: Run a Workflow](/dotnet/framework/windows-workflow-foundation/how-to-run-a-workflow), which is part of the [Getting Started Tutorial [.NET Framework 4.5]](/dotnet/framework/windows-workflow-foundation/getting-started-tutorial). If the handler in that step is modified to contain the code from this example, the following output is displayed. - -```Output -BookmarkName: EnterGuess - OwnerDisplayName: ReadInt -``` - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet2"::: - + passed into the handler of a instance. In this example the workflow going idle has one with a name of `EnterGuess`, owned by an activity named `ReadInt`. This code example is based off of [How to: Run a Workflow](/dotnet/framework/windows-workflow-foundation/how-to-run-a-workflow), which is part of the [Getting Started Tutorial [.NET Framework 4.5]](/dotnet/framework/windows-workflow-foundation/getting-started-tutorial). If the handler in that step is modified to contain the code from this example, the following output is displayed. + +```Output +BookmarkName: EnterGuess - OwnerDisplayName: ReadInt +``` + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet2"::: + ]]> @@ -2656,13 +2656,13 @@ BookmarkName: EnterGuess - OwnerDisplayName: ReadInt Gets or sets an object that provides access to the persisted state of the current instance of the workflow application. An instance store. - using a . This code example is part of [How to: Create and Run a Long Running Workflow](/dotnet/framework/windows-workflow-foundation/how-to-create-and-run-a-long-running-workflow), which is part of the [Getting Started Tutorial [.NET Framework 4.5]](/dotnet/framework/windows-workflow-foundation/getting-started-tutorial). - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet28"::: - + using a . This code example is part of [How to: Create and Run a Long Running Workflow](/dotnet/framework/windows-workflow-foundation/how-to-create-and-run-a-long-running-workflow), which is part of the [Getting Started Tutorial [.NET Framework 4.5]](/dotnet/framework/windows-workflow-foundation/getting-started-tutorial). + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet28"::: + ]]> @@ -2722,14 +2722,14 @@ BookmarkName: EnterGuess - OwnerDisplayName: ReadInt A globally unique 128-bit identifier for the workflow instance. Loads the specified workflow instance into memory from an instance store. - to load persisted workflow instance from a . - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet27"::: - +The following example calls to load persisted workflow instance from a . + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet27"::: + ]]> @@ -2810,14 +2810,14 @@ The following example calls The interval in which the load operation must complete before the load operation is canceled and a is thrown. Loads the specified workflow instance into memory from an instance store using the specified time-out interval. - to load persisted workflow instance from a . - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet27"::: - +The following example calls to load persisted workflow instance from a . + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet27"::: + ]]> @@ -2858,11 +2858,11 @@ The following example calls Loads a runnable workflow instance from the . - @@ -2886,13 +2886,13 @@ The following example calls Loads a runnable workflow instance from the . - is thrown. - + is thrown. + ]]> @@ -2919,11 +2919,11 @@ The following example calls The interval in which the load operation must complete before the operation is canceled and a is thrown. Loads a runnable workflow instance from the using the specified time-out interval. - @@ -3224,18 +3224,18 @@ The following example calls Gets or sets the that is invoked when the current workflow instance encounters an unhandled exception. The delegate that is invoked when a workflow instance encounters an unhandled exception. - and dictate the behavior of the runtime when an exception is not handled in the workflow; however, has the option of leaving a suspended workflow in the persistence store, while does not. The reason for this is that what happens to a suspended workflow is host-specific, and is not. To implement this functionality using , create a custom that has this behavior. - - - -## Examples - The following example invokes a workflow that throws an exception. The exception is unhandled by the workflow and the handler is invoked. The are inspected to provide information about the exception, and the workflow is terminated. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet1"::: - + and dictate the behavior of the runtime when an exception is not handled in the workflow; however, has the option of leaving a suspended workflow in the persistence store, while does not. The reason for this is that what happens to a suspended workflow is host-specific, and is not. To implement this functionality using , create a custom that has this behavior. + + + +## Examples + The following example invokes a workflow that throws an exception. The exception is unhandled by the workflow and the handler is invoked. The are inspected to provide information about the exception, and the workflow is terminated. + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet1"::: + ]]> @@ -3248,11 +3248,11 @@ The following example calls Persists a workflow instance to an instance store. - used to load the workflow is used for persistence. If the workflow was created and has not yet been persisted, then an must be configured before calling this method or else an is thrown when this method is called. - + used to load the workflow is used for persistence. If the workflow was created and has not yet been persisted, then an must be configured before calling this method or else an is thrown when this method is called. + ]]> @@ -3276,19 +3276,19 @@ The following example calls Persists a workflow instance to an instance store. - is thrown. - - If the workflow instance was previously loaded from persistence, then the same used to load the workflow is used for persistence. If the workflow was created and has not yet been persisted, then an must be configured before calling this method or else an is thrown when this method is called. + is thrown. + + If the workflow instance was previously loaded from persistence, then the same used to load the workflow is used for persistence. If the workflow was created and has not yet been persisted, then an must be configured before calling this method or else an is thrown when this method is called. ## Examples -The following example calls to persist a workflow instance before the workflow is started. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet34"::: - +The following example calls to persist a workflow instance before the workflow is started. + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet34"::: + ]]> @@ -3315,17 +3315,17 @@ The following example calls The interval in which the persist operation must complete before the operation is canceled and a is thrown. Persists a workflow instance to an instance store using the specified time-out interval. - used to load the workflow is used for persistence. If the workflow was created and has not yet been persisted, then an must be configured before calling this method or else an is thrown when this method is called. + used to load the workflow is used for persistence. If the workflow was created and has not yet been persisted, then an must be configured before calling this method or else an is thrown when this method is called. ## Examples -The following example calls to persist a workflow instance before the workflow is started. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet34"::: - +The following example calls to persist a workflow instance before the workflow is started. + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet34"::: + ]]> @@ -3355,18 +3355,18 @@ The following example calls Gets or sets the delegate that is invoked when the current workflow instance is idle and can be persisted. The delegate that is invoked when the current workflow instance is idle and can be persisted. - and are invoked, in that order. The handler returns one of the enumeration values of , , or . - - - -## Examples - The following example handles the handler and instructs the runtime to persist and unload the workflow. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet26"::: - + and are invoked, in that order. The handler returns one of the enumeration values of , , or . + + + +## Examples + The following example handles the handler and instructs the runtime to persist and unload the workflow. + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet26"::: + ]]> @@ -3405,20 +3405,20 @@ The following example calls Initiates an operation to resume the specified bookmark, using the specified value. The bookmark to be resumed is previously created by an activity within the workflow instance. The result of the bookmark resumption operation. - . The workflow is started, and once the is created and the workflow goes idle, the user's input is gathered and the bookmark is resumed. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet15"::: - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet24"::: - + . The workflow is started, and once the is created and the workflow goes idle, the user's input is gathered and the bookmark is resumed. + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet15"::: + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet24"::: + ]]> @@ -3448,20 +3448,20 @@ The following example calls Initiates an operation to resume the bookmark with the specified name, using the specified value. The bookmark to be resumed is previously created by an activity within the workflow instance. The result of the bookmark resumption operation. - . The workflow is started, and once the is created and the workflow goes idle, the user's input is gathered and the bookmark is resumed. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet15"::: - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet22"::: - + . The workflow is started, and once the is created and the workflow goes idle, the user's input is gathered and the bookmark is resumed. + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet15"::: + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet22"::: + ]]> @@ -3493,20 +3493,20 @@ The following example calls Initiates an operation to resume the specified bookmark, using the specified value and time-out interval. The bookmark to be resumed is previously created by an activity within the workflow instance. The result of the bookmark resumption operation. - . The workflow is started, and once the is created and the workflow goes idle, the user's input is gathered and the bookmark is resumed. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet15"::: - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet25"::: - + . The workflow is started, and once the is created and the workflow goes idle, the user's input is gathered and the bookmark is resumed. + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet15"::: + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet25"::: + ]]> @@ -3538,20 +3538,20 @@ The following example calls Initiates an operation to resume the bookmark with the specified name, using the specified value and time-out interval. The bookmark to be resumed is previously created by an activity within the workflow instance. The result of the bookmark resumption operation. - . The workflow is started, and once the is created and the workflow goes idle, the user's input is gathered and the bookmark is resumed. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet15"::: - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet22"::: - + . The workflow is started, and once the is created and the workflow goes idle, the user's input is gathered and the bookmark is resumed. + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet15"::: + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet22"::: + ]]> @@ -3564,11 +3564,11 @@ The following example calls Begins or resumes the execution of a workflow instance. - @@ -3592,29 +3592,29 @@ The following example calls Begins or resumes the execution of a workflow instance. - is thrown. - - - -## Examples - The following example hosts a workflow using . A instance is constructed using the specified workflow definition, the desired workflow lifecycle events are handled, and the workflow is invoked with a call to . When the workflow is completed, the following output is displayed to the console. - -```Output -Starting the workflow. -Workflow 593976e8-558d-4989-94d6-50a14b34fd7b Idle. -Ending the workflow. -Workflow 593976e8-558d-4989-94d6-50a14b34fd7b Completed -Workflow 593976e8-558d-4989-94d6-50a14b34fd7b Unloaded. - -``` - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet9"::: - + is thrown. + + + +## Examples + The following example hosts a workflow using . A instance is constructed using the specified workflow definition, the desired workflow lifecycle events are handled, and the workflow is invoked with a call to . When the workflow is completed, the following output is displayed to the console. + +```Output +Starting the workflow. +Workflow 593976e8-558d-4989-94d6-50a14b34fd7b Idle. +Ending the workflow. +Workflow 593976e8-558d-4989-94d6-50a14b34fd7b Completed +Workflow 593976e8-558d-4989-94d6-50a14b34fd7b Unloaded. + +``` + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet9"::: + ]]> @@ -3644,32 +3644,32 @@ Workflow 593976e8-558d-4989-94d6-50a14b34fd7b Unloaded. - Call this method to initiate execution of a newly created workflow instance. - + Call this method to initiate execution of a newly created workflow instance. + The interval in which the run operation must complete before the operation is canceled and a is thrown. Begins or resumes the execution of a workflow instance using the specified time-out interval. - , this method will time out only if the workflow doesn't start in the specified amount of time, rather than needing to complete in the specified amount of time. The reason for this is that executes the workflow synchronously (blocking the host thread), while executes asynchronously, only blocking the host thread for the amount of time it takes the workflow to start. - - - -## Examples - The following example hosts a workflow using . A instance is constructed using the specified workflow definition, the desired workflow lifecycle events are handled, and the workflow is invoked with a call to . When the workflow is completed, the following output is displayed to the console. - -```Output -Starting the workflow. -Workflow 593976e8-558d-4989-94d6-50a14b34fd7b Idle. -Ending the workflow. -Workflow 593976e8-558d-4989-94d6-50a14b34fd7b Completed -Workflow 593976e8-558d-4989-94d6-50a14b34fd7b Unloaded. - -``` - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet9"::: - + , this method will time out only if the workflow doesn't start in the specified amount of time, rather than needing to complete in the specified amount of time. The reason for this is that executes the workflow synchronously (blocking the host thread), while executes asynchronously, only blocking the host thread for the amount of time it takes the workflow to start. + + + +## Examples + The following example hosts a workflow using . A instance is constructed using the specified workflow definition, the desired workflow lifecycle events are handled, and the workflow is invoked with a call to . When the workflow is completed, the following output is displayed to the console. + +```Output +Starting the workflow. +Workflow 593976e8-558d-4989-94d6-50a14b34fd7b Idle. +Ending the workflow. +Workflow 593976e8-558d-4989-94d6-50a14b34fd7b Completed +Workflow 593976e8-558d-4989-94d6-50a14b34fd7b Unloaded. + +``` + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet9"::: + ]]> @@ -3726,29 +3726,29 @@ Workflow 593976e8-558d-4989-94d6-50a14b34fd7b Unloaded. The reason for terminating the workflow instance. Terminates a workflow instance using the specified exception. - handle. - - By default, the operation must complete in 30 seconds or a is thrown. - - - -## Examples - The following example hosts a workflow using . A instance is constructed using the specified workflow definition, the desired workflow lifecycle events are handled, and the workflow is invoked with a call to . After the workflow is started, is called. When the workflow is terminated, the following output is displayed to the console. - -```Output -Starting the workflow. -Workflow e6b33409-f010-49f1-82ce-56f8baabe5e5 Terminated. -Exception: System.ApplicationException -Terminating the workflow. -Workflow e6b33409-f010-49f1-82ce-56f8baabe5e5 unloaded. - -``` - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet16"::: - + handle. + + By default, the operation must complete in 30 seconds or a is thrown. + + + +## Examples + The following example hosts a workflow using . A instance is constructed using the specified workflow definition, the desired workflow lifecycle events are handled, and the workflow is invoked with a call to . After the workflow is started, is called. When the workflow is terminated, the following output is displayed to the console. + +```Output +Starting the workflow. +Workflow e6b33409-f010-49f1-82ce-56f8baabe5e5 Terminated. +Exception: System.ApplicationException +Terminating the workflow. +Workflow e6b33409-f010-49f1-82ce-56f8baabe5e5 unloaded. + +``` + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet16"::: + ]]> @@ -3775,29 +3775,29 @@ Workflow e6b33409-f010-49f1-82ce-56f8baabe5e5 unloaded. The reason for terminating the workflow instance. Terminates a workflow instance using the specified error message. - handle. - - By default, the operation must complete in 30 seconds or a is thrown. - - - -## Examples - The following example hosts a workflow using . A instance is constructed using the specified workflow definition, the desired workflow lifecycle events are handled, and the workflow is invoked with a call to . After the workflow is started, is called. When the workflow is terminated, the following output is displayed to the console. - -```Output -Starting the workflow. -Workflow f87c6f91-4fe4-40b9-b7cb-4f1bd071bf84 Terminated. -Exception: System.Activities.WorkflowApplicationTerminatedException -Terminating the workflow. -Workflow f87c6f91-4fe4-40b9-b7cb-4f1bd071bf84 unloaded. - -``` - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet18"::: - + handle. + + By default, the operation must complete in 30 seconds or a is thrown. + + + +## Examples + The following example hosts a workflow using . A instance is constructed using the specified workflow definition, the desired workflow lifecycle events are handled, and the workflow is invoked with a call to . After the workflow is started, is called. When the workflow is terminated, the following output is displayed to the console. + +```Output +Starting the workflow. +Workflow f87c6f91-4fe4-40b9-b7cb-4f1bd071bf84 Terminated. +Exception: System.Activities.WorkflowApplicationTerminatedException +Terminating the workflow. +Workflow f87c6f91-4fe4-40b9-b7cb-4f1bd071bf84 unloaded. + +``` + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet18"::: + ]]> @@ -3826,27 +3826,27 @@ Workflow f87c6f91-4fe4-40b9-b7cb-4f1bd071bf84 unloaded. The interval in which the operation must complete before the operation is canceled and a is thrown. Terminates a workflow instance using the specified exception and time-out interval. - handle. - - - -## Examples - The following example hosts a workflow using . A instance is constructed using the specified workflow definition, the desired workflow lifecycle events are handled, and the workflow is invoked with a call to . After the workflow is started, is called. When the workflow is terminated, the following output is displayed to the console. - -```Output -Starting the workflow. -Workflow de28efe5-9057-472b-8d95-899c249893c5 Terminated. -Exception: System.ApplicationException -Terminating the workflow. -Workflow de28efe5-9057-472b-8d95-899c249893c5 unloaded. - -``` - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet17"::: - + handle. + + + +## Examples + The following example hosts a workflow using . A instance is constructed using the specified workflow definition, the desired workflow lifecycle events are handled, and the workflow is invoked with a call to . After the workflow is started, is called. When the workflow is terminated, the following output is displayed to the console. + +```Output +Starting the workflow. +Workflow de28efe5-9057-472b-8d95-899c249893c5 Terminated. +Exception: System.ApplicationException +Terminating the workflow. +Workflow de28efe5-9057-472b-8d95-899c249893c5 unloaded. + +``` + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet17"::: + ]]> @@ -3875,27 +3875,27 @@ Workflow de28efe5-9057-472b-8d95-899c249893c5 unloaded. The interval in which the operation must complete before the operation is canceled and a is thrown. Terminates a workflow instance using the specified error message and time-out interval. - handle. - - - -## Examples - The following example hosts a workflow using . A instance is constructed using the specified workflow definition, the desired workflow lifecycle events are handled, and the workflow is invoked with a call to . After the workflow is started, is called. When the workflow is terminated, the following output is displayed to the console. - -```Output -Starting the workflow. -Workflow 2897d2ef-377e-4224-ae93-5c19b38f487c Terminated. -Exception: System.Activities.WorkflowApplicationTerminatedException -Terminating the workflow. -Workflow 2897d2ef-377e-4224-ae93-5c19b38f487c unloaded. - -``` - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet19"::: - + handle. + + + +## Examples + The following example hosts a workflow using . A instance is constructed using the specified workflow definition, the desired workflow lifecycle events are handled, and the workflow is invoked with a call to . After the workflow is started, is called. When the workflow is terminated, the following output is displayed to the console. + +```Output +Starting the workflow. +Workflow 2897d2ef-377e-4224-ae93-5c19b38f487c Terminated. +Exception: System.Activities.WorkflowApplicationTerminatedException +Terminating the workflow. +Workflow 2897d2ef-377e-4224-ae93-5c19b38f487c unloaded. + +``` + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet19"::: + ]]> @@ -3908,13 +3908,13 @@ Workflow 2897d2ef-377e-4224-ae93-5c19b38f487c unloaded. Persists and unloads a workflow instance. - is thrown. - - If the workflow instance was previously loaded from persistence, then the same used to load the workflow is used for persistence. If the workflow was created and has not yet been persisted, then an must be configured before calling this method or else an is thrown when this method is called. - + is thrown. + + If the workflow instance was previously loaded from persistence, then the same used to load the workflow is used for persistence. If the workflow was created and has not yet been persisted, then an must be configured before calling this method or else an is thrown when this method is called. + ]]> @@ -3938,19 +3938,19 @@ Workflow 2897d2ef-377e-4224-ae93-5c19b38f487c unloaded. Persists and unloads a workflow instance. - is thrown. - - If the workflow instance was previously loaded from persistence, then the same used to load the workflow is used for persistence. If the workflow was created and has not yet been persisted, then an must be configured before calling this method or else an is thrown when this method is called. + is thrown. + + If the workflow instance was previously loaded from persistence, then the same used to load the workflow is used for persistence. If the workflow was created and has not yet been persisted, then an must be configured before calling this method or else an is thrown when this method is called. ## Examples -In this example, the workflow is idle and the host application is waiting for user input. If the user chooses to unload, is called. If successful, the workflow is persisted and unloaded from memory. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet20"::: - +In this example, the workflow is idle and the host application is waiting for user input. If the user chooses to unload, is called. If successful, the workflow is persisted and unloaded from memory. + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet20"::: + ]]> @@ -3977,17 +3977,17 @@ In this example, the workflow is idle and the host application is waiting for us The interval in which the unload operation must complete before the operation is canceled and a is thrown. Persists and unloads a workflow instance using the specified time-out interval. - used to load the workflow is used for persistence. If the workflow was created and has not yet been persisted, then an must be configured before calling this method or else an is thrown when this method is called. + used to load the workflow is used for persistence. If the workflow was created and has not yet been persisted, then an must be configured before calling this method or else an is thrown when this method is called. ## Examples -In this example, the workflow is idle and the host application is waiting for user input. If the user chooses to unload, is called. If successful, the workflow is persisted and unloaded from memory. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet20"::: - +In this example, the workflow is idle and the host application is waiting for user input. If the user chooses to unload, is called. If successful, the workflow is persisted and unloaded from memory. + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet20"::: + ]]> @@ -4017,13 +4017,13 @@ In this example, the workflow is idle and the host application is waiting for us Gets or sets the that is invoked when the current workflow unloads. An action that is invoked when a workflow instance is unloaded. - passed into the handler of a instance and displays the of the workflow that was unloaded. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet3"::: - + passed into the handler of a instance and displays the of the workflow that was unloaded. + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet3"::: + ]]> diff --git a/xml/System.Activities/WorkflowApplicationAbortedEventArgs.xml b/xml/System.Activities/WorkflowApplicationAbortedEventArgs.xml index 922043e5e21..5d076cd4be8 100644 --- a/xml/System.Activities/WorkflowApplicationAbortedEventArgs.xml +++ b/xml/System.Activities/WorkflowApplicationAbortedEventArgs.xml @@ -16,18 +16,18 @@ Provides data about an aborted workflow instance. - is aborted, the handler is invoked and the handler is not invoked. - - - -## Examples - The following code example inspects the passed into the handler of a instance and displays information about why workflow was aborted. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet5"::: - + is aborted, the handler is invoked and the handler is not invoked. + + + +## Examples + The following code example inspects the passed into the handler of a instance and displays information about why workflow was aborted. + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet5"::: + ]]> @@ -57,18 +57,18 @@ Gets the exception that provides information about why the workflow instance was aborted. The exception that provides information about why the workflow instance was aborted. - is aborted, the handler is invoked and the handler is not invoked. - - - -## Examples - The following code example inspects the passed into the handler of a instance and displays information about why workflow was aborted. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet5"::: - + is aborted, the handler is invoked and the handler is not invoked. + + + +## Examples + The following code example inspects the passed into the handler of a instance and displays information about why workflow was aborted. + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet5"::: + ]]> diff --git a/xml/System.Activities/WorkflowApplicationCompletedEventArgs.xml b/xml/System.Activities/WorkflowApplicationCompletedEventArgs.xml index 6d17b22672b..645c70edb9e 100644 --- a/xml/System.Activities/WorkflowApplicationCompletedEventArgs.xml +++ b/xml/System.Activities/WorkflowApplicationCompletedEventArgs.xml @@ -16,13 +16,13 @@ Provides information about a workflow instance that has completed its execution. - passed into the handler of a instance and displays information about how the workflow completed. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet4"::: - + passed into the handler of a instance and displays information about how the workflow completed. + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet4"::: + ]]> @@ -52,13 +52,13 @@ Gets the completion state of the workflow instance, which indicates whether the workflow instance completed successfully, was canceled, or faulted. The completion state of the workflow instance, which indicates whether the workflow instance completed successfully, was canceled, or faulted. - passed into the handler of a instance and displays information about how the workflow completed. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet4"::: - + passed into the handler of a instance and displays information about how the workflow completed. + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet4"::: + ]]> @@ -82,13 +82,13 @@ Gets a dictionary that contains the values of s of the workflow instance's root activity, keyed by argument name. A dictionary that contains the values of s of the workflow instance's root activity, keyed by argument name. - passed into the handler of a instance and displays information about how the workflow completed. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet4"::: - + passed into the handler of a instance and displays information about how the workflow completed. + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet4"::: + ]]> @@ -118,13 +118,13 @@ Gets the exception associated with the termination of the workflow instance. The exception associated with the termination of the workflow instance. - passed into the handler of a instance and displays information about how the workflow completed. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet4"::: - + passed into the handler of a instance and displays information about how the workflow completed. + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet4"::: + ]]> diff --git a/xml/System.Activities/WorkflowApplicationEventArgs.xml b/xml/System.Activities/WorkflowApplicationEventArgs.xml index 35379a6f600..4176cbc9ab4 100644 --- a/xml/System.Activities/WorkflowApplicationEventArgs.xml +++ b/xml/System.Activities/WorkflowApplicationEventArgs.xml @@ -16,18 +16,18 @@ A base class for events associated with a . - is also used in the handler of a instance. - - - -## Examples - The following code example inspects the passed into the handler of a instance and displays the of the workflow that was unloaded. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet3"::: - + is also used in the handler of a instance. + + + +## Examples + The following code example inspects the passed into the handler of a instance and displays the of the workflow that was unloaded. + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet3"::: + ]]> @@ -81,13 +81,13 @@ The unique identifier of the workflow instance. A unique identifier. - passed into the handler of a instance and displays the of the workflow that was unloaded. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet3"::: - + passed into the handler of a instance and displays the of the workflow that was unloaded. + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet3"::: + ]]> diff --git a/xml/System.Activities/WorkflowApplicationIdleEventArgs.xml b/xml/System.Activities/WorkflowApplicationIdleEventArgs.xml index 25077b3a2d2..bb2704efa32 100644 --- a/xml/System.Activities/WorkflowApplicationIdleEventArgs.xml +++ b/xml/System.Activities/WorkflowApplicationIdleEventArgs.xml @@ -16,17 +16,17 @@ Holds information about the workflow instance that has become idle. - passed into the handler of a instance. In this example the workflow going idle has one with a name of `EnterGuess`, owned by an activity named `ReadInt`. This code example is based off of [How to: Run a Workflow](/dotnet/framework/windows-workflow-foundation/how-to-run-a-workflow), which is part of the [Getting Started Tutorial [.NET Framework 4.5]](/dotnet/framework/windows-workflow-foundation/getting-started-tutorial). If the handler in that step is modified to contain the code from this example, the following output is displayed. - -```Output -BookmarkName: EnterGuess - OwnerDisplayName: ReadInt -``` - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet2"::: - + passed into the handler of a instance. In this example the workflow going idle has one with a name of `EnterGuess`, owned by an activity named `ReadInt`. This code example is based off of [How to: Run a Workflow](/dotnet/framework/windows-workflow-foundation/how-to-run-a-workflow), which is part of the [Getting Started Tutorial [.NET Framework 4.5]](/dotnet/framework/windows-workflow-foundation/getting-started-tutorial). If the handler in that step is modified to contain the code from this example, the following output is displayed. + +```Output +BookmarkName: EnterGuess - OwnerDisplayName: ReadInt +``` + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet2"::: + ]]> @@ -50,17 +50,17 @@ BookmarkName: EnterGuess - OwnerDisplayName: ReadInt Gets the read-only collection of bookmarks for the workflow instance. A read-only collection of bookmarks. - passed into the handler of a instance. In this example the workflow going idle has one with a name of `EnterGuess`, owned by an activity named `ReadInt`. This code example is based off of [How to: Run a Workflow](/dotnet/framework/windows-workflow-foundation/how-to-run-a-workflow), which is part of the [Getting Started Tutorial [.NET Framework 4.5]](/dotnet/framework/windows-workflow-foundation/getting-started-tutorial). If the handler in that step is modified to contain the code from this example, the following output is displayed. - -```Output -BookmarkName: EnterGuess - OwnerDisplayName: ReadInt -``` - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet2"::: - + passed into the handler of a instance. In this example the workflow going idle has one with a name of `EnterGuess`, owned by an activity named `ReadInt`. This code example is based off of [How to: Run a Workflow](/dotnet/framework/windows-workflow-foundation/how-to-run-a-workflow), which is part of the [Getting Started Tutorial [.NET Framework 4.5]](/dotnet/framework/windows-workflow-foundation/getting-started-tutorial). If the handler in that step is modified to contain the code from this example, the following output is displayed. + +```Output +BookmarkName: EnterGuess - OwnerDisplayName: ReadInt +``` + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet2"::: + ]]> diff --git a/xml/System.Activities/WorkflowApplicationUnhandledExceptionEventArgs.xml b/xml/System.Activities/WorkflowApplicationUnhandledExceptionEventArgs.xml index f08f9b838de..4d2bd3996ac 100644 --- a/xml/System.Activities/WorkflowApplicationUnhandledExceptionEventArgs.xml +++ b/xml/System.Activities/WorkflowApplicationUnhandledExceptionEventArgs.xml @@ -16,18 +16,18 @@ Provides information about an unhandled exception that occurred in a workflow instance. - handler is present, it can override this default behavior. This handler gives the workflow host author an opportunity to provide the appropriate handling, such as custom logging, aborting the workflow, canceling the workflow, or terminating the workflow. - - - -## Examples - The following example invokes a workflow that throws an exception. The exception is unhandled by the workflow and the handler is invoked. The are inspected to provide information about the exception, and the workflow is terminated. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet1"::: - + handler is present, it can override this default behavior. This handler gives the workflow host author an opportunity to provide the appropriate handling, such as custom logging, aborting the workflow, canceling the workflow, or terminating the workflow. + + + +## Examples + The following example invokes a workflow that throws an exception. The exception is unhandled by the workflow and the handler is invoked. The are inspected to provide information about the exception, and the workflow is terminated. + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet1"::: + ]]> @@ -57,18 +57,18 @@ Gets the activity that is the source of the unhandled exception. An activity. - handler is present, it can override this default behavior. This handler gives the workflow host author an opportunity to provide the appropriate handling, such as custom logging, aborting the workflow, canceling the workflow, or terminating the workflow. - - - -## Examples - The following example invokes a workflow that throws an exception. The exception is unhandled by the workflow and the handler is invoked. The are inspected to provide information about the exception, and the workflow is terminated. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet1"::: - + handler is present, it can override this default behavior. This handler gives the workflow host author an opportunity to provide the appropriate handling, such as custom logging, aborting the workflow, canceling the workflow, or terminating the workflow. + + + +## Examples + The following example invokes a workflow that throws an exception. The exception is unhandled by the workflow and the handler is invoked. The are inspected to provide information about the exception, and the workflow is terminated. + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet1"::: + ]]> @@ -98,18 +98,18 @@ Gets the unique identifier of the activity instance that is the source of the unhandled exception. An identifier of the activity instance that is the source of the unhandled exception. - handler is present, it can override this default behavior. This handler gives the workflow host author an opportunity to provide the appropriate handling, such as custom logging, aborting the workflow, canceling the workflow, or terminating the workflow. - - - -## Examples - The following example invokes a workflow that throws an exception. The exception is unhandled by the workflow and the handler is invoked. The are inspected to provide information about the exception, and the workflow is terminated. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet1"::: - + handler is present, it can override this default behavior. This handler gives the workflow host author an opportunity to provide the appropriate handling, such as custom logging, aborting the workflow, canceling the workflow, or terminating the workflow. + + + +## Examples + The following example invokes a workflow that throws an exception. The exception is unhandled by the workflow and the handler is invoked. The are inspected to provide information about the exception, and the workflow is terminated. + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet1"::: + ]]> @@ -139,18 +139,18 @@ Gets the that was unhandled by the workflow instance. The that was unhandled by the workflow instance. - handler is present, it can override this default behavior. This handler gives the workflow host author an opportunity to provide the appropriate handling, such as custom logging, aborting the workflow, canceling the workflow, or terminating the workflow. - - - -## Examples - The following example invokes a workflow that throws an exception. The exception is unhandled by the workflow and the handler is invoked. The are inspected to provide information about the exception, and the workflow is terminated. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet1"::: - + handler is present, it can override this default behavior. This handler gives the workflow host author an opportunity to provide the appropriate handling, such as custom logging, aborting the workflow, canceling the workflow, or terminating the workflow. + + + +## Examples + The following example invokes a workflow that throws an exception. The exception is unhandled by the workflow and the handler is invoked. The are inspected to provide information about the exception, and the workflow is terminated. + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowapplicationexample/cs/program.cs" id="Snippet1"::: + ]]> diff --git a/xml/System.Activities/WorkflowInspectionServices.xml b/xml/System.Activities/WorkflowInspectionServices.xml index c0cba4502d4..6245e1cbfbf 100644 --- a/xml/System.Activities/WorkflowInspectionServices.xml +++ b/xml/System.Activities/WorkflowInspectionServices.xml @@ -143,13 +143,13 @@ Returns an that represents all activities associated with the input activity. An enumeration that represents all activities associated with the input activity. - is thrown. The activity tree must remain unmodified and must not be called while the tree is being enumerated or else an is thrown when is called. - - Calling this method causes a full cache metadata to occur. If you make changes to the workflow after calling this method, you must call the method after making the changes in order to re-cache the metadata. - + is thrown. The activity tree must remain unmodified and must not be called while the tree is being enumerated or else an is thrown when is called. + + Calling this method causes a full cache metadata to occur. If you make changes to the workflow after calling this method, you must call the method after making the changes in order to re-cache the metadata. + ]]> diff --git a/xml/System.Activities/WorkflowInvoker.xml b/xml/System.Activities/WorkflowInvoker.xml index c2f2ab7afa9..f4b809e05d3 100644 --- a/xml/System.Activities/WorkflowInvoker.xml +++ b/xml/System.Activities/WorkflowInvoker.xml @@ -23,7 +23,7 @@ does not allow instance control such as persisting, unloading, or resuming bookmarks. If instance control is desired, use instead. - To execute workflows synchronously with no instance control, call the method. To execute a workflow asynchronously with no instance control, use the and method pairs, or the method. + To execute workflows synchronously with no instance control, call the method. To execute a workflow asynchronously with no instance control, use the and method pairs, or the method. @@ -116,14 +116,14 @@ from the `callback` method. If is called before the workflow completes, it blocks until the workflow completes. To configure a time-out interval in which the workflow must complete, use one of the overloads that take a . + To be notified when the workflow is complete and retrieve the output parameters of the workflow, call from the `callback` method. If is called before the workflow completes, it blocks until the workflow completes. To configure a time-out interval in which the workflow must complete, use one of the overloads that take a . This method invokes a workflow asynchronously using the asynchronous design pattern. For more information, see [Asynchronous Programming Overview](/dotnet/standard/asynchronous-programming-patterns/asynchronous-programming-model-apm). ## Examples - The following example invokes a workflow consisting of a `LongRunningDiceRoll` activity. The `LongRunningDiceRoll` activity has two output arguments that represent the results of the dice roll operation. These are retrieved by calling . When the call to returns, each output argument is returned in the outputs dictionary, keyed by argument name. + The following example invokes a workflow consisting of a `LongRunningDiceRoll` activity. The `LongRunningDiceRoll` activity has two output arguments that represent the results of the dice roll operation. These are retrieved by calling . When the call to returns, each output argument is returned in the outputs dictionary, keyed by argument name. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowinvokerexample/cs/program.cs" id="Snippet131"::: @@ -163,14 +163,14 @@ from the `callback` method. If is called before the workflow completes, it blocks until the workflow completes. To configure a time-out interval in which the workflow must complete, use one of the overloads that take a . + To be notified when the workflow is complete and retrieve the output parameters of the workflow, call from the `callback` method. If is called before the workflow completes, it blocks until the workflow completes. To configure a time-out interval in which the workflow must complete, use one of the overloads that take a . This method invokes a workflow asynchronously using the asynchronous design pattern. For more information, see [Asynchronous Programming Overview](/dotnet/standard/asynchronous-programming-patterns/asynchronous-programming-model-apm). ## Examples - The following example invokes a workflow consisting of a `LongRunningDiceRoll` activity. The `LongRunningDiceRoll` activity has two output arguments that represent the results of the dice roll operation. These are retrieved by calling . When the call to returns, each output argument is returned in the outputs dictionary, keyed by argument name. + The following example invokes a workflow consisting of a `LongRunningDiceRoll` activity. The `LongRunningDiceRoll` activity has two output arguments that represent the results of the dice roll operation. These are retrieved by calling . When the call to returns, each output argument is returned in the outputs dictionary, keyed by argument name. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowinvokerexample/cs/program.cs" id="Snippet131"::: @@ -210,7 +210,7 @@ from the `callback` method. If is called before the workflow completes, it blocks until the workflow completes. If the workflow does not complete within the specified time-out interval the workflow is aborted and a is thrown when the method is called. + To be notified when the workflow is complete and retrieve the output parameters of the workflow, call from the `callback` method. If is called before the workflow completes, it blocks until the workflow completes. If the workflow does not complete within the specified time-out interval the workflow is aborted and a is thrown when the method is called. > [!NOTE] > The is only thrown if the time-out interval elapses and the workflow becomes idle during execution. A workflow that takes longer than the specified time-out interval to complete completes successfully if the workflow does not become idle. @@ -220,7 +220,7 @@ ## Examples - The following example invokes a workflow consisting of a `LongRunningDiceRoll` activity. The `LongRunningDiceRoll` activity has two output arguments that represent the results of the dice roll operation. These are retrieved by calling . When the call to returns, each output argument is returned in the outputs dictionary, keyed by argument name. + The following example invokes a workflow consisting of a `LongRunningDiceRoll` activity. The `LongRunningDiceRoll` activity has two output arguments that represent the results of the dice roll operation. These are retrieved by calling . When the call to returns, each output argument is returned in the outputs dictionary, keyed by argument name. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowinvokerexample/cs/program.cs" id="Snippet131"::: @@ -262,7 +262,7 @@ from the `callback` method. If is called before the workflow completes, it blocks until the workflow completes. If the workflow does not complete within the specified time-out interval the workflow is aborted and a is thrown when is called. + To be notified when the workflow is complete and retrieve the output parameters of the workflow, call from the `callback` method. If is called before the workflow completes, it blocks until the workflow completes. If the workflow does not complete within the specified time-out interval the workflow is aborted and a is thrown when is called. > [!NOTE] > The is only thrown if the time-out interval elapses and the workflow becomes idle during execution. A workflow that takes longer than the specified time-out interval to complete completes successfully if the workflow does not become idle. @@ -272,7 +272,7 @@ ## Examples - The following example invokes a workflow consisting of a `LongRunningDiceRoll` activity. The `LongRunningDiceRoll` activity has two output arguments that represent the results of the dice roll operation. These are retrieved by calling . When the call to returns, each output argument is returned in the outputs dictionary, keyed by argument name. + The following example invokes a workflow consisting of a `LongRunningDiceRoll` activity. The `LongRunningDiceRoll` activity has two output arguments that represent the results of the dice roll operation. These are retrieved by calling . When the call to returns, each output argument is returned in the outputs dictionary, keyed by argument name. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowinvokerexample/cs/program.cs" id="Snippet131"::: @@ -307,7 +307,7 @@ overloads that takes a `userState` parameter can be canceled. + Only a workflow invoked by one of the overloads that takes a `userState` parameter can be canceled. If the cancellation succeeds, the property of the passed to the handler is set to `true`; otherwise, it is set to `false`. @@ -350,14 +350,14 @@ from the `callback` method specified by . If is called before the workflow completes, it blocks until the workflow completes. + To be notified when the workflow is complete and retrieve the output parameters of the workflow, call from the `callback` method specified by . If is called before the workflow completes, it blocks until the workflow completes. This method returns the result of a workflow invoked asynchronously using the asynchronous design pattern. For more information, see [Asynchronous Programming Overview](/dotnet/standard/asynchronous-programming-patterns/asynchronous-programming-model-apm). ## Examples - The following example invokes a workflow consisting of a `LongRunningDiceRoll` activity. The `LongRunningDiceRoll` activity has two output arguments that represent the results of the dice roll operation. These are retrieved by calling . When the call to returns, each output argument is returned in the outputs dictionary, keyed by argument name. + The following example invokes a workflow consisting of a `LongRunningDiceRoll` activity. The `LongRunningDiceRoll` activity has two output arguments that represent the results of the dice roll operation. These are retrieved by calling . When the call to returns, each output argument is returned in the outputs dictionary, keyed by argument name. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowinvokerexample/cs/program.cs" id="Snippet131"::: @@ -394,7 +394,7 @@ ## Examples - The following example registers a custom with the collection of a instance. This code example is part of the [Custom Tracking](/dotnet/framework/windows-workflow-foundation/samples/custom-tracking) sample. + The following example registers a custom with the collection of a instance. This code example is part of the [Custom Tracking](/dotnet/framework/windows-workflow-foundation/samples/custom-tracking) sample. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowinvokerexample/cs/program.cs" id="Snippet40"::: @@ -413,7 +413,7 @@ overloads that take a . + This method blocks until the workflow has completed, including idle time. All workflow execution is guaranteed to execute on the invoking thread. To configure a time-out interval in which the workflow must complete, use one of the overloads that take a . ]]> @@ -442,7 +442,7 @@ overloads that take a . + This method blocks until the workflow has completed, including idle time. All workflow execution is guaranteed to execute on the invoking thread. To configure a time-out interval in which the workflow must complete, use one of the overloads that take a . @@ -487,7 +487,7 @@ overloads that take a . + This method blocks until the workflow has completed, including idle time. All workflow execution is guaranteed to execute on the invoking thread. To configure a time-out interval in which the workflow must complete, use one of the overloads that take a . @@ -532,7 +532,7 @@ overloads that take a . + This method blocks until the workflow has completed, including idle time. All workflow execution is guaranteed to execute on the invoking thread. To configure a time-out interval in which the workflow must complete, use one of the overloads that take a . @@ -543,7 +543,7 @@ :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowinvokerexample/cs/program.cs" id="Snippet22"::: - If the workflow derives from , such as `CodeActivity` or `Activity`, and there are output arguments in addition to the well-defined output argument, a non-generic overload of `Invoke`, such as this one, must be used in order to retrieve the additional arguments. To do this, the workflow definition passed into the `WorkflowInvoker` constructor must be of type . In this example the `Divide` activity derives from `CodeActivity`, but is declared as so that this overload of `Invoke`, which returns a dictionary of arguments instead of a single return value, is used. + If the workflow derives from , such as `CodeActivity` or `Activity`, and there are output arguments in addition to the well-defined output argument, a non-generic overload of `Invoke`, such as this one, must be used in order to retrieve the additional arguments. To do this, the workflow definition passed into the `WorkflowInvoker` constructor must be of type . In this example the `Divide` activity derives from `CodeActivity`, but is declared as so that this overload of `Invoke`, which returns a dictionary of arguments instead of a single return value, is used. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowinvokerexample/cs/program.cs" id="Snippet121"::: @@ -587,7 +587,7 @@ ## Examples - The following example invokes a workflow that contains two activities and a activity configured with a of one minute. This workflow is invoked twice; the first time with a time-out interval of two minutes, and the second time with a time-out interval of 30 seconds. The first workflow completes successfully, but the second one does not and a is thrown and the following message is displayed. + The following example invokes a workflow that contains two activities and a activity configured with a of one minute. This workflow is invoked twice; the first time with a time-out interval of two minutes, and the second time with a time-out interval of 30 seconds. The first workflow completes successfully, but the second one does not and a is thrown and the following message is displayed. ```Output The operation did not complete within the allotted timeout of 00:00:30. @@ -596,7 +596,7 @@ The time allotted to this operation may have been a portion of a longer timeout. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowinvokerexample/cs/program.cs" id="Snippet51"::: - For an example of using `Invoke` with output arguments, see the overload of with the same parameters as this overload without the time-out interval. + For an example of using `Invoke` with output arguments, see the overload of with the same parameters as this overload without the time-out interval. ]]> @@ -630,7 +630,7 @@ The time allotted to this operation may have been a portion of a longer timeout. overloads that take a . + This method blocks until the workflow has completed, including idle time. All workflow execution is guaranteed to execute on the invoking thread. To configure a time-out interval in which the workflow must complete, use one of the overloads that take a . @@ -641,7 +641,7 @@ The time allotted to this operation may have been a portion of a longer timeout. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowinvokerexample/cs/program.cs" id="Snippet20"::: - If the workflow derives from , such as `CodeActivity` or `Activity`, and there are output arguments in addition to the well-defined output argument, a non-generic overload of `Invoke`, such as this one, must be used in order to retrieve the additional arguments. To do this, the workflow definition passed into `Invoke` must be of type . In this example the `Divide` activity derives from `CodeActivity`, but is declared as so that this overload of `Invoke`, which returns a dictionary of arguments instead of a single return value, is used. + If the workflow derives from , such as `CodeActivity` or `Activity`, and there are output arguments in addition to the well-defined output argument, a non-generic overload of `Invoke`, such as this one, must be used in order to retrieve the additional arguments. To do this, the workflow definition passed into `Invoke` must be of type . In this example the `Divide` activity derives from `CodeActivity`, but is declared as so that this overload of `Invoke`, which returns a dictionary of arguments instead of a single return value, is used. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowinvokerexample/cs/program.cs" id="Snippet121"::: @@ -693,11 +693,11 @@ The time allotted to this operation may have been a portion of a longer timeout. ## Examples - The following example invokes a workflow that contains two activities and a activity configured with a of one minute. This workflow is invoked twice; the first time with a time-out interval of two minutes, and the second time with a time-out interval of 30 seconds. The first workflow completes successfully, but the second one does not and a is thrown. + The following example invokes a workflow that contains two activities and a activity configured with a of one minute. This workflow is invoked twice; the first time with a time-out interval of two minutes, and the second time with a time-out interval of 30 seconds. The first workflow completes successfully, but the second one does not and a is thrown. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowinvokerexample/cs/program.cs" id="Snippet50"::: - For an example of using `Invoke` with output arguments, see the overload of with the same parameters as this overload without the time-out interval. + For an example of using `Invoke` with output arguments, see the overload of with the same parameters as this overload without the time-out interval. ]]> @@ -739,7 +739,7 @@ The time allotted to this operation may have been a portion of a longer timeout. ## Examples - The following example invokes a workflow that contains two activities and a activity configured with a of one minute. This workflow is invoked twice; the first time with a time-out interval of two minutes, and the second time with a time-out interval of 30 seconds. The first workflow completes successfully, but the second one does not and a is thrown and the following message is displayed. + The following example invokes a workflow that contains two activities and a activity configured with a of one minute. This workflow is invoked twice; the first time with a time-out interval of two minutes, and the second time with a time-out interval of 30 seconds. The first workflow completes successfully, but the second one does not and a is thrown and the following message is displayed. ```Output The operation did not complete within the allotted timeout of 00:00:30. @@ -748,7 +748,7 @@ The time allotted to this operation may have been a portion of a longer timeout. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowinvokerexample/cs/program.cs" id="Snippet51"::: - For an example of using `Invoke` with input and output arguments, see the overload of with the same parameters as this overload without the time-out interval. + For an example of using `Invoke` with input and output arguments, see the overload of with the same parameters as this overload without the time-out interval. ]]> @@ -798,11 +798,11 @@ The time allotted to this operation may have been a portion of a longer timeout. ## Examples - The following example invokes a workflow that contains two activities and a activity configured with a of one minute. This workflow is invoked twice; the first time with a time-out interval of two minutes, and the second time with a time-out interval of 30 seconds. The first workflow completes successfully, but the second one does not and a is thrown. + The following example invokes a workflow that contains two activities and a activity configured with a of one minute. This workflow is invoked twice; the first time with a time-out interval of two minutes, and the second time with a time-out interval of 30 seconds. The first workflow completes successfully, but the second one does not and a is thrown. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowinvokerexample/cs/program.cs" id="Snippet50"::: - For an example of using `Invoke` with input and output arguments, see the overload of with the same parameters as this overload without the time-out interval. + For an example of using `Invoke` with input and output arguments, see the overload of with the same parameters as this overload without the time-out interval. ]]> @@ -844,11 +844,11 @@ The time allotted to this operation may have been a portion of a longer timeout. overloads that take a . + This method blocks until the workflow has completed, including idle time. All workflow execution is guaranteed to execute on the invoking thread. To configure a time-out interval in which the workflow must complete, use one of the overloads that take a . ## Examples -The following example invokes a workflow consisting of a single `Add` activity that has two input arguments and since it derives from `CodeActivity` it has one well-defined output argument. When the workflow is invoked, the `arguments` dictionary is passed that contains the values for each input argument, keyed by argument name. When the call to `Invoke` returns, the value of the output argument is returned. +The following example invokes a workflow consisting of a single `Add` activity that has two input arguments and since it derives from `CodeActivity` it has one well-defined output argument. When the workflow is invoked, the `arguments` dictionary is passed that contains the values for each input argument, keyed by argument name. When the call to `Invoke` returns, the value of the output argument is returned. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowinvokerexample/cs/program.cs" id="Snippet110"::: @@ -890,14 +890,14 @@ The following example invokes a workflow consisting of a single `Add` activity t overloads that take a . + This method blocks until the workflow has completed, including idle time. All workflow execution is guaranteed to execute on the invoking thread. To configure a time-out interval in which the workflow must complete, use one of the overloads that take a . > [!NOTE] > The is only thrown if the time-out interval elapses and the workflow becomes idle during execution. A workflow that takes longer than the specified time-out interval to complete, completes successfully if the workflow does not become idle. ## Examples -The following example invokes a workflow consisting of a single `Add` activity that has two input arguments and since it derives from `CodeActivity` it has one well-defined output argument. When the workflow is invoked, the `arguments` dictionary is passed that contains the values for each input argument, keyed by argument name. When the call to `Invoke` returns, the value of the output argument is returned. +The following example invokes a workflow consisting of a single `Add` activity that has two input arguments and since it derives from `CodeActivity` it has one well-defined output argument. When the workflow is invoked, the `arguments` dictionary is passed that contains the values for each input argument, keyed by argument name. When the call to `Invoke` returns, the value of the output argument is returned. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowinvokerexample/cs/program.cs" id="Snippet110"::: @@ -948,7 +948,7 @@ The following example invokes a workflow consisting of a single `Add` activity t ## Examples -The following example invokes a workflow consisting of a single `Add` activity that has two input arguments and since it derives from `CodeActivity` it has one well-defined output argument. When the workflow is invoked, the `arguments` dictionary is passed that contains the values for each input argument, keyed by argument name. When the call to `Invoke` returns, the value of the output argument is returned. +The following example invokes a workflow consisting of a single `Add` activity that has two input arguments and since it derives from `CodeActivity` it has one well-defined output argument. When the workflow is invoked, the `arguments` dictionary is passed that contains the values for each input argument, keyed by argument name. When the call to `Invoke` returns, the value of the output argument is returned. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowinvokerexample/cs/program.cs" id="Snippet110"::: @@ -1001,7 +1001,7 @@ The following example invokes a workflow consisting of a single `Add` activity t ## Examples -The following example invokes a workflow consisting of a single `Add` activity that has two input arguments and since it derives from `CodeActivity` it has one well-defined output argument. When the workflow is invoked, the `arguments` dictionary is passed that contains the values for each input argument, keyed by argument name. When the call to `Invoke` returns, the value of the output argument is returned. +The following example invokes a workflow consisting of a single `Add` activity that has two input arguments and since it derives from `CodeActivity` it has one well-defined output argument. When the workflow is invoked, the `arguments` dictionary is passed that contains the values for each input argument, keyed by argument name. When the call to `Invoke` returns, the value of the output argument is returned. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/cfx_workflowinvokerexample/cs/program.cs" id="Snippet110"::: @@ -1022,7 +1022,7 @@ The following example invokes a workflow consisting of a single `Add` activity t . To configure a time-out interval in which the workflow must complete, use one of the overloads that take a . + To be notified when the workflow is complete, handle . To configure a time-out interval in which the workflow must complete, use one of the overloads that take a . This method invokes a workflow asynchronously using the event-based asynchronous design pattern. For more information, see [Event-based Asynchronous Pattern Overview](/dotnet/standard/asynchronous-programming-patterns/event-based-asynchronous-pattern-overview). @@ -1052,7 +1052,7 @@ The following example invokes a workflow consisting of a single `Add` activity t . To configure a time-out interval in which the workflow must complete, use one of the overloads that take a . + To be notified when the workflow is complete, handle . To configure a time-out interval in which the workflow must complete, use one of the overloads that take a . This method invokes a workflow asynchronously using the event-based asynchronous design pattern. For more information, see [Event-based Asynchronous Pattern Overview](/dotnet/standard/asynchronous-programming-patterns/event-based-asynchronous-pattern-overview). @@ -1100,7 +1100,7 @@ The following example invokes a workflow consisting of a single `Add` activity t . To configure a time-out interval in which the workflow must complete, use one of the overloads that take a . + To be notified when the workflow is complete, handle . To configure a time-out interval in which the workflow must complete, use one of the overloads that take a . This method invokes a workflow asynchronously using the event-based asynchronous design pattern. For more information, see [Event-based Asynchronous Pattern Overview](/dotnet/standard/asynchronous-programming-patterns/event-based-asynchronous-pattern-overview). @@ -1142,9 +1142,9 @@ The following example invokes a workflow consisting of a single `Add` activity t operations for the current activity. If the `userState` parameter is not unique, an is thrown. `userState` is used to identify the workflow in , and to cancel the workflow using . + The `userState` parameter must be unique across all currently running operations for the current activity. If the `userState` parameter is not unique, an is thrown. `userState` is used to identify the workflow in , and to cancel the workflow using . - To be notified when the workflow is complete, handle . To configure a time-out interval in which the workflow must complete, use one of the overloads that take a . + To be notified when the workflow is complete, handle . To configure a time-out interval in which the workflow must complete, use one of the overloads that take a . This method invokes a workflow asynchronously using the event-based asynchronous design pattern. For more information, see [Event-based Asynchronous Pattern Overview](/dotnet/standard/asynchronous-programming-patterns/event-based-asynchronous-pattern-overview). @@ -1239,9 +1239,9 @@ The following example invokes a workflow consisting of a single `Add` activity t operations for the current activity. If `userState` is not unique, an is thrown. `userState` is used to identify the workflow in , and to cancel the workflow using . + The `userState` parameter must be unique across all currently running operations for the current activity. If `userState` is not unique, an is thrown. `userState` is used to identify the workflow in , and to cancel the workflow using . - To be notified when the workflow is complete, handle . To configure a time-out interval in which the workflow must complete, use one of the overloads that take a . + To be notified when the workflow is complete, handle . To configure a time-out interval in which the workflow must complete, use one of the overloads that take a . This method invokes a workflow asynchronously using the event-based asynchronous design pattern. For more information, see [Event-based Asynchronous Pattern Overview](/dotnet/standard/asynchronous-programming-patterns/event-based-asynchronous-pattern-overview). @@ -1338,7 +1338,7 @@ This method stores in the task it returns all non-usage exceptions that the meth operations for the current activity. If `userState` is not unique, an is thrown. `userState` is used to identify the workflow in , and to cancel the workflow using . + The `userState` parameter must be unique across all currently running operations for the current activity. If `userState` is not unique, an is thrown. `userState` is used to identify the workflow in , and to cancel the workflow using . To be notified when the workflow is complete, handle . If the workflow does not complete within the specified time-out interval the workflow is aborted and a is thrown. @@ -1389,7 +1389,7 @@ This method stores in the task it returns all non-usage exceptions that the meth operations for the current activity. If `userState` is not unique, an is thrown. `userState` is used to identify the workflow in , and to cancel the workflow using . + The `userState` parameter must be unique across all currently running operations for the current activity. If `userState` is not unique, an is thrown. `userState` is used to identify the workflow in , and to cancel the workflow using . To be notified when the workflow is complete, handle . If the workflow does not complete within the specified time-out interval the workflow is aborted and a is thrown. @@ -1433,7 +1433,7 @@ This method stores in the task it returns all non-usage exceptions that the meth overloads completed successfully and to retrieve the output arguments of the completed workflow. + Handle this to determine whether a workflow invoked with one of the overloads completed successfully and to retrieve the output arguments of the completed workflow. diff --git a/xml/System.AddIn.Contract.Automation/IRemoteDelegateContract.xml b/xml/System.AddIn.Contract.Automation/IRemoteDelegateContract.xml index 0ae05cb9967..cdcb067afb6 100644 --- a/xml/System.AddIn.Contract.Automation/IRemoteDelegateContract.xml +++ b/xml/System.AddIn.Contract.Automation/IRemoteDelegateContract.xml @@ -21,13 +21,13 @@ Defines a contract that components can use to access a delegate across application domain and process boundaries. - method. - - To add a delegate to an event or remove a delegate from an event, call the method of the that is returned by or . Pass an that represents the delegate to the `parameters` parameter of . - + method. + + To add a delegate to an event or remove a delegate from an event, call the method of the that is returned by or . Pass an that represents the delegate to the `parameters` parameter of . + ]]> diff --git a/xml/System.AddIn.Contract.Automation/IRemoteEventInfoContract.xml b/xml/System.AddIn.Contract.Automation/IRemoteEventInfoContract.xml index 5ce3b1d5058..01a34214eb9 100644 --- a/xml/System.AddIn.Contract.Automation/IRemoteEventInfoContract.xml +++ b/xml/System.AddIn.Contract.Automation/IRemoteEventInfoContract.xml @@ -18,13 +18,13 @@ Defines a contract that components can use to access information about an event across application domain and process boundaries. - provides information about an event of a remote object that implements the interface. - - To access one or more events of a remote object, use the method to get an that represents the type of the remote object. Then, call the or method. - + provides information about an event of a remote object that implements the interface. + + To access one or more events of a remote object, use the method to get an that represents the type of the remote object. Then, call the or method. + ]]> @@ -50,11 +50,11 @@ Returns the method that was used to add an event handler delegate to the event that this identifies. An that represents the method that was used to add an event handler delegate to the event that this identifies. - method of the that returns. Pass an that represents the delegate into the `parameters` parameter of . - + method of the that returns. Pass an that represents the delegate into the `parameters` parameter of . + ]]> @@ -80,11 +80,11 @@ Returns information about the event that this identifies. A that provides information about the event that this identifies. - structure includes the name of the event and the type that declares the event. - + structure includes the name of the event and the type that declares the event. + ]]> @@ -110,11 +110,11 @@ Returns the method that was used to remove an event handler delegate from the event that this identifies. An that represents the method that was used to remove an event handler delegate from the event that this identifies. - method of the that returns. Pass an that represents the delegate into the `parameters` parameter of . - + method of the that returns. Pass an that represents the delegate into the `parameters` parameter of . + ]]> diff --git a/xml/System.AddIn.Contract.Automation/IRemoteFieldInfoContract.xml b/xml/System.AddIn.Contract.Automation/IRemoteFieldInfoContract.xml index dc922b9bdb7..c0f4b24295d 100644 --- a/xml/System.AddIn.Contract.Automation/IRemoteFieldInfoContract.xml +++ b/xml/System.AddIn.Contract.Automation/IRemoteFieldInfoContract.xml @@ -18,13 +18,13 @@ Defines a contract that components can use to access information about a field across application domain and process boundaries. - represents a field of a remote object that implements the interface. - - To access one or more fields of a remote object, use the method to get an that represents the type of the remote object. Then, call the or method. - + represents a field of a remote object that implements the interface. + + To access one or more fields of a remote object, use the method to get an that represents the type of the remote object. Then, call the or method. + ]]> @@ -50,11 +50,11 @@ Returns information about the field that this identifies. A that provides information about the field that this identifies. - structure includes an that specifies the type of the field. - + structure includes an that specifies the type of the field. + ]]> diff --git a/xml/System.AddIn.Contract.Automation/IRemoteMethodInfoContract.xml b/xml/System.AddIn.Contract.Automation/IRemoteMethodInfoContract.xml index a09a9608e05..1c47844146a 100644 --- a/xml/System.AddIn.Contract.Automation/IRemoteMethodInfoContract.xml +++ b/xml/System.AddIn.Contract.Automation/IRemoteMethodInfoContract.xml @@ -23,7 +23,7 @@ ## Remarks An represents a method of a remote object that implements the interface. - To access one or more methods of a remote object, use the method to get an that represents the type of the remote object. Then, call the or method. + To access one or more methods of a remote object, use the method to get an that represents the type of the remote object. Then, call the or method. ]]> @@ -92,7 +92,7 @@ returns a default in which the property is set to the value and the property is set to the value . + If the invoked method does not have a return value (for example, the method is a constructor), returns a default in which the property is set to the value and the property is set to the value . ]]> diff --git a/xml/System.AddIn.Contract.Automation/IRemoteObjectContract.xml b/xml/System.AddIn.Contract.Automation/IRemoteObjectContract.xml index 09b2f17ed9b..cf3f11d2363 100644 --- a/xml/System.AddIn.Contract.Automation/IRemoteObjectContract.xml +++ b/xml/System.AddIn.Contract.Automation/IRemoteObjectContract.xml @@ -18,11 +18,11 @@ Defines a contract that components can use to access an object across application domain and process boundaries. - on a type, components can use the contract to access type information for objects of the type. Components access type information by calling the method to obtain an . The interface defines a contract that components can use to access specific type and member information, and to invoke members. - + on a type, components can use the contract to access type information for objects of the type. Components access type information by calling the method to obtain an . The interface defines a contract that components can use to access specific type and member information, and to invoke members. + ]]> @@ -48,11 +48,11 @@ Returns an that specifies the type of the current . An that specifies the type of the current . - method to access the members of the remote object that the current identifies. - + method to access the members of the remote object that the current identifies. + ]]> @@ -81,15 +81,15 @@ Casts the object identified by the current to a specified type. A that represents the result of the cast operation. - , \<*fully qualified type name*> are recommended. An example of the recommended format of a canonical name is "ShapeApp, Microsoft.VisualStudio.Tools.Applications.Samples.ShapeApp.Application". - - The canonical name for a type cannot change after a type is published in a component. Changing the canonical name of a type in a future version of a component breaks compatibility between the component and clients that are already using the type. - - It is recommended that implementations throw an if the cast operation fails. - + , \<*fully qualified type name*> are recommended. An example of the recommended format of a canonical name is "ShapeApp, Microsoft.VisualStudio.Tools.Applications.Samples.ShapeApp.Application". + + The canonical name for a type cannot change after a type is published in a component. Changing the canonical name of a type in a future version of a component breaks compatibility between the component and clients that are already using the type. + + It is recommended that implementations throw an if the cast operation fails. + ]]> diff --git a/xml/System.AddIn.Contract.Automation/IRemotePropertyInfoContract.xml b/xml/System.AddIn.Contract.Automation/IRemotePropertyInfoContract.xml index 6c7993ab230..bc4f0d6e766 100644 --- a/xml/System.AddIn.Contract.Automation/IRemotePropertyInfoContract.xml +++ b/xml/System.AddIn.Contract.Automation/IRemotePropertyInfoContract.xml @@ -18,13 +18,13 @@ Defines a contract that components can use to access information about a property across application domain and process boundaries. - represents a property of a remote object that implements the interface. - - To access one or more properties of a remote object, use the method to get an that represents the type of the remote object. Then, call the or method. - + represents a property of a remote object that implements the interface. + + To access one or more properties of a remote object, use the method to get an that represents the type of the remote object. Then, call the or method. + ]]> @@ -73,11 +73,11 @@ Returns information about the property that this identifies. A that provides information about the property that this identifies. - structure includes the type of the property value and whether the property is readable or writable. - + structure includes the type of the property value and whether the property is readable or writable. + ]]> @@ -135,11 +135,11 @@ Returns the value of the property that this identifies. A that specifies the property value. - implementations throw an if the property is write-only. - + implementations throw an if the property is write-only. + ]]> @@ -175,11 +175,11 @@ The locale ID that the property will use for any locale-specific type conversions. Sets the value of the property that this identifies. - implementations throw an if the property is read-only. - + implementations throw an if the property is read-only. + ]]> diff --git a/xml/System.AddIn.Contract.Automation/IRemoteTypeContract.xml b/xml/System.AddIn.Contract.Automation/IRemoteTypeContract.xml index 0ebf1212416..92c057fb7cf 100644 --- a/xml/System.AddIn.Contract.Automation/IRemoteTypeContract.xml +++ b/xml/System.AddIn.Contract.Automation/IRemoteTypeContract.xml @@ -18,17 +18,17 @@ Defines a contract that components can use to access type information and invoke members across application domain and process boundaries. - , components can call the method of an object that implements the interface. - - To get information about the type of an object, components call the method. - - To get information about the members of an object, components call one of the methods that returns information about a particular kind of member. For example, to get information about the events of an object, components can use the or method. - - To invoke a member of an object, components use the method. - + , components can call the method of an object that implements the interface. + + To get information about the type of an object, components call the method. + + To get information about the members of an object, components call one of the methods that returns information about a particular kind of member. For example, to get information about the events of an object, components can use the or method. + + To invoke a member of an object, components use the method. + ]]> @@ -54,13 +54,13 @@ Returns the canonical name of the current . The canonical name of the current . - , \<*fully qualified type name*> are recommended for managed types. Strings in the format \<*type library name*>, \<*type name*> are recommended for COM types. - - Do not change the canonical name for a type after the type is published. Changing the canonical name for a type in a future version of a component breaks compatibility between the component and clients that are already using the type. - + , \<*fully qualified type name*> are recommended for managed types. Strings in the format \<*type library name*>, \<*type name*> are recommended for COM types. + + Do not change the canonical name for a type after the type is published. Changing the canonical name for a type in a future version of a component breaks compatibility between the component and clients that are already using the type. + ]]> @@ -197,13 +197,13 @@ Returns an interface that is implemented by the current . An that represents the interface with the specified canonical name that this implements. if this does not implement an interface with the specified canonical name. - , \<*fully qualified type name*> are recommended for managed types. Strings in the format \<*type library name*>, \<*type name*> are recommended for COM types. - - Do not change the canonical name for a type after the type is published. Changing the canonical name for a type in a future version of a component breaks compatibility between the component and clients that are already using the type. - + , \<*fully qualified type name*> are recommended for managed types. Strings in the format \<*type library name*>, \<*type name*> are recommended for COM types. + + Do not change the canonical name for a type after the type is published. Changing the canonical name for a type in a future version of a component breaks compatibility between the component and clients that are already using the type. + ]]> @@ -259,11 +259,11 @@ Returns a collection of objects that provides access to all the specified members of the specified member type in the current , using the specified binding constraints. An of objects that represent the members of the current that have the specified name and that meet the criteria specified by the and parameters. - @@ -465,13 +465,13 @@ Invokes the specified member of the current . A that represents the return value of the invoked member. - diff --git a/xml/System.AddIn.Contract.Automation/RemoteTypeData.xml b/xml/System.AddIn.Contract.Automation/RemoteTypeData.xml index 936e0c86bc3..cdae18bcdd2 100644 --- a/xml/System.AddIn.Contract.Automation/RemoteTypeData.xml +++ b/xml/System.AddIn.Contract.Automation/RemoteTypeData.xml @@ -26,7 +26,7 @@ structure provides information about an object that implements the interface. To get type information about a remote object, components call the method to obtain an . Then, components call the method to get a . + The structure provides information about an object that implements the interface. To get type information about a remote object, components call the method to obtain an . Then, components call the method to get a . ]]> diff --git a/xml/System.AddIn.Contract.Collections/IArrayContract`1.xml b/xml/System.AddIn.Contract.Collections/IArrayContract`1.xml index 38a8be3a1dc..30a6b2a7aea 100644 --- a/xml/System.AddIn.Contract.Collections/IArrayContract`1.xml +++ b/xml/System.AddIn.Contract.Collections/IArrayContract`1.xml @@ -29,13 +29,13 @@ The type of elements in the array. must implement the interface. Represents a generic array of objects. - to pass an array of objects between contracts by reference. - - An does not dynamically resize itself. - + to pass an array of objects between contracts by reference. + + An does not dynamically resize itself. + ]]> @@ -88,10 +88,10 @@ The element at the specified index. To be added. - is less than zero. - - -or- - + is less than zero. + + -or- + is equal to or greater than the return value of . @@ -121,10 +121,10 @@ Replaces the element at the specified index with the specified . To be added. - is less than zero. - - -or- - + is less than zero. + + -or- + is equal to or greater than the return value of . diff --git a/xml/System.AddIn.Contract.Collections/ICollectionContract`1.xml b/xml/System.AddIn.Contract.Collections/ICollectionContract`1.xml index b5595d712e9..07b2c8489c3 100644 --- a/xml/System.AddIn.Contract.Collections/ICollectionContract`1.xml +++ b/xml/System.AddIn.Contract.Collections/ICollectionContract`1.xml @@ -32,7 +32,7 @@ can be dynamically resized. + An can be dynamically resized. ]]> @@ -64,7 +64,7 @@ is read-only, call the method. + To determine whether an is read-only, call the method. ]]> @@ -94,7 +94,7 @@ is read-only, call the method. + To determine whether an is read-only, call the method. ]]> @@ -244,7 +244,7 @@ is read-only, call the method. + To determine whether an is read-only, call the method. ]]> diff --git a/xml/System.AddIn.Contract.Collections/IEnumeratorContract`1.xml b/xml/System.AddIn.Contract.Collections/IEnumeratorContract`1.xml index 592ccb5e312..b50d5833046 100644 --- a/xml/System.AddIn.Contract.Collections/IEnumeratorContract`1.xml +++ b/xml/System.AddIn.Contract.Collections/IEnumeratorContract`1.xml @@ -31,11 +31,11 @@ ## Remarks Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection. - Initially, the enumerator is positioned before the first element in the collection. At this position, the return value of is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before calling . + Initially, the enumerator is positioned before the first element in the collection. At this position, the return value of is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before calling . - returns the same object until is called. sets the return value of to the next element. + returns the same object until is called. sets the return value of to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, the return value of is undefined. + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, the return value of is undefined. An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and its behavior is undefined. @@ -67,15 +67,15 @@ is undefined under any of the following conditions: + The return value of is undefined under any of the following conditions: -- The enumerator is positioned before the first element in the collection, immediately after the enumerator is created or after is called. must be called to advance the enumerator to the first element of the collection before calling . +- The enumerator is positioned before the first element in the collection, immediately after the enumerator is created or after is called. must be called to advance the enumerator to the first element of the collection before calling . -- The last call to returned `false`, which indicates the end of the collection. +- The last call to returned `false`, which indicates the end of the collection. - The enumerator is invalidated due to changes made in the collection, such as adding, modifying, or deleting elements. - returns the same object until is called. sets the return value of to the next element. + returns the same object until is called. sets the return value of to the next element. ]]> @@ -106,11 +106,11 @@ method is called, an enumerator is positioned before the first element of the collection. The first call to the method moves the enumerator to the first element of the collection. + After an enumerator is created or after the method is called, an enumerator is positioned before the first element of the collection. The first call to the method moves the enumerator to the first element of the collection. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false` until is called. + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false` until is called. - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . ]]> @@ -140,7 +140,7 @@ or throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . ]]> diff --git a/xml/System.AddIn.Contract.Collections/IListContract`1.xml b/xml/System.AddIn.Contract.Collections/IListContract`1.xml index 8bf78e7849a..1ce3710dffc 100644 --- a/xml/System.AddIn.Contract.Collections/IListContract`1.xml +++ b/xml/System.AddIn.Contract.Collections/IListContract`1.xml @@ -58,18 +58,18 @@ Returns the element at the specified index. The element at the specified index. - method does not remove the element at the specified index. To remove an element from the , use the method. - + method does not remove the element at the specified index. To remove an element from the , use the method. + ]]> - is less than zero. - - -or- - + is less than zero. + + -or- + is equal to or greater than the return value of . @@ -124,20 +124,20 @@ The to insert in the . Inserts an element in the at the specified index. - , the elements that follow the insertion point move to accommodate the new element. The indexes of the elements that are moved are also updated. To replace an element at a specified index, use the method. - - To determine whether an is read-only, call the method. - + , the elements that follow the insertion point move to accommodate the new element. The indexes of the elements that are moved are also updated. To replace an element at a specified index, use the method. + + To determine whether an is read-only, call the method. + ]]> - is less than zero. - - -or- - + is less than zero. + + -or- + is equal to or greater than the return value of . The is read-only. @@ -165,20 +165,20 @@ The index of the element to remove. Removes the element at the specified index. - , the elements that follow the removed element move to occupy the vacated spot. The indexes of the elements that are moved are also updated. - - To determine whether an is read-only, call the method. - + , the elements that follow the removed element move to occupy the vacated spot. The indexes of the elements that are moved are also updated. + + To determine whether an is read-only, call the method. + ]]> - is less than zero. - - -or- - + is less than zero. + + -or- + is equal to or greater than the return value of . The is read-only. @@ -208,20 +208,20 @@ The element to set at the specified index. Replaces the element at the specified index. - method replaces the element at the specified index. To add an element to the , use the method. - - To determine whether an is read-only, call the method. - + method replaces the element at the specified index. To add an element to the , use the method. + + To determine whether an is read-only, call the method. + ]]> - is less than zero. - - -or- - + is less than zero. + + -or- + is equal to or greater than the return value of . The is read-only. diff --git a/xml/System.AddIn.Contract.Collections/IRemoteArgumentDictionaryEnumeratorContract.xml b/xml/System.AddIn.Contract.Collections/IRemoteArgumentDictionaryEnumeratorContract.xml index d78342a5a8f..b87a714eedf 100644 --- a/xml/System.AddIn.Contract.Collections/IRemoteArgumentDictionaryEnumeratorContract.xml +++ b/xml/System.AddIn.Contract.Collections/IRemoteArgumentDictionaryEnumeratorContract.xml @@ -21,11 +21,11 @@ Enumerates the elements of an . - , use the method of an . - + , use the method of an . + ]]> @@ -51,15 +51,15 @@ Returns the key and the value of the current entry. A that contains the key and the value of the current entry. - method is called, the method must be called to advance the enumerator to the first element of the collection before calling the method; otherwise, the return value of is undefined. - - also throws an exception if the last call to returned `false`, which indicates the end of the collection. - - does not move the position of the enumerator, and consecutive calls to return the same object until either or is called. - + method is called, the method must be called to advance the enumerator to the first element of the collection before calling the method; otherwise, the return value of is undefined. + + also throws an exception if the last call to returned `false`, which indicates the end of the collection. + + does not move the position of the enumerator, and consecutive calls to return the same object until either or is called. + ]]> The is positioned before the first entry of the or after the last entry. @@ -86,15 +86,15 @@ Returns the key of the current entry. A that contains the key of the current entry. - method is called, the method must be called to advance the enumerator to the first element of the collection before calling the method; otherwise, the return value of is undefined. - - also throws an exception if the last call to returned `false`, which indicates the end of the collection. - - does not move the position of the enumerator, and consecutive calls to return the same object until either or is called. - + method is called, the method must be called to advance the enumerator to the first element of the collection before calling the method; otherwise, the return value of is undefined. + + also throws an exception if the last call to returned `false`, which indicates the end of the collection. + + does not move the position of the enumerator, and consecutive calls to return the same object until either or is called. + ]]> The is positioned before the first entry of the or after the last entry. @@ -121,15 +121,15 @@ Returns the value of the current entry. A that contains the value of the current entry. - method is called, the method must be called to advance the enumerator to the first element of the collection before calling the method; otherwise, the return value of is undefined. - - also throws an exception if the last call to returned `false`, which indicates the end of the collection. - - does not move the position of the enumerator, and consecutive calls to return the same object until either or is called. - + method is called, the method must be called to advance the enumerator to the first element of the collection before calling the method; otherwise, the return value of is undefined. + + also throws an exception if the last call to returned `false`, which indicates the end of the collection. + + does not move the position of the enumerator, and consecutive calls to return the same object until either or is called. + ]]> The is positioned before the first entry of the or after the last entry. diff --git a/xml/System.AddIn.Contract.Collections/IRemoteArgumentEnumeratorContract.xml b/xml/System.AddIn.Contract.Collections/IRemoteArgumentEnumeratorContract.xml index 88d24da257c..d734c9ff8ad 100644 --- a/xml/System.AddIn.Contract.Collections/IRemoteArgumentEnumeratorContract.xml +++ b/xml/System.AddIn.Contract.Collections/IRemoteArgumentEnumeratorContract.xml @@ -23,11 +23,11 @@ ## Remarks Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection. - Initially, the enumerator is positioned before the first element in the collection. At this position, the return value of is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before calling . + Initially, the enumerator is positioned before the first element in the collection. At this position, the return value of is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before calling . - returns the same object until is called. sets the return value of to the next element. + returns the same object until is called. sets the return value of to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, the return value of is undefined. + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, the return value of is undefined. An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and its behavior is undefined. @@ -59,15 +59,15 @@ is undefined under any of the following conditions: + The return value of is undefined under any of the following conditions: -- The enumerator is positioned before the first element in the collection, immediately after the enumerator is created or is called. must be called to advance the enumerator to the first element of the collection before calling . +- The enumerator is positioned before the first element in the collection, immediately after the enumerator is created or is called. must be called to advance the enumerator to the first element of the collection before calling . -- The last call to returned `false`, which indicates the end of the collection. +- The last call to returned `false`, which indicates the end of the collection. - The enumerator is invalidated due to changes made in the collection, such as adding, modifying, or deleting elements. - returns the same object until is called. sets the return value of to the next element. + returns the same object until is called. sets the return value of to the next element. ]]> @@ -98,11 +98,11 @@ method is called, an enumerator is positioned before the first element of the collection. The first call to the method moves the enumerator to the first element of the collection. + After an enumerator is created or after the method is called, an enumerator is positioned before the first element of the collection. The first call to the method moves the enumerator to the first element of the collection. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false` until is called. + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false` until is called. - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . ]]> @@ -132,9 +132,9 @@ , the value of is undefined. Call the method to move the enumerator to the first element of the collection. + After you call , the value of is undefined. Call the method to move the enumerator to the first element of the collection. - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . ]]> diff --git a/xml/System.AddIn.Contract/IContract.xml b/xml/System.AddIn.Contract/IContract.xml index fed93ddeb76..15758c9bea9 100644 --- a/xml/System.AddIn.Contract/IContract.xml +++ b/xml/System.AddIn.Contract/IContract.xml @@ -14,11 +14,11 @@ Represents the base interface for all contracts that are used for communication between components that are updated independently. - interface defines a contract that independently updated components, such as an application and an add-in, can use to communicate. Components can use to communicate across process or application domain boundaries, or to communicate with other components in the same process or application domain. serves a similar purpose for components created using the .NET Framework as the `IUnknown` interface serves for components created using COM. To determine whether an object implements a particular contract, use the method. - + interface defines a contract that independently updated components, such as an application and an add-in, can use to communicate. Components can use to communicate across process or application domain boundaries, or to communicate with other components in the same process or application domain. serves a similar purpose for components created using the .NET Framework as the `IUnknown` interface serves for components created using COM. To determine whether an object implements a particular contract, use the method. + ]]> @@ -44,13 +44,13 @@ Specifies that the contract is accessible to a client until the client revokes the contract. A value, also known as a lifetime token, that identifies the client that has acquired the contract. - call the method to notify the object that the client requires access to the contract. An is guaranteed to be usable as long as at least one lifetime token that it passed to a client has not been revoked. - - To revoke a contract, clients call the method. - + call the method to notify the object that the client requires access to the contract. An is guaranteed to be usable as long as at least one lifetime token that it passed to a client has not been revoked. + + To revoke a contract, clients call the method. + ]]> @@ -102,13 +102,13 @@ Returns a contract that is implemented by this contract. An that represents a contract that a client is requesting from the current contract; if the current contract does not support the contract that is requested. - method enables objects to expose other contracts. serves a purpose similar to that of the `IUnknown.QueryInterface` method in COM. - - The format of the strings used to identify contracts is defined by the implementation. It is recommended that you use the of the contract that is being queried. - + method enables objects to expose other contracts. serves a purpose similar to that of the `IUnknown.QueryInterface` method in COM. + + The format of the strings used to identify contracts is defined by the implementation. It is recommended that you use the of the contract that is being queried. + ]]> @@ -186,13 +186,13 @@ A value, also known as a lifetime token, that identifies the client that is revoking the contract. Specifies that the contract is no longer accessible to a client. - call the method to notify the object that the client no longer needs the contract. An is guaranteed to be usable as long as at least one lifetime token that it passed to a client has not been revoked. - - To acquire a contract, clients call the method. - + call the method to notify the object that the client no longer needs the contract. An is guaranteed to be usable as long as at least one lifetime token that it passed to a client has not been revoked. + + To acquire a contract, clients call the method. + ]]> diff --git a/xml/System.AddIn.Contract/IEnumeratorContract`1.xml b/xml/System.AddIn.Contract/IEnumeratorContract`1.xml index bca9feb28b0..87ec7ff4e11 100644 --- a/xml/System.AddIn.Contract/IEnumeratorContract`1.xml +++ b/xml/System.AddIn.Contract/IEnumeratorContract`1.xml @@ -27,11 +27,11 @@ ## Remarks Enumerators can be used to read the data in the collection, but they cannot be used to modify the collection. - Initially, the enumerator is positioned before the first element in the collection. At this position, the return value of is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before calling . + Initially, the enumerator is positioned before the first element in the collection. At this position, the return value of is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before calling . - returns the same object until is called. sets the return value of to the next element. + returns the same object until is called. sets the return value of to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, the return value of is undefined. + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, the return value of is undefined. An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and its behavior is undefined. @@ -63,15 +63,15 @@ is undefined under any of the following conditions: + The return value of is undefined under any of the following conditions: -- The enumerator is positioned before the first element in the collection, immediately after the enumerator is created or after is called. must be called to advance the enumerator to the first element of the collection before calling . +- The enumerator is positioned before the first element in the collection, immediately after the enumerator is created or after is called. must be called to advance the enumerator to the first element of the collection before calling . -- The last call to returned `false`, which indicates the end of the collection. +- The last call to returned `false`, which indicates the end of the collection. - The enumerator is invalidated due to changes made in the collection, such as adding, modifying, or deleting elements. - returns the same object until is called. sets the return value of to the next element. + returns the same object until is called. sets the return value of to the next element. ]]> @@ -102,11 +102,11 @@ method is called, an enumerator is positioned before the first element of the collection. The first call to the method moves the enumerator to the first element of the collection. + After an enumerator is created or after the method is called, an enumerator is positioned before the first element of the collection. The first call to the method moves the enumerator to the first element of the collection. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false` until is called. + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false` until is called. - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . ]]> @@ -136,7 +136,7 @@ or throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . ]]> diff --git a/xml/System.AddIn.Contract/IListContract`1.xml b/xml/System.AddIn.Contract/IListContract`1.xml index 2fb1adb325c..d296529dca8 100644 --- a/xml/System.AddIn.Contract/IListContract`1.xml +++ b/xml/System.AddIn.Contract/IListContract`1.xml @@ -25,7 +25,7 @@ class uses an interface to pass collections, in both directions, between the host and the add-in. It is recommended that you use the class instead of using this class directly in your code. For an example, see [Walkthrough: Passing Collections Between Hosts and Add-Ins](/previous-versions/dotnet/netframework-4.0/bb384207(v=vs.100)). + The class uses an interface to pass collections, in both directions, between the host and the add-in. It is recommended that you use the class instead of using this class directly in your code. For an example, see [Walkthrough: Passing Collections Between Hosts and Add-Ins](/previous-versions/dotnet/netframework-4.0/bb384207(v=vs.100)). This class can be used to pass objects by reference between application domains because the objects are not serialized. @@ -211,7 +211,7 @@ method does not remove the item at the specified index. To remove an item from the collection, use the method. + The method does not remove the item at the specified index. To remove an item from the collection, use the method. ]]> @@ -252,7 +252,7 @@ ## Remarks If there are several objects of the same type in the collection, this method identifies the index of the item that is the first occurrence of the specified type in the collection. - The method does not remove the item at the specified index. To remove an item from the collection, use the method. + The method does not remove the item at the specified index. To remove an item from the collection, use the method. ]]> @@ -286,9 +286,9 @@ method, the items that follow the insertion point move to accommodate the new item. The indexes of the items that are moved are also updated. To replace an item at a specified index, use the method. + After you call the method, the items that follow the insertion point move to accommodate the new item. The indexes of the items that are moved are also updated. To replace an item at a specified index, use the method. - To determine whether an collection is read-only, call the method. + To determine whether an collection is read-only, call the method. ]]> @@ -361,9 +361,9 @@ , the items that follow the removed item move to occupy the vacated spot. The indexes of the items that are moved are also updated. + After you call , the items that follow the removed item move to occupy the vacated spot. The indexes of the items that are moved are also updated. - To determine whether an collection is read-only, call the method. + To determine whether an collection is read-only, call the method. ]]> @@ -404,9 +404,9 @@ method sets the item at the specified index. To add an item to the collection, use the method. + The method sets the item at the specified index. To add an item to the collection, use the method. - To determine whether an collection is read-only, call the method. + To determine whether an collection is read-only, call the method. ]]> diff --git a/xml/System.AddIn.Contract/IProfferServiceContract.xml b/xml/System.AddIn.Contract/IProfferServiceContract.xml index c49b6f5fbec..32c9140ef4e 100644 --- a/xml/System.AddIn.Contract/IProfferServiceContract.xml +++ b/xml/System.AddIn.Contract/IProfferServiceContract.xml @@ -18,13 +18,13 @@ Enables clients to provide custom services to components on which the contract is implemented. - to enable clients to offer services to the component. After a service has been offered to a component, other clients of the component can access the service. Components typically implement on the same type on which they implement . - - Clients use the method to add an to the set of service providers offered by a component. Clients use the method to remove an from the set of service providers offered by a component. - + to enable clients to offer services to the component. After a service has been offered to a component, other clients of the component can access the service. Components typically implement on the same type on which they implement . + + Clients use the method to add an to the set of service providers offered by a component. Clients use the method to remove an from the set of service providers offered by a component. + ]]> @@ -54,11 +54,11 @@ An that implements the service being offered. Adds a service to the set of services that can be accessed by clients of a component. - implementation. A uniform resource identifier (URI) is the recommended identifier. - + implementation. A uniform resource identifier (URI) is the recommended identifier. + ]]> @@ -86,11 +86,11 @@ A string that identifies the service being revoked. Removes a service from the set of services offered by a component. - implementation. A uniform resource identifier (URI) is the recommended identifier. - + implementation. A uniform resource identifier (URI) is the recommended identifier. + ]]> diff --git a/xml/System.AddIn.Contract/IServiceProviderContract.xml b/xml/System.AddIn.Contract/IServiceProviderContract.xml index d65978d5862..e763015c312 100644 --- a/xml/System.AddIn.Contract/IServiceProviderContract.xml +++ b/xml/System.AddIn.Contract/IServiceProviderContract.xml @@ -21,7 +21,7 @@ interface defines a contract that enables a component to obtain a custom service that is defined by another component. A component that implements is known as a service provider. Service providers implement the method to return an that implements a service. + The interface defines a contract that enables a component to obtain a custom service that is defined by another component. A component that implements is known as a service provider. Service providers implement the method to return an that implements a service. ]]> diff --git a/xml/System.AddIn.Contract/RemoteArgument.xml b/xml/System.AddIn.Contract/RemoteArgument.xml index f143cedfac3..825c14b68ae 100644 --- a/xml/System.AddIn.Contract/RemoteArgument.xml +++ b/xml/System.AddIn.Contract/RemoteArgument.xml @@ -40,7 +40,7 @@ An intrinsic data type is a primitive data type (that is, the property of the type is `true`) or a , , , or . - provides constructors for each of the types that it supports. You can also use the methods to create objects. The methods automatically call the appropriate constructor for your argument type. + provides constructors for each of the types that it supports. You can also use the methods to create objects. The methods automatically call the appropriate constructor for your argument type. If you create a using the default parameterless constructor, the property is set to the value and the property is set to the value . @@ -1503,7 +1503,7 @@ constructor that applies to the type of the `value` parameter. + This method calls the constructor that applies to the type of the `value` parameter. ]]> @@ -1554,7 +1554,7 @@ constructor that applies to the type of the `value` parameter. + This method calls the constructor that applies to the type of the `value` parameter. ]]> @@ -1607,7 +1607,7 @@ constructor that applies to the type of the `value` parameter. + This method calls the constructor that applies to the type of the `value` parameter. You cannot use this method to create a that represents a `null` array that contains elements of intrinsic data types. An intrinsic data type is a primitive data type (that is, the property of the type is `true`) or a , , , or . diff --git a/xml/System.AddIn.Contract/SerializableObjectData.xml b/xml/System.AddIn.Contract/SerializableObjectData.xml index 49ecf81cce7..0fb3de81a50 100644 --- a/xml/System.AddIn.Contract/SerializableObjectData.xml +++ b/xml/System.AddIn.Contract/SerializableObjectData.xml @@ -23,15 +23,15 @@ Provides information about a serializable object. - structure contains data that can be used to deserialize a serializable object. - - To get a , call the method of an . - - The only field that contains a value for every serializable object is the field. - + structure contains data that can be used to deserialize a serializable object. + + To get a , call the method of an . + + The only field that contains a value for every serializable object is the field. + ]]> @@ -55,11 +55,11 @@ Represents an array that contains the length of each of the dimensions of the serializable array that this describes. - is `null` if is `false`. - + is `null` if is `false`. + ]]> @@ -83,11 +83,11 @@ Represents an array that contains the lower bound of each of the dimensions of the serializable array that this describes. - is `null` if is `false`. - + is `null` if is `false`. + ]]> @@ -111,11 +111,11 @@ Represents an array that contains the indexes of the parent array that contains the serializable object that this describes. - is `null` if is `false`. - + is `null` if is `false`. + ]]> @@ -139,13 +139,13 @@ Indicates whether the describes a serializable array. - is `true` if the describes an array; otherwise, is `false`. - - If and are both `true`, the describes a jagged array. - + is `true` if the describes an array; otherwise, is `false`. + + If and are both `true`, the describes a jagged array. + ]]> @@ -169,15 +169,15 @@ Indicates whether the describes an element in a serializable array. - is `true` if the describes an element in an array; otherwise, is `false`. - - If is `true`, then identifies the array, and is `null`. - - If and are both `true`, the describes a jagged array. - + is `true` if the describes an element in an array; otherwise, is `false`. + + If is `true`, then identifies the array, and is `null`. + + If and are both `true`, the describes a jagged array. + ]]> @@ -201,11 +201,11 @@ Represents the member name of the serializable object that this describes. - is `null` if the describes an object that is not a member of another object (that is, is `null`). - + is `null` if the describes an object that is not a member of another object (that is, is `null`). + ]]> @@ -229,11 +229,11 @@ Represents the ID of the serializable object that this describes. - can use the class. - + can use the class. + ]]> @@ -257,11 +257,11 @@ Represents the ID of the parent of the serializable object that this describes. - is `null` if the describes a serializable object that is not a member of another object. - + is `null` if the describes a serializable object that is not a member of another object. + ]]> diff --git a/xml/System.AddIn.Hosting/AddInController.xml b/xml/System.AddIn.Hosting/AddInController.xml index 4dd34d4ca19..5d7ddfc2dec 100644 --- a/xml/System.AddIn.Hosting/AddInController.xml +++ b/xml/System.AddIn.Hosting/AddInController.xml @@ -28,9 +28,9 @@ - Use the property to obtain an object that represents an add-in. -- Shut down an add-in with the method. +- Shut down an add-in with the method. - To obtain the controller for an add-in, call the method and pass an instance of the add-in as its parameter. + To obtain the controller for an add-in, call the method and pass an instance of the add-in as its parameter. @@ -145,7 +145,7 @@ methods return an object that represents the host's view of the add-in. + The methods return an object that represents the host's view of the add-in. ]]> @@ -180,9 +180,9 @@ or methods, the method also unloads the application domain. + This method breaks the communication pipeline between an add-in and its host. If the add-in was activated in an automatically generated application domain by using the or methods, the method also unloads the application domain. - If the add-in was loaded into its own application domain, the method also unloads the application domain. + If the add-in was loaded into its own application domain, the method also unloads the application domain. If the add-in was loaded into an existing application domain, the host and pipeline segments will no longer have any references to that add-in. In this case, the add-in will be eligible to be reclaimed by garbage collection. diff --git a/xml/System.AddIn.Hosting/AddInEnvironment.xml b/xml/System.AddIn.Hosting/AddInEnvironment.xml index ebd02a44cc1..16d1ab184cb 100644 --- a/xml/System.AddIn.Hosting/AddInEnvironment.xml +++ b/xml/System.AddIn.Hosting/AddInEnvironment.xml @@ -32,9 +32,9 @@ After you obtain the object, you can do the following: -- Pass that object to the appropriate method overload. The add-in will be activated in the application domain and process that is represented by the object. +- Pass that object to the appropriate method overload. The add-in will be activated in the application domain and process that is represented by the object. -- Use the property to obtain an object. Then pass that object to the appropriate method overload. The add-in will be activated in the process that is represented by the object but in a new application domain. +- Use the property to obtain an object. Then pass that object to the appropriate method overload. The add-in will be activated in the process that is represented by the object but in a new application domain. ]]> @@ -104,9 +104,9 @@ ## Remarks You can use this property to activate multiple add-ins in the same process but in different domains. - Pass the object obtained with this property to the appropriate method overload. + Pass the object obtained with this property to the appropriate method overload. - If you want to activate them in the same domain in an external process you should pass the object directly to the method overload. + If you want to activate them in the same domain in an external process you should pass the object directly to the method overload. ]]> diff --git a/xml/System.AddIn.Hosting/AddInProcess.xml b/xml/System.AddIn.Hosting/AddInProcess.xml index 025b7e6aae1..5e3180fdb27 100644 --- a/xml/System.AddIn.Hosting/AddInProcess.xml +++ b/xml/System.AddIn.Hosting/AddInProcess.xml @@ -20,9 +20,9 @@ object to the appropriate method overload. + To activate an add-in in an external process, pass an object to the appropriate method overload. - The executable that runs the add-in is obtained from one of two files installed with the .NET Framework under the Windows directory. By default, the executable that matches the bits-per-word of the host application is used. If the host is a 64-bit process, AddInProcess.exe is run; otherwise, AddInProcess32.exe is run. To specify the way the executable is selected, use the constructor to create the object. + The executable that runs the add-in is obtained from one of two files installed with the .NET Framework under the Windows directory. By default, the executable that matches the bits-per-word of the host application is used. If the host is a 64-bit process, AddInProcess.exe is run; otherwise, AddInProcess32.exe is run. To specify the way the executable is selected, use the constructor to create the object. @@ -75,7 +75,7 @@ constructor with the flag, to specify that the process that runs the add-in will have the same bits-per-word as the host process. + This constructor has the same effect as using the constructor with the flag, to specify that the process that runs the add-in will have the same bits-per-word as the host process. ]]> @@ -151,7 +151,7 @@ or method throws an . + If the value of this property is `true`, the add-in is running in-process with the host application. In that case, using the or method throws an . > [!NOTE] > The property returns an object that represents the host application process if the add-in is running in-process. diff --git a/xml/System.AddIn.Hosting/AddInSegmentDirectoryNotFoundException.xml b/xml/System.AddIn.Hosting/AddInSegmentDirectoryNotFoundException.xml index 38abed73806..9d3d7245045 100644 --- a/xml/System.AddIn.Hosting/AddInSegmentDirectoryNotFoundException.xml +++ b/xml/System.AddIn.Hosting/AddInSegmentDirectoryNotFoundException.xml @@ -72,8 +72,8 @@ |Property|Value| |--------------|-----------| -||A null reference (`Nothing` in Visual Basic).| -||The localized error message string.| +||A null reference (`Nothing` in Visual Basic).| +||The localized error message string.| ]]> @@ -112,8 +112,8 @@ |Property|Value| |--------------|-----------| -||A null reference (`Nothing` in Visual Basic).| -||The localized error message string.| +||A null reference (`Nothing` in Visual Basic).| +||The localized error message string.| ]]> @@ -156,8 +156,8 @@ |Property|Value| |--------------|-----------| -||A null reference (`Nothing` in Visual Basic).| -||The localized error message string.| +||A null reference (`Nothing` in Visual Basic).| +||The localized error message string.| ]]> @@ -200,8 +200,8 @@ |Property|Value| |--------------|-----------| -||The inner exception reference.| -||The localized error message string.| +||The inner exception reference.| +||The localized error message string.| ]]> diff --git a/xml/System.AddIn.Hosting/AddInStore.xml b/xml/System.AddIn.Hosting/AddInStore.xml index 499de996f5a..eaf320403e4 100644 --- a/xml/System.AddIn.Hosting/AddInStore.xml +++ b/xml/System.AddIn.Hosting/AddInStore.xml @@ -24,12 +24,12 @@ |Cache file|Methods that create the file| |----------------|----------------------------------| -|PipelineSegments.store

This file is located in the root directory of the pipeline directory structure.|

Updates the file with new pipeline segments. If no new segments are installed, this method just validates the cache.



Rebuilds the file and includes new pipeline segments.| -|AddIns.store

This file is located in a directory that contains one or more add-in subdirectories. If this directory is in the pipeline directory structure, it must be named AddIns.|

Updates the file with new add-ins at a specified location. Call this method if your add-ins are outside the pipeline directory structure.

If no new add-ins are installed, this method just validates the cache.



Rebuilds the file and includes add-ins at a specified location. Call this method if your add-ins are outside the pipeline directory structure.



If the add-ins are in the pipeline directory structure, this method updates the file with new add-ins.



If the add-ins are in the pipeline directory structure, this method rebuilds the file and includes new add-ins.| +|PipelineSegments.store

This file is located in the root directory of the pipeline directory structure.|

Updates the file with new pipeline segments. If no new segments are installed, this method just validates the cache.



Rebuilds the file and includes new pipeline segments.| +|AddIns.store

This file is located in a directory that contains one or more add-in subdirectories. If this directory is in the pipeline directory structure, it must be named AddIns.|

Updates the file with new add-ins at a specified location. Call this method if your add-ins are outside the pipeline directory structure.

If no new add-ins are installed, this method just validates the cache.



Rebuilds the file and includes add-ins at a specified location. Call this method if your add-ins are outside the pipeline directory structure.



If the add-ins are in the pipeline directory structure, this method updates the file with new add-ins.



If the add-ins are in the pipeline directory structure, this method rebuilds the file and includes new add-ins.| These methods create the cache files if they do not previously exist. - After the cache files are created, use the method to examine the files to find all add-ins that match a specified host view of the add-in. You can also use the method to find a specific add-in. + After the cache files are created, use the method to examine the files to find all add-ins that match a specified host view of the add-in. You can also use the method to find a specific add-in. > [!IMPORTANT] > It is unsupported to allow untrusted users or entities to access PipelineSegments.store and Addins.store. Doing so can cause data corruption issues for applications. @@ -282,7 +282,7 @@ collection to activate a specific add-in by calling the method of the class. + This method examines the store files of cached add-in and pipeline segment information to find all add-ins that match a specified `hostAddInView` type. You can then use one of the tokens in the returned collection to activate a specific add-in by calling the method of the class. ]]> @@ -391,7 +391,7 @@ ## Remarks This method also rebuilds the add-ins cache if the add-ins are in the pipeline directory structure. - Use this method only when there may be a problem with the cache and it must be rebuilt. For faster performance, use the method. + Use this method only when there may be a problem with the cache and it must be rebuilt. For faster performance, use the method. ]]>
@@ -435,7 +435,7 @@ ## Remarks Call this method if your add-ins are outside the pipeline directory structure. - Use this method only when there may be a problem with the cache and it must be rebuilt. For faster performance, use the method. + Use this method only when there may be a problem with the cache and it must be rebuilt. For faster performance, use the method. ]]>
diff --git a/xml/System.AddIn.Hosting/AddInToken.xml b/xml/System.AddIn.Hosting/AddInToken.xml index a2310b3afd8..6e434ce5ade 100644 --- a/xml/System.AddIn.Hosting/AddInToken.xml +++ b/xml/System.AddIn.Hosting/AddInToken.xml @@ -35,11 +35,11 @@ ## Remarks An object represents an add-in, and its associated pipeline segments, that can be activated. The token contains the name, assembly name, description, publisher, and version of the add-in that it represents. - Use the method to get a collection of tokens that represent add-ins whose pipelines match a specified host view. Use the method to get a collection of tokens that represent all the pipelines for a specified add-in that match a specified host view. + Use the method to get a collection of tokens that represent add-ins whose pipelines match a specified host view. Use the method to get a collection of tokens that represent all the pipelines for a specified add-in that match a specified host view. - To activate an add-in, pass the token that represents the desired add-in to the method. This method returns an instance of the type that represents the host view of the add-in. + To activate an add-in, pass the token that represents the desired add-in to the method. This method returns an instance of the type that represents the host view of the add-in. - The method has several overloads. When you use an overload that does not require the name of an application domain as one of its parameters, a new application domain for the add-in is automatically created. + The method has several overloads. When you use an overload that does not require the name of an application domain as one of its parameters, a new application domain for the add-in is automatically created. You can use Language-Integrated Query (LINQ) extension methods to perform queries on an , treating the token as a collection of structures. @@ -153,7 +153,7 @@ overload. + This method overload loads the add-in into an automatically generated application domain. If you want to specify a name for the new application domain, use the overload. This method sets the base directory for the application domain to be the location of the add-in assembly. It also looks for the configuration file [addinassemblyname].dll.config and, if found, sets it to be the configuration file for the new application domain. @@ -201,7 +201,7 @@ overload to generate a new application domain with a specified security level or the overload to include a friendly name for the application domain. + To activate an add-in in an automatically generated application domain, use the overload to generate a new application domain with a specified security level or the overload to include a friendly name for the application domain. @@ -386,7 +386,7 @@ overload. + If you do not need to specify an application domain name, use the overload. This method sets the base directory for the application domain to be the location of the add-in assembly. It also looks for the configuration file `[addinassemblyname].dll.config` and, if found, sets it to be the configuration file for the new application domain. @@ -422,7 +422,7 @@ ## Examples - The following example displays the value of the , , , , , and properties to the console. This code example is part of a larger example provided for the class. + The following example displays the value of the , , , , , and properties to the console. This code example is part of a larger example provided for the class. :::code language="csharp" source="~/snippets/csharp/System.AddIn.Hosting/AddInController/Overview/P3Host.cs" id="Snippet7"::: :::code language="vb" source="~/snippets/visualbasic/System.AddIn.Hosting/AddInController/Overview/p3host.vb" id="Snippet7"::: @@ -459,7 +459,7 @@ ## Examples - The following example displays the value of the , , , , , and properties to the console. This code example is part of a larger example provided for the class. + The following example displays the value of the , , , , , and properties to the console. This code example is part of a larger example provided for the class. :::code language="csharp" source="~/snippets/csharp/System.AddIn.Hosting/AddInController/Overview/P3Host.cs" id="Snippet7"::: :::code language="vb" source="~/snippets/visualbasic/System.AddIn.Hosting/AddInController/Overview/p3host.vb" id="Snippet7"::: @@ -496,7 +496,7 @@ ## Examples - The following example displays the value of the , , , , , and properties to the console. This code example is part of a larger example provided for the class. + The following example displays the value of the , , , , , and properties to the console. This code example is part of a larger example provided for the class. :::code language="csharp" source="~/snippets/csharp/System.AddIn.Hosting/AddInController/Overview/P3Host.cs" id="Snippet7"::: :::code language="vb" source="~/snippets/visualbasic/System.AddIn.Hosting/AddInController/Overview/p3host.vb" id="Snippet7"::: @@ -679,7 +679,7 @@ ## Examples - The following example displays the value of the , , , , , and properties to the console. This code example is part of a larger example provided for the class. + The following example displays the value of the , , , , , and properties to the console. This code example is part of a larger example provided for the class. :::code language="csharp" source="~/snippets/csharp/System.AddIn.Hosting/AddInController/Overview/P3Host.cs" id="Snippet7"::: :::code language="vb" source="~/snippets/visualbasic/System.AddIn.Hosting/AddInController/Overview/p3host.vb" id="Snippet7"::: @@ -716,7 +716,7 @@ ## Examples - The following example displays the value of the , , , , , and properties to the console. This code example is part of a larger example provided for the class. + The following example displays the value of the , , , , , and properties to the console. This code example is part of a larger example provided for the class. :::code language="csharp" source="~/snippets/csharp/System.AddIn.Hosting/AddInController/Overview/P3Host.cs" id="Snippet7"::: :::code language="vb" source="~/snippets/visualbasic/System.AddIn.Hosting/AddInController/Overview/p3host.vb" id="Snippet7"::: @@ -750,7 +750,7 @@ ## Remarks Use this property to obtain data that has been applied to pipeline segments with the attribute. You can use this data to identify and work with the types that compose your pipelines. - This property returns a dictionary of dictionaries. The top dictionary always has six keys. Each key is an value for a segment in the pipeline. Each value is a generic of strings with string keys that contains the segment's qualification data. + This property returns a dictionary of dictionaries. The top dictionary always has six keys. Each key is an value for a segment in the pipeline. Each value is a generic of strings with string keys that contains the segment's qualification data. The keys and values of these inner dictionaries are the names and values specified in the attributes for the segments. If no qualification data has been applied to a segment, its dictionary is empty. @@ -866,7 +866,7 @@ ## Examples - The following example displays the value of the , , , , , and properties to the console. This code example is part of a larger example provided for the class. + The following example displays the value of the , , , , , and properties to the console. This code example is part of a larger example provided for the class. :::code language="csharp" source="~/snippets/csharp/System.AddIn.Hosting/AddInController/Overview/P3Host.cs" id="Snippet7"::: :::code language="vb" source="~/snippets/visualbasic/System.AddIn.Hosting/AddInController/Overview/p3host.vb" id="Snippet7"::: diff --git a/xml/System.AddIn.Hosting/InvalidPipelineStoreException.xml b/xml/System.AddIn.Hosting/InvalidPipelineStoreException.xml index 9a5fb8ead43..0c7dc5fa61e 100644 --- a/xml/System.AddIn.Hosting/InvalidPipelineStoreException.xml +++ b/xml/System.AddIn.Hosting/InvalidPipelineStoreException.xml @@ -28,7 +28,7 @@ ## Remarks Unlike , this exception does not provide any path information. This prevents a malicious user from deliberately specifying erroneous paths and using the information returned by the exception to determine actual paths. - This exception is thrown by the following discovery methods that build and update the store of add-in and pipeline information: ,, , , and . + This exception is thrown by the following discovery methods that build and update the store of add-in and pipeline information: ,, , , and . ]]> @@ -163,8 +163,8 @@ |Property|Value| |--------------|-----------| -||The inner exception reference.| -||The localized error message string.| +||The inner exception reference.| +||The localized error message string.| ]]> diff --git a/xml/System.AddIn.Hosting/PipelineStoreLocation.xml b/xml/System.AddIn.Hosting/PipelineStoreLocation.xml index b23a265eb86..b3c3e5364b6 100644 --- a/xml/System.AddIn.Hosting/PipelineStoreLocation.xml +++ b/xml/System.AddIn.Hosting/PipelineStoreLocation.xml @@ -22,23 +22,23 @@ Specifies alternative locations for a pipeline store instead of a path to a directory. - class that use this enumeration enable partially trusted hosts, which may not have permission to discover their own location, to find and activate add-ins in their own directory. - - You can use the and method overloads to specify a location for updating or rebuilding the pipeline store, and the method overload to specify a location for finding add-ins. - - - -## Examples - The following example uses the ApplicationBase value to activate an add-in from the pipeline store files, which are located in the host application's directory. - + class that use this enumeration enable partially trusted hosts, which may not have permission to discover their own location, to find and activate add-ins in their own directory. + + You can use the and method overloads to specify a location for updating or rebuilding the pipeline store, and the method overload to specify a location for finding add-ins. + + + +## Examples + The following example uses the ApplicationBase value to activate an add-in from the pipeline store files, which are located in the host application's directory. + :::code language="csharp" source="~/snippets/csharp/System.AddIn.Hosting/AddInController/Overview/P3Host.cs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/System.AddIn.Hosting/AddInController/Overview/p3host.vb" id="Snippet4"::: - + :::code language="vb" source="~/snippets/visualbasic/System.AddIn.Hosting/AddInController/Overview/p3host.vb" id="Snippet4"::: + ]]> diff --git a/xml/System.AddIn.Hosting/QualificationDataItem.xml b/xml/System.AddIn.Hosting/QualificationDataItem.xml index d821c9181c3..36e593c0f9a 100644 --- a/xml/System.AddIn.Hosting/QualificationDataItem.xml +++ b/xml/System.AddIn.Hosting/QualificationDataItem.xml @@ -30,7 +30,7 @@ Use the property to get a nested set of dictionaries that contains structures for the pipeline segments associated with an . - Alternatively, use the method to get an enumerator for the structures of the pipeline segments associated with a token, or simply use a `foreach` statement (`For Each` in Visual Basic) to treat the token as if it were a collection of structures. + Alternatively, use the method to get an enumerator for the structures of the pipeline segments associated with a token, or simply use a `foreach` statement (`For Each` in Visual Basic) to treat the token as if it were a collection of structures. ## Examples The following example lists the qualification data for the pipeline segments associated with each in a collection of tokens. diff --git a/xml/System.AddIn.Pipeline/AddInAdapterAttribute.xml b/xml/System.AddIn.Pipeline/AddInAdapterAttribute.xml index f64ec3e3e07..10a8165609a 100644 --- a/xml/System.AddIn.Pipeline/AddInAdapterAttribute.xml +++ b/xml/System.AddIn.Pipeline/AddInAdapterAttribute.xml @@ -23,21 +23,21 @@ Identifies an object as an add-in-side adapter segment of the pipeline. - and methods, which maintain the store of information about available pipeline segments, use this attribute to identify an add-in-side adapter. - - This attribute should be used only on types that activate the segments of the pipeline. Types that represent objects passed between the host and the add-in do not need this attribute. - - - -## Examples - The following example identifies an add-in-side adapter. - + and methods, which maintain the store of information about available pipeline segments, use this attribute to identify an add-in-side adapter. + + This attribute should be used only on types that activate the segments of the pipeline. Types that represent objects passed between the host and the add-in do not need this attribute. + + + +## Examples + The following example identifies an add-in-side adapter. + :::code language="csharp" source="~/snippets/csharp/System.AddIn.Pipeline/AddInAdapterAttribute/Overview/Calc1ViewToContractAddInSideAdapter.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/System.AddIn.Pipeline/AddInAdapterAttribute/Overview/Calc1ViewToContractAddInSideAdapter.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/System.AddIn.Pipeline/AddInAdapterAttribute/Overview/Calc1ViewToContractAddInSideAdapter.vb" id="Snippet2"::: + ]]> Add-Ins and Extensibility diff --git a/xml/System.AddIn.Pipeline/AddInBaseAttribute.xml b/xml/System.AddIn.Pipeline/AddInBaseAttribute.xml index e5eafb69e8f..92712756be1 100644 --- a/xml/System.AddIn.Pipeline/AddInBaseAttribute.xml +++ b/xml/System.AddIn.Pipeline/AddInBaseAttribute.xml @@ -23,23 +23,23 @@ Identifies an object as an add-in view segment of the pipeline. - and methods, which maintain the store of information about available pipeline segments, use this attribute to identify an add-in view. - - To construct the pipeline, the type in the add-in view that the add-in inherits from is identified by the attribute and is called the add-in base. - - This attribute should be used only on types that activate the segments of the pipeline. Types that represent objects passed between the host and the add-in do not need this attribute. - - - -## Examples - The following example identifies the add-in base class for an add-in view pipeline segment. - + and methods, which maintain the store of information about available pipeline segments, use this attribute to identify an add-in view. + + To construct the pipeline, the type in the add-in view that the add-in inherits from is identified by the attribute and is called the add-in base. + + This attribute should be used only on types that activate the segments of the pipeline. Types that represent objects passed between the host and the add-in do not need this attribute. + + + +## Examples + The following example identifies the add-in base class for an add-in view pipeline segment. + :::code language="csharp" source="~/snippets/csharp/System.AddIn.Pipeline/AddInBaseAttribute/Overview/Calc1AddInView.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/System.AddIn.Pipeline/AddInBaseAttribute/Overview/Calc1AddInView.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/System.AddIn.Pipeline/AddInBaseAttribute/Overview/Calc1AddInView.vb" id="Snippet2"::: + ]]> Add-Ins and Extensibility diff --git a/xml/System.AddIn.Pipeline/AddInContractAttribute.xml b/xml/System.AddIn.Pipeline/AddInContractAttribute.xml index cdea6f932c6..1c2cadee256 100644 --- a/xml/System.AddIn.Pipeline/AddInContractAttribute.xml +++ b/xml/System.AddIn.Pipeline/AddInContractAttribute.xml @@ -23,21 +23,21 @@ Identifies an object as a add-in contract segment of the pipeline. - and methods, which maintain the store of information about available pipeline segments, use this attribute to identify a contract. - - This attribute should be used only on types that activate the segments of the pipeline. Types that represent objects passed between the host and the add-in do not need this attribute. - - - -## Examples - The following example identifies a contract. - + and methods, which maintain the store of information about available pipeline segments, use this attribute to identify a contract. + + This attribute should be used only on types that activate the segments of the pipeline. Types that represent objects passed between the host and the add-in do not need this attribute. + + + +## Examples + The following example identifies a contract. + :::code language="csharp" source="~/snippets/csharp/System.AddIn.Pipeline/AddInContractAttribute/Overview/ICalc1Contract.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/System.AddIn.Pipeline/AddInContractAttribute/Overview/ICalc1Contract.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/System.AddIn.Pipeline/AddInContractAttribute/Overview/ICalc1Contract.vb" id="Snippet2"::: + ]]> Add-Ins and Extensibility diff --git a/xml/System.AddIn.Pipeline/CollectionAdapters.xml b/xml/System.AddIn.Pipeline/CollectionAdapters.xml index 4f7a4a6083d..44c3f63c0b5 100644 --- a/xml/System.AddIn.Pipeline/CollectionAdapters.xml +++ b/xml/System.AddIn.Pipeline/CollectionAdapters.xml @@ -20,7 +20,7 @@ collection to be converted to a collection. The collection is passed across the isolation boundary and converted back to an collection that the add-in or the host application can use. + This class provides methods that enable an collection to be converted to a collection. The collection is passed across the isolation boundary and converted back to an collection that the add-in or the host application can use. Objects in collections must be remotable. For more information about the object types that you can pass, see [Contracts, Views, and Adapters](/previous-versions/dotnet/netframework-4.0/bb384205(v=vs.100)). @@ -60,14 +60,14 @@ collection. The collection will have a lifetime token for the remote collection. + The host application or add-in can use the returned collection. The collection will have a lifetime token for the remote collection. - You should use this method overload only when the contents of the are serializable types that can be passed directly to the add-in and host (rather than types that must be adapted into views). + You should use this method overload only when the contents of the are serializable types that can be passed directly to the add-in and host (rather than types that must be adapted into views). ## Examples - The following example implements a host-side adapter pipeline segment as described [Walkthrough: Passing Collections Between Hosts and Add-Ins](/previous-versions/dotnet/netframework-4.0/bb384207(v=vs.100)). The example adapts the custom `ProcessBooks` method by taking the collection passed from the add-in and converting it to an collection, which the host application can then use. + The following example implements a host-side adapter pipeline segment as described [Walkthrough: Passing Collections Between Hosts and Add-Ins](/previous-versions/dotnet/netframework-4.0/bb384207(v=vs.100)). The example adapts the custom `ProcessBooks` method by taking the collection passed from the add-in and converting it to an collection, which the host application can then use. :::code language="csharp" source="~/snippets/csharp/System.AddIn.Pipeline/CollectionAdapters/ToIListT/LibraryManagerViewToContractAddInAdapter.cs" id="Snippet3"::: :::code language="vb" source="~/snippets/visualbasic/System.AddIn.Pipeline/CollectionAdapters/ToIListT/LibraryManagerViewToContractAddInAdapter.vb" id="Snippet3"::: @@ -113,7 +113,7 @@ collections that contain types that must be adapted before they can be passed to the add-in or host (rather than simple serializable types that can be passed directly). The host application or add-in can use the returned collection. It will have a lifetime token for the remote . + Use this method overload for collections that contain types that must be adapted before they can be passed to the add-in or host (rather than simple serializable types that can be passed directly). The host application or add-in can use the returned collection. It will have a lifetime token for the remote . ]]> @@ -150,14 +150,14 @@ collection can be marshaled across the isolation boundary between the add-in and its host application. + The collection can be marshaled across the isolation boundary between the add-in and its host application. - You should use this method overload only when the contents of the collection are serializable types that can be passed directly to the contract (rather than types that must be adapted into contracts). + You should use this method overload only when the contents of the collection are serializable types that can be passed directly to the contract (rather than types that must be adapted into contracts). ## Examples - The following example implements the class that defines an add-in side adapter pipeline segment. It adapts the custom `ProcessBooks` method by taking the collection passed from the add-in view segment and converting it to an collection that can be marshaled across the isolation boundary to the host. + The following example implements the class that defines an add-in side adapter pipeline segment. It adapts the custom `ProcessBooks` method by taking the collection passed from the add-in view segment and converting it to an collection that can be marshaled across the isolation boundary to the host. :::code language="csharp" source="~/snippets/csharp/System.AddIn.Pipeline/CollectionAdapters/ToIListContractT/LibraryManagerContractToViewHostAdapter.cs" id="Snippet4"::: :::code language="vb" source="~/snippets/visualbasic/System.AddIn.Pipeline/CollectionAdapters/ToIListContractT/LibraryManagerContractToViewHostAdapter.vb" id="Snippet4"::: @@ -203,7 +203,7 @@ collections that contain types that must be adapted into contracts before they can be passed to the contract (rather than simple serializable types that can be passed directly). The collection can be marshaled across the isolation boundary between an add-in and its host application. + Use this method overload for collections that contain types that must be adapted into contracts before they can be passed to the contract (rather than simple serializable types that can be passed directly). The collection can be marshaled across the isolation boundary between an add-in and its host application. ]]> diff --git a/xml/System.AddIn.Pipeline/ContractAdapter.xml b/xml/System.AddIn.Pipeline/ContractAdapter.xml index 7dd9330d124..8159edb77e2 100644 --- a/xml/System.AddIn.Pipeline/ContractAdapter.xml +++ b/xml/System.AddIn.Pipeline/ContractAdapter.xml @@ -17,15 +17,15 @@ Provides methods for sharing and readapting add-ins. - method. - - If you have an instance of the contract and need to convert it to the host view, use the method. - + method. + + If you have an instance of the contract and need to convert it to the host view, use the method. + ]]> @@ -75,11 +75,11 @@ Obtains a host view of an add-in if a suitable host-side adapter is found at a location specified by a value from the enumeration. The host view of the add-in that is shared. - @@ -126,11 +126,11 @@ Obtains a host view of an add-in if a suitable host-side adapter is found at a location specified by a path. The host view of the add-in that is shared. - @@ -159,13 +159,13 @@ Gets the handle to the contract for a provided host view of an add-in. A handle to the contract. - diff --git a/xml/System.AddIn.Pipeline/ContractHandle.xml b/xml/System.AddIn.Pipeline/ContractHandle.xml index 5183a18363e..10fbe0ae9c0 100644 --- a/xml/System.AddIn.Pipeline/ContractHandle.xml +++ b/xml/System.AddIn.Pipeline/ContractHandle.xml @@ -21,25 +21,25 @@ Provides methods that control the lifetime of an add-in. - object is constructed, it calls the method on the contract that is passed to the constructor. When the object is disposed or finalized, it calls the method on the contract, which removes its hold on the contract. - - Adapters implement the contract. The class is designed to be used in a contract-to-view adapter to help pipeline developers manage the lifetime of the contract that is being adapted. Typically, an instance of this class is instantiated during the construction of the adapter class and is stored in an instance field of the adapter. When the adapter class is garbage-collected, the object will also be collected and the object will revoke the lifetime token on the contract. - - It is recommended that your view-to-contract adapters inherit from the class. You can then use a default implementation for the members of , which means you need to implement only the members of your specific contract. - - - -## Examples - The following example shows how to set the lifetime token handle in a contract-to-view adapter on the add-in side of a pipeline. - + object is constructed, it calls the method on the contract that is passed to the constructor. When the object is disposed or finalized, it calls the method on the contract, which removes its hold on the contract. + + Adapters implement the contract. The class is designed to be used in a contract-to-view adapter to help pipeline developers manage the lifetime of the contract that is being adapted. Typically, an instance of this class is instantiated during the construction of the adapter class and is stored in an instance field of the adapter. When the adapter class is garbage-collected, the object will also be collected and the object will revoke the lifetime token on the contract. + + It is recommended that your view-to-contract adapters inherit from the class. You can then use a default implementation for the members of , which means you need to implement only the members of your specific contract. + + + +## Examples + The following example shows how to set the lifetime token handle in a contract-to-view adapter on the add-in side of a pipeline. + :::code language="csharp" source="~/snippets/csharp/System.AddIn.Pipeline/ContractHandle/Overview/Calc2ContractToViewHostSideAdapter.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/System.AddIn.Pipeline/ContractHandle/Overview/Calc2ContractToViewHostSideAdapter.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/System.AddIn.Pipeline/ContractHandle/Overview/Calc2ContractToViewHostSideAdapter.vb" id="Snippet2"::: + ]]> @@ -92,13 +92,13 @@ Gets the instance of the add-in-side adapter when the application domain was created. An object that represents the owner of the application domain. - . - - If the application domain was previously created by a user, there is no owner. - + . + + If the application domain was previously created by a user, there is no owner. + ]]> @@ -244,13 +244,13 @@ Releases the resources associated with the instance. - . Application code should not call this method; an object's method is automatically invoked during garbage collection, unless finalization by the garbage collector has been disabled by a call to the method. - - When called by the garbage collector, this method calls the method. - + . Application code should not call this method; an object's method is automatically invoked during garbage collection, unless finalization by the garbage collector has been disabled by a call to the method. + + When called by the garbage collector, this method calls the method. + ]]> diff --git a/xml/System.AddIn.Pipeline/FrameworkElementAdapters.xml b/xml/System.AddIn.Pipeline/FrameworkElementAdapters.xml index 65b1f54b3f5..9ab8a131976 100644 --- a/xml/System.AddIn.Pipeline/FrameworkElementAdapters.xml +++ b/xml/System.AddIn.Pipeline/FrameworkElementAdapters.xml @@ -29,9 +29,9 @@ Windows Presentation Foundation (WPF) extends the .NET Framework add-in model to - Derives from the class. - is not remotable and must be converted to a remotable type before it is passed across the isolation boundary between an add-in and a host application. For this purpose, you need to call the static method to convert the to an instance of the remotable . + is not remotable and must be converted to a remotable type before it is passed across the isolation boundary between an add-in and a host application. For this purpose, you need to call the static method to convert the to an instance of the remotable . - Once the is passed across the isolation boundary, it must be converted to a type that can be displayed by the host application or the add-in. In this case, the static method is called to convert an to a . + Once the is passed across the isolation boundary, it must be converted to a type that can be displayed by the host application or the add-in. In this case, the static method is called to convert an to a . For more detailed exposition of WPF add-ins, see [WPF Add-Ins Overview](/dotnet/framework/wpf/app-development/wpf-add-ins-overview). diff --git a/xml/System.AddIn.Pipeline/HostAdapterAttribute.xml b/xml/System.AddIn.Pipeline/HostAdapterAttribute.xml index ba38ed9841a..56d5b0e6421 100644 --- a/xml/System.AddIn.Pipeline/HostAdapterAttribute.xml +++ b/xml/System.AddIn.Pipeline/HostAdapterAttribute.xml @@ -23,21 +23,21 @@ Identifies an object as a host-side adapter segment of the pipeline. - and methods, which maintain the store of information about available pipeline segments, use this attribute to identify a host-side adapter. - - This attribute should be used only on types that activate the segments of the pipeline. Types that represent objects passed between the host and the add-in do not need this attribute. - - - -## Examples - The following example identifies a host-side adapter. - + and methods, which maintain the store of information about available pipeline segments, use this attribute to identify a host-side adapter. + + This attribute should be used only on types that activate the segments of the pipeline. Types that represent objects passed between the host and the add-in do not need this attribute. + + + +## Examples + The following example identifies a host-side adapter. + :::code language="csharp" source="~/snippets/csharp/System.AddIn.Pipeline/HostAdapterAttribute/Overview/Calc1ContractToViewHostSideAdapter.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/System.AddIn.Pipeline/HostAdapterAttribute/Overview/Calc1ContractToViewHostSideAdapter.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/System.AddIn.Pipeline/HostAdapterAttribute/Overview/Calc1ContractToViewHostSideAdapter.vb" id="Snippet2"::: + ]]> Add-Ins and Extensibility diff --git a/xml/System.AddIn.Pipeline/QualificationDataAttribute.xml b/xml/System.AddIn.Pipeline/QualificationDataAttribute.xml index 3e8f5694c77..be2529f1ba2 100644 --- a/xml/System.AddIn.Pipeline/QualificationDataAttribute.xml +++ b/xml/System.AddIn.Pipeline/QualificationDataAttribute.xml @@ -28,7 +28,7 @@ ## Remarks You can use this attribute to assign data, in the form of name-value string pairs, for any purpose to a pipeline segment. For example, you can indicate that an add-in should be loaded into an external process. - The and methods, which maintain the store of information about available pipeline segments, use this attribute to identify a segment that has qualification data. + The and methods, which maintain the store of information about available pipeline segments, use this attribute to identify a segment that has qualification data. To access the qualification data for a pipeline segment, see the property. To enumerate the data for all the pipeline segments, see the class. diff --git a/xml/System.AddIn/AddInAttribute.xml b/xml/System.AddIn/AddInAttribute.xml index 594ebdf4c06..2918beba70a 100644 --- a/xml/System.AddIn/AddInAttribute.xml +++ b/xml/System.AddIn/AddInAttribute.xml @@ -23,33 +23,33 @@ Identifies an object as an add-in. - - -- - -- - -- - -- - - This attribute is not required when an add-in is found exclusively by the method. The host has already identified the add-in by its type name and location, and therefore the attribute is not required for the add-in to be discovered. - - This attribute should be used only on types that activate the segments of the pipeline. Types that represent objects passed between the host and the add-in do not need this attribute. - - - -## Examples - The following example identifies an add-in. - + + +- + +- + +- + +- + + This attribute is not required when an add-in is found exclusively by the method. The host has already identified the add-in by its type name and location, and therefore the attribute is not required for the add-in to be discovered. + + This attribute should be used only on types that activate the segments of the pipeline. Types that represent objects passed between the host and the add-in do not need this attribute. + + + +## Examples + The following example identifies an add-in. + :::code language="csharp" source="~/snippets/csharp/System.AddIn/AddInAttribute/Overview/addincalcv2.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/System.AddIn/AddInAttribute/Overview/AddInCalcV2.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/System.AddIn/AddInAttribute/Overview/AddInCalcV2.vb" id="Snippet2"::: + ]]> Add-Ins and Extensibility diff --git a/xml/System.Buffers/ArrayBufferWriter`1.xml b/xml/System.Buffers/ArrayBufferWriter`1.xml index dbace398c29..3aa1ba01b00 100644 --- a/xml/System.Buffers/ArrayBufferWriter`1.xml +++ b/xml/System.Buffers/ArrayBufferWriter`1.xml @@ -314,7 +314,7 @@ You must clear the before trying to re A whose length is at least . If is not provided or is equal to 0, some non-empty buffer is returned. . +This method never returns . ]]> @@ -366,7 +366,7 @@ This method never returns A span of at least in length. If is not provided or is equal to 0, some non-empty buffer is returned. . +This method never returns . ]]> diff --git a/xml/System.Buffers/ArrayPool`1.xml b/xml/System.Buffers/ArrayPool`1.xml index 0e72ab80813..d9dee06f0c3 100644 --- a/xml/System.Buffers/ArrayPool`1.xml +++ b/xml/System.Buffers/ArrayPool`1.xml @@ -68,12 +68,12 @@ The type of the objects that are in the resource pool. Provides a resource pool that enables reusing instances of type T[]. - class to rent and return buffers (using the and methods) can improve performance in situations where arrays are created and destroyed frequently, resulting in significant memory pressure on the garbage collector. - + class to rent and return buffers (using the and methods) can improve performance in situations where arrays are created and destroyed frequently, resulting in significant memory pressure on the garbage collector. + ]]> This class is thread-safe. All members may be used by multiple threads concurrently. @@ -113,11 +113,11 @@ Initializes a new instance of the class. - class. + class. ]]> @@ -208,11 +208,11 @@ Note that this constructor is protected; it can only be called by classes derive Creates a new instance of the class using the specified configuration. A new instance of the class with the specified configuration. - class created by this method will group arrays into buckets, with no more than `maxArraysPerBucket` in each bucket, and with those arrays not exceeding `maxArrayLength` in length. + class created by this method will group arrays into buckets, with no more than `maxArraysPerBucket` in each bucket, and with those arrays not exceeding `maxArrayLength` in length. ]]> @@ -259,13 +259,13 @@ The instance of the class created by this me Retrieves a buffer that is at least the requested length. An array of type T that is at least in length. - method, so that it can be reused in subsequent calls to the method. Failure to return a rented buffer is not a fatal error. However, it may lead to decreased application performance, as the pool may need to create a new buffer to replace the lost one. +This buffer is loaned to the caller and should be returned to the same pool using the method, so that it can be reused in subsequent calls to the method. Failure to return a rented buffer is not a fatal error. However, it may lead to decreased application performance, as the pool may need to create a new buffer to replace the lost one. -The array returned by this method may not be zero-initialized. +The array returned by this method may not be zero-initialized. ]]> @@ -312,11 +312,11 @@ The array returned by this method may not be zero-initialized. Indicates whether the contents of the buffer should be cleared before reuse. If is set to , and if the pool will store the buffer to enable subsequent reuse, the method will clear the of its contents so that a subsequent caller using the method will not see the content of the previous caller. If is set to or if the pool will release the buffer, the array's contents are left unchanged. Returns an array to the pool that was previously obtained using the method on the same instance. - method must only be returned using the method once. The default may hold onto the returned buffer in order to rent it again, or it may release the returned buffer if it's determined that the pool already has enough buffers stored. +## Remarks + +Once a buffer has been returned to the pool, the caller gives up all ownership of the buffer and must not use it. The reference returned from a given call to the method must only be returned using the method once. The default may hold onto the returned buffer in order to rent it again, or it may release the returned buffer if it's determined that the pool already has enough buffers stored. > [!IMPORTANT] > Returning the same array reference twice or continuing to use the array reference after it has been returned is a high-severity security issue. These actions can lead to [double-free](https://cwe.mitre.org/data/definitions/415.html) and [use-after-free](https://cwe.mitre.org/data/definitions/416.html) vulnerabilities, which might result in data corruption, data leaks, and denial of service. @@ -362,11 +362,11 @@ Once a buffer has been returned to the pool, the caller gives up all ownership o Gets a shared instance. A shared instance. - class that's intended for general applicability. A shared class maintains arrays of multiple sizes, and may hand back a larger array than was actually requested, but it will never hand back a smaller array than was requested. Renting a buffer from a shared class using the method will result in an existing buffer being taken from the pool if an appropriate buffer is available or in a new buffer being allocated if one is not available. +The shared pool provides a default implementation of the class that's intended for general applicability. A shared class maintains arrays of multiple sizes, and may hand back a larger array than was actually requested, but it will never hand back a smaller array than was requested. Renting a buffer from a shared class using the method will result in an existing buffer being taken from the pool if an appropriate buffer is available or in a new buffer being allocated if one is not available. ]]> diff --git a/xml/System.Buffers/IBufferWriter`1.xml b/xml/System.Buffers/IBufferWriter`1.xml index 6356951b42f..b4e9982561e 100644 --- a/xml/System.Buffers/IBufferWriter`1.xml +++ b/xml/System.Buffers/IBufferWriter`1.xml @@ -124,11 +124,11 @@ Returns a to write to that is at least the requested size (specified by ). A of at least the size . If is 0, returns a non-empty buffer. - , but it can throw if the requested buffer size is not available. +This must never return , but it can throw if the requested buffer size is not available. You must request a new buffer after calling `Advance` to continue writing more data; you cannot write to a previously acquired buffer. @@ -179,10 +179,10 @@ You must request a new buffer after calling `Advance` to continue writing more d A of at least the size . If is 0, returns a non-empty buffer. , but it can throw if the requested buffer size is not available. +This method must never return , but it can throw if the requested buffer size is not available. You must request a new buffer after calling `Advance` to continue writing more data; you cannot write to a previously acquired buffer. ]]> diff --git a/xml/System.Buffers/IMemoryOwner`1.xml b/xml/System.Buffers/IMemoryOwner`1.xml index b9897badc53..207f2248364 100644 --- a/xml/System.Buffers/IMemoryOwner`1.xml +++ b/xml/System.Buffers/IMemoryOwner`1.xml @@ -67,9 +67,9 @@ The type of elements to store in memory. Identifies the owner of a block of memory who is responsible for disposing of the underlying memory appropriately. - ` interface is used to define the owner responsible for the lifetime management of a buffer. An instance of the `IMemoryOwner` interface is returned by the method. +The `IMemoryOwner` interface is used to define the owner responsible for the lifetime management of a buffer. An instance of the `IMemoryOwner` interface is returned by the method. While a buffer can have multiple consumers, it can only have a single owner at any given time. The owner can: @@ -79,7 +79,7 @@ While a buffer can have multiple consumers, it can only have a single owner at a - Destroy the buffer when it is no longer in use. -Because the `IMemoryOwner` object implements the interface, you should call its method only after the memory buffer is no longer needed and you have destroyed it. You should *not* dispose of the `IMemoryOwner` object while a reference to its memory is available. This means that the type in which `IMemoryOwner` is declared should not have a method. +Because the `IMemoryOwner` object implements the interface, you should call its method only after the memory buffer is no longer needed and you have destroyed it. You should *not* dispose of the `IMemoryOwner` object while a reference to its memory is available. This means that the type in which `IMemoryOwner` is declared should not have a method. ]]> diff --git a/xml/System.Buffers/IPinnable.xml b/xml/System.Buffers/IPinnable.xml index 0b9131083b3..f41bd674ce3 100644 --- a/xml/System.Buffers/IPinnable.xml +++ b/xml/System.Buffers/IPinnable.xml @@ -52,11 +52,11 @@ Provides a mechanism for pinning and unpinning objects to prevent the garbage collector from moving them. - class implements the `IPinnable` interface. +## Remarks + +The class implements the `IPinnable` interface. ]]> @@ -104,11 +104,11 @@ The class implements the `IPinnable` int Pins a block of memory. A handle to the block of memory. - interface without pinning it only through managed APIs. Pinning is required for access by unmanaged APIs. +A developer can access an object that implements the interface without pinning it only through managed APIs. Pinning is required for access by unmanaged APIs. Call this method to indicate that the object cannot be moved by the garbage collector so that the address of the pinned object can be used. @@ -155,9 +155,9 @@ Call this method to indicate that the object can Frees a block of pinned memory. - object no longer needs to be pinned, and that the garbage collector can now move the object. diff --git a/xml/System.Buffers/MemoryHandle.xml b/xml/System.Buffers/MemoryHandle.xml index e5e7e39994f..35d0a4bb231 100644 --- a/xml/System.Buffers/MemoryHandle.xml +++ b/xml/System.Buffers/MemoryHandle.xml @@ -64,10 +64,10 @@ A `MemoryHandle` instance represents a handle to a pinned block of memory. It is returned by the following methods: -- . -- -- . -- +- . +- +- . +- ]]> diff --git a/xml/System.Buffers/MemoryManager`1.xml b/xml/System.Buffers/MemoryManager`1.xml index 71a83159e91..40a4baa03e9 100644 --- a/xml/System.Buffers/MemoryManager`1.xml +++ b/xml/System.Buffers/MemoryManager`1.xml @@ -75,9 +75,9 @@ The type of items in the memory buffer managed by this memory manager. An abstract base class that is used to replace the implementation of . - ` class is used to extend the knowledge of types that is able to represent. For example, you can derive from `MemoryManager` to allow to be backed by a . +The `MemoryManager` class is used to extend the knowledge of types that is able to represent. For example, you can derive from `MemoryManager` to allow to be backed by a . > [!NOTE] > The `MemoryManager` class is intended for advanced scenarios. Most developers do not need to use it. diff --git a/xml/System.CodeDom.Compiler/CodeDomProvider.xml b/xml/System.CodeDom.Compiler/CodeDomProvider.xml index f9452e12dc0..8eee84b6da5 100644 --- a/xml/System.CodeDom.Compiler/CodeDomProvider.xml +++ b/xml/System.CodeDom.Compiler/CodeDomProvider.xml @@ -54,7 +54,7 @@ The [<system.codedom> Element](/dotnet/framework/configure-apps/file-schema/compiler/system-codedom-element) in the machine configuration file (Machine.config) provides a mechanism for developers and compiler vendors to add configuration settings for additional implementations. - The class provides static methods to discover and enumerate the implementations on a computer. The method returns the settings for all implementations on a computer. The method returns the settings for a specific implementation, based on the programming language name. The method returns an instance of a implementation for a specific language. + The class provides static methods to discover and enumerate the implementations on a computer. The method returns the settings for all implementations on a computer. The method returns the settings for a specific implementation, based on the programming language name. The method returns an instance of a implementation for a specific language. For more details on language provider settings in the configuration file, see [Compiler and Language Provider Settings Schema](/dotnet/framework/configure-apps/file-schema/compiler/). @@ -412,10 +412,10 @@ tests whether the identifier conflicts with any reserved or language keywords, and if so, returns an equivalent name with language-specific escape code formatting. This is referred to an escaped identifier. The escaped identifier contains the same `value` but has escape-code formatting added to differentiate the identifier from the keyword. Two implementation examples are preceding the `value` with "@" or bracketing the `value` with "[" and "]". + tests whether the identifier conflicts with any reserved or language keywords, and if so, returns an equivalent name with language-specific escape code formatting. This is referred to an escaped identifier. The escaped identifier contains the same `value` but has escape-code formatting added to differentiate the identifier from the keyword. Two implementation examples are preceding the `value` with "@" or bracketing the `value` with "[" and "]". > [!NOTE] -> In the .NET Framework versions 1.0 and 1.1, this method is provided by the implementation that is returned by the method of the provider. In version 2.0, this method can be called directly on the code provider even if it is not overridden by the code provider. If the code provider does not override this method, the implementation is called by the base class. +> In the .NET Framework versions 1.0 and 1.1, this method is provided by the implementation that is returned by the method of the provider. In version 2.0, this method can be called directly on the code provider even if it is not overridden by the code provider. If the code provider does not override this method, the implementation is called by the base class. ]]> @@ -539,7 +539,7 @@ This method uses the specified for output. This method supports more optimized code generation that incrementally updates the source code. > [!NOTE] -> The base class implementation calls the method, which is obsolete and results in a if an object is not returned. +> The base class implementation calls the method, which is obsolete and results in a if an object is not returned. ]]> @@ -595,7 +595,7 @@ This method uses the specified file name for output. > [!NOTE] -> The base class implementation calls the method, which is obsolete and results in a if an object is not returned. +> The base class implementation calls the method, which is obsolete and results in a if an object is not returned. ]]> @@ -703,19 +703,19 @@ ## Remarks > [!NOTE] -> This method is most commonly used to create an instance of a code provider in an application that may optionally use one of several providers. allows you to specify at run time the code provider you wish to instantiate. If you know at design time which code provider is to be used, you should create an instance of that code provider rather than use the method. +> This method is most commonly used to create an instance of a code provider in an application that may optionally use one of several providers. allows you to specify at run time the code provider you wish to instantiate. If you know at design time which code provider is to be used, you should create an instance of that code provider rather than use the method. - The method returns a instance for a specific language name; it is similar to calling the method with the language provider type. Use when you want to dynamically find a configured provider implementation for a language name. + The method returns a instance for a specific language name; it is similar to calling the method with the language provider type. Use when you want to dynamically find a configured provider implementation for a language name. - If more than one provider implementation is configured for the language name, returns a provider instance for the last matching configuration element. + If more than one provider implementation is configured for the language name, returns a provider instance for the last matching configuration element. - Use the method overload when you want a specific language provider implementation. For example, use the method to get a provider instance that supports the language name `"CSharp"`; use the method overload to get a provider instance specifically for the implementation. Use the method if you have multiple code providers for a language and you desire to instantiate a specific code provider. + Use the method overload when you want a specific language provider implementation. For example, use the method to get a provider instance that supports the language name `"CSharp"`; use the method overload to get a provider instance specifically for the implementation. Use the method if you have multiple code providers for a language and you desire to instantiate a specific code provider. - The method checks whether at least one provider implementation supports a specific language. You can validate a language name using before passing it to . If you pass an unsupported language name to a is thrown. + The method checks whether at least one provider implementation supports a specific language. You can validate a language name using before passing it to . If you pass an unsupported language name to a is thrown. - The method can be used to determine all implementations on a computer, including additional implementations provided by developers and compiler vendors that are identified in the [<system.codedom> Element](/dotnet/framework/configure-apps/file-schema/compiler/system-codedom-element) in the machine configuration file (Machine.config). + The method can be used to determine all implementations on a computer, including additional implementations provided by developers and compiler vendors that are identified in the [<system.codedom> Element](/dotnet/framework/configure-apps/file-schema/compiler/system-codedom-element) in the machine configuration file (Machine.config). - The method returns an instance of a implementation for a specific language. + The method returns an instance of a implementation for a specific language. Language names are case-insensitive. @@ -840,10 +840,10 @@ tests whether the identifier conflicts with reserved or language keywords, and if so, attempts to return a valid identifier name that does not conflict. Usually the returned identifier is only slightly modified to differentiate the identifier from the keyword; for example, the name might be preceded by the underscore ("_") character. + tests whether the identifier conflicts with reserved or language keywords, and if so, attempts to return a valid identifier name that does not conflict. Usually the returned identifier is only slightly modified to differentiate the identifier from the keyword; for example, the name might be preceded by the underscore ("_") character. > [!NOTE] -> In the .NET Framework versions 1.0 and 1.1, this method is provided by the implementation that is returned by the method of the provider. In version 2.0, this method can be called directly on the code provider even if it is not overridden by the code provider. If the code provider does not override this method, the implementation is called by the base class. +> In the .NET Framework versions 1.0 and 1.1, this method is provided by the implementation that is returned by the method of the provider. In version 2.0, this method can be called directly on the code provider even if it is not overridden by the code provider. If the code provider does not override this method, the implementation is called by the base class. ]]> @@ -953,12 +953,12 @@ ## Remarks > [!NOTE] -> In the .NET Framework versions 1.0 and 1.1, this method is provided by the implementation that is returned by the method of the provider. In version 2.0, this method can be called directly on the code provider even if it is not overridden by the code provider. If the code provider does not override this method, the implementation is called by the base class. +> In the .NET Framework versions 1.0 and 1.1, this method is provided by the implementation that is returned by the method of the provider. In version 2.0, this method can be called directly on the code provider even if it is not overridden by the code provider. If the code provider does not override this method, the implementation is called by the base class. ## Examples - The following code example shows the use of the method to generate code for a "Hello World" application from a . This example is part of a larger example provided for the class. + The following code example shows the use of the method to generate code for a "Hello World" application from a . This example is part of a larger example provided for the class. :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeCompileUnit/Overview/source.cs" id="Snippet3"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeCompileUnit/Overview/source.vb" id="Snippet3"::: @@ -1018,7 +1018,7 @@ ## Remarks > [!NOTE] -> In the .NET Framework versions 1.0 and 1.1, this method is provided by the implementation that is returned by the method of the provider. In version 2.0, this method can be called directly on the code provider even if it is not overridden by the code provider. If the code provider does not override this method, the implementation is called by the base class. +> In the .NET Framework versions 1.0 and 1.1, this method is provided by the implementation that is returned by the method of the provider. In version 2.0, this method can be called directly on the code provider even if it is not overridden by the code provider. If the code provider does not override this method, the implementation is called by the base class. ]]> @@ -1073,12 +1073,12 @@ . See for documentation describing an implementation of this method. + The base class implementation throws a . See for documentation describing an implementation of this method. ## Examples - The following code example shows the use of the method as implemented by the and classes. + The following code example shows the use of the method as implemented by the and classes. :::code language="csharp" source="~/snippets/csharp/Microsoft.CSharp/CSharpCodeProvider/GenerateCodeFromMember/program.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/Microsoft.CSharp/CSharpCodeProvider/GenerateCodeFromMember/module1.vb" id="Snippet1"::: @@ -1135,7 +1135,7 @@ ## Remarks > [!NOTE] -> In the .NET Framework versions 1.0 and 1.1, this method is provided by the implementation that is returned by the method of the provider. In version 2.0, this method can be called directly on the code provider even if it is not overridden by the code provider. If the code provider does not override this method, the implementation is called by the base class. +> In the .NET Framework versions 1.0 and 1.1, this method is provided by the implementation that is returned by the method of the provider. In version 2.0, this method can be called directly on the code provider even if it is not overridden by the code provider. If the code provider does not override this method, the implementation is called by the base class. ]]> @@ -1192,7 +1192,7 @@ ## Remarks > [!NOTE] -> In the .NET Framework versions 1.0 and 1.1, this method is provided by the implementation that is returned by the method of the provider. In version 2.0, this method can be called directly on the code provider even if it is not overridden by the code provider. If the code provider does not override this method, the implementation is called by the base class. +> In the .NET Framework versions 1.0 and 1.1, this method is provided by the implementation that is returned by the method of the provider. In version 2.0, this method can be called directly on the code provider even if it is not overridden by the code provider. If the code provider does not override this method, the implementation is called by the base class. ]]>
@@ -1249,7 +1249,7 @@ ## Remarks > [!NOTE] -> In the .NET Framework versions 1.0 and 1.1, this method is provided by the implementation that is returned by the method of the provider. In version 2.0, this method can be called directly on the code provider even if it is not overridden by the code provider. If the code provider does not override this method, the implementation is called by the base class. +> In the .NET Framework versions 1.0 and 1.1, this method is provided by the implementation that is returned by the method of the provider. In version 2.0, this method can be called directly on the code provider even if it is not overridden by the code provider. If the code provider does not override this method, the implementation is called by the base class. ]]>
@@ -1304,7 +1304,7 @@ method to enumerate the language provider settings on a computer. + Use the method to enumerate the language provider settings on a computer. ## Examples The following code example enumerates the language providers on the computer and displays the configuration and compiler settings for each language provider. This code example is part of a larger example provided for the class. @@ -1364,11 +1364,11 @@ implementation on the computer. For information about machine configuration files, see the Machine Configuration Files section in [Configuring Apps](/dotnet/framework/configure-apps/). The method searches each provider configuration element for the specified language name. The returned instance contains the configured language provider and compiler settings. + The [<system.codedom> Element](/dotnet/framework/configure-apps/file-schema/compiler/system-codedom-element) in the machine configuration file contains the language provider and compiler configuration settings for each implementation on the computer. For information about machine configuration files, see the Machine Configuration Files section in [Configuring Apps](/dotnet/framework/configure-apps/). The method searches each provider configuration element for the specified language name. The returned instance contains the configured language provider and compiler settings. - The method checks whether at least one provider implementation supports a specific language. You can validate a language name using before passing it to . This prevents throwing a when you access the instance for an unsupported language name. + The method checks whether at least one provider implementation supports a specific language. You can validate a language name using before passing it to . This prevents throwing a when you access the instance for an unsupported language name. - If more than one provider implementation is configured for the input language name, returns the settings from the last matching provider configuration element. + If more than one provider implementation is configured for the input language name, returns the settings from the last matching provider configuration element. Language names are case-insensitive. @@ -1482,11 +1482,11 @@ implementation on the computer. The method searches each provider configuration element for the specified file name extension. + The [<system.codedom> Element](/dotnet/framework/configure-apps/file-schema/compiler/system-codedom-element) in the machine configuration file (Machine.config) contains the language provider and compiler configuration settings for each implementation on the computer. The method searches each provider configuration element for the specified file name extension. - The method checks whether at least one provider implementation supports a specific file name extension. You can validate a file name extension using before passing it to . This prevents from throwing a for an unsupported file name extension. + The method checks whether at least one provider implementation supports a specific file name extension. You can validate a file name extension using before passing it to . This prevents from throwing a for an unsupported file name extension. - If a provider implementation supports the input file name extension, and there are multiple supported languages configured for that provider, then returns the first language name for that provider. If more than one provider implementation is configured for the input file name extension, returns the language name from the last matching provider configuration element. + If a provider implementation supports the input file name extension, and there are multiple supported languages configured for that provider, then returns the first language name for that provider. If more than one provider implementation is configured for the input file name extension, returns the language name from the last matching provider configuration element. Language names and file name extensions are case-insensitive. @@ -1549,7 +1549,7 @@ ## Remarks > [!NOTE] -> In the .NET Framework versions 1.0 and 1.1, this method is provided by the implementation that is returned by the method of the provider. In version 2.0, this method can be called directly on the code provider even if it is not overridden by the code provider. If the code provider does not override this method, the implementation is called by the base class. +> In the .NET Framework versions 1.0 and 1.1, this method is provided by the implementation that is returned by the method of the provider. In version 2.0, this method can be called directly on the code provider even if it is not overridden by the code provider. If the code provider does not override this method, the implementation is called by the base class. ]]> @@ -1605,7 +1605,7 @@ implementation on the computer. The method searches the provider configuration elements for the specified file name extension. + The [<system.codedom> Element](/dotnet/framework/configure-apps/file-schema/compiler/system-codedom-element) in the machine configuration file (Machine.config) contains the language provider and compiler configuration settings for each implementation on the computer. The method searches the provider configuration elements for the specified file name extension. File name extensions are case-insensitive. @@ -1672,7 +1672,7 @@ implementation on the computer. The method searches the provider configuration elements for the specified language name. + The [<system.codedom> Element](/dotnet/framework/configure-apps/file-schema/compiler/system-codedom-element) in the machine configuration file (Machine.config) contains the language provider and compiler configuration settings for each implementation on the computer. The method searches the provider configuration elements for the specified language name. Language names are case-insensitive. @@ -1732,10 +1732,10 @@ method is provider specific. Identifiers that are valid for one provider might not be valid for other providers. If `value` contains characters outside of the ASCII character range, check the identifier for all the languages that might be used to compile the code. + This method tests whether an identifier is valid. The method is provider specific. Identifiers that are valid for one provider might not be valid for other providers. If `value` contains characters outside of the ASCII character range, check the identifier for all the languages that might be used to compile the code. > [!NOTE] -> In the .NET Framework versions 1.0 and 1.1, this method is provided by the implementation that is returned by the method of the provider. In version 2.0, this method can be called directly on the code provider even if it is not overridden by the code provider. If the code provider does not override this method, the implementation is called by the base class. +> In the .NET Framework versions 1.0 and 1.1, this method is provided by the implementation that is returned by the method of the provider. In version 2.0, this method can be called directly on the code provider even if it is not overridden by the code provider. If the code provider does not override this method, the implementation is called by the base class. ]]> @@ -1823,7 +1823,7 @@ ## Remarks > [!NOTE] -> In the .NET Framework versions 1.0 and 1.1, this method is provided by the implementation that is returned by the method of the provider. In version 2.0, this method can be called directly on the code provider even if it is not overridden by the code provider. If the code provider does not override this method, the implementation is called by the base class. +> In the .NET Framework versions 1.0 and 1.1, this method is provided by the implementation that is returned by the method of the provider. In version 2.0, this method can be called directly on the code provider even if it is not overridden by the code provider. If the code provider does not override this method, the implementation is called by the base class. ]]> @@ -1878,7 +1878,7 @@ This method can be called with a number of flags at once to test for a set of capabilities by joining a set of appropriate capability flags together with a binary `OR` operator (|). > [!NOTE] -> In the .NET Framework versions 1.0 and 1.1, this method is provided by the implementation that is returned by the method of the provider. In version 2.0, this method can be called directly on the code provider even if it is not overridden by the code provider. If the code provider does not override this method, the implementation is called by the base class. +> In the .NET Framework versions 1.0 and 1.1, this method is provided by the implementation that is returned by the method of the provider. In version 2.0, this method can be called directly on the code provider even if it is not overridden by the code provider. If the code provider does not override this method, the implementation is called by the base class. ]]> diff --git a/xml/System.CodeDom.Compiler/CodeGenerator.xml b/xml/System.CodeDom.Compiler/CodeGenerator.xml index 2a4fdf88f70..5f0c496e2d0 100644 --- a/xml/System.CodeDom.Compiler/CodeGenerator.xml +++ b/xml/System.CodeDom.Compiler/CodeGenerator.xml @@ -170,7 +170,7 @@ tests whether the identifier conflicts with reserved or language keywords, and if so, returns an equivalent name with language-specific escape code formatting. The returned name is referred to an escaped identifier. The escaped identifier contains the same `value` but includes escape code formatting to differentiate it from conflicting keywords. For example, `value` could be preceded by an at sign ("@") or delimited by square brackets ("[" and "]") to create an escaped identifier. + tests whether the identifier conflicts with reserved or language keywords, and if so, returns an equivalent name with language-specific escape code formatting. The returned name is referred to an escaped identifier. The escaped identifier contains the same `value` but includes escape code formatting to differentiate it from conflicting keywords. For example, `value` could be preceded by an at sign ("@") or delimited by square brackets ("[" and "]") to create an escaped identifier. > [!NOTE] > The default implementation of this method does nothing. @@ -220,7 +220,7 @@ tests whether the identifier conflicts with reserved or language keywords, and if so, returns a valid identifier name that does not conflict. The returned identifier contains the same `value` but includes escape code formatting to differentiate it from conflicting keywords. Typically, if the value requires modification, it is preceded by an underscore "_". + tests whether the identifier conflicts with reserved or language keywords, and if so, returns a valid identifier name that does not conflict. The returned identifier contains the same `value` but includes escape code formatting to differentiate it from conflicting keywords. Typically, if the value requires modification, it is preceded by an underscore "_". > [!NOTE] > The default implementation of this method does nothing. @@ -3692,7 +3692,7 @@ method calls this method to perform string validation. Calling the method and passing a before generating code from it can prevent the use of certain character sequences to include hidden code within an identifier field. + This method checks the specified string to ensure that it does not contain certain characters that can be used to escape an identifier field. The method calls this method to perform string validation. Calling the method and passing a before generating code from it can prevent the use of certain character sequences to include hidden code within an identifier field. ]]> @@ -5077,7 +5077,7 @@ ## Remarks It is possible for the identifier fields of objects to contain field escape characters and hidden code, which can allow security violations. This method checks the literal fields of each in a tree for characters which could be used to hide code, and throws an exception if an identifier field contains an invalid character. - This method calls the method to validate each identifier in the specified or tree, and throws an exception if an identifier is invalid or contains invalid characters. + This method calls the method to validate each identifier in the specified or tree, and throws an exception if an identifier is invalid or contains invalid characters. Call this method and pass it the containing the code graph to generate before generating code to block the use of certain character sequences that can be used to include hidden code within an identifier field. This method is not called automatically by any generate code methods. diff --git a/xml/System.CodeDom.Compiler/CodeGeneratorOptions.xml b/xml/System.CodeDom.Compiler/CodeGeneratorOptions.xml index 34923ee21dd..cc3f515bd4d 100644 --- a/xml/System.CodeDom.Compiler/CodeGeneratorOptions.xml +++ b/xml/System.CodeDom.Compiler/CodeGeneratorOptions.xml @@ -41,7 +41,7 @@ The property specifies the string to use for each spacing indentation. The property specifies the placement style for braces indicating the boundaries of code blocks. The property specifies whether to append an `else`, `catch`, or `finally` block, including brackets, at the closing line of each `if` or `try` block. The property specifies whether to insert blank lines between members. - An implementation can provide custom code generation options which you can set or pass data to using the dictionary indexer, which a code generator can search through to locate additional code generation options. + An implementation can provide custom code generation options which you can set or pass data to using the dictionary indexer, which a code generator can search through to locate additional code generation options. > [!NOTE] > This class contains a link demand and an inheritance demand at the class level that applies to all members. A is thrown when either the immediate caller or the derived class does not have full-trust permission. For details about security demands, see [Link Demands](/dotnet/framework/misc/link-demands) and [Inheritance Demands](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/x4yx82e6(v=vs.100)). diff --git a/xml/System.CodeDom.Compiler/CompilerErrorCollection.xml b/xml/System.CodeDom.Compiler/CompilerErrorCollection.xml index ba6ad7009db..44cebc1092f 100644 --- a/xml/System.CodeDom.Compiler/CompilerErrorCollection.xml +++ b/xml/System.CodeDom.Compiler/CompilerErrorCollection.xml @@ -232,7 +232,7 @@ method to add a object to a . + The following example demonstrates how to use the method to add a object to a . :::code language="csharp" source="~/snippets/csharp/System.CodeDom.Compiler/CompilerErrorCollection/Overview/class1.cs" id="Snippet3"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom.Compiler/CompilerErrorCollection/Overview/class1.vb" id="Snippet3"::: @@ -290,7 +290,7 @@ method overload to add an array of objects to a . + The following example demonstrates how to use the method overload to add an array of objects to a . :::code language="csharp" source="~/snippets/csharp/System.CodeDom.Compiler/CompilerErrorCollection/Overview/class1.cs" id="Snippet4"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom.Compiler/CompilerErrorCollection/Overview/class1.vb" id="Snippet4"::: @@ -341,7 +341,7 @@ method overload to add objects from one to another . + The following example demonstrates how to use the method overload to add objects from one to another . :::code language="csharp" source="~/snippets/csharp/System.CodeDom.Compiler/CompilerErrorCollection/Overview/class1.cs" id="Snippet4"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom.Compiler/CompilerErrorCollection/Overview/class1.vb" id="Snippet4"::: @@ -394,7 +394,7 @@ method to locate a specific object and determine the index value at which it was found. + The following example uses the method to locate a specific object and determine the index value at which it was found. :::code language="csharp" source="~/snippets/csharp/System.CodeDom.Compiler/CompilerErrorCollection/Overview/class1.cs" id="Snippet5"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom.Compiler/CompilerErrorCollection/Overview/class1.vb" id="Snippet5"::: @@ -445,7 +445,7 @@ method to copy the contents of a to an array, starting at the specified index value. + The following example demonstrates how to use the method to copy the contents of a to an array, starting at the specified index value. :::code language="csharp" source="~/snippets/csharp/System.CodeDom.Compiler/CompilerErrorCollection/Overview/class1.cs" id="Snippet6"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom.Compiler/CompilerErrorCollection/Overview/class1.vb" id="Snippet6"::: @@ -574,7 +574,7 @@ object and uses the method to determine the index value at which it was found. + The following example searches for a specific object and uses the method to determine the index value at which it was found. :::code language="csharp" source="~/snippets/csharp/System.CodeDom.Compiler/CompilerErrorCollection/Overview/class1.cs" id="Snippet5"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom.Compiler/CompilerErrorCollection/Overview/class1.vb" id="Snippet5"::: @@ -625,7 +625,7 @@ method to insert a object into a . + The following example demonstrates how to use the method to insert a object into a . :::code language="csharp" source="~/snippets/csharp/System.CodeDom.Compiler/CompilerErrorCollection/Overview/class1.cs" id="Snippet8"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom.Compiler/CompilerErrorCollection/Overview/class1.vb" id="Snippet8"::: diff --git a/xml/System.CodeDom.Compiler/CompilerInfo.xml b/xml/System.CodeDom.Compiler/CompilerInfo.xml index da51f974c31..c80eb56978c 100644 --- a/xml/System.CodeDom.Compiler/CompilerInfo.xml +++ b/xml/System.CodeDom.Compiler/CompilerInfo.xml @@ -42,7 +42,7 @@ The .NET Framework defines the initial compiler settings in the machine configuration file. Developers and compiler vendors can add configuration settings for a new implementation. - The class provides read-only access to these settings in the machine configuration file. Use the , , and members to examine the corresponding configuration attributes for a language provider. Use the method to obtain the compiler options and warning level attribute values for a language provider. + The class provides read-only access to these settings in the machine configuration file. Use the , , and members to examine the corresponding configuration attributes for a language provider. Use the method to obtain the compiler options and warning level attribute values for a language provider. For more details on language provider settings in the configuration file, see [Compiler and Language Provider Settings Schema](/dotnet/framework/configure-apps/file-schema/compiler/). @@ -163,9 +163,9 @@ method to examine the compiler settings of the instances returned by the and methods. + Use the method to examine the compiler settings of the instances returned by the and methods. - The [<system.codedom> Element](/dotnet/framework/configure-apps/file-schema/compiler/system-codedom-element) in the machine configuration file contains the language provider and compiler configuration settings for each implementation on the computer. Each language provider configuration element can contain optional `compilerOptions` and `warningLevel` attributes. These attributes define the default values for the and properties. + The [<system.codedom> Element](/dotnet/framework/configure-apps/file-schema/compiler/system-codedom-element) in the machine configuration file contains the language provider and compiler configuration settings for each implementation on the computer. Each language provider configuration element can contain optional `compilerOptions` and `warningLevel` attributes. These attributes define the default values for the and properties. If the language provider configuration element does not define the `compilerOptions` attribute, the property value is an empty string (""). If the language provider configuration element does not define the `warningLevel` attribute, the property value is -1. @@ -228,9 +228,9 @@ method returns a instance for the current language provider settings. + The method returns a instance for the current language provider settings. - Use the method to get a implementation for a instance returned by the or method. + Use the method to get a implementation for a instance returned by the or method. @@ -284,9 +284,9 @@ method returns a instance for the current language provider settings and the specified provider options. For information about supported provider options, see the specific CodeDOM provider documentation. + The method returns a instance for the current language provider settings and the specified provider options. For information about supported provider options, see the specific CodeDOM provider documentation. - Use the method to get a implementation for a instance returned by the or method. + Use the method to get a implementation for a instance returned by the or method. ]]> @@ -335,13 +335,13 @@ method. + This method overrides the method. The two instances are considered equal if the values of the following properties are equal: - The property. -- The , , and properties of the instance returned by the method. +- The , , and properties of the instance returned by the method. ]]> @@ -444,9 +444,9 @@ method. + This method overrides the method. - This method generates the same hash code for two objects that are equal according to the method. + This method generates the same hash code for two objects that are equal according to the method. @@ -557,7 +557,7 @@ property to check the implementation before accessing the provider properties or methods. For example, after you get the language provider settings from the method, use the property to verify the provider type implementation before calling the method or using the property. + Use the property to check the implementation before accessing the provider properties or methods. For example, after you get the language provider settings from the method, use the property to verify the provider type implementation before calling the method or using the property. diff --git a/xml/System.CodeDom.Compiler/CompilerParameters.xml b/xml/System.CodeDom.Compiler/CompilerParameters.xml index 3d5560a0e9c..7ecefc381ef 100644 --- a/xml/System.CodeDom.Compiler/CompilerParameters.xml +++ b/xml/System.CodeDom.Compiler/CompilerParameters.xml @@ -50,7 +50,7 @@ ## Remarks A object represents the settings and options for an interface. - If you are compiling an executable program, you must set the property to `true`. When the is set to `false`, the compiler will generate a class library. By default, a new is initialized with its property set to `false`. If you are compiling an executable from a CodeDOM graph, a must be defined in the graph. If there are multiple code entry points, you can indicate the class that defines the entry point to use by setting the name of the class to the property. + If you are compiling an executable program, you must set the property to `true`. When the is set to `false`, the compiler will generate a class library. By default, a new is initialized with its property set to `false`. If you are compiling an executable from a CodeDOM graph, a must be defined in the graph. If there are multiple code entry points, you can indicate the class that defines the entry point to use by setting the name of the class to the property. You can specify a file name for the output assembly in the property. Otherwise, a default output file name will be used. To include debug information in a generated assembly, set the property to `true`. If your project references any assemblies, you must specify the assembly names as items in a set to the property of the used when invoking compilation. @@ -405,11 +405,11 @@ An typically includes this string o ## Remarks Embedded resources are built into the generated assembly output file. Including files through this property is similar to the `/resource` command-line argument supported by many of the .NET compilers. - Not all compilers support .NET resource files, so you should test for this support by calling the method with the flag . + Not all compilers support .NET resource files, so you should test for this support by calling the method with the flag . Add one or more .NET resource file paths to the returned to embed the file resources in the compiled assembly. Adding a duplicate or invalid file path results in compilation errors; ensure that each string specifies a unique path to a valid .NET resource file. - Use to include default or neutral culture .NET resources for an assembly; use the property to reference .NET resources in satellite assemblies. + Use to include default or neutral culture .NET resources for an assembly; use the property to reference .NET resources in satellite assemblies. ## Examples The following example illustrates using to specify various compiler settings and options. This code example is part of a larger example provided for the class. @@ -667,11 +667,11 @@ An typically includes this string o ## Remarks Linked resource files allow your assembly to reference .NET resources without embedding the actual resources in the assembly. Referencing files through this property is similar to the `/linkresource` command-line argument supported by many of the .NET compilers. - Not all compilers support .NET resource files, so you should test for this support by calling the method with the flag . + Not all compilers support .NET resource files, so you should test for this support by calling the method with the flag . Add one or more .NET resource file paths to the returned to create links for the resources in the compiled assembly. Adding a duplicate or invalid file path results in compilation errors; ensure that each string specifies a unique path to a valid .NET resource file. - Use to reference .NET resources in satellite assemblies, localized for a particular culture; use the property to embed the resources into the compiled assembly. + Use to reference .NET resources in satellite assemblies, localized for a particular culture; use the property to embed the resources into the compiled assembly. ## Examples The following example illustrates using to specify various compiler settings and options. This code example is part of a larger example provided for the class. @@ -900,7 +900,7 @@ An typically includes this string o property in the collection. The property is set if the collection is created using the constructor with the `keepFiles` parameter set to `true`. + The temporary files in the collection are retained or deleted upon the completion of compiler activity based on the value of the property in the collection. The property is set if the collection is created using the constructor with the `keepFiles` parameter set to `true`. > [!NOTE] > This class contains a link demand and an inheritance demand at the class level that applies to all members. A is thrown when either the immediate caller or the derived class does not have full-trust permission. For details about security demands, see [Link Demands](/dotnet/framework/misc/link-demands) and [Inheritance Demands](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/x4yx82e6(v=vs.100)). @@ -1111,9 +1111,9 @@ An typically includes this string o ## Remarks Linking files through this property is similar to the `/winres` and `/winresource` command-line arguments supported by many of the .NET Framework compilers. - Use to compile a Win32 resource file into the assembly. Use or to compile with .NET Framework resource files. + Use to compile a Win32 resource file into the assembly. Use or to compile with .NET Framework resource files. - Not all compilers support Win32 resource files, so you should test a code generator for this support before linking a resource file by calling the method with the flag . + Not all compilers support Win32 resource files, so you should test a code generator for this support before linking a resource file by calling the method with the flag . ]]> diff --git a/xml/System.CodeDom.Compiler/CompilerResults.xml b/xml/System.CodeDom.Compiler/CompilerResults.xml index 23ea1ca2fef..81c216db8db 100644 --- a/xml/System.CodeDom.Compiler/CompilerResults.xml +++ b/xml/System.CodeDom.Compiler/CompilerResults.xml @@ -154,7 +154,7 @@ ## Remarks > [!NOTE] -> The `get` accessor for the property calls the method to load the compiled assembly into the current application domain. After calling the `get` accessor, the compiled assembly cannot be deleted until the current is unloaded. +> The `get` accessor for the property calls the method to load the compiled assembly into the current application domain. After calling the `get` accessor, the compiled assembly cannot be deleted until the current is unloaded. ]]> diff --git a/xml/System.CodeDom.Compiler/GeneratorSupport.xml b/xml/System.CodeDom.Compiler/GeneratorSupport.xml index 27c8d09f53d..723453aa88c 100644 --- a/xml/System.CodeDom.Compiler/GeneratorSupport.xml +++ b/xml/System.CodeDom.Compiler/GeneratorSupport.xml @@ -47,7 +47,7 @@ method of a code generator to determine whether the code generator supports generating certain types of code. + These identifiers are used when calling the method of a code generator to determine whether the code generator supports generating certain types of code. diff --git a/xml/System.CodeDom.Compiler/ICodeCompiler.xml b/xml/System.CodeDom.Compiler/ICodeCompiler.xml index a1708e46e51..99d7eb329d7 100644 --- a/xml/System.CodeDom.Compiler/ICodeCompiler.xml +++ b/xml/System.CodeDom.Compiler/ICodeCompiler.xml @@ -37,7 +37,7 @@ ## Remarks > [!NOTE] -> Starting in .NET Framework 2.0, the , , and methods are obsolete, and the methods of and are directly available in the class. You should override those methods in your code provider implementation and not call the base methods. +> Starting in .NET Framework 2.0, the , , and methods are obsolete, and the methods of and are directly available in the class. You should override those methods in your code provider implementation and not call the base methods. The interface can be implemented for a specific compiler to enable developers to programmatically compile assemblies from Code Document Object Model (CodeDOM) compile units, strings containing source code, or source code files. diff --git a/xml/System.CodeDom.Compiler/ICodeGenerator.xml b/xml/System.CodeDom.Compiler/ICodeGenerator.xml index 4c94d166f00..a1597c1dccb 100644 --- a/xml/System.CodeDom.Compiler/ICodeGenerator.xml +++ b/xml/System.CodeDom.Compiler/ICodeGenerator.xml @@ -37,11 +37,11 @@ ## Remarks > [!NOTE] -> Starting in .NET Framework 2.0, the , , and methods are obsolete, and the methods of and are directly available in the class. You should override those methods in your code provider implementation and not call the base methods. +> Starting in .NET Framework 2.0, the , , and methods are obsolete, and the methods of and are directly available in the class. You should override those methods in your code provider implementation and not call the base methods. Developers of compilers can implement this interface to allow people to dynamically generate code in a particular language. This can be used for a variety of purposes, such as creating code-generating wizards, creating dynamic assemblies with content that can be debugged, and for templated documents with embedded code, such as ASP.NET. - An implementation is typically obtained through a call to the method of . + An implementation is typically obtained through a call to the method of . ]]> @@ -87,7 +87,7 @@ tests whether the identifier conflicts with reserved or language keywords, and if so, returns an equivalent name with language-specific escape code formatting. This is referred to an escaped identifier. The escaped identifier will contain the same `value` but will have escape code formatting added to differentiate the identifier from the keyword. Two implementation examples are preceding the `value` with "@" or bracketing the `value` with "[" and "]". + tests whether the identifier conflicts with reserved or language keywords, and if so, returns an equivalent name with language-specific escape code formatting. This is referred to an escaped identifier. The escaped identifier will contain the same `value` but will have escape code formatting added to differentiate the identifier from the keyword. Two implementation examples are preceding the `value` with "@" or bracketing the `value` with "[" and "]". ]]> @@ -134,7 +134,7 @@ tests whether the identifier conflicts with reserved or language keywords, and returns a valid identifier name that does not conflict. The returned identifier will contain the same `value` but, if it conflicts with reserved or language keywords, will have escape code formatting added to differentiate the identifier from the keyword. Typically, if the value needs modification, value is returned preceded by an underscore "_". + tests whether the identifier conflicts with reserved or language keywords, and returns a valid identifier name that does not conflict. The returned identifier will contain the same `value` but, if it conflicts with reserved or language keywords, will have escape code formatting added to differentiate the identifier from the keyword. Typically, if the value needs modification, value is returned preceded by an underscore "_". ]]> @@ -446,7 +446,7 @@ in a derived class, design the method to test the value passed to it, and return `true` only if the value fits the rules of the language and does not conflict with a keyword. + This method tests whether an identifier is valid. When implementing in a derived class, design the method to test the value passed to it, and return `true` only if the value fits the rules of the language and does not conflict with a keyword. ]]> diff --git a/xml/System.CodeDom.Compiler/TempFileCollection.xml b/xml/System.CodeDom.Compiler/TempFileCollection.xml index 5cf46907c3b..0bb8c58de64 100644 --- a/xml/System.CodeDom.Compiler/TempFileCollection.xml +++ b/xml/System.CodeDom.Compiler/TempFileCollection.xml @@ -58,17 +58,17 @@ ## Remarks can be used to generate unique file names and to keep track of a list of files. This can be useful to implementers when managing a list of compiler-generated intermediate files, which are sometimes deleted after use. - To specify a directory to generate unique temporary file names in, use an appropriately overloaded constructor. You can also use a constructor overload to indicate whether files added to the collection should, if not specified otherwise when using the or methods, be deleted when the collection is disposed or the method is called. + To specify a directory to generate unique temporary file names in, use an appropriately overloaded constructor. You can also use a constructor overload to indicate whether files added to the collection should, if not specified otherwise when using the or methods, be deleted when the collection is disposed or the method is called. - A file in any directory can be added to an instance of using the method. + A file in any directory can be added to an instance of using the method. - To generate a unique name for a temporary file of a particular file extension, call and specify the extension of the file name to generate. The method will return a string consisting of a full path to a file name of the specified extension in the directory specified by the property. The method will only return one unique file name per file name extension. + To generate a unique name for a temporary file of a particular file extension, call and specify the extension of the file name to generate. The method will return a string consisting of a full path to a file name of the specified extension in the directory specified by the property. The method will only return one unique file name per file name extension. - Both the and methods have overloads that allow you to specify whether the files should be deleted when the collection is disposed or the method is called. + Both the and methods have overloads that allow you to specify whether the files should be deleted when the collection is disposed or the method is called. - The method will delete all the files in the collection except those that are marked to be kept. + The method will delete all the files in the collection except those that are marked to be kept. - The property indicates a full path to the base file name, without a file name extension, used to generate the file names returned by the method. + The property indicates a full path to the base file name, without a file name extension, used to generate the file names returned by the method. > [!NOTE] > This class contains a link demand and an inheritance demand at the class level that applies to all members. A is thrown when either the immediate caller or the derived class does not have full-trust permission. For details about security demands, see [Link Demands](/dotnet/framework/misc/link-demands) and [Inheritance Demands](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/x4yx82e6(v=vs.100)). @@ -76,7 +76,7 @@ ## Examples - The following example shows the use of the class and the and methods. + The following example shows the use of the class and the and methods. :::code language="csharp" source="~/snippets/csharp/System.CodeDom.Compiler/TempFileCollection/Overview/program.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom.Compiler/TempFileCollection/Overview/program.vb" id="Snippet1"::: @@ -218,7 +218,7 @@ parameter. The temporary files in the collection are retained or deleted upon the completion of compiler activity based on the value of the property in the collection. As each file is added to the collection, the current value of is associated with it, unless it is added with a method that has a `keepFile` parameter, in which case that value is used for that specific file. When the method is called, if is `true`, all files are deleted, including those added with a value of `true`. This allows specific files, those identified as being keep files, to be temporarily retained after compilation for purposes such as error reporting, then deleted when they are no longer needed. + The value of `keepFiles` is used to set the parameter. The temporary files in the collection are retained or deleted upon the completion of compiler activity based on the value of the property in the collection. As each file is added to the collection, the current value of is associated with it, unless it is added with a method that has a `keepFile` parameter, in which case that value is used for that specific file. When the method is called, if is `true`, all files are deleted, including those added with a value of `true`. This allows specific files, those identified as being keep files, to be temporarily retained after compilation for purposes such as error reporting, then deleted when they are no longer needed. ]]> @@ -376,7 +376,7 @@ method to add a file that is to be kept to the collection. This code example is part of a larger example provided for the class. + The following example shows the use of the method to add a file that is to be kept to the collection. This code example is part of a larger example provided for the class. :::code language="csharp" source="~/snippets/csharp/System.CodeDom.Compiler/TempFileCollection/Overview/program.cs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom.Compiler/TempFileCollection/Overview/program.vb" id="Snippet2"::: @@ -541,7 +541,7 @@ method examines each file in the collection to determine, on an individual basis, whether the file is to be kept or deleted. Files can be explicitly marked to be kept when added to the collection using add methods that take a `keepFile` parameter. When adding a file to the collection using the overload that does not have a `keepFile` parameter the value of the property is used as the default keep file indicator. + The method examines each file in the collection to determine, on an individual basis, whether the file is to be kept or deleted. Files can be explicitly marked to be kept when added to the collection using add methods that take a `keepFile` parameter. When adding a file to the collection using the overload that does not have a `keepFile` parameter the value of the property is used as the default keep file indicator. ]]> @@ -645,9 +645,9 @@ and cleans up resources by calling `Dispose(false)`. Override `Dispose(Boolean)` to customize the cleanup. + This method overrides and cleans up resources by calling `Dispose(false)`. Override `Dispose(Boolean)` to customize the cleanup. - Application code should not call this method; an object's `Finalize` method is automatically invoked during garbage collection, unless finalization by the garbage collector has been disabled by a call to the method. + Application code should not call this method; an object's `Finalize` method is automatically invoked during garbage collection, unless finalization by the garbage collector has been disabled by a call to the method. For more information, see [Finalize Methods and Destructors](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/0s71x931(v%3dvs.100)), [Cleaning Up Unmanaged Resources](/dotnet/standard/garbage-collection/unmanaged), and [Overriding the Finalize Method](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/ddae83kx(v=vs.100)). @@ -738,7 +738,7 @@ property is used as the default value when the overload that does not have a `keepFile` parameter is called to add a temporary file to the collection. Each temporary file in the collection has an associated keep file flag that determines, on a per-file basis, whether that file is to be kept or deleted. Files are automatically kept or deleted on completion of the compilation based on their associated keep files value. However, after compilation is complete, files that were kept can be released by setting false and calling the method. This will result in all files being deleted. + The value of the property is used as the default value when the overload that does not have a `keepFile` parameter is called to add a temporary file to the collection. Each temporary file in the collection has an associated keep file flag that determines, on a per-file basis, whether that file is to be kept or deleted. Files are automatically kept or deleted on completion of the compilation based on their associated keep files value. However, after compilation is complete, files that were kept can be released by setting false and calling the method. This will result in all files being deleted. ]]> diff --git a/xml/System.CodeDom/CodeArrayCreateExpression.xml b/xml/System.CodeDom/CodeArrayCreateExpression.xml index d44f35b39d1..f7e3a5d2b63 100644 --- a/xml/System.CodeDom/CodeArrayCreateExpression.xml +++ b/xml/System.CodeDom/CodeArrayCreateExpression.xml @@ -56,7 +56,7 @@ Most arrays can be initialized immediately following declaration. The property can be set to the expression to use to initialize the array. - A only directly supports creating single-dimension arrays. If a language allows arrays of arrays, it is possible to create them by nesting a within a . Not all languages support arrays of arrays. You can check whether an for a language declares support for nested arrays by calling with the flag. + A only directly supports creating single-dimension arrays. If a language allows arrays of arrays, it is possible to create them by nesting a within a . Not all languages support arrays of arrays. You can check whether an for a language declares support for nested arrays by calling with the flag. diff --git a/xml/System.CodeDom/CodeAttributeArgument.xml b/xml/System.CodeDom/CodeAttributeArgument.xml index 0b0637a2768..4a606c8a092 100644 --- a/xml/System.CodeDom/CodeAttributeArgument.xml +++ b/xml/System.CodeDom/CodeAttributeArgument.xml @@ -56,7 +56,7 @@ The property indicates the value of the argument. The property, when used, indicates the name of a property of the attribute to which to assign the value. - Attribute declarations are frequently initialized with a number of arguments that are passed into the constructor of the attribute at run time. To provide arguments to the constructor for an attribute, add a for each argument to the collection of a . Only the property of each needs to be initialized. The order of arguments within the collection must correspond to the order of arguments in the method signature of the constructor for the attribute. + Attribute declarations are frequently initialized with a number of arguments that are passed into the constructor of the attribute at run time. To provide arguments to the constructor for an attribute, add a for each argument to the collection of a . Only the property of each needs to be initialized. The order of arguments within the collection must correspond to the order of arguments in the method signature of the constructor for the attribute. You can also set properties of the attribute that are not available through the constructor by providing a that indicates the name of the property to set, along with the value to set. diff --git a/xml/System.CodeDom/CodeAttributeArgumentCollection.xml b/xml/System.CodeDom/CodeAttributeArgumentCollection.xml index bc6a824a607..4fdc3660ad9 100644 --- a/xml/System.CodeDom/CodeAttributeArgumentCollection.xml +++ b/xml/System.CodeDom/CodeAttributeArgumentCollection.xml @@ -284,7 +284,7 @@ method overload to add the members of a array to a . + The following example demonstrates how to use the method overload to add the members of a array to a . :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeAttributeArgumentCollection/Overview/class1.cs" id="Snippet4"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeAttributeArgumentCollection/Overview/class1.vb" id="Snippet4"::: @@ -335,7 +335,7 @@ method overload to add the members of one object to another . + The following example demonstrates how to use the method overload to add the members of one object to another . :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeAttributeArgumentCollection/Overview/class1.cs" id="Snippet4"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeAttributeArgumentCollection/Overview/class1.vb" id="Snippet4"::: @@ -388,7 +388,7 @@ method to search for the presence of a specific object in a and gets the index value at which it was found. + The following example uses the method to search for the presence of a specific object in a and gets the index value at which it was found. :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeAttributeArgumentCollection/Overview/class1.cs" id="Snippet5"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeAttributeArgumentCollection/Overview/class1.vb" id="Snippet5"::: @@ -494,7 +494,7 @@ object and uses the method to get the index value at which it was found. + The following example searches for the presence of a specific object and uses the method to get the index value at which it was found. :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeAttributeArgumentCollection/Overview/class1.cs" id="Snippet5"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeAttributeArgumentCollection/Overview/class1.vb" id="Snippet5"::: @@ -545,7 +545,7 @@ method to add a object to a . + The following example demonstrates how to use the method to add a object to a . :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeAttributeArgumentCollection/Overview/class1.cs" id="Snippet8"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeAttributeArgumentCollection/Overview/class1.vb" id="Snippet8"::: @@ -640,7 +640,7 @@ method to delete a object from a . + The following example demonstrates how to use the method to delete a object from a . :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeAttributeArgumentCollection/Overview/class1.cs" id="Snippet9"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeAttributeArgumentCollection/Overview/class1.vb" id="Snippet9"::: diff --git a/xml/System.CodeDom/CodeAttributeDeclaration.xml b/xml/System.CodeDom/CodeAttributeDeclaration.xml index 16fde0c9b4d..541102023cb 100644 --- a/xml/System.CodeDom/CodeAttributeDeclaration.xml +++ b/xml/System.CodeDom/CodeAttributeDeclaration.xml @@ -149,7 +149,7 @@ and properties. + The `attributeType` parameter is used to set the and properties. ]]> @@ -235,7 +235,7 @@ and properties, and the `arguments` parameter is used to set the property for the . + The `attributeType` parameter is used to set the and properties, and the `arguments` parameter is used to set the property for the . ]]> diff --git a/xml/System.CodeDom/CodeAttributeDeclarationCollection.xml b/xml/System.CodeDom/CodeAttributeDeclarationCollection.xml index a8452659fa0..446f58a986d 100644 --- a/xml/System.CodeDom/CodeAttributeDeclarationCollection.xml +++ b/xml/System.CodeDom/CodeAttributeDeclarationCollection.xml @@ -58,7 +58,7 @@ ## Examples The following example demonstrates the use of the class methods. - + :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeAttributeDeclarationCollection/Overview/class1.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeAttributeDeclarationCollection/Overview/class1.vb" id="Snippet1"::: @@ -284,7 +284,7 @@ method overload to add an array of objects to a . + The following example demonstrates how to use method overload to add an array of objects to a . :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeAttributeDeclarationCollection/Overview/class1.cs" id="Snippet4"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeAttributeDeclarationCollection/Overview/class1.vb" id="Snippet4"::: @@ -335,7 +335,7 @@ method overload to add the members of one to another. + The following example demonstrates how to use the method overload to add the members of one to another. :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeAttributeDeclarationCollection/Overview/class1.cs" id="Snippet4"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeAttributeDeclarationCollection/Overview/class1.vb" id="Snippet4"::: @@ -388,7 +388,7 @@ method to search for the presence of a specific instance and gets the index value at which it was found. + The following example uses the method to search for the presence of a specific instance and gets the index value at which it was found. :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeAttributeDeclarationCollection/Overview/class1.cs" id="Snippet5"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeAttributeDeclarationCollection/Overview/class1.vb" id="Snippet5"::: @@ -496,7 +496,7 @@ instance and uses the method to get the index value at which it was found. + The following example searches for the presence of a specific instance and uses the method to get the index value at which it was found. :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeAttributeDeclarationCollection/Overview/class1.cs" id="Snippet5"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeAttributeDeclarationCollection/Overview/class1.vb" id="Snippet5"::: @@ -547,7 +547,7 @@ method to add a object to the . + The following example demonstrates how to use the method to add a object to the . :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeAttributeDeclarationCollection/Overview/class1.cs" id="Snippet8"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeAttributeDeclarationCollection/Overview/class1.vb" id="Snippet8"::: @@ -644,7 +644,7 @@ method to delete a object from the . + The following example demonstrates how to use the method to delete a object from the . :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeAttributeDeclarationCollection/Overview/class1.cs" id="Snippet9"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeAttributeDeclarationCollection/Overview/class1.vb" id="Snippet9"::: diff --git a/xml/System.CodeDom/CodeCatchClause.xml b/xml/System.CodeDom/CodeCatchClause.xml index dd9637b155e..be11693040a 100644 --- a/xml/System.CodeDom/CodeCatchClause.xml +++ b/xml/System.CodeDom/CodeCatchClause.xml @@ -54,7 +54,7 @@ ## Remarks can be used to represent a `catch` exception block of a `try/catch` statement. - The property specifies the type of exception to catch. The property specifies a name for the variable representing the exception that has been caught. The collection property contains the statements for the `catch` block. + The property specifies the type of exception to catch. The property specifies a name for the variable representing the exception that has been caught. The collection property contains the statements for the `catch` block. diff --git a/xml/System.CodeDom/CodeCatchClauseCollection.xml b/xml/System.CodeDom/CodeCatchClauseCollection.xml index 9fcdcabb7cb..5afa9313fb4 100644 --- a/xml/System.CodeDom/CodeCatchClauseCollection.xml +++ b/xml/System.CodeDom/CodeCatchClauseCollection.xml @@ -58,7 +58,7 @@ ## Examples The following example demonstrates the use of the class methods. The example creates a new instance of the class and uses the methods to add statements to the collection, return their index, and add or remove attributes at a specific index point. - + :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeCatchClauseCollection/Overview/class1.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeCatchClauseCollection/Overview/class1.vb" id="Snippet1"::: @@ -284,7 +284,7 @@ method overload to add the members of an array of objects to the . + The following example demonstrates how to use the method overload to add the members of an array of objects to the . :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeCatchClauseCollection/Overview/class1.cs" id="Snippet4"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeCatchClauseCollection/Overview/class1.vb" id="Snippet4"::: @@ -335,7 +335,7 @@ method overload to add the members of one object to another . + The following example demonstrates how to use the method overload to add the members of one object to another . :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeCatchClauseCollection/Overview/class1.cs" id="Snippet4"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeCatchClauseCollection/Overview/class1.vb" id="Snippet4"::: @@ -388,7 +388,7 @@ method to search for the presence of a specific instance and gets the index value at which it was found. + The following example uses the method to search for the presence of a specific instance and gets the index value at which it was found. :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeCatchClauseCollection/Overview/class1.cs" id="Snippet5"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeCatchClauseCollection/Overview/class1.vb" id="Snippet5"::: @@ -496,7 +496,7 @@ object and uses the method to get the index value at which it was found. + The following example searches for the presence of a specific object and uses the method to get the index value at which it was found. :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeCatchClauseCollection/Overview/class1.cs" id="Snippet5"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeCatchClauseCollection/Overview/class1.vb" id="Snippet5"::: @@ -547,7 +547,7 @@ method to add a object to a . + The following example demonstrates how to use the method to add a object to a . :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeCatchClauseCollection/Overview/class1.cs" id="Snippet8"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeCatchClauseCollection/Overview/class1.vb" id="Snippet8"::: @@ -644,7 +644,7 @@ method to delete a object from a . + The following example demonstrates how to use the method to delete a object from a . :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeCatchClauseCollection/Overview/class1.cs" id="Snippet9"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeCatchClauseCollection/Overview/class1.vb" id="Snippet9"::: diff --git a/xml/System.CodeDom/CodeChecksumPragma.xml b/xml/System.CodeDom/CodeChecksumPragma.xml index bf1948786e9..106d2ecd538 100644 --- a/xml/System.CodeDom/CodeChecksumPragma.xml +++ b/xml/System.CodeDom/CodeChecksumPragma.xml @@ -111,7 +111,7 @@ constructor. This code example is part of a larger example provided for the class. + The following code example shows the use of the constructor. This code example is part of a larger example provided for the class. :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeChecksumPragma/Overview/codedirective.cs" id="Snippet4"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeChecksumPragma/Overview/codedirective.vb" id="Snippet4"::: @@ -170,7 +170,7 @@ ## Examples - The following code example shows the use of the constructor. This code example is part of a larger example provided for the class. + The following code example shows the use of the constructor. This code example is part of a larger example provided for the class. :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeChecksumPragma/Overview/codedirective.cs" id="Snippet8"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeChecksumPragma/Overview/codedirective.vb" id="Snippet8"::: diff --git a/xml/System.CodeDom/CodeCommentStatement.xml b/xml/System.CodeDom/CodeCommentStatement.xml index 3f2e8ee4cd6..8e6e81ce913 100644 --- a/xml/System.CodeDom/CodeCommentStatement.xml +++ b/xml/System.CodeDom/CodeCommentStatement.xml @@ -58,7 +58,7 @@ ## Examples This example demonstrates using a to represent a comment in source code. - + :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeComment/Overview/codecommentexample.cs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeComment/Overview/codecommentexample.vb" id="Snippet2"::: @@ -233,7 +233,7 @@ ## Examples - The following code example demonstrates the use of the constructor to create a comment statement to be used as an XML comment field. This example is part of a larger example that follows. + The following code example demonstrates the use of the constructor to create a comment statement to be used as an XML comment field. This example is part of a larger example that follows. :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeCommentStatement/.ctor/program.cs" id="Snippet3"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeCommentStatement/.ctor/program.vb" id="Snippet3"::: diff --git a/xml/System.CodeDom/CodeCommentStatementCollection.xml b/xml/System.CodeDom/CodeCommentStatementCollection.xml index 84be3cdc334..386dd891e71 100644 --- a/xml/System.CodeDom/CodeCommentStatementCollection.xml +++ b/xml/System.CodeDom/CodeCommentStatementCollection.xml @@ -58,7 +58,7 @@ ## Examples The following example demonstrates the use of the class methods. The example creates a new instance of the class and uses the methods to add statements to the collection, return their index, and add or remove attributes at a specific index point. - + :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeCommentStatementCollection/Overview/class1.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeCommentStatementCollection/Overview/class1.vb" id="Snippet1"::: @@ -284,7 +284,7 @@ method overload to add the members of a array to the . + The following example demonstrates how to use the method overload to add the members of a array to the . :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeCommentStatementCollection/Overview/class1.cs" id="Snippet4"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeCommentStatementCollection/Overview/class1.vb" id="Snippet4"::: @@ -335,7 +335,7 @@ method overload to add the members of one to another. + The following example demonstrates how to use the method overload to add the members of one to another. :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeCommentStatementCollection/Overview/class1.cs" id="Snippet4"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeCommentStatementCollection/Overview/class1.vb" id="Snippet4"::: @@ -388,7 +388,7 @@ method to search for the presence of a specific object and gets the index value at which it was found. + The following example uses the method to search for the presence of a specific object and gets the index value at which it was found. :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeCommentStatementCollection/Overview/class1.cs" id="Snippet5"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeCommentStatementCollection/Overview/class1.vb" id="Snippet5"::: @@ -496,7 +496,7 @@ object and uses the method to get the index value at which it was found. + The following example searches for the presence of a specific object and uses the method to get the index value at which it was found. :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeCommentStatementCollection/Overview/class1.cs" id="Snippet5"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeCommentStatementCollection/Overview/class1.vb" id="Snippet5"::: @@ -547,7 +547,7 @@ method to add a object to the . + The following example demonstrates how to use the method to add a object to the . :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeCommentStatementCollection/Overview/class1.cs" id="Snippet8"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeCommentStatementCollection/Overview/class1.vb" id="Snippet8"::: @@ -643,7 +643,7 @@ method to delete a object from the . + The following example demonstrates how to use the method to delete a object from the . :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeCommentStatementCollection/Overview/class1.cs" id="Snippet9"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeCommentStatementCollection/Overview/class1.vb" id="Snippet9"::: diff --git a/xml/System.CodeDom/CodeCompileUnit.xml b/xml/System.CodeDom/CodeCompileUnit.xml index 1308d244f22..14b535b7991 100644 --- a/xml/System.CodeDom/CodeCompileUnit.xml +++ b/xml/System.CodeDom/CodeCompileUnit.xml @@ -56,7 +56,7 @@ contains a collection that can store objects containing CodeDOM source code graphs, along with a collection of assemblies referenced by the project, and a collection of attributes for the project assembly. - A can be passed to the method of an implementation along with other parameters to generate code based on the program graph contained by the compile unit. + A can be passed to the method of an implementation along with other parameters to generate code based on the program graph contained by the compile unit. > [!NOTE] > Some languages support only a single namespace that contains a single class in a compile unit. diff --git a/xml/System.CodeDom/CodeConditionStatement.xml b/xml/System.CodeDom/CodeConditionStatement.xml index e279831e964..39ae38b2f9e 100644 --- a/xml/System.CodeDom/CodeConditionStatement.xml +++ b/xml/System.CodeDom/CodeConditionStatement.xml @@ -241,7 +241,7 @@ collection will be executed. If this conditional expression evaluates to `false` and the collection is not empty, the code contained in the collection will be executed. + If this conditional expression evaluates to `true`, the code contained in the collection will be executed. If this conditional expression evaluates to `false` and the collection is not empty, the code contained in the collection will be executed. ]]> diff --git a/xml/System.CodeDom/CodeDirectiveCollection.xml b/xml/System.CodeDom/CodeDirectiveCollection.xml index a941647c9ba..0691a475adb 100644 --- a/xml/System.CodeDom/CodeDirectiveCollection.xml +++ b/xml/System.CodeDom/CodeDirectiveCollection.xml @@ -48,19 +48,19 @@ Represents a collection of objects. - class provides a simple collection object that can be used to store a set of objects. - - - -## Examples - The following code example shows the use of the members of the class. - + class provides a simple collection object that can be used to store a set of objects. + + + +## Examples + The following code example shows the use of the members of the class. + :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeDirectiveCollection/Overview/class1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeDirectiveCollection/Overview/class1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeDirectiveCollection/Overview/class1.vb" id="Snippet1"::: + ]]> @@ -109,14 +109,14 @@ Initializes a new instance of the class. - constructor to create a new instance of the class. This example is part of a larger example provided for the class. - + constructor to create a new instance of the class. This example is part of a larger example provided for the class. + :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeDirectiveCollection/Overview/class1.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeDirectiveCollection/Overview/class1.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeDirectiveCollection/Overview/class1.vb" id="Snippet2"::: + ]]> @@ -229,14 +229,14 @@ Adds the specified object to the collection. The index position at which the new element was inserted. - method to add a object to the collection. This example is part of a larger example provided for the class. - + method to add a object to the collection. This example is part of a larger example provided for the class. + :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeDirectiveCollection/Overview/class1.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeDirectiveCollection/Overview/class1.vb" id="Snippet3"::: - + :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeDirectiveCollection/Overview/class1.vb" id="Snippet3"::: + ]]> @@ -286,14 +286,14 @@ An array of objects to add to the collection. Adds an array of objects to the end of the collection. - method to add an array of objects to the collection. This example is part of a larger example provided for the class. - + method to add an array of objects to the collection. This example is part of a larger example provided for the class. + :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeDirectiveCollection/Overview/class1.cs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeDirectiveCollection/Overview/class1.vb" id="Snippet4"::: - + :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeDirectiveCollection/Overview/class1.vb" id="Snippet4"::: + ]]> @@ -336,14 +336,14 @@ A object containing the objects to add to the collection. Adds the contents of the specified object to the end of the collection. - method to add the contents of a object to the collection. This example is part of a larger example provided for the class. - + method to add the contents of a object to the collection. This example is part of a larger example provided for the class. + :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeDirectiveCollection/Overview/class1.cs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeDirectiveCollection/Overview/class1.vb" id="Snippet4"::: - + :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeDirectiveCollection/Overview/class1.vb" id="Snippet4"::: + ]]> @@ -387,14 +387,14 @@ if the collection contains the specified object; otherwise, . - method to determine whether the collection contains a specific object. This example is part of a larger example provided for the class. - + method to determine whether the collection contains a specific object. This example is part of a larger example provided for the class. + :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeDirectiveCollection/Overview/class1.cs" id="Snippet5"::: - :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeDirectiveCollection/Overview/class1.vb" id="Snippet5"::: - + :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeDirectiveCollection/Overview/class1.vb" id="Snippet5"::: + ]]> @@ -436,20 +436,20 @@ The index in the array at which to begin inserting collection objects. Copies the contents of the collection to a one-dimensional array beginning at the specified index. - method to copy the contents of the collection beginning at index 0 to the specified array. This example is part of a larger example provided for the class. - + method to copy the contents of the collection beginning at index 0 to the specified array. This example is part of a larger example provided for the class. + :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeDirectiveCollection/Overview/class1.cs" id="Snippet6"::: - :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeDirectiveCollection/Overview/class1.vb" id="Snippet6"::: - + :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeDirectiveCollection/Overview/class1.vb" id="Snippet6"::: + ]]> - The destination array is multidimensional. - - -or- - + The destination array is multidimensional. + + -or- + The number of elements in the is greater than the available space between the index of the target array specified by and the end of the target array. is . @@ -493,14 +493,14 @@ Gets the index in the collection of the specified object, if it exists in the collection. The index position in the collection of the specified object, if found; otherwise, -1. - method to get the index in the collection of the specified object. This example is part of a larger example provided for the class. - + method to get the index in the collection of the specified object. This example is part of a larger example provided for the class. + :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeDirectiveCollection/Overview/class1.cs" id="Snippet5"::: - :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeDirectiveCollection/Overview/class1.vb" id="Snippet5"::: - + :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeDirectiveCollection/Overview/class1.vb" id="Snippet5"::: + ]]> @@ -542,21 +542,21 @@ The object to insert. Inserts the specified object into the collection at the specified index. - method to insert a object at index 0 of the collection. This example is part of a larger example provided for the class. - + method to insert a object at index 0 of the collection. This example is part of a larger example provided for the class. + :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeDirectiveCollection/Overview/class1.cs" id="Snippet8"::: - :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeDirectiveCollection/Overview/class1.vb" id="Snippet8"::: - + :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeDirectiveCollection/Overview/class1.vb" id="Snippet8"::: + ]]> - is less than 0. - - -or- - + is less than 0. + + -or- + is greater than . @@ -596,11 +596,11 @@ Gets or sets the object at the specified index in the collection. The at the index position. - @@ -642,14 +642,14 @@ The object to remove from the collection. Removes the specified object from the collection. - method to remove the specified object from the collection. This example is part of a larger example provided for the class. - + method to remove the specified object from the collection. This example is part of a larger example provided for the class. + :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeDirectiveCollection/Overview/class1.cs" id="Snippet9"::: - :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeDirectiveCollection/Overview/class1.vb" id="Snippet9"::: - + :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeDirectiveCollection/Overview/class1.vb" id="Snippet9"::: + ]]> The specified object is not found in the collection. diff --git a/xml/System.CodeDom/CodeExpressionCollection.xml b/xml/System.CodeDom/CodeExpressionCollection.xml index 1401490416f..f385f53772d 100644 --- a/xml/System.CodeDom/CodeExpressionCollection.xml +++ b/xml/System.CodeDom/CodeExpressionCollection.xml @@ -60,7 +60,7 @@ ## Examples The following example demonstrates the use of the class methods. The example creates a new instance of the class and uses the methods to add statements to the collection, return their index, and add or remove attributes at a specific index point. - + :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeExpressionCollection/Overview/class1.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeExpressionCollection/Overview/class1.vb" id="Snippet1"::: @@ -286,7 +286,7 @@ method overload to add the members of a array to a . + The following example demonstrates how to use the method overload to add the members of a array to a . :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeExpressionCollection/Overview/class1.cs" id="Snippet4"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeExpressionCollection/Overview/class1.vb" id="Snippet4"::: @@ -337,7 +337,7 @@ method overload to add the members of one object to another . + The following example demonstrates how to use the method overload to add the members of one object to another . :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeExpressionCollection/Overview/class1.cs" id="Snippet4"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeExpressionCollection/Overview/class1.vb" id="Snippet4"::: @@ -390,7 +390,7 @@ method to search for the presence of a specific object and gets the index value at which it was found. + The following example uses the method to search for the presence of a specific object and gets the index value at which it was found. :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeExpressionCollection/Overview/class1.cs" id="Snippet5"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeExpressionCollection/Overview/class1.vb" id="Snippet5"::: @@ -498,7 +498,7 @@ object and uses the method to get the index value at which it was found. + The following example searches for the presence of a specific object and uses the method to get the index value at which it was found. :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeExpressionCollection/Overview/class1.cs" id="Snippet5"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeExpressionCollection/Overview/class1.vb" id="Snippet5"::: @@ -549,7 +549,7 @@ method to add a object to a . + The following example demonstrates how to use the method to add a object to a . :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeExpressionCollection/Overview/class1.cs" id="Snippet8"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeExpressionCollection/Overview/class1.vb" id="Snippet8"::: @@ -645,7 +645,7 @@ method to delete a object from a . + The following example demonstrates how to use the method to delete a object from a . :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeExpressionCollection/Overview/class1.cs" id="Snippet9"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeExpressionCollection/Overview/class1.vb" id="Snippet9"::: diff --git a/xml/System.CodeDom/CodeGotoStatement.xml b/xml/System.CodeDom/CodeGotoStatement.xml index d407df5da12..3bd91fbeaca 100644 --- a/xml/System.CodeDom/CodeGotoStatement.xml +++ b/xml/System.CodeDom/CodeGotoStatement.xml @@ -57,7 +57,7 @@ The property indicates the name of the label at which to continue program execution. > [!NOTE] -> Not all languages support `goto` statements. Call the method with the flag to determine whether a code generator supports `goto` statements. +> Not all languages support `goto` statements. Call the method with the flag to determine whether a code generator supports `goto` statements. diff --git a/xml/System.CodeDom/CodeLabeledStatement.xml b/xml/System.CodeDom/CodeLabeledStatement.xml index e3d5b5e74a5..6053be0ff3f 100644 --- a/xml/System.CodeDom/CodeLabeledStatement.xml +++ b/xml/System.CodeDom/CodeLabeledStatement.xml @@ -57,7 +57,7 @@ The property is optional. To create only a label, leave the property uninitialized. > [!NOTE] -> Not all languages support `goto` statements and labels, so you should test whether a code generator supports `goto` statements and labels by calling the method with the flag. +> Not all languages support `goto` statements and labels, so you should test whether a code generator supports `goto` statements and labels by calling the method with the flag. diff --git a/xml/System.CodeDom/CodeLinePragma.xml b/xml/System.CodeDom/CodeLinePragma.xml index 5066db33bb5..14f9488bfc0 100644 --- a/xml/System.CodeDom/CodeLinePragma.xml +++ b/xml/System.CodeDom/CodeLinePragma.xml @@ -112,7 +112,7 @@ and properties. + If you use this constructor you should also set the and properties. ]]> diff --git a/xml/System.CodeDom/CodeMemberField.xml b/xml/System.CodeDom/CodeMemberField.xml index eb8787e5eb8..1f71ff89094 100644 --- a/xml/System.CodeDom/CodeMemberField.xml +++ b/xml/System.CodeDom/CodeMemberField.xml @@ -195,7 +195,7 @@ > [!NOTE] > You must use square brackets ([]) and not the C# angle brackets (<>) to delimit generic parameters. - To avoid the possibility of making a syntactic mistake, consider using the constructor that takes a type instead of a string as a parameter. + To avoid the possibility of making a syntactic mistake, consider using the constructor that takes a type instead of a string as a parameter. ]]> diff --git a/xml/System.CodeDom/CodeMemberMethod.xml b/xml/System.CodeDom/CodeMemberMethod.xml index 8094f91f826..59d09d8a525 100644 --- a/xml/System.CodeDom/CodeMemberMethod.xml +++ b/xml/System.CodeDom/CodeMemberMethod.xml @@ -105,7 +105,7 @@ ## Examples - The following code example shows the use of the constructor to create a instance. This example is part of a larger example provided for the method. + The following code example shows the use of the constructor to create a instance. This example is part of a larger example provided for the method. :::code language="csharp" source="~/snippets/csharp/Microsoft.CSharp/CSharpCodeProvider/GenerateCodeFromMember/program.cs" id="Snippet3"::: :::code language="vb" source="~/snippets/visualbasic/Microsoft.CSharp/CSharpCodeProvider/GenerateCodeFromMember/module1.vb" id="Snippet3"::: diff --git a/xml/System.CodeDom/CodeMemberProperty.xml b/xml/System.CodeDom/CodeMemberProperty.xml index eb1ed29d072..0b16d98af7b 100644 --- a/xml/System.CodeDom/CodeMemberProperty.xml +++ b/xml/System.CodeDom/CodeMemberProperty.xml @@ -188,7 +188,7 @@ ## Remarks > [!NOTE] -> Setting this property to `false` clears the collection. +> Setting this property to `false` clears the collection. ]]> @@ -232,10 +232,10 @@ will return `false` if the property is read-only. + will return `false` if the property is read-only. > [!NOTE] -> Setting this property to `false` will clear the collection. +> Setting this property to `false` will clear the collection. ]]> diff --git a/xml/System.CodeDom/CodeNamespaceCollection.xml b/xml/System.CodeDom/CodeNamespaceCollection.xml index e5ee120bc06..c6f54b5453f 100644 --- a/xml/System.CodeDom/CodeNamespaceCollection.xml +++ b/xml/System.CodeDom/CodeNamespaceCollection.xml @@ -236,7 +236,7 @@ method to add a object to a instance. + The following example demonstrates how to use the method to add a object to a instance. :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeNamespaceCollection/Overview/class1.cs" id="Snippet3"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeNamespaceCollection/Overview/class1.vb" id="Snippet3"::: @@ -294,7 +294,7 @@ method overload to add members of a array to the . + The following example demonstrates how to use the method overload to add members of a array to the . :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeNamespaceCollection/Overview/class1.cs" id="Snippet4"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeNamespaceCollection/Overview/class1.vb" id="Snippet4"::: @@ -345,7 +345,7 @@ method overload to add objects from one to another . + The following example demonstrates how to use the method overload to add objects from one to another . :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeNamespaceCollection/Overview/class1.cs" id="Snippet4"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeNamespaceCollection/Overview/class1.vb" id="Snippet4"::: @@ -398,7 +398,7 @@ method to find a object in a . + The following example uses the method to find a object in a . :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeNamespaceCollection/Overview/class1.cs" id="Snippet5"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeNamespaceCollection/Overview/class1.vb" id="Snippet5"::: @@ -449,7 +449,7 @@ method to copy the contents of a object to an array, starting at the specified index value. + The following example demonstrates how to use the method to copy the contents of a object to an array, starting at the specified index value. :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeNamespaceCollection/Overview/class1.cs" id="Snippet6"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeNamespaceCollection/Overview/class1.vb" id="Snippet6"::: @@ -506,7 +506,7 @@ and uses the method to retrieve the index value at which it was found. + The following example searches for the presence of a specific and uses the method to retrieve the index value at which it was found. :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeNamespaceCollection/Overview/class1.cs" id="Snippet5"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeNamespaceCollection/Overview/class1.vb" id="Snippet5"::: @@ -557,7 +557,7 @@ method to insert a object into a . + The following example demonstrates how to use the method to insert a object into a . :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeNamespaceCollection/Overview/class1.cs" id="Snippet8"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeNamespaceCollection/Overview/class1.vb" id="Snippet8"::: @@ -654,7 +654,7 @@ method to delete a object from a . + The following example demonstrates how to use the method to delete a object from a . :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeNamespaceCollection/Overview/class1.cs" id="Snippet9"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeNamespaceCollection/Overview/class1.vb" id="Snippet9"::: diff --git a/xml/System.CodeDom/CodeNamespaceImportCollection.xml b/xml/System.CodeDom/CodeNamespaceImportCollection.xml index 2d95978ce1d..328fe8b53fb 100644 --- a/xml/System.CodeDom/CodeNamespaceImportCollection.xml +++ b/xml/System.CodeDom/CodeNamespaceImportCollection.xml @@ -197,7 +197,7 @@ method to add the members of a array to a . + The following example demonstrates how to use the method to add the members of a array to a . :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeExpressionStatement/Overview/class1.cs" id="Snippet6"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeExpressionStatement/Overview/class1.vb" id="Snippet6"::: diff --git a/xml/System.CodeDom/CodeParameterDeclarationExpression.xml b/xml/System.CodeDom/CodeParameterDeclarationExpression.xml index f68d2fed9e2..4ad330f5a3d 100644 --- a/xml/System.CodeDom/CodeParameterDeclarationExpression.xml +++ b/xml/System.CodeDom/CodeParameterDeclarationExpression.xml @@ -195,7 +195,7 @@ > [!NOTE] > You must use square brackets ([]) and not the C# angle brackets (<>) to delimit generic parameters. - To avoid the possibility of making a syntactic mistake, consider using the constructor that takes a type instead of a string as a parameter. + To avoid the possibility of making a syntactic mistake, consider using the constructor that takes a type instead of a string as a parameter. ]]> diff --git a/xml/System.CodeDom/CodeParameterDeclarationExpressionCollection.xml b/xml/System.CodeDom/CodeParameterDeclarationExpressionCollection.xml index a98680477cd..992156a5362 100644 --- a/xml/System.CodeDom/CodeParameterDeclarationExpressionCollection.xml +++ b/xml/System.CodeDom/CodeParameterDeclarationExpressionCollection.xml @@ -284,7 +284,7 @@ method overload to add the members of a array to a . + The following example demonstrates how to use the method overload to add the members of a array to a . :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeParameterDeclarationExpressionCollection/Overview/class1.cs" id="Snippet4"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeParameterDeclarationExpressionCollection/Overview/class1.vb" id="Snippet4"::: @@ -335,7 +335,7 @@ method overload to add the members of one object to another . + The following example demonstrates how to use the method overload to add the members of one object to another . :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeParameterDeclarationExpressionCollection/Overview/class1.cs" id="Snippet4"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeParameterDeclarationExpressionCollection/Overview/class1.vb" id="Snippet4"::: @@ -388,7 +388,7 @@ method to search for the presence of a specific object and get the index value at which it was found. + The following example uses the method to search for the presence of a specific object and get the index value at which it was found. :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeParameterDeclarationExpressionCollection/Overview/class1.cs" id="Snippet5"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeParameterDeclarationExpressionCollection/Overview/class1.vb" id="Snippet5"::: @@ -496,7 +496,7 @@ instance and uses the method to get the index value at which it was found. + The following example searches for the presence of a specific instance and uses the method to get the index value at which it was found. :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeParameterDeclarationExpressionCollection/Overview/class1.cs" id="Snippet5"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeParameterDeclarationExpressionCollection/Overview/class1.vb" id="Snippet5"::: @@ -547,7 +547,7 @@ method to add a object to a . + The following example demonstrates how to use the method to add a object to a . :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeParameterDeclarationExpressionCollection/Overview/class1.cs" id="Snippet8"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeParameterDeclarationExpressionCollection/Overview/class1.vb" id="Snippet8"::: @@ -643,7 +643,7 @@ method to delete a object from a . + The following example demonstrates how to use the method to delete a object from a . :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeParameterDeclarationExpressionCollection/Overview/class1.cs" id="Snippet9"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeParameterDeclarationExpressionCollection/Overview/class1.vb" id="Snippet9"::: diff --git a/xml/System.CodeDom/CodeRegionDirective.xml b/xml/System.CodeDom/CodeRegionDirective.xml index 8886a350476..742fe6e3f6b 100644 --- a/xml/System.CodeDom/CodeRegionDirective.xml +++ b/xml/System.CodeDom/CodeRegionDirective.xml @@ -114,7 +114,7 @@ and properties. + If you use this constructor, you should also set the and properties. ]]> @@ -157,7 +157,7 @@ constructor. This code example is part of a larger example provided for the class. + The following code example shows the use of the constructor. This code example is part of a larger example provided for the class. :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeChecksumPragma/Overview/codedirective.cs" id="Snippet9"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeChecksumPragma/Overview/codedirective.vb" id="Snippet9"::: diff --git a/xml/System.CodeDom/CodeSnippetExpression.xml b/xml/System.CodeDom/CodeSnippetExpression.xml index e648e2bbacc..4c1638323e0 100644 --- a/xml/System.CodeDom/CodeSnippetExpression.xml +++ b/xml/System.CodeDom/CodeSnippetExpression.xml @@ -150,7 +150,7 @@ constructor to create an instance of the class. + The following code example demonstrates in the use of the constructor to create an instance of the class. :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeExpressionStatement/Overview/class1.cs" id="Snippet9"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeExpressionStatement/Overview/class1.vb" id="Snippet9"::: diff --git a/xml/System.CodeDom/CodeSnippetTypeMember.xml b/xml/System.CodeDom/CodeSnippetTypeMember.xml index c4cdea19b97..25d056ab3e7 100644 --- a/xml/System.CodeDom/CodeSnippetTypeMember.xml +++ b/xml/System.CodeDom/CodeSnippetTypeMember.xml @@ -61,7 +61,7 @@ ## Examples - The following example demonstrates the use of the class to store literal code in a string format. This code example is part of a larger example provided for the method. + The following example demonstrates the use of the class to store literal code in a string format. This code example is part of a larger example provided for the method. :::code language="csharp" source="~/snippets/csharp/Microsoft.CSharp/CSharpCodeProvider/GenerateCodeFromMember/program.cs" id="Snippet3"::: :::code language="vb" source="~/snippets/visualbasic/Microsoft.CSharp/CSharpCodeProvider/GenerateCodeFromMember/module1.vb" id="Snippet3"::: @@ -152,7 +152,7 @@ constructor to create an instance of the class. This code example is part of a larger example provided for the method. + The following example demonstrates the use of the constructor to create an instance of the class. This code example is part of a larger example provided for the method. :::code language="csharp" source="~/snippets/csharp/Microsoft.CSharp/CSharpCodeProvider/GenerateCodeFromMember/program.cs" id="Snippet3"::: :::code language="vb" source="~/snippets/visualbasic/Microsoft.CSharp/CSharpCodeProvider/GenerateCodeFromMember/module1.vb" id="Snippet3"::: diff --git a/xml/System.CodeDom/CodeStatementCollection.xml b/xml/System.CodeDom/CodeStatementCollection.xml index 3104ee7e277..5de0d7e2039 100644 --- a/xml/System.CodeDom/CodeStatementCollection.xml +++ b/xml/System.CodeDom/CodeStatementCollection.xml @@ -344,7 +344,7 @@ method overload to add the members of an array to a instance. + The following example demonstrates how to use the method overload to add the members of an array to a instance. :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeStatementCollection/Overview/class1.cs" id="Snippet4"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeStatementCollection/Overview/class1.vb" id="Snippet4"::: @@ -395,7 +395,7 @@ method overload to add the members of one to another. + The following example demonstrates how to use the method overload to add the members of one to another. :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeStatementCollection/Overview/class1.cs" id="Snippet4"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeStatementCollection/Overview/class1.vb" id="Snippet4"::: @@ -448,7 +448,7 @@ method to search for the presence of a specific and retrieve the index value at which it was found. + The following example uses the method to search for the presence of a specific and retrieve the index value at which it was found. :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeStatementCollection/Overview/class1.cs" id="Snippet5"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeStatementCollection/Overview/class1.vb" id="Snippet5"::: @@ -556,7 +556,7 @@ and uses the method to retrieve the index value at which it was found. + The following example searches for the presence of a specific and uses the method to retrieve the index value at which it was found. :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeStatementCollection/Overview/class1.cs" id="Snippet5"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeStatementCollection/Overview/class1.vb" id="Snippet5"::: @@ -607,7 +607,7 @@ method to add a object to a . + The following example demonstrates how to use the method to add a object to a . :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeStatementCollection/Overview/class1.cs" id="Snippet8"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeStatementCollection/Overview/class1.vb" id="Snippet8"::: @@ -703,7 +703,7 @@ method to delete a object from a . + The following example demonstrates how to use the method to delete a object from a . :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeStatementCollection/Overview/class1.cs" id="Snippet9"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeStatementCollection/Overview/class1.vb" id="Snippet9"::: diff --git a/xml/System.CodeDom/CodeTryCatchFinallyStatement.xml b/xml/System.CodeDom/CodeTryCatchFinallyStatement.xml index fda171fa112..da05bfd8ed4 100644 --- a/xml/System.CodeDom/CodeTryCatchFinallyStatement.xml +++ b/xml/System.CodeDom/CodeTryCatchFinallyStatement.xml @@ -57,7 +57,7 @@ The property contains the statements to execute within a `try` block. The property contains the `catch` clauses to handle caught exceptions. The property contains the statements to execute within a `finally` block. > [!NOTE] -> Not all languages support `try`/`catch` blocks. Call the method with the flag to determine whether a code generator supports `try`/`catch` blocks. +> Not all languages support `try`/`catch` blocks. Call the method with the flag to determine whether a code generator supports `try`/`catch` blocks. diff --git a/xml/System.CodeDom/CodeTypeConstructor.xml b/xml/System.CodeDom/CodeTypeConstructor.xml index aa330739d99..9975fec633d 100644 --- a/xml/System.CodeDom/CodeTypeConstructor.xml +++ b/xml/System.CodeDom/CodeTypeConstructor.xml @@ -55,7 +55,7 @@ can be used to represent the static constructor for a class. A static constructor is called once when the type is loaded. > [!NOTE] -> Not all languages support static constructors. Support for static constructors can be checked by calling with the flag to determine if static constructors are supported by the code generator for a particular language. +> Not all languages support static constructors. Support for static constructors can be checked by calling with the flag to determine if static constructors are supported by the code generator for a particular language. diff --git a/xml/System.CodeDom/CodeTypeDeclaration.xml b/xml/System.CodeDom/CodeTypeDeclaration.xml index bc1fb1b7a3d..51df57fbec4 100644 --- a/xml/System.CodeDom/CodeTypeDeclaration.xml +++ b/xml/System.CodeDom/CodeTypeDeclaration.xml @@ -54,12 +54,12 @@ ## Remarks can be used to represent code that declares a class, structure, interface, or enumeration. can be used to declare a type that is nested within another type. - The property specifies the base type or base types of the type being declared. The property contains the type members, which can include methods, fields, properties, comments and other types. The property indicates the values for the type declaration, which indicate the type category of the type. The , , , and methods indicate whether the type is a class, structure, enumeration, or interface type, respectively. + The property specifies the base type or base types of the type being declared. The property contains the type members, which can include methods, fields, properties, comments and other types. The property indicates the values for the type declaration, which indicate the type category of the type. The , , , and methods indicate whether the type is a class, structure, enumeration, or interface type, respectively. > [!NOTE] -> Some programming languages only support the declaration of reference types, or classes. To check a language-specific CodeDOM code generator for support for declaring interfaces, enumerations, or value types, call the method to test for the appropriate flags. indicates support for interfaces, indicates support for enumerations, and indicates support for value types such as structures. +> Some programming languages only support the declaration of reference types, or classes. To check a language-specific CodeDOM code generator for support for declaring interfaces, enumerations, or value types, call the method to test for the appropriate flags. indicates support for interfaces, indicates support for enumerations, and indicates support for value types such as structures. - You can build a class or a structure implementation in one complete declaration, or spread the implementation across multiple declarations. The property indicates whether the type declaration is complete or partial. Not all code generators support partial type declarations, so you should test for this support by calling the method with the flag . + You can build a class or a structure implementation in one complete declaration, or spread the implementation across multiple declarations. The property indicates whether the type declaration is complete or partial. Not all code generators support partial type declarations, so you should test for this support by calling the method with the flag . @@ -186,7 +186,7 @@ as the first item in the collection. + To generate a class in Visual Basic that does not inherit from a base type, but that does implement one or more interfaces, you must include as the first item in the collection. > [!NOTE] > In the .NET Framework version 2.0 you do not need the for if the interface you are implementing already exists and you are referring to it by type. For example, if you are implementing the interface and add it to the collection with this statement, `ctd.BaseTypes.Add(New CodeTypeReference(typeof(ICollection)))`, you do not need the preceding `ctd.BaseTypes.Add(New CodeTypeReference(GetType(Object)))` statement. @@ -391,7 +391,7 @@ Implements Interface1 A partial type declaration makes it easier to build different portions of a class or structure implementation in different modules of your application. The partial type declarations can be stored in one source file, or spread across multiple source files that are eventually compiled together to form the combined type implementation. - The C# language supports partial type declarations of classes and structures through the `partial` keyword. Visual Basic supports partial type declarations of classes and structures with the `Partial` keyword. Not all code generators support partial type declarations, so you should test for this support by calling the method with the flag . + The C# language supports partial type declarations of classes and structures through the `partial` keyword. Visual Basic supports partial type declarations of classes and structures with the `Partial` keyword. Not all code generators support partial type declarations, so you should test for this support by calling the method with the flag . > [!NOTE] > Partial type declarations are supported for classes and structures. If you specify a partial type declaration for an enumeration or interface, the generated code produces compiler errors. @@ -666,7 +666,7 @@ Implements Interface1 class contains the type parameter `T`. + A generic type declaration contains one or more unspecified types known as type parameters. A type parameter name stands for the type within the body of the generic declaration. For example, the generic declaration for the class contains the type parameter `T`. For more information on generics, see [Generics in the .NET Framework Class Library](/dotnet/csharp/programming-guide/generics/generics-in-the-net-framework-class-library). diff --git a/xml/System.CodeDom/CodeTypeDeclarationCollection.xml b/xml/System.CodeDom/CodeTypeDeclarationCollection.xml index 8c8c73e9633..89d1b2aece4 100644 --- a/xml/System.CodeDom/CodeTypeDeclarationCollection.xml +++ b/xml/System.CodeDom/CodeTypeDeclarationCollection.xml @@ -233,7 +233,7 @@ method to add a object to a . + The following example demonstrates how to use the method to add a object to a . :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeTypeDeclarationCollection/Overview/class1.cs" id="Snippet3"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeTypeDeclarationCollection/Overview/class1.vb" id="Snippet3"::: @@ -291,7 +291,7 @@ method overload to add an array of objects to a . + The following example demonstrates how to use the method overload to add an array of objects to a . :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeTypeDeclarationCollection/Overview/class1.cs" id="Snippet4"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeTypeDeclarationCollection/Overview/class1.vb" id="Snippet4"::: @@ -342,7 +342,7 @@ method overload to add objects from one to another . + The following example demonstrates how to use the method overload to add objects from one to another . :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeTypeDeclarationCollection/Overview/class1.cs" id="Snippet4"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeTypeDeclarationCollection/Overview/class1.vb" id="Snippet4"::: @@ -395,7 +395,7 @@ method to find a object in a . + The following example demonstrates how to use the method to find a object in a . :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeTypeDeclarationCollection/Overview/class1.cs" id="Snippet5"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeTypeDeclarationCollection/Overview/class1.vb" id="Snippet5"::: @@ -446,7 +446,7 @@ method to copy the contents of a object to an array, starting at the specified index value. + The following example demonstrates how to use the method to copy the contents of a object to an array, starting at the specified index value. :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeTypeDeclarationCollection/Overview/class1.cs" id="Snippet6"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeTypeDeclarationCollection/Overview/class1.vb" id="Snippet6"::: @@ -503,7 +503,7 @@ entries from a object and displays their names and indexes returned by the method. + The following example retrieves entries from a object and displays their names and indexes returned by the method. :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeTypeDeclarationCollection/Overview/class1.cs" id="Snippet5"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeTypeDeclarationCollection/Overview/class1.vb" id="Snippet5"::: @@ -554,7 +554,7 @@ method to insert a object into a . + The following example demonstrates how to use the method to insert a object into a . :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeTypeDeclarationCollection/Overview/class1.cs" id="Snippet8"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeTypeDeclarationCollection/Overview/class1.vb" id="Snippet8"::: @@ -650,7 +650,7 @@ method to delete a object from a . + The following example demonstrates how to use the method to delete a object from a . :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeTypeDeclarationCollection/Overview/class1.cs" id="Snippet9"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeTypeDeclarationCollection/Overview/class1.vb" id="Snippet9"::: diff --git a/xml/System.CodeDom/CodeTypeDelegate.xml b/xml/System.CodeDom/CodeTypeDelegate.xml index ac69bbf1c62..f59568df3b9 100644 --- a/xml/System.CodeDom/CodeTypeDelegate.xml +++ b/xml/System.CodeDom/CodeTypeDelegate.xml @@ -59,7 +59,7 @@ should not be used for enumeration, interface, or type declaration. Instead, use for those. > [!NOTE] -> Not all languages support the declaration of delegates. Call the method with the flag to determine if it is supported in a particular language. +> Not all languages support the declaration of delegates. Call the method with the flag to determine if it is supported in a particular language. diff --git a/xml/System.CodeDom/CodeTypeMemberCollection.xml b/xml/System.CodeDom/CodeTypeMemberCollection.xml index b2d351ed618..51b6e353301 100644 --- a/xml/System.CodeDom/CodeTypeMemberCollection.xml +++ b/xml/System.CodeDom/CodeTypeMemberCollection.xml @@ -291,7 +291,7 @@ method overloads to add the members of an array to a object, and to add the members of one to another. + The following example demonstrates how to use the two method overloads to add the members of an array to a object, and to add the members of one to another. :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeTypeMemberCollection/Overview/class1.cs" id="Snippet4"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeTypeMemberCollection/Overview/class1.vb" id="Snippet4"::: @@ -342,7 +342,7 @@ method overloads to add the members of an array to a object, and to add the members of one to another. + The following code example demonstrates how to use the two method overloads to add the members of an array to a object, and to add the members of one to another. :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeTypeMemberCollection/Overview/class1.cs" id="Snippet4"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeTypeMemberCollection/Overview/class1.vb" id="Snippet4"::: @@ -395,7 +395,7 @@ method to search for the presence of a specific object and retrieve the index value at which it was found. + The following code example uses the method to search for the presence of a specific object and retrieve the index value at which it was found. :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeTypeMemberCollection/Overview/class1.cs" id="Snippet5"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeTypeMemberCollection/Overview/class1.vb" id="Snippet5"::: @@ -503,7 +503,7 @@ object and uses the method to retrieve the index value at which it was found. + The following code example searches for the presence of a specific object and uses the method to retrieve the index value at which it was found. :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeTypeMemberCollection/Overview/class1.cs" id="Snippet5"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeTypeMemberCollection/Overview/class1.vb" id="Snippet5"::: @@ -554,7 +554,7 @@ method to add a object to a . + The following code example demonstrates how to use the method to add a object to a . :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeTypeMemberCollection/Overview/class1.cs" id="Snippet8"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeTypeMemberCollection/Overview/class1.vb" id="Snippet8"::: @@ -650,7 +650,7 @@ method to delete a object from a . + The following code example demonstrates how to use the method to delete a object from a . :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeTypeMemberCollection/Overview/class1.cs" id="Snippet9"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeTypeMemberCollection/Overview/class1.vb" id="Snippet9"::: diff --git a/xml/System.CodeDom/CodeTypeParameter.xml b/xml/System.CodeDom/CodeTypeParameter.xml index 820edd5e2de..c859f1a33c2 100644 --- a/xml/System.CodeDom/CodeTypeParameter.xml +++ b/xml/System.CodeDom/CodeTypeParameter.xml @@ -53,7 +53,7 @@ ## Remarks The class represents a type parameter in the declaration of a generic type or method. - A generic type or method declaration contains one or more unspecified types known as type parameters. A type parameter name stands for the type within the body of the generic declaration. For example, the generic declaration for the class contains the type parameter `T`. + A generic type or method declaration contains one or more unspecified types known as type parameters. A type parameter name stands for the type within the body of the generic declaration. For example, the generic declaration for the class contains the type parameter `T`. For more information on generics, see [Generics in the .NET Framework Class Library](/dotnet/csharp/programming-guide/generics/generics-in-the-net-framework-class-library). @@ -162,7 +162,7 @@ constructor to add a type parameter. This example is part of a larger example provided for the class. + The following code example shows the use of constructor to add a type parameter. This example is part of a larger example provided for the class. :::code language="csharp" source="~/snippets/csharp/System.CodeDom/CodeDefaultValueExpression/Overview/codedomgenerics.cs" id="Snippet10"::: :::code language="vb" source="~/snippets/visualbasic/System.CodeDom/CodeDefaultValueExpression/Overview/codedomgenerics.vb" id="Snippet10"::: diff --git a/xml/System.CodeDom/CodeTypeReference.xml b/xml/System.CodeDom/CodeTypeReference.xml index fea0ca7c7df..51f2e68dad6 100644 --- a/xml/System.CodeDom/CodeTypeReference.xml +++ b/xml/System.CodeDom/CodeTypeReference.xml @@ -187,7 +187,7 @@ type, where `K` is a string and `V` is a of integers, is represented by reflection as the following (with the assembly information removed): ``System.Collections.Generic.Dictionary`2[[System.String], [System.Collections.Generic.List`1[[System.Int32]]]]``. + If the `typeName` parameter references a generic type, it must follow the syntax conventions for generic types. For example, the reflection signature for a type, where `K` is a string and `V` is a of integers, is represented by reflection as the following (with the assembly information removed): ``System.Collections.Generic.Dictionary`2[[System.String], [System.Collections.Generic.List`1[[System.Int32]]]]``. > [!NOTE] > You must use square brackets ([]) and not the C# angle brackets (<>) to delimit generic parameters. @@ -579,18 +579,18 @@ This property contains the name of the type unless it is an array type, in which case it is the array element type. > [!NOTE] -> The name of the property may be misleading. This property contains just the type name with any array adornments or generic type arguments removed, not the base or parent type as might be expected. For example, the value for ``System.Collections.Generic.Dictionary`2[[System.String], [System.Collections.Generic.List`1[[System.Int32]]]]`` is ``System.Collections.Generic.Dictionary`2``. +> The name of the property may be misleading. This property contains just the type name with any array adornments or generic type arguments removed, not the base or parent type as might be expected. For example, the value for ``System.Collections.Generic.Dictionary`2[[System.String], [System.Collections.Generic.List`1[[System.Int32]]]]`` is ``System.Collections.Generic.Dictionary`2``. ## Representation of Generic Types - The information in this section is intended for CodeDom provider developers and only applies to CLS-compliant languages. The return value can contain generic types. Generic types are formatted with the name of the type followed by a grave accent ("`") followed by a count of the generic type arguments. The generic type arguments can be found in the returned by the property. The values returned by and the associated contain the same content as the value of the type returned by reflection. + The information in this section is intended for CodeDom provider developers and only applies to CLS-compliant languages. The return value can contain generic types. Generic types are formatted with the name of the type followed by a grave accent ("`") followed by a count of the generic type arguments. The generic type arguments can be found in the returned by the property. The values returned by and the associated contain the same content as the value of the type returned by reflection. - For example, a constructed where `K` is a string and `V` is a constructed of integers is represented by reflection as the following (with the assembly information removed): + For example, a constructed where `K` is a string and `V` is a constructed of integers is represented by reflection as the following (with the assembly information removed): ``` System.Collections.Generic.Dictionary`2[[System.String], [System.Collections.Generic.List`1[[System.Int32]]]] ``` - Recursively parsing the property from the for yields the same strings as the reflection representation above: + Recursively parsing the property from the for yields the same strings as the reflection representation above: - The property for the parent returns the following: @@ -598,13 +598,13 @@ System.Collections.Generic.Dictionary`2[[System.String], [System.Collections.Gen System.Collections.Generic.Dictionary`2 ``` -- The property for the first object in the collection returns the following: +- The property for the first object in the collection returns the following: ``` System.String ``` -- The property for the second object in the collection returns the following: +- The property for the second object in the collection returns the following: ``` System.Collections.Generic.List`1 @@ -616,7 +616,7 @@ System.Collections.Generic.Dictionary`2[[System.String], [System.Collections.Gen System.Int32 ``` - The type argument count should be used when parsing the associated values. The common practice is to remove the type argument count from the generated code, but the practice is compiler specific. It is important to note that the type argument count can be found within a nested type name, in which case it is followed by a plus sign ("+"). + The type argument count should be used when parsing the associated values. The common practice is to remove the type argument count from the generated code, but the practice is compiler specific. It is important to note that the type argument count can be found within a nested type name, in which case it is followed by a plus sign ("+"). > [!NOTE] > When creating a generic , the recommended practice is to specify the type arguments as objects or use the constructor that takes a . Use of the constructor that creates a from a string can lead to undiscoverable type-argument errors. diff --git a/xml/System.Collections.Concurrent/BlockingCollection`1.xml b/xml/System.Collections.Concurrent/BlockingCollection`1.xml index 589ed8f53c0..e5d49a27d5e 100644 --- a/xml/System.Collections.Concurrent/BlockingCollection`1.xml +++ b/xml/System.Collections.Concurrent/BlockingCollection`1.xml @@ -104,30 +104,30 @@ is a thread-safe collection class that provides the following: + is a thread-safe collection class that provides the following: -- An implementation of the producer/consumer pattern; is a wrapper for the interface. +- An implementation of the producer/consumer pattern; is a wrapper for the interface. -- Concurrent addition and removal of items from multiple threads with the and methods. +- Concurrent addition and removal of items from multiple threads with the and methods. -- A bounded collection that blocks and operations when the collection is full or empty. +- A bounded collection that blocks and operations when the collection is full or empty. -- Cancellation of or operations by using a object in the or method. +- Cancellation of or operations by using a object in the or method. > [!IMPORTANT] -> This type implements the interface. When you have finished using the type, you should dispose of it either directly or indirectly. To dispose of the type directly, call its method in a `try`/`catch` block. To dispose of it indirectly, use a language construct such as `using` (in C#) or `Using` (in Visual Basic). For more information, see the "Using an Object that Implements IDisposable" section in the interface topic. Also, note that the method is not thread-safe. All other public and protected members of are thread-safe and may be used concurrently from multiple threads. +> This type implements the interface. When you have finished using the type, you should dispose of it either directly or indirectly. To dispose of the type directly, call its method in a `try`/`catch` block. To dispose of it indirectly, use a language construct such as `using` (in C#) or `Using` (in Visual Basic). For more information, see the "Using an Object that Implements IDisposable" section in the interface topic. Also, note that the method is not thread-safe. All other public and protected members of are thread-safe and may be used concurrently from multiple threads. - represents a collection that allows for thread-safe adding and removal of data. is used as a wrapper for an instance, and allows removal attempts from the collection to block until data is available to be removed. Similarly, you can create a to enforce an upper bound on the number of data elements allowed in the ; addition attempts to the collection may then block until space is available to store the added items. In this manner, is similar to a traditional blocking queue data structure, except that the underlying data storage mechanism is abstracted away as an . + represents a collection that allows for thread-safe adding and removal of data. is used as a wrapper for an instance, and allows removal attempts from the collection to block until data is available to be removed. Similarly, you can create a to enforce an upper bound on the number of data elements allowed in the ; addition attempts to the collection may then block until space is available to store the added items. In this manner, is similar to a traditional blocking queue data structure, except that the underlying data storage mechanism is abstracted away as an . - supports bounding and blocking. Bounding means that you can set the maximum capacity of the collection. Bounding is important in certain scenarios because it enables you to control the maximum size of the collection in memory, and it prevents the producing threads from moving too far ahead of the consuming threads.Multiple threads or tasks can add items to the collection concurrently, and if the collection reaches its specified maximum capacity, the producing threads will block until an item is removed. Multiple consumers can remove items concurrently, and if the collection becomes empty, the consuming threads will block until a producer adds an item. A producing thread can call the method to indicate that no more items will be added. Consumers monitor the property to know when the collection is empty and no more items will be added. + supports bounding and blocking. Bounding means that you can set the maximum capacity of the collection. Bounding is important in certain scenarios because it enables you to control the maximum size of the collection in memory, and it prevents the producing threads from moving too far ahead of the consuming threads.Multiple threads or tasks can add items to the collection concurrently, and if the collection reaches its specified maximum capacity, the producing threads will block until an item is removed. Multiple consumers can remove items concurrently, and if the collection becomes empty, the consuming threads will block until a producer adds an item. A producing thread can call the method to indicate that no more items will be added. Consumers monitor the property to know when the collection is empty and no more items will be added. - and operations are typically performed in a loop. You can cancel a loop by passing in a object to the or method, and then checking the value of the token's property on each iteration. If the value is `true`, it is up to you to respond the cancellation request by cleaning up any resources and exiting the loop. + and operations are typically performed in a loop. You can cancel a loop by passing in a object to the or method, and then checking the value of the token's property on each iteration. If the value is `true`, it is up to you to respond the cancellation request by cleaning up any resources and exiting the loop. - When you create a object, you can specify not only the bounded capacity but also the type of collection to use. For example, you could specify a object for first in, first out (FIFO) behavior, or a object for last in, first out (LIFO) behavior. You can use any collection class that implements the interface. The default collection type for is . + When you create a object, you can specify not only the bounded capacity but also the type of collection to use. For example, you could specify a object for first in, first out (FIFO) behavior, or a object for last in, first out (LIFO) behavior. You can use any collection class that implements the interface. The default collection type for is . - Do not modify the underlying collection directly. Use methods to add or remove elements. The object can become corrupted if you change the underlying collection directly. + Do not modify the underlying collection directly. Use methods to add or remove elements. The object can become corrupted if you change the underlying collection directly. - was not designed with asynchronous access in mind. If your application requires asynchronous producer/consumer scenarios, consider using instead. + was not designed with asynchronous access in mind. If your application requires asynchronous producer/consumer scenarios, consider using instead. @@ -195,7 +195,7 @@ object, which provides first in, first out (FIFO) behavior. + The default underlying collection is a object, which provides first in, first out (FIFO) behavior. ]]> @@ -289,7 +289,7 @@ . + The default underlying collection is a . ]]> @@ -404,7 +404,7 @@ was initialized, a call to Add may block until space is available to store the provided item. + If a bounded capacity was specified when this instance of was initialized, a call to Add may block until space is available to store the provided item. ]]> @@ -465,7 +465,7 @@ was initialized, a call to may block until space is available to store the provided item. + If a bounded capacity was specified when this instance of was initialized, a call to may block until space is available to store the provided item. This method can return early with an if the `cancellationToken` is canceled. @@ -541,7 +541,7 @@ instances were initialized, a call to AddToAny may block until space is available in one of the collections to store the provided item. + If a bounded capacity was specified when all of the instances were initialized, a call to AddToAny may block until space is available in one of the collections to store the provided item. ]]> @@ -610,7 +610,7 @@ instances were initialized, a call to AddToAny may block until space is available in one of the collections to store the provided item. This method may return before the item is added to any collection if the `cancellationToken` is canceled before space is available. + If a bounded capacity was specified when all of the instances were initialized, a call to AddToAny may block until space is available in one of the collections to store the provided item. This method may return before the item is added to any collection if the `cancellationToken` is canceled before space is available. ]]> @@ -897,12 +897,12 @@ ## Remarks The `Dispose` method is not thread-safe. - Call `Dispose` when you are finished using the . The `Dispose` method leaves the in an unusable state. After calling `Dispose`, you must release all references to the so the garbage collector can reclaim the memory that the was occupying. + Call `Dispose` when you are finished using the . The `Dispose` method leaves the in an unusable state. After calling `Dispose`, you must release all references to the so the garbage collector can reclaim the memory that the was occupying. For more information, see [Cleaning Up Unmanaged Resources](/dotnet/standard/garbage-collection/unmanaged) and [Implementing a Dispose Method](/dotnet/standard/garbage-collection/implementing-dispose). > [!NOTE] -> Always call `Dispose` before you release your last reference to the . Otherwise, the resources it is using will not be freed until the garbage collector calls the object's `Finalize` method. +> Always call `Dispose` before you release your last reference to the . Otherwise, the resources it is using will not be freed until the garbage collector calls the object's `Finalize` method. ]]> @@ -1012,7 +1012,7 @@ method: + The following example shows how to use the method: :::code language="csharp" source="~/snippets/csharp/System.Collections.Concurrent/BlockingCollectionT/Overview/blockingcoll.cs" id="Snippet4"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Concurrent/BlockingCollectionT/Overview/blockingcoll.fs" id="Snippet4"::: @@ -1082,7 +1082,7 @@ or a PLINQ query. The enumerator will continue to provide items (if any exist) until returns true, and if is false the loop blocks until an item becomes available or until the is cancelled. + This method enables client code to remove items from the collection by using a foreach loop (For Each in Visual Basic), or or a PLINQ query. The enumerator will continue to provide items (if any exist) until returns true, and if is false the loop blocks until an item becomes available or until the is cancelled. ]]> @@ -1226,7 +1226,7 @@ , returns a standard enumerator that does not modify the underlying collection. If other threads are adding or removing elements concurrently when GetEnumerator is called, then the elements returned by the enumerator might not represent the current state of the collection. + Unlike , returns a standard enumerator that does not modify the underlying collection. If other threads are adding or removing elements concurrently when GetEnumerator is called, then the elements returned by the enumerator might not represent the current state of the collection. ]]> @@ -1512,9 +1512,9 @@ This member is an explicit interface member implementation. It can be used only may block until an item is available to be removed. + A call to may block until an item is available to be removed. - The order in which an item is removed depends on the type of collection used to create the instance. When you create a object, you can specify the type of collection to use. For example, you could specify a object for first in, first out (FIFO) behavior, or a object for last in, first out (LIFO) behavior. You can use any collection class that implements the interface. The default collection type for is . + The order in which an item is removed depends on the type of collection used to create the instance. When you create a object, you can specify the type of collection to use. For example, you could specify a object for first in, first out (FIFO) behavior, or a object for last in, first out (LIFO) behavior. You can use any collection class that implements the interface. The default collection type for is . ]]> @@ -1570,9 +1570,9 @@ This member is an explicit interface member implementation. It can be used only may block until an item is available to be removed or the token is canceled. + A call to may block until an item is available to be removed or the token is canceled. - The order in which an item is removed depends on the type of collection used to create the instance. When you create a object, you can specify the type of collection to use. For example, you could specify a object for first in, first out (FIFO) behavior, or a object for last in, first out (LIFO) behavior. You can use any collection class that implements the interface. The default collection type for is . + The order in which an item is removed depends on the type of collection used to create the instance. When you create a object, you can specify the type of collection to use. For example, you could specify a object for first in, first out (FIFO) behavior, or a object for last in, first out (LIFO) behavior. You can use any collection class that implements the interface. The default collection type for is . ]]> @@ -2338,7 +2338,7 @@ This member is an explicit interface member implementation. It can be used only method. + The following example shows how to use the method. :::code language="csharp" source="~/snippets/csharp/System.Collections.Concurrent/BlockingCollectionT/Overview/blockingcoll.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Concurrent/BlockingCollectionT/Overview/blockingcoll.fs" id="Snippet2"::: @@ -2406,7 +2406,7 @@ This member is an explicit interface member implementation. It can be used only ## Remarks If the collection is empty, this method immediately returns false. - The order in which an item is removed depends on the type of collection used to create the instance. When you create a object, you can specify the type of collection to use. For example, you could specify a object for first in, first out (FIFO) behavior, or a object for last in, first out (LIFO) behavior. You can use any collection class that implements the interface. The default collection type for is . + The order in which an item is removed depends on the type of collection used to create the instance. When you create a object, you can specify the type of collection to use. For example, you could specify a object for first in, first out (FIFO) behavior, or a object for last in, first out (LIFO) behavior. You can use any collection class that implements the interface. The default collection type for is . ]]> @@ -2472,7 +2472,7 @@ This member is an explicit interface member implementation. It can be used only instance. When you create a , you can specify the type of collection to use. For example, you could specify a object for first in, first out (FIFO) behavior, or a object for last in, first out (LIFO) behavior. You can use any collection class that implements the interface. The default collection type for is . + The order in which an item is removed depends on the type of collection used to create the instance. When you create a , you can specify the type of collection to use. For example, you could specify a object for first in, first out (FIFO) behavior, or a object for last in, first out (LIFO) behavior. You can use any collection class that implements the interface. The default collection type for is . ]]> @@ -2540,7 +2540,7 @@ This member is an explicit interface member implementation. It can be used only instance. When you create a object, you can specify the type of collection to use. For example, you could specify a object for first in, first out (FIFO) behavior, or a object for last in, first out (LIFO) behavior. You can use any collection class that implements the interface. The default collection type for is . + The order in which an item is removed depends on the type of collection used to create the instance. When you create a object, you can specify the type of collection to use. For example, you could specify a object for first in, first out (FIFO) behavior, or a object for last in, first out (LIFO) behavior. You can use any collection class that implements the interface. The default collection type for is . ]]> @@ -2614,7 +2614,7 @@ This member is an explicit interface member implementation. It can be used only instance. When you create a object, you can specify the type of collection to use. For example, you could specify a object for first in, first out (FIFO) behavior, or a object for last in, first out (LIFO) behavior. You can use any collection class that implements the interface. The default collection type for is . + The order in which an item is removed depends on the type of collection used to create the instance. When you create a object, you can specify the type of collection to use. For example, you could specify a object for first in, first out (FIFO) behavior, or a object for last in, first out (LIFO) behavior. You can use any collection class that implements the interface. The default collection type for is . ]]> @@ -2709,7 +2709,7 @@ This member is an explicit interface member implementation. It can be used only ## Examples - The following example shows how to use the method: + The following example shows how to use the method: :::code language="csharp" source="~/snippets/csharp/System.Collections.Concurrent/BlockingCollectionT/Overview/blockingcoll.cs" id="Snippet3"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Concurrent/BlockingCollectionT/Overview/blockingcoll.fs" id="Snippet3"::: diff --git a/xml/System.Collections.Concurrent/ConcurrentBag`1.xml b/xml/System.Collections.Concurrent/ConcurrentBag`1.xml index bbe3e5fe33d..e83d07ecd83 100644 --- a/xml/System.Collections.Concurrent/ConcurrentBag`1.xml +++ b/xml/System.Collections.Concurrent/ConcurrentBag`1.xml @@ -108,24 +108,24 @@ The type of the elements to be stored in the collection. Represents a thread-safe, unordered collection of objects. - is a thread-safe bag implementation, optimized for scenarios where the same thread will be both producing and consuming data stored in the bag. - - accepts `null` as a valid value for reference types. - - For more information, see the entry [FAQ: Are all of the new concurrent collections lock-free?](https://devblogs.microsoft.com/pfxteam/faq-are-all-of-the-new-concurrent-collections-lock-free/) in the Parallel Programming with .NET blog. - - - -## Examples - The following example shows how to add and remove items from a : - + is a thread-safe bag implementation, optimized for scenarios where the same thread will be both producing and consuming data stored in the bag. + + accepts `null` as a valid value for reference types. + + For more information, see the entry [FAQ: Are all of the new concurrent collections lock-free?](https://devblogs.microsoft.com/pfxteam/faq-are-all-of-the-new-concurrent-collections-lock-free/) in the Parallel Programming with .NET blog. + + + +## Examples + The following example shows how to add and remove items from a : + :::code language="csharp" source="~/snippets/csharp/System.Collections.Concurrent/ConcurrentBag/concbag.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Concurrent/ConcurrentBag/concbag.fs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/api/system.collections.concurrent/concurrentbag/concbag.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/api/system.collections.concurrent/concurrentbag/concbag.vb" id="Snippet1"::: + ]]> All public and protected members of are thread-safe and may be used concurrently from multiple threads. However, members accessed through one of the interfaces the implements, including extension methods, are not guaranteed to be thread safe and may need to be synchronized by the caller. @@ -394,11 +394,11 @@ Gets the number of elements contained in the . The number of elements contained in the . - Thread-Safe Collections @@ -447,11 +447,11 @@ Returns an enumerator that iterates through the . An enumerator for the contents of the . - was called. The enumerator is safe to use concurrently with reads from and writes to the bag. - + was called. The enumerator is safe to use concurrently with reads from and writes to the bag. + ]]> Thread-Safe Collections @@ -761,11 +761,11 @@ This member is an explicit interface member implementation. It can be used only Returns an enumerator that iterates through the . An enumerator for the contents of the . - was called. - + was called. + ]]> diff --git a/xml/System.Collections.Concurrent/ConcurrentDictionary`2.xml b/xml/System.Collections.Concurrent/ConcurrentDictionary`2.xml index f5c9ac726af..115ec85de7d 100644 --- a/xml/System.Collections.Concurrent/ConcurrentDictionary`2.xml +++ b/xml/System.Collections.Concurrent/ConcurrentDictionary`2.xml @@ -120,27 +120,27 @@ objects, you can increase the maximum array size to 2 gigabytes (GB) on a 64-bit system by setting the [``](/dotnet/framework/configure-apps/file-schema/runtime/gcallowverylargeobjects-element) configuration element to `true` in the run-time environment. + For very large objects, you can increase the maximum array size to 2 gigabytes (GB) on a 64-bit system by setting the [``](/dotnet/framework/configure-apps/file-schema/runtime/gcallowverylargeobjects-element) configuration element to `true` in the run-time environment. > [!NOTE] -> implements the and interfaces starting with the .NET Framework 4.6; in previous versions of the .NET Framework, the class did not implement these interfaces. +> implements the and interfaces starting with the .NET Framework 4.6; in previous versions of the .NET Framework, the class did not implement these interfaces. - Like the class, implements the interface. In addition, provides several methods for adding or updating key/value pairs in the dictionary, as described in the following table. + Like the class, implements the interface. In addition, provides several methods for adding or updating key/value pairs in the dictionary, as described in the following table. | To do this | Use this method | Usage notes | |------------|-----------------|-------------| -|Add a new key to the dictionary, if it doesn't already exist in the dictionary||This method adds the specified key/value pair, if the key doesn't currently exist in the dictionary. The method returns `true` or `false` depending on whether the new pair was added.| -|Update the value for an existing key in the dictionary, if that key has a specific value||This method checks whether the key has a specified value, and if it does, updates the key with a new value. It's similar to the method, except that it's used for dictionary elements.| +|Add a new key to the dictionary, if it doesn't already exist in the dictionary||This method adds the specified key/value pair, if the key doesn't currently exist in the dictionary. The method returns `true` or `false` depending on whether the new pair was added.| +|Update the value for an existing key in the dictionary, if that key has a specific value||This method checks whether the key has a specified value, and if it does, updates the key with a new value. It's similar to the method, except that it's used for dictionary elements.| |Store a key/value pair in the dictionary unconditionally, and overwrite the value of a key that already exists|The indexer's setter: `dictionary[key] = newValue`| | -|Add a key/value pair to the dictionary, or if the key already exists, update the value for the key based on the key's existing value|

-or-

| accepts the key and two delegates. It uses the first delegate if the key doesn't exist in the dictionary; it accepts the key and returns the value that should be added for the key. It uses the second delegate if the key does exist; it accepts the key and its current value, and it returns the new value that should be set for the key.

accepts the key, a value to add, and the update delegate. This is the same as the previous overload, except that it doesn't use a delegate to add a key.| -|Get the value for a key in the dictionary, adding the value to the dictionary and returning it if the key doesn't exist|

-or-

|These overloads provide lazy initialization for a key/value pair in the dictionary, adding the value only if it's not there.

takes the value to be added if the key doesn't exist.

takes a delegate that will generate the value if the key doesn't exist.| +|Add a key/value pair to the dictionary, or if the key already exists, update the value for the key based on the key's existing value|

-or-

| accepts the key and two delegates. It uses the first delegate if the key doesn't exist in the dictionary; it accepts the key and returns the value that should be added for the key. It uses the second delegate if the key does exist; it accepts the key and its current value, and it returns the new value that should be set for the key.

accepts the key, a value to add, and the update delegate. This is the same as the previous overload, except that it doesn't use a delegate to add a key.| +|Get the value for a key in the dictionary, adding the value to the dictionary and returning it if the key doesn't exist|

-or-

|These overloads provide lazy initialization for a key/value pair in the dictionary, adding the value only if it's not there.

takes the value to be added if the key doesn't exist.

takes a delegate that will generate the value if the key doesn't exist.| - All these operations are atomic and are thread-safe with regards to all other operations on the class. The only exceptions are the methods that accept a delegate, that is, and . For modifications and write operations to the dictionary, uses fine-grained locking to ensure thread safety. (Read operations on the dictionary are performed in a lock-free manner.) However, delegates for these methods are called outside the locks to avoid the problems that can arise from executing unknown code under a lock. Therefore, the code executed by these delegates is not subject to the atomicity of the operation. + All these operations are atomic and are thread-safe with regards to all other operations on the class. The only exceptions are the methods that accept a delegate, that is, and . For modifications and write operations to the dictionary, uses fine-grained locking to ensure thread safety. (Read operations on the dictionary are performed in a lock-free manner.) However, delegates for these methods are called outside the locks to avoid the problems that can arise from executing unknown code under a lock. Therefore, the code executed by these delegates is not subject to the atomicity of the operation. ## Examples - The following example shows how to construct a object. + The following example shows how to construct a object. :::code language="csharp" source="~/snippets/csharp/System.Collections.Concurrent/ConcurrentDictionaryTKey,TValue/Overview/concdictionary.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Concurrent/ConcurrentDictionaryTKey,TValue/Overview/concdictionary.fs" id="Snippet1"::: @@ -571,7 +571,7 @@ method: + The following example shows how to call the method: :::code language="csharp" source="~/snippets/csharp/System.Collections.Concurrent/ConcurrentDictionaryTKey,TValue/Overview/concdictionary.cs" id="Snippet3"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Concurrent/ConcurrentDictionaryTKey,TValue/Overview/concdictionary.fs" id="Snippet3"::: @@ -633,9 +633,9 @@ simultaneously on different threads, `addValueFactory` may be called multiple times, but its key/value pair might not be added to the dictionary for every call. + If you call simultaneously on different threads, `addValueFactory` may be called multiple times, but its key/value pair might not be added to the dictionary for every call. - For modifications and write operations to the dictionary, uses fine-grained locking to ensure thread safety (read operations on the dictionary are performed in a lock-free manner). The `addValueFactory` and `updateValueFactory` delegates may be executed multiple times to verify the value was added or updated as expected. However, they are called outside the locks to avoid the problems that can arise from executing unknown code under a lock. Therefore, is not atomic with regards to all other operations on the class. + For modifications and write operations to the dictionary, uses fine-grained locking to ensure thread safety (read operations on the dictionary are performed in a lock-free manner). The `addValueFactory` and `updateValueFactory` delegates may be executed multiple times to verify the value was added or updated as expected. However, they are called outside the locks to avoid the problems that can arise from executing unknown code under a lock. Therefore, is not atomic with regards to all other operations on the class. ]]> @@ -696,14 +696,14 @@ and how to use the AddOrUpdate method to add an additional item to the collection, and update the existing items. + The following code example shows how to initialize an and how to use the AddOrUpdate method to add an additional item to the collection, and update the existing items. :::code language="csharp" source="~/snippets/csharp/System.Collections.Concurrent/ConcurrentDictionaryTKey,TValue/AddOrUpdate/program.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Concurrent/ConcurrentDictionaryTKey,TValue/AddOrUpdate/program.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Concurrent/ConcurrentDictionaryTKey,TValue/AddOrUpdate/module1.vb" id="Snippet1"::: ## Remarks - For modifications and write operations to the dictionary, uses fine-grained locking to ensure thread safety. (Read operations on the dictionary are performed in a lock-free manner.) The `addValueFactory` and `updateValueFactory` delegates may be executed multiple times to verify the value was added or updated as expected. However, they are called outside the locks to avoid the problems that can arise from executing unknown code under a lock. Therefore, is not atomic with regards to all other operations on the class. + For modifications and write operations to the dictionary, uses fine-grained locking to ensure thread safety. (Read operations on the dictionary are performed in a lock-free manner.) The `addValueFactory` and `updateValueFactory` delegates may be executed multiple times to verify the value was added or updated as expected. However, they are called outside the locks to avoid the problems that can arise from executing unknown code under a lock. Therefore, is not atomic with regards to all other operations on the class. ]]> @@ -777,9 +777,9 @@ simultaneously on different threads, `addValueFactory` may be called multiple times, but its key/value pair might not be added to the dictionary for every call. + If you call simultaneously on different threads, `addValueFactory` may be called multiple times, but its key/value pair might not be added to the dictionary for every call. - For modifications and write operations to the dictionary, uses fine-grained locking to ensure thread safety. (Read operations on the dictionary are performed in a lock-free manner.) The `addValueFactory` and `updateValueFactory` delegates may be executed multiple times to verify the value was added or updated as expected. However, they are called outside the locks to avoid the problems that can arise from executing unknown code under a lock. Therefore, is not atomic with regards to all other operations on the class. + For modifications and write operations to the dictionary, uses fine-grained locking to ensure thread safety. (Read operations on the dictionary are performed in a lock-free manner.) The `addValueFactory` and `updateValueFactory` delegates may be executed multiple times to verify the value was added or updated as expected. However, they are called outside the locks to avoid the problems that can arise from executing unknown code under a lock. Therefore, is not atomic with regards to all other operations on the class. ]]> @@ -979,7 +979,7 @@ at the moment when the property was accessed. + This property has snapshot semantics and represents the number of items in the at the moment when the property was accessed. ]]> @@ -1099,7 +1099,7 @@ was called. + The enumerator returned from the dictionary is safe to use concurrently with reads and writes to the dictionary, however it does not represent a moment-in-time snapshot of the dictionary. The contents exposed through the enumerator may contain modifications made to the dictionary after was called. ]]> @@ -1119,7 +1119,7 @@ method: + The following example shows how to call the method: :::code language="csharp" source="~/snippets/csharp/System.Collections.Concurrent/ConcurrentDictionaryTKey,TValue/Overview/concdictionary.cs" id="Snippet3"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Concurrent/ConcurrentDictionaryTKey,TValue/Overview/concdictionary.fs" id="Snippet3"::: @@ -1179,11 +1179,11 @@ uses fine-grained locking to ensure thread safety. (Read operations on the dictionary are performed in a lock-free manner.) However, the `valueFactory` delegate is called outside the locks to avoid the problems that can arise from executing unknown code under a lock. Therefore, is not atomic with regards to all other operations on the class. + For modifications and write operations to the dictionary, uses fine-grained locking to ensure thread safety. (Read operations on the dictionary are performed in a lock-free manner.) However, the `valueFactory` delegate is called outside the locks to avoid the problems that can arise from executing unknown code under a lock. Therefore, is not atomic with regards to all other operations on the class. - Since a key/value can be inserted by another thread while `valueFactory` is generating a value, you cannot trust that just because `valueFactory` executed, its produced value will be inserted into the dictionary and returned. If you call simultaneously on different threads, `valueFactory` may be called multiple times, but only one key/value pair will be added to the dictionary. + Since a key/value can be inserted by another thread while `valueFactory` is generating a value, you cannot trust that just because `valueFactory` executed, its produced value will be inserted into the dictionary and returned. If you call simultaneously on different threads, `valueFactory` may be called multiple times, but only one key/value pair will be added to the dictionary. - The return value depends on the presence of the key in the dictionary and whether a key/value is inserted by another thread after is called but before `valueFactory` generates a value: + The return value depends on the presence of the key in the dictionary and whether a key/value is inserted by another thread after is called but before `valueFactory` generates a value: | Scenario | Return value | | -------- | ------------ | @@ -1313,11 +1313,11 @@ uses fine-grained locking to ensure thread safety. (Read operations on the dictionary are performed in a lock-free manner.) However, the `valueFactory` delegate is called outside the locks to avoid the problems that can arise from executing unknown code under a lock. Therefore, is not atomic with regards to all other operations on the class. + For modifications and write operations to the dictionary, uses fine-grained locking to ensure thread safety. (Read operations on the dictionary are performed in a lock-free manner.) However, the `valueFactory` delegate is called outside the locks to avoid the problems that can arise from executing unknown code under a lock. Therefore, is not atomic with regards to all other operations on the class. - Since a key/value can be inserted by another thread while `valueFactory` is generating a value, you cannot trust that just because `valueFactory` executed, its produced value will be inserted into the dictionary and returned. If you call simultaneously on different threads, `valueFactory` may be called multiple times, but only one key/value pair will be added to the dictionary. + Since a key/value can be inserted by another thread while `valueFactory` is generating a value, you cannot trust that just because `valueFactory` executed, its produced value will be inserted into the dictionary and returned. If you call simultaneously on different threads, `valueFactory` may be called multiple times, but only one key/value pair will be added to the dictionary. - The return value depends on the presence of the key in the dictionary and whether a key/value is inserted by another thread after is called but before `valueFactory` generates a value: + The return value depends on the presence of the key in the dictionary and whether a key/value is inserted by another thread after is called but before `valueFactory` generates a value: | Scenario | Return value | | -------- | ------------ | @@ -2650,7 +2650,7 @@ This member is an explicit interface member implementation. It can be used only was called. + The enumerator returned from the dictionary is safe to use concurrently with reads and writes to the dictionary, however it does not represent a moment-in-time snapshot of the dictionary. The contents exposed through the enumerator may contain modifications made to the dictionary after was called. ]]> @@ -2751,12 +2751,12 @@ This member is an explicit interface member implementation. It can be used only or method to update the value in case a key already exists. + This method returns `false` if the key already exists. Use the or method to update the value in case a key already exists. ## Examples - The following example shows how to call the method: + The following example shows how to call the method: :::code language="csharp" source="~/snippets/csharp/System.Collections.Concurrent/ConcurrentDictionaryTKey,TValue/Overview/concdictionary.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Concurrent/ConcurrentDictionaryTKey,TValue/Overview/concdictionary.fs" id="Snippet2"::: @@ -3001,7 +3001,7 @@ The key is compared using the dictionary's comparer (or the default comparer for method: + The following example shows how to call the method: :::code language="csharp" source="~/snippets/csharp/System.Collections.Concurrent/ConcurrentDictionaryTKey,TValue/Overview/concdictionary.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Concurrent/ConcurrentDictionaryTKey,TValue/Overview/concdictionary.fs" id="Snippet2"::: @@ -3066,7 +3066,7 @@ The key is compared using the dictionary's comparer (or the default comparer for method: + The following example shows how to call the method: :::code language="csharp" source="~/snippets/csharp/System.Collections.Concurrent/ConcurrentDictionaryTKey,TValue/Overview/concdictionary.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Concurrent/ConcurrentDictionaryTKey,TValue/Overview/concdictionary.fs" id="Snippet2"::: diff --git a/xml/System.Collections.Concurrent/ConcurrentQueue`1.xml b/xml/System.Collections.Concurrent/ConcurrentQueue`1.xml index 73ceb9ea06e..9324ebb8f06 100644 --- a/xml/System.Collections.Concurrent/ConcurrentQueue`1.xml +++ b/xml/System.Collections.Concurrent/ConcurrentQueue`1.xml @@ -113,12 +113,12 @@ ## Remarks > [!NOTE] -> implements the interface starting with the .NET Framework 4.6; in previous versions of the .NET Framework, the class did not implement this interface. +> implements the interface starting with the .NET Framework 4.6; in previous versions of the .NET Framework, the class did not implement this interface. ## Examples - The following example shows how to use a to enqueue and dequeue items: + The following example shows how to use a to enqueue and dequeue items: :::code language="csharp" source="~/snippets/csharp/System.Collections.Concurrent/ConcurrentQueueT/Overview/concqueue.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Concurrent/ConcurrentQueueT/Overview/concqueue.fs" id="Snippet1"::: @@ -360,7 +360,7 @@ property is recommended rather than retrieving the number of items from the property and comparing it to 0. + For determining whether the collection contains any items, use of the property is recommended rather than retrieving the number of items from the property and comparing it to 0. ]]> @@ -458,7 +458,7 @@ was called. The enumerator is safe to use concurrently with reads from and writes to the queue. + The enumeration represents a moment-in-time snapshot of the contents of the queue. It does not reflect any updates to the collection after was called. The enumerator is safe to use concurrently with reads from and writes to the queue. The enumerator returns the collection elements in the order in which they were added, which is FIFO order (first-in, first-out). @@ -510,7 +510,7 @@ property and comparing it to 0. However, as this collection is intended to be accessed concurrently, it may be the case that another thread will modify the collection after returns, thus invalidating the result. + For determining whether the collection contains any items, use of this property is recommended rather than retrieving the number of items from the property and comparing it to 0. However, as this collection is intended to be accessed concurrently, it may be the case that another thread will modify the collection after returns, thus invalidating the result. ]]> @@ -567,7 +567,7 @@ , this operation will always add the object to the end of the and return true. + For , this operation will always add the object to the end of the and return true. ]]> @@ -631,7 +631,7 @@ , this operation will attempt to remove the object from the beginning of the . + For , this operation will attempt to remove the object from the beginning of the . ]]> @@ -955,9 +955,9 @@ This member is an explicit interface member implementation. It can be used only handles all synchronization internally. If two threads call at precisely the same moment, neither operation is blocked. When a conflict is detected between two threads, one thread has to try again to retrieve the next element, and the synchronization is handled internally. + handles all synchronization internally. If two threads call at precisely the same moment, neither operation is blocked. When a conflict is detected between two threads, one thread has to try again to retrieve the next element, and the synchronization is handled internally. - tries to remove an element from the queue. If the method is successful, the item is removed and the method returns `true`; otherwise, it returns `false`. That happens atomically with respect to other operations on the queue. If the queue was populated with code such as `q.Enqueue("a"); q.Enqueue("b"); q.Enqueue("c");` and two threads concurrently try to dequeue an element, one thread will dequeue `a` and the other thread will dequeue `b`. Both calls to will return `true`, because they were both able to dequeue an element. If each thread goes back to dequeue an additional element, one of the threads will dequeue `c` and return `true`, whereas the other thread will find the queue empty and will return `false`. + tries to remove an element from the queue. If the method is successful, the item is removed and the method returns `true`; otherwise, it returns `false`. That happens atomically with respect to other operations on the queue. If the queue was populated with code such as `q.Enqueue("a"); q.Enqueue("b"); q.Enqueue("c");` and two threads concurrently try to dequeue an element, one thread will dequeue `a` and the other thread will dequeue `b`. Both calls to will return `true`, because they were both able to dequeue an element. If each thread goes back to dequeue an additional element, one of the threads will dequeue `c` and return `true`, whereas the other thread will find the queue empty and will return `false`. ]]> diff --git a/xml/System.Collections.Concurrent/ConcurrentStack`1.xml b/xml/System.Collections.Concurrent/ConcurrentStack`1.xml index e44a6493301..e6f0ed1e4da 100644 --- a/xml/System.Collections.Concurrent/ConcurrentStack`1.xml +++ b/xml/System.Collections.Concurrent/ConcurrentStack`1.xml @@ -109,28 +109,28 @@ ## Remarks > [!NOTE] -> implements the interface starting with the .NET Framework 4.6; in previous versions of the .NET Framework, the class did not implement this interface. +> implements the interface starting with the .NET Framework 4.6; in previous versions of the .NET Framework, the class did not implement this interface. - provides a few main operations: + provides a few main operations: -- inserts an element at the top of the . +- inserts an element at the top of the . -- removes an element from the top of the , or returns `false` if the item cannot be removed. +- removes an element from the top of the , or returns `false` if the item cannot be removed. -- returns an element that is at the top of the but does not remove it from the . +- returns an element that is at the top of the but does not remove it from the . -- The and methods provide efficient pushing and popping of multiple elements in a single operation. +- The and methods provide efficient pushing and popping of multiple elements in a single operation. ## Examples - The following example shows how to use a to push and pop individual items: + The following example shows how to use a to push and pop individual items: :::code language="csharp" source="~/snippets/csharp/System.Collections.Concurrent/ConcurrentStackT/Overview/concstack_single.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Concurrent/ConcurrentStackT/Overview/concstack_single.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Concurrent/ConcurrentStackT/Overview/concstack_single.vb" id="Snippet1"::: - The following example shows how to use a to push and pop ranges of items: + The following example shows how to use a to push and pop ranges of items: :::code language="csharp" source="~/snippets/csharp/System.Collections.Concurrent/ConcurrentStackT/Overview/concstack_range.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Concurrent/ConcurrentStackT/Overview/concstack_range.fs" id="Snippet1"::: @@ -367,7 +367,7 @@ property is recommended rather than retrieving the number of items from the property and comparing it to 0. + For determining whether the collection contains any items, use of the property is recommended rather than retrieving the number of items from the property and comparing it to 0. ]]> @@ -419,7 +419,7 @@ was called. The enumerator is safe to use concurrently with reads from and writes to the stack. The enumerator returns items in LIFO (last-in, first-out) order. + The enumeration represents a moment-in-time snapshot of the contents of the stack. It does not reflect any updates to the collection after was called. The enumerator is safe to use concurrently with reads from and writes to the stack. The enumerator returns items in LIFO (last-in, first-out) order. ]]> @@ -469,9 +469,9 @@ property and comparing it to 0. However, as this collection is intended to be accessed concurrently, it may be the case that another thread will modify the collection after returns, thus invalidating the result. + For determining whether the collection contains any items, use of this property is recommended rather than retrieving the number of items from the property and comparing it to 0. However, as this collection is intended to be accessed concurrently, it may be the case that another thread will modify the collection after returns, thus invalidating the result. - For a code example, see . + For a code example, see . ]]> @@ -580,9 +580,9 @@ one item at a time. Additionally, PushRange guarantees that all of the elements will be added atomically, meaning that no other threads will be able to inject elements between the elements being pushed. Items at lower indices in the `items` array will be pushed before items at higher indices. + When adding multiple items to the stack, using PushRange is a more efficient mechanism than using one item at a time. Additionally, PushRange guarantees that all of the elements will be added atomically, meaning that no other threads will be able to inject elements between the elements being pushed. Items at lower indices in the `items` array will be pushed before items at higher indices. - For a code example, see . + For a code example, see . ]]> @@ -640,9 +640,9 @@ one item at a time. Additionally, PushRange guarantees that all of the elements will be added atomically, meaning that no other threads will be able to inject elements between the elements being pushed. Items at lower indices in the `items` array will be pushed before items at higher indices. + When adding multiple items to the stack, using PushRange is a more efficient mechanism than using one item at a time. Additionally, PushRange guarantees that all of the elements will be added atomically, meaning that no other threads will be able to inject elements between the elements being pushed. Items at lower indices in the `items` array will be pushed before items at higher indices. - For a code example, see . + For a code example, see . ]]> @@ -705,7 +705,7 @@ , this operation will always insert the object onto the top of the and return true. + For , this operation will always insert the object onto the top of the and return true. ]]> @@ -769,7 +769,7 @@ , this operation will attempt to pop the object at the top of the . + For , this operation will attempt to pop the object at the top of the . ]]> @@ -984,7 +984,7 @@ This member is an explicit interface member implementation. It can be used only was called. The enumerator is safe to use concurrently with reads from and writes to the stack. + The enumeration represents a moment-in-time snapshot of the contents of the stack. It does not reflect any updates to the collection after was called. The enumerator is safe to use concurrently with reads from and writes to the stack. ]]> @@ -1144,7 +1144,7 @@ This member is an explicit interface member implementation. It can be used only . + For a code example, see . ]]> @@ -1208,9 +1208,9 @@ This member is an explicit interface member implementation. It can be used only once per item to be removed. Nodes fill the `items` array with the first item to be popped at the startIndex, the second item to be popped at startIndex + 1, and so on. + When popping multiple items, if there is little contention on the stack, using `TryPopRange` can be more efficient than using once per item to be removed. Nodes fill the `items` array with the first item to be popped at the startIndex, the second item to be popped at startIndex + 1, and so on. - For a code example, see . + For a code example, see . ]]> @@ -1269,7 +1269,7 @@ This member is an explicit interface member implementation. It can be used only once per item to be removed. Nodes fill the `items` array with the first item to be popped at the startIndex, the second item to be popped at startIndex + 1, and so on. + When popping multiple items, if there is little contention on the stack, using TryPopRange can be more efficient than using once per item to be removed. Nodes fill the `items` array with the first item to be popped at the startIndex, the second item to be popped at startIndex + 1, and so on. ]]> diff --git a/xml/System.Collections.Concurrent/EnumerablePartitionerOptions.xml b/xml/System.Collections.Concurrent/EnumerablePartitionerOptions.xml index f42532c54a8..eb1eb50977e 100644 --- a/xml/System.Collections.Concurrent/EnumerablePartitionerOptions.xml +++ b/xml/System.Collections.Concurrent/EnumerablePartitionerOptions.xml @@ -56,11 +56,11 @@ Specifies options to control the buffering behavior of a partitioner. - implementation is fast and non-blocking. These behaviors can be overridden by this enumeration by using the method. - + implementation is fast and non-blocking. These behaviors can be overridden by this enumeration by using the method. + ]]> diff --git a/xml/System.Collections.Concurrent/IProducerConsumerCollection`1.xml b/xml/System.Collections.Concurrent/IProducerConsumerCollection`1.xml index 1bdd2e800ec..7093f14ca07 100644 --- a/xml/System.Collections.Concurrent/IProducerConsumerCollection`1.xml +++ b/xml/System.Collections.Concurrent/IProducerConsumerCollection`1.xml @@ -66,19 +66,19 @@ Specifies the type of elements in the collection. Defines methods to manipulate thread-safe collections intended for producer/consumer usage. This interface provides a unified representation for producer/consumer collections so that higher level abstractions such as can use the collection as the underlying storage mechanism. - . - + . + :::code language="csharp" source="~/snippets/csharp/System.Collections.Concurrent/IProducerConsumerCollectionT/Overview/iprodcon.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Collections.Concurrent/IProducerConsumerCollectionT/Overview/iprodcon.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.Collections.Concurrent/IProducerConsumerCollectionT/Overview/iprodcon.vb" id="Snippet1"::: + ]]> All implementations of this interface must enable all members of this interface to be used concurrently from multiple threads. @@ -125,17 +125,17 @@ - The one-dimensional that is the destination of the elements copied from the . - + The one-dimensional that is the destination of the elements copied from the . + The array must have zero-based indexing. The zero-based index in at which copying begins. Copies the elements of the to an , starting at a specified index. - @@ -189,11 +189,11 @@ Copies the elements contained in the to a new array. A new array containing the elements copied from the . - Thread-Safe Collections diff --git a/xml/System.Collections.Concurrent/OrderablePartitioner`1.xml b/xml/System.Collections.Concurrent/OrderablePartitioner`1.xml index da5de150f0a..2503523ac4f 100644 --- a/xml/System.Collections.Concurrent/OrderablePartitioner`1.xml +++ b/xml/System.Collections.Concurrent/OrderablePartitioner`1.xml @@ -185,11 +185,11 @@ interface. Calling on the object creates another partition over the sequence. + The returned object implements the interface. Calling on the object creates another partition over the sequence. - The default implementation provides the same behavior as except that the returned set of partitions does not provide the keys for the elements. + The default implementation provides the same behavior as except that the returned set of partitions does not provide the keys for the elements. - The method is only supported if the property returns true. + The method is only supported if the property returns true. For more information, see [Custom Partitioners for PLINQ and TPL](/dotnet/standard/parallel-programming/custom-partitioners-for-plinq-and-tpl). @@ -245,11 +245,11 @@ interface. Calling on the object creates another partition over the sequence. + The returned object implements the interface. Calling on the object creates another partition over the sequence. Each partition is represented as an enumerator over key-value pairs. The value in the pair is the element itself, and the key is an integer which determines the relative ordering of this element against other elements. - The method is only supported if the property returns true. + The method is only supported if the property returns true. For more information, see [Custom Partitioners for PLINQ and TPL](/dotnet/standard/parallel-programming/custom-partitioners-for-plinq-and-tpl). @@ -368,7 +368,7 @@ except that the returned set of partitions does not provide the keys for the elements. + The default implementation provides the same behavior as except that the returned set of partitions does not provide the keys for the elements. For more information, see [Custom Partitioners for PLINQ and TPL](/dotnet/standard/parallel-programming/custom-partitioners-for-plinq-and-tpl). @@ -423,7 +423,7 @@ returns true, all order keys are distinct integers in the range [0 .. numberOfElements-1]. If the property returns false, order keys must still be distinct, but only their relative order is considered, not their absolute values. + If returns true, all order keys are distinct integers in the range [0 .. numberOfElements-1]. If the property returns false, order keys must still be distinct, but only their relative order is considered, not their absolute values. For more information, see [Custom Partitioners for PLINQ and TPL](/dotnet/standard/parallel-programming/custom-partitioners-for-plinq-and-tpl). @@ -474,7 +474,7 @@ returns true, each element in partition 0 has a smaller order key than any element in partition 1, each element in partition 1 has a smaller order key than any element in partition 2, and so on. + If returns true, each element in partition 0 has a smaller order key than any element in partition 1, each element in partition 1 has a smaller order key than any element in partition 2, and so on. For more information, see [Custom Partitioners for PLINQ and TPL](/dotnet/standard/parallel-programming/custom-partitioners-for-plinq-and-tpl). diff --git a/xml/System.Collections.Concurrent/Partitioner`1.xml b/xml/System.Collections.Concurrent/Partitioner`1.xml index d254d19f606..c57665a04f2 100644 --- a/xml/System.Collections.Concurrent/Partitioner`1.xml +++ b/xml/System.Collections.Concurrent/Partitioner`1.xml @@ -166,9 +166,9 @@ interface. Calling on the object creates another partition over the sequence. + The returned object implements the interface. Calling on the object creates another partition over the sequence. - The method is only supported if the property returns true. For more information, see [Custom Partitioners for PLINQ and TPL](/dotnet/standard/parallel-programming/custom-partitioners-for-plinq-and-tpl). + The method is only supported if the property returns true. For more information, see [Custom Partitioners for PLINQ and TPL](/dotnet/standard/parallel-programming/custom-partitioners-for-plinq-and-tpl). ]]> @@ -276,7 +276,7 @@ , should return false. The value of should not vary over the lifetime of this instance. For more information, see [Custom Partitioners for PLINQ and TPL](/dotnet/standard/parallel-programming/custom-partitioners-for-plinq-and-tpl). + If a derived class does not override and implement , should return false. The value of should not vary over the lifetime of this instance. For more information, see [Custom Partitioners for PLINQ and TPL](/dotnet/standard/parallel-programming/custom-partitioners-for-plinq-and-tpl). ]]> diff --git a/xml/System.Collections.Generic/Comparer`1.xml b/xml/System.Collections.Generic/Comparer`1.xml index 90955327145..67e8261e636 100644 --- a/xml/System.Collections.Generic/Comparer`1.xml +++ b/xml/System.Collections.Generic/Comparer`1.xml @@ -81,20 +81,20 @@ interface for use with collection classes such as the and generic classes. + Derive from this class to provide a custom implementation of the interface for use with collection classes such as the and generic classes. - The difference between deriving from the class and implementing the interface is as follows: + The difference between deriving from the class and implementing the interface is as follows: - To specify how two objects should be compared by default, implement the interface in your class. This ensures that sort operations will use the default comparison code that you provided. -- To define a comparer to use instead of the default comparer, derive from the class. You can then use this comparer in sort operations that take a comparer as a parameter. +- To define a comparer to use instead of the default comparer, derive from the class. You can then use this comparer in sort operations that take a comparer as a parameter. - The object returned by the property uses the generic interface (`IComparable` in C#, `IComparable(Of T)` in Visual Basic) to compare two objects. If type `T` does not implement the generic interface, the property returns a that uses the interface. + The object returned by the property uses the generic interface (`IComparable` in C#, `IComparable(Of T)` in Visual Basic) to compare two objects. If type `T` does not implement the generic interface, the property returns a that uses the interface. ## Examples - The following example derives a class, `BoxLengthFirst`, from the class. This comparer compares two objects of type `Box`. It sorts them first by length, then by height, and then by width. The `Box` class implements the interface to control the default comparison between two `Box` objects. This default implementation sorts first by height, then by length, and then by width. The example shows the differences between the two comparisons by sorting a list of `Box` objects first by using the `BoxLengthFirst` comparer and then by using the default comparer. + The following example derives a class, `BoxLengthFirst`, from the class. This comparer compares two objects of type `Box`. It sorts them first by length, then by height, and then by width. The `Box` class implements the interface to control the default comparison between two `Box` objects. This default implementation sorts first by height, then by length, and then by width. The example shows the differences between the two comparisons by sorting a list of `Box` objects first by using the `BoxLengthFirst` comparer and then by using the default comparer. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ComparerT/Overview/program.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/ComparerT/Overview/program.fs" id="Snippet1"::: @@ -244,7 +244,7 @@ Implement this method to provide a customized sort order comparison for type `T`. ## Examples - The following example defines a comparer of `Box` objects that can be used instead of the default comparer. This example is part of a larger example provided for the class. + The following example defines a comparer of `Box` objects that can be used instead of the default comparer. This example is part of a larger example provided for the class. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ComparerT/Overview/program.cs" id="Snippet5"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/ComparerT/Overview/program.fs" id="Snippet5"::: @@ -361,10 +361,10 @@ returned by this property uses the generic interface (`IComparable` in C#, `IComparable(Of T)` in Visual Basic) to compare two objects. If type `T` does not implement the generic interface, this property returns a that uses the interface. + The returned by this property uses the generic interface (`IComparable` in C#, `IComparable(Of T)` in Visual Basic) to compare two objects. If type `T` does not implement the generic interface, this property returns a that uses the interface. ## Examples - The following example shows how to use the property to get an object that performs the default comparison. This example is part of a larger example provided for the class. + The following example shows how to use the property to get an object that performs the default comparison. This example is part of a larger example provided for the class. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ComparerT/Overview/program.cs" id="Snippet3"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/ComparerT/Overview/program.fs" id="Snippet3"::: @@ -454,12 +454,12 @@ method, so `obj` must be cast to the type specified by the generic argument `T` of the current instance. If it cannot be cast to `T`, an is thrown. + This method is a wrapper for the method, so `obj` must be cast to the type specified by the generic argument `T` of the current instance. If it cannot be cast to `T`, an is thrown. Comparing `null` with any reference type is allowed and does not generate an exception. When sorting, `null` is considered to be less than any other object. ## Examples - The following example shows how to use the method to compare two objects. This example is part of a larger example provided for the class. + The following example shows how to use the method to compare two objects. This example is part of a larger example provided for the class. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ComparerT/Overview/program.cs" id="Snippet4"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/ComparerT/Overview/program.fs" id="Snippet4"::: diff --git a/xml/System.Collections.Generic/Dictionary`2+Enumerator.xml b/xml/System.Collections.Generic/Dictionary`2+Enumerator.xml index 9f0f840042a..e2b9c28220f 100644 --- a/xml/System.Collections.Generic/Dictionary`2+Enumerator.xml +++ b/xml/System.Collections.Generic/Dictionary`2+Enumerator.xml @@ -89,15 +89,15 @@ Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection. - Initially, the enumerator is positioned before the first element in the collection. At this position, is undefined. You must call to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. At this position, is undefined. You must call to advance the enumerator to the first element of the collection before reading the value of . - returns the same object until is called. sets to the next element. + returns the same object until is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator instance instead. + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator instance instead. - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding elements or changing the capacity, the enumerator is irrecoverably invalidated and the next call to or throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding elements or changing the capacity, the enumerator is irrecoverably invalidated and the next call to or throws an . -.NET Core 3.0+ only: The only mutating methods which do not invalidate enumerators are and . +.NET Core 3.0+ only: The only mutating methods which do not invalidate enumerators are and . The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization. @@ -164,15 +164,15 @@ is undefined under any of the following conditions: + is undefined under any of the following conditions: -- The enumerator is positioned before the first element of the collection. That happens after an enumerator is created or after the method is called. The method must be called to advance the enumerator to the first element of the collection before reading the value of the property. +- The enumerator is positioned before the first element of the collection. That happens after an enumerator is created or after the method is called. The method must be called to advance the enumerator to the first element of the collection before reading the value of the property. -- The last call to returned `false`, which indicates the end of the collection and that the enumerator is positioned after the last element of the collection. +- The last call to returned `false`, which indicates the end of the collection and that the enumerator is positioned after the last element of the collection. - The enumerator is invalidated due to changes made in the collection, such as adding, modifying, or deleting elements. - does not move the position of the enumerator, and consecutive calls to return the same object until either or is called. + does not move the position of the enumerator, and consecutive calls to return the same object until either or is called. ]]> @@ -274,13 +274,13 @@ advances the enumerator to the first element of the collection. + After an enumerator is created, the enumerator is positioned before the first element in the collection, and the first call to advances the enumerator to the first element of the collection. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding elements or changing the capacity, the enumerator is irrecoverably invalidated and the next call to or throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding elements or changing the capacity, the enumerator is irrecoverably invalidated and the next call to or throws an . -.NET Core 3.0+ only: The only mutating methods which do not invalidate enumerators are and . +.NET Core 3.0+ only: The only mutating methods which do not invalidate enumerators are and . ]]> @@ -335,15 +335,15 @@ is undefined under any of the following conditions: + is undefined under any of the following conditions: -- The enumerator is positioned before the first element of the collection. That happens after an enumerator is created or after the method is called. The method must be called to advance the enumerator to the first element of the collection before reading the value of the property. +- The enumerator is positioned before the first element of the collection. That happens after an enumerator is created or after the method is called. The method must be called to advance the enumerator to the first element of the collection before reading the value of the property. -- The last call to returned `false`, which indicates the end of the collection and that the enumerator is positioned after the last element of the collection. +- The last call to returned `false`, which indicates the end of the collection and that the enumerator is positioned after the last element of the collection. - The enumerator is invalidated due to changes made in the collection, such as adding, modifying, or deleting elements. - does not move the position of the enumerator, and consecutive calls to return the same object until either or is called. + does not move the position of the enumerator, and consecutive calls to return the same object until either or is called. ]]> @@ -407,15 +407,15 @@ is undefined under any of the following conditions: + is undefined under any of the following conditions: -- The enumerator is positioned before the first element of the collection. That happens after an enumerator is created or after the method is called. The method must be called to advance the enumerator to the first element of the collection before reading the value of the property. +- The enumerator is positioned before the first element of the collection. That happens after an enumerator is created or after the method is called. The method must be called to advance the enumerator to the first element of the collection before reading the value of the property. -- The last call to returned `false`, which indicates the end of the collection and that the enumerator is positioned after the last element of the collection. +- The last call to returned `false`, which indicates the end of the collection and that the enumerator is positioned after the last element of the collection. - The enumerator is invalidated due to changes made in the collection, such as adding, modifying, or deleting elements. - does not move the position of the enumerator, and consecutive calls to return the same object until either or is called. + does not move the position of the enumerator, and consecutive calls to return the same object until either or is called. ]]> @@ -480,15 +480,15 @@ is undefined under any of the following conditions: + is undefined under any of the following conditions: -- The enumerator is positioned before the first element of the collection. That happens after an enumerator is created or after the method is called. The method must be called to advance the enumerator to the first element of the collection before reading the value of the property. +- The enumerator is positioned before the first element of the collection. That happens after an enumerator is created or after the method is called. The method must be called to advance the enumerator to the first element of the collection before reading the value of the property. -- The last call to returned `false`, which indicates the end of the collection and that the enumerator is positioned after the last element of the collection. +- The last call to returned `false`, which indicates the end of the collection and that the enumerator is positioned after the last element of the collection. - The enumerator is invalidated due to changes made in the collection, such as adding, modifying, or deleting elements. - does not move the position of the enumerator, and consecutive calls to return the same object until either or is called. + does not move the position of the enumerator, and consecutive calls to return the same object until either or is called. ]]> @@ -554,15 +554,15 @@ ## Remarks - is undefined under any of the following conditions: + is undefined under any of the following conditions: -- The enumerator is positioned before the first element of the collection. That happens after an enumerator is created or after the method is called. The method must be called to advance the enumerator to the first element of the collection before reading the value of the property. +- The enumerator is positioned before the first element of the collection. That happens after an enumerator is created or after the method is called. The method must be called to advance the enumerator to the first element of the collection before reading the value of the property. -- The last call to returned `false`, which indicates the end of the collection and that the enumerator is positioned after the last element of the collection. +- The last call to returned `false`, which indicates the end of the collection and that the enumerator is positioned after the last element of the collection. - The enumerator is invalidated due to changes made in the collection, such as adding, modifying, or deleting elements. - does not move the position of the enumerator, and consecutive calls to return the same object until either or is called. + does not move the position of the enumerator, and consecutive calls to return the same object until either or is called. ]]> @@ -619,11 +619,11 @@ method, you must call the method to advance the enumerator to the first element of the collection before reading the value of the property. + After calling the method, you must call the method to advance the enumerator to the first element of the collection before reading the value of the property. - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding elements or changing the capacity, the enumerator is irrecoverably invalidated and the next call to or throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding elements or changing the capacity, the enumerator is irrecoverably invalidated and the next call to or throws an . -.NET Core 3.0+ only: The only mutating methods which do not invalidate enumerators are and . +.NET Core 3.0+ only: The only mutating methods which do not invalidate enumerators are and . ]]> diff --git a/xml/System.Collections.Generic/Dictionary`2+KeyCollection+Enumerator.xml b/xml/System.Collections.Generic/Dictionary`2+KeyCollection+Enumerator.xml index f4b6170c277..4a5a236ca79 100644 --- a/xml/System.Collections.Generic/Dictionary`2+KeyCollection+Enumerator.xml +++ b/xml/System.Collections.Generic/Dictionary`2+KeyCollection+Enumerator.xml @@ -84,15 +84,15 @@ Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection. - Initially, the enumerator is positioned before the first element in the collection. At this position, is undefined. You must call to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. At this position, is undefined. You must call to advance the enumerator to the first element of the collection before reading the value of . - returns the same object until is called. sets to the next element. + returns the same object until is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator instance instead. + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator instance instead. - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding elements or changing the capacity, the enumerator is irrecoverably invalidated and the next call to or throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding elements or changing the capacity, the enumerator is irrecoverably invalidated and the next call to or throws an . -.NET Core 3.0+ only: The only mutating methods which do not invalidate enumerators are and . +.NET Core 3.0+ only: The only mutating methods which do not invalidate enumerators are and . The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization. @@ -159,15 +159,15 @@ is undefined under any of the following conditions: + is undefined under any of the following conditions: -- The enumerator is positioned before the first element of the collection. That happens after an enumerator is created or after the method is called. The method must be called to advance the enumerator to the first element of the collection before reading the value of the property. +- The enumerator is positioned before the first element of the collection. That happens after an enumerator is created or after the method is called. The method must be called to advance the enumerator to the first element of the collection before reading the value of the property. -- The last call to returned `false`, which indicates the end of the collection and that the enumerator is positioned after the last element of the collection. +- The last call to returned `false`, which indicates the end of the collection and that the enumerator is positioned after the last element of the collection. - The enumerator is invalidated due to changes made in the collection, such as adding, modifying, or deleting elements. - does not move the position of the enumerator, and consecutive calls to return the same object until either or is called. + does not move the position of the enumerator, and consecutive calls to return the same object until either or is called. ]]> @@ -273,13 +273,13 @@ advances the enumerator to the first element of the collection. + After an enumerator is created, the enumerator is positioned before the first element in the collection, and the first call to advances the enumerator to the first element of the collection. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding elements or changing the capacity, the enumerator is irrecoverably invalidated and the next call to or throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding elements or changing the capacity, the enumerator is irrecoverably invalidated and the next call to or throws an . -.NET Core 3.0+ only: The only mutating methods which do not invalidate enumerators are and . +.NET Core 3.0+ only: The only mutating methods which do not invalidate enumerators are and . ]]> @@ -342,15 +342,15 @@ ## Remarks - is undefined under any of the following conditions: + is undefined under any of the following conditions: -- The enumerator is positioned before the first element of the collection. That happens after an enumerator is created or after the method is called. The method must be called to advance the enumerator to the first element of the collection before reading the value of the property. +- The enumerator is positioned before the first element of the collection. That happens after an enumerator is created or after the method is called. The method must be called to advance the enumerator to the first element of the collection before reading the value of the property. -- The last call to returned `false`, which indicates the end of the collection and that the enumerator is positioned after the last element of the collection. +- The last call to returned `false`, which indicates the end of the collection and that the enumerator is positioned after the last element of the collection. - The enumerator is invalidated due to changes made in the collection, such as adding, modifying, or deleting elements. - does not move the position of the enumerator, and consecutive calls to return the same object until either or is called. + does not move the position of the enumerator, and consecutive calls to return the same object until either or is called. ]]> @@ -408,11 +408,11 @@ method, you must call the method to advance the enumerator to the first element of the collection before reading the value of the property. + After calling the method, you must call the method to advance the enumerator to the first element of the collection before reading the value of the property. - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding elements or changing the capacity, the enumerator is irrecoverably invalidated and the next call to or throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding elements or changing the capacity, the enumerator is irrecoverably invalidated and the next call to or throws an . -.NET Core 3.0+ only: The only mutating methods which do not invalidate enumerators are and . +.NET Core 3.0+ only: The only mutating methods which do not invalidate enumerators are and . ]]> diff --git a/xml/System.Collections.Generic/Dictionary`2+KeyCollection.xml b/xml/System.Collections.Generic/Dictionary`2+KeyCollection.xml index 0b543860e2a..c46aaeb2bd6 100644 --- a/xml/System.Collections.Generic/Dictionary`2+KeyCollection.xml +++ b/xml/System.Collections.Generic/Dictionary`2+KeyCollection.xml @@ -103,9 +103,9 @@ property returns an instance of this type, containing all the keys in that . The order of the keys in the is unspecified, but it is the same order as the associated values in the returned by the property. + The property returns an instance of this type, containing all the keys in that . The order of the keys in the is unspecified, but it is the same order as the associated values in the returned by the property. - The is not a static copy; instead, the refers back to the keys in the original . Therefore, changes to the continue to be reflected in the . + The is not a static copy; instead, the refers back to the keys in the original . Therefore, changes to the continue to be reflected in the . ]]> @@ -158,7 +158,7 @@ is not a static copy; instead, the refers back to the keys in the original . Therefore, changes to the continue to be reflected in the . + The is not a static copy; instead, the refers back to the keys in the original . Therefore, changes to the continue to be reflected in the . This constructor is an O(1) operation. @@ -252,9 +252,9 @@ in the same order in which the enumerator iterates through the . + The elements are copied to the in the same order in which the enumerator iterates through the . - This method is an O(`n`) operation, where `n` is . + This method is an O(`n`) operation, where `n` is . ]]> @@ -365,15 +365,15 @@ Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection. - Initially, the enumerator is positioned before the first element in the collection. At this position, is undefined. You must call to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. At this position, is undefined. You must call to advance the enumerator to the first element of the collection before reading the value of . - returns the same object until is called. sets to the next element. + returns the same object until is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator instance instead. + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator instance instead. - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding elements or changing the capacity, the enumerator is irrecoverably invalidated and the next call to or throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding elements or changing the capacity, the enumerator is irrecoverably invalidated and the next call to or throws an . -.NET Core 3.0+ only: The only mutating methods which do not invalidate enumerators are and . +.NET Core 3.0+ only: The only mutating methods which do not invalidate enumerators are and . The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization. @@ -485,7 +485,7 @@ is set to zero, and references to other objects from elements of the collection are also released. + is set to zero, and references to other objects from elements of the collection are also released. ]]> @@ -541,7 +541,7 @@ uses , whereas, allows the user to specify the implementation to use for comparing keys. + Implementations can vary in how they determine equality of objects; for example, uses , whereas, allows the user to specify the implementation to use for comparing keys. This method is an O(1) operation. @@ -657,7 +657,7 @@ uses , whereas, allows the user to specify the implementation to use for comparing keys. + Implementations can vary in how they determine equality of objects; for example, uses , whereas, allows the user to specify the implementation to use for comparing keys. ]]> @@ -717,15 +717,15 @@ Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection. - Initially, the enumerator is positioned before the first element in the collection. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . - returns the same object until is called. sets to the next element. + returns the same object until is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator instance instead. + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator instance instead. - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding elements or changing the capacity, the enumerator is irrecoverably invalidated and the next call to or throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding elements or changing the capacity, the enumerator is irrecoverably invalidated and the next call to or throws an . -.NET Core 3.0+ only: The only mutating methods which do not invalidate enumerators are and . +.NET Core 3.0+ only: The only mutating methods which do not invalidate enumerators are and . The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization. @@ -792,9 +792,9 @@ ## Remarks > [!NOTE] -> If the type of the source cannot be cast automatically to the type of the destination `array`, the non-generic implementations of throw , whereas the generic implementations throw . +> If the type of the source cannot be cast automatically to the type of the destination `array`, the non-generic implementations of throw , whereas the generic implementations throw . - This method is an O(`n`) operation, where `n` is . + This method is an O(`n`) operation, where `n` is . ]]> @@ -872,7 +872,7 @@ Enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization. - returns an object that can be used to synchronize access to the . Synchronization is effective only if all threads lock this object before accessing the collection. + returns an object that can be used to synchronize access to the . Synchronization is effective only if all threads lock this object before accessing the collection. Retrieving the value of this property is an O(1) operation. @@ -938,7 +938,7 @@ Enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization. - returns an object that can be used to synchronize access to the . Synchronization is effective only if all threads lock this object before accessing the collection. The following code shows the use of the property. + returns an object that can be used to synchronize access to the . Synchronization is effective only if all threads lock this object before accessing the collection. The following code shows the use of the property. ```csharp ICollection ic = ...; @@ -1013,15 +1013,15 @@ Retrieving the value of this property is an O(1) operation. Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection. - Initially, the enumerator is positioned before the first element in the collection. also brings the enumerator back to this position. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. also brings the enumerator back to this position. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . - returns the same object until either or is called. sets to the next element. + returns the same object until either or is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. To set to the first element of the collection again, you can call followed by . + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. To set to the first element of the collection again, you can call followed by . - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding elements or changing the capacity, the enumerator is irrecoverably invalidated and the next call to or throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding elements or changing the capacity, the enumerator is irrecoverably invalidated and the next call to or throws an . -.NET Core 3.0+ only: The only mutating methods which do not invalidate enumerators are and . +.NET Core 3.0+ only: The only mutating methods which do not invalidate enumerators are and . The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization. diff --git a/xml/System.Collections.Generic/Dictionary`2+ValueCollection+Enumerator.xml b/xml/System.Collections.Generic/Dictionary`2+ValueCollection+Enumerator.xml index 7680f479af1..d8704fbc0cf 100644 --- a/xml/System.Collections.Generic/Dictionary`2+ValueCollection+Enumerator.xml +++ b/xml/System.Collections.Generic/Dictionary`2+ValueCollection+Enumerator.xml @@ -84,13 +84,13 @@ Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection. - Initially, the enumerator is positioned before the first element in the collection. At this position, is undefined. You must call to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. At this position, is undefined. You must call to advance the enumerator to the first element of the collection before reading the value of . - returns the same object until is called. sets to the next element. + returns the same object until is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator instance instead. + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator instance instead. - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization. @@ -158,15 +158,15 @@ ## Remarks - is undefined under any of the following conditions: + is undefined under any of the following conditions: -- The enumerator is positioned before the first element of the collection. That happens after an enumerator is created or after the method is called. The method must be called to advance the enumerator to the first element of the collection before reading the value of the property. +- The enumerator is positioned before the first element of the collection. That happens after an enumerator is created or after the method is called. The method must be called to advance the enumerator to the first element of the collection before reading the value of the property. -- The last call to returned `false`, which indicates the end of the collection and that the enumerator is positioned after the last element of the collection. +- The last call to returned `false`, which indicates the end of the collection and that the enumerator is positioned after the last element of the collection. - The enumerator is invalidated due to changes made in the collection, such as adding, modifying, or deleting elements. - does not move the position of the enumerator, and consecutive calls to return the same object until either or is called. + does not move the position of the enumerator, and consecutive calls to return the same object until either or is called. ]]> @@ -269,11 +269,11 @@ advances the enumerator to the first element of the collection. + After an enumerator is created, the enumerator is positioned before the first element in the collection, and the first call to advances the enumerator to the first element of the collection. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . ]]> @@ -336,15 +336,15 @@ ## Remarks - is undefined under any of the following conditions: + is undefined under any of the following conditions: -- The enumerator is positioned before the first element of the collection. That happens after an enumerator is created or after the method is called. The method must be called to advance the enumerator to the first element of the collection before reading the value of the property. +- The enumerator is positioned before the first element of the collection. That happens after an enumerator is created or after the method is called. The method must be called to advance the enumerator to the first element of the collection before reading the value of the property. -- The last call to returned `false`, which indicates the end of the collection and that the enumerator is positioned after the last element of the collection. +- The last call to returned `false`, which indicates the end of the collection and that the enumerator is positioned after the last element of the collection. - The enumerator is invalidated due to changes made in the collection, such as adding, modifying, or deleting elements. - does not move the position of the enumerator, and consecutive calls to return the same object until either or is called. + does not move the position of the enumerator, and consecutive calls to return the same object until either or is called. ]]> @@ -402,9 +402,9 @@ method, you must call the method to advance the enumerator to the first element of the collection before reading the value of the property. + After calling the method, you must call the method to advance the enumerator to the first element of the collection before reading the value of the property. - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . ]]> diff --git a/xml/System.Collections.Generic/Dictionary`2+ValueCollection.xml b/xml/System.Collections.Generic/Dictionary`2+ValueCollection.xml index e6c3dd543ea..4d50261cab3 100644 --- a/xml/System.Collections.Generic/Dictionary`2+ValueCollection.xml +++ b/xml/System.Collections.Generic/Dictionary`2+ValueCollection.xml @@ -103,9 +103,9 @@ property returns an instance of this type, containing all the values in that . The order of the values in the is unspecified, but it is the same order as the associated keys in the returned by the property. + The property returns an instance of this type, containing all the values in that . The order of the values in the is unspecified, but it is the same order as the associated keys in the returned by the property. - The is not a static copy; instead, the refers back to the values in the original . Therefore, changes to the continue to be reflected in the . + The is not a static copy; instead, the refers back to the values in the original . Therefore, changes to the continue to be reflected in the . ]]> @@ -158,7 +158,7 @@ is not a static copy; instead, the refers back to the values in the original . Therefore, changes to the continue to be reflected in the . + The is not a static copy; instead, the refers back to the values in the original . Therefore, changes to the continue to be reflected in the . This constructor is an O(1) operation. @@ -220,9 +220,9 @@ in the same order in which the enumerator iterates through the . + The elements are copied to the in the same order in which the enumerator iterates through the . - This method is an O(`n`) operation, where `n` is . + This method is an O(`n`) operation, where `n` is . ]]> @@ -338,15 +338,15 @@ Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection. - Initially, the enumerator is positioned before the first element in the collection. At this position, is undefined. You must call to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. At this position, is undefined. You must call to advance the enumerator to the first element of the collection before reading the value of . - The returns the same object until is called. sets to the next element. + The returns the same object until is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator instance instead. + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator instance instead. - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding elements or changing the capacity, the enumerator is irrecoverably invalidated and the next call to or throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding elements or changing the capacity, the enumerator is irrecoverably invalidated and the next call to or throws an . -.NET Core 3.0+ only: The only mutating methods which do not invalidate enumerators are and . +.NET Core 3.0+ only: The only mutating methods which do not invalidate enumerators are and . The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization. @@ -458,7 +458,7 @@ is set to zero, and references to other objects from elements of the collection are also released. + is set to zero, and references to other objects from elements of the collection are also released. ]]> @@ -518,9 +518,9 @@ uses , whereas, allows the user to specify the implementation to use for comparing keys. + Implementations can vary in how they determine equality of objects; for example, uses , whereas, allows the user to specify the implementation to use for comparing keys. - This method is an O(`n`) operation, where `n` is . + This method is an O(`n`) operation, where `n` is . ]]> @@ -634,7 +634,7 @@ uses , whereas, allows the user to specify the implementation to use for comparing keys. + Implementations can vary in how they determine equality of objects; for example, uses , whereas, allows the user to specify the implementation to use for comparing keys. ]]> @@ -694,15 +694,15 @@ Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection. - Initially, the enumerator is positioned before the first element in the collection. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . - returns the same object until is called. sets to the next element. + returns the same object until is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator instance instead. + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator instance instead. - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding elements or changing the capacity, the enumerator is irrecoverably invalidated and the next call to or throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding elements or changing the capacity, the enumerator is irrecoverably invalidated and the next call to or throws an . -.NET Core 3.0+ only: The only mutating methods which do not invalidate enumerators are and . +.NET Core 3.0+ only: The only mutating methods which do not invalidate enumerators are and . The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization. @@ -769,9 +769,9 @@ ## Remarks > [!NOTE] -> If the type of the source cannot be cast automatically to the type of the destination `array`, the non-generic implementations of throw , whereas the generic implementations throw . +> If the type of the source cannot be cast automatically to the type of the destination `array`, the non-generic implementations of throw , whereas the generic implementations throw . - This method is an O(`n`) operation, where `n` is . + This method is an O(`n`) operation, where `n` is . ]]> @@ -849,7 +849,7 @@ Enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization. - returns an object, which can be used to synchronize access to the . Synchronization is effective only if all threads lock this object before accessing the collection. + returns an object, which can be used to synchronize access to the . Synchronization is effective only if all threads lock this object before accessing the collection. Retrieving the value of this property is an O(1) operation. @@ -915,7 +915,7 @@ Enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization. - returns an object, which can be used to synchronize access to the . Synchronization is effective only if all threads lock this object before accessing the collection. The following code shows the use of the property. + returns an object, which can be used to synchronize access to the . Synchronization is effective only if all threads lock this object before accessing the collection. The following code shows the use of the property. ```csharp ICollection ic = ...; @@ -990,15 +990,15 @@ End SyncLock Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection. - Initially, the enumerator is positioned before the first element in the collection. also brings the enumerator back to this position. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. also brings the enumerator back to this position. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . - returns the same object until either or is called. sets to the next element. + returns the same object until either or is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. To set to the first element of the collection again, you can call followed by . + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. To set to the first element of the collection again, you can call followed by . - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding elements or changing the capacity, the enumerator is irrecoverably invalidated and the next call to or throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding elements or changing the capacity, the enumerator is irrecoverably invalidated and the next call to or throws an . -.NET Core 3.0+ only: The only mutating methods which do not invalidate enumerators are and . +.NET Core 3.0+ only: The only mutating methods which do not invalidate enumerators are and . The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization. diff --git a/xml/System.Collections.Generic/Dictionary`2.xml b/xml/System.Collections.Generic/Dictionary`2.xml index 9610a4c3e8a..24cbbbdf23a 100644 --- a/xml/System.Collections.Generic/Dictionary`2.xml +++ b/xml/System.Collections.Generic/Dictionary`2.xml @@ -134,25 +134,25 @@ generic class provides a mapping from a set of keys to a set of values. Each addition to the dictionary consists of a value and its associated key. Retrieving a value by using its key is very fast, close to O(1), because the class is implemented as a hash table. + The generic class provides a mapping from a set of keys to a set of values. Each addition to the dictionary consists of a value and its associated key. Retrieving a value by using its key is very fast, close to O(1), because the class is implemented as a hash table. > [!NOTE] > The speed of retrieval depends on the quality of the hashing algorithm of the type specified for `TKey`. - As long as an object is used as a key in the , it must not change in any way that affects its hash value. Every key in a must be unique according to the dictionary's equality comparer. A key cannot be `null`, but a value can be, if its type `TValue` is a reference type. + As long as an object is used as a key in the , it must not change in any way that affects its hash value. Every key in a must be unique according to the dictionary's equality comparer. A key cannot be `null`, but a value can be, if its type `TValue` is a reference type. - requires an equality implementation to determine whether keys are equal. You can specify an implementation of the generic interface by using a constructor that accepts a `comparer` parameter; if you do not specify an implementation, the default generic equality comparer is used. If type `TKey` implements the generic interface, the default equality comparer uses that implementation. + requires an equality implementation to determine whether keys are equal. You can specify an implementation of the generic interface by using a constructor that accepts a `comparer` parameter; if you do not specify an implementation, the default generic equality comparer is used. If type `TKey` implements the generic interface, the default equality comparer uses that implementation. > [!NOTE] > For example, you can use the case-insensitive string comparers provided by the class to create dictionaries with case-insensitive string keys. - The capacity of a is the number of elements the can hold. As elements are added to a , the capacity is automatically increased as required by reallocating the internal array. + The capacity of a is the number of elements the can hold. As elements are added to a , the capacity is automatically increased as required by reallocating the internal array. - **.NET Framework only:** For very large objects, you can increase the maximum capacity to 2 billion elements on a 64-bit system by setting the `enabled` attribute of the [``](/dotnet/framework/configure-apps/file-schema/runtime/gcallowverylargeobjects-element) configuration element to `true` in the run-time environment. + **.NET Framework only:** For very large objects, you can increase the maximum capacity to 2 billion elements on a 64-bit system by setting the `enabled` attribute of the [``](/dotnet/framework/configure-apps/file-schema/runtime/gcallowverylargeobjects-element) configuration element to `true` in the run-time environment. - For purposes of enumeration, each item in the dictionary is treated as a structure representing a value and its key. The order in which the items are returned is undefined. + For purposes of enumeration, each item in the dictionary is treated as a structure representing a value and its key. The order in which the items are returned is undefined. - The `foreach` statement of the C# language (`For Each` in Visual Basic) returns an object of the type of the elements in the collection. Since the is a collection of keys and values, the element type is not the type of the key or the type of the value. Instead, the element type is a of the key type and the value type. For example: + The `foreach` statement of the C# language (`For Each` in Visual Basic) returns an object of the type of the elements in the collection. Since the is a collection of keys and values, the element type is not the type of the key or the type of the value. Instead, the element type is a of the key type and the value type. For example: :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/DictionaryTKey,TValue/Overview/source2.cs" id="Snippet11"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/DictionaryTKey,TValue/Overview/source2.fs" id="Snippet11"::: @@ -161,21 +161,21 @@ The `foreach` statement is a wrapper around the enumerator, which allows only reading from the collection, not writing to it. > [!NOTE] -> Because keys can be inherited and their behavior changed, their absolute uniqueness cannot be guaranteed by comparisons using the method. +> Because keys can be inherited and their behavior changed, their absolute uniqueness cannot be guaranteed by comparisons using the method. ## Examples - The following code example creates an empty of strings with string keys and uses the method to add some elements. The example demonstrates that the method throws an when attempting to add a duplicate key. + The following code example creates an empty of strings with string keys and uses the method to add some elements. The example demonstrates that the method throws an when attempting to add a duplicate key. - The example uses the property (the indexer in C#) to retrieve values, demonstrating that a is thrown when a requested key is not present, and showing that the value associated with a key can be replaced. + The example uses the property (the indexer in C#) to retrieve values, demonstrating that a is thrown when a requested key is not present, and showing that the value associated with a key can be replaced. - The example shows how to use the method as a more efficient way to retrieve values if a program often must try key values that are not in the dictionary, and it shows how to use the method to test whether a key exists before calling the method. + The example shows how to use the method as a more efficient way to retrieve values if a program often must try key values that are not in the dictionary, and it shows how to use the method to test whether a key exists before calling the method. - The example shows how to enumerate the keys and values in the dictionary and how to enumerate the keys and values alone using the property and the property. + The example shows how to enumerate the keys and values in the dictionary and how to enumerate the keys and values alone using the property and the property. - Finally, the example demonstrates the method. + Finally, the example demonstrates the method. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/DictionaryTKey,TValue/Overview/source.cs" interactive="try-dotnet-method" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/DictionaryTKey,TValue/Overview/source.fs" id="Snippet1"::: @@ -245,12 +245,12 @@ must be unique according to the default equality comparer. + Every key in a must be unique according to the default equality comparer. - requires an equality implementation to determine whether keys are equal. This constructor uses the default generic equality comparer, . If type `TKey` implements the generic interface, the default equality comparer uses that implementation. Alternatively, you can specify an implementation of the generic interface by using a constructor that accepts a `comparer` parameter. + requires an equality implementation to determine whether keys are equal. This constructor uses the default generic equality comparer, . If type `TKey` implements the generic interface, the default equality comparer uses that implementation. Alternatively, you can specify an implementation of the generic interface by using a constructor that accepts a `comparer` parameter. > [!NOTE] -> If you can estimate the size of the collection, using a constructor that specifies the initial capacity eliminates the need to perform a number of resizing operations while adding elements to the . +> If you can estimate the size of the collection, using a constructor that specifies the initial capacity eliminates the need to perform a number of resizing operations while adding elements to the . This constructor is an O(1) operation. @@ -258,9 +258,9 @@ ## Examples - The following code example creates an empty of strings with string keys and uses the method to add some elements. The example demonstrates that the method throws an when attempting to add a duplicate key. + The following code example creates an empty of strings with string keys and uses the method to add some elements. The example demonstrates that the method throws an when attempting to add a duplicate key. - This code example is part of a larger example provided for the class. + This code example is part of a larger example provided for the class. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/DictionaryTKey,TValue/Overview/source.cs" interactive="try-dotnet-method" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/DictionaryTKey,TValue/Overview/source.fs" id="Snippet2"::: @@ -317,18 +317,18 @@ must be unique according to the default equality comparer; likewise, every key in the source `dictionary` must also be unique according to the default equality comparer. + Every key in a must be unique according to the default equality comparer; likewise, every key in the source `dictionary` must also be unique according to the default equality comparer. - The initial capacity of the new is large enough to contain all the elements in `dictionary`. + The initial capacity of the new is large enough to contain all the elements in `dictionary`. - requires an equality implementation to determine whether keys are equal. This constructor uses the default generic equality comparer, . If type `TKey` implements the generic interface, the default equality comparer uses that implementation. Alternatively, you can specify an implementation of the generic interface by using a constructor that accepts a `comparer` parameter. + requires an equality implementation to determine whether keys are equal. This constructor uses the default generic equality comparer, . If type `TKey` implements the generic interface, the default equality comparer uses that implementation. Alternatively, you can specify an implementation of the generic interface by using a constructor that accepts a `comparer` parameter. This constructor is an O(n) operation, where n is the number of elements in `dictionary`. ## Examples - The following code example shows how to use the constructor to initialize a with sorted content from another dictionary. The code example creates a and populates it with data in random order, then passes the to the constructor, creating a that is sorted. This is useful if you need to build a sorted dictionary that at some point becomes static; copying the data from a to a improves retrieval speed. + The following code example shows how to use the constructor to initialize a with sorted content from another dictionary. The code example creates a and populates it with data in random order, then passes the to the constructor, creating a that is sorted. This is useful if you need to build a sorted dictionary that at some point becomes static; copying the data from a to a improves retrieval speed. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/DictionaryTKey,TValue/.ctor/source.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/DictionaryTKey,TValue/.ctor/source.fs" id="Snippet1"::: @@ -447,12 +447,12 @@ ## Remarks Use this constructor with the case-insensitive string comparers provided by the class to create dictionaries with case-insensitive string keys. - Every key in a must be unique according to the specified comparer. + Every key in a must be unique according to the specified comparer. - requires an equality implementation to determine whether keys are equal. If `comparer` is `null`, this constructor uses the default generic equality comparer, . If type `TKey` implements the generic interface, the default equality comparer uses that implementation. + requires an equality implementation to determine whether keys are equal. If `comparer` is `null`, this constructor uses the default generic equality comparer, . If type `TKey` implements the generic interface, the default equality comparer uses that implementation. > [!NOTE] -> If you can estimate the size of the collection, using a constructor that specifies the initial capacity eliminates the need to perform a number of resizing operations while adding elements to the . +> If you can estimate the size of the collection, using a constructor that specifies the initial capacity eliminates the need to perform a number of resizing operations while adding elements to the . This constructor is an O(1) operation. @@ -462,7 +462,7 @@ > If `capacity` comes from user input, prefer using a constructor without a capacity parameter and letting the collection resize as elements are added. If you must use a user-specified value, either clamp it to a reasonable limit (for example, `Math.Clamp(untrustedValue, 0, 20)`) or verify that the element count matches the specified value. ## Examples - The following code example creates a with a case-insensitive equality comparer for the current culture. The example adds four elements, some with lower-case keys and some with upper-case keys. The example then attempts to add an element with a key that differs from an existing key only by case, catches the resulting exception, and displays an error message. Finally, the example displays the elements in the dictionary. + The following code example creates a with a case-insensitive equality comparer for the current culture. The example adds four elements, some with lower-case keys and some with upper-case keys. The example then attempts to add an element with a key that differs from an existing key only by case, catches the resulting exception, and displays an error message. Finally, the example displays the elements in the dictionary. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/DictionaryTKey,TValue/.ctor/source2.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/DictionaryTKey,TValue/.ctor/source2.fs" id="Snippet1"::: @@ -519,13 +519,13 @@ must be unique according to the default equality comparer. + Every key in a must be unique according to the default equality comparer. - The capacity of a is the number of elements that can be added to the before resizing is necessary. As elements are added to a , the capacity is automatically increased as required by reallocating the internal array. + The capacity of a is the number of elements that can be added to the before resizing is necessary. As elements are added to a , the capacity is automatically increased as required by reallocating the internal array. - If the size of the collection can be estimated, specifying the initial capacity eliminates the need to perform a number of resizing operations while adding elements to the . + If the size of the collection can be estimated, specifying the initial capacity eliminates the need to perform a number of resizing operations while adding elements to the . - requires an equality implementation to determine whether keys are equal. This constructor uses the default generic equality comparer, . If type `TKey` implements the generic interface, the default equality comparer uses that implementation. Alternatively, you can specify an implementation of the generic interface by using a constructor that accepts a `comparer` parameter. + requires an equality implementation to determine whether keys are equal. This constructor uses the default generic equality comparer, . If type `TKey` implements the generic interface, the default equality comparer uses that implementation. Alternatively, you can specify an implementation of the generic interface by using a constructor that accepts a `comparer` parameter. This constructor is an O(1) operation. @@ -603,21 +603,21 @@ ## Remarks Use this constructor with the case-insensitive string comparers provided by the class to create dictionaries with case-insensitive string keys. - Every key in a must be unique according to the specified comparer; likewise, every key in the source `dictionary` must also be unique according to the specified comparer. + Every key in a must be unique according to the specified comparer; likewise, every key in the source `dictionary` must also be unique according to the specified comparer. > [!NOTE] > For example, duplicate keys can occur if `comparer` is one of the case-insensitive string comparers provided by the class and `dictionary` does not use a case-insensitive comparer key. - The initial capacity of the new is large enough to contain all the elements in `dictionary`. + The initial capacity of the new is large enough to contain all the elements in `dictionary`. - requires an equality implementation to determine whether keys are equal. If `comparer` is `null`, this constructor uses the default generic equality comparer, . If type `TKey` implements the generic interface, the default equality comparer uses that implementation. + requires an equality implementation to determine whether keys are equal. If `comparer` is `null`, this constructor uses the default generic equality comparer, . If type `TKey` implements the generic interface, the default equality comparer uses that implementation. This constructor is an O(`n`) operation, where `n` is the number of elements in `dictionary`. ## Examples - The following code example shows how to use the constructor to initialize a with case-insensitive sorted content from another dictionary. The code example creates a with a case-insensitive comparer and populates it with data in random order, then passes the to the constructor, along with a case-insensitive equality comparer, creating a that is sorted. This is useful if you need to build a sorted dictionary that at some point becomes static; copying the data from a to a improves retrieval speed. + The following code example shows how to use the constructor to initialize a with case-insensitive sorted content from another dictionary. The code example creates a with a case-insensitive comparer and populates it with data in random order, then passes the to the constructor, along with a case-insensitive equality comparer, creating a that is sorted. This is useful if you need to build a sorted dictionary that at some point becomes static; copying the data from a to a improves retrieval speed. > [!NOTE] > When you create a new dictionary with a case-insensitive comparer and populate it with entries from a dictionary that uses a case-sensitive comparer, as in this example, an exception occurs if the input dictionary has keys that differ only by case. @@ -752,20 +752,20 @@ ## Remarks Use this constructor with the case-insensitive string comparers provided by the class to create dictionaries with case-insensitive string keys. - Every key in a must be unique according to the specified comparer. + Every key in a must be unique according to the specified comparer. - The capacity of a is the number of elements that can be added to the before resizing is necessary. As elements are added to a , the capacity is automatically increased as required by reallocating the internal array. + The capacity of a is the number of elements that can be added to the before resizing is necessary. As elements are added to a , the capacity is automatically increased as required by reallocating the internal array. - If the size of the collection can be estimated, specifying the initial capacity eliminates the need to perform a number of resizing operations while adding elements to the . + If the size of the collection can be estimated, specifying the initial capacity eliminates the need to perform a number of resizing operations while adding elements to the . - requires an equality implementation to determine whether keys are equal. If `comparer` is `null`, this constructor uses the default generic equality comparer, . If type `TKey` implements the generic interface, the default equality comparer uses that implementation. + requires an equality implementation to determine whether keys are equal. If `comparer` is `null`, this constructor uses the default generic equality comparer, . If type `TKey` implements the generic interface, the default equality comparer uses that implementation. This constructor is an O(1) operation. ## Examples - The following code example creates a with an initial capacity of 5 and a case-insensitive equality comparer for the current culture. The example adds four elements, some with lower-case keys and some with upper-case keys. The example then attempts to add an element with a key that differs from an existing key only by case, catches the resulting exception, and displays an error message. Finally, the example displays the elements in the dictionary. + The following code example creates a with an initial capacity of 5 and a case-insensitive equality comparer for the current culture. The example adds four elements, some with lower-case keys and some with upper-case keys. The example then attempts to add an element with a key that differs from an existing key only by case, catches the resulting exception, and displays an error message. Finally, the example displays the elements in the dictionary. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/DictionaryTKey,TValue/.ctor/source4.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/DictionaryTKey,TValue/.ctor/source4.fs" id="Snippet1"::: @@ -893,21 +893,21 @@ property to add new elements by setting the value of a key that does not exist in the ; for example, `myCollection[myKey] = myValue` (in Visual Basic, `myCollection(myKey) = myValue`). However, if the specified key already exists in the , setting the property overwrites the old value. In contrast, the method throws an exception if a value with the specified key already exists. + You can also use the property to add new elements by setting the value of a key that does not exist in the ; for example, `myCollection[myKey] = myValue` (in Visual Basic, `myCollection(myKey) = myValue`). However, if the specified key already exists in the , setting the property overwrites the old value. In contrast, the method throws an exception if a value with the specified key already exists. - If the property value already equals the capacity, the capacity of the is increased by automatically reallocating the internal array, and the existing elements are copied to the new array before the new element is added. + If the property value already equals the capacity, the capacity of the is increased by automatically reallocating the internal array, and the existing elements are copied to the new array before the new element is added. A key cannot be `null`, but a value can be, if `TValue` is a reference type. - If is less than the capacity, this method approaches an O(1) operation. If the capacity must be increased to accommodate the new element, this method becomes an O(`n`) operation, where `n` is . + If is less than the capacity, this method approaches an O(1) operation. If the capacity must be increased to accommodate the new element, this method becomes an O(`n`) operation, where `n` is . ## Examples - The following code example creates an empty of strings with string keys and uses the method to add some elements. The example demonstrates that the method throws an when attempting to add a duplicate key. + The following code example creates an empty of strings with string keys and uses the method to add some elements. The example demonstrates that the method throws an when attempting to add a duplicate key. - This code example is part of a larger example provided for the class. + This code example is part of a larger example provided for the class. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/DictionaryTKey,TValue/Overview/source.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/DictionaryTKey,TValue/Overview/source.fs" id="Snippet2"::: @@ -1000,11 +1000,11 @@ property is set to 0, and references to other objects from elements of the collection are also released. The capacity remains unchanged. + The property is set to 0, and references to other objects from elements of the collection are also released. The capacity remains unchanged. This method is an O(`n`) operation, where `n` is the capacity of the dictionary. - .NET Core 3.0+ only: This mutating method can be safely called without invalidating active enumerators on the instance. This does not imply thread safety. + .NET Core 3.0+ only: This mutating method may be safely called without invalidating active enumerators on the instance. This does not imply thread safety. ]]> @@ -1054,7 +1054,7 @@ requires an equality implementation to determine whether keys are equal. You can specify an implementation of the generic interface by using a constructor that accepts a `comparer` parameter; if you do not specify one, the default generic equality comparer is used. + requires an equality implementation to determine whether keys are equal. You can specify an implementation of the generic interface by using a constructor that accepts a `comparer` parameter; if you do not specify one, the default generic equality comparer is used. Getting the value of this property is an O(1) operation. @@ -1120,9 +1120,9 @@ ## Examples - The following code example shows how to use the method to test whether a key exists prior to calling the method. It also shows how to use the method to retrieve values, which is an efficient way to retrieve values when a program frequently tries keys that are not in the dictionary. Finally, it shows the least efficient way to test whether keys exist, by using the property (the indexer in C#). + The following code example shows how to use the method to test whether a key exists prior to calling the method. It also shows how to use the method to retrieve values, which is an efficient way to retrieve values when a program frequently tries keys that are not in the dictionary. Finally, it shows the least efficient way to test whether keys exist, by using the property (the indexer in C#). - This code example is part of a larger example provided for the class (`openWith` is the name of the Dictionary used in this example). + This code example is part of a larger example provided for the class (`openWith` is the name of the Dictionary used in this example). :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/DictionaryTKey,TValue/Overview/source.cs" id="Snippet6"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/DictionaryTKey,TValue/Overview/source.fs" id="Snippet6"::: @@ -1190,9 +1190,9 @@ for `TValue`, the type of values in the dictionary. + This method determines equality using the default equality comparer for `TValue`, the type of values in the dictionary. - This method performs a linear search; therefore, the average execution time is proportional to . That is, this method is an O(`n`) operation, where `n` is . + This method performs a linear search; therefore, the average execution time is proportional to . That is, this method is an O(`n`) operation, where `n` is . ]]> @@ -1249,9 +1249,9 @@ is the number of elements that the can store. The property is the number of elements that are actually in the . + The capacity of a is the number of elements that the can store. The property is the number of elements that are actually in the . - The capacity is always greater than or equal to . If exceeds the capacity while adding elements, the capacity is increased by automatically reallocating the internal array before copying the old elements and adding the new elements. + The capacity is always greater than or equal to . If exceeds the capacity while adding elements, the capacity is increased by automatically reallocating the internal array before copying the old elements and adding the new elements. Getting the value of this property is an O(1) operation. @@ -1400,21 +1400,21 @@ structure representing a value and its key. + For purposes of enumeration, each item is a structure representing a value and its key. The `foreach` statement of the C# language (`For Each` in Visual Basic) hides the complexity of enumerators. Therefore, using `foreach` is recommended, instead of directly manipulating the enumerator. Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection. - Initially, the enumerator is positioned before the first element in the collection. At this position, is undefined. You must call the method to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. At this position, is undefined. You must call the method to advance the enumerator to the first element of the collection before reading the value of . - The property returns the same element until the method is called. sets to the next element. + The property returns the same element until the method is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator instance instead. + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator instance instead. - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding elements or changing the capacity, the enumerator is irrecoverably invalidated and the next call to or throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding elements or changing the capacity, the enumerator is irrecoverably invalidated and the next call to or throws an . -.NET Core 3.0+ only: The only mutating methods which do not invalidate enumerators are and . +.NET Core 3.0+ only: The only mutating methods which do not invalidate enumerators are and . The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization. @@ -1492,7 +1492,7 @@ . + This method is an O(`n`) operation, where `n` is . ]]> @@ -1557,11 +1557,11 @@ ## Remarks This property provides the ability to access a specific element in the collection by using the following C# syntax: `myCollection[key]` (`myCollection(key)` in Visual Basic). - You can also use the property to add new elements by setting the value of a key that does not exist in the . When you set the property value, if the key is in the , the value associated with that key is replaced by the assigned value. If the key is not in the , the key and value are added to the dictionary. In contrast, the method does not modify existing elements. + You can also use the property to add new elements by setting the value of a key that does not exist in the . When you set the property value, if the key is in the , the value associated with that key is replaced by the assigned value. If the key is not in the , the key and value are added to the dictionary. In contrast, the method does not modify existing elements. A key cannot be `null`, but a value can be, if the value type `TValue` is a reference type. - The C# language uses the [`this`](/dotnet/csharp/language-reference/keywords/this) keyword to define the indexers instead of implementing the property. Visual Basic implements as a default property, which provides the same indexing functionality. + The C# language uses the [`this`](/dotnet/csharp/language-reference/keywords/this) keyword to define the indexers instead of implementing the property. Visual Basic implements as a default property, which provides the same indexing functionality. Getting or setting the value of this property approaches an O(1) operation. @@ -1569,11 +1569,11 @@ ## Examples - The following code example uses the property (the indexer in C#) to retrieve values, demonstrating that a is thrown when a requested key is not present, and showing that the value associated with a key can be replaced. + The following code example uses the property (the indexer in C#) to retrieve values, demonstrating that a is thrown when a requested key is not present, and showing that the value associated with a key can be replaced. - The example also shows how to use the method as a more efficient way to retrieve values if a program often must try key values that are not in the dictionary. + The example also shows how to use the method as a more efficient way to retrieve values if a program often must try key values that are not in the dictionary. - This code example is part of a larger example provided for the class. `openWith` is the name of the Dictionary used in this example. + This code example is part of a larger example provided for the class. `openWith` is the name of the Dictionary used in this example. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/DictionaryTKey,TValue/Overview/source.cs" interactive="try-dotnet-method" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/DictionaryTKey,TValue/Overview/source.fs" id="Snippet2"::: @@ -1640,18 +1640,18 @@ is unspecified, but it is the same order as the associated values in the returned by the property. + The order of the keys in the is unspecified, but it is the same order as the associated values in the returned by the property. - The returned is not a static copy; instead, the refers back to the keys in the original . Therefore, changes to the continue to be reflected in the . + The returned is not a static copy; instead, the refers back to the keys in the original . Therefore, changes to the continue to be reflected in the . Getting the value of this property is an O(1) operation. ## Examples - The following code example shows how to enumerate the keys in the dictionary using the property, and how to enumerate the keys and values in the dictionary. + The following code example shows how to enumerate the keys in the dictionary using the property, and how to enumerate the keys and values in the dictionary. - This code is part of a larger example that can be compiled and executed (`openWith` is the name of the Dictionary used in this example). See . + This code is part of a larger example that can be compiled and executed (`openWith` is the name of the Dictionary used in this example). See . :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/DictionaryTKey,TValue/Overview/source.cs" id="Snippet9"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/DictionaryTKey,TValue/Overview/source.fs" id="Snippet9"::: @@ -1715,7 +1715,7 @@ . + This method is an O(`n`) operation, where `n` is . ]]> @@ -1778,16 +1778,16 @@ does not contain an element with the specified key, the remains unchanged. No exception is thrown. + If the does not contain an element with the specified key, the remains unchanged. No exception is thrown. This method approaches an O(1) operation. - .NET Core 3.0+ only: This mutating method can be safely called without invalidating active enumerators on the instance. This does not imply thread safety. + .NET Core 3.0+ only: This mutating method may be safely called without invalidating active enumerators on the instance. This does not imply thread safety. ## Examples - The following code example shows how to remove a key/value pair from a dictionary using the method. + The following code example shows how to remove a key/value pair from a dictionary using the method. - This code example is part of a larger example provided for the class (`openWith` is the name of the Dictionary used in this example). + This code example is part of a larger example provided for the class (`openWith` is the name of the Dictionary used in this example). :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/DictionaryTKey,TValue/Overview/source.cs" id="Snippet10"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/DictionaryTKey,TValue/Overview/source.fs" id="Snippet10"::: @@ -2391,12 +2391,12 @@ is a structure representing a value and its key. + Each element copied from a is a structure representing a value and its key. > [!NOTE] -> If the type of the source cannot be cast automatically to the type of the destination `array`, the nongeneric implementations of throw an , whereas the generic implementations throw an . +> If the type of the source cannot be cast automatically to the type of the destination `array`, the nongeneric implementations of throw an , whereas the generic implementations throw an . - This method is an O(`n`) operation, where `n` is . + This method is an O(`n`) operation, where `n` is . ]]> @@ -2608,13 +2608,13 @@ Getting the value of this property is an O(1) operation. ## Remarks - You can also use the property to add new elements by setting the value of a key that does not exist in the dictionary; for example, `myCollection["myNonexistentKey"] = myValue`. However, if the specified key already exists in the dictionary, setting the property overwrites the old value. In contrast, the method throws an exception if the specified key already exists. + You can also use the property to add new elements by setting the value of a key that does not exist in the dictionary; for example, `myCollection["myNonexistentKey"] = myValue`. However, if the specified key already exists in the dictionary, setting the property overwrites the old value. In contrast, the method throws an exception if the specified key already exists. - If is less than the capacity, this method approaches an O(1) operation. If the capacity needs to be increased to accommodate the new element, this method becomes an O(`n`) operation, where `n` is . + If is less than the capacity, this method approaches an O(1) operation. If the capacity needs to be increased to accommodate the new element, this method becomes an O(`n`) operation, where `n` is . ## Examples - The following code example shows how to access the class through the interface. The code example creates an empty of strings with string keys and uses the method to add some elements. The example demonstrates that the method throws an when attempting to add a duplicate key, or when a key or value of the wrong data type is supplied. + The following code example shows how to access the class through the interface. The code example creates an empty of strings with string keys and uses the method to add some elements. The example demonstrates that the method throws an when attempting to add a duplicate key, or when a key or value of the wrong data type is supplied. The code example demonstrates the use of several other members of the interface. @@ -2691,14 +2691,14 @@ Getting the value of this property is an O(1) operation. . + This method returns `false` if `key` is of a type that is not assignable to the key type `TKey` of the . This method approaches an O(1) operation. ## Examples - The following code example shows how to use the method of the interface with a . The example demonstrates that the method returns `false` if a key of the wrong data type is supplied. + The following code example shows how to use the method of the interface with a . The example demonstrates that the method returns `false` if a key of the wrong data type is supplied. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/DictionaryTKey,TValue/System.Collections.IDictionary.Contains/source.cs"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/DictionaryTKey,TValue/System.Collections.IDictionary.Contains/source.fs"::: @@ -2764,15 +2764,15 @@ Getting the value of this property is an O(1) operation. Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection. - Initially, the enumerator is positioned before the first element in the collection. The method also brings the enumerator back to this position. At this position, is undefined. Therefore, you must call the method to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. The method also brings the enumerator back to this position. At this position, is undefined. Therefore, you must call the method to advance the enumerator to the first element of the collection before reading the value of . - The property returns the same element until either the or method is called. sets to the next element. + The property returns the same element until either the or method is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. To set to the first element of the collection again, you can call followed by . + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. To set to the first element of the collection again, you can call followed by . - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding elements or changing the capacity, the enumerator is irrecoverably invalidated and the next call to or throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding elements or changing the capacity, the enumerator is irrecoverably invalidated and the next call to or throws an . -.NET Core 3.0+ only: The only mutating methods which do not invalidate enumerators are and . +.NET Core 3.0+ only: The only mutating methods which do not invalidate enumerators are and . The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization. @@ -2783,7 +2783,7 @@ Getting the value of this property is an O(1) operation. ## Examples - The following code example shows how to enumerate the key/value pairs in the dictionary by using the `foreach` statement (`For Each` in Visual Basic), which hides the use of the enumerator. In particular, note that the enumerator for the interface returns objects rather than objects. + The following code example shows how to enumerate the key/value pairs in the dictionary by using the `foreach` statement (`For Each` in Visual Basic), which hides the use of the enumerator. In particular, note that the enumerator for the interface returns objects rather than objects. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/DictionaryTKey,TValue/System.Collections.IDictionary.GetEnumerator/source.cs"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/DictionaryTKey,TValue/System.Collections.IDictionary.GetEnumerator/source.fs"::: @@ -2971,16 +2971,16 @@ Getting the value of this property is an O(1) operation. ## Remarks This property provides the ability to access a specific value in the collection by using the following C# syntax: `myCollection[key]` (`myCollection(key)` in Visual Basic). - You can also use the property to add new elements by setting the value of a key that does not exist in the dictionary; for example, `myCollection["myNonexistentKey"] = myValue`. However, if the specified key already exists in the dictionary, setting the property overwrites the old value. In contrast, the method does not modify existing elements. + You can also use the property to add new elements by setting the value of a key that does not exist in the dictionary; for example, `myCollection["myNonexistentKey"] = myValue`. However, if the specified key already exists in the dictionary, setting the property overwrites the old value. In contrast, the method does not modify existing elements. - The C# language uses the [this](/dotnet/csharp/language-reference/keywords/this) keyword to define the indexers instead of implementing the property. Visual Basic implements as a default property, which provides the same indexing functionality. + The C# language uses the [this](/dotnet/csharp/language-reference/keywords/this) keyword to define the indexers instead of implementing the property. Visual Basic implements as a default property, which provides the same indexing functionality. Getting or setting the value of this property approaches an O(1) operation. ## Examples - The following code example shows how to use the property (the indexer in C#) of the interface with a , and ways the property differs from the property. + The following code example shows how to use the property (the indexer in C#) of the interface with a , and ways the property differs from the property. - The example shows that, like the property, the property can change the value associated with an existing key and can be used to add a new key/value pair if the specified key is not in the dictionary. The example also shows that unlike the property, the property does not throw an exception if `key` is not in the dictionary, returning a null reference instead. Finally, the example demonstrates that getting the property returns a null reference if `key` is not the correct data type, and that setting the property throws an exception if `key` is not the correct data type. + The example shows that, like the property, the property can change the value associated with an existing key and can be used to add a new key/value pair if the specified key is not in the dictionary. The example also shows that unlike the property, the property does not throw an exception if `key` is not in the dictionary, returning a null reference instead. Finally, the example demonstrates that getting the property returns a null reference if `key` is not the correct data type, and that setting the property throws an exception if `key` is not the correct data type. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/DictionaryTKey,TValue/System.Collections.IDictionary.Item/source.cs"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/DictionaryTKey,TValue/System.Collections.IDictionary.Item/source.fs"::: @@ -3052,7 +3052,7 @@ Getting the value of this property is an O(1) operation. ## Examples - The following code example shows how to use the property of the interface with a , to list the keys in the dictionary. The example also shows how to enumerate the key/value pairs in the dictionary; note that the enumerator for the interface returns objects rather than objects. + The following code example shows how to use the property of the interface with a , to list the keys in the dictionary. The example also shows how to enumerate the key/value pairs in the dictionary; note that the enumerator for the interface returns objects rather than objects. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/DictionaryTKey,TValue/System.Collections.IDictionary.Keys/source.cs"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/DictionaryTKey,TValue/System.Collections.IDictionary.Keys/source.fs"::: @@ -3118,7 +3118,7 @@ Getting the value of this property is an O(1) operation. ## Examples - The following code example shows how to use the of the interface with a . + The following code example shows how to use the of the interface with a . :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/DictionaryTKey,TValue/System.Collections.IDictionary.Remove/source.cs"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/DictionaryTKey,TValue/System.Collections.IDictionary.Remove/source.fs"::: @@ -3184,7 +3184,7 @@ Getting the value of this property is an O(1) operation. ## Examples - The following code example shows how to use the property of the interface with a , to list the values in the dictionary. The example also shows how to enumerate the key/value pairs in the dictionary; note that the enumerator for the interface returns objects rather than objects. + The following code example shows how to use the property of the interface with a , to list the values in the dictionary. The example also shows how to enumerate the key/value pairs in the dictionary; note that the enumerator for the interface returns objects rather than objects. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/DictionaryTKey,TValue/System.Collections.IDictionary.Values/source.cs"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/DictionaryTKey,TValue/System.Collections.IDictionary.Values/source.fs"::: @@ -3248,15 +3248,15 @@ Getting the value of this property is an O(1) operation. Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection. - Initially, the enumerator is positioned before the first element in the collection. The method also brings the enumerator back to this position. At this position, the property is undefined. Therefore, you must call the method to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. The method also brings the enumerator back to this position. At this position, the property is undefined. Therefore, you must call the method to advance the enumerator to the first element of the collection before reading the value of . - The property returns the same element until either the or method is called. sets to the next element. + The property returns the same element until either the or method is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. To set to the first element of the collection again, you can call followed by . + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. To set to the first element of the collection again, you can call followed by . - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding elements or changing the capacity, the enumerator is irrecoverably invalidated and the next call to or throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding elements or changing the capacity, the enumerator is irrecoverably invalidated and the next call to or throws an . -.NET Core 3.0+ only: The only mutating methods which do not invalidate enumerators are and . +.NET Core 3.0+ only: The only mutating methods which do not invalidate enumerators are and . The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization. @@ -3403,7 +3403,7 @@ dictionary.TrimExcess(); ## Remarks -Unlike the method, this method doesn't throw an exception if the element with the given key exists in the dictionary. Unlike the Dictionary indexer, `TryAdd` doesn't override the element if the element with the given key exists in the dictionary. If the key already exists, `TryAdd` does nothing and returns `false`. +Unlike the method, this method doesn't throw an exception if the element with the given key exists in the dictionary. Unlike the Dictionary indexer, `TryAdd` doesn't override the element if the element with the given key exists in the dictionary. If the key already exists, `TryAdd` does nothing and returns `false`. ]]> @@ -3522,20 +3522,20 @@ Unlike the method, this method and the property. + This method combines the functionality of the method and the property. If the key is not found, then the `value` parameter gets the appropriate default value for the type `TValue`; for example, 0 (zero) for integer types, `false` for Boolean types, and `null` for reference types. - Use the method if your code frequently attempts to access keys that are not in the dictionary. Using this method is more efficient than catching the thrown by the property. + Use the method if your code frequently attempts to access keys that are not in the dictionary. Using this method is more efficient than catching the thrown by the property. This method approaches an O(1) operation. ## Examples - The example shows how to use the method as a more efficient way to retrieve values in a program that frequently tries keys that are not in the dictionary. For contrast, the example also shows how the property (the indexer in C#) throws exceptions when attempting to retrieve nonexistent keys. + The example shows how to use the method as a more efficient way to retrieve values in a program that frequently tries keys that are not in the dictionary. For contrast, the example also shows how the property (the indexer in C#) throws exceptions when attempting to retrieve nonexistent keys. - This code example is part of a larger example provided for the class (`openWith` is the name of the Dictionary used in this example). + This code example is part of a larger example provided for the class (`openWith` is the name of the Dictionary used in this example). :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/DictionaryTKey,TValue/Overview/source.cs" id="Snippet5"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/DictionaryTKey,TValue/Overview/source.fs" id="Snippet5"::: @@ -3596,18 +3596,18 @@ Unlike the method, this is unspecified, but it is the same order as the associated keys in the returned by the property. + The order of the values in the is unspecified, but it is the same order as the associated keys in the returned by the property. - The returned is not a static copy; instead, the refers back to the values in the original . Therefore, changes to the continue to be reflected in the . + The returned is not a static copy; instead, the refers back to the values in the original . Therefore, changes to the continue to be reflected in the . Getting the value of this property is an O(1) operation. ## Examples - This code example shows how to enumerate the values in the dictionary using the property, and how to enumerate the keys and values in the dictionary. + This code example shows how to enumerate the values in the dictionary using the property, and how to enumerate the keys and values in the dictionary. - This code example is part of a larger example provided for the class (`openWith` is the name of the Dictionary used in this example). + This code example is part of a larger example provided for the class (`openWith` is the name of the Dictionary used in this example). :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/DictionaryTKey,TValue/Overview/source.cs" id="Snippet8"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/DictionaryTKey,TValue/Overview/source.fs" id="Snippet8"::: diff --git a/xml/System.Collections.Generic/EqualityComparer`1.xml b/xml/System.Collections.Generic/EqualityComparer`1.xml index e2b4f800909..44c26302a61 100644 --- a/xml/System.Collections.Generic/EqualityComparer`1.xml +++ b/xml/System.Collections.Generic/EqualityComparer`1.xml @@ -82,11 +82,11 @@ ## Remarks -Derive from this class to provide a custom implementation of the generic interface for use with collection classes such as the generic class, or with methods such as . +Derive from this class to provide a custom implementation of the generic interface for use with collection classes such as the generic class, or with methods such as . -The property checks whether type `T` implements the generic interface and, if so, returns an that invokes the implementation of the method. Otherwise, it returns an , as provided by `T`. +The property checks whether type `T` implements the generic interface and, if so, returns an that invokes the implementation of the method. Otherwise, it returns an , as provided by `T`. -In .NET 8 and later versions, we recommend using the method to create instances of this type. +In .NET 8 and later versions, we recommend using the method to create instances of this type. ## Examples The following example creates a dictionary collection of objects of type `Box` with an equality comparer. Two boxes are considered equal if their dimensions are the same. It then adds the boxes to the collection. @@ -246,14 +246,14 @@ In .NET 8 and later versions, we recommend using the property checks whether type `T` implements the interface and, if so, returns an that uses that implementation. Otherwise, it returns an that uses the overrides of and provided by `T`. + The property checks whether type `T` implements the interface and, if so, returns an that uses that implementation. Otherwise, it returns an that uses the overrides of and provided by `T`. ## Examples The following example creates a collection that contains elements of the `Box` type and then searches it for a box matching another box by calling the `FindFirst` method, twice. - The first search does not specify any equality comparer, which means `FindFirst` uses to determine equality of boxes. That in turn uses the implementation of the method in the `Box` class. Two boxes are considered equal if their dimensions are the same. + The first search does not specify any equality comparer, which means `FindFirst` uses to determine equality of boxes. That in turn uses the implementation of the method in the `Box` class. Two boxes are considered equal if their dimensions are the same. The second search specifies an equality comparer (`BoxEqVolume`) that defines equality by volume. Two boxes are considered equal if their volumes are the same. @@ -336,7 +336,7 @@ In .NET 8 and later versions, we recommend using the method is reflexive, symmetric, and transitive. That is, it returns `true` if used to compare an object with itself; `true` for two objects `x` and `y` if it is `true` for `y` and `x`; and `true` for two objects `x` and `z` if it is `true` for `x` and `y` and also `true` for `y` and `z`. + The method is reflexive, symmetric, and transitive. That is, it returns `true` if used to compare an object with itself; `true` for two objects `x` and `y` if it is `true` for `y` and `x`; and `true` for two objects `x` and `z` if it is `true` for `x` and `y` and also `true` for `y` and `z`. ]]> @@ -460,7 +460,7 @@ In .NET 8 and later versions, we recommend using the method, so `obj` must be cast to the type specified by the generic argument `T` of the current instance. If it cannot be cast to `T`, an is thrown. + This method is a wrapper for the method, so `obj` must be cast to the type specified by the generic argument `T` of the current instance. If it cannot be cast to `T`, an is thrown. Comparing `null` is allowed and does not generate an exception. @@ -521,7 +521,7 @@ In .NET 8 and later versions, we recommend using the method, so `obj` must be a type that can be cast to the type specified by the generic type argument `T` of the current instance. + This method is a wrapper for the method, so `obj` must be a type that can be cast to the type specified by the generic type argument `T` of the current instance. ]]> diff --git a/xml/System.Collections.Generic/HashSet`1+Enumerator.xml b/xml/System.Collections.Generic/HashSet`1+Enumerator.xml index b78a27c2999..211d0100ed4 100644 --- a/xml/System.Collections.Generic/HashSet`1+Enumerator.xml +++ b/xml/System.Collections.Generic/HashSet`1+Enumerator.xml @@ -83,13 +83,13 @@ Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection. - Initially, the enumerator is positioned before the first element in the collection. At this position, the property is undefined. Therefore, you must call the method to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. At this position, the property is undefined. Therefore, you must call the method to advance the enumerator to the first element of the collection before reading the value of . - returns the same object until is called. sets to the next element. + returns the same object until is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator object instead. + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator object instead. - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization. @@ -157,15 +157,15 @@ ## Remarks - is undefined under any of the following conditions: + is undefined under any of the following conditions: -- The enumerator is positioned before the first element of the collection. That happens after an enumerator is created or after the method is called. The method must be called to advance the enumerator to the first element of the collection before reading the value of the property. +- The enumerator is positioned before the first element of the collection. That happens after an enumerator is created or after the method is called. The method must be called to advance the enumerator to the first element of the collection before reading the value of the property. -- The last call to returned `false`, which indicates the end of the collection and that the enumerator is positioned after the last element of the collection. +- The last call to returned `false`, which indicates the end of the collection and that the enumerator is positioned after the last element of the collection. - The enumerator is invalidated due to changes made in the collection, such as adding, modifying, or deleting elements. - does not move the position of the enumerator, and consecutive calls to return the same object until either or is called. + does not move the position of the enumerator, and consecutive calls to return the same object until either or is called. ]]> @@ -266,11 +266,11 @@ method advances the enumerator to the first element of the collection. + After an enumerator is created, the enumerator is positioned before the first element in the collection, and the first call to the method advances the enumerator to the first element of the collection. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . ]]> @@ -332,15 +332,15 @@ ## Remarks - is undefined under any of the following conditions: + is undefined under any of the following conditions: -- The enumerator is positioned before the first element of the collection. That happens after an enumerator is created or after the method is called. The method must be called to advance the enumerator to the first element of the collection before reading the value of the property. +- The enumerator is positioned before the first element of the collection. That happens after an enumerator is created or after the method is called. The method must be called to advance the enumerator to the first element of the collection before reading the value of the property. -- The last call to returned `false`, which indicates the end of the collection and that the enumerator is positioned after the last element of the collection. +- The last call to returned `false`, which indicates the end of the collection and that the enumerator is positioned after the last element of the collection. - The enumerator is invalidated due to changes made in the collection, such as adding, modifying, or deleting elements. - does not move the position of the enumerator, and consecutive calls to return the same object until either or is called. + does not move the position of the enumerator, and consecutive calls to return the same object until either or is called. ]]> @@ -394,9 +394,9 @@ , you must call the method to advance the enumerator to the first element of the collection before reading the value of the property. + After calling , you must call the method to advance the enumerator to the first element of the collection before reading the value of the property. - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . ]]> diff --git a/xml/System.Collections.Generic/HashSet`1.xml b/xml/System.Collections.Generic/HashSet`1.xml index 34064c69e9c..6bb8b03c538 100644 --- a/xml/System.Collections.Generic/HashSet`1.xml +++ b/xml/System.Collections.Generic/HashSet`1.xml @@ -131,7 +131,7 @@ For more information about this API, see Supplemental API remarks for HashSet<T>. objects and populates them with even and odd numbers, respectively. A third object is created from the set that contains the even numbers. The example then calls the method, which adds the odd number set to the third set. +The following example demonstrates how to merge two disparate sets. This example creates two objects and populates them with even and odd numbers, respectively. A third object is created from the set that contains the even numbers. The example then calls the method, which adds the odd number set to the third set. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/HashSetT/Overview/Program.cs" interactive="try-dotnet-method" id="Snippet01"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/HashSetT/Overview/Program.fs" id="Snippet01"::: @@ -193,14 +193,14 @@ The following example demonstrates how to merge two disparate sets. This example object is the number of elements that the object can hold. A object's capacity automatically increases as elements are added to the object. + The capacity of a object is the number of elements that the object can hold. A object's capacity automatically increases as elements are added to the object. This constructor is an O(1) operation. ## Examples - The following example demonstrates how to create and populate two objects. This example is part of a larger example provided for the method. + The following example demonstrates how to create and populate two objects. This example is part of a larger example provided for the method. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/HashSetT/Overview/Program.cs" id="Snippet03"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/HashSetT/Overview/Program.fs" id="Snippet03"::: @@ -254,7 +254,7 @@ The following example demonstrates how to merge two disparate sets. This example object is the number of elements that the object can hold. A object's capacity automatically increases as elements are added to the object. + The capacity of a object is the number of elements that the object can hold. A object's capacity automatically increases as elements are added to the object. If `collection` contains duplicates, the set will contain one of each unique element. No exception will be thrown. Therefore, the size of the resulting set is not identical to the size of `collection`. @@ -263,7 +263,7 @@ The following example demonstrates how to merge two disparate sets. This example ## Examples - The following example shows how to create a collection from an existing set. In this example, two sets are created with even and odd integers, respectively. A third object is then created from the even integer set. + The following example shows how to create a collection from an existing set. In this example, two sets are created with even and odd integers, respectively. A third object is then created from the even integer set. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/HashSetT/Overview/Program.cs" interactive="try-dotnet-method" id="Snippet01"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/HashSetT/Overview/Program.fs" id="Snippet01"::: @@ -327,7 +327,7 @@ The following example demonstrates how to merge two disparate sets. This example object is the number of elements that the object can hold. A object's capacity automatically increases as elements are added to the object. + The capacity of a object is the number of elements that the object can hold. A object's capacity automatically increases as elements are added to the object. This constructor is an O(1) operation. @@ -437,7 +437,7 @@ The following example demonstrates how to merge two disparate sets. This example object is the number of elements that the object can hold. A object's capacity automatically increases as elements are added to the object. + The capacity of a object is the number of elements that the object can hold. A object's capacity automatically increases as elements are added to the object. If `collection` contains duplicates, the set will contain one of each unique element. No exception will be thrown. Therefore, the size of the resulting set is not identical to the size of `collection`. @@ -446,7 +446,7 @@ The following example demonstrates how to merge two disparate sets. This example ## Examples - The following example uses a supplied to allow case-insensitive comparisons on the elements of a collection of vehicle types. + The following example uses a supplied to allow case-insensitive comparisons on the elements of a collection of vehicle types. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/HashSetT/.ctor/source2.cs" interactive="try-dotnet-method" id="Snippet03"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/HashSetT/.ctor/source2.fs" id="Snippet03"::: @@ -641,14 +641,14 @@ The following example demonstrates how to merge two disparate sets. This example already equals the capacity of the object, the capacity is automatically adjusted to accommodate the new item. + If already equals the capacity of the object, the capacity is automatically adjusted to accommodate the new item. - If is less than the capacity of the internal array, this method is an O(1) operation. If the object must be resized, this method becomes an O(`n`) operation, where `n` is . + If is less than the capacity of the internal array, this method is an O(1) operation. If the object must be resized, this method becomes an O(`n`) operation, where `n` is . ## Examples - The following example demonstrates how to create and populate two objects. This example is part of a larger example provided for the method. + The following example demonstrates how to create and populate two objects. This example is part of a larger example provided for the method. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/HashSetT/Overview/Program.cs" id="Snippet03"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/HashSetT/Overview/Program.fs" id="Snippet03"::: @@ -733,14 +733,14 @@ The following example demonstrates how to merge two disparate sets. This example is set to zero and references to other objects from elements of the collection are also released. The capacity remains unchanged until a call to is made. + is set to zero and references to other objects from elements of the collection are also released. The capacity remains unchanged until a call to is made. - This method is an O(`n`) operation, where `n` is . + This method is an O(`n`) operation, where `n` is . ## Examples - The following example creates and populates a collection, then clears it and releases the memory referenced by the collection. + The following example creates and populates a collection, then clears it and releases the memory referenced by the collection. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/HashSetT/Clear/Program.cs" interactive="try-dotnet-method" id="Snippet01"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/HashSetT/Clear/Program.fs" id="Snippet01"::: @@ -864,7 +864,7 @@ The following example demonstrates how to merge two disparate sets. This example ## Examples - The following example demonstrates how to remove values from a collection using the method. In this example, the method verifies that the set contains a value before removing it. + The following example demonstrates how to remove values from a collection using the method. In this example, the method verifies that the set contains a value before removing it. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/HashSetT/Contains/Program.cs" interactive="try-dotnet-method" id="Snippet02"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/HashSetT/Contains/Program.fs" id="Snippet02"::: @@ -932,7 +932,7 @@ The following example demonstrates how to merge two disparate sets. This example . + This method is an O(`n`) operation, where `n` is . ]]> @@ -992,7 +992,7 @@ The following example demonstrates how to merge two disparate sets. This example . + This method is an O(`n`) operation, where `n` is . ]]> @@ -1129,16 +1129,16 @@ The following example demonstrates how to merge two disparate sets. This example object is the number of elements that the object can hold. A object's capacity automatically increases as elements are added to the object. + The capacity of a object is the number of elements that the object can hold. A object's capacity automatically increases as elements are added to the object. - The capacity is always greater than or equal to . If exceeds the capacity while adding elements, the capacity is set to the first prime number that is greater than double the previous capacity. + The capacity is always greater than or equal to . If exceeds the capacity while adding elements, the capacity is set to the first prime number that is greater than double the previous capacity. Retrieving the value of this property is an O(1) operation. ## Examples - The following example demonstrates how to create, populate, and manipulate two objects. In this example, both the contents of the set and display to the console. + The following example demonstrates how to create, populate, and manipulate two objects. In this example, both the contents of the set and display to the console. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/HashSetT/Overview/Program.cs" interactive="try-dotnet-method" id="Snippet01"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/HashSetT/Overview/Program.fs" id="Snippet01"::: @@ -1303,14 +1303,14 @@ The following example demonstrates how to merge two disparate sets. This example method is the equivalent of mathematical set subtraction. + The method is the equivalent of mathematical set subtraction. This method is an O(`n`) operation, where `n` is the number of elements in the `other` parameter. ## Examples - The following example creates two collections with overlapping sets of data. The lower range of values is then removed from the larger set using the method. + The following example creates two collections with overlapping sets of data. The lower range of values is then removed from the larger set using the method. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/HashSetT/.ctor/Program.cs" interactive="try-dotnet-method" id="Snippet02"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/HashSetT/.ctor/Program.fs" id="Snippet02"::: @@ -1416,13 +1416,13 @@ The following example demonstrates how to merge two disparate sets. This example Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection. - Initially, the enumerator is positioned before the first element in the collection. At this position, the property is undefined. Therefore, you must call the method to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. At this position, the property is undefined. Therefore, you must call the method to advance the enumerator to the first element of the collection before reading the value of . - The property returns the same object until is called. sets to the next element. + The property returns the same object until is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator object instead. + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator object instead. - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization. @@ -1498,7 +1498,7 @@ The following example demonstrates how to merge two disparate sets. This example . + Calling this method is an O(`n`) operation, where `n` is . ]]> @@ -1565,7 +1565,7 @@ The following example demonstrates how to merge two disparate sets. This example collection with the same equality comparer as the current object, this method is an O(`n`) operation. Otherwise, this method is an O(`n` + `m`) operation, where `n` is and `m` is the number of elements in `other`. + If the collection represented by the `other` parameter is a collection with the same equality comparer as the current object, this method is an O(`n`) operation. Otherwise, this method is an O(`n` + `m`) operation, where `n` is and `m` is the number of elements in `other`. ]]> @@ -1635,16 +1635,16 @@ The following example demonstrates how to merge two disparate sets. This example object is empty unless the `other` parameter is also an empty set. + An empty set is a subset of any other collection. Therefore, this method returns `true` if the collection represented by the current object is empty unless the `other` parameter is also an empty set. - This method always returns `false` if is greater than or equal to the number of elements in `other`. + This method always returns `false` if is greater than or equal to the number of elements in `other`. - If the collection represented by `other` is a collection with the same equality comparer as the current object, then this method is an O(`n`) operation. Otherwise, this method is an O(`n` + `m`) operation, where `n` is and `m` is the number of elements in `other`. + If the collection represented by `other` is a collection with the same equality comparer as the current object, then this method is an O(`n`) operation. Otherwise, this method is an O(`n` + `m`) operation, where `n` is and `m` is the number of elements in `other`. ## Examples - The following example creates two disparate objects and compares them to each other. In this example, `lowNumbers` is both a subset and a proper subset of `allNumbers` until `allNumbers` is modified, using the method, to contain only values that are present in both sets. Once `allNumbers` and `lowNumbers` are identical, `lowNumbers` is still a subset of `allNumbers` but is no longer a proper subset. + The following example creates two disparate objects and compares them to each other. In this example, `lowNumbers` is both a subset and a proper subset of `allNumbers` until `allNumbers` is modified, using the method, to contain only values that are present in both sets. Once `allNumbers` and `lowNumbers` are identical, `lowNumbers` is still a subset of `allNumbers` but is no longer a proper subset. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/HashSetT/IsProperSubsetOf/Program.cs" interactive="try-dotnet-method" id="Snippet02"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/HashSetT/IsProperSubsetOf/Program.fs" id="Snippet02"::: @@ -1718,16 +1718,16 @@ The following example demonstrates how to merge two disparate sets. This example collection is also empty. + An empty set is a subset of any other collection. Therefore, this method returns `true` if the collection represented by the `other` parameter is empty unless the current collection is also empty. - This method always returns `false` if is less than or equal to the number of elements in `other`. + This method always returns `false` if is less than or equal to the number of elements in `other`. - If the collection represented by `other` is a collection with the same equality comparer as the current object, this method is an O(`n`) operation. Otherwise, this method is an O(`n` + `m`) operation, where `n` is the number of elements in `other` and `m` is . + If the collection represented by `other` is a collection with the same equality comparer as the current object, this method is an O(`n`) operation. Otherwise, this method is an O(`n` + `m`) operation, where `n` is the number of elements in `other` and `m` is . ## Examples - The following example creates two disparate objects and compares them to each other. In this example, `allNumbers` is both a superset and a proper superset of `lowNumbers` until `allNumbers` is modified, using the method, to contain only values that are present in both sets. Once `allNumbers` and `lowNumbers` are identical, `allNumbers` is still a superset of `lowNumbers` but is no longer a proper superset. + The following example creates two disparate objects and compares them to each other. In this example, `allNumbers` is both a superset and a proper superset of `lowNumbers` until `allNumbers` is modified, using the method, to contain only values that are present in both sets. Once `allNumbers` and `lowNumbers` are identical, `allNumbers` is still a superset of `lowNumbers` but is no longer a proper superset. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/HashSetT/IsProperSubsetOf/Program.cs" interactive="try-dotnet-method" id="Snippet02"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/HashSetT/IsProperSubsetOf/Program.fs" id="Snippet02"::: @@ -1801,16 +1801,16 @@ The following example demonstrates how to merge two disparate sets. This example object is empty, even if the `other` parameter is an empty set. + An empty set is a subset of any other collection, including an empty set; therefore, this method returns `true` if the collection represented by the current object is empty, even if the `other` parameter is an empty set. - This method always returns `false` if is greater than the number of elements in `other`. + This method always returns `false` if is greater than the number of elements in `other`. - If the collection represented by `other` is a collection with the same equality comparer as the current object, this method is an O(`n`) operation. Otherwise, this method is an O(`n` + `m`) operation, where `n` is and `m` is the number of elements in `other`. + If the collection represented by `other` is a collection with the same equality comparer as the current object, this method is an O(`n`) operation. Otherwise, this method is an O(`n` + `m`) operation, where `n` is and `m` is the number of elements in `other`. ## Examples - The following example creates two disparate objects and compares them to each other. In this example, `lowNumbers` is both a subset and a proper subset of `allNumbers` until `allNumbers` is modified, using the method, to contain only values that are present in both sets. Once `allNumbers` and `lowNumbers` are identical, `lowNumbers` is still a subset of `allNumbers` but is no longer a proper subset. + The following example creates two disparate objects and compares them to each other. In this example, `lowNumbers` is both a subset and a proper subset of `allNumbers` until `allNumbers` is modified, using the method, to contain only values that are present in both sets. Once `allNumbers` and `lowNumbers` are identical, `lowNumbers` is still a subset of `allNumbers` but is no longer a proper subset. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/HashSetT/IsProperSubsetOf/Program.cs" interactive="try-dotnet-method" id="Snippet02"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/HashSetT/IsProperSubsetOf/Program.fs" id="Snippet02"::: @@ -1878,16 +1878,16 @@ The following example demonstrates how to merge two disparate sets. This example object is empty. + All collections, including the empty set, are supersets of the empty set. Therefore, this method returns `true` if the collection represented by the `other` parameter is empty, even if the current object is empty. - This method always returns `false` if is less than the number of elements in `other`. + This method always returns `false` if is less than the number of elements in `other`. - If the collection represented by `other` is a collection with the same equality comparer as the current object, this method is an O(`n`) operation. Otherwise, this method is an O(`n` + `m`) operation, where `n` is the number of elements in `other` and `m` is . + If the collection represented by `other` is a collection with the same equality comparer as the current object, this method is an O(`n`) operation. Otherwise, this method is an O(`n` + `m`) operation, where `n` is the number of elements in `other` and `m` is . ## Examples - The following example creates two disparate objects and compares them to each other. In this example, `allNumbers` is both a superset and a proper superset of `lowNumbers` until `allNumbers` is modified, using the method, to contain only values that are present in both sets. Once `allNumbers` and `lowNumbers` are identical, `allNumbers` is still a superset of `lowNumbers` but is no longer a proper superset. + The following example creates two disparate objects and compares them to each other. In this example, `allNumbers` is both a superset and a proper superset of `lowNumbers` until `allNumbers` is modified, using the method, to contain only values that are present in both sets. Once `allNumbers` and `lowNumbers` are identical, `allNumbers` is still a superset of `lowNumbers` but is no longer a proper superset. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/HashSetT/IsProperSubsetOf/Program.cs" interactive="try-dotnet-method" id="Snippet02"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/HashSetT/IsProperSubsetOf/Program.fs" id="Snippet02"::: @@ -1948,7 +1948,7 @@ The following example demonstrates how to merge two disparate sets. This example . + Calling this method is an O(`n`) operation, where `n` is . ]]> @@ -2016,7 +2016,7 @@ The following example demonstrates how to merge two disparate sets. This example ## Examples - The following example creates two disparate objects and compares them to each another. In this example, `allNumbers` and `lowNumbers` are shown to share common elements using the method. + The following example creates two disparate objects and compares them to each another. In this example, `allNumbers` and `lowNumbers` are shown to share common elements using the method. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/HashSetT/IsProperSubsetOf/Program.cs" interactive="try-dotnet-method" id="Snippet02"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/HashSetT/IsProperSubsetOf/Program.fs" id="Snippet02"::: @@ -2080,14 +2080,14 @@ The following example demonstrates how to merge two disparate sets. This example object does not contain the specified element, the object remains unchanged. No exception is thrown. + If the object does not contain the specified element, the object remains unchanged. No exception is thrown. This method is an O(1) operation. ## Examples - The following example demonstrates how to remove values from a collection using the method. In this example, zero is arbitrarily removed from the collection. + The following example demonstrates how to remove values from a collection using the method. In this example, zero is arbitrarily removed from the collection. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/HashSetT/Contains/Program.cs" interactive="try-dotnet-method" id="Snippet02"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/HashSetT/Contains/Program.fs" id="Snippet02"::: @@ -2145,12 +2145,12 @@ The following example demonstrates how to merge two disparate sets. This example . + Calling this method is an O(`n`) operation, where `n` is . ## Examples - The following example demonstrates how to remove values from a collection using the method. In this example, all odd integers are removed from the collection as specified by the `match` delegate. + The following example demonstrates how to remove values from a collection using the method. In this example, all odd integers are removed from the collection as specified by the `match` delegate. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/HashSetT/Contains/Program.cs" interactive="try-dotnet-method" id="Snippet02"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/HashSetT/Contains/Program.fs" id="Snippet02"::: @@ -2224,14 +2224,14 @@ The following example demonstrates how to merge two disparate sets. This example method ignores duplicate entries and the order of elements in the `other` parameter. + The method ignores duplicate entries and the order of elements in the `other` parameter. - If the collection represented by `other` is a collection with the same equality comparer as the current object, this method is an O(`n`) operation. Otherwise, this method is an O(`n` + `m`) operation, where `n` is the number of elements in `other` and `m` is . + If the collection represented by `other` is a collection with the same equality comparer as the current object, this method is an O(`n`) operation. Otherwise, this method is an O(`n` + `m`) operation, where `n` is the number of elements in `other` and `m` is . ## Examples - The following example creates two disparate objects and compares them to each another. Initially, the two sets are not equal, which is demonstrated by using the method. The `allNumbers` object is then modified, after which the sets are equal. + The following example creates two disparate objects and compares them to each another. Initially, the two sets are not equal, which is demonstrated by using the method. The `allNumbers` object is then modified, after which the sets are equal. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/HashSetT/IsProperSubsetOf/Program.cs" interactive="try-dotnet-method" id="Snippet02"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/HashSetT/IsProperSubsetOf/Program.fs" id="Snippet02"::: @@ -2302,12 +2302,12 @@ The following example demonstrates how to merge two disparate sets. This example collection with the same equality comparer as the current object, this method is an O(`n`) operation. Otherwise, this method is an O(`n` + `m`) operation, where `n` is the number of elements in `other` and `m` is . + If the `other` parameter is a collection with the same equality comparer as the current object, this method is an O(`n`) operation. Otherwise, this method is an O(`n` + `m`) operation, where `n` is the number of elements in `other` and `m` is . ## Examples - The following example creates two collections with overlapping sets of data. The set that contains the lower values is then modified, using the method, to contain only the values that are not present in both sets. + The following example creates two collections with overlapping sets of data. The set that contains the lower values is then modified, using the method, to contain only the values that are not present in both sets. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/HashSetT/SymmetricExceptWith/Program.cs" interactive="try-dotnet-method" id="Snippet02"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/HashSetT/SymmetricExceptWith/Program.fs" id="Snippet02"::: @@ -2369,7 +2369,7 @@ The following example demonstrates how to merge two disparate sets. This example is less than , this method is an O(1) operation. If the capacity must be increased to accommodate the new element, this method becomes an O(`n`) operation, where `n` is . + If is less than , this method is an O(1) operation. If the capacity must be increased to accommodate the new element, this method becomes an O(`n`) operation, where `n` is . ]]> @@ -2482,11 +2482,11 @@ The following example demonstrates how to merge two disparate sets. This example Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection. - Initially, the enumerator is positioned before the first element in the collection. At this position, the property is undefined. Therefore, you must call the method to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. At this position, the property is undefined. Therefore, you must call the method to advance the enumerator to the first element of the collection before reading the value of . - The property returns the same object until is called. sets to the next element. + The property returns the same object until is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator object instead. + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator object instead. An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and its behavior is undefined. @@ -2553,11 +2553,11 @@ The following example demonstrates how to merge two disparate sets. This example Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection. - Initially, the enumerator is positioned before the first element in the collection. also brings the enumerator back to this position. At this position, the property is undefined. Therefore, you must call the method to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. also brings the enumerator back to this position. At this position, the property is undefined. Therefore, you must call the method to advance the enumerator to the first element of the collection before reading the value of . - The property returns the same object until either or is called. sets to the next element. + The property returns the same object until either or is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. To set to the first element of the collection again, you can call followed by . + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. To set to the first element of the collection again, you can call followed by . An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and its behavior is undefined. @@ -2616,14 +2616,14 @@ The following example demonstrates how to merge two disparate sets. This example method to minimize a object's memory overhead once it is known that no new elements will be added. To completely clear a object and release all memory referenced by it, call this method after calling the method. + You can use the method to minimize a object's memory overhead once it is known that no new elements will be added. To completely clear a object and release all memory referenced by it, call this method after calling the method. - This method is an O(`n`) operation, where `n` is . + This method is an O(`n`) operation, where `n` is . ## Examples - The following example creates and populates a collection, and then clears the collection and releases the memory referenced by it. + The following example creates and populates a collection, and then clears the collection and releases the memory referenced by it. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/HashSetT/Clear/Program.cs" interactive="try-dotnet-method" id="Snippet01"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/HashSetT/Clear/Program.fs" id="Snippet01"::: @@ -2831,7 +2831,7 @@ The following example demonstrates how to merge two disparate sets. This example ## Examples - The following example demonstrates how to merge two disparate sets. This example creates two objects, and populates them with even and odd numbers, respectively. A third object is created from the set that contains the even numbers. The example then calls the method, which adds the odd number set to the third set. + The following example demonstrates how to merge two disparate sets. This example creates two objects, and populates them with even and odd numbers, respectively. A third object is created from the set that contains the even numbers. The example then calls the method, which adds the odd number set to the third set. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/HashSetT/Overview/Program.cs" interactive="try-dotnet-method" id="Snippet01"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/HashSetT/Overview/Program.fs" id="Snippet01"::: diff --git a/xml/System.Collections.Generic/ICollection`1.xml b/xml/System.Collections.Generic/ICollection`1.xml index 02673dc4a14..c90d5bc16f0 100644 --- a/xml/System.Collections.Generic/ICollection`1.xml +++ b/xml/System.Collections.Generic/ICollection`1.xml @@ -69,20 +69,20 @@ interface is the base interface for classes in the namespace. + The interface is the base interface for classes in the namespace. - The interface extends ; and are more specialized interfaces that extend . A implementation is a collection of key/value pairs, like the class. A implementation is a collection of values, and its members can be accessed by index, like the class. + The interface extends ; and are more specialized interfaces that extend . A implementation is a collection of key/value pairs, like the class. A implementation is a collection of values, and its members can be accessed by index, like the class. - If neither the interface nor the interface meet the requirements of the required collection, derive the new collection class from the interface instead for more flexibility. + If neither the interface nor the interface meet the requirements of the required collection, derive the new collection class from the interface instead for more flexibility. ## Examples - The following example implements the interface to create a collection of custom `Box` objects named `BoxCollection`. Each `Box` has height, length, and width properties, which are used to define equality. Equality can be defined as all dimensions being the same or the volume being the same. The `Box` class implements the interface to define the default equality as the dimensions being the same. + The following example implements the interface to create a collection of custom `Box` objects named `BoxCollection`. Each `Box` has height, length, and width properties, which are used to define equality. Equality can be defined as all dimensions being the same or the volume being the same. The `Box` class implements the interface to define the default equality as the dimensions being the same. - The `BoxCollection` class implements the method to use the default equality to determine whether a `Box` is in the collection. This method is used by the method so that each `Box` added to the collection has a unique set of dimensions. The `BoxCollection` class also provides an overload of the method that takes a specified object, such as `BoxSameDimensions` and `BoxSameVol` classes in the example. + The `BoxCollection` class implements the method to use the default equality to determine whether a `Box` is in the collection. This method is used by the method so that each `Box` added to the collection has a unique set of dimensions. The `BoxCollection` class also provides an overload of the method that takes a specified object, such as `BoxSameDimensions` and `BoxSameVol` classes in the example. - This example also implements an interface for the `BoxCollection` class so that the collection can be enumerated. + This example also implements an interface for the `BoxCollection` class so that the collection can be enumerated. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ICollectionT/Overview/program.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ICollectionT/Overview/program.vb" id="Snippet1"::: @@ -190,7 +190,7 @@ must be set to 0, and references to other objects from elements of the collection must be released. + must be set to 0, and references to other objects from elements of the collection must be released. ]]> @@ -246,12 +246,12 @@ if is found in the ; otherwise, . - uses , whereas allows the user to specify the implementation to use for comparing keys. -Implementations can vary in how they determine equality of objects; for example, uses , whereas allows the user to specify the implementation to use for comparing keys. - ]]> @@ -403,7 +403,7 @@ Implementations can vary in how they determine equality of objects; for example, interface only supports addition and removal operations. For example, the property of an array that is cast or converted to an object returns `true`, even though individual array elements can be modified. + A collection that is read-only does not allow the addition or removal of elements after the collection is created. Note that read-only in this context does not indicate whether individual elements of the collection can be modified, since the interface only supports addition and removal operations. For example, the property of an array that is cast or converted to an object returns `true`, even though individual array elements can be modified. ]]> @@ -457,14 +457,14 @@ Implementations can vary in how they determine equality of objects; for example, if was successfully removed from the ; otherwise, . This method also returns if is not found in the original . - uses , whereas, allows the user to specify the implementation to use for comparing keys. + + In collections of contiguous elements, such as lists, the elements that follow the removed element move up to occupy the vacated spot. If the collection is indexed, the indexes of the elements that are moved are also updated. This behavior does not apply to collections where elements are conceptually grouped into buckets, such as a hash table. -Implementations can vary in how they determine equality of objects; for example, uses , whereas, allows the user to specify the implementation to use for comparing keys. - - In collections of contiguous elements, such as lists, the elements that follow the removed element move up to occupy the vacated spot. If the collection is indexed, the indexes of the elements that are moved are also updated. This behavior does not apply to collections where elements are conceptually grouped into buckets, such as a hash table. - ]]> The is read-only. diff --git a/xml/System.Collections.Generic/IComparer`1.xml b/xml/System.Collections.Generic/IComparer`1.xml index f86e2b0335e..93ed3ff2d99 100644 --- a/xml/System.Collections.Generic/IComparer`1.xml +++ b/xml/System.Collections.Generic/IComparer`1.xml @@ -63,18 +63,18 @@ and methods. It provides a way to customize the sort order of a collection. Classes that implement this interface include the and generic classes. + This interface is used with the and methods. It provides a way to customize the sort order of a collection. Classes that implement this interface include the and generic classes. - The default implementation of this interface is the class. The class implements this interface for type . + The default implementation of this interface is the class. The class implements this interface for type . - This interface supports ordering comparisons. That is, when the method returns 0, it means that two objects sort the same. Implementation of exact equality comparisons is provided by the generic interface. + This interface supports ordering comparisons. That is, when the method returns 0, it means that two objects sort the same. Implementation of exact equality comparisons is provided by the generic interface. - We recommend that you derive from the class instead of implementing the interface, because the class provides an explicit interface implementation of the method and the property that gets the default comparer for the object. + We recommend that you derive from the class instead of implementing the interface, because the class provides an explicit interface implementation of the method and the property that gets the default comparer for the object. ## Examples - The following example implements the interface to compare objects of type `Box` according to their dimensions. This example is part of a larger example provided for the class. + The following example implements the interface to compare objects of type `Box` according to their dimensions. This example is part of a larger example provided for the class. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ComparerT/Overview/program.cs" id="Snippet7"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ComparerT/Overview/program.vb" id="Snippet7"::: @@ -181,7 +181,7 @@ ## Examples - The following example implements the interface to compare objects of type `Box` according to their dimensions. This example is part of a larger example provided for the class. + The following example implements the interface to compare objects of type `Box` according to their dimensions. This example is part of a larger example provided for the class. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ComparerT/Overview/program.cs" id="Snippet7"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ComparerT/Overview/program.vb" id="Snippet7"::: diff --git a/xml/System.Collections.Generic/IDictionary`2.xml b/xml/System.Collections.Generic/IDictionary`2.xml index 6566a5a9ce1..0044c957db2 100644 --- a/xml/System.Collections.Generic/IDictionary`2.xml +++ b/xml/System.Collections.Generic/IDictionary`2.xml @@ -84,13 +84,13 @@ interface is the base interface for generic collections of key/value pairs. + The interface is the base interface for generic collections of key/value pairs. - Each element is a key/value pair stored in a object. + Each element is a key/value pair stored in a object. - Each pair must have a unique key. Implementations can vary in whether they allow `key` to be `null`. The value can be `null` and does not have to be unique. The interface allows the contained keys and values to be enumerated, but it does not imply any particular sort order. + Each pair must have a unique key. Implementations can vary in whether they allow `key` to be `null`. The value can be `null` and does not have to be unique. The interface allows the contained keys and values to be enumerated, but it does not imply any particular sort order. - The `foreach` statement of the C# language (`For Each` in Visual Basic) returns an object of the type of the elements in the collection. Since each element of the is a key/value pair, the element type is not the type of the key or the type of the value. Instead, the element type is . For example: + The `foreach` statement of the C# language (`For Each` in Visual Basic) returns an object of the type of the elements in the collection. Since each element of the is a key/value pair, the element type is not the type of the key or the type of the value. Instead, the element type is . For example: :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/IDictionaryTKey,TValue/Overview/source2.cs" id="Snippet11"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/IDictionaryTKey,TValue/Overview/source2.vb" id="Snippet11"::: @@ -98,20 +98,20 @@ The `foreach` statement is a wrapper around the enumerator, which only allows reading from, not writing to, the collection. > [!NOTE] -> Because keys can be inherited and their behavior changed, their absolute uniqueness cannot be guaranteed by comparisons using the method. +> Because keys can be inherited and their behavior changed, their absolute uniqueness cannot be guaranteed by comparisons using the method. ## Examples - The following code example creates an empty of strings, with string keys, and accesses it through the interface. + The following code example creates an empty of strings, with string keys, and accesses it through the interface. - The code example uses the method to add some elements. The example demonstrates that the method throws when attempting to add a duplicate key. + The code example uses the method to add some elements. The example demonstrates that the method throws when attempting to add a duplicate key. - The example uses the property (the indexer in C#) to retrieve values, demonstrating that a is thrown when a requested key is not present, and showing that the value associated with a key can be replaced. + The example uses the property (the indexer in C#) to retrieve values, demonstrating that a is thrown when a requested key is not present, and showing that the value associated with a key can be replaced. - The example shows how to use the method as a more efficient way to retrieve values if a program often must try key values that are not in the dictionary, and how to use the method to test whether a key exists prior to calling the method. + The example shows how to use the method as a more efficient way to retrieve values if a program often must try key values that are not in the dictionary, and how to use the method to test whether a key exists prior to calling the method. - Finally, the example shows how to enumerate the keys and values in the dictionary, and how to enumerate the values alone using the property. + Finally, the example shows how to enumerate the keys and values in the dictionary, and how to enumerate the values alone using the property. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/IDictionaryTKey,TValue/Overview/source.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/IDictionaryTKey,TValue/Overview/source.vb" id="Snippet1"::: @@ -176,18 +176,18 @@ property to add new elements by setting the value of a key that does not exist in the dictionary; for example, `myCollection["myNonexistentKey"] = myValue` in C# (`myCollection("myNonexistentKey") = myValue` in Visual Basic). However, if the specified key already exists in the dictionary, setting the property overwrites the old value. In contrast, the method does not modify existing elements. + You can also use the property to add new elements by setting the value of a key that does not exist in the dictionary; for example, `myCollection["myNonexistentKey"] = myValue` in C# (`myCollection("myNonexistentKey") = myValue` in Visual Basic). However, if the specified key already exists in the dictionary, setting the property overwrites the old value. In contrast, the method does not modify existing elements. - Implementations can vary in how they determine equality of objects; for example, the class uses , whereas the class allows the user to specify the implementation to use for comparing keys. + Implementations can vary in how they determine equality of objects; for example, the class uses , whereas the class allows the user to specify the implementation to use for comparing keys. Implementations can vary in whether they allow `key` to be `null`. ## Examples - The following code example creates an empty of strings, with integer keys, and accesses it through the interface. The code example uses the method to add some elements. The example demonstrates that the method throws an when attempting to add a duplicate key. + The following code example creates an empty of strings, with integer keys, and accesses it through the interface. The code example uses the method to add some elements. The example demonstrates that the method throws an when attempting to add a duplicate key. - This code is part of a larger example that can be compiled and executed. See . + This code is part of a larger example that can be compiled and executed. See . :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/IDictionaryTKey,TValue/Overview/source.cs" interactive="try-dotnet-method" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/IDictionaryTKey,TValue/Overview/source.vb" id="Snippet2"::: @@ -253,14 +253,14 @@ class uses , whereas the class allows the user to specify the implementation to use for comparing keys. + Implementations can vary in how they determine equality of objects; for example, the class uses , whereas the class allows the user to specify the implementation to use for comparing keys. Implementations can vary in whether they allow `key` to be `null`. ## Examples - The following code example shows how to use the method to test whether a key exists prior to calling the method. It also shows how to use the method, which can be a more efficient way to retrieve values if a program frequently tries key values that are not in the dictionary. Finally, it shows how to insert items using property (the indexer in C#). + The following code example shows how to use the method to test whether a key exists prior to calling the method. It also shows how to use the method, which can be a more efficient way to retrieve values if a program frequently tries key values that are not in the dictionary. Finally, it shows how to insert items using property (the indexer in C#). - This code is part of a larger example that can be compiled and executed. See . + This code is part of a larger example that can be compiled and executed. See . :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/IDictionaryTKey,TValue/Overview/source.cs" id="Snippet6"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/IDictionaryTKey,TValue/Overview/source.vb" id="Snippet6"::: @@ -327,22 +327,22 @@ ## Remarks This property provides the ability to access a specific element in the collection by using the following syntax: `myCollection[key]` (`myCollection(key)` in Visual Basic). - You can also use the property to add new elements by setting the value of a key that does not exist in the dictionary; for example, `myCollection["myNonexistentKey"] = myValue` in C# (`myCollection("myNonexistentKey") = myValue` in Visual Basic). However, if the specified key already exists in the dictionary, setting the property overwrites the old value. In contrast, the method does not modify existing elements. + You can also use the property to add new elements by setting the value of a key that does not exist in the dictionary; for example, `myCollection["myNonexistentKey"] = myValue` in C# (`myCollection("myNonexistentKey") = myValue` in Visual Basic). However, if the specified key already exists in the dictionary, setting the property overwrites the old value. In contrast, the method does not modify existing elements. - Implementations can vary in how they determine equality of objects; for example, the class uses , whereas the class allows the user to specify the implementation to use for comparing keys. + Implementations can vary in how they determine equality of objects; for example, the class uses , whereas the class allows the user to specify the implementation to use for comparing keys. - The C# language uses the [this](/dotnet/csharp/language-reference/keywords/this) keyword to define the indexers instead of implementing the property. Visual Basic implements as a default property, which provides the same indexing functionality. + The C# language uses the [this](/dotnet/csharp/language-reference/keywords/this) keyword to define the indexers instead of implementing the property. Visual Basic implements as a default property, which provides the same indexing functionality. Implementations can vary in whether they allow `key` to be `null`. ## Examples - The following code example uses the property (the indexer in C#) to retrieve values, demonstrating that a is thrown when a requested key is not present, and showing that the value associated with a key can be replaced. + The following code example uses the property (the indexer in C#) to retrieve values, demonstrating that a is thrown when a requested key is not present, and showing that the value associated with a key can be replaced. - The example also shows how to use the method as a more efficient way to retrieve values if a program often must try key values that are not in the dictionary. + The example also shows how to use the method as a more efficient way to retrieve values if a program often must try key values that are not in the dictionary. - This code is part of a larger example that can be compiled and executed. See . + This code is part of a larger example that can be compiled and executed. See . :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/IDictionaryTKey,TValue/Overview/source.cs" id="Snippet3"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/IDictionaryTKey,TValue/Overview/source.vb" id="Snippet3"::: @@ -408,14 +408,14 @@ is unspecified, but it is guaranteed to be the same order as the corresponding values in the returned by the property. + The order of the keys in the returned is unspecified, but it is guaranteed to be the same order as the corresponding values in the returned by the property. ## Examples - The following code example shows how to enumerate keys alone using the property. + The following code example shows how to enumerate keys alone using the property. - This code is part of a larger example that can be compiled and executed. See . + This code is part of a larger example that can be compiled and executed. See . :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/IDictionaryTKey,TValue/Overview/source.cs" id="Snippet9"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/IDictionaryTKey,TValue/Overview/source.vb" id="Snippet9"::: @@ -476,14 +476,14 @@ class uses , whereas the class allows the user to specify the implementation to use for comparing keys. + Implementations can vary in how they determine equality of objects; for example, the class uses , whereas the class allows the user to specify the implementation to use for comparing keys. ## Examples - The following code example shows how to remove a key/value pair from a dictionary using the method. + The following code example shows how to remove a key/value pair from a dictionary using the method. - This code is part of a larger example that can be compiled and executed. See . + This code is part of a larger example that can be compiled and executed. See . :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/IDictionaryTKey,TValue/Overview/source.cs" id="Snippet10"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/IDictionaryTKey,TValue/Overview/source.vb" id="Snippet10"::: @@ -556,16 +556,16 @@ method and the property. + This method combines the functionality of the method and the property. If the key is not found, then the `value` parameter gets the appropriate default value for the type `TValue`; for example, zero (0) for integer types, `false` for Boolean types, and `null` for reference types. ## Examples - The example shows how to use the method to retrieve values. If a program frequently tries key values that are not in a dictionary, the method can be more efficient than using the property (the indexer in C#), which throws exceptions when attempting to retrieve nonexistent keys. + The example shows how to use the method to retrieve values. If a program frequently tries key values that are not in a dictionary, the method can be more efficient than using the property (the indexer in C#), which throws exceptions when attempting to retrieve nonexistent keys. - This code is part of a larger example that can be compiled and executed. See . + This code is part of a larger example that can be compiled and executed. See . :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/IDictionaryTKey,TValue/Overview/source.cs" id="Snippet5"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/IDictionaryTKey,TValue/Overview/source.vb" id="Snippet5"::: @@ -626,14 +626,14 @@ is unspecified, but it is guaranteed to be the same order as the corresponding keys in the returned by the property. + The order of the values in the returned is unspecified, but it is guaranteed to be the same order as the corresponding keys in the returned by the property. ## Examples - The following code example shows how to enumerate values alone using the property. + The following code example shows how to enumerate values alone using the property. - This code is part of a larger example that can be compiled and executed. See . + This code is part of a larger example that can be compiled and executed. See . :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/IDictionaryTKey,TValue/Overview/source.cs" id="Snippet8"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/IDictionaryTKey,TValue/Overview/source.vb" id="Snippet8"::: diff --git a/xml/System.Collections.Generic/IEnumerable`1.xml b/xml/System.Collections.Generic/IEnumerable`1.xml index bd4a35a3044..cc70cc4f5d4 100644 --- a/xml/System.Collections.Generic/IEnumerable`1.xml +++ b/xml/System.Collections.Generic/IEnumerable`1.xml @@ -73,16 +73,16 @@ is the base interface for collections in the namespace such as , , and and other generic collections such as and . Collections that implement can be enumerated by using the `foreach` statement. + is the base interface for collections in the namespace such as , , and and other generic collections such as and . Collections that implement can be enumerated by using the `foreach` statement. For the non-generic version of this interface, see . - contains a single method that you must implement when implementing this interface; , which returns an object. The returned provides the ability to iterate through the collection by exposing a property. + contains a single method that you must implement when implementing this interface; , which returns an object. The returned provides the ability to iterate through the collection by exposing a property. ## Examples - The following example demonstrates how to implement the interface and how to use that implementation to create a LINQ query. When you implement , you must also implement or, for C# only, you can use the [yield](/dotnet/csharp/language-reference/keywords/yield) keyword. Implementing also requires to be implemented, which you will see in this example. + The following example demonstrates how to implement the interface and how to use that implementation to create a LINQ query. When you implement , you must also implement or, for C# only, you can use the [yield](/dotnet/csharp/language-reference/keywords/yield) keyword. Implementing also requires to be implemented, which you will see in this example. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/IEnumerableT/Overview/program.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/IEnumerableT/Overview/module1.vb" id="Snippet1"::: @@ -148,13 +148,13 @@ provides the ability to iterate through the collection by exposing a property .You can use enumerators to read the data in a collection, but not to modify the collection. + The returned provides the ability to iterate through the collection by exposing a property .You can use enumerators to read the data in a collection, but not to modify the collection. - Initially, the enumerator is positioned before the first element in the collection. At this position, is undefined. Therefore, you must call the method to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. At this position, is undefined. Therefore, you must call the method to advance the enumerator to the first element of the collection before reading the value of . - returns the same object until is called again as sets to the next element. + returns the same object until is called again as sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator instance instead. + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator instance instead. If changes are made to the collection, such as adding, modifying, or deleting elements, the behavior of the enumerator is undefined. @@ -163,7 +163,7 @@ Default implementations of collections in the namespace aren't synchronized. ## Examples - The following example demonstrates how to implement the interface and uses that implementation to create a LINQ query. When you implement , you must also implement or, for C# only, you can use the [yield](/dotnet/csharp/language-reference/keywords/yield) keyword. Implementing also requires to be implemented, which you will see in this example. + The following example demonstrates how to implement the interface and uses that implementation to create a LINQ query. When you implement , you must also implement or, for C# only, you can use the [yield](/dotnet/csharp/language-reference/keywords/yield) keyword. Implementing also requires to be implemented, which you will see in this example. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/IEnumerableT/Overview/program.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/IEnumerableT/Overview/module1.vb" id="Snippet1"::: diff --git a/xml/System.Collections.Generic/IEnumerator`1.xml b/xml/System.Collections.Generic/IEnumerator`1.xml index c581fb0e02f..216fda7cbe8 100644 --- a/xml/System.Collections.Generic/IEnumerator`1.xml +++ b/xml/System.Collections.Generic/IEnumerator`1.xml @@ -77,19 +77,19 @@ is the base interface for all generic enumerators. + is the base interface for all generic enumerators. The `foreach` statement of the C# language (`For Each` in Visual Basic) hides the complexity of the enumerators. Therefore, using `foreach` is recommended, instead of directly manipulating the enumerator. Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection. - Initially, the enumerator is positioned before the first element in the collection. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . - returns the same object until is called. sets to the next element. + returns the same object until is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator instance instead. + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator instance instead. - The method is provided for COM interoperability. It does not necessarily need to be implemented; instead, the implementer can simply throw a . However, if you choose to do this, you should make sure no callers are relying on the functionality. + The method is provided for COM interoperability. It does not necessarily need to be implemented; instead, the implementer can simply throw a . However, if you choose to do this, you should make sure no callers are relying on the functionality. If changes are made to the collection, such as adding, modifying, or deleting elements, the behavior of the enumerator is undefined. @@ -100,7 +100,7 @@ ## Examples - The following example shows an implementation of the interface for a collection class of custom objects. The custom object is an instance of the type `Box`, and the collection class is `BoxCollection`. This code example is part of a larger example provided for the interface. + The following example shows an implementation of the interface for a collection class of custom objects. The custom object is an instance of the type `Box`, and the collection class is `BoxCollection`. This code example is part of a larger example provided for the interface. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ICollectionT/Overview/program.cs" id="Snippet3"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ICollectionT/Overview/program.vb" id="Snippet3"::: @@ -169,15 +169,15 @@ is undefined under any of the following conditions: + is undefined under any of the following conditions: -- The enumerator is positioned before the first element in the collection, immediately after the enumerator is created. must be called to advance the enumerator to the first element of the collection before reading the value of . +- The enumerator is positioned before the first element in the collection, immediately after the enumerator is created. must be called to advance the enumerator to the first element of the collection before reading the value of . -- The last call to returned `false`, which indicates the end of the collection. +- The last call to returned `false`, which indicates the end of the collection. - The enumerator is invalidated due to changes made in the collection, such as adding, modifying, or deleting elements. - returns the same object until is called. sets to the next element. + returns the same object until is called. sets to the next element. ]]> diff --git a/xml/System.Collections.Generic/IEqualityComparer`1.xml b/xml/System.Collections.Generic/IEqualityComparer`1.xml index 601c57f7163..449b1c781ea 100644 --- a/xml/System.Collections.Generic/IEqualityComparer`1.xml +++ b/xml/System.Collections.Generic/IEqualityComparer`1.xml @@ -63,13 +63,13 @@ generic interface. In the .NET Framework, constructors of the generic collection type accept this interface. + This interface allows the implementation of customized equality comparison for collections. That is, you can create your own definition of equality for type `T`, and specify that this definition be used with a collection type that accepts the generic interface. In the .NET Framework, constructors of the generic collection type accept this interface. - A default implementation of this interface is provided by the property of the generic class. The class implements of type . + A default implementation of this interface is provided by the property of the generic class. The class implements of type . - This interface supports only equality comparisons. Customization of comparisons for sorting and ordering is provided by the generic interface. + This interface supports only equality comparisons. Customization of comparisons for sorting and ordering is provided by the generic interface. - We recommend that you derive from the class instead of implementing the interface, because the class tests for equality using the method instead of the method. This is consistent with the `Contains`, `IndexOf`, `LastIndexOf`, and `Remove` methods of the class and other generic collections. + We recommend that you derive from the class instead of implementing the interface, because the class tests for equality using the method instead of the method. This is consistent with the `Contains`, `IndexOf`, `LastIndexOf`, and `Remove` methods of the class and other generic collections. @@ -223,7 +223,7 @@ method. + Implement this method to provide a customized hash code for type `T`, corresponding to the customized equality comparison provided by the method. ]]> diff --git a/xml/System.Collections.Generic/IList`1.xml b/xml/System.Collections.Generic/IList`1.xml index 64d8655d5f7..fb96a09a023 100644 --- a/xml/System.Collections.Generic/IList`1.xml +++ b/xml/System.Collections.Generic/IList`1.xml @@ -72,7 +72,7 @@ generic interface is a descendant of the generic interface and is the base interface of all generic lists. + The generic interface is a descendant of the generic interface and is the base interface of all generic lists. ]]> @@ -130,7 +130,7 @@ method always returns the first instance found. + If an object occurs multiple times in the list, the method always returns the first instance found. ]]> @@ -187,7 +187,7 @@ , then `item` is appended to the list. + If `index` equals the number of items in the , then `item` is appended to the list. In collections of contiguous elements, such as lists, the elements that follow the insertion point move down to accommodate the new element. If the collection is indexed, the indexes of the elements that are moved are also updated. This behavior does not apply to collections where elements are conceptually grouped into buckets, such as a hash table. @@ -251,7 +251,7 @@ ## Remarks This property provides the ability to access a specific element in the collection by using the following syntax: `myCollection[index]`. - The C# language uses the [this](/dotnet/csharp/language-reference/keywords/this) keyword to define the indexers instead of implementing the property. Visual Basic implements as a [default property](/dotnet/visual-basic/language-reference/modifiers/default), which provides the same indexing functionality. + The C# language uses the [this](/dotnet/csharp/language-reference/keywords/this) keyword to define the indexers instead of implementing the property. Visual Basic implements as a [default property](/dotnet/visual-basic/language-reference/modifiers/default), which provides the same indexing functionality. ]]> diff --git a/xml/System.Collections.Generic/IReadOnlyDictionary`2.xml b/xml/System.Collections.Generic/IReadOnlyDictionary`2.xml index 89fedc9d74e..bd6126c78c9 100644 --- a/xml/System.Collections.Generic/IReadOnlyDictionary`2.xml +++ b/xml/System.Collections.Generic/IReadOnlyDictionary`2.xml @@ -84,11 +84,11 @@ object. + Each element is a key/value pair that is stored in a object. - Each pair must have a unique key. Implementations can vary in whether they allow you to specify a key that is `null`. The value can be `null` and does not have to be unique. The interface allows the contained keys and values to be enumerated, but it does not imply any particular sort order. + Each pair must have a unique key. Implementations can vary in whether they allow you to specify a key that is `null`. The value can be `null` and does not have to be unique. The interface allows the contained keys and values to be enumerated, but it does not imply any particular sort order. - The `foreach` statement of the C# language (`For Each` in Visual Basic) requires the type of each element in the collection. Because each element of the interface is a key/value pair, the element type is not the type of the key or the type of the value. Instead, the element type is , as the following example illustrates. + The `foreach` statement of the C# language (`For Each` in Visual Basic) requires the type of each element in the collection. Because each element of the interface is a key/value pair, the element type is not the type of the key or the type of the value. Instead, the element type is , as the following example illustrates. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/IDictionaryTKey,TValue/Overview/source2.cs" id="Snippet11"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/IDictionaryTKey,TValue/Overview/source2.vb" id="Snippet11"::: @@ -149,7 +149,7 @@ might use the property, or it might implement the method. + Implementations can vary in how they determine the equality of objects; for example, the class that implements might use the property, or it might implement the method. Implementations can vary in whether they allow `key` to be `null`. @@ -210,7 +210,7 @@ ## Remarks This property lets you access a specific element in the collection by using the following syntax: `myCollection[key]` (`myCollection(key)` in Visual Basic). - Implementations can vary in how they determine the equality of objects: for example, the class that implements might use the property, or it might implement the method. + Implementations can vary in how they determine the equality of objects: for example, the class that implements might use the property, or it might implement the method. Implementations can vary in whether they allow `key` to be `null`. @@ -266,7 +266,7 @@ property. + The order of the keys in the enumerable collection is unspecified, but the implementation must guarantee that the keys are in the same order as the corresponding values in the enumerable collection that is returned by the property. ]]> @@ -331,7 +331,7 @@ method and the property. + This method combines the functionality of the method and the property. If the key is not found, the `value` parameter gets the appropriate default value for the type `TValue`: for example, 0 (zero) for integer types, `false` for Boolean types, and `null` for reference types. @@ -386,7 +386,7 @@ property. + The order of the values in the enumerable collection is unspecified, but the implementation must guarantee that the values are in the same order as the corresponding keys in the enumerable collection that is returned by the property. ]]> diff --git a/xml/System.Collections.Generic/IReadOnlyList`1.xml b/xml/System.Collections.Generic/IReadOnlyList`1.xml index 24ad3a378ec..46c0d30039c 100644 --- a/xml/System.Collections.Generic/IReadOnlyList`1.xml +++ b/xml/System.Collections.Generic/IReadOnlyList`1.xml @@ -72,11 +72,11 @@ The type of elements in the read-only list. Represents a read-only collection of elements that can be accessed by index. - represents a list in which the number and order of list elements is read-only. The content of list elements is not guaranteed to be read-only. - + represents a list in which the number and order of list elements is read-only. The content of list elements is not guaranteed to be read-only. + ]]> diff --git a/xml/System.Collections.Generic/ISet`1.xml b/xml/System.Collections.Generic/ISet`1.xml index d60a5064666..f462f2a8fd9 100644 --- a/xml/System.Collections.Generic/ISet`1.xml +++ b/xml/System.Collections.Generic/ISet`1.xml @@ -68,11 +68,11 @@ The type of elements in the set. Provides the base interface for the abstraction of sets. - and collections implement this interface. - + and collections implement this interface. + ]]> @@ -171,11 +171,11 @@ The collection of items to remove from the set. Removes all elements in the specified collection from the current set. - @@ -227,11 +227,11 @@ The collection to compare to the current set. Modifies the current set so that it contains only elements that are also in a specified collection. - @@ -285,15 +285,15 @@ if the current set is a proper subset of ; otherwise, . - @@ -347,15 +347,15 @@ if the current set is a proper superset of ; otherwise, . - @@ -409,13 +409,13 @@ if the current set is a subset of ; otherwise, . - @@ -469,13 +469,13 @@ if the current set is a superset of ; otherwise, . - @@ -529,11 +529,11 @@ if the current set and share at least one common element; otherwise, . - @@ -587,11 +587,11 @@ if the current set is equal to ; otherwise, . - @@ -643,11 +643,11 @@ The collection to compare to the current set. Modifies the current set so that it contains only elements that are present either in the current set or in the specified collection, but not both. - @@ -699,11 +699,11 @@ The collection to compare to the current set. Modifies the current set so that it contains all elements that are present in the current set, in the specified collection, or in both. - diff --git a/xml/System.Collections.Generic/KeyNotFoundException.xml b/xml/System.Collections.Generic/KeyNotFoundException.xml index 6f24c481376..332f99a676e 100644 --- a/xml/System.Collections.Generic/KeyNotFoundException.xml +++ b/xml/System.Collections.Generic/KeyNotFoundException.xml @@ -84,7 +84,7 @@ uses the HRESULT COR_E_KEYNOTFOUND, which has the value 0x80131577. - For a list of initial property values for an instance of the class, see the constructors. + For a list of initial property values for an instance of the class, see the constructors. ]]> @@ -151,8 +151,8 @@ |Property|Value| |--------------|-----------| -||`null`.| -||The localized error message string.| +||`null`.| +||The localized error message string.| ]]> @@ -211,8 +211,8 @@ |Property|Value| |--------------|-----------| -||`null`.| -||The localized error message string.| +||`null`.| +||The localized error message string.| ]]> @@ -337,8 +337,8 @@ |Property|Value| |--------------|-----------| -||The inner exception reference.| -||The localized error message string.| +||The inner exception reference.| +||The localized error message string.| ]]> diff --git a/xml/System.Collections.Generic/KeyValuePair`2.xml b/xml/System.Collections.Generic/KeyValuePair`2.xml index 8e9ad58b834..585c8ab3f03 100644 --- a/xml/System.Collections.Generic/KeyValuePair`2.xml +++ b/xml/System.Collections.Generic/KeyValuePair`2.xml @@ -89,9 +89,9 @@ property returns an instance of this type. + The property returns an instance of this type. - The `foreach` statement of the C# language (`For Each` in Visual Basic) returns an object of the type of the elements in the collection. Since each element of a collection based on is a key/value pair, the element type is not the type of the key or the type of the value. Instead, the element type is . For example: + The `foreach` statement of the C# language (`For Each` in Visual Basic) returns an object of the type of the elements in the collection. Since each element of a collection based on is a key/value pair, the element type is not the type of the key or the type of the value. Instead, the element type is . For example: :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/DictionaryTKey,TValue/Overview/source2.cs" id="Snippet11"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/DictionaryTKey,TValue/Overview/source2.vb" id="Snippet11"::: @@ -101,9 +101,9 @@ ## Examples - The following code example shows how to enumerate the keys and values in a dictionary, using the structure. + The following code example shows how to enumerate the keys and values in a dictionary, using the structure. - This code is part of a larger example provided for the class. + This code is part of a larger example provided for the class. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/DictionaryTKey,TValue/Overview/source.cs" id="Snippet7"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/DictionaryTKey,TValue/Overview/source.vb" id="Snippet7"::: @@ -261,9 +261,9 @@ ## Examples - The following code example shows how to enumerate the keys and values in a dictionary, using the structure. + The following code example shows how to enumerate the keys and values in a dictionary, using the structure. - This code is part of a larger example provided for the class. + This code is part of a larger example provided for the class. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/DictionaryTKey,TValue/Overview/source.cs" id="Snippet7"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/DictionaryTKey,TValue/Overview/source.vb" id="Snippet7"::: @@ -319,7 +319,7 @@ method for a structure with the string "Test" and the integer 14 returns the string "[Test, 14]". + The string representation consists of the string representations of the key and value, separated by a comma and a space, and enclosed in square brackets. For example, the method for a structure with the string "Test" and the integer 14 returns the string "[Test, 14]". > [!NOTE] > This method uses the `ToString` methods provided by the key and value types. Some types do not return useful or informative values for their `ToString` methods. @@ -379,9 +379,9 @@ ## Examples - The following code example shows how to enumerate the keys and values in a dictionary, using the structure. + The following code example shows how to enumerate the keys and values in a dictionary, using the structure. - This code is part of a larger example provided for the class. + This code is part of a larger example provided for the class. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/DictionaryTKey,TValue/Overview/source.cs" id="Snippet7"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/DictionaryTKey,TValue/Overview/source.vb" id="Snippet7"::: diff --git a/xml/System.Collections.Generic/LinkedListNode`1.xml b/xml/System.Collections.Generic/LinkedListNode`1.xml index ce53c83f2ef..94c13c76b5b 100644 --- a/xml/System.Collections.Generic/LinkedListNode`1.xml +++ b/xml/System.Collections.Generic/LinkedListNode`1.xml @@ -72,12 +72,12 @@ collection is a . The contains a value, a reference to the that it belongs to, a reference to the next node, and a reference to the previous node. + Each element of the collection is a . The contains a value, a reference to the that it belongs to, a reference to the next node, and a reference to the previous node. ## Examples - The following code example creates a , adds it to a , and tracks the values of its properties as the changes. + The following code example creates a , adds it to a , and tracks the values of its properties as the changes. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/LinkedListNodeT/Overview/llnctor.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/LinkedListNodeT/Overview/llnctor.vb" id="Snippet1"::: @@ -136,12 +136,12 @@ , , and properties are set to `null`. + The , , and properties are set to `null`. ## Examples - The following code example creates a , adds it to a , and tracks the values of its properties as the changes. + The following code example creates a , adds it to a , and tracks the values of its properties as the changes. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/LinkedListNodeT/Overview/llnctor.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/LinkedListNodeT/Overview/llnctor.vb" id="Snippet1"::: @@ -205,7 +205,7 @@ , adds it to a , and tracks the values of its properties as the changes. + The following code example creates a , adds it to a , and tracks the values of its properties as the changes. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/LinkedListNodeT/Overview/llnctor.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/LinkedListNodeT/Overview/llnctor.vb" id="Snippet1"::: @@ -265,7 +265,7 @@ , adds it to a , and tracks the values of its properties as the changes. + The following code example creates a , adds it to a , and tracks the values of its properties as the changes. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/LinkedListNodeT/Overview/llnctor.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/LinkedListNodeT/Overview/llnctor.vb" id="Snippet1"::: @@ -325,7 +325,7 @@ , adds it to a , and tracks the values of its properties as the changes. + The following code example creates a , adds it to a , and tracks the values of its properties as the changes. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/LinkedListNodeT/Overview/llnctor.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/LinkedListNodeT/Overview/llnctor.vb" id="Snippet1"::: @@ -388,12 +388,12 @@ . + This property is set in the . ## Examples - The following code example creates a , adds it to a , and tracks the values of its properties as the changes. + The following code example creates a , adds it to a , and tracks the values of its properties as the changes. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/LinkedListNodeT/Overview/llnctor.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/LinkedListNodeT/Overview/llnctor.vb" id="Snippet1"::: diff --git a/xml/System.Collections.Generic/LinkedList`1+Enumerator.xml b/xml/System.Collections.Generic/LinkedList`1+Enumerator.xml index d180c7dfb7a..d16441df8eb 100644 --- a/xml/System.Collections.Generic/LinkedList`1+Enumerator.xml +++ b/xml/System.Collections.Generic/LinkedList`1+Enumerator.xml @@ -94,13 +94,13 @@ Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection. - Initially, the enumerator is positioned before the first element in the collection. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . - returns the same object until is called. sets to the next element. + returns the same object until is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator instance instead. + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator instance instead. - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization. @@ -169,15 +169,15 @@ is undefined under any of the following conditions: + is undefined under any of the following conditions: -- The enumerator is positioned before the first element of the collection. That happens after an enumerator is created or after the method is called. The method must be called to advance the enumerator to the first element of the collection before reading the value of the property. +- The enumerator is positioned before the first element of the collection. That happens after an enumerator is created or after the method is called. The method must be called to advance the enumerator to the first element of the collection before reading the value of the property. -- The last call to returned `false`, which indicates the end of the collection and that the enumerator is positioned after the last element of the collection. +- The last call to returned `false`, which indicates the end of the collection and that the enumerator is positioned after the last element of the collection. - The enumerator is invalidated due to changes made in the collection, such as adding, modifying, or deleting elements. - does not move the position of the enumerator, and consecutive calls to return the same object until either or is called. + does not move the position of the enumerator, and consecutive calls to return the same object until either or is called. ]]> @@ -280,11 +280,11 @@ advances the enumerator to the first element of the collection. + After an enumerator is created, the enumerator is positioned before the first element in the collection, and the first call to advances the enumerator to the first element of the collection. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to throws an . ]]> @@ -346,15 +346,15 @@ is undefined under any of the following conditions: + is undefined under any of the following conditions: -- The enumerator is positioned before the first element of the collection. That happens after an enumerator is created or after the method is called. The method must be called to advance the enumerator to the first element of the collection before reading the value of the property. +- The enumerator is positioned before the first element of the collection. That happens after an enumerator is created or after the method is called. The method must be called to advance the enumerator to the first element of the collection before reading the value of the property. -- The last call to returned `false`, which indicates the end of the collection and that the enumerator is positioned after the last element of the collection. +- The last call to returned `false`, which indicates the end of the collection and that the enumerator is positioned after the last element of the collection. - The enumerator is invalidated due to changes made in the collection, such as adding, modifying, or deleting elements. - does not move the position of the enumerator, and consecutive calls to return the same object until either or is called. + does not move the position of the enumerator, and consecutive calls to return the same object until either or is called. ]]> @@ -410,7 +410,7 @@ or throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . ]]> diff --git a/xml/System.Collections.Generic/LinkedList`1.xml b/xml/System.Collections.Generic/LinkedList`1.xml index 43366c8609c..b2b74a53cce 100644 --- a/xml/System.Collections.Generic/LinkedList`1.xml +++ b/xml/System.Collections.Generic/LinkedList`1.xml @@ -123,24 +123,24 @@ is a general-purpose linked list. It supports enumerators and implements the interface, consistent with other collection classes in the .NET Framework. + is a general-purpose linked list. It supports enumerators and implements the interface, consistent with other collection classes in the .NET Framework. - provides separate nodes of type , so insertion and removal are O(1) operations. + provides separate nodes of type , so insertion and removal are O(1) operations. - You can remove nodes and reinsert them, either in the same list or in another list, which results in no additional objects allocated on the heap. Because the list also maintains an internal count, getting the property is an O(1) operation. + You can remove nodes and reinsert them, either in the same list or in another list, which results in no additional objects allocated on the heap. Because the list also maintains an internal count, getting the property is an O(1) operation. - Each node in a object is of the type . Because the is doubly linked, each node points forward to the node and backward to the node. + Each node in a object is of the type . Because the is doubly linked, each node points forward to the node and backward to the node. - Lists that contain reference types perform better when a node and its value are created at the same time. accepts `null` as a valid property for reference types and allows duplicate values. + Lists that contain reference types perform better when a node and its value are created at the same time. accepts `null` as a valid property for reference types and allows duplicate values. - If the is empty, the and properties contain `null`. + If the is empty, the and properties contain `null`. - The class does not support chaining, splitting, cycles, or other features that can leave the list in an inconsistent state. The list remains consistent on a single thread. The only multithreaded scenario supported by is multithreaded read operations. + The class does not support chaining, splitting, cycles, or other features that can leave the list in an inconsistent state. The list remains consistent on a single thread. The only multithreaded scenario supported by is multithreaded read operations. ## Examples - The following code example demonstrates many features of the class. + The following code example demonstrates many features of the class. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/LinkedListT/Overview/source.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/LinkedListT/Overview/source.vb" id="Snippet1"::: @@ -210,16 +210,16 @@ accepts `null` as a valid for reference types and allows duplicate values. + accepts `null` as a valid for reference types and allows duplicate values. - If the is empty, the and properties contain `null`. + If the is empty, the and properties contain `null`. This constructor is an O(1) operation. ## Examples - The following code example creates and initializes a of type , adds several nodes, and then displays its contents. + The following code example creates and initializes a of type , adds several nodes, and then displays its contents. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/LinkedListT/.ctor/llctor.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/LinkedListT/.ctor/llctor.vb" id="Snippet1"::: @@ -272,16 +272,16 @@ accepts `null` as a valid for reference types and allows duplicate values. + accepts `null` as a valid for reference types and allows duplicate values. - If `collection` has no elements then the new is empty, and the and properties contain `null`. + If `collection` has no elements then the new is empty, and the and properties contain `null`. This constructor is an O(n) operation, where `n` is the number of elements in `collection`. ## Examples - For an example that includes this constructor, see the class. + For an example that includes this constructor, see the class. ]]> @@ -347,9 +347,9 @@ accepts `null` as a valid for reference types and allows duplicate values. + accepts `null` as a valid for reference types and allows duplicate values. - If the is empty, the and properties contain `null`. + If the is empty, the and properties contain `null`. This constructor is an O(n) operation. @@ -418,14 +418,14 @@ accepts `null` as a valid for reference types and allows duplicate values. + accepts `null` as a valid for reference types and allows duplicate values. This method is an O(1) operation. ## Examples - For an example that includes this method, see the class. + For an example that includes this method, see the class. ]]> @@ -497,14 +497,14 @@ accepts `null` as a valid for reference types and allows duplicate values. + accepts `null` as a valid for reference types and allows duplicate values. This method is an O(1) operation. ## Examples - For an example that includes this method, see the class. + For an example that includes this method, see the class. ]]> @@ -578,14 +578,14 @@ accepts `null` as a valid for reference types and allows duplicate values. + accepts `null` as a valid for reference types and allows duplicate values. This method is an O(1) operation. ## Examples - For an example that includes this method, see the class. + For an example that includes this method, see the class. ]]> @@ -657,14 +657,14 @@ accepts `null` as a valid for reference types and allows duplicate values. + accepts `null` as a valid for reference types and allows duplicate values. This method is an O(1) operation. ## Examples - For an example that includes this method, see the class. + For an example that includes this method, see the class. ]]> @@ -736,16 +736,16 @@ accepts `null` as a valid for reference types and allows duplicate values. + accepts `null` as a valid for reference types and allows duplicate values. - If the is empty, the new node becomes the and the . + If the is empty, the new node becomes the and the . This method is an O(1) operation. ## Examples - For an example that includes this method, see the class. + For an example that includes this method, see the class. ]]> @@ -807,16 +807,16 @@ accepts `null` as a valid for reference types and allows duplicate values. + accepts `null` as a valid for reference types and allows duplicate values. - If the is empty, the new node becomes the and the . + If the is empty, the new node becomes the and the . This method is an O(1) operation. ## Examples - For an example that includes this method, see the class. + For an example that includes this method, see the class. ]]> @@ -884,16 +884,16 @@ accepts `null` as a valid for reference types and allows duplicate values. + accepts `null` as a valid for reference types and allows duplicate values. - If the is empty, the new node becomes the and the . + If the is empty, the new node becomes the and the . This method is an O(1) operation. ## Examples - For an example that includes this method, see the class. + For an example that includes this method, see the class. ]]> @@ -955,16 +955,16 @@ accepts `null` as a valid for reference types and allows duplicate values. + accepts `null` as a valid for reference types and allows duplicate values. - If the is empty, the new node becomes the and the . + If the is empty, the new node becomes the and the . This method is an O(1) operation. ## Examples - For an example that includes this method, see the class. + For an example that includes this method, see the class. ]]> @@ -1021,14 +1021,14 @@ is set to zero, and references to other objects from elements of the collection are also released. and are set to `null`. + is set to zero, and references to other objects from elements of the collection are also released. and are set to `null`. - This method is an O(`n`) operation, where `n` is . + This method is an O(`n`) operation, where `n` is . ## Examples - For an example that includes this method, see the class. + For an example that includes this method, see the class. ]]> @@ -1089,12 +1089,12 @@ . + This method performs a linear search; therefore, this method is an O(`n`) operation, where `n` is . ## Examples - For an example that includes this method, see the class. + For an example that includes this method, see the class. ]]> @@ -1155,14 +1155,14 @@ in the same order in which the enumerator iterates through the . + The elements are copied to the in the same order in which the enumerator iterates through the . - This method is an O(`n`) operation, where `n` is . + This method is an O(`n`) operation, where `n` is . ## Examples - For an example that includes this method, see the class. + For an example that includes this method, see the class. ]]> @@ -1233,7 +1233,7 @@ ## Examples - For an example that includes this property, see the class. + For an example that includes this property, see the class. ]]> @@ -1288,14 +1288,14 @@ is searched forward starting at and ending at . + The is searched forward starting at and ending at . - This method performs a linear search; therefore, this method is an O(`n`) operation, where `n` is . + This method performs a linear search; therefore, this method is an O(`n`) operation, where `n` is . ## Examples - For an example that includes this method, see the class. + For an example that includes this method, see the class. ]]> @@ -1353,14 +1353,14 @@ is searched backward starting at and ending at . + The is searched backward starting at and ending at . - This method performs a linear search; therefore, this method is an O(`n`) operation, where `n` is . + This method performs a linear search; therefore, this method is an O(`n`) operation, where `n` is . ## Examples - For an example that includes this method, see the class. + For an example that includes this method, see the class. ]]> @@ -1424,16 +1424,16 @@ accepts `null` as a valid for reference types and allows duplicate values. + accepts `null` as a valid for reference types and allows duplicate values. - If the is empty, the and properties contain `null`. + If the is empty, the and properties contain `null`. Retrieving the value of this property is an O(1) operation. ## Examples - For an example that includes this property, see the class. + For an example that includes this property, see the class. ]]> @@ -1488,13 +1488,13 @@ Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection. - Initially, the enumerator is positioned before the first element in the collection. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . - returns the same object until is called. sets to the next element. + returns the same object until is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator instance instead. + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator instance instead. - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization. @@ -1568,7 +1568,7 @@ . + This method is an O(`n`) operation, where `n` is . ]]> @@ -1631,16 +1631,16 @@ accepts `null` as a valid for reference types and allows duplicate values. + accepts `null` as a valid for reference types and allows duplicate values. - If the is empty, the and properties contain `null`. + If the is empty, the and properties contain `null`. Retrieving the value of this property is an O(1) operation. ## Examples - For an example that includes this property, see the class. + For an example that includes this property, see the class. ]]> @@ -1695,7 +1695,7 @@ . + This method is an O(`n`) operation, where `n` is . ]]> @@ -1769,7 +1769,7 @@ ## Examples - For an example that includes this method, see the class. + For an example that includes this method, see the class. ]]> @@ -1838,12 +1838,12 @@ . + This method performs a linear search; therefore, this method is an O(`n`) operation, where `n` is . ## Examples - For an example that includes this method, see the class. + For an example that includes this method, see the class. ]]> @@ -1905,7 +1905,7 @@ ## Examples - For an example that includes this method, see the class. + For an example that includes this method, see the class. ]]> @@ -1965,7 +1965,7 @@ ## Examples - For an example that includes this method, see the class. + For an example that includes this method, see the class. ]]> @@ -2026,16 +2026,16 @@ accepts `null` as a valid for reference types and allows duplicate values. + accepts `null` as a valid for reference types and allows duplicate values. - If the is empty, the new node becomes the and the . + If the is empty, the new node becomes the and the . This method is an O(1) operation. ## Examples - For an example that includes this method, see the class. + For an example that includes this method, see the class. ]]> @@ -2152,13 +2152,13 @@ Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection. - Initially, the enumerator is positioned before the first element in the collection. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . - returns the same object until is called. sets to the next element. + returns the same object until is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator instance instead. + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator instance instead. - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization. @@ -2225,9 +2225,9 @@ ## Remarks > [!NOTE] -> If the type of the source cannot be cast automatically to the type of the destination `array`, the non-generic implementations of throw , whereas the generic implementations throw . +> If the type of the source cannot be cast automatically to the type of the destination `array`, the non-generic implementations of throw , whereas the generic implementations throw . - This method is an O(`n`) operation, where `n` is . + This method is an O(`n`) operation, where `n` is . ]]> @@ -2303,7 +2303,7 @@ Enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization. - returns an object that can be used to synchronize access to the . Synchronization is effective only if all threads lock this object before accessing the collection. + returns an object that can be used to synchronize access to the . Synchronization is effective only if all threads lock this object before accessing the collection. Retrieving the value of this property is an O(1) operation. @@ -2363,7 +2363,7 @@ Enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization. - returns an object that can be used to synchronize access to the . Synchronization is effective only if all threads lock this object before accessing the collection. The following code shows the use of the property. + returns an object that can be used to synchronize access to the . Synchronization is effective only if all threads lock this object before accessing the collection. The following code shows the use of the property. ```csharp ICollection ic = ...; @@ -2438,13 +2438,13 @@ Retrieving the value of this property is an O(1) operation. Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection. - Initially, the enumerator is positioned before the first element in the collection. also brings the enumerator back to this position. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. also brings the enumerator back to this position. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . - returns the same object until either or is called. sets to the next element. + returns the same object until either or is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. To set to the first element of the collection again, you can call followed by . + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. To set to the first element of the collection again, you can call followed by . - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization. diff --git a/xml/System.Collections.Generic/List`1+Enumerator.xml b/xml/System.Collections.Generic/List`1+Enumerator.xml index 98f1a85daf2..d7b74981fd5 100644 --- a/xml/System.Collections.Generic/List`1+Enumerator.xml +++ b/xml/System.Collections.Generic/List`1+Enumerator.xml @@ -83,13 +83,13 @@ Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection. - Initially, the enumerator is positioned before the first element in the collection. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . - returns the same object until is called. sets to the next element. + returns the same object until is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator instance instead. + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator instance instead. - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization. @@ -154,15 +154,15 @@ is undefined under any of the following conditions: + is undefined under any of the following conditions: -- The enumerator is positioned before the first element of the collection. That happens after an enumerator is created or after the method is called. The method must be called to advance the enumerator to the first element of the collection before reading the value of the property. +- The enumerator is positioned before the first element of the collection. That happens after an enumerator is created or after the method is called. The method must be called to advance the enumerator to the first element of the collection before reading the value of the property. -- The last call to returned `false`, which indicates the end of the collection and that the enumerator is positioned after the last element of the collection. +- The last call to returned `false`, which indicates the end of the collection and that the enumerator is positioned after the last element of the collection. - The enumerator is invalidated due to changes made in the collection, such as adding, modifying, or deleting elements. - does not move the position of the enumerator, and consecutive calls to return the same object until either or is called. + does not move the position of the enumerator, and consecutive calls to return the same object until either or is called. ]]> @@ -271,11 +271,11 @@ advances the enumerator to the first element of the collection. + After an enumerator is created, the enumerator is positioned before the first element in the collection, and the first call to advances the enumerator to the first element of the collection. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to throws an . ]]> @@ -337,15 +337,15 @@ is undefined under any of the following conditions: + is undefined under any of the following conditions: -- The enumerator is positioned before the first element of the collection. That happens after an enumerator is created or after the method is called. The method must be called to advance the enumerator to the first element of the collection before reading the value of the property. +- The enumerator is positioned before the first element of the collection. That happens after an enumerator is created or after the method is called. The method must be called to advance the enumerator to the first element of the collection before reading the value of the property. -- The last call to returned `false`, which indicates the end of the collection and that the enumerator is positioned after the last element of the collection. +- The last call to returned `false`, which indicates the end of the collection and that the enumerator is positioned after the last element of the collection. - The enumerator is invalidated due to changes made in the collection, such as adding, modifying, or deleting elements. - does not move the position of the enumerator, and consecutive calls to return the same object until either or is called. + does not move the position of the enumerator, and consecutive calls to return the same object until either or is called. ]]> @@ -402,9 +402,9 @@ , you must call to advance the enumerator to the first element of the collection before reading the value of . + After calling , you must call to advance the enumerator to the first element of the collection before reading the value of . - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to throws an . ]]> diff --git a/xml/System.Collections.Generic/List`1.xml b/xml/System.Collections.Generic/List`1.xml index 8a1dee2ca71..f50bb56302c 100644 --- a/xml/System.Collections.Generic/List`1.xml +++ b/xml/System.Collections.Generic/List`1.xml @@ -178,17 +178,17 @@ is the number of elements that the can hold. As elements are added to a , the capacity is automatically increased as required by reallocating the internal array. + The capacity of a is the number of elements that the can hold. As elements are added to a , the capacity is automatically increased as required by reallocating the internal array. - If the size of the collection can be estimated, using the constructor and specifying the initial capacity eliminates the need to perform a number of resizing operations while adding elements to the . + If the size of the collection can be estimated, using the constructor and specifying the initial capacity eliminates the need to perform a number of resizing operations while adding elements to the . - The capacity can be decreased by calling the method or by setting the property explicitly. Decreasing the capacity reallocates memory and copies all the elements in the . + The capacity can be decreased by calling the method or by setting the property explicitly. Decreasing the capacity reallocates memory and copies all the elements in the . This constructor is an O(1) operation. ## Examples - The following example demonstrates the parameterless constructor of the generic class. The parameterless constructor creates a list with the default capacity, as demonstrated by displaying the property. + The following example demonstrates the parameterless constructor of the generic class. The parameterless constructor creates a list with the default capacity, as demonstrated by displaying the property. The example adds, inserts, and removes items, showing how the capacity changes as these methods are used. @@ -244,12 +244,12 @@ in the same order they are read by the enumerator of the collection. + The elements are copied onto the in the same order they are read by the enumerator of the collection. This constructor is an O(*n*) operation, where *n* is the number of elements in `collection`. ## Examples - The following example demonstrates the constructor and various methods of the class that act on ranges. An array of strings is created and passed to the constructor, populating the list with the elements of the array. The property is then displayed, to show that the initial capacity is exactly what is required to hold the input elements. + The following example demonstrates the constructor and various methods of the class that act on ranges. An array of strings is created and passed to the constructor, populating the list with the elements of the array. The property is then displayed, to show that the initial capacity is exactly what is required to hold the input elements. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/.ctor/source1.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/.ctor/source2.vb" id="Snippet1"::: @@ -312,11 +312,11 @@ is the number of elements that the can hold. As elements are added to a , the capacity is automatically increased as required by reallocating the internal array. + The capacity of a is the number of elements that the can hold. As elements are added to a , the capacity is automatically increased as required by reallocating the internal array. - If the size of the collection can be estimated, specifying the initial capacity eliminates the need to perform a number of resizing operations while adding elements to the . + If the size of the collection can be estimated, specifying the initial capacity eliminates the need to perform a number of resizing operations while adding elements to the . - The capacity can be decreased by calling the method or by setting the property explicitly. Decreasing the capacity reallocates memory and copies all the elements in the . + The capacity can be decreased by calling the method or by setting the property explicitly. Decreasing the capacity reallocates memory and copies all the elements in the . This constructor is an O(1) operation. @@ -324,7 +324,7 @@ > If `capacity` comes from user input, prefer using the parameterless constructor and letting the collection resize as elements are added. If you must use a user-specified value, either clamp it to a reasonable limit (for example, `Math.Clamp(untrustedValue, 0, 20)`) or verify that the element count matches the specified value. ## Examples - The following example demonstrates the constructor. A of strings with a capacity of 4 is created, because the ultimate size of the list is known to be exactly 4. The list is populated with four strings, and a read-only copy is created by using the method. + The following example demonstrates the constructor. A of strings with a capacity of 4 is created, because the ultimate size of the list is known to be exactly 4. The list is populated with four strings, and a read-only copy is created by using the method. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/.ctor/source.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/.ctor/source.vb" id="Snippet1"::: @@ -386,21 +386,21 @@ accepts `null` as a valid value for reference types and allows duplicate elements. + accepts `null` as a valid value for reference types and allows duplicate elements. - If already equals , the capacity of the is increased by automatically reallocating the internal array, and the existing elements are copied to the new array before the new element is added. + If already equals , the capacity of the is increased by automatically reallocating the internal array, and the existing elements are copied to the new array before the new element is added. - If is less than , this method is an O(1) operation. If the capacity needs to be increased to accommodate the new element, this method becomes an O(*n*) operation, where *n* is . + If is less than , this method is an O(1) operation. If the capacity needs to be increased to accommodate the new element, this method becomes an O(*n*) operation, where *n* is . ## Examples - The following example demonstrates how to add, remove, and insert a simple business object in a . + The following example demonstrates how to add, remove, and insert a simple business object in a . :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/Overview/program.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/Add/module1.vb" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.collections.generic.list.addremoveinsert/fs/addremoveinsert.fs" id="Snippet1"::: - The following example demonstrates several properties and methods of the generic class, including the method. The parameterless constructor is used to create a list of strings with a capacity of 0. The property is displayed, and then the method is used to add several items. The items are listed, and the property is displayed again, along with the property, to show that the capacity has been increased as needed. + The following example demonstrates several properties and methods of the generic class, including the method. The parameterless constructor is used to create a list of strings with a capacity of 0. The property is displayed, and then the method is used to add several items. The items are listed, and the property is displayed again, along with the property, to show that the capacity has been increased as needed. Other properties and methods are used to search for, insert, and remove elements from the list, and finally to clear the list. @@ -463,14 +463,14 @@ . + The order of the elements in the collection is preserved in the . - If the new (the current plus the size of the collection) will be greater than , the capacity of the is increased by automatically reallocating the internal array to accommodate the new elements, and the existing elements are copied to the new array before the new elements are added. + If the new (the current plus the size of the collection) will be greater than , the capacity of the is increased by automatically reallocating the internal array to accommodate the new elements, and the existing elements are copied to the new array before the new elements are added. - If the can accommodate the new elements without increasing the , this method is an O(*n*) operation, where *n* is the number of elements to be added. If the capacity needs to be increased to accommodate the new elements, this method becomes an O(*n* + *m*) operation, where *n* is the number of elements to be added and *m* is . + If the can accommodate the new elements without increasing the , this method is an O(*n*) operation, where *n* is the number of elements to be added. If the capacity needs to be increased to accommodate the new elements, this method becomes an O(*n* + *m*) operation, where *n* is the number of elements to be added and *m* is . ## Examples - The following example demonstrates the method and various other methods of the class that act on ranges. An array of strings is created and passed to the constructor, populating the list with the elements of the array. The method is called, with the list as its argument. The result is that the current elements of the list are added to the end of the list, duplicating all the elements. + The following example demonstrates the method and various other methods of the class that act on ranges. An array of strings is created and passed to the constructor, populating the list with the elements of the array. The method is called, with the list as its argument. The result is that the current elements of the list are added to the end of the list, duplicating all the elements. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/.ctor/source1.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/.ctor/source2.vb" id="Snippet1"::: @@ -532,14 +532,14 @@ object, expose it only through this wrapper. A object does not expose methods that modify the collection. However, if changes are made to the underlying object, the read-only collection reflects those changes. + To prevent any modifications to the object, expose it only through this wrapper. A object does not expose methods that modify the collection. However, if changes are made to the underlying object, the read-only collection reflects those changes. This method is an O(1) operation. ## Examples - The following example demonstrates the method. A of strings with a capacity of 4 is created, because the ultimate size of the list is known to be exactly 4. The list is populated with four strings, and the method is used to get a read-only generic interface implementation that wraps the original list. + The following example demonstrates the method. A of strings with a capacity of 4 is created, because the ultimate size of the list is known to be exactly 4. The list is populated with four strings, and the method is used to get a read-only generic interface implementation that wraps the original list. - An element of the original list is set to "Coelophysis" using the property (the indexer in C#), and the contents of the read-only list are displayed again to demonstrate that it is just a wrapper for the original list. + An element of the original list is set to "Coelophysis" using the property (the indexer in C#), and the contents of the read-only list are displayed again to demonstrate that it is just a wrapper for the original list. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/.ctor/source.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/.ctor/source.vb" id="Snippet1"::: @@ -607,22 +607,22 @@ for type `T` to determine the order of list elements. The property checks whether type `T` implements the generic interface and uses that implementation, if available. If not, checks whether type `T` implements the interface. If type `T` does not implement either interface, throws an . + This method uses the default comparer for type `T` to determine the order of list elements. The property checks whether type `T` implements the generic interface and uses that implementation, if available. If not, checks whether type `T` implements the interface. If type `T` does not implement either interface, throws an . - The must already be sorted according to the comparer implementation; otherwise, the result is incorrect. + The must already be sorted according to the comparer implementation; otherwise, the result is incorrect. - Comparing `null` with any reference type is allowed and does not generate an exception when using the generic interface. When sorting, `null` is considered to be less than any other object. + Comparing `null` with any reference type is allowed and does not generate an exception when using the generic interface. When sorting, `null` is considered to be less than any other object. - If the contains more than one element with the same value, the method returns only one of the occurrences, and it might return any one of the occurrences, not necessarily the first one. + If the contains more than one element with the same value, the method returns only one of the occurrences, and it might return any one of the occurrences, not necessarily the first one. - If the does not contain the specified value, the method returns a negative integer. You can apply the bitwise complement operation (~) to this negative integer to get the index of the first element that is larger than the search value. When inserting the value into the , this index should be used as the insertion point to maintain the sort order. + If the does not contain the specified value, the method returns a negative integer. You can apply the bitwise complement operation (~) to this negative integer to get the index of the first element that is larger than the search value. When inserting the value into the , this index should be used as the insertion point to maintain the sort order. This method is an O(log *n*) operation, where *n* is the number of elements in the range. ## Examples - The following example demonstrates the method overload and the method overload. A of strings is created and populated with four strings, in no particular order. The list is displayed, sorted, and displayed again. + The following example demonstrates the method overload and the method overload. A of strings is created and populated with four strings, in no particular order. The list is displayed, sorted, and displayed again. - The method overload is then used to search for two strings that are not in the list, and the method is used to insert them. The return value of the method is negative in each case, because the strings are not in the list. Taking the bitwise complement (the ~ operator in C#, `Xor` -1 in Visual Basic) of this negative number produces the index of the first element in the list that is larger than the search string, and inserting at this location preserves the sort order. The second search string is larger than any element in the list, so the insertion position is at the end of the list. + The method overload is then used to search for two strings that are not in the list, and the method is used to insert them. The return value of the method is negative in each case, because the strings are not in the list. Taking the bitwise complement (the ~ operator in C#, `Xor` -1 in Visual Basic) of this negative number produces the index of the first element in the list that is larger than the search string, and inserting at this location preserves the sort order. The second search string is larger than any element in the list, so the insertion position is at the end of the list. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/BinarySearch/source.cs" interactive="try-dotnet-method" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/BinarySearch/source.vb" id="Snippet1"::: @@ -697,28 +697,28 @@ ## Remarks The comparer customizes how the elements are compared. For example, you can use a instance as the comparer to perform case-insensitive string searches. - If `comparer` is provided, the elements of the are compared to the specified value using the specified implementation. + If `comparer` is provided, the elements of the are compared to the specified value using the specified implementation. - If `comparer` is `null`, the default comparer checks whether type `T` implements the generic interface and uses that implementation, if available. If not, checks whether type `T` implements the interface. If type `T` does not implement either interface, throws . + If `comparer` is `null`, the default comparer checks whether type `T` implements the generic interface and uses that implementation, if available. If not, checks whether type `T` implements the interface. If type `T` does not implement either interface, throws . - The must already be sorted according to the comparer implementation; otherwise, the result is incorrect. + The must already be sorted according to the comparer implementation; otherwise, the result is incorrect. - Comparing `null` with any reference type is allowed and does not generate an exception when using the generic interface. When sorting, `null` is considered to be less than any other object. + Comparing `null` with any reference type is allowed and does not generate an exception when using the generic interface. When sorting, `null` is considered to be less than any other object. - If the contains more than one element with the same value, the method returns only one of the occurrences, and it might return any one of the occurrences, not necessarily the first one. + If the contains more than one element with the same value, the method returns only one of the occurrences, and it might return any one of the occurrences, not necessarily the first one. - If the does not contain the specified value, the method returns a negative integer. You can apply the bitwise complement operation (~) to this negative integer to get the index of the first element that is larger than the search value. When inserting the value into the , this index should be used as the insertion point to maintain the sort order. + If the does not contain the specified value, the method returns a negative integer. You can apply the bitwise complement operation (~) to this negative integer to get the index of the first element that is larger than the search value. When inserting the value into the , this index should be used as the insertion point to maintain the sort order. This method is an O(log *n*) operation, where *n* is the number of elements in the range. ## Examples - The following example demonstrates the method overload and the method overload. + The following example demonstrates the method overload and the method overload. The example defines an alternative comparer for strings named DinoCompare, which implements the `IComparer` (`IComparer(Of String)` in Visual Basic) generic interface. The comparer works as follows: First, the comparands are tested for `null`, and a null reference is treated as less than a non-null. Second, the string lengths are compared, and the longer string is deemed to be greater. Third, if the lengths are equal, ordinary string comparison is used. - A of strings is created and populated with four strings, in no particular order. The list is displayed, sorted using the alternate comparer, and displayed again. + A of strings is created and populated with four strings, in no particular order. The list is displayed, sorted using the alternate comparer, and displayed again. - The method overload is then used to search for several strings that are not in the list, employing the alternate comparer. The method is used to insert the strings. These two methods are located in the function named `SearchAndInsert`, along with code to take the bitwise complement (the ~ operator in C#, `Xor` -1 in Visual Basic) of the negative number returned by and use it as an index for inserting the new string. + The method overload is then used to search for several strings that are not in the list, employing the alternate comparer. The method is used to insert the strings. These two methods are located in the function named `SearchAndInsert`, along with code to take the bitwise complement (the ~ operator in C#, `Xor` -1 in Visual Basic) of the negative number returned by and use it as an index for inserting the new string. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/BinarySearch/source1.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/BinarySearch/source1.vb" id="Snippet1"::: @@ -794,28 +794,28 @@ ## Remarks The comparer customizes how the elements are compared. For example, you can use a instance as the comparer to perform case-insensitive string searches. - If `comparer` is provided, the elements of the are compared to the specified value using the specified implementation. + If `comparer` is provided, the elements of the are compared to the specified value using the specified implementation. - If `comparer` is `null`, the default comparer checks whether type `T` implements the generic interface and uses that implementation, if available. If not, checks whether type `T` implements the interface. If type `T` does not implement either interface, throws . + If `comparer` is `null`, the default comparer checks whether type `T` implements the generic interface and uses that implementation, if available. If not, checks whether type `T` implements the interface. If type `T` does not implement either interface, throws . - The must already be sorted according to the comparer implementation; otherwise, the result is incorrect. + The must already be sorted according to the comparer implementation; otherwise, the result is incorrect. - Comparing `null` with any reference type is allowed and does not generate an exception when using the generic interface. When sorting, `null` is considered to be less than any other object. + Comparing `null` with any reference type is allowed and does not generate an exception when using the generic interface. When sorting, `null` is considered to be less than any other object. - If the contains more than one element with the same value, the method returns only one of the occurrences, and it might return any one of the occurrences, not necessarily the first one. + If the contains more than one element with the same value, the method returns only one of the occurrences, and it might return any one of the occurrences, not necessarily the first one. - If the does not contain the specified value, the method returns a negative integer. You can apply the bitwise complement operation (~) to this negative integer to get the index of the first element that is larger than the search value. When inserting the value into the , this index should be used as the insertion point to maintain the sort order. + If the does not contain the specified value, the method returns a negative integer. You can apply the bitwise complement operation (~) to this negative integer to get the index of the first element that is larger than the search value. When inserting the value into the , this index should be used as the insertion point to maintain the sort order. This method is an O(log *n*) operation, where *n* is the number of elements in the range. ## Examples - The following example demonstrates the method overload and the method overload. + The following example demonstrates the method overload and the method overload. The example defines an alternative comparer for strings named DinoCompare, which implements the `IComparer` (`IComparer(Of String)` in Visual Basic) generic interface. The comparer works as follows: First, the comparands are tested for `null`, and a null reference is treated as less than a non-null. Second, the string lengths are compared, and the longer string is deemed to be greater. Third, if the lengths are equal, ordinary string comparison is used. - A of strings is created and populated with the names of five herbivorous dinosaurs and three carnivorous dinosaurs. Within each of the two groups, the names are not in any particular sort order. The list is displayed, the range of herbivores is sorted using the alternate comparer, and the list is displayed again. + A of strings is created and populated with the names of five herbivorous dinosaurs and three carnivorous dinosaurs. Within each of the two groups, the names are not in any particular sort order. The list is displayed, the range of herbivores is sorted using the alternate comparer, and the list is displayed again. - The method overload is then used to search only the range of herbivores for "Brachiosaurus". The string is not found, and the bitwise complement (the ~ operator in C#, `Xor` -1 in Visual Basic) of the negative number returned by the method is used as an index for inserting the new string. + The method overload is then used to search only the range of herbivores for "Brachiosaurus". The string is not found, and the bitwise complement (the ~ operator in C#, `Xor` -1 in Visual Basic) of the negative number returned by the method is used as an index for inserting the new string. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/BinarySearch/source2.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/BinarySearch/source2.vb" id="Snippet1"::: @@ -887,24 +887,24 @@ is the number of elements that the can store before resizing is required, whereas is the number of elements that are actually in the . + is the number of elements that the can store before resizing is required, whereas is the number of elements that are actually in the . - is always greater than or equal to . If exceeds while adding elements, the capacity is increased by automatically reallocating the internal array before copying the old elements and adding the new elements. + is always greater than or equal to . If exceeds while adding elements, the capacity is increased by automatically reallocating the internal array before copying the old elements and adding the new elements. - If the capacity is significantly larger than the count and you want to reduce the memory used by the , you can decrease capacity by calling the method or by setting the property explicitly to a lower value. When the value of is set explicitly, the internal array is also reallocated to accommodate the specified capacity, and all the elements are copied. + If the capacity is significantly larger than the count and you want to reduce the memory used by the , you can decrease capacity by calling the method or by setting the property explicitly to a lower value. When the value of is set explicitly, the internal array is also reallocated to accommodate the specified capacity, and all the elements are copied. Retrieving the value of this property is an O(1) operation; setting the property is an O(*n*) operation, where *n* is the new capacity. ## Examples - The following example demonstrates how to check the capacity and count of a that contains a simple business object, and illustrates using the method to remove extra capacity. + The following example demonstrates how to check the capacity and count of a that contains a simple business object, and illustrates using the method to remove extra capacity. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/Capacity/program.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/Capacity/module1.vb" id="Snippet1"::: - The following example shows the property at several points in the life of a list. The parameterless constructor is used to create a list of strings with a capacity of 0, and the property is displayed to demonstrate this. After the method has been used to add several items, the items are listed, and then the property is displayed again, along with the property, to show that the capacity has been increased as needed. + The following example shows the property at several points in the life of a list. The parameterless constructor is used to create a list of strings with a capacity of 0, and the property is displayed to demonstrate this. After the method has been used to add several items, the items are listed, and then the property is displayed again, along with the property, to show that the capacity has been increased as needed. - The property is displayed again after the method is used to reduce the capacity to match the count. Finally, the method is used to remove all items from the list, and the and properties are displayed again. + The property is displayed again after the method is used to reduce the capacity to match the count. Finally, the method is used to remove all items from the list, and the and properties are displayed again. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/Overview/source.cs" interactive="try-dotnet-method" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/.ctor/source1.vb" id="Snippet1"::: @@ -966,15 +966,15 @@ is set to 0, and references to other objects from elements of the collection are also released. + is set to 0, and references to other objects from elements of the collection are also released. - remains unchanged. To reset the capacity of the , call the method or set the property directly. Decreasing the capacity reallocates memory and copies all the elements in the . Trimming an empty sets the capacity of the to the default capacity. + remains unchanged. To reset the capacity of the , call the method or set the property directly. Decreasing the capacity reallocates memory and copies all the elements in the . Trimming an empty sets the capacity of the to the default capacity. - This method is an O(*n*) operation, where *n* is . + This method is an O(*n*) operation, where *n* is . ## Examples - The following example demonstrates the method and various other properties and methods of the generic class. The method is used at the end of the program, to remove all items from the list, and the and properties are then displayed. + The following example demonstrates the method and various other properties and methods of the generic class. The method is used at the end of the program, to remove all items from the list, and the and properties are then displayed. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/Overview/source.cs" interactive="try-dotnet-method" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/.ctor/source1.vb" id="Snippet1"::: @@ -1039,17 +1039,17 @@ for `T`, the type of values in the list. + This method determines equality using the default equality comparer for `T`, the type of values in the list. - This method performs a linear search; therefore, this method is an O(*n*) operation, where *n* is . + This method performs a linear search; therefore, this method is an O(*n*) operation, where *n* is . ## Examples - The following example demonstrates the and methods on a that contains a simple business object that implements . + The following example demonstrates the and methods on a that contains a simple business object that implements . :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/Contains/program1.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/Contains/module1.vb" id="Snippet1"::: - The following example contains a list of complex objects of type `Cube`. The `Cube` class implements the method so that two cubes are considered equal if their dimensions are the same. In this example, the method returns `true`, because a cube that has the specified dimensions is already in the collection. + The following example contains a list of complex objects of type `Cube`. The `Cube` class implements the method so that two cubes are considered equal if their dimensions are the same. In this example, the method returns `true`, because a cube that has the specified dimensions is already in the collection. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/Contains/program.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/Contains/program.vb" id="Snippet1"::: @@ -1118,14 +1118,14 @@ is a delegate to a method that converts an object to the target type. The elements of the current are individually passed to the delegate, and the converted elements are saved in the new . + The is a delegate to a method that converts an object to the target type. The elements of the current are individually passed to the delegate, and the converted elements are saved in the new . - The current remains unchanged. + The current remains unchanged. - This method is an O(*n*) operation, where *n* is . + This method is an O(*n*) operation, where *n* is . ## Examples - The following example defines a method named `PointFToPoint` that converts a structure to a structure. The example then creates a of structures, creates a `Converter\` delegate (`Converter(Of PointF, Point)` in Visual Basic) to represent the `PointFToPoint` method, and passes the delegate to the method. The method passes each element of the input list to the `PointFToPoint` method and puts the converted elements into a new list of structures. Both lists are displayed. + The following example defines a method named `PointFToPoint` that converts a structure to a structure. The example then creates a of structures, creates a `Converter\` delegate (`Converter(Of PointF, Point)` in Visual Basic) to represent the `PointFToPoint` method, and passes the delegate to the method. The method passes each element of the input list to the `PointFToPoint` method and puts the converted elements into a new list of structures. Both lists are displayed. :::code language="csharp" source="~/snippets/csharp/System/ConverterTInput,TOutput/Overview/source.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/ConverterTInput,TOutput/Overview/source.vb" id="Snippet1"::: @@ -1150,7 +1150,7 @@ method. A of strings is created and populated with 5 strings. An empty string array of 15 elements is created, and the method overload is used to copy all the elements of the list to the array beginning at the first element of the array. The method overload is used to copy all the elements of the list to the array beginning at array index 6 (leaving index 5 empty). Finally, the method overload is used to copy 3 elements from the list, beginning with index 2, to the array beginning at array index 12 (leaving index 11 empty). The contents of the array are then displayed. + The following example demonstrates all three overloads of the method. A of strings is created and populated with 5 strings. An empty string array of 15 elements is created, and the method overload is used to copy all the elements of the list to the array beginning at the first element of the array. The method overload is used to copy all the elements of the list to the array beginning at array index 6 (leaving index 5 empty). Finally, the method overload is used to copy 3 elements from the list, beginning with index 2, to the array beginning at array index 12 (leaving index 11 empty). The contents of the array are then displayed. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/CopyTo/source.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/CopyTo/source.vb" id="Snippet1"::: @@ -1212,11 +1212,11 @@ to copy the elements. + This method uses to copy the elements. - The elements are copied to the in the same order in which the enumerator iterates through the . + The elements are copied to the in the same order in which the enumerator iterates through the . - This method is an O(*n*) operation, where *n* is . + This method is an O(*n*) operation, where *n* is . ]]> @@ -1277,11 +1277,11 @@ to copy the elements. + This method uses to copy the elements. - The elements are copied to the in the same order in which the enumerator iterates through the . + The elements are copied to the in the same order in which the enumerator iterates through the . - This method is an O(*n*) operation, where *n* is . + This method is an O(*n*) operation, where *n* is . ]]> @@ -1345,9 +1345,9 @@ to copy the elements. + This method uses to copy the elements. - The elements are copied to the in the same order in which the enumerator iterates through the . + The elements are copied to the in the same order in which the enumerator iterates through the . This method is an O(*n*) operation, where *n* is `count`. @@ -1422,20 +1422,20 @@ is the number of elements that the can store before resizing is required. is the number of elements that are actually in the . + is the number of elements that the can store before resizing is required. is the number of elements that are actually in the . - is always greater than or equal to . If exceeds while adding elements, the capacity is increased by automatically reallocating the internal array before copying the old elements and adding the new elements. + is always greater than or equal to . If exceeds while adding elements, the capacity is increased by automatically reallocating the internal array before copying the old elements and adding the new elements. Retrieving the value of this property is an O(1) operation. ## Examples - The following example demonstrates how to check the capacity and count of a that contains a simple business object, and illustrates using the method to remove extra capacity. + The following example demonstrates how to check the capacity and count of a that contains a simple business object, and illustrates using the method to remove extra capacity. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/Capacity/program.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/Capacity/module1.vb" id="Snippet1"::: - The following example shows the value of the property at various points in the life of a list. After the list has been created and populated and its elements displayed, the and properties are displayed. These properties are displayed again after the method has been called, and again after the contents of the list are cleared. + The following example shows the value of the property at various points in the life of a list. After the list has been created and populated and its elements displayed, the and properties are displayed. These properties are displayed again after the method has been called, and again after the contents of the list are cleared. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/Overview/source.cs" interactive="try-dotnet-method" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/.ctor/source1.vb" id="Snippet1"::: @@ -1540,23 +1540,23 @@ is a delegate to a method that returns `true` if the object passed to it matches the conditions defined in the delegate. The elements of the current are individually passed to the delegate, and processing is stopped when a match is found. + The is a delegate to a method that returns `true` if the object passed to it matches the conditions defined in the delegate. The elements of the current are individually passed to the delegate, and processing is stopped when a match is found. - This method performs a linear search; therefore, this method is an O(*n*) operation, where *n* is . + This method performs a linear search; therefore, this method is an O(*n*) operation, where *n* is . ## Examples - The following example demonstrates the and methods on a that contains a simple business object that implements . + The following example demonstrates the and methods on a that contains a simple business object that implements . :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/Contains/program1.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/Contains/module1.vb" id="Snippet1"::: - The following example demonstrates the method and several other methods that use the generic delegate. + The following example demonstrates the method and several other methods that use the generic delegate. - A of strings is created, containing 8 dinosaur names, two of which (at positions 1 and 5) end with "saurus". The example also defines a search predicate method named `EndsWithSaurus`, which accepts a string parameter and returns a Boolean value indicating whether the input string ends in "saurus". + A of strings is created, containing 8 dinosaur names, two of which (at positions 1 and 5) end with "saurus". The example also defines a search predicate method named `EndsWithSaurus`, which accepts a string parameter and returns a Boolean value indicating whether the input string ends in "saurus". - The , , and methods are used to search the list with the search predicate method, and then the method is used to remove all entries ending with "saurus". + The , , and methods are used to search the list with the search predicate method, and then the method is used to remove all entries ending with "saurus". - Finally, the method is called. It traverses the list from the beginning, passing each element in turn to the `EndsWithSaurus` method. The search stops and the method returns `true` if the `EndsWithSaurus` method returns `true` for any element. The method returns `false` because all such elements have been removed. + Finally, the method is called. It traverses the list from the beginning, passing each element in turn to the `EndsWithSaurus` method. The search stops and the method returns `true` if the `EndsWithSaurus` method returns `true` for any element. The method returns `false` because all such elements have been removed. > [!NOTE] > In C# and Visual Basic, it is not necessary to create the `Predicate` delegate (`Predicate(Of String)` in Visual Basic) explicitly. These languages infer the correct delegate from context and create it automatically. @@ -1629,32 +1629,32 @@ is a delegate to a method that returns `true` if the object passed to it matches the conditions defined in the delegate. The elements of the current are individually passed to the delegate, moving forward in the , starting with the first element and ending with the last element. Processing is stopped when a match is found. + The is a delegate to a method that returns `true` if the object passed to it matches the conditions defined in the delegate. The elements of the current are individually passed to the delegate, moving forward in the , starting with the first element and ending with the last element. Processing is stopped when a match is found. > [!IMPORTANT] -> When searching a list containing value types, make sure the default value for the type does not satisfy the search predicate. Otherwise, there is no way to distinguish between a default value indicating that no match was found and a list element that happens to have the default value for the type. If the default value satisfies the search predicate, use the method instead. +> When searching a list containing value types, make sure the default value for the type does not satisfy the search predicate. Otherwise, there is no way to distinguish between a default value indicating that no match was found and a list element that happens to have the default value for the type. If the default value satisfies the search predicate, use the method instead. - This method performs a linear search; therefore, this method is an O(*n*) operation, where *n* is . + This method performs a linear search; therefore, this method is an O(*n*) operation, where *n* is . ## Examples - The following example demonstrates the method on a that contains a simple complex object. + The following example demonstrates the method on a that contains a simple complex object. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/Contains/program1.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/Contains/module1.vb" id="Snippet1"::: - The following example demonstrates the find methods for the class. The example for the class contains `book` objects, of class `Book`, using the data from the [Sample XML File: Books (LINQ to XML)](/dotnet/standard/linq/sample-xml-file-books). The `FillList` method in the example uses [LINQ to XML](/dotnet/standard/linq/linq-xml-overview) to parse the values from the XML to property values of the `book` objects. + The following example demonstrates the find methods for the class. The example for the class contains `book` objects, of class `Book`, using the data from the [Sample XML File: Books (LINQ to XML)](/dotnet/standard/linq/sample-xml-file-books). The `FillList` method in the example uses [LINQ to XML](/dotnet/standard/linq/linq-xml-overview) to parse the values from the XML to property values of the `book` objects. The following table describes the examples provided for the find methods. |Method|Example| |------------|-------------| -||Finds a book by an ID using the `IDToFind` predicate delegate.

C# example uses an anonymous delegate.| -||Find all books that whose `Genre` property is "Computer" using the `FindComputer` predicate delegate.| -||Finds the last book in the collection that has a publish date before 2001, using the `PubBefore2001` predicate delegate.

C# example uses an anonymous delegate.| -||Finds the index of first computer book using the `FindComputer` predicate delegate.| -||Finds the index of the last computer book using the `FindComputer` predicate delegate.| -||Finds the index of first computer book in the second half of the collection, using the `FindComputer` predicate delegate.| -||Finds the index of last computer book in the second half of the collection, using the `FindComputer` predicate delegate.| +||Finds a book by an ID using the `IDToFind` predicate delegate.

C# example uses an anonymous delegate.| +||Find all books that whose `Genre` property is "Computer" using the `FindComputer` predicate delegate.| +||Finds the last book in the collection that has a publish date before 2001, using the `PubBefore2001` predicate delegate.

C# example uses an anonymous delegate.| +||Finds the index of first computer book using the `FindComputer` predicate delegate.| +||Finds the index of the last computer book using the `FindComputer` predicate delegate.| +||Finds the index of first computer book in the second half of the collection, using the `FindComputer` predicate delegate.| +||Finds the index of last computer book in the second half of the collection, using the `FindComputer` predicate delegate.| :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/Find/program.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/Find/module1.vb" id="Snippet1"::: @@ -1722,24 +1722,24 @@ is a delegate to a method that returns `true` if the object passed to it matches the conditions defined in the delegate. The elements of the current are individually passed to the delegate, and the elements that match the conditions are saved in the returned . + The is a delegate to a method that returns `true` if the object passed to it matches the conditions defined in the delegate. The elements of the current are individually passed to the delegate, and the elements that match the conditions are saved in the returned . - This method performs a linear search; therefore, this method is an O(*n*) operation, where *n* is . + This method performs a linear search; therefore, this method is an O(*n*) operation, where *n* is . ## Examples - The following example demonstrates the find methods for the class. The example for the class contains `book` objects, of class `Book`, using the data from the [Sample XML File: Books (LINQ to XML)](/dotnet/standard/linq/sample-xml-file-books). The `FillList` method in the example uses [LINQ to XML](/dotnet/standard/linq/linq-xml-overview) to parse the values from the XML to property values of the `book` objects. + The following example demonstrates the find methods for the class. The example for the class contains `book` objects, of class `Book`, using the data from the [Sample XML File: Books (LINQ to XML)](/dotnet/standard/linq/sample-xml-file-books). The `FillList` method in the example uses [LINQ to XML](/dotnet/standard/linq/linq-xml-overview) to parse the values from the XML to property values of the `book` objects. The following table describes the examples provided for the find methods. |Method|Example| |------------|-------------| -||Finds a book by an ID using the `IDToFind` predicate delegate.

C# example uses an anonymous delegate.| -||Find all books that whose `Genre` property is "Computer" using the `FindComputer` predicate delegate.| -||Finds the last book in the collection that has a publish date before 2001, using the `PubBefore2001` predicate delegate.

C# example uses an anonymous delegate.| -||Finds the index of first computer book using the `FindComputer` predicate delegate.| -||Finds the index of the last computer book using the `FindComputer` predicate delegate.| -||Finds the index of first computer book in the second half of the collection, using the `FindComputer` predicate delegate.| -||Finds the index of last computer book in the second half of the collection, using the `FindComputer` predicate delegate.| +||Finds a book by an ID using the `IDToFind` predicate delegate.

C# example uses an anonymous delegate.| +||Find all books that whose `Genre` property is "Computer" using the `FindComputer` predicate delegate.| +||Finds the last book in the collection that has a publish date before 2001, using the `PubBefore2001` predicate delegate.

C# example uses an anonymous delegate.| +||Finds the index of first computer book using the `FindComputer` predicate delegate.| +||Finds the index of the last computer book using the `FindComputer` predicate delegate.| +||Finds the index of first computer book in the second half of the collection, using the `FindComputer` predicate delegate.| +||Finds the index of last computer book in the second half of the collection, using the `FindComputer` predicate delegate.| :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/Find/program.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/Find/module1.vb" id="Snippet1"::: @@ -1818,9 +1818,9 @@ is searched forward starting at the first element and ending at the last element. + The is searched forward starting at the first element and ending at the last element. - The is a delegate to a method that returns `true` if the object passed to it matches the conditions defined in the delegate. The elements of the current are individually passed to the delegate. The delegate has the signature: + The is a delegate to a method that returns `true` if the object passed to it matches the conditions defined in the delegate. The elements of the current are individually passed to the delegate. The delegate has the signature: ```csharp public bool methodName(T obj) @@ -1830,7 +1830,7 @@ public bool methodName(T obj) Public Function methodName(obj As T) As Boolean ``` - This method performs a linear search; therefore, this method is an O(*n*) operation, where *n* is . + This method performs a linear search; therefore, this method is an O(*n*) operation, where *n* is . ## Examples The following example defines an `Employee` class with two fields, `Name` and `Id`. It also defines an `EmployeeSearch` class with a single method, `StartsWith`, that indicates whether the `Employee.Name` field starts with a specified substring that is supplied to the `EmployeeSearch` class constructor. Note the signature of this method @@ -1843,7 +1843,7 @@ public bool StartsWith(Employee e) Public Function StartsWith(e As Employee) As Boolean ``` - corresponds to the signature of the delegate that can be passed to the method. The example instantiates a `List` object, adds a number of `Employee` objects to it, and then calls the method twice to search the entire collection, the first time for the first `Employee` object whose `Name` field begins with "J", and the second time for the first `Employee` object whose `Name` field begins with "Ju". + corresponds to the signature of the delegate that can be passed to the method. The example instantiates a `List` object, adds a number of `Employee` objects to it, and then calls the method twice to search the entire collection, the first time for the first `Employee` object whose `Name` field begins with "J", and the second time for the first `Employee` object whose `Name` field begins with "Ju". :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/FindIndex/FindIndex2.cs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/FindIndex/FindIndex2.vb" id="Snippet2"::: @@ -1913,9 +1913,9 @@ Public Function StartsWith(e As Employee) As Boolean is searched forward starting at `startIndex` and ending at the last element. + The is searched forward starting at `startIndex` and ending at the last element. - The is a delegate to a method that returns `true` if the object passed to it matches the conditions defined in the delegate. The elements of the current are individually passed to the delegate. The delegate has the signature: + The is a delegate to a method that returns `true` if the object passed to it matches the conditions defined in the delegate. The elements of the current are individually passed to the delegate. The delegate has the signature: ```csharp public bool methodName(T obj) @@ -1925,7 +1925,7 @@ public bool methodName(T obj) Public Function methodName(obj As T) As Boolean ``` - This method performs a linear search; therefore, this method is an O(*n*) operation, where *n* is the number of elements from `startIndex` to the end of the . + This method performs a linear search; therefore, this method is an O(*n*) operation, where *n* is the number of elements from `startIndex` to the end of the . ## Examples The following example defines an `Employee` class with two fields, `Name` and `Id`. It also defines an `EmployeeSearch` class with a single method, `StartsWith`, that indicates whether the `Employee.Name` field starts with a specified substring that is supplied to the `EmployeeSearch` class constructor. Note the signature of this method @@ -1938,7 +1938,7 @@ public bool StartsWith(Employee e) Public Function StartsWith(e As Employee) As Boolean ``` - corresponds to the signature of the delegate that can be passed to the method. The example instantiates a `List` object, adds a number of `Employee` objects to it, and then calls the method twice to search the collection starting with its fifth member (that is, the member at index 4). The first time, it searches for the first `Employee` object whose `Name` field begins with "J"; the second time, it searches for the first `Employee` object whose `Name` field begins with "Ju". + corresponds to the signature of the delegate that can be passed to the method. The example instantiates a `List` object, adds a number of `Employee` objects to it, and then calls the method twice to search the collection starting with its fifth member (that is, the member at index 4). The first time, it searches for the first `Employee` object whose `Name` field begins with "J"; the second time, it searches for the first `Employee` object whose `Name` field begins with "Ju". :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/FindIndex/FindIndex3.cs" id="Snippet3"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/FindIndex/FindIndex3.vb" id="Snippet3"::: @@ -2012,9 +2012,9 @@ Public Function StartsWith(e As Employee) As Boolean is searched forward starting at `startIndex` and ending at `startIndex` plus `count` minus 1, if `count` is greater than 0. + The is searched forward starting at `startIndex` and ending at `startIndex` plus `count` minus 1, if `count` is greater than 0. - The is a delegate to a method that returns `true` if the object passed to it matches the conditions defined in the delegate. The elements of the current are individually passed to the delegate. The delegate has the signature: + The is a delegate to a method that returns `true` if the object passed to it matches the conditions defined in the delegate. The elements of the current are individually passed to the delegate. The delegate has the signature: ```csharp public bool methodName(T obj) @@ -2037,7 +2037,7 @@ public bool StartsWith(Employee e) Public Function StartsWith(e As Employee) As Boolean ``` - corresponds to the signature of the delegate that can be passed to the method. The example instantiates a `List` object, adds a number of `Employee` objects to it, and then calls the method twice to search the entire collection (that is, the members from index 0 to index - 1). The first time, it searches for the first `Employee` object whose `Name` field begins with "J"; the second time, it searches for the first `Employee` object whose `Name` field begins with "Ju". + corresponds to the signature of the delegate that can be passed to the method. The example instantiates a `List` object, adds a number of `Employee` objects to it, and then calls the method twice to search the entire collection (that is, the members from index 0 to index - 1). The first time, it searches for the first `Employee` object whose `Name` field begins with "J"; the second time, it searches for the first `Employee` object whose `Name` field begins with "Ju". :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/FindIndex/FindIndex1.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/FindIndex/FindIndex1.vb" id="Snippet1"::: @@ -2116,27 +2116,27 @@ Public Function StartsWith(e As Employee) As Boolean is a delegate to a method that returns `true` if the object passed to it matches the conditions defined in the delegate. The elements of the current are individually passed to the delegate, moving backward in the , starting with the last element and ending with the first element. Processing is stopped when a match is found. + The is a delegate to a method that returns `true` if the object passed to it matches the conditions defined in the delegate. The elements of the current are individually passed to the delegate, moving backward in the , starting with the last element and ending with the first element. Processing is stopped when a match is found. > [!IMPORTANT] -> When searching a list containing value types, make sure the default value for the type does not satisfy the search predicate. Otherwise, there is no way to distinguish between a default value indicating that no match was found and a list element that happens to have the default value for the type. If the default value satisfies the search predicate, use the method instead. +> When searching a list containing value types, make sure the default value for the type does not satisfy the search predicate. Otherwise, there is no way to distinguish between a default value indicating that no match was found and a list element that happens to have the default value for the type. If the default value satisfies the search predicate, use the method instead. - This method performs a linear search; therefore, this method is an O(*n*) operation, where *n* is . + This method performs a linear search; therefore, this method is an O(*n*) operation, where *n* is . ## Examples - The following example demonstrates the find methods for the class. The example for the class contains `book` objects, of class `Book`, using the data from the [Sample XML File: Books (LINQ to XML)](/dotnet/standard/linq/sample-xml-file-books). The `FillList` method in the example uses [LINQ to XML](/dotnet/standard/linq/linq-xml-overview) to parse the values from the XML to property values of the `book` objects. + The following example demonstrates the find methods for the class. The example for the class contains `book` objects, of class `Book`, using the data from the [Sample XML File: Books (LINQ to XML)](/dotnet/standard/linq/sample-xml-file-books). The `FillList` method in the example uses [LINQ to XML](/dotnet/standard/linq/linq-xml-overview) to parse the values from the XML to property values of the `book` objects. The following table describes the examples provided for the find methods. |Method|Example| |------------|-------------| -||Finds a book by an ID using the `IDToFind` predicate delegate.

C# example uses an anonymous delegate.| -||Find all books that whose `Genre` property is "Computer" using the `FindComputer` predicate delegate.| -||Finds the last book in the collection that has a publish date before 2001, using the `PubBefore2001` predicate delegate.

C# example uses an anonymous delegate.| -||Finds the index of first computer book using the `FindComputer` predicate delegate.| -||Finds the index of the last computer book using the `FindComputer` predicate delegate.| -||Finds the index of first computer book in the second half of the collection, using the `FindComputer` predicate delegate.| -||Finds the index of last computer book in the second half of the collection, using the `FindComputer` predicate delegate.| +||Finds a book by an ID using the `IDToFind` predicate delegate.

C# example uses an anonymous delegate.| +||Find all books that whose `Genre` property is "Computer" using the `FindComputer` predicate delegate.| +||Finds the last book in the collection that has a publish date before 2001, using the `PubBefore2001` predicate delegate.

C# example uses an anonymous delegate.| +||Finds the index of first computer book using the `FindComputer` predicate delegate.| +||Finds the index of the last computer book using the `FindComputer` predicate delegate.| +||Finds the index of first computer book in the second half of the collection, using the `FindComputer` predicate delegate.| +||Finds the index of last computer book in the second half of the collection, using the `FindComputer` predicate delegate.| :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/Find/program.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/Find/module1.vb" id="Snippet1"::: @@ -2215,26 +2215,26 @@ Public Function StartsWith(e As Employee) As Boolean is searched backward starting at the last element and ending at the first element. + The is searched backward starting at the last element and ending at the first element. - The is a delegate to a method that returns `true` if the object passed to it matches the conditions defined in the delegate. The elements of the current are individually passed to the delegate. + The is a delegate to a method that returns `true` if the object passed to it matches the conditions defined in the delegate. The elements of the current are individually passed to the delegate. - This method performs a linear search; therefore, this method is an O(*n*) operation, where *n* is . + This method performs a linear search; therefore, this method is an O(*n*) operation, where *n* is . ## Examples - The following example demonstrates the find methods for the class. The example for the class contains `book` objects, of class `Book`, using the data from the [Sample XML File: Books (LINQ to XML)](/dotnet/standard/linq/sample-xml-file-books). The `FillList` method in the example uses [LINQ to XML](/dotnet/standard/linq/linq-xml-overview) to parse the values from the XML to property values of the `book` objects. + The following example demonstrates the find methods for the class. The example for the class contains `book` objects, of class `Book`, using the data from the [Sample XML File: Books (LINQ to XML)](/dotnet/standard/linq/sample-xml-file-books). The `FillList` method in the example uses [LINQ to XML](/dotnet/standard/linq/linq-xml-overview) to parse the values from the XML to property values of the `book` objects. The following table describes the examples provided for the find methods. |Method|Example| |------------|-------------| -||Finds a book by an ID using the `IDToFind` predicate delegate.

C# example uses an anonymous delegate.| -||Find all books that whose `Genre` property is "Computer" using the `FindComputer` predicate delegate.| -||Finds the last book in the collection that has a publish date before 2001, using the `PubBefore2001` predicate delegate.

C# example uses an anonymous delegate.| -||Finds the index of first computer book using the `FindComputer` predicate delegate.| -||Finds the index of the last computer book using the `FindComputer` predicate delegate.| -||Finds the index of first computer book in the second half of the collection, using the `FindComputer` predicate delegate.| -||Finds the index of last computer book in the second half of the collection, using the `FindComputer` predicate delegate.| +||Finds a book by an ID using the `IDToFind` predicate delegate.

C# example uses an anonymous delegate.| +||Find all books that whose `Genre` property is "Computer" using the `FindComputer` predicate delegate.| +||Finds the last book in the collection that has a publish date before 2001, using the `PubBefore2001` predicate delegate.

C# example uses an anonymous delegate.| +||Finds the index of first computer book using the `FindComputer` predicate delegate.| +||Finds the index of the last computer book using the `FindComputer` predicate delegate.| +||Finds the index of first computer book in the second half of the collection, using the `FindComputer` predicate delegate.| +||Finds the index of last computer book in the second half of the collection, using the `FindComputer` predicate delegate.| :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/Find/program.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/Find/module1.vb" id="Snippet1"::: @@ -2304,11 +2304,11 @@ Public Function StartsWith(e As Employee) As Boolean is searched backward starting at `startIndex` and ending at the first element. + The is searched backward starting at `startIndex` and ending at the first element. - The is a delegate to a method that returns `true` if the object passed to it matches the conditions defined in the delegate. The elements of the current are individually passed to the delegate. + The is a delegate to a method that returns `true` if the object passed to it matches the conditions defined in the delegate. The elements of the current are individually passed to the delegate. - This method performs a linear search; therefore, this method is an O(*n*) operation, where *n* is the number of elements from the beginning of the to `startIndex`. + This method performs a linear search; therefore, this method is an O(*n*) operation, where *n* is the number of elements from the beginning of the to `startIndex`. ]]> @@ -2379,26 +2379,26 @@ Public Function StartsWith(e As Employee) As Boolean is searched backward starting at `startIndex` and ending at `startIndex` minus `count` plus 1, if `count` is greater than 0. + The is searched backward starting at `startIndex` and ending at `startIndex` minus `count` plus 1, if `count` is greater than 0. - The is a delegate to a method that returns `true` if the object passed to it matches the conditions defined in the delegate. The elements of the current are individually passed to the delegate. + The is a delegate to a method that returns `true` if the object passed to it matches the conditions defined in the delegate. The elements of the current are individually passed to the delegate. This method performs a linear search; therefore, this method is an O(*n*) operation, where *n* is `count`. ## Examples - The following example demonstrates the find methods for the class. The example for the class contains `book` objects, of class `Book`, using the data from the [Sample XML File: Books (LINQ to XML)](/dotnet/standard/linq/sample-xml-file-books). The `FillList` method in the example uses [LINQ to XML](/dotnet/standard/linq/linq-xml-overview) to parse the values from the XML to property values of the `book` objects. + The following example demonstrates the find methods for the class. The example for the class contains `book` objects, of class `Book`, using the data from the [Sample XML File: Books (LINQ to XML)](/dotnet/standard/linq/sample-xml-file-books). The `FillList` method in the example uses [LINQ to XML](/dotnet/standard/linq/linq-xml-overview) to parse the values from the XML to property values of the `book` objects. The following table describes the examples provided for the find methods. |Method|Example| |------------|-------------| -||Finds a book by an ID using the `IDToFind` predicate delegate.

C# example uses an anonymous delegate.| -||Find all books that whose `Genre` property is "Computer" using the `FindComputer` predicate delegate.| -||Finds the last book in the collection that has a publish date before 2001, using the `PubBefore2001` predicate delegate.

C# example uses an anonymous delegate.| -||Finds the index of first computer book using the `FindComputer` predicate delegate.| -||Finds the index of the last computer book using the `FindComputer` predicate delegate.| -||Finds the index of first computer book in the second half of the collection, using the `FindComputer` predicate delegate.| -||Finds the index of last computer book in the second half of the collection, using the `FindComputer` predicate delegate.| +||Finds a book by an ID using the `IDToFind` predicate delegate.

C# example uses an anonymous delegate.| +||Find all books that whose `Genre` property is "Computer" using the `FindComputer` predicate delegate.| +||Finds the last book in the collection that has a publish date before 2001, using the `PubBefore2001` predicate delegate.

C# example uses an anonymous delegate.| +||Finds the index of first computer book using the `FindComputer` predicate delegate.| +||Finds the index of the last computer book using the `FindComputer` predicate delegate.| +||Finds the index of first computer book in the second half of the collection, using the `FindComputer` predicate delegate.| +||Finds the index of last computer book in the second half of the collection, using the `FindComputer` predicate delegate.| :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/Find/program.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/Find/module1.vb" id="Snippet1"::: @@ -2474,14 +2474,14 @@ Public Function StartsWith(e As Employee) As Boolean is a delegate to a method that performs an action on the object passed to it. The elements of the current are individually passed to the delegate. + The is a delegate to a method that performs an action on the object passed to it. The elements of the current are individually passed to the delegate. - This method is an O(*n*) operation, where *n* is . + This method is an O(*n*) operation, where *n* is . - Modifying the underlying collection in the body of the delegate is not supported and causes undefined behavior. + Modifying the underlying collection in the body of the delegate is not supported and causes undefined behavior. ## Examples - The following example demonstrates the use of the delegate to print the contents of a object. In this example the `Print` method is used to display the contents of the list to the console. + The following example demonstrates the use of the delegate to print the contents of a object. In this example the `Print` method is used to display the contents of the list to the console. > [!NOTE] > In addition to displaying the contents using the `Print` method, the C# example demonstrates the use of [anonymous methods](/dotnet/csharp/programming-guide/statements-expressions-operators/anonymous-methods) to display the results to the console. @@ -2552,13 +2552,13 @@ Public Function StartsWith(e As Employee) As Boolean Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection. - Initially, the enumerator is positioned before the first element in the collection. At this position, the property is undefined. Therefore, you must call the method to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. At this position, the property is undefined. Therefore, you must call the method to advance the enumerator to the first element of the collection before reading the value of . - The property returns the same object until is called. sets to the next element. + The property returns the same object until is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator instance instead. + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator instance instead. - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization. @@ -2631,7 +2631,7 @@ Public Function StartsWith(e As Employee) As Boolean This method is an O(*n*) operation, where *n* is `count`. ## Examples - The following example demonstrates the method and other methods of the class that act on ranges. At the end of the example, the method is used to get three items from the list, beginning with index location 2. The method is called on the resulting , creating an array of three elements. The elements of the array are displayed. + The following example demonstrates the method and other methods of the class that act on ranges. At the end of the example, the method is used to get three items from the list, beginning with index location 2. The method is called on the resulting , creating an array of three elements. The elements of the array are displayed. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/.ctor/source1.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/.ctor/source2.vb" id="Snippet1"::: @@ -2664,7 +2664,7 @@ Public Function StartsWith(e As Employee) As Boolean method. A of strings is created, with one entry that appears twice, at index location 0 and index location 5. The method overload searches the list from the beginning, and finds the first occurrence of the string. The method overload is used to search the list beginning with index location 3 and continuing to the end of the list, and finds the second occurrence of the string. Finally, the method overload is used to search a range of two entries, beginning at index location two; it returns -1 because there are no instances of the search string in that range. + The following example demonstrates all three overloads of the method. A of strings is created, with one entry that appears twice, at index location 0 and index location 5. The method overload searches the list from the beginning, and finds the first occurrence of the string. The method overload is used to search the list beginning with index location 3 and continuing to the end of the list, and finds the second occurrence of the string. Finally, the method overload is used to search a range of two entries, beginning at index location two; it returns -1 because there are no instances of the search string in that range. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/IndexOf/source.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/IndexOf/source.vb" id="Snippet1"::: @@ -2730,11 +2730,11 @@ Public Function StartsWith(e As Employee) As Boolean is searched forward starting at the first element and ending at the last element. + The is searched forward starting at the first element and ending at the last element. - This method determines equality using the default equality comparer for `T`, the type of values in the list. + This method determines equality using the default equality comparer for `T`, the type of values in the list. - This method performs a linear search; therefore, this method is an O(*n*) operation, where *n* is . + This method performs a linear search; therefore, this method is an O(*n*) operation, where *n* is . ]]> @@ -2793,11 +2793,11 @@ Public Function StartsWith(e As Employee) As Boolean is searched forward starting at `index` and ending at the last element. + The is searched forward starting at `index` and ending at the last element. - This method determines equality using the default equality comparer for `T`, the type of values in the list. + This method determines equality using the default equality comparer for `T`, the type of values in the list. - This method performs a linear search; therefore, this method is an O(*n*) operation, where *n* is the number of elements from `index` to the end of the . + This method performs a linear search; therefore, this method is an O(*n*) operation, where *n* is the number of elements from `index` to the end of the . ]]> @@ -2860,9 +2860,9 @@ Public Function StartsWith(e As Employee) As Boolean is searched forward starting at `index` and ending at `index` plus `count` minus 1, if `count` is greater than 0. + The is searched forward starting at `index` and ending at `index` plus `count` minus 1, if `count` is greater than 0. - This method determines equality using the default equality comparer for `T`, the type of values in the list. + This method determines equality using the default equality comparer for `T`, the type of values in the list. This method performs a linear search; therefore, this method is an O(*n*) operation, where *n* is `count`. @@ -2935,23 +2935,23 @@ Public Function StartsWith(e As Employee) As Boolean accepts `null` as a valid value for reference types and allows duplicate elements. + accepts `null` as a valid value for reference types and allows duplicate elements. - If already equals , the capacity of the is increased by automatically reallocating the internal array, and the existing elements are copied to the new array before the new element is added. + If already equals , the capacity of the is increased by automatically reallocating the internal array, and the existing elements are copied to the new array before the new element is added. - If `index` is equal to , `item` is added to the end of . + If `index` is equal to , `item` is added to the end of . - This method is an O(*n*) operation, where *n* is . + This method is an O(*n*) operation, where *n* is . ## Examples - The following example demonstrates how to add, remove, and insert a simple business object in a . + The following example demonstrates how to add, remove, and insert a simple business object in a . :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/Overview/program.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/Add/module1.vb" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.collections.generic.list.addremoveinsert/fs/addremoveinsert.fs" id="Snippet1"::: - The following example demonstrates the method, along with various other properties and methods of the generic class. After the list is created, elements are added. The method is used to insert an item into the middle of the list. The item inserted is a duplicate, which is later removed using the method. + The following example demonstrates the method, along with various other properties and methods of the generic class. After the list is created, elements are added. The method is used to insert an item into the middle of the list. The item inserted is a duplicate, which is later removed using the method. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/Overview/source.cs" interactive="try-dotnet-method" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/.ctor/source1.vb" id="Snippet1"::: @@ -3019,18 +3019,18 @@ Public Function StartsWith(e As Employee) As Boolean accepts `null` as a valid value for reference types and allows duplicate elements. + accepts `null` as a valid value for reference types and allows duplicate elements. - If the new (the current plus the size of the collection) will be greater than , the capacity of the is increased by automatically reallocating the internal array to accommodate the new elements, and the existing elements are copied to the new array before the new elements are added. + If the new (the current plus the size of the collection) will be greater than , the capacity of the is increased by automatically reallocating the internal array to accommodate the new elements, and the existing elements are copied to the new array before the new elements are added. - If `index` is equal to , the elements are added to the end of . + If `index` is equal to , the elements are added to the end of . - The order of the elements in the collection is preserved in the . + The order of the elements in the collection is preserved in the . - This method is an O(*n* * *m*) operation, where *n* is the number of elements to be added and *m* is . + This method is an O(*n* * *m*) operation, where *n* is the number of elements to be added and *m* is . ## Examples - The following example demonstrates method and various other methods of the class that act on ranges. After the list has been created and populated with the names of several peaceful plant-eating dinosaurs, the method is used to insert an array of three ferocious meat-eating dinosaurs into the list, beginning at index location 3. + The following example demonstrates method and various other methods of the class that act on ranges. After the list has been created and populated with the names of several peaceful plant-eating dinosaurs, the method is used to insert an array of three ferocious meat-eating dinosaurs into the list, beginning at index location 3. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/.ctor/source1.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/.ctor/source2.vb" id="Snippet1"::: @@ -3112,19 +3112,19 @@ Public Function StartsWith(e As Employee) As Boolean accepts `null` as a valid value for reference types and allows duplicate elements. + accepts `null` as a valid value for reference types and allows duplicate elements. This property provides the ability to access a specific element in the collection by using the following syntax: `myCollection[index]`. Retrieving the value of this property is an O(1) operation; setting the property is also an O(1) operation. ## Examples - The example in this section demonstrates the property (the indexer in C#) and various other properties and methods of the generic class. After the list has been created and populated using the method, an element is retrieved and displayed using the property. (For an example that uses the property to set the value of a list element, see .) + The example in this section demonstrates the property (the indexer in C#) and various other properties and methods of the generic class. After the list has been created and populated using the method, an element is retrieved and displayed using the property. (For an example that uses the property to set the value of a list element, see .) > [!NOTE] -> Visual Basic, C#, and C++ all have syntax for accessing the property without using its name. Instead, the variable containing the is used as if it were an array. +> Visual Basic, C#, and C++ all have syntax for accessing the property without using its name. Instead, the variable containing the is used as if it were an array. - The C# language uses the [`this`](/dotnet/csharp/language-reference/keywords/this) keyword to define the indexers instead of implementing the property. Visual Basic implements as a default property, which provides the same indexing functionality. + The C# language uses the [`this`](/dotnet/csharp/language-reference/keywords/this) keyword to define the indexers instead of implementing the property. Visual Basic implements as a default property, which provides the same indexing functionality. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/Overview/source.cs" interactive="try-dotnet-method" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/.ctor/source1.vb" id="Snippet2"::: @@ -3155,7 +3155,7 @@ Public Function StartsWith(e As Employee) As Boolean method. A of strings is created, with one entry that appears twice, at index location 0 and index location 5. The method overload searches the entire list from the end, and finds the second occurrence of the string. The method overload is used to search the list backward beginning with index location 3 and continuing to the beginning of the list, so it finds the first occurrence of the string in the list. Finally, the method overload is used to search a range of four entries, beginning at index location 4 and extending backward (that is, it searches the items at locations 4, 3, 2, and 1); this search returns -1 because there are no instances of the search string in that range. + The following example demonstrates all three overloads of the method. A of strings is created, with one entry that appears twice, at index location 0 and index location 5. The method overload searches the entire list from the end, and finds the second occurrence of the string. The method overload is used to search the list backward beginning with index location 3 and continuing to the beginning of the list, so it finds the first occurrence of the string in the list. Finally, the method overload is used to search a range of four entries, beginning at index location 4 and extending backward (that is, it searches the items at locations 4, 3, 2, and 1); this search returns -1 because there are no instances of the search string in that range. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/LastIndexOf/source.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/LastIndexOf/source.vb" id="Snippet1"::: @@ -3212,11 +3212,11 @@ Public Function StartsWith(e As Employee) As Boolean is searched backward starting at the last element and ending at the first element. + The is searched backward starting at the last element and ending at the first element. - This method determines equality using the default equality comparer for `T`, the type of values in the list. + This method determines equality using the default equality comparer for `T`, the type of values in the list. - This method performs a linear search; therefore, this method is an O(*n*) operation, where *n* is . + This method performs a linear search; therefore, this method is an O(*n*) operation, where *n* is . ]]> @@ -3275,11 +3275,11 @@ Public Function StartsWith(e As Employee) As Boolean is searched backward starting at `index` and ending at the first element. + The is searched backward starting at `index` and ending at the first element. - This method determines equality using the default equality comparer for `T`, the type of values in the list. + This method determines equality using the default equality comparer for `T`, the type of values in the list. - This method performs a linear search; therefore, this method is an O(*n*) operation, where *n* is the number of elements from the beginning of the to `index`. + This method performs a linear search; therefore, this method is an O(*n*) operation, where *n* is the number of elements from the beginning of the to `index`. ]]> @@ -3342,9 +3342,9 @@ Public Function StartsWith(e As Employee) As Boolean is searched backward starting at `index` and ending at `index` minus `count` plus 1, if `count` is greater than 0. + The is searched backward starting at `index` and ending at `index` minus `count` plus 1, if `count` is greater than 0. - This method determines equality using the default equality comparer for `T`, the type of values in the list. + This method determines equality using the default equality comparer for `T`, the type of values in the list. This method performs a linear search; therefore, this method is an O(*n*) operation, where *n* is `count`. @@ -3423,19 +3423,19 @@ Public Function StartsWith(e As Employee) As Boolean for `T`, the type of values in the list. + This method determines equality using the default equality comparer for `T`, the type of values in the list. - This method performs a linear search; therefore, this method is an O(*n*) operation, where *n* is . + This method performs a linear search; therefore, this method is an O(*n*) operation, where *n* is . ## Examples - The following example demonstrates how to add, remove, and insert a simple business object in a . + The following example demonstrates how to add, remove, and insert a simple business object in a . :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/Overview/program.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/Add/module1.vb" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.collections.generic.list.addremoveinsert/fs/addremoveinsert.fs" id="Snippet1"::: - The following example demonstrates method. Several properties and methods of the generic class are used to add, insert, and search the list. After these operations, the list contains a duplicate. The method is used to remove the first instance of the duplicate item, and the contents are displayed. The method always removes the first instance it encounters. + The following example demonstrates method. Several properties and methods of the generic class are used to add, insert, and search the list. After these operations, the list contains a duplicate. The method is used to remove the first instance of the duplicate item, and the contents are displayed. The method always removes the first instance it encounters. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/Overview/source.cs" interactive="try-dotnet-method" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/.ctor/source1.vb" id="Snippet1"::: @@ -3498,23 +3498,23 @@ Public Function StartsWith(e As Employee) As Boolean is a delegate to a method that returns `true` if the object passed to it matches the conditions defined in the delegate. The elements of the current are individually passed to the delegate, and the elements that match the conditions are removed from the . + The is a delegate to a method that returns `true` if the object passed to it matches the conditions defined in the delegate. The elements of the current are individually passed to the delegate, and the elements that match the conditions are removed from the . - This method performs a linear search; therefore, this method is an O(*n*) operation, where *n* is . + This method performs a linear search; therefore, this method is an O(*n*) operation, where *n* is . ## Examples - The following example demonstrates the method and several other methods that use the generic delegate. + The following example demonstrates the method and several other methods that use the generic delegate. - A of strings is created, containing 8 dinosaur names, two of which (at positions 1 and 5) end with "saurus". The example also defines a search predicate method named `EndsWithSaurus`, which accepts a string parameter and returns a Boolean value indicating whether the input string ends in "saurus". + A of strings is created, containing 8 dinosaur names, two of which (at positions 1 and 5) end with "saurus". The example also defines a search predicate method named `EndsWithSaurus`, which accepts a string parameter and returns a Boolean value indicating whether the input string ends in "saurus". - The , , and methods are used to search the list with the search predicate method. + The , , and methods are used to search the list with the search predicate method. - The method is used to remove all entries ending with "saurus". It traverses the list from the beginning, passing each element in turn to the `EndsWithSaurus` method. The element is removed if the `EndsWithSaurus` method returns `true`. + The method is used to remove all entries ending with "saurus". It traverses the list from the beginning, passing each element in turn to the `EndsWithSaurus` method. The element is removed if the `EndsWithSaurus` method returns `true`. > [!NOTE] > In C# and Visual Basic, it is not necessary to create the `Predicate` delegate (`Predicate(Of String)` in Visual Basic) explicitly. These languages infer the correct delegate from context, and create it automatically. - Finally, the method verifies that there are no strings in the list that end with "saurus". + Finally, the method verifies that there are no strings in the list that end with "saurus". :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/Exists/source.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/Exists/source.vb" id="Snippet1"::: @@ -3581,12 +3581,12 @@ Public Function StartsWith(e As Employee) As Boolean to remove an item, the remaining items in the list are renumbered to replace the removed item. For example, if you remove the item at index 3, the item at index 4 is moved to the 3 position. In addition, the number of items in the list (as represented by the property) is reduced by 1. + When you call to remove an item, the remaining items in the list are renumbered to replace the removed item. For example, if you remove the item at index 3, the item at index 4 is moved to the 3 position. In addition, the number of items in the list (as represented by the property) is reduced by 1. - This method is an O(*n*) operation, where *n* is ( - `index`). + This method is an O(*n*) operation, where *n* is ( - `index`). ## Examples - The following example demonstrates how to add, remove, and insert a simple business object in a . + The following example demonstrates how to add, remove, and insert a simple business object in a . :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/Overview/program.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/Add/module1.vb" id="Snippet1"::: @@ -3655,12 +3655,12 @@ Public Function StartsWith(e As Employee) As Boolean have their indexes reduced by `count`. + The items are removed and all the elements following them in the have their indexes reduced by `count`. - This method is an O(*n*) operation, where *n* is . + This method is an O(*n*) operation, where *n* is . ## Examples - The following example demonstrates the method and various other methods of the class that act on ranges. After the list has been created and modified, the method is used to remove two elements from the list, beginning at index location 2. + The following example demonstrates the method and various other methods of the class that act on ranges. After the list has been created and modified, the method is used to remove two elements from the list, beginning at index location 2. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/.ctor/source1.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/.ctor/source2.vb" id="Snippet1"::: @@ -3695,7 +3695,7 @@ Public Function StartsWith(e As Employee) As Boolean method. The example creates a of strings and adds six strings. The method overload is used to reverse the list, and then the method overload is used to reverse the middle of the list, beginning with element 1 and encompassing four elements. + The following example demonstrates both overloads of the method. The example creates a of strings and adds six strings. The method overload is used to reverse the list, and then the method overload is used to reverse the middle of the list, beginning with element 1 and encompassing four elements. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/Reverse/source.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/Reverse/source.vb" id="Snippet1"::: @@ -3748,9 +3748,9 @@ Public Function StartsWith(e As Employee) As Boolean to reverse the order of the elements. + This method uses to reverse the order of the elements. - This method is an O(*n*) operation, where *n* is . + This method is an O(*n*) operation, where *n* is . ]]> @@ -3805,9 +3805,9 @@ Public Function StartsWith(e As Employee) As Boolean to reverse the order of the elements. + This method uses to reverse the order of the elements. - This method is an O(*n*) operation, where *n* is . + This method is an O(*n*) operation, where *n* is . ]]> @@ -3919,9 +3919,9 @@ Public Function StartsWith(e As Employee) As Boolean for type `T` to determine the order of list elements. The property checks whether type `T` implements the generic interface and uses that implementation, if available. If not, checks whether type `T` implements the interface. If type `T` does not implement either interface, throws an . + This method uses the default comparer for type `T` to determine the order of list elements. The property checks whether type `T` implements the generic interface and uses that implementation, if available. If not, checks whether type `T` implements the interface. If type `T` does not implement either interface, throws an . - This method uses the method, which applies the introspective sort as follows: + This method uses the method, which applies the introspective sort as follows: - If the partition size is less than or equal to 16 elements, it uses an insertion sort algorithm. @@ -3931,23 +3931,23 @@ Public Function StartsWith(e As Employee) As Boolean This implementation performs an unstable sort; that is, if two elements are equal, their order might not be preserved. In contrast, a stable sort preserves the order of elements that are equal. - This method is an O(*n* log *n*) operation, where *n* is . + This method is an O(*n* log *n*) operation, where *n* is . ## Examples - The following example adds some names to a `List` object, displays the list in unsorted order, calls the method, and then displays the sorted list. + The following example adds some names to a `List` object, displays the list in unsorted order, calls the method, and then displays the sorted list. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/Sort/Sort1.cs" interactive="try-dotnet-method" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/Sort/Sort1.vb" id="Snippet2"::: - The following code demonstrates the and method overloads on a simple business object. Calling the method results in the use of the default comparer for the Part type, and the method is implemented by using an anonymous method. + The following code demonstrates the and method overloads on a simple business object. Calling the method results in the use of the default comparer for the Part type, and the method is implemented by using an anonymous method. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/Sort/program.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/Sort/module1.vb" id="Snippet1"::: - The following example demonstrates the method overload and the method overload. A of strings is created and populated with four strings, in no particular order. The list is displayed, sorted, and displayed again. + The following example demonstrates the method overload and the method overload. A of strings is created and populated with four strings, in no particular order. The list is displayed, sorted, and displayed again. - The method overload is then used to search for two strings that are not in the list, and the method is used to insert them. The return value of the method is negative in each case, because the strings are not in the list. Taking the bitwise complement (the ~ operator in C#, `Xor` -1 in Visual Basic) of this negative number produces the index of the first element in the list that is larger than the search string, and inserting at this location preserves the sort order. The second search string is larger than any element in the list, so the insertion position is at the end of the list. + The method overload is then used to search for two strings that are not in the list, and the method is used to insert them. The return value of the method is negative in each case, because the strings are not in the list. Taking the bitwise complement (the ~ operator in C#, `Xor` -1 in Visual Basic) of this negative number produces the index of the first element in the list that is larger than the search string, and inserting at this location preserves the sort order. The second search string is larger than any element in the list, so the insertion position is at the end of the list. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/BinarySearch/source.cs" interactive="try-dotnet-method" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/BinarySearch/source.vb" id="Snippet1"::: @@ -4013,11 +4013,11 @@ Public Function StartsWith(e As Employee) As Boolean are sorted using the specified implementation. + If `comparer` is provided, the elements of the are sorted using the specified implementation. - If `comparer` is `null`, the default comparer checks whether type `T` implements the generic interface and uses that implementation, if available. If not, checks whether type `T` implements the interface. If type `T` does not implement either interface, throws an . + If `comparer` is `null`, the default comparer checks whether type `T` implements the generic interface and uses that implementation, if available. If not, checks whether type `T` implements the interface. If type `T` does not implement either interface, throws an . - This method uses the method, which applies the introspective sort as follows: + This method uses the method, which applies the introspective sort as follows: - If the partition size is less than or equal to 16 elements, it uses an insertion sort algorithm. @@ -4027,16 +4027,16 @@ Public Function StartsWith(e As Employee) As Boolean This implementation performs an unstable sort; that is, if two elements are equal, their order might not be preserved. In contrast, a stable sort preserves the order of elements that are equal. - This method is an O(*n* log *n*) operation, where *n* is . + This method is an O(*n* log *n*) operation, where *n* is . ## Examples - The following example demonstrates the method overload and the method overload. + The following example demonstrates the method overload and the method overload. The example defines an alternative comparer for strings named DinoCompare, which implements the `IComparer` (`IComparer(Of String)` in Visual Basic) generic interface. The comparer works as follows: First, the comparands are tested for `null`, and a null reference is treated as less than a non-null. Second, the string lengths are compared, and the longer string is deemed to be greater. Third, if the lengths are equal, ordinary string comparison is used. - A of strings is created and populated with four strings, in no particular order. The list is displayed, sorted using the alternate comparer, and displayed again. + A of strings is created and populated with four strings, in no particular order. The list is displayed, sorted using the alternate comparer, and displayed again. - The method overload is then used to search for several strings that are not in the list, employing the alternate comparer. The method is used to insert the strings. These two methods are located in the function named `SearchAndInsert`, along with code to take the bitwise complement (the ~ operator in C#, `Xor` -1 in Visual Basic) of the negative number returned by and use it as an index for inserting the new string. + The method overload is then used to search for several strings that are not in the list, employing the alternate comparer. The method is used to insert the strings. These two methods are located in the function named `SearchAndInsert`, along with code to take the bitwise complement (the ~ operator in C#, `Xor` -1 in Visual Basic) of the negative number returned by and use it as an index for inserting the new string. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/BinarySearch/source1.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/BinarySearch/source1.vb" id="Snippet1"::: @@ -4096,11 +4096,11 @@ Public Function StartsWith(e As Employee) As Boolean are sorted using the method represented by the delegate. + If `comparison` is provided, the elements of the are sorted using the method represented by the delegate. If `comparison` is `null`, an is thrown. - This method uses , which applies the introspective sort as follows: + This method uses , which applies the introspective sort as follows: - If the partition size is less than or equal to 16 elements, it uses an insertion sort algorithm @@ -4110,19 +4110,19 @@ Public Function StartsWith(e As Employee) As Boolean This implementation performs an unstable sort; that is, if two elements are equal, their order might not be preserved. In contrast, a stable sort preserves the order of elements that are equal. - This method is an O(*n* log *n*) operation, where *n* is . + This method is an O(*n* log *n*) operation, where *n* is . ## Examples - The following code demonstrates the and method overloads on a simple business object. Calling the method results in the use of the default comparer for the Part type, and the method is implemented using an anonymous method. + The following code demonstrates the and method overloads on a simple business object. Calling the method results in the use of the default comparer for the Part type, and the method is implemented using an anonymous method. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/Sort/program.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/Sort/module1.vb" id="Snippet1"::: - The following example demonstrates the method overload. + The following example demonstrates the method overload. The example defines an alternative comparison method for strings, named `CompareDinosByLength`. This method works as follows: First, the comparands are tested for `null`, and a null reference is treated as less than a non-null. Second, the string lengths are compared, and the longer string is deemed to be greater. Third, if the lengths are equal, ordinary string comparison is used. - A of strings is created and populated with four strings, in no particular order. The list also includes an empty string and a null reference. The list is displayed, sorted using a generic delegate representing the `CompareDinosByLength` method, and displayed again. + A of strings is created and populated with four strings, in no particular order. The list also includes an empty string and a null reference. The list is displayed, sorted using a generic delegate representing the `CompareDinosByLength` method, and displayed again. :::code language="csharp" source="~/snippets/csharp/System/ComparisonT/Overview/source.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/ComparisonT/Overview/source.vb" id="Snippet1"::: @@ -4195,11 +4195,11 @@ Public Function StartsWith(e As Employee) As Boolean are sorted using the specified implementation. + If `comparer` is provided, the elements of the are sorted using the specified implementation. - If `comparer` is `null`, the default comparer checks whether type `T` implements the generic interface and uses that implementation, if available. If not, checks whether type `T` implements the interface. If type `T` does not implement either interface, throws an . + If `comparer` is `null`, the default comparer checks whether type `T` implements the generic interface and uses that implementation, if available. If not, checks whether type `T` implements the interface. If type `T` does not implement either interface, throws an . - This method uses , which applies the introspective sort as follows: + This method uses , which applies the introspective sort as follows: - If the partition size is less than or equal to 16 elements, it uses an insertion sort algorithm @@ -4209,16 +4209,16 @@ Public Function StartsWith(e As Employee) As Boolean This implementation performs an unstable sort; that is, if two elements are equal, their order might not be preserved. In contrast, a stable sort preserves the order of elements that are equal. - This method is an O(*n* log *n*) operation, where *n* is . + This method is an O(*n* log *n*) operation, where *n* is . ## Examples - The following example demonstrates the method overload and the method overload. + The following example demonstrates the method overload and the method overload. The example defines an alternative comparer for strings named DinoCompare, which implements the `IComparer` (`IComparer(Of String)` in Visual Basic) generic interface. The comparer works as follows: First, the comparands are tested for `null`, and a null reference is treated as less than a non-null. Second, the string lengths are compared, and the longer string is deemed to be greater. Third, if the lengths are equal, ordinary string comparison is used. - A of strings is created and populated with the names of five herbivorous dinosaurs and three carnivorous dinosaurs. Within each of the two groups, the names are not in any particular sort order. The list is displayed, the range of herbivores is sorted using the alternate comparer, and the list is displayed again. + A of strings is created and populated with the names of five herbivorous dinosaurs and three carnivorous dinosaurs. Within each of the two groups, the names are not in any particular sort order. The list is displayed, the range of herbivores is sorted using the alternate comparer, and the list is displayed again. - The method overload is then used to search only the range of herbivores for "Brachiosaurus". The string is not found, and the bitwise complement (the ~ operator in C#, `Xor` -1 in Visual Basic) of the negative number returned by the method is used as an index for inserting the new string. + The method overload is then used to search only the range of herbivores for "Brachiosaurus". The string is not found, and the bitwise complement (the ~ operator in C#, `Xor` -1 in Visual Basic) of the negative number returned by the method is used as an index for inserting the new string. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/BinarySearch/source2.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/BinarySearch/source2.vb" id="Snippet1"::: @@ -4364,13 +4364,13 @@ Public Function StartsWith(e As Employee) As Boolean Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection. - Initially, the enumerator is positioned before the first element in the collection. At this position, the property is undefined. Therefore, you must call the method to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. At this position, the property is undefined. Therefore, you must call the method to advance the enumerator to the first element of the collection before reading the value of . - The property returns the same object until is called. sets to the next element. + The property returns the same object until is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator instance instead. + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator instance instead. - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization. @@ -4443,9 +4443,9 @@ Public Function StartsWith(e As Employee) As Boolean ## Remarks > [!NOTE] -> If the type of the source cannot be cast automatically to the type of the destination `array`, the nongeneric implementations of throw , whereas the generic implementations throw . +> If the type of the source cannot be cast automatically to the type of the destination `array`, the nongeneric implementations of throw , whereas the generic implementations throw . - This method is an O(*n*) operation, where *n* is . + This method is an O(*n*) operation, where *n* is . ]]> @@ -4521,7 +4521,7 @@ Public Function StartsWith(e As Employee) As Boolean Enumerating through a collection is intrinsically not a thread-safe procedure. In the rare case where enumeration contends with write accesses, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization. - returns an object that can be used to synchronize access to the . Synchronization is effective only if all threads lock this object before accessing the collection. + returns an object that can be used to synchronize access to the . Synchronization is effective only if all threads lock this object before accessing the collection. Retrieving the value of this property is an O(1) operation. @@ -4581,7 +4581,7 @@ Public Function StartsWith(e As Employee) As Boolean Enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization. - returns an object that can be used to synchronize access to the . Synchronization is effective only if all threads lock this object before accessing the collection. The following code shows the use of the property. + returns an object that can be used to synchronize access to the . Synchronization is effective only if all threads lock this object before accessing the collection. The following code shows the use of the property. ```csharp ICollection ic = ...; @@ -4663,13 +4663,13 @@ Retrieving the value of this property is an O(1) operation. Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection. - Initially, the enumerator is positioned before the first element in the collection. also brings the enumerator back to this position. At this position, the property is undefined. Therefore, you must call the method to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. also brings the enumerator back to this position. At this position, the property is undefined. Therefore, you must call the method to advance the enumerator to the first element of the collection before reading the value of . - The property returns the same object until either or is called. sets to the next element. + The property returns the same object until either or is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. To set to the first element of the collection again, you can call followed by . + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. To set to the first element of the collection again, you can call followed by . - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization. @@ -4733,7 +4733,7 @@ Retrieving the value of this property is an O(1) operation. is less than , this method is an O(1) operation. If the capacity needs to be increased to accommodate the new element, this method becomes an O(*n*) operation, where *n* is . + If is less than , this method is an O(1) operation. If the capacity needs to be increased to accommodate the new element, this method becomes an O(*n*) operation, where *n* is . ]]> @@ -4799,9 +4799,9 @@ Retrieving the value of this property is an O(1) operation. for `T`, the type of values in the list. + This method determines equality using the default equality comparer for `T`, the type of values in the list. - This method performs a linear search; therefore, this method is an O(*n*) operation, where *n* is . + This method performs a linear search; therefore, this method is an O(*n*) operation, where *n* is . ]]> @@ -4868,9 +4868,9 @@ Retrieving the value of this property is an O(1) operation. for `T`, the type of values in the list. + This method determines equality using the default equality comparer for `T`, the type of values in the list. - This method performs a linear search; therefore, this method is an O(*n*) operation, where *n* is . + This method performs a linear search; therefore, this method is an O(*n*) operation, where *n* is . ]]> @@ -4932,7 +4932,7 @@ Retrieving the value of this property is an O(1) operation. ## Remarks If `index` equals the number of items in the , then `item` is appended to the end. - This method is an O(*n*) operation, where *n* is . + This method is an O(*n*) operation, where *n* is . ]]> @@ -5122,7 +5122,7 @@ Retrieving the value of this property is an O(1) operation. property. Visual Basic implements as a default property, which provides the same indexing functionality. + The C# language uses the [this](/dotnet/csharp/language-reference/keywords/this) keyword to define the indexers instead of implementing the property. Visual Basic implements as a default property, which provides the same indexing functionality. Retrieving the value of this property is an O(1) operation; setting the property is also an O(1) operation. @@ -5189,9 +5189,9 @@ Retrieving the value of this property is an O(1) operation. for `T`, the type of values in the list. + This method determines equality using the default equality comparer for `T`, the type of values in the list. - This method performs a linear search; therefore, this method is an O(*n*) operation, where *n* is . + This method performs a linear search; therefore, this method is an O(*n*) operation, where *n* is . ]]> @@ -5244,12 +5244,12 @@ Retrieving the value of this property is an O(1) operation. , which is an O(*n*) operation, where *n* is . + The elements are copied using , which is an O(*n*) operation, where *n* is . - This method is an O(*n*) operation, where *n* is . + This method is an O(*n*) operation, where *n* is . ## Examples - The following example demonstrates the method and other methods of the class that act on ranges. At the end of the example, the method is used to get three items from the list, beginning with index location 2. The method is called on the resulting , creating an array of three elements. The elements of the array are displayed. + The following example demonstrates the method and other methods of the class that act on ranges. At the end of the example, the method is used to get three items from the list, beginning with index location 2. The method is called on the resulting , creating an array of three elements. The elements of the array are displayed. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/.ctor/source1.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/.ctor/source2.vb" id="Snippet1"::: @@ -5302,25 +5302,25 @@ Retrieving the value of this property is an O(1) operation. can be considerable, however, so the method does nothing if the list is at more than 90 percent of capacity. This avoids incurring a large reallocation cost for a relatively small gain. + This method can be used to minimize a collection's memory overhead if no new elements will be added to the collection. The cost of reallocating and copying a large can be considerable, however, so the method does nothing if the list is at more than 90 percent of capacity. This avoids incurring a large reallocation cost for a relatively small gain. > [!NOTE] > The current threshold of 90 percent might change in future releases. - This method is an O(*n*) operation, where *n* is . + This method is an O(*n*) operation, where *n* is . - To reset a to its initial state, call the method before calling the method. Trimming an empty sets the capacity of the to the default capacity. + To reset a to its initial state, call the method before calling the method. Trimming an empty sets the capacity of the to the default capacity. - The capacity can also be set using the property. + The capacity can also be set using the property. ## Examples - The following example demonstrates how to check the capacity and count of a that contains a simple business object, and illustrates using the method to remove extra capacity. + The following example demonstrates how to check the capacity and count of a that contains a simple business object, and illustrates using the method to remove extra capacity. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/Capacity/program.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/Capacity/module1.vb" id="Snippet1"::: - The following example demonstrates the method. Several properties and methods of the class are used to add, insert, and remove items from a list of strings. Then the method is used to reduce the capacity to match the count, and the and properties are displayed. If the unused capacity had been less than 10 percent of total capacity, the list would not have been resized. Finally, the contents of the list are cleared. + The following example demonstrates the method. Several properties and methods of the class are used to add, insert, and remove items from a list of strings. Then the method is used to reduce the capacity to match the count, and the and properties are displayed. If the unused capacity had been less than 10 percent of total capacity, the list would not have been resized. Finally, the contents of the list are cleared. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/ListT/Overview/source.cs" interactive="try-dotnet-method" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/ListT/.ctor/source1.vb" id="Snippet1"::: @@ -5382,16 +5382,16 @@ Retrieving the value of this property is an O(1) operation. is a delegate to a method that returns `true` if the object passed to it matches the conditions defined in the delegate. The elements of the current are individually passed to the delegate, and processing is stopped when the delegate returns `false` for any element. The elements are processed in order, and all calls are made on a single thread. + The is a delegate to a method that returns `true` if the object passed to it matches the conditions defined in the delegate. The elements of the current are individually passed to the delegate, and processing is stopped when the delegate returns `false` for any element. The elements are processed in order, and all calls are made on a single thread. - This method is an O(*n*) operation, where *n* is . + This method is an O(*n*) operation, where *n* is . ## Examples - The following example demonstrates the method and several other methods that use generic delegate. + The following example demonstrates the method and several other methods that use generic delegate. - A of strings is created, containing 8 dinosaur names, two of which (at positions 1 and 5) end with "saurus". The example also defines a search predicate method named `EndsWithSaurus`, which accepts a string parameter and returns a Boolean value indicating whether the input string ends in "saurus". + A of strings is created, containing 8 dinosaur names, two of which (at positions 1 and 5) end with "saurus". The example also defines a search predicate method named `EndsWithSaurus`, which accepts a string parameter and returns a Boolean value indicating whether the input string ends in "saurus". - The method traverses the list from the beginning, passing each element in turn to the `EndsWithSaurus` method. The search stops when the `EndsWithSaurus` method returns `false`. + The method traverses the list from the beginning, passing each element in turn to the `EndsWithSaurus` method. The search stops when the `EndsWithSaurus` method returns `false`. > [!NOTE] > In C# and Visual Basic, it is not necessary to create the `Predicate` delegate (`Predicate(Of String)` in Visual Basic) explicitly. These languages infer the correct delegate from context and create it automatically. diff --git a/xml/System.Collections.Generic/Queue`1+Enumerator.xml b/xml/System.Collections.Generic/Queue`1+Enumerator.xml index 7b28b55a958..5b2e47983ed 100644 --- a/xml/System.Collections.Generic/Queue`1+Enumerator.xml +++ b/xml/System.Collections.Generic/Queue`1+Enumerator.xml @@ -83,13 +83,13 @@ Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection. - Initially, the enumerator is positioned before the first element in the collection. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . - returns the same object until is called. sets to the next element. + returns the same object until is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator instance instead. + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator instance instead. - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization. @@ -154,15 +154,15 @@ is undefined under any of the following conditions: + is undefined under any of the following conditions: -- The enumerator is positioned before the first element of the collection. That happens after an enumerator is created or after the method is called. The method must be called to advance the enumerator to the first element of the collection before reading the value of the property. +- The enumerator is positioned before the first element of the collection. That happens after an enumerator is created or after the method is called. The method must be called to advance the enumerator to the first element of the collection before reading the value of the property. -- The last call to returned `false`, which indicates the end of the collection and that the enumerator is positioned after the last element of the collection. +- The last call to returned `false`, which indicates the end of the collection and that the enumerator is positioned after the last element of the collection. - The enumerator is invalidated due to changes made in the collection, such as adding, modifying, or deleting elements. - does not move the position of the enumerator, and consecutive calls to return the same object until either or is called. + does not move the position of the enumerator, and consecutive calls to return the same object until either or is called. ]]> @@ -266,11 +266,11 @@ advances the enumerator to the first element of the collection. + After an enumerator is created, the enumerator is positioned before the first element in the collection, and the first call to advances the enumerator to the first element of the collection. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . ]]> @@ -333,15 +333,15 @@ ## Remarks - is undefined under any of the following conditions: + is undefined under any of the following conditions: -- The enumerator is positioned before the first element of the collection. That happens after an enumerator is created or after the method is called. The method must be called to advance the enumerator to the first element of the collection before reading the value of the property. +- The enumerator is positioned before the first element of the collection. That happens after an enumerator is created or after the method is called. The method must be called to advance the enumerator to the first element of the collection before reading the value of the property. -- The last call to returned `false`, which indicates the end of the collection and that the enumerator is positioned after the last element of the collection. +- The last call to returned `false`, which indicates the end of the collection and that the enumerator is positioned after the last element of the collection. - The enumerator is invalidated due to changes made in the collection, such as adding, modifying, or deleting elements. - does not move the position of the enumerator, and consecutive calls to return the same object until either or is called. + does not move the position of the enumerator, and consecutive calls to return the same object until either or is called. ]]> @@ -397,7 +397,7 @@ or throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . ]]> diff --git a/xml/System.Collections.Generic/Queue`1.xml b/xml/System.Collections.Generic/Queue`1.xml index adddf34e1dc..3886d58e152 100644 --- a/xml/System.Collections.Generic/Queue`1.xml +++ b/xml/System.Collections.Generic/Queue`1.xml @@ -105,30 +105,30 @@ are inserted at one end and removed from the other. Queues and stacks are useful when you need temporary storage for information; that is, when you might want to discard an element after retrieving its value. Use if you need to access the information in the same order that it is stored in the collection. Use if you need to access the information in reverse order. Use or if you need to access the collection from multiple threads concurrently. + This class implements a generic queue as a circular array. Objects stored in a are inserted at one end and removed from the other. Queues and stacks are useful when you need temporary storage for information; that is, when you might want to discard an element after retrieving its value. Use if you need to access the information in the same order that it is stored in the collection. Use if you need to access the information in reverse order. Use or if you need to access the collection from multiple threads concurrently. - Three main operations can be performed on a and its elements: + Three main operations can be performed on a and its elements: -- adds an element to the end of the . +- adds an element to the end of the . -- removes the oldest element from the start of the . +- removes the oldest element from the start of the . -- peek returns the oldest element that is at the start of the but does not remove it from the . +- peek returns the oldest element that is at the start of the but does not remove it from the . - The capacity of a is the number of elements the can hold. As elements are added to a , the capacity is automatically increased as required by reallocating the internal array. The capacity can be decreased by calling . + The capacity of a is the number of elements the can hold. As elements are added to a , the capacity is automatically increased as required by reallocating the internal array. The capacity can be decreased by calling . - accepts `null` as a valid value for reference types and allows duplicate elements. + accepts `null` as a valid value for reference types and allows duplicate elements. ## Examples - The following code example demonstrates several methods of the generic class. The code example creates a queue of strings with default capacity and uses the method to queue five strings. The elements of the queue are enumerated, which does not change the state of the queue. The method is used to dequeue the first string. The method is used to look at the next item in the queue, and then the method is used to dequeue it. + The following code example demonstrates several methods of the generic class. The code example creates a queue of strings with default capacity and uses the method to queue five strings. The elements of the queue are enumerated, which does not change the state of the queue. The method is used to dequeue the first string. The method is used to look at the next item in the queue, and then the method is used to dequeue it. - The method is used to create an array and copy the queue elements to it, then the array is passed to the constructor that takes , creating a copy of the queue. The elements of the copy are displayed. + The method is used to create an array and copy the queue elements to it, then the array is passed to the constructor that takes , creating a copy of the queue. The elements of the copy are displayed. - An array twice the size of the queue is created, and the method is used to copy the array elements beginning at the middle of the array. The constructor is used again to create a second copy of the queue containing three null elements at the beginning. + An array twice the size of the queue is created, and the method is used to copy the array elements beginning at the middle of the array. The constructor is used again to create a second copy of the queue containing three null elements at the beginning. - The method is used to show that the string "four" is in the first copy of the queue, after which the method clears the copy and the property shows that the queue is empty. + The method is used to show that the string "four" is in the first copy of the queue, after which the method clears the copy and the property shows that the queue is empty. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/QueueT/Overview/source.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/QueueT/Overview/source.fs" id="Snippet1"::: @@ -155,13 +155,13 @@ generic class. The code example creates a queue of strings with default capacity and uses the method to queue five strings. The elements of the queue are enumerated, which does not change the state of the queue. The method is used to dequeue the first string. The method is used to look at the next item in the queue, and then the method is used to dequeue it. + The following code example demonstrates this constructor and several other methods of the generic class. The code example creates a queue of strings with default capacity and uses the method to queue five strings. The elements of the queue are enumerated, which does not change the state of the queue. The method is used to dequeue the first string. The method is used to look at the next item in the queue, and then the method is used to dequeue it. - The method is used to create an array and copy the queue elements to it, then the array is passed to the constructor that takes , creating a copy of the queue. The elements of the copy are displayed. + The method is used to create an array and copy the queue elements to it, then the array is passed to the constructor that takes , creating a copy of the queue. The elements of the copy are displayed. - An array twice the size of the queue is created, and the method is used to copy the array elements beginning at the middle of the array. The constructor is used again to create a second copy of the queue containing three null elements at the beginning. + An array twice the size of the queue is created, and the method is used to copy the array elements beginning at the middle of the array. The constructor is used again to create a second copy of the queue containing three null elements at the beginning. - The method is used to show that the string "four" is in the first copy of the queue, after which the method clears the copy and the property shows that the queue is empty. + The method is used to show that the string "four" is in the first copy of the queue, after which the method clears the copy and the property shows that the queue is empty. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/QueueT/Overview/source.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/QueueT/Overview/source.fs" id="Snippet1"::: @@ -211,11 +211,11 @@ is the number of elements that the can hold. As elements are added to a , the capacity is automatically increased as required by reallocating the internal array. + The capacity of a is the number of elements that the can hold. As elements are added to a , the capacity is automatically increased as required by reallocating the internal array. - If the size of the collection can be estimated, specifying the initial capacity eliminates the need to perform a number of resizing operations while adding elements to the . + If the size of the collection can be estimated, specifying the initial capacity eliminates the need to perform a number of resizing operations while adding elements to the . - The capacity can be decreased by calling . + The capacity can be decreased by calling . This constructor is an O(1) operation. @@ -267,13 +267,13 @@ is the number of elements that the can hold. As elements are added to a , the capacity is automatically increased as required by reallocating the internal array. + The capacity of a is the number of elements that the can hold. As elements are added to a , the capacity is automatically increased as required by reallocating the internal array. - If the size of the collection can be estimated, specifying the initial capacity eliminates the need to perform a number of resizing operations while adding elements to the . + If the size of the collection can be estimated, specifying the initial capacity eliminates the need to perform a number of resizing operations while adding elements to the . - The capacity can be decreased by calling . + The capacity can be decreased by calling . - The elements are copied onto the in the same order they are read by the of the collection. + The elements are copied onto the in the same order they are read by the of the collection. This constructor is an O(`n`) operation, where `n` is the number of elements in `collection`. @@ -327,11 +327,11 @@ is the number of elements that the can hold. As elements are added to a , the capacity is automatically increased as required by reallocating the internal array. + The capacity of a is the number of elements that the can hold. As elements are added to a , the capacity is automatically increased as required by reallocating the internal array. - If the size of the collection can be estimated, specifying the initial capacity eliminates the need to perform a number of resizing operations while adding elements to the . + If the size of the collection can be estimated, specifying the initial capacity eliminates the need to perform a number of resizing operations while adding elements to the . - The capacity can be decreased by calling . + The capacity can be decreased by calling . This constructor is an O(`n`) operation, where `n` is `capacity`. @@ -417,24 +417,24 @@ is set to zero, and references to other objects from elements of the collection are also released. + is set to zero, and references to other objects from elements of the collection are also released. - The capacity remains unchanged. To reset the capacity of the , call . Trimming an empty sets the capacity of the to the default capacity. + The capacity remains unchanged. To reset the capacity of the , call . Trimming an empty sets the capacity of the to the default capacity. - This method is an O(`n`) operation, where `n` is . + This method is an O(`n`) operation, where `n` is . ## Examples - The following code example demonstrates several methods of the generic class, including the method. + The following code example demonstrates several methods of the generic class, including the method. - The code example creates a queue of strings with default capacity and uses the method to queue five strings. The elements of the queue are enumerated, which does not change the state of the queue. The method is used to dequeue the first string. The method is used to look at the next item in the queue, and then the method is used to dequeue it. + The code example creates a queue of strings with default capacity and uses the method to queue five strings. The elements of the queue are enumerated, which does not change the state of the queue. The method is used to dequeue the first string. The method is used to look at the next item in the queue, and then the method is used to dequeue it. - The method is used to create an array and copy the queue elements to it, then the array is passed to the constructor that takes , creating a copy of the queue. The elements of the copy are displayed. + The method is used to create an array and copy the queue elements to it, then the array is passed to the constructor that takes , creating a copy of the queue. The elements of the copy are displayed. - An array twice the size of the queue is created, and the method is used to copy the array elements beginning at the middle of the array. The constructor is used again to create a second copy of the queue containing three null elements at the beginning. + An array twice the size of the queue is created, and the method is used to copy the array elements beginning at the middle of the array. The constructor is used again to create a second copy of the queue containing three null elements at the beginning. - The method is used to show that the string "four" is in the first copy of the queue, after which the method clears the copy and the property shows that the queue is empty. + The method is used to show that the string "four" is in the first copy of the queue, after which the method clears the copy and the property shows that the queue is empty. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/QueueT/Overview/source.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/QueueT/Overview/source.fs" id="Snippet1"::: @@ -494,22 +494,22 @@ for `T`, the type of values in the queue. + This method determines equality using the default equality comparer for `T`, the type of values in the queue. - This method performs a linear search; therefore, this method is an O(`n`) operation, where `n` is . + This method performs a linear search; therefore, this method is an O(`n`) operation, where `n` is . ## Examples - The following code example demonstrates several methods of the generic class, including the method. + The following code example demonstrates several methods of the generic class, including the method. - The code example creates a queue of strings with default capacity and uses the method to queue five strings. The elements of the queue are enumerated, which does not change the state of the queue. The method is used to dequeue the first string. The method is used to look at the next item in the queue, and then the method is used to dequeue it. + The code example creates a queue of strings with default capacity and uses the method to queue five strings. The elements of the queue are enumerated, which does not change the state of the queue. The method is used to dequeue the first string. The method is used to look at the next item in the queue, and then the method is used to dequeue it. - The method is used to create an array and copy the queue elements to it, then the array is passed to the constructor that takes , creating a copy of the queue. The elements of the copy are displayed. + The method is used to create an array and copy the queue elements to it, then the array is passed to the constructor that takes , creating a copy of the queue. The elements of the copy are displayed. - An array twice the size of the queue is created, and the method is used to copy the array elements beginning at the middle of the array. The constructor is used again to create a second copy of the queue containing three null elements at the beginning. + An array twice the size of the queue is created, and the method is used to copy the array elements beginning at the middle of the array. The constructor is used again to create a second copy of the queue containing three null elements at the beginning. - The method is used to show that the string "four" is in the first copy of the queue, after which the method clears the copy and the property shows that the queue is empty. + The method is used to show that the string "four" is in the first copy of the queue, after which the method clears the copy and the property shows that the queue is empty. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/QueueT/Overview/source.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/QueueT/Overview/source.fs" id="Snippet1"::: @@ -569,9 +569,9 @@ in the same order in which the enumerator iterates through the . + The elements are copied to the in the same order in which the enumerator iterates through the . - This method is an O(`n`) operation, where `n` is . + This method is an O(`n`) operation, where `n` is . ]]> @@ -636,24 +636,24 @@ is the number of elements that the can store. is the number of elements that are actually in the . + The capacity of a is the number of elements that the can store. is the number of elements that are actually in the . - The capacity is always greater than or equal to . If exceeds the capacity while adding elements, the capacity is increased by automatically reallocating the internal array before copying the old elements and adding the new elements. + The capacity is always greater than or equal to . If exceeds the capacity while adding elements, the capacity is increased by automatically reallocating the internal array before copying the old elements and adding the new elements. Retrieving the value of this property is an O(1) operation. ## Examples - The following code example demonstrates several properties and methods of the generic class, including the property. + The following code example demonstrates several properties and methods of the generic class, including the property. - The code example creates a queue of strings with default capacity and uses the method to queue five strings. The elements of the queue are enumerated, which does not change the state of the queue. The method is used to dequeue the first string. The method is used to look at the next item in the queue, and then the method is used to dequeue it. + The code example creates a queue of strings with default capacity and uses the method to queue five strings. The elements of the queue are enumerated, which does not change the state of the queue. The method is used to dequeue the first string. The method is used to look at the next item in the queue, and then the method is used to dequeue it. - The method is used to create an array and copy the queue elements to it, then the array is passed to the constructor that takes , creating a copy of the queue. The elements of the copy are displayed. + The method is used to create an array and copy the queue elements to it, then the array is passed to the constructor that takes , creating a copy of the queue. The elements of the copy are displayed. - An array twice the size of the queue is created, and the method is used to copy the array elements beginning at the middle of the array. The constructor is used again to create a second copy of the queue containing three null elements at the beginning. + An array twice the size of the queue is created, and the method is used to copy the array elements beginning at the middle of the array. The constructor is used again to create a second copy of the queue containing three null elements at the beginning. - The method is used to show that the string "four" is in the first copy of the queue, after which the method clears the copy and the property shows that the queue is empty. + The method is used to show that the string "four" is in the first copy of the queue, after which the method clears the copy and the property shows that the queue is empty. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/QueueT/Overview/source.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/QueueT/Overview/source.fs" id="Snippet1"::: @@ -708,24 +708,24 @@ method, but does not modify the . + This method is similar to the method, but does not modify the . - If type `T` is a reference type, `null` can be added to the as a value. + If type `T` is a reference type, `null` can be added to the as a value. This method is an O(1) operation. ## Examples - The following code example demonstrates several methods of the generic class, including the method. + The following code example demonstrates several methods of the generic class, including the method. - The code example creates a queue of strings with default capacity and uses the method to queue five strings. The elements of the queue are enumerated, which does not change the state of the queue. The method is used to dequeue the first string. The method is used to look at the next item in the queue, and then the method is used to dequeue it. + The code example creates a queue of strings with default capacity and uses the method to queue five strings. The elements of the queue are enumerated, which does not change the state of the queue. The method is used to dequeue the first string. The method is used to look at the next item in the queue, and then the method is used to dequeue it. - The method is used to create an array and copy the queue elements to it, then the array is passed to the constructor that takes , creating a copy of the queue. The elements of the copy are displayed. + The method is used to create an array and copy the queue elements to it, then the array is passed to the constructor that takes , creating a copy of the queue. The elements of the copy are displayed. - An array twice the size of the queue is created, and the method is used to copy the array elements beginning at the middle of the array. The constructor is used again to create a second copy of the queue containing three null elements at the beginning. + An array twice the size of the queue is created, and the method is used to copy the array elements beginning at the middle of the array. The constructor is used again to create a second copy of the queue containing three null elements at the beginning. - The method is used to show that the string "four" is in the first copy of the queue, after which the method clears the copy and the property shows that the queue is empty. + The method is used to show that the string "four" is in the first copy of the queue, after which the method clears the copy and the property shows that the queue is empty. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/QueueT/Overview/source.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/QueueT/Overview/source.fs" id="Snippet1"::: @@ -785,22 +785,22 @@ already equals the capacity, the capacity of the is increased by automatically reallocating the internal array, and the existing elements are copied to the new array before the new element is added. + If already equals the capacity, the capacity of the is increased by automatically reallocating the internal array, and the existing elements are copied to the new array before the new element is added. - If is less than the capacity of the internal array, this method is an O(1) operation. If the internal array needs to be reallocated to accommodate the new element, this method becomes an O(`n`) operation, where `n` is . + If is less than the capacity of the internal array, this method is an O(1) operation. If the internal array needs to be reallocated to accommodate the new element, this method becomes an O(`n`) operation, where `n` is . ## Examples - The following code example demonstrates several methods of the generic class, including the method. + The following code example demonstrates several methods of the generic class, including the method. - The code example creates a queue of strings with default capacity and uses the method to queue five strings. The elements of the queue are enumerated, which does not change the state of the queue. The method is used to dequeue the first string. The method is used to look at the next item in the queue, and then the method is used to dequeue it. + The code example creates a queue of strings with default capacity and uses the method to queue five strings. The elements of the queue are enumerated, which does not change the state of the queue. The method is used to dequeue the first string. The method is used to look at the next item in the queue, and then the method is used to dequeue it. - The method is used to create an array and copy the queue elements to it, then the array is passed to the constructor that takes , creating a copy of the queue. The elements of the copy are displayed. + The method is used to create an array and copy the queue elements to it, then the array is passed to the constructor that takes , creating a copy of the queue. The elements of the copy are displayed. - An array twice the size of the queue is created, and the method is used to copy the array elements beginning at the middle of the array. The constructor is used again to create a second copy of the queue containing three null elements at the beginning. + An array twice the size of the queue is created, and the method is used to copy the array elements beginning at the middle of the array. The constructor is used again to create a second copy of the queue containing three null elements at the beginning. - The method is used to show that the string "four" is in the first copy of the queue, after which the method clears the copy and the property shows that the queue is empty. + The method is used to show that the string "four" is in the first copy of the queue, after which the method clears the copy and the property shows that the queue is empty. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/QueueT/Overview/source.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/QueueT/Overview/source.fs" id="Snippet1"::: @@ -906,13 +906,13 @@ Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection. - Initially, the enumerator is positioned before the first element in the collection. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . - returns the same object until is called. sets to the next element. + returns the same object until is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator instance instead. + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator instance instead. - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization. @@ -923,15 +923,15 @@ ## Examples - The following code example demonstrates that the generic class is enumerable. The `foreach` statement (`For Each` in Visual Basic) is used to enumerate the queue. + The following code example demonstrates that the generic class is enumerable. The `foreach` statement (`For Each` in Visual Basic) is used to enumerate the queue. - The code example creates a queue of strings with default capacity and uses the method to queue five strings. The elements of the queue are enumerated, which does not change the state of the queue. The method is used to dequeue the first string. The method is used to look at the next item in the queue, and then the method is used to dequeue it. + The code example creates a queue of strings with default capacity and uses the method to queue five strings. The elements of the queue are enumerated, which does not change the state of the queue. The method is used to dequeue the first string. The method is used to look at the next item in the queue, and then the method is used to dequeue it. - The method is used to create an array and copy the queue elements to it, then the array is passed to the constructor that takes , creating a copy of the queue. The elements of the copy are displayed. + The method is used to create an array and copy the queue elements to it, then the array is passed to the constructor that takes , creating a copy of the queue. The elements of the copy are displayed. - An array twice the size of the queue is created, and the method is used to copy the array elements beginning at the middle of the array. The constructor is used again to create a second copy of the queue containing three null elements at the beginning. + An array twice the size of the queue is created, and the method is used to copy the array elements beginning at the middle of the array. The constructor is used again to create a second copy of the queue containing three null elements at the beginning. - The method is used to show that the string "four" is in the first copy of the queue, after which the method clears the copy and the property shows that the queue is empty. + The method is used to show that the string "four" is in the first copy of the queue, after which the method clears the copy and the property shows that the queue is empty. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/QueueT/Overview/source.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/QueueT/Overview/source.fs" id="Snippet1"::: @@ -988,24 +988,24 @@ method, but does not modify the . + This method is similar to the method, but does not modify the . - If type `T` is a reference type, `null` can be added to the as a value. + If type `T` is a reference type, `null` can be added to the as a value. This method is an O(1) operation. ## Examples - The following code example demonstrates several methods of the generic class, including the method. + The following code example demonstrates several methods of the generic class, including the method. - The code example creates a queue of strings with default capacity and uses the method to queue five strings. The elements of the queue are enumerated, which does not change the state of the queue. The method is used to dequeue the first string. The method is used to look at the next item in the queue, and then the method is used to dequeue it. + The code example creates a queue of strings with default capacity and uses the method to queue five strings. The elements of the queue are enumerated, which does not change the state of the queue. The method is used to dequeue the first string. The method is used to look at the next item in the queue, and then the method is used to dequeue it. - The method is used to create an array and copy the queue elements to it, then the array is passed to the constructor that takes , creating a copy of the queue. The elements of the copy are displayed. + The method is used to create an array and copy the queue elements to it, then the array is passed to the constructor that takes , creating a copy of the queue. The elements of the copy are displayed. - An array twice the size of the queue is created, and the method is used to copy the array elements beginning at the middle of the array. The constructor is used again to create a second copy of the queue containing three null elements at the beginning. + An array twice the size of the queue is created, and the method is used to copy the array elements beginning at the middle of the array. The constructor is used again to create a second copy of the queue containing three null elements at the beginning. - The method is used to show that the string "four" is in the first copy of the queue, after which the method clears the copy and the property shows that the queue is empty. + The method is used to show that the string "four" is in the first copy of the queue, after which the method clears the copy and the property shows that the queue is empty. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/QueueT/Overview/source.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/QueueT/Overview/source.fs" id="Snippet1"::: @@ -1070,13 +1070,13 @@ Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection. - Initially, the enumerator is positioned before the first element in the collection. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . - returns the same object until is called. sets to the next element. + returns the same object until is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator instance instead. + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator instance instead. - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization. @@ -1145,9 +1145,9 @@ ## Remarks > [!NOTE] -> If the type of the source cannot be cast automatically to the type of the destination `array`, the non-generic implementations of throw , whereas the generic implementations throw . +> If the type of the source cannot be cast automatically to the type of the destination `array`, the non-generic implementations of throw , whereas the generic implementations throw . - This method is an O(`n`) operation, where `n` is . + This method is an O(`n`) operation, where `n` is . ]]> @@ -1223,7 +1223,7 @@ Enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization. - returns an object, which can be used to synchronize access to the . Synchronization is effective only if all threads lock this object before accessing the collection. + returns an object, which can be used to synchronize access to the . Synchronization is effective only if all threads lock this object before accessing the collection. Retrieving the value of this property is an O(1) operation. @@ -1284,7 +1284,7 @@ Enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization. - returns an object, which can be used to synchronize access to the . Synchronization is effective only if all threads lock this object before accessing the collection. The following code shows the use of the property. + returns an object, which can be used to synchronize access to the . Synchronization is effective only if all threads lock this object before accessing the collection. The following code shows the use of the property. ```csharp ICollection ic = ...; @@ -1359,13 +1359,13 @@ Retrieving the value of this property is an O(1) operation. Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection. - Initially, the enumerator is positioned before the first element in the collection. also brings the enumerator back to this position. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. also brings the enumerator back to this position. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . - returns the same object until either or is called. sets to the next element. + returns the same object until either or is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. To set to the first element of the collection again, you can call followed by . + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. To set to the first element of the collection again, you can call followed by . - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization. @@ -1425,22 +1425,22 @@ Retrieving the value of this property is an O(1) operation. is not modified. The order of the elements in the new array is the same as the order of the elements from the beginning of the to its end. + The is not modified. The order of the elements in the new array is the same as the order of the elements from the beginning of the to its end. - This method is an O(`n`) operation, where `n` is . + This method is an O(`n`) operation, where `n` is . ## Examples - The following code example demonstrates several methods of the generic class, including the method. + The following code example demonstrates several methods of the generic class, including the method. - The code example creates a queue of strings with default capacity and uses the method to queue five strings. The elements of the queue are enumerated, which does not change the state of the queue. The method is used to dequeue the first string. The method is used to look at the next item in the queue, and then the method is used to dequeue it. + The code example creates a queue of strings with default capacity and uses the method to queue five strings. The elements of the queue are enumerated, which does not change the state of the queue. The method is used to dequeue the first string. The method is used to look at the next item in the queue, and then the method is used to dequeue it. - The method is used to create an array and copy the queue elements to it, then the array is passed to the constructor that takes , creating a copy of the queue. The elements of the copy are displayed. + The method is used to create an array and copy the queue elements to it, then the array is passed to the constructor that takes , creating a copy of the queue. The elements of the copy are displayed. - An array twice the size of the queue is created, and the method is used to copy the array elements beginning at the middle of the array. The constructor is used again to create a second copy of the queue containing three null elements at the beginning. + An array twice the size of the queue is created, and the method is used to copy the array elements beginning at the middle of the array. The constructor is used again to create a second copy of the queue containing three null elements at the beginning. - The method is used to show that the string "four" is in the first copy of the queue, after which the method clears the copy and the property shows that the queue is empty. + The method is used to show that the string "four" is in the first copy of the queue, after which the method clears the copy and the property shows that the queue is empty. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/QueueT/Overview/source.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/QueueT/Overview/source.fs" id="Snippet1"::: @@ -1494,11 +1494,11 @@ Retrieving the value of this property is an O(1) operation. can be considerable, however, so the method does nothing if the list is at more than 90 percent of capacity. This avoids incurring a large reallocation cost for a relatively small gain. + This method can be used to minimize a collection's memory overhead if no new elements will be added to the collection. The cost of reallocating and copying a large can be considerable, however, so the method does nothing if the list is at more than 90 percent of capacity. This avoids incurring a large reallocation cost for a relatively small gain. - This method is an O(`n`) operation, where `n` is . + This method is an O(`n`) operation, where `n` is . - To reset a to its initial state, call the method before calling method. Trimming an empty sets the capacity of the to the default capacity. + To reset a to its initial state, call the method before calling method. Trimming an empty sets the capacity of the to the default capacity. ]]> diff --git a/xml/System.Collections.Generic/SortedDictionary`2+Enumerator.xml b/xml/System.Collections.Generic/SortedDictionary`2+Enumerator.xml index a4129f33acf..ab46ae9f641 100644 --- a/xml/System.Collections.Generic/SortedDictionary`2+Enumerator.xml +++ b/xml/System.Collections.Generic/SortedDictionary`2+Enumerator.xml @@ -82,13 +82,13 @@ Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection. - Initially, the enumerator is positioned before the first element in the collection. At this position, is undefined. You must call the method to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. At this position, is undefined. You must call the method to advance the enumerator to the first element of the collection before reading the value of . - The property returns the same object until is called. sets to the next element. + The property returns the same object until is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator instance instead. + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator instance instead. - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization. @@ -155,15 +155,15 @@ is undefined under any of the following conditions: + is undefined under any of the following conditions: -- The enumerator is positioned before the first element of the collection. That happens after an enumerator is created or after the method is called. The method must be called to advance the enumerator to the first element of the collection before reading the value of the property. +- The enumerator is positioned before the first element of the collection. That happens after an enumerator is created or after the method is called. The method must be called to advance the enumerator to the first element of the collection before reading the value of the property. -- The last call to returned `false`, which indicates the end of the collection and that the enumerator is positioned after the last element of the collection. +- The last call to returned `false`, which indicates the end of the collection and that the enumerator is positioned after the last element of the collection. - The enumerator is invalidated due to changes made in the collection, such as adding, modifying, or deleting elements. - does not move the position of the enumerator, and consecutive calls to return the same object until either or is called. + does not move the position of the enumerator, and consecutive calls to return the same object until either or is called. ]]> @@ -265,11 +265,11 @@ method advances the enumerator to the first element of the collection. + After an enumerator is created, the enumerator is positioned before the first element in the collection, and the first call to the method advances the enumerator to the first element of the collection. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . ]]> @@ -325,15 +325,15 @@ ## Remarks - is undefined under any of the following conditions: + is undefined under any of the following conditions: -- The enumerator is positioned before the first element of the collection. That happens after an enumerator is created or after the method is called. The method must be called to advance the enumerator to the first element of the collection before reading the value of the property. +- The enumerator is positioned before the first element of the collection. That happens after an enumerator is created or after the method is called. The method must be called to advance the enumerator to the first element of the collection before reading the value of the property. -- The last call to returned `false`, which indicates the end of the collection and that the enumerator is positioned after the last element of the collection. +- The last call to returned `false`, which indicates the end of the collection and that the enumerator is positioned after the last element of the collection. - The enumerator is invalidated due to changes made in the collection, such as adding, modifying, or deleting elements. - does not move the position of the enumerator, and consecutive calls to return the same object until either or is called. + does not move the position of the enumerator, and consecutive calls to return the same object until either or is called. ]]> @@ -397,15 +397,15 @@ is undefined under any of the following conditions: + is undefined under any of the following conditions: -- The enumerator is positioned before the first element of the collection. That happens after an enumerator is created or after the method is called. The method must be called to advance the enumerator to the first element of the collection before reading the value of the property. +- The enumerator is positioned before the first element of the collection. That happens after an enumerator is created or after the method is called. The method must be called to advance the enumerator to the first element of the collection before reading the value of the property. -- The last call to returned `false`, which indicates the end of the collection and that the enumerator is positioned after the last element of the collection. +- The last call to returned `false`, which indicates the end of the collection and that the enumerator is positioned after the last element of the collection. - The enumerator is invalidated due to changes made in the collection, such as adding, modifying, or deleting elements. - does not move the position of the enumerator, and consecutive calls to return the same object until either or is called. + does not move the position of the enumerator, and consecutive calls to return the same object until either or is called. ]]> @@ -470,15 +470,15 @@ is undefined under any of the following conditions: + is undefined under any of the following conditions: -- The enumerator is positioned before the first element of the collection. That happens after an enumerator is created or after the method is called. The method must be called to advance the enumerator to the first element of the collection before reading the value of the property. +- The enumerator is positioned before the first element of the collection. That happens after an enumerator is created or after the method is called. The method must be called to advance the enumerator to the first element of the collection before reading the value of the property. -- The last call to returned `false`, which indicates the end of the collection and that the enumerator is positioned after the last element of the collection. +- The last call to returned `false`, which indicates the end of the collection and that the enumerator is positioned after the last element of the collection. - The enumerator is invalidated due to changes made in the collection, such as adding, modifying, or deleting elements. - does not move the position of the enumerator, and consecutive calls to return the same object until either or is called. + does not move the position of the enumerator, and consecutive calls to return the same object until either or is called. ]]> @@ -544,15 +544,15 @@ ## Remarks - is undefined under any of the following conditions: + is undefined under any of the following conditions: -- The enumerator is positioned before the first element of the collection. That happens after an enumerator is created or after the method is called. The method must be called to advance the enumerator to the first element of the collection before reading the value of the property. +- The enumerator is positioned before the first element of the collection. That happens after an enumerator is created or after the method is called. The method must be called to advance the enumerator to the first element of the collection before reading the value of the property. -- The last call to returned `false`, which indicates the end of the collection and that the enumerator is positioned after the last element of the collection. +- The last call to returned `false`, which indicates the end of the collection and that the enumerator is positioned after the last element of the collection. - The enumerator is invalidated due to changes made in the collection, such as adding, modifying, or deleting elements. - does not move the position of the enumerator, and consecutive calls to return the same object until either or is called. + does not move the position of the enumerator, and consecutive calls to return the same object until either or is called. ]]> @@ -610,9 +610,9 @@ method, you must call the method to advance the enumerator to the first element of the collection before reading the value of the property. + After calling the method, you must call the method to advance the enumerator to the first element of the collection before reading the value of the property. - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . ]]> diff --git a/xml/System.Collections.Generic/SortedDictionary`2+KeyCollection+Enumerator.xml b/xml/System.Collections.Generic/SortedDictionary`2+KeyCollection+Enumerator.xml index a0c7cb4b01e..4c685655a7b 100644 --- a/xml/System.Collections.Generic/SortedDictionary`2+KeyCollection+Enumerator.xml +++ b/xml/System.Collections.Generic/SortedDictionary`2+KeyCollection+Enumerator.xml @@ -77,13 +77,13 @@ Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection. - Initially, the enumerator is positioned before the first element in the collection. At this position, is undefined. You must call the method to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. At this position, is undefined. You must call the method to advance the enumerator to the first element of the collection before reading the value of . - The property returns the same object until is called. sets to the next element. + The property returns the same object until is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator instance instead. + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator instance instead. - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization. @@ -151,15 +151,15 @@ ## Remarks - is undefined under any of the following conditions: + is undefined under any of the following conditions: -- The enumerator is positioned before the first element of the collection. That happens after an enumerator is created or after the method is called. The method must be called to advance the enumerator to the first element of the collection before reading the value of the property. +- The enumerator is positioned before the first element of the collection. That happens after an enumerator is created or after the method is called. The method must be called to advance the enumerator to the first element of the collection before reading the value of the property. -- The last call to returned `false`, which indicates the end of the collection and that the enumerator is positioned after the last element of the collection. +- The last call to returned `false`, which indicates the end of the collection and that the enumerator is positioned after the last element of the collection. - The enumerator is invalidated due to changes made in the collection, such as adding, modifying, or deleting elements. - does not move the position of the enumerator, and consecutive calls to return the same object until either or is called. + does not move the position of the enumerator, and consecutive calls to return the same object until either or is called. ]]> @@ -262,11 +262,11 @@ method advances the enumerator to the first element of the collection. + After an enumerator is created, the enumerator is positioned before the first element in the collection, and the first call to the method advances the enumerator to the first element of the collection. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . ]]> @@ -329,15 +329,15 @@ ## Remarks - is undefined under any of the following conditions: + is undefined under any of the following conditions: -- The enumerator is positioned before the first element of the collection. That happens after an enumerator is created or after the method is called. The method must be called to advance the enumerator to the first element of the collection before reading the value of the property. +- The enumerator is positioned before the first element of the collection. That happens after an enumerator is created or after the method is called. The method must be called to advance the enumerator to the first element of the collection before reading the value of the property. -- The last call to returned `false`, which indicates the end of the collection and that the enumerator is positioned after the last element of the collection. +- The last call to returned `false`, which indicates the end of the collection and that the enumerator is positioned after the last element of the collection. - The enumerator is invalidated due to changes made in the collection, such as adding, modifying, or deleting elements. - does not move the position of the enumerator, and consecutive calls to return the same object until either or is called. + does not move the position of the enumerator, and consecutive calls to return the same object until either or is called. ]]> @@ -395,9 +395,9 @@ method, you must call the method to advance the enumerator to the first element of the collection before reading the value of the property. + After calling the method, you must call the method to advance the enumerator to the first element of the collection before reading the value of the property. - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . ]]> diff --git a/xml/System.Collections.Generic/SortedDictionary`2+KeyCollection.xml b/xml/System.Collections.Generic/SortedDictionary`2+KeyCollection.xml index 404ff616d3a..51f9b50d6dc 100644 --- a/xml/System.Collections.Generic/SortedDictionary`2+KeyCollection.xml +++ b/xml/System.Collections.Generic/SortedDictionary`2+KeyCollection.xml @@ -103,9 +103,9 @@ property returns an instance of this type, containing all the keys in that . The order of the keys in the is the same as the order of elements in the , the same as the order of the associated values in the returned by the property. + The property returns an instance of this type, containing all the keys in that . The order of the keys in the is the same as the order of elements in the , the same as the order of the associated values in the returned by the property. - The is not a static copy; instead, the refers back to the keys in the original . Therefore, changes to the continue to be reflected in the . + The is not a static copy; instead, the refers back to the keys in the original . Therefore, changes to the continue to be reflected in the . ]]> @@ -158,7 +158,7 @@ is not a static copy; instead, the refers back to the keys in the original . Therefore, changes to the continue to be reflected in the . + The is not a static copy; instead, the refers back to the keys in the original . Therefore, changes to the continue to be reflected in the . This constructor is an O(1) operation. @@ -252,9 +252,9 @@ . + The elements are copied to the array in the same order in which the enumerator iterates through the . - This method is an O(`n`) operation, where `n` is . + This method is an O(`n`) operation, where `n` is . ]]> @@ -370,13 +370,13 @@ Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection. - Initially, the enumerator is positioned before the first element in the collection. At this position, is undefined. You must call the method to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. At this position, is undefined. You must call the method to advance the enumerator to the first element of the collection before reading the value of . - The property returns the same object until is called. sets to the next element. + The property returns the same object until is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator instance instead. + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator instance instead. - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization. @@ -488,7 +488,7 @@ property is set to 0, and references to other objects from elements of the collection are also released. + The property is set to 0, and references to other objects from elements of the collection are also released. ]]> @@ -544,7 +544,7 @@ uses , whereas allows the user to specify the implementation to use for comparing keys. + Implementations can vary in how they determine equality of objects; for example, uses , whereas allows the user to specify the implementation to use for comparing keys. This method is an O(1) operation. @@ -660,7 +660,7 @@ uses , whereas allows the user to specify the implementation to use for comparing keys. + Implementations can vary in how they determine equality of objects; for example, uses , whereas allows the user to specify the implementation to use for comparing keys. ]]> @@ -720,13 +720,13 @@ Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection. - Initially, the enumerator is positioned before the first element in the collection. At this position, the property is undefined. Therefore, you must call the method to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. At this position, the property is undefined. Therefore, you must call the method to advance the enumerator to the first element of the collection before reading the value of . - The property returns the same object until is called. sets to the next element. + The property returns the same object until is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns false. When the enumerator is at this position, subsequent calls to also return false. If the last call to returned `false`, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator instance instead. + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns false. When the enumerator is at this position, subsequent calls to also return false. If the last call to returned `false`, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator instance instead. - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization. @@ -793,9 +793,9 @@ ## Remarks > [!NOTE] -> If the type of the source cannot be cast automatically to the type of the destination `array`, the nongeneric implementations of throw an , whereas the generic implementations throw an . +> If the type of the source cannot be cast automatically to the type of the destination `array`, the nongeneric implementations of throw an , whereas the generic implementations throw an . - This method is an O(`n`) operation, where `n` is . + This method is an O(`n`) operation, where `n` is . ]]> @@ -1015,13 +1015,13 @@ Getting the value of this property is an O(1) operation. Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection. - Initially, the enumerator is positioned before the first element in the collection. also brings the enumerator back to this position. At this position, the property is undefined. Therefore, you must call the method to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. also brings the enumerator back to this position. At this position, the property is undefined. Therefore, you must call the method to advance the enumerator to the first element of the collection before reading the value of . - The property returns the same object until either or is called. sets to the next element. + The property returns the same object until either or is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. To set to the first element of the collection again, you can call followed by . + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. To set to the first element of the collection again, you can call followed by . - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization. diff --git a/xml/System.Collections.Generic/SortedDictionary`2+ValueCollection+Enumerator.xml b/xml/System.Collections.Generic/SortedDictionary`2+ValueCollection+Enumerator.xml index f31a4778fd7..e497a797215 100644 --- a/xml/System.Collections.Generic/SortedDictionary`2+ValueCollection+Enumerator.xml +++ b/xml/System.Collections.Generic/SortedDictionary`2+ValueCollection+Enumerator.xml @@ -73,17 +73,17 @@ interface. + The `foreach` statement of the C# (`For Each` in Visual Basic) hides the complexity of enumerators. Therefore, using `foreach` is recommended, instead of directly manipulating the enumerator. This type implements the interface. Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection. - Initially, the enumerator is positioned before the first element in the collection. At this position, is undefined. You must call the method to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. At this position, is undefined. You must call the method to advance the enumerator to the first element of the collection before reading the value of . - The property returns the same object until is called. sets to the next element. + The property returns the same object until is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator instance instead. + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator instance instead. - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization. @@ -151,15 +151,15 @@ ## Remarks - is undefined under any of the following conditions: + is undefined under any of the following conditions: -- The enumerator is positioned before the first element of the collection. That happens after an enumerator is created or after the method is called. The method must be called to advance the enumerator to the first element of the collection before reading the value of the property. +- The enumerator is positioned before the first element of the collection. That happens after an enumerator is created or after the method is called. The method must be called to advance the enumerator to the first element of the collection before reading the value of the property. -- The last call to returned `false`, which indicates the end of the collection and that the enumerator is positioned after the last element of the collection. +- The last call to returned `false`, which indicates the end of the collection and that the enumerator is positioned after the last element of the collection. - The enumerator is invalidated due to changes made in the collection, such as adding, modifying, or deleting elements. - does not move the position of the enumerator, and consecutive calls to return the same object until either or is called. + does not move the position of the enumerator, and consecutive calls to return the same object until either or is called. ]]> @@ -262,11 +262,11 @@ method advances the enumerator to the first element of the collection. + After an enumerator is created, the enumerator is positioned before the first element in the collection, and the first call to the method advances the enumerator to the first element of the collection. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . ]]> @@ -329,15 +329,15 @@ ## Remarks - is undefined under any of the following conditions: + is undefined under any of the following conditions: -- The enumerator is positioned before the first element of the collection. That happens after an enumerator is created or after the method is called. The method must be called to advance the enumerator to the first element of the collection before reading the value of the property. +- The enumerator is positioned before the first element of the collection. That happens after an enumerator is created or after the method is called. The method must be called to advance the enumerator to the first element of the collection before reading the value of the property. -- The last call to returned `false`, which indicates the end of the collection and that the enumerator is positioned after the last element of the collection. +- The last call to returned `false`, which indicates the end of the collection and that the enumerator is positioned after the last element of the collection. - The enumerator is invalidated due to changes made in the collection, such as adding, modifying, or deleting elements. - does not move the position of the enumerator, and consecutive calls to return the same object until either or is called. + does not move the position of the enumerator, and consecutive calls to return the same object until either or is called. ]]> @@ -395,9 +395,9 @@ method, you must call the method to advance the enumerator to the first element of the collection before reading the value of the property. + After calling the method, you must call the method to advance the enumerator to the first element of the collection before reading the value of the property. - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . ]]> diff --git a/xml/System.Collections.Generic/SortedDictionary`2+ValueCollection.xml b/xml/System.Collections.Generic/SortedDictionary`2+ValueCollection.xml index 04a77989ebd..eb2de68234e 100644 --- a/xml/System.Collections.Generic/SortedDictionary`2+ValueCollection.xml +++ b/xml/System.Collections.Generic/SortedDictionary`2+ValueCollection.xml @@ -103,9 +103,9 @@ property returns an instance of this type, containing all the values in that . The order of the values in the is the same as the order of the elements in the , and the same as the order of the associated keys in the returned by the property. + The property returns an instance of this type, containing all the values in that . The order of the values in the is the same as the order of the elements in the , and the same as the order of the associated keys in the returned by the property. - The is not a static copy; instead, the refers back to the values in the original . Therefore, changes to the continue to be reflected in the . + The is not a static copy; instead, the refers back to the values in the original . Therefore, changes to the continue to be reflected in the . ]]> @@ -158,7 +158,7 @@ is not a static copy; instead, the refers back to the values in the original . Therefore, changes to the continue to be reflected in the . + The is not a static copy; instead, the refers back to the values in the original . Therefore, changes to the continue to be reflected in the . This constructor is an O(1) operation. @@ -220,9 +220,9 @@ . + The elements are copied to the array in the same order in which the enumerator iterates through the . - This method is an O(`n`) operation, where `n` is . + This method is an O(`n`) operation, where `n` is . ]]> @@ -338,13 +338,13 @@ Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection. - Initially, the enumerator is positioned before the first element in the collection. At this position, is undefined. You must call the method to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. At this position, is undefined. You must call the method to advance the enumerator to the first element of the collection before reading the value of . - The property returns the same object until is called. sets to the next element. + The property returns the same object until is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator instance instead. + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator instance instead. - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization. @@ -456,7 +456,7 @@ property is set to 0, and references to other objects from elements of the collection are also released. + The property is set to 0, and references to other objects from elements of the collection are also released. ]]> @@ -516,9 +516,9 @@ uses , whereas allows the user to specify the implementation to use for comparing keys. + Implementations can vary in how they determine equality of objects; for example, uses , whereas allows the user to specify the implementation to use for comparing keys. - This method is an O(`n`) operation, where `n` is . + This method is an O(`n`) operation, where `n` is . ]]> @@ -632,7 +632,7 @@ uses , whereas allows the user to specify the implementation to use for comparing keys. + Implementations can vary in how they determine equality of objects; for example, uses , whereas allows the user to specify the implementation to use for comparing keys. ]]> @@ -692,13 +692,13 @@ Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection. - Initially, the enumerator is positioned before the first element in the collection. At this position, the property is undefined. Therefore, you must call the method to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. At this position, the property is undefined. Therefore, you must call the method to advance the enumerator to the first element of the collection before reading the value of . - The property returns the same object until is called. sets to the next element. + The property returns the same object until is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator instance instead. + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator instance instead. - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization. @@ -765,9 +765,9 @@ ## Remarks > [!NOTE] -> If the type of the source cannot be cast automatically to the type of the destination `array`, the nongeneric implementations of throw an , whereas the generic implementations throw an . +> If the type of the source cannot be cast automatically to the type of the destination `array`, the nongeneric implementations of throw an , whereas the generic implementations throw an . - This method is an O(`n`) operation, where `n` is . + This method is an O(`n`) operation, where `n` is . ]]> @@ -987,13 +987,13 @@ Getting the value of this property is an O(1) operation. Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection. - Initially, the enumerator is positioned before the first element in the collection. also brings the enumerator back to this position. At this position, the property is undefined. Therefore, you must call the method to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. also brings the enumerator back to this position. At this position, the property is undefined. Therefore, you must call the method to advance the enumerator to the first element of the collection before reading the value of . - The property returns the same object until either or is called. sets to the next element. + The property returns the same object until either or is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. To set to the first element of the collection again, you can call followed by . + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. To set to the first element of the collection again, you can call followed by . - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization. diff --git a/xml/System.Collections.Generic/SortedDictionary`2.xml b/xml/System.Collections.Generic/SortedDictionary`2.xml index 9dce542d43f..5db576f828c 100644 --- a/xml/System.Collections.Generic/SortedDictionary`2.xml +++ b/xml/System.Collections.Generic/SortedDictionary`2.xml @@ -118,21 +118,21 @@ generic class is a binary search tree with O(log n) retrieval, where n is the number of elements in the dictionary. In this respect, it is similar to the generic class. The two classes have similar object models, and both have O(log n) retrieval. Where the two classes differ is in memory use and speed of insertion and removal: + The generic class is a binary search tree with O(log n) retrieval, where n is the number of elements in the dictionary. In this respect, it is similar to the generic class. The two classes have similar object models, and both have O(log n) retrieval. Where the two classes differ is in memory use and speed of insertion and removal: -- uses less memory than . +- uses less memory than . -- has faster insertion and removal operations for unsorted data: O(log n) as opposed to O(n) for . +- has faster insertion and removal operations for unsorted data: O(log n) as opposed to O(n) for . -- If the list is populated all at once from sorted data, is faster than . +- If the list is populated all at once from sorted data, is faster than . - Each key/value pair can be retrieved as a structure, or as a through the nongeneric interface. + Each key/value pair can be retrieved as a structure, or as a through the nongeneric interface. - Keys must be immutable as long as they are used as keys in the . Every key in a must be unique. A key cannot be `null`, but a value can be, if the value type `TValue` is a reference type. + Keys must be immutable as long as they are used as keys in the . Every key in a must be unique. A key cannot be `null`, but a value can be, if the value type `TValue` is a reference type. - requires a comparer implementation to perform key comparisons. You can specify an implementation of the generic interface by using a constructor that accepts a `comparer` parameter; if you do not specify an implementation, the default generic comparer is used. If type `TKey` implements the generic interface, the default comparer uses that implementation. + requires a comparer implementation to perform key comparisons. You can specify an implementation of the generic interface by using a constructor that accepts a `comparer` parameter; if you do not specify an implementation, the default generic comparer is used. If type `TKey` implements the generic interface, the default comparer uses that implementation. - The `foreach` statement of the C# language (`For Each` in Visual Basic) returns an object of the type of the elements in the collection. Since each element of the is a key/value pair, the element type is not the type of the key or the type of the value. Instead, the element type is . The following code shows the syntax. + The `foreach` statement of the C# language (`For Each` in Visual Basic) returns an object of the type of the elements in the collection. Since each element of the is a key/value pair, the element type is not the type of the key or the type of the value. Instead, the element type is . The following code shows the syntax. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/DictionaryTKey,TValue/Overview/source2.cs" id="Snippet11"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/DictionaryTKey,TValue/Overview/source2.vb" id="Snippet11"::: @@ -140,15 +140,15 @@ The `foreach` statement is a wrapper around the enumerator, which allows only reading from the collection, not writing to it. ## Examples - The following code example creates an empty of strings with string keys and uses the method to add some elements. The example demonstrates that the method throws an when attempting to add a duplicate key. + The following code example creates an empty of strings with string keys and uses the method to add some elements. The example demonstrates that the method throws an when attempting to add a duplicate key. - The example uses the property (the indexer in C#) to retrieve values, demonstrating that a is thrown when a requested key is not present, and showing that the value associated with a key can be replaced. + The example uses the property (the indexer in C#) to retrieve values, demonstrating that a is thrown when a requested key is not present, and showing that the value associated with a key can be replaced. - The example shows how to use the method as a more efficient way to retrieve values if a program often must try key values that are not in the dictionary, and it shows how to use the method to test whether a key exists before calling the method. + The example shows how to use the method as a more efficient way to retrieve values if a program often must try key values that are not in the dictionary, and it shows how to use the method to test whether a key exists before calling the method. - The example shows how to enumerate the keys and values in the dictionary and how to enumerate the keys and values alone using the property and the property. + The example shows how to enumerate the keys and values in the dictionary and how to enumerate the keys and values alone using the property and the property. - Finally, the example demonstrates the method. + Finally, the example demonstrates the method. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedDictionaryTKey,TValue/Overview/source.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/Overview/source.vb" id="Snippet1"::: @@ -219,18 +219,18 @@ must be unique according to the default comparer. + Every key in a must be unique according to the default comparer. - requires a comparer implementation to perform key comparisons. This constructor uses the default generic equality comparer . If type `TKey` implements the generic interface, the default comparer uses that implementation. Alternatively, you can specify an implementation of the generic interface by using a constructor that accepts a `comparer` parameter. + requires a comparer implementation to perform key comparisons. This constructor uses the default generic equality comparer . If type `TKey` implements the generic interface, the default comparer uses that implementation. Alternatively, you can specify an implementation of the generic interface by using a constructor that accepts a `comparer` parameter. This constructor is an O(1) operation. ## Examples - The following code example creates an empty of strings with string keys and uses the method to add some elements. The example demonstrates that the method throws an when attempting to add a duplicate key. + The following code example creates an empty of strings with string keys and uses the method to add some elements. The example demonstrates that the method throws an when attempting to add a duplicate key. - This code example is part of a larger example provided for the class. + This code example is part of a larger example provided for the class. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedDictionaryTKey,TValue/Overview/source.cs" interactive="try-dotnet-method" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/Overview/source.vb" id="Snippet2"::: @@ -294,16 +294,16 @@ must be unique according to the specified comparer. + Every key in a must be unique according to the specified comparer. - requires a comparer implementation to perform key comparisons. If `comparer` is `null`, this constructor uses the default generic equality comparer, . If type `TKey` implements the generic interface, the default comparer uses that implementation. + requires a comparer implementation to perform key comparisons. If `comparer` is `null`, this constructor uses the default generic equality comparer, . If type `TKey` implements the generic interface, the default comparer uses that implementation. This constructor is an O(1) operation. ## Examples - The following code example creates a with a case-insensitive comparer for the current culture. The example adds four elements, some with lower-case keys and some with upper-case keys. The example then attempts to add an element with a key that differs from an existing key only by case, catches the resulting exception, and displays an error message. Finally, the example displays the elements in case-insensitive sort order. + The following code example creates a with a case-insensitive comparer for the current culture. The example adds four elements, some with lower-case keys and some with upper-case keys. The example then attempts to add an element with a key that differs from an existing key only by case, catches the resulting exception, and displays an error message. Finally, the example displays the elements in case-insensitive sort order. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedDictionaryTKey,TValue/.ctor/source.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/.ctor/source.vb" id="Snippet1"::: @@ -366,16 +366,16 @@ must be unique according to the default comparer; therefore, every key in the source `dictionary` must also be unique according to the default comparer. + Every key in a must be unique according to the default comparer; therefore, every key in the source `dictionary` must also be unique according to the default comparer. - requires a comparer implementation to perform key comparisons. This constructor uses the default generic equality comparer, . If type `TKey` implements the generic interface, the default comparer uses that implementation. Alternatively, you can specify an implementation of the generic interface by using a constructor that accepts a `comparer` parameter. + requires a comparer implementation to perform key comparisons. This constructor uses the default generic equality comparer, . If type `TKey` implements the generic interface, the default comparer uses that implementation. Alternatively, you can specify an implementation of the generic interface by using a constructor that accepts a `comparer` parameter. This constructor is an O(`n` log `n`) operation, where `n` is the number of elements in `dictionary`. ## Examples - The following code example shows how to use to create a sorted copy of the information in a , by passing the to the constructor. + The following code example shows how to use to create a sorted copy of the information in a , by passing the to the constructor. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedDictionaryTKey,TValue/.ctor/source1.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/.ctor/source1.vb" id="Snippet1"::: @@ -446,16 +446,16 @@ must be unique according to the specified comparer; therefore, every key in the source `dictionary` must also be unique according to the specified comparer. + Every key in a must be unique according to the specified comparer; therefore, every key in the source `dictionary` must also be unique according to the specified comparer. - requires a comparer implementation to perform key comparisons. If `comparer` is `null`, this constructor uses the default generic equality comparer, . If type `TKey` implements the generic interface, the default comparer uses that implementation. + requires a comparer implementation to perform key comparisons. If `comparer` is `null`, this constructor uses the default generic equality comparer, . If type `TKey` implements the generic interface, the default comparer uses that implementation. This constructor is an O(`n` log `n`) operation, where `n` is the number of elements in `dictionary`. ## Examples - The following code example shows how to use to create a case-insensitive sorted copy of the information in a case-insensitive , by passing the to the constructor. In this example, the case-insensitive comparers are for the current culture. + The following code example shows how to use to create a case-insensitive sorted copy of the information in a case-insensitive , by passing the to the constructor. In this example, the case-insensitive comparers are for the current culture. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedDictionaryTKey,TValue/.ctor/source2.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/.ctor/source2.vb" id="Snippet1"::: @@ -525,18 +525,18 @@ property to add new elements by setting the value of a key that does not exist in the ; for example, `myCollection["myNonexistentKey"] = myValue` (in Visual Basic, `myCollection("myNonexistantKey") = myValue`). However, if the specified key already exists in the , setting the property overwrites the old value. In contrast, the method throws an exception if an element with the specified key already exists. + You can also use the property to add new elements by setting the value of a key that does not exist in the ; for example, `myCollection["myNonexistentKey"] = myValue` (in Visual Basic, `myCollection("myNonexistantKey") = myValue`). However, if the specified key already exists in the , setting the property overwrites the old value. In contrast, the method throws an exception if an element with the specified key already exists. A key cannot be `null`, but a value can be, if the value type `TValue` is a reference type. - This method is an O(log `n`) operation, where `n` is . + This method is an O(log `n`) operation, where `n` is . ## Examples - The following code example creates an empty of strings with string keys and uses the method to add some elements. The example demonstrates that the method throws an when attempting to add a duplicate key. + The following code example creates an empty of strings with string keys and uses the method to add some elements. The example demonstrates that the method throws an when attempting to add a duplicate key. - This code example is part of a larger example provided for the class. + This code example is part of a larger example provided for the class. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedDictionaryTKey,TValue/Overview/source.cs" interactive="try-dotnet-method" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/Overview/source.vb" id="Snippet2"::: @@ -599,7 +599,7 @@ property is set to 0, and references to other objects from elements of the collection are also released. + The property is set to 0, and references to other objects from elements of the collection are also released. This method is an O(1) operation, since the root of the internal data structures is simply released for garbage collection. @@ -651,7 +651,7 @@ requires a comparer implementation to perform key comparisons. You can specify an implementation of the generic interface by using a constructor that accepts a `comparer` parameter. If you do not, the default generic equality comparer, , is used. If type `TKey` implements the generic interface, the default comparer uses that implementation. + requires a comparer implementation to perform key comparisons. You can specify an implementation of the generic interface by using a constructor that accepts a `comparer` parameter. If you do not, the default generic equality comparer, , is used. If type `TKey` implements the generic interface, the default comparer uses that implementation. Getting the value of this property is an O(1) operation. @@ -718,9 +718,9 @@ ## Examples - The following code example shows how to use the method to test whether a key exists prior to calling the method. It also shows how to use the method to retrieve values, which is an efficient way to retrieve values when a program frequently tries keys that are not in the dictionary. Finally, it shows the least efficient way to test whether keys exist, by using the property (the indexer in C#). + The following code example shows how to use the method to test whether a key exists prior to calling the method. It also shows how to use the method to retrieve values, which is an efficient way to retrieve values when a program frequently tries keys that are not in the dictionary. Finally, it shows the least efficient way to test whether keys exist, by using the property (the indexer in C#). - This code example is part of a larger example provided for the class. + This code example is part of a larger example provided for the class. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedDictionaryTKey,TValue/Overview/source.cs" id="Snippet6"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/Overview/source.vb" id="Snippet6"::: @@ -785,9 +785,9 @@ for the value type `TValue`. + This method determines equality using the default equality comparer for the value type `TValue`. - This method performs a linear search; therefore, the average execution time is proportional to the property. That is, this method is an O(`n`) operation, where `n` is . + This method performs a linear search; therefore, the average execution time is proportional to the property. That is, this method is an O(`n`) operation, where `n` is . ]]> @@ -856,9 +856,9 @@ ## Remarks > [!NOTE] -> If the type of the source cannot be cast automatically to the type of the destination `array`, the nongeneric implementations of throw , whereas the generic implementations throw . +> If the type of the source cannot be cast automatically to the type of the destination `array`, the nongeneric implementations of throw , whereas the generic implementations throw . - This method is an O(`n`) operation, where `n` is . + This method is an O(`n`) operation, where `n` is . ]]> @@ -969,7 +969,7 @@ structure representing a value and its key. + For purposes of enumeration, each item is a structure representing a value and its key. The `foreach` statement of the C# language (`For Each` in Visual Basic) hides the complexity of enumerators. Therefore, using `foreach` is recommended, instead of directly manipulating the enumerator. @@ -977,13 +977,13 @@ The dictionary is maintained in a sorted order using an internal tree. Every new element is positioned at the correct sort position, and the tree is adjusted to maintain the sort order whenever an element is removed. While enumerating, the sort order is maintained. - Initially, the enumerator is positioned before the first element in the collection. At this position, the property is undefined. Therefore, you must call the method to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. At this position, the property is undefined. Therefore, you must call the method to advance the enumerator to the first element of the collection before reading the value of . - The property returns the same element until the method is called. sets to the next element. + The property returns the same element until the method is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator instance instead. + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator instance instead. - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization. @@ -1050,22 +1050,22 @@ ## Remarks This property provides the ability to access a specific element in the collection by using the following C# syntax: `myCollection[key]` (`myCollection(key)` in Visual Basic). - You can also use the property to add new elements by setting the value of a key that does not exist in the ; for example, `myCollection["myNonexistentKey"] = myValue`. However, if the specified key already exists in the , setting the property overwrites the old value. In contrast, the method does not modify existing elements. + You can also use the property to add new elements by setting the value of a key that does not exist in the ; for example, `myCollection["myNonexistentKey"] = myValue`. However, if the specified key already exists in the , setting the property overwrites the old value. In contrast, the method does not modify existing elements. A key cannot be `null`, but a value can be, if the value type `TValue` is a reference type. - The C# language uses the [this](/dotnet/csharp/language-reference/keywords/this) keyword to define the indexers instead of implementing the property. Visual Basic implements as a default property, which provides the same indexing functionality. + The C# language uses the [this](/dotnet/csharp/language-reference/keywords/this) keyword to define the indexers instead of implementing the property. Visual Basic implements as a default property, which provides the same indexing functionality. Getting the value of this property is an O(log `n`) operation; setting the property is also an O(log `n`) operation. ## Examples - The following code example uses the property (the indexer in C#) to retrieve values, demonstrating that a is thrown when a requested key is not present, and showing that the value associated with a key can be replaced. + The following code example uses the property (the indexer in C#) to retrieve values, demonstrating that a is thrown when a requested key is not present, and showing that the value associated with a key can be replaced. - The example also shows how to use the method as a more efficient way to retrieve values if a program often must try key values that are not in the dictionary. + The example also shows how to use the method as a more efficient way to retrieve values if a program often must try key values that are not in the dictionary. - This code example is part of a larger example provided for the class. + This code example is part of a larger example provided for the class. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedDictionaryTKey,TValue/Overview/source.cs" id="Snippet3"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/Overview/source.vb" id="Snippet3"::: @@ -1126,18 +1126,18 @@ are sorted according to the property and are in the same order as the associated values in the returned by the property. + The keys in the are sorted according to the property and are in the same order as the associated values in the returned by the property. - The returned is not a static copy; instead, the refers back to the keys in the original . Therefore, changes to the continue to be reflected in the . + The returned is not a static copy; instead, the refers back to the keys in the original . Therefore, changes to the continue to be reflected in the . Getting the value of this property is an O(1) operation. ## Examples - The following code example shows how to enumerate the keys in the dictionary using the property, and how to enumerate the keys and values in the dictionary. + The following code example shows how to enumerate the keys in the dictionary using the property, and how to enumerate the keys and values in the dictionary. - This code is part of a larger example that can be compiled and executed. See . + This code is part of a larger example that can be compiled and executed. See . :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedDictionaryTKey,TValue/Overview/source.cs" id="Snippet9"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/Overview/source.vb" id="Snippet9"::: @@ -1202,16 +1202,16 @@ does not contain an element with the specified key, the remains unchanged. No exception is thrown. + If the does not contain an element with the specified key, the remains unchanged. No exception is thrown. This method is an O(log `n`) operation. ## Examples - The following code example shows how to remove a key/value pair from the dictionary using the method. + The following code example shows how to remove a key/value pair from the dictionary using the method. - This code example is part of a larger example provided for the class. + This code example is part of a larger example provided for the class. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedDictionaryTKey,TValue/Overview/source.cs" id="Snippet10"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/Overview/source.vb" id="Snippet10"::: @@ -1719,9 +1719,9 @@ ## Remarks > [!NOTE] -> If the type of the source cannot be cast automatically to the type of the destination `array`, the nongeneric implementations of throw an , whereas the generic implementations throw an . +> If the type of the source cannot be cast automatically to the type of the destination `array`, the nongeneric implementations of throw an , whereas the generic implementations throw an . - This method is an O(`n`) operation, where `n` is . + This method is an O(`n`) operation, where `n` is . ]]> @@ -1797,7 +1797,7 @@ Enumerating through a collection is intrinsically not a thread-safe procedure. Even when a collection is synchronized, other threads can still modify the collection, which can cause the enumerator to throw an exception. To guarantee thread safety during enumeration, you can either lock the collection during the entire enumeration or catch the exceptions resulting from changes made by other threads. - The property returns an object that can be used to synchronize access to the . Synchronization is effective only if all threads lock the object before accessing the collection. + The property returns an object that can be used to synchronize access to the . Synchronization is effective only if all threads lock the object before accessing the collection. Getting the value of this property is an O(1) operation. @@ -1857,7 +1857,7 @@ Enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization. - The property returns an object that can be used to synchronize access to the . Synchronization is effective only if all threads lock the object before accessing the collection. The following code shows the use of the property. + The property returns an object that can be used to synchronize access to the . Synchronization is effective only if all threads lock the object before accessing the collection. The following code shows the use of the property. ```csharp ICollection ic = ...; @@ -1933,14 +1933,14 @@ Getting the value of this property is an O(1) operation. property to add new elements by setting the value of a key that does not exist in the dictionary; for example, `myCollection["myNonexistentKey"] = myValue`. However, if the specified key already exists in the dictionary, setting the property overwrites the old value. In contrast, the method does not modify existing elements. + You can also use the property to add new elements by setting the value of a key that does not exist in the dictionary; for example, `myCollection["myNonexistentKey"] = myValue`. However, if the specified key already exists in the dictionary, setting the property overwrites the old value. In contrast, the method does not modify existing elements. - This method is an O(log `n`) operation, where `n` is . + This method is an O(log `n`) operation, where `n` is . ## Examples - The following code example shows how to access the class through the interface. The code example creates an empty of strings with string keys and uses the method to add some elements. The example demonstrates that the method throws an when attempting to add a duplicate key, or when a key or value of the wrong data type is supplied. + The following code example shows how to access the class through the interface. The code example creates an empty of strings with string keys and uses the method to add some elements. The example demonstrates that the method throws an when attempting to add a duplicate key, or when a key or value of the wrong data type is supplied. The code example demonstrates the use of several other members of the interface. @@ -2016,16 +2016,16 @@ Getting the value of this property is an O(1) operation. . + This method returns `false` if `key` is of a type that is not assignable to the key type `TKey` of the . - This method is an O(log `n`) operation, where `n` is . + This method is an O(log `n`) operation, where `n` is . ## Examples - The following code example shows how to use the method of the interface with a . The example demonstrates that the method returns `false` if a key of the wrong data type is supplied. + The following code example shows how to use the method of the interface with a . The example demonstrates that the method returns `false` if a key of the wrong data type is supplied. - The code example is part of a larger example, including output, provided for the method. + The code example is part of a larger example, including output, provided for the method. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedDictionaryTKey,TValue/System.Collections.IDictionary.Add/source.cs" id="Snippet31"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/System.Collections.IDictionary.Add/source.vb" id="Snippet31"::: @@ -2094,13 +2094,13 @@ Getting the value of this property is an O(1) operation. Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection. - Initially, the enumerator is positioned before the first element in the collection. The method also brings the enumerator back to this position. At this position, is undefined. Therefore, you must call the method to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. The method also brings the enumerator back to this position. At this position, is undefined. Therefore, you must call the method to advance the enumerator to the first element of the collection before reading the value of . - The property returns the same object until either or is called. sets to the next element. + The property returns the same object until either or is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. To set to the first element of the collection again, you can call followed by . + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. To set to the first element of the collection again, you can call followed by . - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization. @@ -2111,9 +2111,9 @@ Getting the value of this property is an O(1) operation. ## Examples - The following code example shows how to enumerate the key/value pairs in the dictionary by using the `foreach` statement (`For Each` in Visual Basic), which hides the use of the enumerator. In particular, note that the enumerator for the interface returns objects rather than objects. + The following code example shows how to enumerate the key/value pairs in the dictionary by using the `foreach` statement (`For Each` in Visual Basic), which hides the use of the enumerator. In particular, note that the enumerator for the interface returns objects rather than objects. - The code example is part of a larger example, including output, provided for the method. + The code example is part of a larger example, including output, provided for the method. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedDictionaryTKey,TValue/System.Collections.IDictionary.Add/source.cs" id="Snippet31"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/System.Collections.IDictionary.Add/source.vb" id="Snippet31"::: @@ -2304,20 +2304,20 @@ Getting the value of this property is an O(1) operation. ## Remarks This property provides the ability to access a specific element in the collection by using the following C# syntax: `myCollection[key]` (`myCollection(key)` in Visual Basic). - You can also use the property to add new elements by setting the value of a key that does not exist in the dictionary; for example, `myCollection["myNonexistentKey"] = myValue`. However, if the specified key already exists in the dictionary, setting the property overwrites the old value. In contrast, the method does not modify existing elements. + You can also use the property to add new elements by setting the value of a key that does not exist in the dictionary; for example, `myCollection["myNonexistentKey"] = myValue`. However, if the specified key already exists in the dictionary, setting the property overwrites the old value. In contrast, the method does not modify existing elements. - The C# language uses the [this](/dotnet/csharp/language-reference/keywords/this) keyword to define the indexers instead of implementing the property. Visual Basic implements as a default property, which provides the same indexing functionality. + The C# language uses the [this](/dotnet/csharp/language-reference/keywords/this) keyword to define the indexers instead of implementing the property. Visual Basic implements as a default property, which provides the same indexing functionality. Getting the value of this property is an O(log `n`) operation; setting the property is also an O(log `n`) operation. ## Examples - The following code example shows how to use the property (the indexer in C#) of the interface with a , and ways the property differs from the property. + The following code example shows how to use the property (the indexer in C#) of the interface with a , and ways the property differs from the property. - The example shows that, like the property, the property can change the value associated with an existing key and can be used to add a new key/value pair if the specified key is not in the dictionary. The example also shows that unlike the property, the property does not throw an exception if `key` is not in the dictionary, returning a null reference instead. Finally, the example demonstrates that getting the property returns a null reference if `key` is not the correct data type, and that setting the property throws an exception if `key` is not the correct data type. + The example shows that, like the property, the property can change the value associated with an existing key and can be used to add a new key/value pair if the specified key is not in the dictionary. The example also shows that unlike the property, the property does not throw an exception if `key` is not in the dictionary, returning a null reference instead. Finally, the example demonstrates that getting the property returns a null reference if `key` is not the correct data type, and that setting the property throws an exception if `key` is not the correct data type. - The code example is part of a larger example, including output, provided for the method. + The code example is part of a larger example, including output, provided for the method. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedDictionaryTKey,TValue/System.Collections.IDictionary.Add/source.cs" id="Snippet31"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/System.Collections.IDictionary.Add/source.vb" id="Snippet31"::: @@ -2393,16 +2393,16 @@ Getting the value of this property is an O(1) operation. are sorted according to the property and are guaranteed to be in the same order as the corresponding values in the returned by the property. + The keys in the returned are sorted according to the property and are guaranteed to be in the same order as the corresponding values in the returned by the property. Getting the value of this property is an O(1) operation. ## Examples - The following code example shows how to use the property of the interface with a , to list the keys in the dictionary. The example also shows how to enumerate the key/value pairs in the dictionary; note that the enumerator for the interface returns objects rather than objects. + The following code example shows how to use the property of the interface with a , to list the keys in the dictionary. The example also shows how to enumerate the key/value pairs in the dictionary; note that the enumerator for the interface returns objects rather than objects. - The code example is part of a larger example, including output, provided for the method. + The code example is part of a larger example, including output, provided for the method. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedDictionaryTKey,TValue/System.Collections.IDictionary.Add/source.cs" id="Snippet31"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/System.Collections.IDictionary.Add/source.vb" id="Snippet31"::: @@ -2473,9 +2473,9 @@ Getting the value of this property is an O(1) operation. ## Examples - The following code example shows how to use the of the interface with a . + The following code example shows how to use the of the interface with a . - The code example is part of a larger example, including output, provided for the method. + The code example is part of a larger example, including output, provided for the method. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedDictionaryTKey,TValue/System.Collections.IDictionary.Add/source.cs" id="Snippet31"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/System.Collections.IDictionary.Add/source.vb" id="Snippet31"::: @@ -2543,16 +2543,16 @@ Getting the value of this property is an O(1) operation. are sorted according to the property, and are guaranteed to be in the same order as the corresponding keys in the returned by the property. + The values in the returned are sorted according to the property, and are guaranteed to be in the same order as the corresponding keys in the returned by the property. Getting the value of this property is an O(1) operation. ## Examples - The following code example shows how to use the property of the interface with a , to list the values in the dictionary. The example also shows how to enumerate the key/value pairs in the dictionary; note that the enumerator for the interface returns objects rather than objects. + The following code example shows how to use the property of the interface with a , to list the values in the dictionary. The example also shows how to enumerate the key/value pairs in the dictionary; note that the enumerator for the interface returns objects rather than objects. - The code example is part of a larger example, including output, provided for the method. + The code example is part of a larger example, including output, provided for the method. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedDictionaryTKey,TValue/System.Collections.IDictionary.Add/source.cs" id="Snippet31"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/System.Collections.IDictionary.Add/source.vb" id="Snippet31"::: @@ -2621,13 +2621,13 @@ Getting the value of this property is an O(1) operation. Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection. - Initially, the enumerator is positioned before the first element in the collection. At this position, the property is undefined. Therefore, you must call the method to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. At this position, the property is undefined. Therefore, you must call the method to advance the enumerator to the first element of the collection before reading the value of . - The property returns the same element until the method is called. sets to the next element. + The property returns the same element until the method is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator instance instead. + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator instance instead. - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization. @@ -2703,7 +2703,7 @@ Getting the value of this property is an O(1) operation. method and the property. + This method combines the functionality of the method and the property. If the key is not found, then the `value` parameter gets the appropriate default value for the value type `TValue`; for example, 0 (zero) for integer types, `false` for Boolean types, and `null` for reference types. @@ -2712,9 +2712,9 @@ Getting the value of this property is an O(1) operation. ## Examples - The example shows how to use the method as a more efficient way to retrieve values in a program that frequently tries keys that are not in the dictionary. For contrast, the example also shows how the property (the indexer in C#) throws exceptions when attempting to retrieve nonexistent keys. + The example shows how to use the method as a more efficient way to retrieve values in a program that frequently tries keys that are not in the dictionary. For contrast, the example also shows how the property (the indexer in C#) throws exceptions when attempting to retrieve nonexistent keys. - This code example is part of a larger example provided for the class. + This code example is part of a larger example provided for the class. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedDictionaryTKey,TValue/Overview/source.cs" id="Snippet5"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/Overview/source.vb" id="Snippet5"::: @@ -2773,18 +2773,18 @@ Getting the value of this property is an O(1) operation. are sorted according to the property, and are in the same order as the associated keys in the returned by the property. + The values in the are sorted according to the property, and are in the same order as the associated keys in the returned by the property. - The returned is not a static copy; instead, the refers back to the values in the original . Therefore, changes to the continue to be reflected in the . + The returned is not a static copy; instead, the refers back to the values in the original . Therefore, changes to the continue to be reflected in the . Getting the value of this property is an O(1) operation. ## Examples - This code example shows how to enumerate the values in the dictionary using the property, and how to enumerate the keys and values in the dictionary. + This code example shows how to enumerate the values in the dictionary using the property, and how to enumerate the keys and values in the dictionary. - This code example is part of a larger example provided for the class. + This code example is part of a larger example provided for the class. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedDictionaryTKey,TValue/Overview/source.cs" id="Snippet8"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedDictionaryTKey,TValue/Overview/source.vb" id="Snippet8"::: diff --git a/xml/System.Collections.Generic/SortedList`2.xml b/xml/System.Collections.Generic/SortedList`2.xml index e82afde981d..02da1821dcf 100644 --- a/xml/System.Collections.Generic/SortedList`2.xml +++ b/xml/System.Collections.Generic/SortedList`2.xml @@ -119,31 +119,31 @@ generic class is an array of key/value pairs with O(log `n`) retrieval, where n is the number of elements in the dictionary. In this, it is similar to the generic class. The two classes have similar object models, and both have O(log `n`) retrieval. Where the two classes differ is in memory use and speed of insertion and removal: + The generic class is an array of key/value pairs with O(log `n`) retrieval, where n is the number of elements in the dictionary. In this, it is similar to the generic class. The two classes have similar object models, and both have O(log `n`) retrieval. Where the two classes differ is in memory use and speed of insertion and removal: -- uses less memory than . +- uses less memory than . -- has faster insertion and removal operations for unsorted data, O(log `n`) as opposed to O(`n`) for . +- has faster insertion and removal operations for unsorted data, O(log `n`) as opposed to O(`n`) for . -- If the list is populated all at once from sorted data, is faster than . +- If the list is populated all at once from sorted data, is faster than . - Another difference between the and classes is that supports efficient indexed retrieval of keys and values through the collections returned by the and properties. It is not necessary to regenerate the lists when the properties are accessed, because the lists are just wrappers for the internal arrays of keys and values. The following code shows the use of the property for indexed retrieval of values from a sorted list of strings: + Another difference between the and classes is that supports efficient indexed retrieval of keys and values through the collections returned by the and properties. It is not necessary to regenerate the lists when the properties are accessed, because the lists are just wrappers for the internal arrays of keys and values. The following code shows the use of the property for indexed retrieval of values from a sorted list of strings: :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedListTKey,TValue/Overview/remarks.cs" id="Snippet11"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/Overview/remarks.vb" id="Snippet11"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/SortedListTKey,TValue/Overview/remarks.fs" id="Snippet11"::: - is implemented as an array of key/value pairs, sorted by the key. Each element can be retrieved as a object. + is implemented as an array of key/value pairs, sorted by the key. Each element can be retrieved as a object. - Key objects must be immutable as long as they are used as keys in the . Every key in a must be unique. A key cannot be `null`, but a value can be, if the type of values in the list, `TValue`, is a reference type. + Key objects must be immutable as long as they are used as keys in the . Every key in a must be unique. A key cannot be `null`, but a value can be, if the type of values in the list, `TValue`, is a reference type. - requires a comparer implementation to sort and to perform comparisons. The default comparer checks whether the key type `TKey` implements and uses that implementation, if available. If not, checks whether the key type `TKey` implements . If the key type `TKey` does not implement either interface, you can specify a implementation in a constructor overload that accepts a `comparer` parameter. + requires a comparer implementation to sort and to perform comparisons. The default comparer checks whether the key type `TKey` implements and uses that implementation, if available. If not, checks whether the key type `TKey` implements . If the key type `TKey` does not implement either interface, you can specify a implementation in a constructor overload that accepts a `comparer` parameter. - The capacity of a is the number of elements the can hold. As elements are added to a , the capacity is automatically increased as required by reallocating the internal array. The capacity can be decreased by calling or by setting the property explicitly. Decreasing the capacity reallocates memory and copies all the elements in the . + The capacity of a is the number of elements the can hold. As elements are added to a , the capacity is automatically increased as required by reallocating the internal array. The capacity can be decreased by calling or by setting the property explicitly. Decreasing the capacity reallocates memory and copies all the elements in the . - **.NET Framework only:** For very large objects, you can increase the maximum capacity to 2 billion elements on a 64-bit system by setting the `enabled` attribute of the [``](/dotnet/framework/configure-apps/file-schema/runtime/gcallowverylargeobjects-element) configuration element to `true` in the run-time environment. + **.NET Framework only:** For very large objects, you can increase the maximum capacity to 2 billion elements on a 64-bit system by setting the `enabled` attribute of the [``](/dotnet/framework/configure-apps/file-schema/runtime/gcallowverylargeobjects-element) configuration element to `true` in the run-time environment. - The `foreach` statement of the C# language (`For Each` in Visual Basic) returns an object of the type of the elements in the collection. Since the elements of the are key/value pairs, the element type is not the type of the key or the type of the value. Instead, the element type is . For example: + The `foreach` statement of the C# language (`For Each` in Visual Basic) returns an object of the type of the elements in the collection. Since the elements of the are key/value pairs, the element type is not the type of the key or the type of the value. Instead, the element type is . For example: :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedListTKey,TValue/Overview/remarks.cs" id="Snippet12"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/Overview/remarks.vb" id="Snippet12"::: @@ -154,15 +154,15 @@ ## Examples - The following code example creates an empty of strings with string keys and uses the method to add some elements. The example demonstrates that the method throws an when attempting to add a duplicate key. + The following code example creates an empty of strings with string keys and uses the method to add some elements. The example demonstrates that the method throws an when attempting to add a duplicate key. - The example uses the property (the indexer in C#) to retrieve values, demonstrating that a is thrown when a requested key is not present, and showing that the value associated with a key can be replaced. + The example uses the property (the indexer in C#) to retrieve values, demonstrating that a is thrown when a requested key is not present, and showing that the value associated with a key can be replaced. - The example shows how to use the method as a more efficient way to retrieve values if a program often must try key values that are not in the sorted list, and it shows how to use the method to test whether a key exists before calling the method. + The example shows how to use the method as a more efficient way to retrieve values if a program often must try key values that are not in the sorted list, and it shows how to use the method to test whether a key exists before calling the method. - The example shows how to enumerate the keys and values in the sorted list and how to enumerate the keys and values alone using the property and the property. + The example shows how to enumerate the keys and values in the sorted list and how to enumerate the keys and values alone using the property and the property. - Finally, the example demonstrates the method. + Finally, the example demonstrates the method. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedListTKey,TValue/Overview/source.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/Overview/source.vb" id="Snippet1"::: @@ -229,20 +229,20 @@ must be unique according to the default comparer. + Every key in a must be unique according to the default comparer. - This constructor uses the default value for the initial capacity of the . To set the initial capacity, use the constructor. If the final size of the collection can be estimated, specifying the initial capacity eliminates the need to perform a number of resizing operations while adding elements to the . + This constructor uses the default value for the initial capacity of the . To set the initial capacity, use the constructor. If the final size of the collection can be estimated, specifying the initial capacity eliminates the need to perform a number of resizing operations while adding elements to the . - This constructor uses the default comparer for `TKey`. To specify a comparer, use the constructor. The default comparer checks whether the key type `TKey` implements and uses that implementation, if available. If not, checks whether the key type `TKey` implements . If the key type `TKey` does not implement either interface, you can specify a implementation in a constructor overload that accepts a `comparer` parameter. + This constructor uses the default comparer for `TKey`. To specify a comparer, use the constructor. The default comparer checks whether the key type `TKey` implements and uses that implementation, if available. If not, checks whether the key type `TKey` implements . If the key type `TKey` does not implement either interface, you can specify a implementation in a constructor overload that accepts a `comparer` parameter. This constructor is an O(1) operation. ## Examples - The following code example creates an empty of strings with string keys and uses the method to add some elements. The example demonstrates that the method throws an when attempting to add a duplicate key. + The following code example creates an empty of strings with string keys and uses the method to add some elements. The example demonstrates that the method throws an when attempting to add a duplicate key. - This code example is part of a larger example provided for the class. + This code example is part of a larger example provided for the class. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedListTKey,TValue/Overview/source.cs" interactive="try-dotnet-method" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/Overview/source.vb" id="Snippet2"::: @@ -310,9 +310,9 @@ must be unique according to the specified comparer. + Every key in a must be unique according to the specified comparer. - This constructor uses the default value for the initial capacity of the . To set the initial capacity, use the constructor. If the final size of the collection can be estimated, specifying the initial capacity eliminates the need to perform a number of resizing operations while adding elements to the . + This constructor uses the default value for the initial capacity of the . To set the initial capacity, use the constructor. If the final size of the collection can be estimated, specifying the initial capacity eliminates the need to perform a number of resizing operations while adding elements to the . This constructor is an O(1) operation. @@ -381,18 +381,18 @@ must be unique according to the default comparer; likewise, every key in the source `dictionary` must also be unique according to the default comparer. + Every key in a must be unique according to the default comparer; likewise, every key in the source `dictionary` must also be unique according to the default comparer. - The capacity of the new is set to the number of elements in `dictionary`, so no resizing takes place while the list is being populated. + The capacity of the new is set to the number of elements in `dictionary`, so no resizing takes place while the list is being populated. - This constructor uses the default comparer for `TKey`. To specify a comparer, use the constructor. The default comparer checks whether the key type `TKey` implements and uses that implementation, if available. If not, checks whether the key type `TKey` implements . If the key type `TKey` does not implement either interface, you can specify a implementation in a constructor overload that accepts a `comparer` parameter. + This constructor uses the default comparer for `TKey`. To specify a comparer, use the constructor. The default comparer checks whether the key type `TKey` implements and uses that implementation, if available. If not, checks whether the key type `TKey` implements . If the key type `TKey` does not implement either interface, you can specify a implementation in a constructor overload that accepts a `comparer` parameter. - The keys in `dictionary` are copied to the new and sorted once, which makes this constructor an O(`n` log `n`) operation. + The keys in `dictionary` are copied to the new and sorted once, which makes this constructor an O(`n` log `n`) operation. ## Examples - The following code example shows how to use to create a sorted copy of the information in a , by passing the to the constructor. + The following code example shows how to use to create a sorted copy of the information in a , by passing the to the constructor. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedListTKey,TValue/.ctor/source1.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/.ctor/source1.vb" id="Snippet1"::: @@ -452,15 +452,15 @@ must be unique according to the default comparer. + Every key in a must be unique according to the default comparer. - The capacity of a is the number of elements that the can hold before resizing. As elements are added to a , the capacity is automatically increased as required by reallocating the internal array. + The capacity of a is the number of elements that the can hold before resizing. As elements are added to a , the capacity is automatically increased as required by reallocating the internal array. - If the size of the collection can be estimated, specifying the initial capacity eliminates the need to perform a number of resizing operations while adding elements to the . + If the size of the collection can be estimated, specifying the initial capacity eliminates the need to perform a number of resizing operations while adding elements to the . - The capacity can be decreased by calling or by setting the property explicitly. Decreasing the capacity reallocates memory and copies all the elements in the . + The capacity can be decreased by calling or by setting the property explicitly. Decreasing the capacity reallocates memory and copies all the elements in the . - This constructor uses the default comparer for `TKey`. To specify a comparer, use the constructor. The default comparer checks whether the key type `TKey` implements and uses that implementation, if available. If not, checks whether the key type `TKey` implements . If the key type `TKey` does not implement either interface, you can specify a implementation in a constructor overload that accepts a `comparer` parameter. + This constructor uses the default comparer for `TKey`. To specify a comparer, use the constructor. The default comparer checks whether the key type `TKey` implements and uses that implementation, if available. If not, checks whether the key type `TKey` implements . If the key type `TKey` does not implement either interface, you can specify a implementation in a constructor overload that accepts a `comparer` parameter. This constructor is an O(`n`) operation, where `n` is `capacity`. @@ -539,16 +539,16 @@ must be unique according to the specified comparer; likewise, every key in the source `dictionary` must also be unique according to the specified comparer. + Every key in a must be unique according to the specified comparer; likewise, every key in the source `dictionary` must also be unique according to the specified comparer. - The capacity of the new is set to the number of elements in `dictionary`, so no resizing takes place while the list is being populated. + The capacity of the new is set to the number of elements in `dictionary`, so no resizing takes place while the list is being populated. - The keys in `dictionary` are copied to the new and sorted once, which makes this constructor an O(`n` log `n`) operation. + The keys in `dictionary` are copied to the new and sorted once, which makes this constructor an O(`n` log `n`) operation. ## Examples - The following code example shows how to use to create a case-insensitive sorted copy of the information in a case-insensitive , by passing the to the constructor. In this example, the case-insensitive comparers are for the current culture. + The following code example shows how to use to create a case-insensitive sorted copy of the information in a case-insensitive , by passing the to the constructor. In this example, the case-insensitive comparers are for the current culture. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedListTKey,TValue/.ctor/source2.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/.ctor/source2.vb" id="Snippet1"::: @@ -623,13 +623,13 @@ must be unique according to the specified comparer. + Every key in a must be unique according to the specified comparer. - The capacity of a is the number of elements that the can hold before resizing. As elements are added to a , the capacity is automatically increased as required by reallocating the internal array. + The capacity of a is the number of elements that the can hold before resizing. As elements are added to a , the capacity is automatically increased as required by reallocating the internal array. - If the size of the collection can be estimated, specifying the initial capacity eliminates the need to perform a number of resizing operations while adding elements to the . + If the size of the collection can be estimated, specifying the initial capacity eliminates the need to perform a number of resizing operations while adding elements to the . - The capacity can be decreased by calling or by setting the property explicitly. Decreasing the capacity reallocates memory and copies all the elements in the . + The capacity can be decreased by calling or by setting the property explicitly. Decreasing the capacity reallocates memory and copies all the elements in the . This constructor is an O(`n`) operation, where `n` is `capacity`. @@ -705,18 +705,18 @@ ## Remarks A key cannot be `null`, but a value can be, if the type of values in the sorted list, `TValue`, is a reference type. - You can also use the property to add new elements by setting the value of a key that does not exist in the ; for example, `myCollection["myNonexistentKey"] = myValue`. However, if the specified key already exists in the , setting the property overwrites the old value. In contrast, the method does not modify existing elements. + You can also use the property to add new elements by setting the value of a key that does not exist in the ; for example, `myCollection["myNonexistentKey"] = myValue`. However, if the specified key already exists in the , setting the property overwrites the old value. In contrast, the method does not modify existing elements. - If already equals , the capacity of the is increased by automatically reallocating the internal array, and the existing elements are copied to the new array before the new element is added. + If already equals , the capacity of the is increased by automatically reallocating the internal array, and the existing elements are copied to the new array before the new element is added. - This method is an O(`n`) operation for unsorted data, where `n` is . It is an O(log `n`) operation if the new element is added at the end of the list. If insertion causes a resize, the operation is O(`n`). + This method is an O(`n`) operation for unsorted data, where `n` is . It is an O(log `n`) operation if the new element is added at the end of the list. If insertion causes a resize, the operation is O(`n`). ## Examples - The following code example creates an empty of strings with string keys and uses the method to add some elements. The example demonstrates that the method throws an when attempting to add a duplicate key. + The following code example creates an empty of strings with string keys and uses the method to add some elements. The example demonstrates that the method throws an when attempting to add a duplicate key. - This code example is part of a larger example provided for the class. + This code example is part of a larger example provided for the class. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedListTKey,TValue/Overview/source.cs" interactive="try-dotnet-method" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/Overview/source.vb" id="Snippet2"::: @@ -775,11 +775,11 @@ is the number of elements that the can store. is the number of elements that are actually in the . + is the number of elements that the can store. is the number of elements that are actually in the . - is always greater than or equal to . If exceeds while adding elements, the capacity is increased by automatically reallocating the internal array before copying the old elements and adding the new elements. + is always greater than or equal to . If exceeds while adding elements, the capacity is increased by automatically reallocating the internal array before copying the old elements and adding the new elements. - The capacity can be decreased by calling or by setting the property explicitly. When the value of is set explicitly, the internal array is also reallocated to accommodate the specified capacity. + The capacity can be decreased by calling or by setting the property explicitly. When the value of is set explicitly, the internal array is also reallocated to accommodate the specified capacity. Retrieving the value of this property is an O(1) operation; setting the property is an O(`n`) operation, where `n` is the new capacity. @@ -839,11 +839,11 @@ is set to zero, and references to other objects from elements of the collection are also released. + is set to zero, and references to other objects from elements of the collection are also released. - remains unchanged. To reset the capacity of the , call or set the property directly. Trimming an empty sets the capacity of the to the default capacity. + remains unchanged. To reset the capacity of the , call or set the property directly. Trimming an empty sets the capacity of the to the default capacity. - This method is an O(`n`) operation, where `n` is . + This method is an O(`n`) operation, where `n` is . ]]> @@ -959,14 +959,14 @@ . + This method is an O(log `n`) operation, where `n` is . ## Examples - The following code example shows how to use the method to test whether a key exists prior to calling the method. It also shows how to use the method to retrieve values, which is an efficient way to retrieve values when a program frequently tries keys that are not in the sorted list. Finally, it shows the least efficient way to test whether keys exist, by using the property (the indexer in C#). + The following code example shows how to use the method to test whether a key exists prior to calling the method. It also shows how to use the method to retrieve values, which is an efficient way to retrieve values when a program frequently tries keys that are not in the sorted list. Finally, it shows the least efficient way to test whether keys exist, by using the property (the indexer in C#). - This code example is part of a larger example provided for the class. + This code example is part of a larger example provided for the class. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedListTKey,TValue/Overview/source.cs" id="Snippet6"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/Overview/source.vb" id="Snippet6"::: @@ -1034,9 +1034,9 @@ for the value type `TValue`. checks whether the value type `TValue` implements and uses that implementation, if available. If not, checks whether the value type `TValue` implements . If the value type `TValue` does not implement either interface, this method uses . + This method determines equality using the default comparer for the value type `TValue`. checks whether the value type `TValue` implements and uses that implementation, if available. If not, checks whether the value type `TValue` implements . If the value type `TValue` does not implement either interface, this method uses . - This method performs a linear search; therefore, the average execution time is proportional to . That is, this method is an O(`n`) operation, where `n` is . + This method performs a linear search; therefore, the average execution time is proportional to . That is, this method is an O(`n`) operation, where `n` is . ]]> @@ -1098,9 +1098,9 @@ is the number of elements that the can store. is the number of elements that are actually in the . + is the number of elements that the can store. is the number of elements that are actually in the . - is always greater than or equal to . If exceeds while adding elements, the capacity is increased by automatically reallocating the internal array before copying the old elements and adding the new elements. + is always greater than or equal to . If exceeds while adding elements, the capacity is increased by automatically reallocating the internal array before copying the old elements and adding the new elements. Retrieving the value of this property is an O(1) operation. @@ -1162,13 +1162,13 @@ The dictionary is maintained in a sorted order using an internal tree. Every new element is positioned at the correct sort position, and the tree is adjusted to maintain the sort order whenever an element is removed. While enumerating, the sort order is maintained. - Initially, the enumerator is positioned before the first element in the collection. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . - returns the same object until is called. sets to the next element. + returns the same object until is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to return `false`. If the last call to returned `false`, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator instance instead. + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to return `false`. If the last call to returned `false`, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator instance instead. - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization. @@ -1294,7 +1294,7 @@ . + This method performs a binary search; therefore, this method is an O(log `n`) operation, where `n` is . ]]> @@ -1351,9 +1351,9 @@ for the value type `TValue`. checks whether the value type `TValue` implements and uses that implementation, if available. If not, checks whether the value type `TValue` implements . If the value type `TValue` does not implement either interface, this method uses . + This method determines equality using the default comparer for the value type `TValue`. checks whether the value type `TValue` implements and uses that implementation, if available. If not, checks whether the value type `TValue` implements . If the value type `TValue` does not implement either interface, this method uses . - This method performs a linear search; therefore, the average execution time is proportional to . That is, this method is an O(`n`) operation, where `n` is . + This method performs a linear search; therefore, the average execution time is proportional to . That is, this method is an O(`n`) operation, where `n` is . ]]> @@ -1417,20 +1417,20 @@ If the key is not found when a value is being retrieved, is thrown. If the key is not found when a value is being set, the key and value are added. - You can also use the property to add new elements by setting the value of a key that does not exist in the ; for example, `myCollection["myNonexistentKey"] = myValue`. However, if the specified key already exists in the , setting the property overwrites the old value. In contrast, the method does not modify existing elements. + You can also use the property to add new elements by setting the value of a key that does not exist in the ; for example, `myCollection["myNonexistentKey"] = myValue`. However, if the specified key already exists in the , setting the property overwrites the old value. In contrast, the method does not modify existing elements. - The C# language uses the [`this`](/dotnet/csharp/language-reference/keywords/this) keyword to define the indexers instead of implementing the property. Visual Basic implements as a default property, which provides the same indexing functionality. + The C# language uses the [`this`](/dotnet/csharp/language-reference/keywords/this) keyword to define the indexers instead of implementing the property. Visual Basic implements as a default property, which provides the same indexing functionality. - Retrieving the value of this property is an O(log `n`) operation, where n is . Setting the property is an O(log `n`) operation if the key is already in the . If the key is not in the list, setting the property is an O(`n`) operation for unsorted data, or O(log `n`) if the new element is added at the end of the list. If insertion causes a resize, the operation is O(`n`). + Retrieving the value of this property is an O(log `n`) operation, where n is . Setting the property is an O(log `n`) operation if the key is already in the . If the key is not in the list, setting the property is an O(`n`) operation for unsorted data, or O(log `n`) if the new element is added at the end of the list. If insertion causes a resize, the operation is O(`n`). ## Examples - The following code example uses the property (the indexer in C#) to retrieve values, demonstrating that a is thrown when a requested key is not present, and showing that the value associated with a key can be replaced. + The following code example uses the property (the indexer in C#) to retrieve values, demonstrating that a is thrown when a requested key is not present, and showing that the value associated with a key can be replaced. - The example also shows how to use the method as a more efficient way to retrieve values if a program often must try key values that are not in the sorted list. + The example also shows how to use the method as a more efficient way to retrieve values if a program often must try key values that are not in the sorted list. - This code example is part of a larger example provided for the class. + This code example is part of a larger example provided for the class. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedListTKey,TValue/Overview/source.cs" id="Snippet3"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/Overview/source.vb" id="Snippet3"::: @@ -1499,11 +1499,11 @@ is the same as the order in the . + The order of the keys in the is the same as the order in the . - The returned is not a static copy; instead, the refers back to the keys in the original . Therefore, changes to the continue to be reflected in the . + The returned is not a static copy; instead, the refers back to the keys in the original . Therefore, changes to the continue to be reflected in the . - The collection returned by the property provides an efficient way to retrieve keys by index. It is not necessary to regenerate the list when the property is accessed, because the list is just a wrapper for the internal array of keys. The following code shows the use of the property for indexed retrieval of keys from a sorted list of elements with string keys: + The collection returned by the property provides an efficient way to retrieve keys by index. It is not necessary to regenerate the list when the property is accessed, because the list is just a wrapper for the internal array of keys. The following code shows the use of the property for indexed retrieval of keys from a sorted list of elements with string keys: :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedListTKey,TValue/Overview/remarks.cs" id="Snippet11"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/Overview/remarks.vb" id="Snippet11"::: @@ -1514,11 +1514,11 @@ ## Examples - The following code example shows how to enumerate the keys in the sorted list using the property, and how to enumerate the keys and values in the sorted list. + The following code example shows how to enumerate the keys in the sorted list using the property, and how to enumerate the keys and values in the sorted list. - The example also shows how to use the property for efficient indexed retrieval of keys. + The example also shows how to use the property for efficient indexed retrieval of keys. - This code is part of a larger example that can be compiled and executed. See . + This code is part of a larger example that can be compiled and executed. See . :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedListTKey,TValue/Overview/source.cs" id="Snippet9"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/Overview/source.vb" id="Snippet9"::: @@ -1584,14 +1584,14 @@ . + This method performs a binary search; however, the elements are moved up to fill in the open spot, so this method is an O(`n`) operation, where `n` is . ## Examples - The following code example shows how to remove a key/value pair from the sorted list using the method. + The following code example shows how to remove a key/value pair from the sorted list using the method. - This code example is part of a larger example provided for the class. + This code example is part of a larger example provided for the class. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedListTKey,TValue/Overview/source.cs" id="Snippet10"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/Overview/source.vb" id="Snippet10"::: @@ -1652,7 +1652,7 @@ . + The elements are moved up to fill in the open spot, so this method is an O(`n`) operation, where `n` is . ]]> @@ -2246,9 +2246,9 @@ ## Remarks > [!NOTE] -> If the type of the source cannot be cast automatically to the type of the destination `array`, the non-generic implementations of throw , whereas the generic implementations throw . +> If the type of the source cannot be cast automatically to the type of the destination `array`, the non-generic implementations of throw , whereas the generic implementations throw . - This method is an O(`n`) operation, where `n` is . + This method is an O(`n`) operation, where `n` is . ]]> @@ -2457,14 +2457,14 @@ Retrieving the value of this property is an O(1) operation. property to add new elements by setting the value of a key that does not exist in the dictionary; for example, `myCollection["myNonexistentKey"] = myValue`. However, if the specified key already exists in the dictionary, setting the property overwrites the old value. In contrast, the method does not modify existing elements. + You can also use the property to add new elements by setting the value of a key that does not exist in the dictionary; for example, `myCollection["myNonexistentKey"] = myValue`. However, if the specified key already exists in the dictionary, setting the property overwrites the old value. In contrast, the method does not modify existing elements. - This method is an O(`n`) operation for unsorted data, where `n` is . It is an O(log `n`) operation if the new element is added at the end of the list. If insertion causes a resize, the operation is O(`n`). + This method is an O(`n`) operation for unsorted data, where `n` is . It is an O(log `n`) operation if the new element is added at the end of the list. If insertion causes a resize, the operation is O(`n`). ## Examples - The following code example shows how to access the class through the interface. The code example creates an empty of strings with string keys and uses the method to add some elements. The example demonstrates that the method throws an when attempting to add a duplicate key, or when a key or value of the wrong data type is supplied. + The following code example shows how to access the class through the interface. The code example creates an empty of strings with string keys and uses the method to add some elements. The example demonstrates that the method throws an when attempting to add a duplicate key, or when a key or value of the wrong data type is supplied. The code example demonstrates the use of several other members of the interface. @@ -2539,16 +2539,16 @@ Retrieving the value of this property is an O(1) operation. . + This method returns `false` if `key` is of a type that is not assignable to the key type `TKey` of the . - This method is an O(log `n`) operation, where `n` is . + This method is an O(log `n`) operation, where `n` is . ## Examples - The following code example shows how to use the method of the interface with a . The example demonstrates that the method returns `false` if a key of the wrong data type is supplied. + The following code example shows how to use the method of the interface with a . The example demonstrates that the method returns `false` if a key of the wrong data type is supplied. - The code example is part of a larger example, including output, provided for the method. + The code example is part of a larger example, including output, provided for the method. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedListTKey,TValue/System.Collections.IDictionary.Add/source.cs" id="Snippet31"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/System.Collections.IDictionary.Add/source.vb" id="Snippet31"::: @@ -2616,13 +2616,13 @@ Retrieving the value of this property is an O(1) operation. Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection. - Initially, the enumerator is positioned before the first element in the collection. also brings the enumerator back to this position. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. also brings the enumerator back to this position. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . - returns the same object until either or is called. sets to the next element. + returns the same object until either or is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. To set to the first element of the collection again, you can call followed by . + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. To set to the first element of the collection again, you can call followed by . - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization. @@ -2633,9 +2633,9 @@ Retrieving the value of this property is an O(1) operation. ## Examples - The following code example shows how to enumerate the key/value pairs in the sorted list by using the `foreach` statement (`For Each` in Visual Basic), which hides the use of the enumerator. In particular, note that the enumerator for the interface returns objects rather than objects. + The following code example shows how to enumerate the key/value pairs in the sorted list by using the `foreach` statement (`For Each` in Visual Basic), which hides the use of the enumerator. In particular, note that the enumerator for the interface returns objects rather than objects. - The code example is part of a larger example, including output, provided for the method. + The code example is part of a larger example, including output, provided for the method. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedListTKey,TValue/System.Collections.IDictionary.Add/source.cs" id="Snippet31"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/System.Collections.IDictionary.Add/source.vb" id="Snippet31"::: @@ -2825,24 +2825,24 @@ Retrieving the value of this property is an O(1) operation. . + This property returns `null` if `key` is of a type that is not assignable to the key type `TKey` of the . This property provides the ability to access a specific element in the collection by using the following syntax: `myCollection[key]`. - You can also use the property to add new elements by setting the value of a key that does not exist in the dictionary; for example, `myCollection["myNonexistentKey"] = myValue`. However, if the specified key already exists in the dictionary, setting the property overwrites the old value. In contrast, the method does not modify existing elements. + You can also use the property to add new elements by setting the value of a key that does not exist in the dictionary; for example, `myCollection["myNonexistentKey"] = myValue`. However, if the specified key already exists in the dictionary, setting the property overwrites the old value. In contrast, the method does not modify existing elements. - The C# language uses the [this](/dotnet/csharp/language-reference/keywords/this) keyword to define the indexers instead of implementing the property. Visual Basic implements as a default property, which provides the same indexing functionality. + The C# language uses the [this](/dotnet/csharp/language-reference/keywords/this) keyword to define the indexers instead of implementing the property. Visual Basic implements as a default property, which provides the same indexing functionality. - Retrieving the value of this property is an O(log `n`) operation, where n is . Setting the property is an O(log `n`) operation if the key is already in the . If the key is not in the list, setting the property is an O(`n`) operation for unsorted data, or O(log `n`) if the new element is added at the end of the list. If insertion causes a resize, the operation is O(`n`). + Retrieving the value of this property is an O(log `n`) operation, where n is . Setting the property is an O(log `n`) operation if the key is already in the . If the key is not in the list, setting the property is an O(`n`) operation for unsorted data, or O(log `n`) if the new element is added at the end of the list. If insertion causes a resize, the operation is O(`n`). ## Examples - The following code example shows how to use the property (the indexer in C#) of the interface with a , and ways the property differs from the property. + The following code example shows how to use the property (the indexer in C#) of the interface with a , and ways the property differs from the property. - The example shows that, like the property, the property can change the value associated with an existing key and can be used to add a new key/value pair if the specified key is not in the sorted list. The example also shows that unlike the property, the property does not throw an exception if `key` is not in the sorted list, returning a null reference instead. Finally, the example demonstrates that getting the property returns a null reference if `key` is not the correct data type, and that setting the property throws an exception if `key` is not the correct data type. + The example shows that, like the property, the property can change the value associated with an existing key and can be used to add a new key/value pair if the specified key is not in the sorted list. The example also shows that unlike the property, the property does not throw an exception if `key` is not in the sorted list, returning a null reference instead. Finally, the example demonstrates that getting the property returns a null reference if `key` is not the correct data type, and that setting the property throws an exception if `key` is not the correct data type. - The code example is part of a larger example, including output, provided for the method. + The code example is part of a larger example, including output, provided for the method. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedListTKey,TValue/System.Collections.IDictionary.Add/source.cs" id="Snippet31"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/System.Collections.IDictionary.Add/source.vb" id="Snippet31"::: @@ -2918,16 +2918,16 @@ Retrieving the value of this property is an O(1) operation. is the same as the order in the . + The order of the keys in the is the same as the order in the . Retrieving the value of this property is an O(1) operation. ## Examples - The following code example shows how to use the property of the interface with a , to list the keys in the dictionary. The example also shows how to enumerate the key/value pairs in the sorted list; note that the enumerator for the interface returns objects rather than objects. + The following code example shows how to use the property of the interface with a , to list the keys in the dictionary. The example also shows how to enumerate the key/value pairs in the sorted list; note that the enumerator for the interface returns objects rather than objects. - The code example is part of a larger example, including output, provided for the method. + The code example is part of a larger example, including output, provided for the method. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedListTKey,TValue/System.Collections.IDictionary.Add/source.cs" id="Snippet31"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/System.Collections.IDictionary.Add/source.vb" id="Snippet31"::: @@ -2994,14 +2994,14 @@ Retrieving the value of this property is an O(1) operation. . + This method performs a binary search; however, the elements are moved up to fill in the open spot, so this method is an O(`n`) operation, where `n` is . ## Examples - The following code example shows how to use the of the interface with a . + The following code example shows how to use the of the interface with a . - The code example is part of a larger example, including output, provided for the method. + The code example is part of a larger example, including output, provided for the method. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedListTKey,TValue/System.Collections.IDictionary.Add/source.cs" id="Snippet31"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/System.Collections.IDictionary.Add/source.vb" id="Snippet31"::: @@ -3070,16 +3070,16 @@ Retrieving the value of this property is an O(1) operation. is the same as the order in the . + The order of the values in the is the same as the order in the . Retrieving the value of this property is an O(1) operation. ## Examples - The following code example shows how to use the property of the interface with a , to list the values in the sorted list. The example also shows how to enumerate the key/value pairs in the sorted list; note that the enumerator for the interface returns objects rather than objects. + The following code example shows how to use the property of the interface with a , to list the values in the sorted list. The example also shows how to enumerate the key/value pairs in the sorted list; note that the enumerator for the interface returns objects rather than objects. - The code example is part of a larger example, including output, provided for the method. + The code example is part of a larger example, including output, provided for the method. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedListTKey,TValue/System.Collections.IDictionary.Add/source.cs" id="Snippet31"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/System.Collections.IDictionary.Add/source.vb" id="Snippet31"::: @@ -3148,13 +3148,13 @@ Retrieving the value of this property is an O(1) operation. Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection. - Initially, the enumerator is positioned before the first element in the collection. also brings the enumerator back to this position. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. also brings the enumerator back to this position. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . - returns the same object until either or is called. sets to the next element. + returns the same object until either or is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. To set to the first element of the collection again, you can call followed by . + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. To set to the first element of the collection again, you can call followed by . - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization. @@ -3211,13 +3211,13 @@ Retrieving the value of this property is an O(1) operation. can be considerable, however, so the method does nothing if the list is at more than 90 percent of capacity. This avoids incurring a large reallocation cost for a relatively small gain. + This method can be used to minimize a collection's memory overhead if no new elements will be added to the collection. The cost of reallocating and copying a large can be considerable, however, so the method does nothing if the list is at more than 90 percent of capacity. This avoids incurring a large reallocation cost for a relatively small gain. - This method is an O(`n`) operation, where `n` is . + This method is an O(`n`) operation, where `n` is . - To reset a to its initial state, call the method before calling method. Trimming an empty sets the capacity of the to the default capacity. + To reset a to its initial state, call the method before calling method. Trimming an empty sets the capacity of the to the default capacity. - The capacity can also be set using the property. + The capacity can also be set using the property. ]]> @@ -3287,18 +3287,18 @@ Retrieving the value of this property is an O(1) operation. method and the property. + This method combines the functionality of the method and the property. If the key is not found, then the `value` parameter gets the appropriate default value for the value type `TValue`; for example, zero (0) for integer types, `false` for Boolean types, and `null` for reference types. - This method performs a binary search; therefore, this method is an O(log `n`) operation, where `n` is . + This method performs a binary search; therefore, this method is an O(log `n`) operation, where `n` is . ## Examples - The example shows how to use the method as a more efficient way to retrieve values in a program that frequently tries keys that are not in the sorted list. For contrast, the example also shows how the property (the indexer in C#) throws exceptions when attempting to retrieve nonexistent keys. + The example shows how to use the method as a more efficient way to retrieve values in a program that frequently tries keys that are not in the sorted list. For contrast, the example also shows how the property (the indexer in C#) throws exceptions when attempting to retrieve nonexistent keys. - This code example is part of a larger example provided for the class. + This code example is part of a larger example provided for the class. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedListTKey,TValue/Overview/source.cs" id="Snippet5"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/Overview/source.vb" id="Snippet5"::: @@ -3366,11 +3366,11 @@ Retrieving the value of this property is an O(1) operation. is the same as the order in the . + The order of the values in the is the same as the order in the . - The returned is not a static copy; instead, the refers back to the values in the original . Therefore, changes to the continue to be reflected in the . + The returned is not a static copy; instead, the refers back to the values in the original . Therefore, changes to the continue to be reflected in the . - The collection returned by the property provides an efficient way to retrieve values by index. It is not necessary to regenerate the list when the property is accessed, because the list is just a wrapper for the internal array of values. The following code shows the use of the property for indexed retrieval of values from a sorted list of strings: + The collection returned by the property provides an efficient way to retrieve values by index. It is not necessary to regenerate the list when the property is accessed, because the list is just a wrapper for the internal array of values. The following code shows the use of the property for indexed retrieval of values from a sorted list of strings: :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedListTKey,TValue/Overview/remarks.cs" id="Snippet11"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/Overview/remarks.vb" id="Snippet11"::: @@ -3381,11 +3381,11 @@ Retrieving the value of this property is an O(1) operation. ## Examples - This code example shows how to enumerate the values in the sorted list using the property, and how to enumerate the keys and values in the sorted list. + This code example shows how to enumerate the values in the sorted list using the property, and how to enumerate the keys and values in the sorted list. - The example also shows how to use the property for efficient indexed retrieval of values. + The example also shows how to use the property for efficient indexed retrieval of values. - This code example is part of a larger example provided for the class. + This code example is part of a larger example provided for the class. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedListTKey,TValue/Overview/source.cs" id="Snippet8"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedListTKey,TValue/Overview/source.vb" id="Snippet8"::: diff --git a/xml/System.Collections.Generic/SortedSet`1+Enumerator.xml b/xml/System.Collections.Generic/SortedSet`1+Enumerator.xml index 519d4262974..0989e8d88db 100644 --- a/xml/System.Collections.Generic/SortedSet`1+Enumerator.xml +++ b/xml/System.Collections.Generic/SortedSet`1+Enumerator.xml @@ -93,13 +93,13 @@ Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection. - Initially, the enumerator is positioned before the first element in the collection. At this position, the property is undefined. Therefore, you must call the method to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. At this position, the property is undefined. Therefore, you must call the method to advance the enumerator to the first element of the collection before reading the value of . - returns the same object until is called. sets to the next element. + returns the same object until is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator object instead. + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator object instead. - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . The enumerator doesn't have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization. @@ -162,15 +162,15 @@ ## Remarks - is undefined under any of the following conditions: + is undefined under any of the following conditions: -- The enumerator is positioned before the first element of the collection. That happens after an enumerator is created or after the method is called. The method must be called to advance the enumerator to the first element of the collection before reading the value of the property. +- The enumerator is positioned before the first element of the collection. That happens after an enumerator is created or after the method is called. The method must be called to advance the enumerator to the first element of the collection before reading the value of the property. -- The last call to returned `false`, which indicates the end of the collection and that the enumerator is positioned after the last element of the collection. +- The last call to returned `false`, which indicates the end of the collection and that the enumerator is positioned after the last element of the collection. - The enumerator is invalidated due to changes made in the collection, such as adding, modifying, or deleting elements. - does not move the position of the enumerator, and consecutive calls to return the same object until either or is called. + does not move the position of the enumerator, and consecutive calls to return the same object until either or is called. ]]> @@ -269,11 +269,11 @@ method advances the enumerator to the first element of the collection. + After an enumerator is created, the enumerator is positioned before the first element in the collection, and the first call to the method advances the enumerator to the first element of the collection. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . ]]> @@ -334,15 +334,15 @@ ## Remarks - is undefined under any of the following conditions: + is undefined under any of the following conditions: -- The enumerator is positioned before the first element of the collection. That happens after an enumerator is created or after the method is called. The method must be called to advance the enumerator to the first element of the collection before reading the value of the property. +- The enumerator is positioned before the first element of the collection. That happens after an enumerator is created or after the method is called. The method must be called to advance the enumerator to the first element of the collection before reading the value of the property. -- The last call to returned `false`, which indicates the end of the collection and that the enumerator is positioned after the last element of the collection. +- The last call to returned `false`, which indicates the end of the collection and that the enumerator is positioned after the last element of the collection. - The enumerator is invalidated due to changes made in the collection, such as adding, modifying, or deleting elements. - does not move the position of the enumerator, and consecutive calls to return the same object until either or is called. + does not move the position of the enumerator, and consecutive calls to return the same object until either or is called. ]]> @@ -395,7 +395,7 @@ or throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . ]]> diff --git a/xml/System.Collections.Generic/SortedSet`1.xml b/xml/System.Collections.Generic/SortedSet`1.xml index d59e69154b7..880fe72c080 100644 --- a/xml/System.Collections.Generic/SortedSet`1.xml +++ b/xml/System.Collections.Generic/SortedSet`1.xml @@ -129,14 +129,14 @@ object maintains a sorted order without affecting performance as elements are inserted and deleted. Duplicate elements are not allowed. Changing the sort values of existing items is not supported and may lead to unexpected behavior. + A object maintains a sorted order without affecting performance as elements are inserted and deleted. Duplicate elements are not allowed. Changing the sort values of existing items is not supported and may lead to unexpected behavior. - For a thread safe alternative to , see + For a thread safe alternative to , see ## Examples - The following example demonstrates a class that is created with the constructor that takes an as a parameter. This comparer (`ByFileExtension`) is used to sort a list of file names by their extensions. + The following example demonstrates a class that is created with the constructor that takes an as a parameter. This comparer (`ByFileExtension`) is used to sort a list of file names by their extensions. This example demonstrates how to create a sorted set of media file names, remove unwanted elements, view a range of elements, and compare the set with another sorted set. @@ -255,7 +255,7 @@ class. + The following example defines a comparer (`ByFileExtension`) that is used to construct a sorted set that sorts file names by their extensions. This code example is part of a larger example provided for the class. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedSetT/Overview/program.cs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedSetT/Overview/program.vb" id="Snippet2"::: @@ -311,7 +311,7 @@ class, and no exceptions are thrown. + Duplicate elements in the enumerable collection are not copied into the new instance of the class, and no exceptions are thrown. This constructor is an `O(n log n)` operation, where `n` is the number of elements in the `collection` parameter. @@ -493,14 +493,14 @@ class does not accept duplicate elements. If `item` is already in the set, this method returns `false` and does not throw an exception. + The class does not accept duplicate elements. If `item` is already in the set, this method returns `false` and does not throw an exception. - If already equals the capacity of the object, the capacity is automatically adjusted to accommodate the new item. + If already equals the capacity of the object, the capacity is automatically adjusted to accommodate the new item. ## Examples - The following example adds elements to a sorted set. This code example is part of a larger example provided for the class. + The following example adds elements to a sorted set. This code example is part of a larger example provided for the class. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedSetT/Overview/program.cs" id="Snippet3"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedSetT/Overview/program.vb" id="Snippet3"::: @@ -555,7 +555,7 @@ . + This method is an `O(n)` operation, where `n` is . ]]> @@ -610,7 +610,7 @@ , or the comparer used for its constructor. + The returned comparer can be either the default comparer of the type for a , or the comparer used for its constructor. Retrieving the value of this property is an `O(1)` operation. @@ -688,7 +688,7 @@ . + This method is an `O(n)` operation, where `n` is . ]]> @@ -800,7 +800,7 @@ . + This method is an `O(n)` operation, where `n` is . ]]> @@ -1043,14 +1043,14 @@ must have the same definition of equality. + The `memberEqualityComparer` and the current must have the same definition of equality. - You can use the comparer returned by this method in the constructor to create a hash table of individual sets. + You can use the comparer returned by this method in the constructor to create a hash table of individual sets. ## Examples - The following example uses the method to create a set of sets. This code example is part of a larger example provided for the class. + The following example uses the method to create a set of sets. This code example is part of a larger example provided for the class. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedSetT/Overview/program.cs" id="Snippet7"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedSetT/Overview/program.vb" id="Snippet7"::: @@ -1108,14 +1108,14 @@ that is also in `other`. Duplicate values in `other` are ignored. + This method removes any element in the current that is also in `other`. Duplicate values in `other` are ignored. - This method is an `O(n log m)` operation, where `m` is and `n` is the number of elements in `other`. + This method is an `O(n log m)` operation, where `m` is and `n` is the number of elements in `other`. ## Examples - The following example removes elements from a sorted set that are duplicated in another sorted set. This code example is part of a larger example provided for the class. + The following example removes elements from a sorted set that are duplicated in another sorted set. This code example is part of a larger example provided for the class. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedSetT/Overview/program.cs" id="Snippet6"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedSetT/Overview/program.vb" id="Snippet6"::: @@ -1170,7 +1170,7 @@ or throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . This method is an `O(log n)` operation. @@ -1224,7 +1224,7 @@ . + Calling this method is an `O(n)` operation, where `n` is . ]]> @@ -1282,12 +1282,12 @@ , but provides a window into the underlying itself. You can make changes in both the view and in the underlying . + This method returns a view of the range of elements that fall between `lowerValue` and `upperValue`, as defined by the comparer. This method does not copy elements from the , but provides a window into the underlying itself. You can make changes in both the view and in the underlying . ## Examples - The following example uses the method to list only the AVI files from a sorted set of media file names. The comparer evaluates file names according to their extensions. The `lowerValue` is "AVI" and the `upperValue` is only one value higher, "AVJ", to get the view of all AVI files. This code example is part of a larger example provided for the class. + The following example uses the method to list only the AVI files from a sorted set of media file names. The comparer evaluates file names according to their extensions. The `lowerValue` is "AVI" and the `upperValue` is only one value higher, "AVJ", to get the view of all AVI files. This code example is part of a larger example provided for the class. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedSetT/Overview/program.cs" id="Snippet5"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedSetT/Overview/program.vb" id="Snippet5"::: @@ -1350,7 +1350,7 @@ ## Remarks This method ignores any duplicate elements in `other`. - If the collection represented by the `other` parameter is a collection with the same equality comparer as the current object, this method is an `O(n)` operation. Otherwise, this method is an `O(n + m)` operation, where `n` is and `m` is the number of elements in `other`. + If the collection represented by the `other` parameter is a collection with the same equality comparer as the current object, this method is an `O(n)` operation. Otherwise, this method is an `O(n + m)` operation, where `n` is and `m` is the number of elements in `other`. ]]> @@ -1416,11 +1416,11 @@ object is empty unless the `other` parameter is also an empty set. + An empty set is a subset of any other collection. Therefore, this method returns `true` if the collection represented by the current object is empty unless the `other` parameter is also an empty set. - This method always returns `false` if is greater than or equal to the number of elements in `other`. + This method always returns `false` if is greater than or equal to the number of elements in `other`. - If the collection represented by `other` is a collection with the same equality comparer as the current object, then this method is an `O(n)` operation. Otherwise, this method is an `O(n + m)` operation, where `n` is and `m` is the number of elements in `other`. + If the collection represented by `other` is a collection with the same equality comparer as the current object, then this method is an `O(n)` operation. Otherwise, this method is an `O(n + m)` operation, where `n` is and `m` is the number of elements in `other`. ]]> @@ -1486,11 +1486,11 @@ collection is also empty. + An empty set is a subset of any other collection. Therefore, this method returns `true` if the collection represented by the `other` parameter is empty unless the current collection is also empty. - This method always returns `false` if is less than or equal to the number of elements in `other`. + This method always returns `false` if is less than or equal to the number of elements in `other`. - If the collection represented by `other` is a collection with the same equality comparer as the current object, this method is an `O(n)` operation. Otherwise, this method is an `O(n + m)` operation, where `n` is the number of elements in `other` and `m` is . + If the collection represented by `other` is a collection with the same equality comparer as the current object, this method is an `O(n)` operation. Otherwise, this method is an `O(n + m)` operation, where `n` is the number of elements in `other` and `m` is . ]]> @@ -1556,11 +1556,11 @@ object is empty, even if the `other` parameter is an empty set. + An empty set is a subset of any other collection, including an empty set; therefore, this method returns `true` if the collection represented by the current object is empty, even if the `other` parameter is an empty set. - This method always returns `false` if is greater than the number of elements in `other`. + This method always returns `false` if is greater than the number of elements in `other`. - If the collection represented by `other` is a collection with the same equality comparer as the current object, this method is an `O(n)` operation. Otherwise, this method is an `O(n + m)` operation, where `n` is and `m` is the number of elements in `other`. + If the collection represented by `other` is a collection with the same equality comparer as the current object, this method is an `O(n)` operation. Otherwise, this method is an `O(n + m)` operation, where `n` is and `m` is the number of elements in `other`. ]]> @@ -1620,11 +1620,11 @@ object is empty. + All collections, including the empty set, are supersets of the empty set. Therefore, this method returns `true` if the collection represented by the `other` parameter is empty, even if the current object is empty. - This method always returns `false` if is less than the number of elements in `other`. + This method always returns `false` if is less than the number of elements in `other`. - If the collection represented by `other` is a collection with the same equality comparer as the current object, this method is an `O(n)` operation. Otherwise, this method is an `O(n + m)` operation, where `n` is the number of elements in `other` and `m` is . + If the collection represented by `other` is a collection with the same equality comparer as the current object, this method is an `O(n)` operation. Otherwise, this method is an `O(n + m)` operation, where `n` is the number of elements in `other` and `m` is . ]]> @@ -1682,7 +1682,7 @@ has no elements, then the property returns the default value of `T`. + If the has no elements, then the property returns the default value of `T`. ]]> @@ -1738,7 +1738,7 @@ has no elements, then the property returns the default value of `T`. + If the has no elements, then the property returns the default value of `T`. ]]> @@ -1789,7 +1789,7 @@ . + Calling this method is an `O(n)` operation, where `n` is . ]]> @@ -1850,7 +1850,7 @@ ## Remarks Any duplicate elements in `other` are ignored. - This method is an `O(n log m)` operation, where `m` is and `n` is the number of elements in `other`. + This method is an `O(n log m)` operation, where `m` is and `n` is the number of elements in `other`. ]]> @@ -1915,7 +1915,7 @@ object does not contain the specified element, the object remains unchanged and no exception is thrown. + If the object does not contain the specified element, the object remains unchanged and no exception is thrown. `item` can be `null` for reference types. @@ -1972,14 +1972,14 @@ . Doing so can cause unexpected results. + `match` must not modify the . Doing so can cause unexpected results. - Calling this method is an `O(n)` operation, where `n` is . + Calling this method is an `O(n)` operation, where `n` is . ## Examples - The following example removes unwanted elements from a sorted set. This code example is part of a larger example provided for the class. + The following example removes unwanted elements from a sorted set. This code example is part of a larger example provided for the class. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/SortedSetT/Overview/program.cs" id="Snippet8"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Generic/SortedSetT/Overview/program.vb" id="Snippet8"::: @@ -2109,7 +2109,7 @@ ## Remarks This method ignores the order of elements and any duplicate elements in `other`. - If the collection represented by `other` is a collection with the same equality comparer as the current object, this method is an `O(log n)` operation. Otherwise, this method is an `O(n + m)` operation, where `n` is the number of elements in `other` and `m` is . + If the collection represented by `other` is a collection with the same equality comparer as the current object, this method is an `O(log n)` operation. Otherwise, this method is an `O(n + m)` operation, where `n` is the number of elements in `other` and `m` is . ]]> @@ -2168,7 +2168,7 @@ ## Remarks Any duplicate elements in `other` are ignored. - If the `other` parameter is a collection with the same equality comparer as the current object, this method is an `O(n log m)` operation. Otherwise, this method is an `O(n log m) + O(n log n)` operation, where `n` is the number of elements in `other` and `m` is . + If the `other` parameter is a collection with the same equality comparer as the current object, this method is an `O(n log m)` operation. Otherwise, this method is an `O(n log m) + O(n log n)` operation, where `n` is the number of elements in `other` and `m` is . ]]> @@ -2225,9 +2225,9 @@ instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. - If is less than , this method is an `O(1)` operation. If the capacity must be increased to accommodate the new element, this method becomes an `O(n)` operation, where `n` is . + If is less than , this method is an `O(1)` operation. If the capacity must be increased to accommodate the new element, this method becomes an `O(n)` operation, where `n` is . ]]> @@ -2281,7 +2281,7 @@ instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. A collection that is read-only does not allow the addition, removal, or modification of elements after the collection is created. @@ -2340,7 +2340,7 @@ instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. This method is an `O(log n)` operation. @@ -2399,7 +2399,7 @@ instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -2457,7 +2457,7 @@ instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -2509,7 +2509,7 @@ instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. This method is an `O(1)` operation. @@ -2564,7 +2564,7 @@ instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. This method is an `O(log n)` operation. @@ -2625,7 +2625,7 @@ instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -2687,7 +2687,7 @@ instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> diff --git a/xml/System.Collections.Generic/Stack`1+Enumerator.xml b/xml/System.Collections.Generic/Stack`1+Enumerator.xml index 854001d6013..5be853bea29 100644 --- a/xml/System.Collections.Generic/Stack`1+Enumerator.xml +++ b/xml/System.Collections.Generic/Stack`1+Enumerator.xml @@ -83,13 +83,13 @@ Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection. - Initially, the enumerator is positioned before the first element in the collection. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . - returns the same object until is called. sets to the next element. + returns the same object until is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator instance instead. + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator instance instead. - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization. @@ -154,15 +154,15 @@ is undefined under any of the following conditions: + is undefined under any of the following conditions: -- The enumerator is positioned before the first element of the collection. That happens after an enumerator is created or after the method is called. The method must be called to advance the enumerator to the first element of the collection before reading the value of the property. +- The enumerator is positioned before the first element of the collection. That happens after an enumerator is created or after the method is called. The method must be called to advance the enumerator to the first element of the collection before reading the value of the property. -- The last call to returned `false`, which indicates the end of the collection and that the enumerator is positioned after the last element of the collection. +- The last call to returned `false`, which indicates the end of the collection and that the enumerator is positioned after the last element of the collection. - The enumerator is invalidated due to changes made in the collection, such as adding, modifying, or deleting elements. - does not move the position of the enumerator, and consecutive calls to return the same object until either or is called. + does not move the position of the enumerator, and consecutive calls to return the same object until either or is called. ]]> @@ -266,11 +266,11 @@ advances the enumerator to the first element of the collection. + After an enumerator is created, the enumerator is positioned before the first element in the collection, and the first call to advances the enumerator to the first element of the collection. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . ]]> @@ -333,15 +333,15 @@ ## Remarks - is undefined under any of the following conditions: + is undefined under any of the following conditions: -- The enumerator is positioned before the first element of the collection. That happens after an enumerator is created or after the method is called. The method must be called to advance the enumerator to the first element of the collection before reading the value of the property. +- The enumerator is positioned before the first element of the collection. That happens after an enumerator is created or after the method is called. The method must be called to advance the enumerator to the first element of the collection before reading the value of the property. -- The last call to returned `false`, which indicates the end of the collection and that the enumerator is positioned after the last element of the collection. +- The last call to returned `false`, which indicates the end of the collection and that the enumerator is positioned after the last element of the collection. - The enumerator is invalidated due to changes made in the collection, such as adding, modifying, or deleting elements. - does not move the position of the enumerator, and consecutive calls to return the same object until either or is called. + does not move the position of the enumerator, and consecutive calls to return the same object until either or is called. ]]> @@ -397,7 +397,7 @@ or throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . ]]> diff --git a/xml/System.Collections.Generic/Stack`1.xml b/xml/System.Collections.Generic/Stack`1.xml index ee945f04822..82c4a77d769 100644 --- a/xml/System.Collections.Generic/Stack`1.xml +++ b/xml/System.Collections.Generic/Stack`1.xml @@ -105,38 +105,38 @@ is implemented as an array. + is implemented as an array. - Stacks and queues are useful when you need temporary storage for information; that is, when you might want to discard an element after retrieving its value. Use if you need to access the information in the same order that it is stored in the collection. Use if you need to access the information in reverse order. + Stacks and queues are useful when you need temporary storage for information; that is, when you might want to discard an element after retrieving its value. Use if you need to access the information in the same order that it is stored in the collection. Use if you need to access the information in reverse order. - Use the and types when you need to access the collection from multiple threads concurrently. + Use the and types when you need to access the collection from multiple threads concurrently. - A common use for is to preserve variable states during calls to other procedures. + A common use for is to preserve variable states during calls to other procedures. - Three main operations can be performed on a and its elements: + Three main operations can be performed on a and its elements: -- inserts an element at the top of the . +- inserts an element at the top of the . -- removes an element from the top of the . +- removes an element from the top of the . -- returns an element that is at the top of the but does not remove it from the . +- returns an element that is at the top of the but does not remove it from the . - The capacity of a is the number of elements the can hold. As elements are added to a , the capacity is automatically increased as required by reallocating the internal array. The capacity can be decreased by calling . + The capacity of a is the number of elements the can hold. As elements are added to a , the capacity is automatically increased as required by reallocating the internal array. The capacity can be decreased by calling . - If is less than the capacity of the stack, is an O(1) operation. If the capacity needs to be increased to accommodate the new element, becomes an O(`n`) operation, where `n` is . is an O(1) operation. + If is less than the capacity of the stack, is an O(1) operation. If the capacity needs to be increased to accommodate the new element, becomes an O(`n`) operation, where `n` is . is an O(1) operation. - accepts `null` as a valid value for reference types and allows duplicate elements. + accepts `null` as a valid value for reference types and allows duplicate elements. ## Examples - The following code example demonstrates several methods of the generic class. The code example creates a stack of strings with default capacity and uses the method to push five strings onto the stack. The elements of the stack are enumerated, which does not change the state of the stack. The method is used to pop the first string off the stack. The method is used to look at the next item on the stack, and then the method is used to pop it off. + The following code example demonstrates several methods of the generic class. The code example creates a stack of strings with default capacity and uses the method to push five strings onto the stack. The elements of the stack are enumerated, which does not change the state of the stack. The method is used to pop the first string off the stack. The method is used to look at the next item on the stack, and then the method is used to pop it off. - The method is used to create an array and copy the stack elements to it, then the array is passed to the constructor that takes , creating a copy of the stack with the order of the elements reversed. The elements of the copy are displayed. + The method is used to create an array and copy the stack elements to it, then the array is passed to the constructor that takes , creating a copy of the stack with the order of the elements reversed. The elements of the copy are displayed. - An array twice the size of the stack is created, and the method is used to copy the array elements beginning at the middle of the array. The constructor is used again to create a copy of the stack with the order of elements reversed; thus, the three null elements are at the end. + An array twice the size of the stack is created, and the method is used to copy the array elements beginning at the middle of the array. The constructor is used again to create a copy of the stack with the order of elements reversed; thus, the three null elements are at the end. - The method is used to show that the string "four" is in the first copy of the stack, after which the method clears the copy and the property shows that the stack is empty. + The method is used to show that the string "four" is in the first copy of the stack, after which the method clears the copy and the property shows that the stack is empty. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/StackT/Overview/source.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/StackT/Overview/source.fs" id="Snippet1"::: @@ -202,26 +202,26 @@ is the number of elements that the can hold. As elements are added to a , the capacity is automatically increased as required by reallocating the internal array. + The capacity of a is the number of elements that the can hold. As elements are added to a , the capacity is automatically increased as required by reallocating the internal array. - If the size of the collection can be estimated, specifying the initial capacity eliminates the need to perform a number of resizing operations while adding elements to the . + If the size of the collection can be estimated, specifying the initial capacity eliminates the need to perform a number of resizing operations while adding elements to the . - The capacity can be decreased by calling . + The capacity can be decreased by calling . This constructor is an O(1) operation. ## Examples - The following code example demonstrates this constructor and several methods of the generic class. + The following code example demonstrates this constructor and several methods of the generic class. - The code example creates a stack of strings with default capacity and uses the method to push five strings onto the stack. The elements of the stack are enumerated, which does not change the state of the stack. The method is used to pop the first string off the stack. The method is used to look at the next item on the stack, and then the method is used to pop it off. + The code example creates a stack of strings with default capacity and uses the method to push five strings onto the stack. The elements of the stack are enumerated, which does not change the state of the stack. The method is used to pop the first string off the stack. The method is used to look at the next item on the stack, and then the method is used to pop it off. - The method is used to create an array and copy the stack elements to it, then the array is passed to the constructor that takes , creating a copy of the stack with the order of the elements reversed. The elements of the copy are displayed. + The method is used to create an array and copy the stack elements to it, then the array is passed to the constructor that takes , creating a copy of the stack with the order of the elements reversed. The elements of the copy are displayed. - An array twice the size of the stack is created, and the method is used to copy the array elements beginning at the middle of the array. The constructor is used again to create a copy of the stack with the order of elements reversed; thus, the three null elements are at the end. + An array twice the size of the stack is created, and the method is used to copy the array elements beginning at the middle of the array. The constructor is used again to create a copy of the stack with the order of elements reversed; thus, the three null elements are at the end. - The method is used to show that the string "four" is in the first copy of the stack, after which the method clears the copy and the property shows that the stack is empty. + The method is used to show that the string "four" is in the first copy of the stack, after which the method clears the copy and the property shows that the stack is empty. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/StackT/Overview/source.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/StackT/Overview/source.fs" id="Snippet1"::: @@ -275,28 +275,28 @@ is the number of elements that the can hold. As elements are added to a , the capacity is automatically increased as required by reallocating the internal array. + The capacity of a is the number of elements that the can hold. As elements are added to a , the capacity is automatically increased as required by reallocating the internal array. - If the size of the collection can be estimated, specifying the initial capacity eliminates the need to perform a number of resizing operations while adding elements to the . + If the size of the collection can be estimated, specifying the initial capacity eliminates the need to perform a number of resizing operations while adding elements to the . - The capacity can be decreased by calling . + The capacity can be decreased by calling . - The elements are copied onto the in the same order they are read by the of the collection. + The elements are copied onto the in the same order they are read by the of the collection. This constructor is an O(`n`) operation, where `n` is the number of elements in `collection`. ## Examples - The following code example demonstrates this constructor and several methods of the generic class. + The following code example demonstrates this constructor and several methods of the generic class. - The code example creates a stack of strings with default capacity and uses the method to push five strings onto the stack. The elements of the stack are enumerated, which does not change the state of the stack. The method is used to pop the first string off the stack. The method is used to look at the next item on the stack, and then the method is used to pop it off. + The code example creates a stack of strings with default capacity and uses the method to push five strings onto the stack. The elements of the stack are enumerated, which does not change the state of the stack. The method is used to pop the first string off the stack. The method is used to look at the next item on the stack, and then the method is used to pop it off. - The method is used to create an array and copy the stack elements to it, then the array is passed to the constructor that takes , creating a copy of the stack with the order of the elements reversed. The elements of the copy are displayed. + The method is used to create an array and copy the stack elements to it, then the array is passed to the constructor that takes , creating a copy of the stack with the order of the elements reversed. The elements of the copy are displayed. - An array twice the size of the stack is created, and the method is used to copy the array elements beginning at the middle of the array. The constructor is used again to create a copy of the stack with the order of elements reversed; thus, the three null elements are at the end. + An array twice the size of the stack is created, and the method is used to copy the array elements beginning at the middle of the array. The constructor is used again to create a copy of the stack with the order of elements reversed; thus, the three null elements are at the end. - The method is used to show that the string "four" is in the first copy of the stack, after which the method clears the copy and the property shows that the stack is empty. + The method is used to show that the string "four" is in the first copy of the stack, after which the method clears the copy and the property shows that the stack is empty. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/StackT/Overview/source.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/StackT/Overview/source.fs" id="Snippet1"::: @@ -354,11 +354,11 @@ is the number of elements that the can hold. As elements are added to a , the capacity is automatically increased as required by reallocating the internal array. + The capacity of a is the number of elements that the can hold. As elements are added to a , the capacity is automatically increased as required by reallocating the internal array. - If the size of the collection can be estimated, specifying the initial capacity eliminates the need to perform a number of resizing operations while adding elements to the . + If the size of the collection can be estimated, specifying the initial capacity eliminates the need to perform a number of resizing operations while adding elements to the . - The capacity can be decreased by calling . + The capacity can be decreased by calling . This constructor is an O(`n`) operation, where `n` is `capacity`. @@ -441,24 +441,24 @@ is set to zero, and references to other objects from elements of the collection are also released. + is set to zero, and references to other objects from elements of the collection are also released. - The capacity remains unchanged. To reset the capacity of the , call . Trimming an empty sets the capacity of the to the default capacity. + The capacity remains unchanged. To reset the capacity of the , call . Trimming an empty sets the capacity of the to the default capacity. - This method is an O(`n`) operation, where `n` is . + This method is an O(`n`) operation, where `n` is . ## Examples - The following code example demonstrates several methods of the generic class, including the method. + The following code example demonstrates several methods of the generic class, including the method. - The code example creates a stack of strings with default capacity and uses the method to push five strings onto the stack. The elements of the stack are enumerated, which does not change the state of the stack. The method is used to pop the first string off the stack. The method is used to look at the next item on the stack, and then the method is used to pop it off. + The code example creates a stack of strings with default capacity and uses the method to push five strings onto the stack. The elements of the stack are enumerated, which does not change the state of the stack. The method is used to pop the first string off the stack. The method is used to look at the next item on the stack, and then the method is used to pop it off. - The method is used to create an array and copy the stack elements to it, then the array is passed to the constructor that takes , creating a copy of the stack with the order of the elements reversed. The elements of the copy are displayed. + The method is used to create an array and copy the stack elements to it, then the array is passed to the constructor that takes , creating a copy of the stack with the order of the elements reversed. The elements of the copy are displayed. - An array twice the size of the stack is created, and the method is used to copy the array elements beginning at the middle of the array. The constructor is used again to create a copy of the stack with the order of elements reversed; thus, the three null elements are at the end. + An array twice the size of the stack is created, and the method is used to copy the array elements beginning at the middle of the array. The constructor is used again to create a copy of the stack with the order of elements reversed; thus, the three null elements are at the end. - The method is used to show that the string "four" is in the first copy of the stack, after which the method clears the copy and the property shows that the stack is empty. + The method is used to show that the string "four" is in the first copy of the stack, after which the method clears the copy and the property shows that the stack is empty. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/StackT/Overview/source.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/StackT/Overview/source.fs" id="Snippet1"::: @@ -517,22 +517,22 @@ for `T`, the type of values in the list. + This method determines equality using the default equality comparer for `T`, the type of values in the list. - This method performs a linear search; therefore, this method is an O(`n`) operation, where `n` is . + This method performs a linear search; therefore, this method is an O(`n`) operation, where `n` is . ## Examples - The following code example demonstrates several methods of the generic class, including the method. + The following code example demonstrates several methods of the generic class, including the method. - The code example creates a stack of strings with default capacity and uses the method to push five strings onto the stack. The elements of the stack are enumerated, which does not change the state of the stack. The method is used to pop the first string off the stack. The method is used to look at the next item on the stack, and then the method is used to pop it off. + The code example creates a stack of strings with default capacity and uses the method to push five strings onto the stack. The elements of the stack are enumerated, which does not change the state of the stack. The method is used to pop the first string off the stack. The method is used to look at the next item on the stack, and then the method is used to pop it off. - The method is used to create an array and copy the stack elements to it, then the array is passed to the constructor that takes , creating a copy of the stack with the order of the elements reversed. The elements of the copy are displayed. + The method is used to create an array and copy the stack elements to it, then the array is passed to the constructor that takes , creating a copy of the stack with the order of the elements reversed. The elements of the copy are displayed. - An array twice the size of the stack is created, and the method is used to copy the array elements beginning at the middle of the array. The constructor is used again to create a copy of the stack with the order of elements reversed; thus, the three null elements are at the end. + An array twice the size of the stack is created, and the method is used to copy the array elements beginning at the middle of the array. The constructor is used again to create a copy of the stack with the order of elements reversed; thus, the three null elements are at the end. - The method is used to show that the string "four" is in the first copy of the stack, after which the method clears the copy and the property shows that the stack is empty. + The method is used to show that the string "four" is in the first copy of the stack, after which the method clears the copy and the property shows that the stack is empty. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/StackT/Overview/source.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/StackT/Overview/source.fs" id="Snippet1"::: @@ -592,22 +592,22 @@ . + The elements are copied onto the array in last-in-first-out (LIFO) order, similar to the order of the elements returned by a succession of calls to . - This method is an O(`n`) operation, where `n` is . + This method is an O(`n`) operation, where `n` is . ## Examples - The following code example demonstrates several methods of the generic class, including the method. + The following code example demonstrates several methods of the generic class, including the method. - The code example creates a stack of strings with default capacity and uses the method to push five strings onto the stack. The elements of the stack are enumerated, which does not change the state of the stack. The method is used to pop the first string off the stack. The method is used to look at the next item on the stack, and then the method is used to pop it off. + The code example creates a stack of strings with default capacity and uses the method to push five strings onto the stack. The elements of the stack are enumerated, which does not change the state of the stack. The method is used to pop the first string off the stack. The method is used to look at the next item on the stack, and then the method is used to pop it off. - The method is used to create an array and copy the stack elements to it, then the array is passed to the constructor that takes , creating a copy of the stack with the order of the elements reversed. The elements of the copy are displayed. + The method is used to create an array and copy the stack elements to it, then the array is passed to the constructor that takes , creating a copy of the stack with the order of the elements reversed. The elements of the copy are displayed. - An array twice the size of the stack is created, and the method is used to copy the array elements beginning at the middle of the array. The constructor is used again to create a copy of the stack with the order of elements reversed; thus, the three null elements are at the end. + An array twice the size of the stack is created, and the method is used to copy the array elements beginning at the middle of the array. The constructor is used again to create a copy of the stack with the order of elements reversed; thus, the three null elements are at the end. - The method is used to show that the string "four" is in the first copy of the stack, after which the method clears the copy and the property shows that the stack is empty. + The method is used to show that the string "four" is in the first copy of the stack, after which the method clears the copy and the property shows that the stack is empty. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/StackT/Overview/source.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/StackT/Overview/source.fs" id="Snippet1"::: @@ -677,24 +677,24 @@ is the number of elements that the can store. is the number of elements that are actually in the . + The capacity of the is the number of elements that the can store. is the number of elements that are actually in the . - The capacity is always greater than or equal to . If exceeds the capacity while adding elements, the capacity is increased by automatically reallocating the internal array before copying the old elements and adding the new elements. + The capacity is always greater than or equal to . If exceeds the capacity while adding elements, the capacity is increased by automatically reallocating the internal array before copying the old elements and adding the new elements. Retrieving the value of this property is an O(1) operation. ## Examples - The following code example demonstrates several properties and methods of the generic class, including the property. + The following code example demonstrates several properties and methods of the generic class, including the property. - The code example creates a stack of strings with default capacity and uses the method to push five strings onto the stack. The elements of the stack are enumerated, which does not change the state of the stack. The method is used to pop the first string off the stack. The method is used to look at the next item on the stack, and then the method is used to pop it off. + The code example creates a stack of strings with default capacity and uses the method to push five strings onto the stack. The elements of the stack are enumerated, which does not change the state of the stack. The method is used to pop the first string off the stack. The method is used to look at the next item on the stack, and then the method is used to pop it off. - The method is used to create an array and copy the stack elements to it, then the array is passed to the constructor that takes , creating a copy of the stack with the order of the elements reversed. The elements of the copy are displayed. + The method is used to create an array and copy the stack elements to it, then the array is passed to the constructor that takes , creating a copy of the stack with the order of the elements reversed. The elements of the copy are displayed. - An array twice the size of the stack is created, and the method is used to copy the array elements beginning at the middle of the array. The constructor is used again to create a copy of the stack with the order of elements reversed; thus, the three null elements are at the end. + An array twice the size of the stack is created, and the method is used to copy the array elements beginning at the middle of the array. The constructor is used again to create a copy of the stack with the order of elements reversed; thus, the three null elements are at the end. - The method is used to show that the string "four" is in the first copy of the stack, after which the method clears the copy and the property shows that the stack is empty. + The method is used to show that the string "four" is in the first copy of the stack, after which the method clears the copy and the property shows that the stack is empty. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/StackT/Overview/source.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/StackT/Overview/source.fs" id="Snippet1"::: @@ -789,13 +789,13 @@ Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection. - Initially, the enumerator is positioned before the first element in the collection. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . - returns the same object until is called. sets to the next element. + returns the same object until is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator instance instead. + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator instance instead. - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization. @@ -804,15 +804,15 @@ This method is an O(1) operation. ## Examples - The following code example demonstrates that the generic class is enumerable. The `foreach` statement (`For Each` in Visual Basic) is used to enumerate the stack. + The following code example demonstrates that the generic class is enumerable. The `foreach` statement (`For Each` in Visual Basic) is used to enumerate the stack. - The code example creates a stack of strings with default capacity and uses the method to push five strings onto the stack. The elements of the stack are enumerated, which does not change the state of the stack. The method is used to pop the first string off the stack. The method is used to look at the next item on the stack, and then the method is used to pop it off. + The code example creates a stack of strings with default capacity and uses the method to push five strings onto the stack. The elements of the stack are enumerated, which does not change the state of the stack. The method is used to pop the first string off the stack. The method is used to look at the next item on the stack, and then the method is used to pop it off. - The method is used to create an array and copy the stack elements to it, then the array is passed to the constructor that takes , creating a copy of the stack with the order of the elements reversed. The elements of the copy are displayed. + The method is used to create an array and copy the stack elements to it, then the array is passed to the constructor that takes , creating a copy of the stack with the order of the elements reversed. The elements of the copy are displayed. - An array twice the size of the stack is created, and the method is used to copy the array elements beginning at the middle of the array. The constructor is used again to create a copy of the stack with the order of elements reversed; thus, the three null elements are at the end. + An array twice the size of the stack is created, and the method is used to copy the array elements beginning at the middle of the array. The constructor is used again to create a copy of the stack with the order of elements reversed; thus, the three null elements are at the end. - The method is used to show that the string "four" is in the first copy of the stack, after which the method clears the copy and the property shows that the stack is empty. + The method is used to show that the string "four" is in the first copy of the stack, after which the method clears the copy and the property shows that the stack is empty. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/StackT/Overview/source.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/StackT/Overview/source.fs" id="Snippet1"::: @@ -869,24 +869,24 @@ method, but does not modify the . + This method is similar to the method, but does not modify the . - If type `T` is a reference type, `null` can be pushed onto the as a placeholder, if needed. + If type `T` is a reference type, `null` can be pushed onto the as a placeholder, if needed. This method is an O(1) operation. ## Examples - The following code example demonstrates several methods of the generic class, including the method. + The following code example demonstrates several methods of the generic class, including the method. - The code example creates a stack of strings with default capacity and uses the method to push five strings onto the stack. The elements of the stack are enumerated, which does not change the state of the stack. The method is used to pop the first string off the stack. The method is used to look at the next item on the stack, and then the method is used to pop it off. + The code example creates a stack of strings with default capacity and uses the method to push five strings onto the stack. The elements of the stack are enumerated, which does not change the state of the stack. The method is used to pop the first string off the stack. The method is used to look at the next item on the stack, and then the method is used to pop it off. - The method is used to create an array and copy the stack elements to it, then the array is passed to the constructor that takes , creating a copy of the stack with the order of the elements reversed. The elements of the copy are displayed. + The method is used to create an array and copy the stack elements to it, then the array is passed to the constructor that takes , creating a copy of the stack with the order of the elements reversed. The elements of the copy are displayed. - An array twice the size of the stack is created, and the method is used to copy the array elements beginning at the middle of the array. The constructor is used again to create a copy of the stack with the order of elements reversed; thus, the three null elements are at the end. + An array twice the size of the stack is created, and the method is used to copy the array elements beginning at the middle of the array. The constructor is used again to create a copy of the stack with the order of elements reversed; thus, the three null elements are at the end. - The method is used to show that the string "four" is in the first copy of the stack, after which the method clears the copy and the property shows that the stack is empty. + The method is used to show that the string "four" is in the first copy of the stack, after which the method clears the copy and the property shows that the stack is empty. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/StackT/Overview/source.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/StackT/Overview/source.fs" id="Snippet1"::: @@ -944,24 +944,24 @@ method, but does not modify the . + This method is similar to the method, but does not modify the . - If type `T` is a reference type, `null` can be pushed onto the as a placeholder, if needed. + If type `T` is a reference type, `null` can be pushed onto the as a placeholder, if needed. - is implemented as an array. This method is an O(1) operation. + is implemented as an array. This method is an O(1) operation. ## Examples - The following code example demonstrates several methods of the generic class, including the method. + The following code example demonstrates several methods of the generic class, including the method. - The code example creates a stack of strings with default capacity and uses the method to push five strings onto the stack. The elements of the stack are enumerated, which does not change the state of the stack. The method is used to pop the first string off the stack. The method is used to look at the next item on the stack, and then the method is used to pop it off. + The code example creates a stack of strings with default capacity and uses the method to push five strings onto the stack. The elements of the stack are enumerated, which does not change the state of the stack. The method is used to pop the first string off the stack. The method is used to look at the next item on the stack, and then the method is used to pop it off. - The method is used to create an array and copy the stack elements to it, then the array is passed to the constructor that takes , creating a copy of the stack with the order of the elements reversed. The elements of the copy are displayed. + The method is used to create an array and copy the stack elements to it, then the array is passed to the constructor that takes , creating a copy of the stack with the order of the elements reversed. The elements of the copy are displayed. - An array twice the size of the stack is created, and the method is used to copy the array elements beginning at the middle of the array. The constructor is used again to create a copy of the stack with the order of elements reversed; thus, the three null elements are at the end. + An array twice the size of the stack is created, and the method is used to copy the array elements beginning at the middle of the array. The constructor is used again to create a copy of the stack with the order of elements reversed; thus, the three null elements are at the end. - The method is used to show that the string "four" is in the first copy of the stack, after which the method clears the copy and the property shows that the stack is empty. + The method is used to show that the string "four" is in the first copy of the stack, after which the method clears the copy and the property shows that the stack is empty. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/StackT/Overview/source.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/StackT/Overview/source.fs" id="Snippet1"::: @@ -1021,26 +1021,26 @@ is implemented as an array. + is implemented as an array. - If already equals the capacity, the capacity of the is increased by automatically reallocating the internal array, and the existing elements are copied to the new array before the new element is added. + If already equals the capacity, the capacity of the is increased by automatically reallocating the internal array, and the existing elements are copied to the new array before the new element is added. - If type `T` is a reference type, `null` can be pushed onto the as a placeholder, if needed. It occupies a slot in the stack and is treated like any object. + If type `T` is a reference type, `null` can be pushed onto the as a placeholder, if needed. It occupies a slot in the stack and is treated like any object. - If is less than the capacity of the stack, is an O(1) operation. If the capacity needs to be increased to accommodate the new element, becomes an O(`n`) operation, where `n` is . + If is less than the capacity of the stack, is an O(1) operation. If the capacity needs to be increased to accommodate the new element, becomes an O(`n`) operation, where `n` is . ## Examples - The following code example demonstrates several methods of the generic class, including the method. + The following code example demonstrates several methods of the generic class, including the method. - The code example creates a stack of strings with default capacity and uses the method to push five strings onto the stack. The elements of the stack are enumerated, which does not change the state of the stack. The method is used to pop the first string off the stack. The method is used to look at the next item on the stack, and then the method is used to pop it off. + The code example creates a stack of strings with default capacity and uses the method to push five strings onto the stack. The elements of the stack are enumerated, which does not change the state of the stack. The method is used to pop the first string off the stack. The method is used to look at the next item on the stack, and then the method is used to pop it off. - The method is used to create an array and copy the stack elements to it, then the array is passed to the constructor that takes , creating a copy of the stack with the order of the elements reversed. The elements of the copy are displayed. + The method is used to create an array and copy the stack elements to it, then the array is passed to the constructor that takes , creating a copy of the stack with the order of the elements reversed. The elements of the copy are displayed. - An array twice the size of the stack is created, and the method is used to copy the array elements beginning at the middle of the array. The constructor is used again to create a copy of the stack with the order of elements reversed; thus, the three null elements are at the end. + An array twice the size of the stack is created, and the method is used to copy the array elements beginning at the middle of the array. The constructor is used again to create a copy of the stack with the order of elements reversed; thus, the three null elements are at the end. - The method is used to show that the string "four" is in the first copy of the stack, after which the method clears the copy and the property shows that the stack is empty. + The method is used to show that the string "four" is in the first copy of the stack, after which the method clears the copy and the property shows that the stack is empty. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/StackT/Overview/source.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/StackT/Overview/source.fs" id="Snippet1"::: @@ -1104,13 +1104,13 @@ Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection. - Initially, the enumerator is positioned before the first element in the collection. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . - returns the same object until is called. sets to the next element. + returns the same object until is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator instance instead. + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator instance instead. - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization. @@ -1177,9 +1177,9 @@ ## Remarks > [!NOTE] -> If the type of the source cannot be cast automatically to the type of the destination `array`, the non-generic implementations of throw , whereas the generic implementations throw . +> If the type of the source cannot be cast automatically to the type of the destination `array`, the non-generic implementations of throw , whereas the generic implementations throw . - This method is an O(`n`) operation, where `n` is . + This method is an O(`n`) operation, where `n` is . ]]> @@ -1255,7 +1255,7 @@ Enumerating through a collection is intrinsically not a thread-safe procedure. In the rare case where enumerations contend with write accesses, you must lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization. - returns an object that can be used to synchronize access to the . Synchronization is effective only if all threads lock this object before accessing the collection. + returns an object that can be used to synchronize access to the . Synchronization is effective only if all threads lock this object before accessing the collection. Retrieving the value of this property is an O(1) operation. @@ -1316,7 +1316,7 @@ Enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization. - returns an object that can be used to synchronize access to the . Synchronization is effective only if all threads lock this object before accessing the collection. The following code shows the use of the property. + returns an object that can be used to synchronize access to the . Synchronization is effective only if all threads lock this object before accessing the collection. The following code shows the use of the property. ```csharp ICollection ic = ...; @@ -1391,13 +1391,13 @@ Retrieving the value of this property is an O(1) operation. Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection. - Initially, the enumerator is positioned before the first element in the collection. also brings the enumerator back to this position. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. also brings the enumerator back to this position. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . - returns the same object until either or is called. sets to the next element. + returns the same object until either or is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. To set to the first element of the collection again, you can call followed by . + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. To set to the first element of the collection again, you can call followed by . - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization. @@ -1457,22 +1457,22 @@ Retrieving the value of this property is an O(1) operation. . + The elements are copied onto the array in last-in-first-out (LIFO) order, similar to the order of the elements returned by a succession of calls to . - This method is an O(`n`) operation, where `n` is . + This method is an O(`n`) operation, where `n` is . ## Examples - The following code example demonstrates several methods of the generic class, including the method. + The following code example demonstrates several methods of the generic class, including the method. - The code example creates a stack of strings with default capacity and uses the method to push five strings onto the stack. The elements of the stack are enumerated, which does not change the state of the stack. The method is used to pop the first string off the stack. The method is used to look at the next item on the stack, and then the method is used to pop it off. + The code example creates a stack of strings with default capacity and uses the method to push five strings onto the stack. The elements of the stack are enumerated, which does not change the state of the stack. The method is used to pop the first string off the stack. The method is used to look at the next item on the stack, and then the method is used to pop it off. - The method is used to create an array and copy the stack elements to it, then the array is passed to the constructor that takes , creating a copy of the stack with the order of the elements reversed. The elements of the copy are displayed. + The method is used to create an array and copy the stack elements to it, then the array is passed to the constructor that takes , creating a copy of the stack with the order of the elements reversed. The elements of the copy are displayed. - An array twice the size of the stack is created, and the method is used to copy the array elements beginning at the middle of the array. The constructor is used again to create a copy of the stack with the order of elements reversed; thus, the three null elements are at the end. + An array twice the size of the stack is created, and the method is used to copy the array elements beginning at the middle of the array. The constructor is used again to create a copy of the stack with the order of elements reversed; thus, the three null elements are at the end. - The method is used to show that the string "four" is in the first copy of the stack, after which the method clears the copy and the property shows that the stack is empty. + The method is used to show that the string "four" is in the first copy of the stack, after which the method clears the copy and the property shows that the stack is empty. :::code language="csharp" source="~/snippets/csharp/System.Collections.Generic/StackT/Overview/source.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System.Collections.Generic/StackT/Overview/source.fs" id="Snippet1"::: @@ -1528,11 +1528,11 @@ Retrieving the value of this property is an O(1) operation. can be considerable, however, so the method does nothing if the list is at more than 90 percent of capacity. This avoids incurring a large reallocation cost for a relatively small gain. + This method can be used to minimize a collection's memory overhead if no new elements will be added to the collection. The cost of reallocating and copying a large can be considerable, however, so the method does nothing if the list is at more than 90 percent of capacity. This avoids incurring a large reallocation cost for a relatively small gain. - This method is an O(`n`) operation, where `n` is . + This method is an O(`n`) operation, where `n` is . - To reset a to its initial state, call the method before calling method. Trimming an empty sets the capacity of the to the default capacity. + To reset a to its initial state, call the method before calling method. Trimming an empty sets the capacity of the to the default capacity. ]]> diff --git a/xml/System.Collections.Generic/SynchronizedCollection`1.xml b/xml/System.Collections.Generic/SynchronizedCollection`1.xml index fec3b0a9da6..a3784a5983d 100644 --- a/xml/System.Collections.Generic/SynchronizedCollection`1.xml +++ b/xml/System.Collections.Generic/SynchronizedCollection`1.xml @@ -75,7 +75,7 @@ stores data in a container and provides an object that can be set and used to synchronize access to the collection so that it is thread-safe. The container can be recovered using the property. The synchronized object can be recovered using the property. It can only be set using one of the constructors that take the `syncRoot` parameter. + The stores data in a container and provides an object that can be set and used to synchronize access to the collection so that it is thread-safe. The container can be recovered using the property. The synchronized object can be recovered using the property. It can only be set using one of the constructors that take the `syncRoot` parameter. ]]> @@ -150,7 +150,7 @@ are created using the same `syncRoot`, then access is protected across all instances. + If multiple instances of the are created using the same `syncRoot`, then access is protected across all instances. ]]> @@ -1056,7 +1056,7 @@ constructor. + The value of this `syncRoot` object can be set when creating the thread-safe collection using the constructor. ]]> diff --git a/xml/System.Collections.Generic/SynchronizedKeyedCollection`2.xml b/xml/System.Collections.Generic/SynchronizedKeyedCollection`2.xml index 642235d3292..346944ef436 100644 --- a/xml/System.Collections.Generic/SynchronizedKeyedCollection`2.xml +++ b/xml/System.Collections.Generic/SynchronizedKeyedCollection`2.xml @@ -119,7 +119,7 @@ are created using the same `syncRoot`, then access is protected across all instances. + If multiple instances of the are created using the same `syncRoot`, then access is protected across all instances. ]]> @@ -160,7 +160,7 @@ input parameter is the first generic parameter for this class. This allows us to compare keys for equality in a customized way that can be used, for example, to optimize on the most critical aspects of the comparison. + The generic parameter `K` used by the input parameter is the first generic parameter for this class. This allows us to compare keys for equality in a customized way that can be used, for example, to optimize on the most critical aspects of the comparison. ]]> diff --git a/xml/System.Collections.Generic/SynchronizedReadOnlyCollection`1.xml b/xml/System.Collections.Generic/SynchronizedReadOnlyCollection`1.xml index d6462ab53c2..fa8ecde81f3 100644 --- a/xml/System.Collections.Generic/SynchronizedReadOnlyCollection`1.xml +++ b/xml/System.Collections.Generic/SynchronizedReadOnlyCollection`1.xml @@ -61,7 +61,7 @@ stores data in an container and provides an object that can be set and used to synchronize access to the collection so that it is thread safe. The container can be recovered using the property. The synchronized object can be recovered using the property. It can only be set using one of the constructors that take the `syncRoot` parameter. + The stores data in an container and provides an object that can be set and used to synchronize access to the collection so that it is thread safe. The container can be recovered using the property. The synchronized object can be recovered using the property. It can only be set using one of the constructors that take the `syncRoot` parameter. ]]> @@ -134,7 +134,7 @@ are created using the same `syncRoot`, then access is protected across all instances. + If multiple instances of the are created using the same `syncRoot`, then access is protected across all instances. ]]> @@ -885,7 +885,7 @@ This member is an explicit interface member implementation. It can be used only constructor. + The value of this `syncRoot` object can be set when creating the thread-safe collection using the constructor. ]]> diff --git a/xml/System.Collections.Immutable/IImmutableDictionary`2.xml b/xml/System.Collections.Immutable/IImmutableDictionary`2.xml index 394be3d5e6d..31ad03c04d3 100644 --- a/xml/System.Collections.Immutable/IImmutableDictionary`2.xml +++ b/xml/System.Collections.Immutable/IImmutableDictionary`2.xml @@ -70,7 +70,7 @@ requires an equality comparer implementation to determine if two keys are equal. + A requires an equality comparer implementation to determine if two keys are equal. ]]> @@ -461,7 +461,7 @@ may be useful: + Following are some scenarios where may be useful: - You want to reuse a previously stored object reference instead of creating a new reference. diff --git a/xml/System.Collections.Immutable/IImmutableList`1.xml b/xml/System.Collections.Immutable/IImmutableList`1.xml index 03174ff8637..f21d6dbe569 100644 --- a/xml/System.Collections.Immutable/IImmutableList`1.xml +++ b/xml/System.Collections.Immutable/IImmutableList`1.xml @@ -65,9 +65,9 @@ ## Remarks -When you add or remove items from an , a copy of the original list is created, with the changes applied. Incremental changes to a list share as much memory as possible with earlier versions of a list and enable garbage collection to clean up any unique list data that is no longer being referenced. +When you add or remove items from an , a copy of the original list is created, with the changes applied. Incremental changes to a list share as much memory as possible with earlier versions of a list and enable garbage collection to clean up any unique list data that is no longer being referenced. -For information on creating an `IImmutableList` implementation, see . +For information on creating an `IImmutableList` implementation, see . ]]> diff --git a/xml/System.Collections.Immutable/IImmutableQueue`1.xml b/xml/System.Collections.Immutable/IImmutableQueue`1.xml index 4a89aa02be6..518b561126c 100644 --- a/xml/System.Collections.Immutable/IImmutableQueue`1.xml +++ b/xml/System.Collections.Immutable/IImmutableQueue`1.xml @@ -53,11 +53,11 @@ The type of elements in the queue. Represents an immutable first-in, first-out collection of objects. - is immutable, when you change using methods such as or , a new queue will be returned with the changes applied and the original queue remains unchanged. - + is immutable, when you change using methods such as or , a new queue will be returned with the changes applied and the original queue remains unchanged. + ]]> diff --git a/xml/System.Collections.Immutable/IImmutableSet`1.xml b/xml/System.Collections.Immutable/IImmutableSet`1.xml index bd1cdc4cf61..a8eb134268a 100644 --- a/xml/System.Collections.Immutable/IImmutableSet`1.xml +++ b/xml/System.Collections.Immutable/IImmutableSet`1.xml @@ -620,7 +620,7 @@ may be useful: + Following are some scenarios where may be useful: - You want to reuse a previously stored object reference instead of creating a new reference. diff --git a/xml/System.Collections.Immutable/ImmutableArray.xml b/xml/System.Collections.Immutable/ImmutableArray.xml index f2906fb9a5e..0a80f955f23 100644 --- a/xml/System.Collections.Immutable/ImmutableArray.xml +++ b/xml/System.Collections.Immutable/ImmutableArray.xml @@ -236,7 +236,7 @@ and do not specify a valid range in .
is less than the lower bound of . - + -or- is less than zero. @@ -316,7 +316,7 @@ is null and does not implement or the search encounters an element that does not implement .
and do not specify a valid range in . - + -or- is , and is of a type that is not compatible with the elements of . @@ -680,7 +680,7 @@ An immutable array that contains the specified objects from the source array. @@ -792,7 +792,7 @@ This overload allows helper methods or custom builder classes to efficiently avo An immutable array that contains the specified objects from the source array. @@ -1056,11 +1056,11 @@ This overload allows helper methods or custom builder classes to efficiently avo Initializes a new instance of the struct. An immutable array that contains the specified items. - based on an existing , where a mapping function needs to be applied to each element from the source array. - + based on an existing , where a mapping function needs to be applied to each element from the source array. + ]]> @@ -1127,11 +1127,11 @@ This overload allows helper methods or custom builder classes to efficiently avo Initializes a new instance of the struct. An immutable array that contains the specified items. - based on a slice of an existing , where a mapping function needs to be applied to each element from the source array included in the resulting array. - + based on a slice of an existing , where a mapping function needs to be applied to each element from the source array included in the resulting array. + ]]> @@ -1206,11 +1206,11 @@ This overload allows helper methods or custom builder classes to efficiently avo Initializes a new instance of the struct. An immutable array that contains the specified items. - based on an existing , where a mapping function needs to be applied to each element from the source array. - + based on an existing , where a mapping function needs to be applied to each element from the source array. + ]]> @@ -1289,11 +1289,11 @@ This overload allows helper methods or custom builder classes to efficiently avo Initializes a new instance of the struct. An immutable array that contains the specified items. - based on a slice of an existing , where a mapping function needs to be applied to each element from the source array included in the resulting array. - + based on a slice of an existing , where a mapping function needs to be applied to each element from the source array included in the resulting array. + ]]> diff --git a/xml/System.Collections.Immutable/ImmutableArray`1+Builder.xml b/xml/System.Collections.Immutable/ImmutableArray`1+Builder.xml index 9ff79d6160c..5bb282aaeb9 100644 --- a/xml/System.Collections.Immutable/ImmutableArray`1+Builder.xml +++ b/xml/System.Collections.Immutable/ImmutableArray`1+Builder.xml @@ -905,13 +905,13 @@ Gets or sets the number of items in the array. The number of items in the array. - @@ -2207,11 +2207,11 @@ Returns an enumerator that iterates through the array. An enumerator that iterates through the array. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -2252,11 +2252,11 @@ Returns an enumerator that iterates through the array. An enumerator that iterates through the array. - instance is cast to an interface. - + instance is cast to an interface. + ]]> diff --git a/xml/System.Collections.Immutable/ImmutableArray`1.xml b/xml/System.Collections.Immutable/ImmutableArray`1.xml index a8db8faa149..011f3301d66 100644 --- a/xml/System.Collections.Immutable/ImmutableArray`1.xml +++ b/xml/System.Collections.Immutable/ImmutableArray`1.xml @@ -104,7 +104,7 @@ and others best for . + There are different scenarios best for and others best for . Reasons to use immutable array: @@ -117,7 +117,7 @@ - Updating the data is common or the number of elements isn't expected to be small - Updating the collection is more performance critical than iterating the contents -The following table summarizes the performance characteristics of +The following table summarizes the performance characteristics of | Operation | ImmutableArray complexity | ImmutableList complexity | Comments | | --------- | ------------------------- | ------------------------ | -------- | @@ -133,7 +133,7 @@ This example shows how to create a new immutable array by adding and removing it :::code language="csharp" source="~/snippets/csharp/System.Collections.Immutable/ImmutableArray`1/Overview/ImmutableArraySnippets.cs" id="SnippetModify"::: -This example shows how to create an immutable array using : +This example shows how to create an immutable array using : :::code language="csharp" source="~/snippets/csharp/System.Collections.Immutable/ImmutableArray`1/Overview/ImmutableArraySnippets.cs" id="SnippetBuilder"::: @@ -588,7 +588,7 @@ This example shows how to create an immutable array using method can be reversed using the method. However, a downcast is only successful when it reverses a prior upcast. operation. + Upcasts of element created with the method can be reversed using the method. However, a downcast is only successful when it reverses a prior upcast. operation. ]]> @@ -849,7 +849,7 @@ This example shows how to create an immutable array using or method. + Covariant upcasts from this method may be reversed by calling the or method. ]]>
@@ -3334,7 +3334,7 @@ This example shows how to create an immutable array using instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]>
@@ -3378,7 +3378,7 @@ This example shows how to create an immutable array using instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]>
@@ -3514,7 +3514,7 @@ This example shows how to create an immutable array using instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]>
@@ -3559,7 +3559,7 @@ This example shows how to create an immutable array using instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]>
@@ -3609,7 +3609,7 @@ This example shows how to create an immutable array using instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]>
@@ -3827,7 +3827,7 @@ This example shows how to create an immutable array using instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]>
@@ -4519,7 +4519,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -4567,7 +4567,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -4612,7 +4612,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -4662,7 +4662,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -4712,7 +4712,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -4762,7 +4762,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -4810,7 +4810,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -4858,7 +4858,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -4908,7 +4908,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -4958,7 +4958,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -5010,7 +5010,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -5062,7 +5062,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -5112,7 +5112,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -5164,7 +5164,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> diff --git a/xml/System.Collections.Immutable/ImmutableDictionary`2+Builder.xml b/xml/System.Collections.Immutable/ImmutableDictionary`2+Builder.xml index 537183bca6d..65a553eb504 100644 --- a/xml/System.Collections.Immutable/ImmutableDictionary`2+Builder.xml +++ b/xml/System.Collections.Immutable/ImmutableDictionary`2+Builder.xml @@ -92,7 +92,7 @@ and other methods already provide fast bulk change operations on a collection, the class allows multiple combinations of changes to be made to a set with equal efficiency. + Although and other methods already provide fast bulk change operations on a collection, the class allows multiple combinations of changes to be made to a set with equal efficiency. ]]> @@ -1058,7 +1058,7 @@ instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -1210,7 +1210,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -1259,7 +1259,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -1304,7 +1304,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -1537,7 +1537,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -1627,7 +1627,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -1717,7 +1717,7 @@ This member is an explicit interface member implementation. It can be used only may be useful: + Following are some scenarios where may be useful: - You want to reuse a previously stored object reference instead of creating a new reference. diff --git a/xml/System.Collections.Immutable/ImmutableDictionary`2.xml b/xml/System.Collections.Immutable/ImmutableDictionary`2.xml index 8d3a98b4dc5..ae1b308fc4e 100644 --- a/xml/System.Collections.Immutable/ImmutableDictionary`2.xml +++ b/xml/System.Collections.Immutable/ImmutableDictionary`2.xml @@ -1296,7 +1296,7 @@ This example shows how to create a new immutable dictionary by adding and removi instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -1448,7 +1448,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -1492,7 +1492,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -1542,7 +1542,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -1587,7 +1587,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -1819,7 +1819,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -1909,7 +1909,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -2290,7 +2290,7 @@ This member is an explicit interface member implementation. It can be used only may be useful: + Following are some scenarios where may be useful: - You want to reuse a previously stored object reference instead of creating a new reference. diff --git a/xml/System.Collections.Immutable/ImmutableHashSet`1+Builder.xml b/xml/System.Collections.Immutable/ImmutableHashSet`1+Builder.xml index 6092ad97d2d..bed65673687 100644 --- a/xml/System.Collections.Immutable/ImmutableHashSet`1+Builder.xml +++ b/xml/System.Collections.Immutable/ImmutableHashSet`1+Builder.xml @@ -68,11 +68,11 @@ Represents a hash set that mutates with little or no memory allocations and that can produce or build on immutable hash set instances efficiently. - and other methods already provide fast bulk change operations on a collection, the class allows multiple combinations of changes to be made to a set with equal efficiency. - + and other methods already provide fast bulk change operations on a collection, the class allows multiple combinations of changes to be made to a set with equal efficiency. + ]]> @@ -759,11 +759,11 @@ The object to add to the set. Adds an item to the hash set. - instance is cast to an interface. - + instance is cast to an interface. + ]]> The set is read-only. @@ -809,11 +809,11 @@ The zero-based index in at which copying begins. Copies the elements of the hash set to an array, starting at a particular array index. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -892,11 +892,11 @@ Returns an enumerator that iterates through the collection. An enumerator that can be used to iterate through the collection. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -937,11 +937,11 @@ Returns an enumerator that iterates through a collection. An enumerator that can be used to iterate through the collection. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -979,11 +979,11 @@ Creates an immutable hash set based on the contents of this instance. An immutable set. - diff --git a/xml/System.Collections.Immutable/ImmutableHashSet`1.xml b/xml/System.Collections.Immutable/ImmutableHashSet`1.xml index cbb9c609819..b2dd8baaf36 100644 --- a/xml/System.Collections.Immutable/ImmutableHashSet`1.xml +++ b/xml/System.Collections.Immutable/ImmutableHashSet`1.xml @@ -96,11 +96,11 @@ The type of elements in the hash set. Represents an immutable, unordered hash set. - This type is thread safe. @@ -499,11 +499,11 @@ This example shows how to use set operations on immutable hash sets: if the current set is a proper subset of the specified collection; otherwise, . - @@ -550,11 +550,11 @@ This example shows how to use set operations on immutable hash sets: if the current set is a proper superset of the specified collection; otherwise, . - @@ -883,11 +883,11 @@ This example shows how to use set operations on immutable hash sets: The object to add to the set. Adds an item to the set. - instance is cast to an interface. - + instance is cast to an interface. + ]]> The set is read-only. @@ -928,11 +928,11 @@ This example shows how to use set operations on immutable hash sets: Removes all items from this set. - instance is cast to an interface. - + instance is cast to an interface. + ]]> The set is read-only. @@ -978,11 +978,11 @@ This example shows how to use set operations on immutable hash sets: The zero-based index in at which copying begins. Copies the elements of the set to an array, starting at a particular index. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -1065,11 +1065,11 @@ This example shows how to use set operations on immutable hash sets: if the element is successfully removed; otherwise, . - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -1110,11 +1110,11 @@ This example shows how to use set operations on immutable hash sets: Returns an enumerator that iterates through the collection. An enumerator that iterates through the collection. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -1159,11 +1159,11 @@ This example shows how to use set operations on immutable hash sets: if the element is added to the set; if the element is already in the set. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -1206,11 +1206,11 @@ This example shows how to use set operations on immutable hash sets: The collection of items to remove. Removes all elements in the specified collection from the current set. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -1253,11 +1253,11 @@ This example shows how to use set operations on immutable hash sets: The collection to compare to the current collection. Modifies the current set so that it contains only elements that are also in a specified collection. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -1300,11 +1300,11 @@ This example shows how to use set operations on immutable hash sets: The collection to compare to the current set. Modifies the current set so that it contains only elements that are present either in the current set or in the specified collection, but not both. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -1347,11 +1347,11 @@ This example shows how to use set operations on immutable hash sets: The collection to compare to the current set. Modifies the current set so that it contains all elements that are present in either the current set or in the specified collection. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -1396,11 +1396,11 @@ This example shows how to use set operations on immutable hash sets: The zero-based index in at which copying begins. Copies the elements of the set to an array, starting at a particular index. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -1544,11 +1544,11 @@ This member is an explicit interface member implementation. It can be used only Returns an enumerator that iterates through a set. An enumerator that can be used to iterate through the set. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -1592,11 +1592,11 @@ This member is an explicit interface member implementation. It can be used only Adds the specified element to this immutable set. A new set with the element added, or this set if the element is already in the set. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -1637,11 +1637,11 @@ This member is an explicit interface member implementation. It can be used only Retrieves an empty set that has the same sorting and ordering semantics as this instance. An empty set that has the same sorting or ordering semantics as this instance. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -1685,11 +1685,11 @@ This member is an explicit interface member implementation. It can be used only Removes the elements in the specified collection from the current set. A new set with the items removed; or the original set if none of the items were in the set. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -1733,11 +1733,11 @@ This member is an explicit interface member implementation. It can be used only Creates an immutable set that contains elements that exist in both this set and the specified set. A new immutable set that contains any elements that exist in both sets. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -1781,11 +1781,11 @@ This member is an explicit interface member implementation. It can be used only Removes the specified element from this immutable set. A new set with the specified element removed, or the current set if the element cannot be found in the set. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -1829,11 +1829,11 @@ This member is an explicit interface member implementation. It can be used only Creates an immutable set that contains only elements that are present either in the current set or in the specified collection, but not both. A new set that contains the elements that are present only in the current set or in the specified collection, but not both. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -1877,11 +1877,11 @@ This member is an explicit interface member implementation. It can be used only Creates a new immutable set that contains all elements that are present in either the current set or in the specified collection. A new immutable set with the items added; or the original set if all the items were already in the set. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -1919,11 +1919,11 @@ This member is an explicit interface member implementation. It can be used only Creates an immutable hash set that has the same contents as this set and can be efficiently mutated across multiple operations by using standard mutable interfaces. A set with the same contents as this set that can be efficiently mutated across multiple operations by using standard mutable interfaces. - @@ -1969,11 +1969,11 @@ This member is an explicit interface member implementation. It can be used only Searches the set for a given value and returns the equal value it finds, if any. A value indicating whether the search was successful. - diff --git a/xml/System.Collections.Immutable/ImmutableList`1+Builder.xml b/xml/System.Collections.Immutable/ImmutableList`1+Builder.xml index 5f971c1ef53..113b349cc3b 100644 --- a/xml/System.Collections.Immutable/ImmutableList`1+Builder.xml +++ b/xml/System.Collections.Immutable/ImmutableList`1+Builder.xml @@ -84,7 +84,7 @@ and other methods already provide fast bulk change operations on the list, the class allows multiple combinations of changes to be made to a list with equal efficiency. + Although and other methods already provide fast bulk change operations on the list, the class allows multiple combinations of changes to be made to a list with equal efficiency. ]]> @@ -209,7 +209,7 @@ does not contain the specified value, the method returns a negative integer. You can apply the bitwise complement operation (~) to this negative integer to get the index of the first element that is larger than the search value. When inserting the value into the , this index should be used as the insertion point to maintain the sort order. + If the does not contain the specified value, the method returns a negative integer. You can apply the bitwise complement operation (~) to this negative integer to get the index of the first element that is larger than the search value. When inserting the value into the , this index should be used as the insertion point to maintain the sort order. ]]> @@ -268,7 +268,7 @@ does not contain the specified value, the method returns a negative integer. You can apply the bitwise complement operation (~) to this negative integer to get the index of the first element that is larger than the search value. When inserting the value into the , this index should be used as the insertion point to maintain the sort order. + If the does not contain the specified value, the method returns a negative integer. You can apply the bitwise complement operation (~) to this negative integer to get the index of the first element that is larger than the search value. When inserting the value into the , this index should be used as the insertion point to maintain the sort order. ]]> @@ -333,7 +333,7 @@ does not contain the specified value, the method returns a negative integer. You can apply the bitwise complement operation (~) to this negative integer to get the index of the first element that is larger than the search value. When inserting the value into the , this index should be used as the insertion point to maintain the sort order. + If the does not contain the specified value, the method returns a negative integer. You can apply the bitwise complement operation (~) to this negative integer to get the index of the first element that is larger than the search value. When inserting the value into the , this index should be used as the insertion point to maintain the sort order. ]]> @@ -2342,7 +2342,7 @@ instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -2391,7 +2391,7 @@ instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -2540,7 +2540,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -2588,7 +2588,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -2633,7 +2633,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -2683,7 +2683,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -2732,7 +2732,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -2782,7 +2782,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -2970,7 +2970,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> diff --git a/xml/System.Collections.Immutable/ImmutableList`1+Enumerator.xml b/xml/System.Collections.Immutable/ImmutableList`1+Enumerator.xml index 4c6dd104836..8f7095b6c91 100644 --- a/xml/System.Collections.Immutable/ImmutableList`1+Enumerator.xml +++ b/xml/System.Collections.Immutable/ImmutableList`1+Enumerator.xml @@ -58,14 +58,14 @@ Enumerates the contents of a binary tree. - and . - + and . + > [!CAUTION] -> When this enumerator is used as a value type (that is, when it isn't boxed), do not copy it by assigning it to a second variable or by passing it to another method. When this enumerator is disposed of, it returns a mutable reference type stack to a resource pool, and if the value type enumerator is copied (which can easily happen unintentionally if you pass the value around), there is a risk that a stack that has already been returned to the resource pool may still be in use by one of the enumerator copies, leading to data corruption or exceptions. - +> When this enumerator is used as a value type (that is, when it isn't boxed), do not copy it by assigning it to a second variable or by passing it to another method. When this enumerator is disposed of, it returns a mutable reference type stack to a resource pool, and if the value type enumerator is copied (which can easily happen unintentionally if you pass the value around), there is a risk that a stack that has already been returned to the resource pool may still be in use by one of the enumerator copies, leading to data corruption or exceptions. + ]]> This type is thread safe. diff --git a/xml/System.Collections.Immutable/ImmutableList`1.xml b/xml/System.Collections.Immutable/ImmutableList`1.xml index 83d2407d99f..ad89c088544 100644 --- a/xml/System.Collections.Immutable/ImmutableList`1.xml +++ b/xml/System.Collections.Immutable/ImmutableList`1.xml @@ -98,7 +98,7 @@ ## Remarks -`ImmutableList` has no public constructor; you begin by retrieving an empty `ImmutableList` by using the . You can then call methods, such as and , to populate the collection. Note that these methods return a new object. When you add or remove items from an immutable list, a copy of the original list is made with the items added or removed, and the original list is unchanged. +`ImmutableList` has no public constructor; you begin by retrieving an empty `ImmutableList` by using the . You can then call methods, such as and , to populate the collection. Note that these methods return a new object. When you add or remove items from an immutable list, a copy of the original list is made with the items added or removed, and the original list is unchanged. ## Examples This example shows how to create an immutable list and iterate over elements in it: @@ -2290,7 +2290,7 @@ This example shows how to create a new immutable list by adding and removing ite instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -2335,7 +2335,7 @@ This example shows how to create a new immutable list by adding and removing ite instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -2423,7 +2423,7 @@ This example shows how to create a new immutable list by adding and removing ite instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -2469,7 +2469,7 @@ This example shows how to create a new immutable list by adding and removing ite instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -2518,7 +2518,7 @@ This example shows how to create a new immutable list by adding and removing ite instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -2609,7 +2609,7 @@ This example shows how to create a new immutable list by adding and removing ite instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -2659,7 +2659,7 @@ This example shows how to create a new immutable list by adding and removing ite instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -2806,7 +2806,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -2854,7 +2854,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -2899,7 +2899,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -2949,7 +2949,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -2998,7 +2998,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -3048,7 +3048,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -3238,7 +3238,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -3286,7 +3286,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -3335,7 +3335,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -3383,7 +3383,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -3428,7 +3428,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -3478,7 +3478,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -3528,7 +3528,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -3578,7 +3578,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -3626,7 +3626,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -3674,7 +3674,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -3692,7 +3692,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -3742,7 +3742,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -3794,7 +3794,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -3891,7 +3891,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> diff --git a/xml/System.Collections.Immutable/ImmutableQueue`1.xml b/xml/System.Collections.Immutable/ImmutableQueue`1.xml index ea47e2636a0..779ece036f5 100644 --- a/xml/System.Collections.Immutable/ImmutableQueue`1.xml +++ b/xml/System.Collections.Immutable/ImmutableQueue`1.xml @@ -446,11 +446,11 @@ Returns an enumerator that iterates through the collection. An enumerator that can be used to iterate through the collection. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -491,11 +491,11 @@ Returns an enumerator that iterates through a collection. An object that can be used to iterate through the collection. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -536,11 +536,11 @@ Removes all elements from the immutable queue. The empty immutable queue. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -581,11 +581,11 @@ Removes the element at the beginning of the immutable queue, and returns the new queue. The new immutable queue; never . - instance is cast to an interface. - + instance is cast to an interface. + ]]> The queue is empty. @@ -630,11 +630,11 @@ Adds an element to the end of the immutable queue, and returns the new queue. The new immutable queue. - instance is cast to an interface. - + instance is cast to an interface. + ]]> diff --git a/xml/System.Collections.Immutable/ImmutableSortedDictionary`2+Builder.xml b/xml/System.Collections.Immutable/ImmutableSortedDictionary`2+Builder.xml index 7a5d9e70054..a22da1f27d5 100644 --- a/xml/System.Collections.Immutable/ImmutableSortedDictionary`2+Builder.xml +++ b/xml/System.Collections.Immutable/ImmutableSortedDictionary`2+Builder.xml @@ -1027,7 +1027,7 @@ instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -1179,7 +1179,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -1228,7 +1228,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -1273,7 +1273,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -1505,7 +1505,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -1595,7 +1595,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -1685,7 +1685,7 @@ This member is an explicit interface member implementation. It can be used only may be useful: + Following are some scenarios where may be useful: - You want to reuse a previously stored object reference instead of creating a new reference. diff --git a/xml/System.Collections.Immutable/ImmutableSortedDictionary`2+Enumerator.xml b/xml/System.Collections.Immutable/ImmutableSortedDictionary`2+Enumerator.xml index b73bb7bd686..96157eaadc8 100644 --- a/xml/System.Collections.Immutable/ImmutableSortedDictionary`2+Enumerator.xml +++ b/xml/System.Collections.Immutable/ImmutableSortedDictionary`2+Enumerator.xml @@ -59,14 +59,14 @@ Enumerates the contents of a binary tree. - and . - + and . + > [!CAUTION] -> When this enumerator is used as a value type (that is, when it isn't boxed), do not copy it by assigning it to a second variable or by passing it to another method. When this enumerator is disposed of, it returns a mutable reference type stack to a resource pool, and if the value type enumerator is copied (which can easily happen unintentionally if you pass the value around), there is a risk that a stack that has already been returned to the resource pool may still be in use by one of the enumerator copies, leading to data corruption or exceptions. - +> When this enumerator is used as a value type (that is, when it isn't boxed), do not copy it by assigning it to a second variable or by passing it to another method. When this enumerator is disposed of, it returns a mutable reference type stack to a resource pool, and if the value type enumerator is copied (which can easily happen unintentionally if you pass the value around), there is a risk that a stack that has already been returned to the resource pool may still be in use by one of the enumerator copies, leading to data corruption or exceptions. + ]]> This type is thread safe. diff --git a/xml/System.Collections.Immutable/ImmutableSortedDictionary`2.xml b/xml/System.Collections.Immutable/ImmutableSortedDictionary`2.xml index 8fcd8d5b58a..99458291799 100644 --- a/xml/System.Collections.Immutable/ImmutableSortedDictionary`2.xml +++ b/xml/System.Collections.Immutable/ImmutableSortedDictionary`2.xml @@ -1267,7 +1267,7 @@ instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -1419,7 +1419,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -1463,7 +1463,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -1513,7 +1513,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -1558,7 +1558,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -1790,7 +1790,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -1880,7 +1880,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -2261,7 +2261,7 @@ This member is an explicit interface member implementation. It can be used only may be useful: + Following are some scenarios where may be useful: - You want to reuse a previously stored object reference instead of creating a new reference. diff --git a/xml/System.Collections.Immutable/ImmutableSortedSet`1+Builder.xml b/xml/System.Collections.Immutable/ImmutableSortedSet`1+Builder.xml index 49c839ee872..2193c72a37c 100644 --- a/xml/System.Collections.Immutable/ImmutableSortedSet`1+Builder.xml +++ b/xml/System.Collections.Immutable/ImmutableSortedSet`1+Builder.xml @@ -75,11 +75,11 @@ Represents a sorted set that enables changes with little or no memory allocations, and efficiently manipulates or builds immutable sorted sets. - and other methods already provide fast bulk change operations on a collection, the class enables multiple combinations of changes to be made to a set with equal or greater efficiency, depending on the operation. - + and other methods already provide fast bulk change operations on a collection, the class enables multiple combinations of changes to be made to a set with equal or greater efficiency, depending on the operation. + ]]> @@ -592,11 +592,11 @@ Gets the element of the set at the given index. The element at the given position. - @@ -673,11 +673,11 @@ Gets or sets the object that is used to determine equality for the values in the immutable sorted set. The comparer that is used to determine equality for the values in the set. - @@ -1003,11 +1003,11 @@ The element to add to the set. Adds an element to the current set and returns a value to indicate whether the element was successfully added. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -1052,11 +1052,11 @@ The zero-based index in at which copying begins. Copies the elements of the collection to an array, starting at a particular array index. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -1134,11 +1134,11 @@ Returns an enumerator that iterates through the collection. A enumerator that can be used to iterate through the collection. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -1183,11 +1183,11 @@ The zero-based index in at which copying begins. Copies the elements of the set to an array, starting at a particular array index. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -1331,11 +1331,11 @@ This member is an explicit interface member implementation. It can be used only Returns an enumerator that iterates through the collection. A enumerator that can be used to iterate through the collection. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -1373,11 +1373,11 @@ This member is an explicit interface member implementation. It can be used only Creates an immutable sorted set based on the contents of this instance. An immutable set. - diff --git a/xml/System.Collections.Immutable/ImmutableSortedSet`1+Enumerator.xml b/xml/System.Collections.Immutable/ImmutableSortedSet`1+Enumerator.xml index 7c5719bf4ee..de99552e1f0 100644 --- a/xml/System.Collections.Immutable/ImmutableSortedSet`1+Enumerator.xml +++ b/xml/System.Collections.Immutable/ImmutableSortedSet`1+Enumerator.xml @@ -58,14 +58,14 @@ Enumerates the contents of a binary tree. - and . - + and . + > [!CAUTION] -> When this enumerator is used as a value type (that is, when it isn't boxed), do not copy it by assigning it to a second variable or by passing it to another method. When this enumerator is disposed of, it returns a mutable reference type stack to a resource pool, and if the value type enumerator is copied (which can easily happen unintentionally if you pass the value around), there is a risk that a stack that has already been returned to the resource pool may still be in use by one of the enumerator copies, leading to data corruption or exceptions. - +> When this enumerator is used as a value type (that is, when it isn't boxed), do not copy it by assigning it to a second variable or by passing it to another method. When this enumerator is disposed of, it returns a mutable reference type stack to a resource pool, and if the value type enumerator is copied (which can easily happen unintentionally if you pass the value around), there is a risk that a stack that has already been returned to the resource pool may still be in use by one of the enumerator copies, leading to data corruption or exceptions. + ]]> This type is thread safe. diff --git a/xml/System.Collections.Immutable/ImmutableSortedSet`1.xml b/xml/System.Collections.Immutable/ImmutableSortedSet`1.xml index db1b350b2b2..8e4c32d2829 100644 --- a/xml/System.Collections.Immutable/ImmutableSortedSet`1.xml +++ b/xml/System.Collections.Immutable/ImmutableSortedSet`1.xml @@ -109,9 +109,9 @@ ## Remarks -Create a new immutable sorted set that is prepopulated with items by using the method. When you manipulate an immutable set with methods such as , or , a copy of the original sorted set is made, manipulations applied and a new immutable sorted set is returned. +Create a new immutable sorted set that is prepopulated with items by using the method. When you manipulate an immutable set with methods such as , or , a copy of the original sorted set is made, manipulations applied and a new immutable sorted set is returned. -If you need to perform multiple operations on an immutable collection, to increase efficiency you can copy the to a , using the method, manipulate the set and make it immutable again using the method. This will not change the original immutable sorted set. +If you need to perform multiple operations on an immutable collection, to increase efficiency you can copy the to a , using the method, manipulate the set and make it immutable again using the method. This will not change the original immutable sorted set. ]]> @@ -1151,7 +1151,7 @@ All collections, including empty sets, are supersets of an empty set. Therefore, ## Remarks -This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. +This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -1196,7 +1196,7 @@ This member is an explicit interface member implementation. It can be used only ## Remarks -This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. +This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -1246,7 +1246,7 @@ This member is an explicit interface member implementation. It can be used only ## Remarks -This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. +This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]>
@@ -1333,7 +1333,7 @@ This member is an explicit interface member implementation. It can be used only ## Remarks -This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. +This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]>
@@ -1379,7 +1379,7 @@ This member is an explicit interface member implementation. It can be used only ## Remarks -This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. +This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]>
@@ -1429,7 +1429,7 @@ This member is an explicit interface member implementation. It can be used only ## Remarks -This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. +This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]>
@@ -1518,7 +1518,7 @@ This member is an explicit interface member implementation. It can be used only ## Remarks -This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. +This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]>
@@ -1568,7 +1568,7 @@ This member is an explicit interface member implementation. It can be used only ## Remarks -This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. +This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]>
@@ -1616,7 +1616,7 @@ This member is an explicit interface member implementation. It can be used only ## Remarks -This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. +This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]>
@@ -1664,7 +1664,7 @@ This member is an explicit interface member implementation. It can be used only ## Remarks -This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. +This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]>
@@ -1712,7 +1712,7 @@ This member is an explicit interface member implementation. It can be used only ## Remarks -This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. +This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]>
@@ -1760,7 +1760,7 @@ This member is an explicit interface member implementation. It can be used only ## Remarks -This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. +This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]>
@@ -1810,7 +1810,7 @@ This member is an explicit interface member implementation. It can be used only ## Remarks -This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. +This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]>
@@ -1958,7 +1958,7 @@ This member is an explicit interface member implementation. It can be used only ## Remarks -This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. +This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]>
@@ -2007,7 +2007,7 @@ This member is an explicit interface member implementation. It can be used only ## Remarks -This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. +This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]>
@@ -2053,7 +2053,7 @@ This member is an explicit interface member implementation. It can be used only ## Remarks -This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. +This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]>
@@ -2104,7 +2104,7 @@ This member is an explicit interface member implementation. It can be used only ## Remarks -This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. +This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]>
@@ -2153,7 +2153,7 @@ This member is an explicit interface member implementation. It can be used only ## Remarks -This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. +This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]>
@@ -2203,7 +2203,7 @@ This member is an explicit interface member implementation. It can be used only ## Remarks -This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. +This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]>
@@ -2393,7 +2393,7 @@ This member is an explicit interface member implementation. It can be used only ## Remarks -This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. +This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]>
@@ -2442,7 +2442,7 @@ This member is an explicit interface member implementation. It can be used only ## Remarks -This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. +This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]>
@@ -2492,7 +2492,7 @@ This member is an explicit interface member implementation. It can be used only ## Remarks -This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. +This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]>
@@ -2538,7 +2538,7 @@ This member is an explicit interface member implementation. It can be used only ## Remarks -This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. +This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]>
@@ -2587,7 +2587,7 @@ This member is an explicit interface member implementation. It can be used only ## Remarks -This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. +This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]>
@@ -2636,7 +2636,7 @@ This member is an explicit interface member implementation. It can be used only ## Remarks -This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. +This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]>
@@ -2685,7 +2685,7 @@ This member is an explicit interface member implementation. It can be used only ## Remarks -This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. +This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]>
@@ -2734,7 +2734,7 @@ This member is an explicit interface member implementation. It can be used only ## Remarks -This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. +This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]>
@@ -2783,7 +2783,7 @@ This member is an explicit interface member implementation. It can be used only ## Remarks -This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. +This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]>
@@ -2826,7 +2826,7 @@ This member is an explicit interface member implementation. It can be used only ## Remarks -If you need to perform multiple operations on an immutable collection, to increase efficiency you can copy the to a , using the method, manipulate the set and make it immutable again using the method. This will not change the original immutable sorted set. +If you need to perform multiple operations on an immutable collection, to increase efficiency you can copy the to a , using the method, manipulate the set and make it immutable again using the method. This will not change the original immutable sorted set. This is an O(1) operation and results in only a single (small) memory allocation. The mutable collection that is returned is not thread safe. diff --git a/xml/System.Collections.Immutable/ImmutableStack`1.xml b/xml/System.Collections.Immutable/ImmutableStack`1.xml index efaaf882490..80b48561a8a 100644 --- a/xml/System.Collections.Immutable/ImmutableStack`1.xml +++ b/xml/System.Collections.Immutable/ImmutableStack`1.xml @@ -449,11 +449,11 @@ Returns an enumerator that iterates through the collection. An enumerator that can be used to iterate through the collection. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -494,11 +494,11 @@ Returns an enumerator that iterates through a collection. An object that can be used to iterate through the collection. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -539,11 +539,11 @@ Removes all elements from the immutable stack. The empty immutable stack. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -584,11 +584,11 @@ Removes the element at the top of the immutable stack and returns the new stack. The new stack; never . - instance is cast to an interface. - + instance is cast to an interface. + ]]> The stack is empty. @@ -633,11 +633,11 @@ Inserts an element at the top of the immutable stack and returns the new stack. The new stack. - instance is cast to an interface. - + instance is cast to an interface. + ]]> diff --git a/xml/System.Collections.ObjectModel/Collection`1.xml b/xml/System.Collections.ObjectModel/Collection`1.xml index 5f86e274180..85b8341d8fd 100644 --- a/xml/System.Collections.ObjectModel/Collection`1.xml +++ b/xml/System.Collections.ObjectModel/Collection`1.xml @@ -120,35 +120,35 @@ class can be used immediately by creating an instance of one of its constructed types; all you have to do is specify the type of object to be contained in the collection. In addition, you can derive your own collection type from any constructed type, or derive a generic collection type from the class itself. + The class can be used immediately by creating an instance of one of its constructed types; all you have to do is specify the type of object to be contained in the collection. In addition, you can derive your own collection type from any constructed type, or derive a generic collection type from the class itself. - The class provides protected methods that can be used to customize its behavior when adding and removing items, clearing the collection, or setting the value of an existing item. + The class provides protected methods that can be used to customize its behavior when adding and removing items, clearing the collection, or setting the value of an existing item. - Most objects can be modified. However, a object that is initialized with a read-only object cannot be modified. See for a read-only version of this class. + Most objects can be modified. However, a object that is initialized with a read-only object cannot be modified. See for a read-only version of this class. Elements in this collection can be accessed using an integer index. Indexes in this collection are zero-based. - accepts `null` as a valid value for reference types and allows duplicate elements. + accepts `null` as a valid value for reference types and allows duplicate elements. ## Examples - This section contains two code examples. The first example demonstrates several properties and methods of the class. The second example shows how to derive a collection class from a constructed type of , and how to override the protected methods of to provide custom behavior. + This section contains two code examples. The first example demonstrates several properties and methods of the class. The second example shows how to derive a collection class from a constructed type of , and how to override the protected methods of to provide custom behavior. Example 1 - The following code example demonstrates many of the properties and methods of . The code example creates a collection of strings, uses the method to add several strings, displays the , and lists the strings. The example uses the method to find the index of a string and the method to determine whether a string is in the collection. The example inserts a string using the method and retrieves and sets strings using the default property (the indexer in C#). The example removes strings by string identity using the method and by index using the method. Finally, the method is used to clear all strings from the collection. + The following code example demonstrates many of the properties and methods of . The code example creates a collection of strings, uses the method to add several strings, displays the , and lists the strings. The example uses the method to find the index of a string and the method to determine whether a string is in the collection. The example inserts a string using the method and retrieves and sets strings using the default property (the indexer in C#). The example removes strings by string identity using the method and by index using the method. Finally, the method is used to clear all strings from the collection. :::code language="csharp" source="~/snippets/csharp/System.Collections.ObjectModel/CollectionT/Overview/source.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.ObjectModel/CollectionT/Overview/source.vb" id="Snippet1"::: Example 2 - The following code example shows how to derive a collection class from a constructed type of the generic class, and how to override the protected , , , and methods to provide custom behavior for the , , , and methods, and for setting the property. + The following code example shows how to derive a collection class from a constructed type of the generic class, and how to override the protected , , , and methods to provide custom behavior for the , , , and methods, and for setting the property. The custom behavior provided by this example is a `Changed` notification event that is raised at the end of each of the protected methods. The `Dinosaurs` class inherits `Collection` (`Collection(Of String)` in Visual Basic) and defines the `Changed` event, which uses a `DinosaursChangedEventArgs` class for the event information, and an enumeration to identify the kind of change. - The code example calls several properties and methods of to demonstrate the custom event. + The code example calls several properties and methods of to demonstrate the custom event. :::code language="csharp" source="~/snippets/csharp/System.Collections.ObjectModel/CollectionT/Overview/source1.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.ObjectModel/CollectionT/Overview/source1.vb" id="Snippet1"::: @@ -231,7 +231,7 @@ ## Examples - The following code example demonstrates many of the properties and methods of . The code example creates a collection of strings with the constructor, uses the method to add several strings, displays the , and lists the strings. The example uses the method to find the index of a string and the method to determine whether a string is in the collection. The example inserts a string using the method and retrieves and sets strings using the default property (the indexer in C#). The example removes strings by string identity using the method and by index using the method. Finally, the method is used to clear all strings from the collection. + The following code example demonstrates many of the properties and methods of . The code example creates a collection of strings with the constructor, uses the method to add several strings, displays the , and lists the strings. The example uses the method to find the index of a string and the method to determine whether a string is in the collection. The example inserts a string using the method and retrieves and sets strings using the default property (the indexer in C#). The example removes strings by string identity using the method and by index using the method. Finally, the method is used to clear all strings from the collection. :::code language="csharp" source="~/snippets/csharp/System.Collections.ObjectModel/CollectionT/Overview/source.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.ObjectModel/CollectionT/Overview/source.vb" id="Snippet1"::: @@ -286,7 +286,7 @@ . + The elements of the list are not copied. The list is wrapped by the collection, so that subsequent changes to the elements of the list are visible through the . This constructor is an O(1) operation. @@ -348,14 +348,14 @@ accepts `null` as a valid value for reference types and allows duplicate elements. + accepts `null` as a valid value for reference types and allows duplicate elements. This method is an O(1) operation. ## Examples - The following code example demonstrates many of the properties and methods of . The code example creates a collection of strings, uses the method to add several strings, displays the , and lists the strings. The example uses the method to find the index of a string and the method to determine whether a string is in the collection. The example inserts a string using the method and retrieves and sets strings using the default property (the indexer in C#). The example removes strings by string identity using the method and by index using the method. Finally, the method is used to clear all strings from the collection. + The following code example demonstrates many of the properties and methods of . The code example creates a collection of strings, uses the method to add several strings, displays the , and lists the strings. The example uses the method to find the index of a string and the method to determine whether a string is in the collection. The example inserts a string using the method and retrieves and sets strings using the default property (the indexer in C#). The example removes strings by string identity using the method and by index using the method. Finally, the method is used to clear all strings from the collection. :::code language="csharp" source="~/snippets/csharp/System.Collections.ObjectModel/CollectionT/Overview/source.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.ObjectModel/CollectionT/Overview/source.vb" id="Snippet1"::: @@ -426,14 +426,14 @@ is set to zero, and references to other objects from elements of the collection are also released. + is set to zero, and references to other objects from elements of the collection are also released. - This method is an O(`n`) operation, where `n` is . + This method is an O(`n`) operation, where `n` is . ## Examples - The following code example demonstrates many of the properties and methods of . The code example creates a collection of strings, uses the method to add several strings, displays the , and lists the strings. The example uses the method to find the index of a string and the method to determine whether a string is in the collection. The example inserts a string using the method and retrieves and sets strings using the default property (the indexer in C#). The example removes strings by string identity using the method and by index using the method. Finally, the method is used to clear all strings from the collection. + The following code example demonstrates many of the properties and methods of . The code example creates a collection of strings, uses the method to add several strings, displays the , and lists the strings. The example uses the method to find the index of a string and the method to determine whether a string is in the collection. The example inserts a string using the method and retrieves and sets strings using the default property (the indexer in C#). The example removes strings by string identity using the method and by index using the method. Finally, the method is used to clear all strings from the collection. :::code language="csharp" source="~/snippets/csharp/System.Collections.ObjectModel/CollectionT/Overview/source.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.ObjectModel/CollectionT/Overview/source.vb" id="Snippet1"::: @@ -498,18 +498,18 @@ is set to zero, and references to other objects from elements of the collection are also released. + is set to zero, and references to other objects from elements of the collection are also released. - This method is an O(`n`) operation, where `n` is . + This method is an O(`n`) operation, where `n` is . ## Examples - The following code example shows how to derive a collection class from a constructed type of the generic class, and how to override the protected , , , and methods to provide custom behavior for the , , , and methods, and for setting the property. + The following code example shows how to derive a collection class from a constructed type of the generic class, and how to override the protected , , , and methods to provide custom behavior for the , , , and methods, and for setting the property. The custom behavior provided by this example is a `Changed` notification event that is raised at the end of each of the protected methods. The `Dinosaurs` class inherits `Collection` (`Collection(Of String)` in Visual Basic) and defines the `Changed` event, which uses a `DinosaursChangedEventArgs` class for the event information, and an enumeration to identify the kind of change. - The code example calls several properties and methods of to demonstrate the custom event. + The code example calls several properties and methods of to demonstrate the custom event. :::code language="csharp" source="~/snippets/csharp/System.Collections.ObjectModel/CollectionT/Overview/source1.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.ObjectModel/CollectionT/Overview/source1.vb" id="Snippet1"::: @@ -582,11 +582,11 @@ object is created using the parameterless constructor, this method determines equality using the default equality comparer for `T`, the type of values in the list. If type `T` does not implement the interface, the method is used. + If the object is created using the parameterless constructor, this method determines equality using the default equality comparer for `T`, the type of values in the list. If type `T` does not implement the interface, the method is used. - If the Collection object is created by passing an object to the constructor, the method will be determined by the interface used by that object. + If the Collection object is created by passing an object to the constructor, the method will be determined by the interface used by that object. - This method performs a linear search; therefore, the average execution time is proportional to . That is, this method is an O(`n`) operation, where `n` is . + This method performs a linear search; therefore, the average execution time is proportional to . That is, this method is an O(`n`) operation, where `n` is . ]]> @@ -654,11 +654,11 @@ to copy the elements. + This method uses to copy the elements. - The elements are copied to the in the same order in which the enumerator iterates through the . + The elements are copied to the in the same order in which the enumerator iterates through the . - This method is an O(`n`) operation, where `n` is . + This method is an O(`n`) operation, where `n` is . ]]> @@ -731,7 +731,7 @@ ## Examples - The following code example demonstrates many of the properties and methods of . The code example creates a collection of strings, uses the method to add several strings, displays the , and lists the strings. The example uses the method to find the index of a string and the method to determine whether a string is in the collection. The example inserts a string using the method and retrieves and sets strings using the default property (the indexer in C#). The example removes strings by string identity using the method and by index using the method. Finally, the method is used to clear all strings from the collection. + The following code example demonstrates many of the properties and methods of . The code example creates a collection of strings, uses the method to add several strings, displays the , and lists the strings. The example uses the method to find the index of a string and the method to determine whether a string is in the collection. The example inserts a string using the method and retrieves and sets strings using the default property (the indexer in C#). The example removes strings by string identity using the method and by index using the method. Finally, the method is used to clear all strings from the collection. :::code language="csharp" source="~/snippets/csharp/System.Collections.ObjectModel/CollectionT/Overview/source.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.ObjectModel/CollectionT/Overview/source.vb" id="Snippet1"::: @@ -794,11 +794,11 @@ Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection. - Initially, the enumerator is positioned before the first element in the collection. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . - returns the same object until is called. sets to the next element. + returns the same object until is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator instance instead. + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator instance instead. An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and its behavior is undefined. @@ -872,16 +872,16 @@ is searched forward starting at the first element and ending at the last element. + The is searched forward starting at the first element and ending at the last element. - This method determines equality using the default equality comparer for `T`, the type of values in the list. + This method determines equality using the default equality comparer for `T`, the type of values in the list. - This method performs a linear search; therefore, the average execution time is proportional to . That is, this method is an O(`n`) operation, where `n` is . + This method performs a linear search; therefore, the average execution time is proportional to . That is, this method is an O(`n`) operation, where `n` is . ## Examples - The following code example demonstrates many of the properties and methods of . The code example creates a collection of strings, uses the method to add several strings, displays the , and lists the strings. The example uses the method to find the index of a string and the method to determine whether a string is in the collection. The example inserts a string using the method and retrieves and sets strings using the default property (the indexer in C#). The example removes strings by string identity using the method and by index using the method. Finally, the method is used to clear all strings from the collection. + The following code example demonstrates many of the properties and methods of . The code example creates a collection of strings, uses the method to add several strings, displays the , and lists the strings. The example uses the method to find the index of a string and the method to determine whether a string is in the collection. The example inserts a string using the method and retrieves and sets strings using the default property (the indexer in C#). The example removes strings by string identity using the method and by index using the method. Finally, the method is used to clear all strings from the collection. :::code language="csharp" source="~/snippets/csharp/System.Collections.ObjectModel/CollectionT/Overview/source.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.ObjectModel/CollectionT/Overview/source.vb" id="Snippet1"::: @@ -946,11 +946,11 @@ accepts `null` as a valid value for reference types and allows duplicate elements. + accepts `null` as a valid value for reference types and allows duplicate elements. - If `index` is equal to , `item` is added to the end of . + If `index` is equal to , `item` is added to the end of . - This method is an O(`n`) operation, where `n` is . + This method is an O(`n`) operation, where `n` is . ]]> @@ -1024,22 +1024,22 @@ is meant to be overridden in a derived class. For a public method to insert an item in the , see . + The is meant to be overridden in a derived class. For a public method to insert an item in the , see . - accepts `null` as a valid value for reference types and allows duplicate elements. + accepts `null` as a valid value for reference types and allows duplicate elements. - If `index` is equal to , `item` is added to the end of . + If `index` is equal to , `item` is added to the end of . - This method is an O(`n`) operation, where `n` is . + This method is an O(`n`) operation, where `n` is . ## Examples - The following code example shows how to derive a collection class from a constructed type of the generic class, and how to override the protected , , , and methods to provide custom behavior for the , , , and methods, and for setting the property. + The following code example shows how to derive a collection class from a constructed type of the generic class, and how to override the protected , , , and methods to provide custom behavior for the , , , and methods, and for setting the property. The custom behavior provided by this example is a `Changed` notification event that is raised at the end of each of the protected methods. The `Dinosaurs` class inherits `Collection` (`Collection(Of String)` in Visual Basic) and defines the `Changed` event, which uses a `DinosaursChangedEventArgs` class for the event information, and an enumeration to identify the kind of change. - The code example calls several properties and methods of to demonstrate the custom event. + The code example calls several properties and methods of to demonstrate the custom event. :::code language="csharp" source="~/snippets/csharp/System.Collections.ObjectModel/CollectionT/Overview/source1.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.ObjectModel/CollectionT/Overview/source1.vb" id="Snippet1"::: @@ -1114,18 +1114,18 @@ accepts `null` as a valid value for reference types and allows duplicate elements. + accepts `null` as a valid value for reference types and allows duplicate elements. This property provides the ability to access a specific element in the collection by using the following syntax: `myCollection[index]`. - The C# language uses the [this](/dotnet/csharp/language-reference/keywords/this) keyword to define the indexers instead of implementing the property. Visual Basic implements as a default property, which provides the same indexing functionality. + The C# language uses the [this](/dotnet/csharp/language-reference/keywords/this) keyword to define the indexers instead of implementing the property. Visual Basic implements as a default property, which provides the same indexing functionality. Retrieving the value of this property is an O(1) operation; setting the property is also an O(1) operation. ## Examples - The following code example demonstrates many of the properties and methods of . The code example creates a collection of strings, uses the method to add several strings, displays the , and lists the strings. The example uses the method to find the index of a string and the method to determine whether a string is in the collection. The example inserts a string using the method and retrieves and sets strings using the default property (the indexer in C#). The example removes strings by string identity using the method and by index using the method. Finally, the method is used to clear all strings from the collection. + The following code example demonstrates many of the properties and methods of . The code example creates a collection of strings, uses the method to add several strings, displays the , and lists the strings. The example uses the method to find the index of a string and the method to determine whether a string is in the collection. The example inserts a string using the method and retrieves and sets strings using the default property (the indexer in C#). The example removes strings by string identity using the method and by index using the method. Finally, the method is used to clear all strings from the collection. :::code language="csharp" source="~/snippets/csharp/System.Collections.ObjectModel/CollectionT/Overview/source.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.ObjectModel/CollectionT/Overview/source.vb" id="Snippet1"::: @@ -1190,7 +1190,7 @@ class and exposes all the elements of the . + The wrapper provides the functionality of the class and exposes all the elements of the . Retrieving the value of this property is an O(1) operation. @@ -1252,14 +1252,14 @@ for `T`, the type of values in the list. + This method determines equality using the default equality comparer for `T`, the type of values in the list. - This method performs a linear search; therefore, the average execution time is proportional to . That is, this method is an O(`n`) operation, where `n` is . + This method performs a linear search; therefore, the average execution time is proportional to . That is, this method is an O(`n`) operation, where `n` is . ## Examples - The following code example demonstrates many of the properties and methods of . The code example creates a collection of strings, uses the method to add several strings, displays the , and lists the strings. The example uses the method to find the index of a string and the method to determine whether a string is in the collection. The example inserts a string using the method and retrieves and sets strings using the default property (the indexer in C#). The example removes strings by string identity using the method and by index using the method. Finally, the method is used to clear all strings from the collection. + The following code example demonstrates many of the properties and methods of . The code example creates a collection of strings, uses the method to add several strings, displays the , and lists the strings. The example uses the method to find the index of a string and the method to determine whether a string is in the collection. The example inserts a string using the method and retrieves and sets strings using the default property (the indexer in C#). The example removes strings by string identity using the method and by index using the method. Finally, the method is used to clear all strings from the collection. :::code language="csharp" source="~/snippets/csharp/System.Collections.ObjectModel/CollectionT/Overview/source.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.ObjectModel/CollectionT/Overview/source.vb" id="Snippet1"::: @@ -1328,12 +1328,12 @@ . + This method is an O(`n`) operation, where `n` is . ## Examples - The following code example demonstrates many of the properties and methods of . The code example creates a collection of strings, uses the method to add several strings, displays the , and lists the strings. The example uses the method to find the index of a string and the method to determine whether a string is in the collection. The example inserts a string using the method and retrieves and sets strings using the default property (the indexer in C#). The example removes strings by string identity using the method and by index using the method. Finally, the method is used to clear all strings from the collection. + The following code example demonstrates many of the properties and methods of . The code example creates a collection of strings, uses the method to add several strings, displays the , and lists the strings. The example uses the method to find the index of a string and the method to determine whether a string is in the collection. The example inserts a string using the method and retrieves and sets strings using the default property (the indexer in C#). The example removes strings by string identity using the method and by index using the method. Finally, the method is used to clear all strings from the collection. :::code language="csharp" source="~/snippets/csharp/System.Collections.ObjectModel/CollectionT/Overview/source.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.ObjectModel/CollectionT/Overview/source.vb" id="Snippet1"::: @@ -1409,16 +1409,16 @@ . + This method is an O(`n`) operation, where `n` is . ## Examples - The following code example shows how to derive a collection class from a constructed type of the generic class, and how to override the protected , , , and methods to provide custom behavior for the , , , and methods, and for setting the property. + The following code example shows how to derive a collection class from a constructed type of the generic class, and how to override the protected , , , and methods to provide custom behavior for the , , , and methods, and for setting the property. The custom behavior provided by this example is a `Changed` notification event that is raised at the end of each of the protected methods. The `Dinosaurs` class inherits `Collection` (`Collection(Of String)` in Visual Basic) and defines the `Changed` event, which uses a `DinosaursChangedEventArgs` class for the event information, and an enumeration to identify the kind of change. - The code example calls several properties and methods of to demonstrate the custom event. + The code example calls several properties and methods of to demonstrate the custom event. :::code language="csharp" source="~/snippets/csharp/System.Collections.ObjectModel/CollectionT/Overview/source1.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.ObjectModel/CollectionT/Overview/source1.vb" id="Snippet1"::: @@ -1485,16 +1485,16 @@ accepts `null` as a valid value for reference types and allows duplicate elements. + accepts `null` as a valid value for reference types and allows duplicate elements. This method is an O(1) operation. ## Examples - The following code example shows how to derive a collection class from a constructed type of the generic class, and how to override the protected , , , and methods to provide custom behavior for the , , , and methods, and for setting the property. + The following code example shows how to derive a collection class from a constructed type of the generic class, and how to override the protected , , , and methods to provide custom behavior for the , , , and methods, and for setting the property. The custom behavior provided by this example is a `Changed` notification event that is raised at the end of each of the protected methods. The `Dinosaurs` class inherits `Collection` (`Collection(Of String)` in Visual Basic) and defines the `Changed` event, which uses a `DinosaursChangedEventArgs` class for the event information, and an enumeration to identify the kind of change. - The code example calls several properties and methods of to demonstrate the custom event. + The code example calls several properties and methods of to demonstrate the custom event. :::code language="csharp" source="~/snippets/csharp/System.Collections.ObjectModel/CollectionT/Overview/source1.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.ObjectModel/CollectionT/Overview/source1.vb" id="Snippet1"::: @@ -1627,9 +1627,9 @@ ## Remarks > [!NOTE] -> If the type of the source cannot be cast automatically to the type of the destination `array`, the non-generic implementations of throw , whereas the generic implementations throw . +> If the type of the source cannot be cast automatically to the type of the destination `array`, the non-generic implementations of throw , whereas the generic implementations throw . - This method is an O(`n`) operation, where `n` is . + This method is an O(`n`) operation, where `n` is . ]]> @@ -1707,7 +1707,7 @@ Enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization. - returns an object that can be used to synchronize access to the . Synchronization is effective only if all threads lock this object before accessing the collection. + returns an object that can be used to synchronize access to the . Synchronization is effective only if all threads lock this object before accessing the collection. Retrieving the value of this property is an O(1) operation. @@ -1769,7 +1769,7 @@ Enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization. - returns an object that can be used to synchronize access to the . Synchronization is effective only if all threads lock this object before accessing the collection. The following code shows the use of the property. + returns an object that can be used to synchronize access to the . Synchronization is effective only if all threads lock this object before accessing the collection. The following code shows the use of the property. ```csharp ICollection ic = ...; @@ -1846,11 +1846,11 @@ Retrieving the value of this property is an O(1) operation. Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection. - Initially, the enumerator is positioned before the first element in the collection. also brings the enumerator back to this position. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. also brings the enumerator back to this position. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . - returns the same object until either or is called. sets to the next element. + returns the same object until either or is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. To set to the first element of the collection again, you can call followed by . + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. To set to the first element of the collection again, you can call followed by . An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and its behavior is undefined. @@ -1980,9 +1980,9 @@ Retrieving the value of this property is an O(1) operation. . + This method determines equality by first determining whether `value` is of type `T` (or null) and then calling . - This method is an O(`n`) operation, where `n` is . + This method is an O(`n`) operation, where `n` is . ]]> @@ -2043,9 +2043,9 @@ Retrieving the value of this property is an O(1) operation. . checks whether type `T` implements and uses that implementation, if available. If not, checks whether type `T` implements . If type `T` does not implement either interface, this method uses . + This method determines equality using the default comparer . checks whether type `T` implements and uses that implementation, if available. If not, checks whether type `T` implements . If type `T` does not implement either interface, this method uses . - This method is an O(`n`) operation, where `n` is . + This method is an O(`n`) operation, where `n` is . ]]> @@ -2109,7 +2109,7 @@ Retrieving the value of this property is an O(1) operation. ## Remarks If `index` equals the number of items in the , then `value` is appended to the end. - This method is an O(`n`) operation, where `n` is . + This method is an O(`n`) operation, where `n` is . ]]> @@ -2301,7 +2301,7 @@ Retrieving the value of this property is an O(1) operation. ## Remarks This property provides the ability to access a specific element in the collection by using the following syntax: `myCollection[index]`. - The C# language uses the [this](/dotnet/csharp/language-reference/keywords/this) keyword to define the indexers instead of implementing the property. Visual Basic implements as a default property, which provides the same indexing functionality. + The C# language uses the [this](/dotnet/csharp/language-reference/keywords/this) keyword to define the indexers instead of implementing the property. Visual Basic implements as a default property, which provides the same indexing functionality. Retrieving the value of this property is an O(1) operation; setting the property is also an O(1) operation. @@ -2364,9 +2364,9 @@ Retrieving the value of this property is an O(1) operation. . checks whether type `T` implements and uses that implementation, if available. If not, checks whether type `T` implements . If type `T` does not implement either interface, this method uses . + This method determines equality using the default comparer . checks whether type `T` implements and uses that implementation, if available. If not, checks whether type `T` implements . If type `T` does not implement either interface, this method uses . - This method is an O(`n`) operation, where `n` is . + This method is an O(`n`) operation, where `n` is . ]]> diff --git a/xml/System.Collections.ObjectModel/KeyedCollection`2.xml b/xml/System.Collections.ObjectModel/KeyedCollection`2.xml index 6c44836ab2a..6b5c42d4e59 100644 --- a/xml/System.Collections.ObjectModel/KeyedCollection`2.xml +++ b/xml/System.Collections.ObjectModel/KeyedCollection`2.xml @@ -90,42 +90,42 @@ class provides both O(1) indexed retrieval and keyed retrieval that approaches O(1). It is an abstract type, or more accurately an infinite set of abstract types, because each of its constructed generic types is an abstract base class. To use , derive your collection type from the appropriate constructed type. + The class provides both O(1) indexed retrieval and keyed retrieval that approaches O(1). It is an abstract type, or more accurately an infinite set of abstract types, because each of its constructed generic types is an abstract base class. To use , derive your collection type from the appropriate constructed type. - The class is a hybrid between a collection based on the generic interface and a collection based on the generic interface. Like collections based on the generic interface, is an indexed list of items. Like collections based on the generic interface, has a key associated with each element. + The class is a hybrid between a collection based on the generic interface and a collection based on the generic interface. Like collections based on the generic interface, is an indexed list of items. Like collections based on the generic interface, has a key associated with each element. - Unlike dictionaries, an element of is not a key/value pair; instead, the entire element is the value and the key is embedded within the value. For example, an element of a collection derived from `KeyedCollection\` (`KeyedCollection(Of String, String)` in Visual Basic) might be "John Doe Jr." where the value is "John Doe Jr." and the key is "Doe"; or a collection of employee records containing integer keys could be derived from `KeyedCollection\`. The abstract method extracts the key from the element. + Unlike dictionaries, an element of is not a key/value pair; instead, the entire element is the value and the key is embedded within the value. For example, an element of a collection derived from `KeyedCollection\` (`KeyedCollection(Of String, String)` in Visual Basic) might be "John Doe Jr." where the value is "John Doe Jr." and the key is "Doe"; or a collection of employee records containing integer keys could be derived from `KeyedCollection\`. The abstract method extracts the key from the element. - By default, the includes a lookup dictionary that you can obtain with the property. When an item is added to the , the item's key is extracted once and saved in the lookup dictionary for faster searches. This behavior is overridden by specifying a dictionary creation threshold when you create the . The lookup dictionary is created the first time the number of elements exceeds that threshold. If you specify -1 as the threshold, the lookup dictionary is never created. + By default, the includes a lookup dictionary that you can obtain with the property. When an item is added to the , the item's key is extracted once and saved in the lookup dictionary for faster searches. This behavior is overridden by specifying a dictionary creation threshold when you create the . The lookup dictionary is created the first time the number of elements exceeds that threshold. If you specify -1 as the threshold, the lookup dictionary is never created. > [!NOTE] > When the internal lookup dictionary is used, it contains references to all the items in the collection if `TItem` is a reference type, or copies of all the items in the collection if `TItem` is a value type. Thus, using the lookup dictionary may not be appropriate if `TItem` is a value type. - You can access an item by its index or key by using the property. You can add items without a key, but these items can subsequently be accessed only by index. + You can access an item by its index or key by using the property. You can add items without a key, but these items can subsequently be accessed only by index. ## Examples - This section contains two code examples. The first example shows the minimum code required to derive from , and demonstrates many of the inherited methods. The second example shows how to override the protected methods of to provide custom behavior. + This section contains two code examples. The first example shows the minimum code required to derive from , and demonstrates many of the inherited methods. The second example shows how to override the protected methods of to provide custom behavior. **Example 1** - This code example shows the minimum code necessary to derive a collection class from : overriding the method and providing a public constructor that delegates to a base class constructor. The code example also demonstrates many of the properties and methods inherited from and classes. + This code example shows the minimum code necessary to derive a collection class from : overriding the method and providing a public constructor that delegates to a base class constructor. The code example also demonstrates many of the properties and methods inherited from and classes. - The `SimpleOrder` class is a very simple requisition list that contains `OrderItem` objects, each of which represents a line item in the order. The key of `OrderItem` is immutable, an important consideration for classes that derive from . For a code example that uses mutable keys, see . + The `SimpleOrder` class is a very simple requisition list that contains `OrderItem` objects, each of which represents a line item in the order. The key of `OrderItem` is immutable, an important consideration for classes that derive from . For a code example that uses mutable keys, see . :::code language="csharp" source="~/snippets/csharp/System.Collections.ObjectModel/KeyedCollectionTKey,TItem/Overview/source.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.ObjectModel/KeyedCollectionTKey,TItem/Overview/source.vb" id="Snippet1"::: **Example 2** - The following code example shows how to override the protected , , , and methods, to provide custom behavior for the , , and methods, and for setting the default property (the indexer in C#). The custom behavior provided in this example is a notification event named `Changed`, which is raised at the end of each of the overridden methods. + The following code example shows how to override the protected , , , and methods, to provide custom behavior for the , , and methods, and for setting the default property (the indexer in C#). The custom behavior provided in this example is a notification event named `Changed`, which is raised at the end of each of the overridden methods. - The code example creates the `SimpleOrder` class, which derives from and represents a simple order form. The order form contains `OrderItem` objects representing items ordered. The code example also creates a `SimpleOrderChangedEventArgs` class to contain the event information, and an enumeration to identify the type of change. + The code example creates the `SimpleOrder` class, which derives from and represents a simple order form. The order form contains `OrderItem` objects representing items ordered. The code example also creates a `SimpleOrderChangedEventArgs` class to contain the event information, and an enumeration to identify the type of change. The code example demonstrates the custom behavior by calling the properties and methods of the derived class, in the `Main` method of the `Demo` class. - This code example uses objects with immutable keys. For a code example that uses mutable keys, see . + This code example uses objects with immutable keys. For a code example that uses mutable keys, see . :::code language="csharp" source="~/snippets/csharp/System.Collections.ObjectModel/KeyedCollectionTKey,TItem/Overview/source1.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.ObjectModel/KeyedCollectionTKey,TItem/Overview/source1.vb" id="Snippet1"::: @@ -186,21 +186,21 @@ created with this constructor uses the default generic equality comparer for the type of the key, obtained from . To specify a different generic equality comparer, use the constructor or the constructor. + A created with this constructor uses the default generic equality comparer for the type of the key, obtained from . To specify a different generic equality comparer, use the constructor or the constructor. - By default, the includes a lookup dictionary that is created when the first item is added. When an item is added to the , the item's key is extracted once and saved in the lookup dictionary for faster searches. This behavior can be overridden by using the constructor and specifying a dictionary creation threshold. + By default, the includes a lookup dictionary that is created when the first item is added. When an item is added to the , the item's key is extracted once and saved in the lookup dictionary for faster searches. This behavior can be overridden by using the constructor and specifying a dictionary creation threshold. > [!NOTE] -> Because the class is abstract (`MustInherit` in Visual Basic), you must derive from it in order to use it. In the constructor for your derived type, call the appropriate constructor. It is not necessary to expose functionality like the equality comparer or the dictionary creation threshold in your constructors. +> Because the class is abstract (`MustInherit` in Visual Basic), you must derive from it in order to use it. In the constructor for your derived type, call the appropriate constructor. It is not necessary to expose functionality like the equality comparer or the dictionary creation threshold in your constructors. This constructor is an O(1) operation. ## Examples - This code example shows the minimum code necessary to derive a collection class from : overriding the method and providing a public constructor that delegates to a base class constructor. The code example also demonstrates many of the properties and methods inherited from and classes. + This code example shows the minimum code necessary to derive a collection class from : overriding the method and providing a public constructor that delegates to a base class constructor. The code example also demonstrates many of the properties and methods inherited from and classes. - The `SimpleOrder` class is a very simple requisition list that contains `OrderItem` objects, each of which represents a line item in the order. The key of `OrderItem` is immutable, an important consideration for classes that derive from . For a code example that uses mutable keys, see . + The `SimpleOrder` class is a very simple requisition list that contains `OrderItem` objects, each of which represents a line item in the order. The key of `OrderItem` is immutable, an important consideration for classes that derive from . For a code example that uses mutable keys, see . :::code language="csharp" source="~/snippets/csharp/System.Collections.ObjectModel/KeyedCollectionTKey,TItem/Overview/source.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.ObjectModel/KeyedCollectionTKey,TItem/Overview/source.vb" id="Snippet1"::: @@ -262,10 +262,10 @@ includes a lookup dictionary that is created when the first item is added. When an item is added to the , the item's key is extracted once and saved in the lookup dictionary for faster searches. This behavior can be overridden by using the constructor and specifying a dictionary creation threshold. + By default, the includes a lookup dictionary that is created when the first item is added. When an item is added to the , the item's key is extracted once and saved in the lookup dictionary for faster searches. This behavior can be overridden by using the constructor and specifying a dictionary creation threshold. > [!NOTE] -> Because the class is abstract (`MustInherit` in Visual Basic), you must derive from it in order to use it. In the constructor for your derived type, call the appropriate constructor. It is not necessary to expose functionality like the equality comparer or the dictionary creation threshold in your constructors. +> Because the class is abstract (`MustInherit` in Visual Basic), you must derive from it in order to use it. In the constructor for your derived type, call the appropriate constructor. It is not necessary to expose functionality like the equality comparer or the dictionary creation threshold in your constructors. This constructor is an O(1) operation. @@ -328,27 +328,27 @@ includes a lookup dictionary that is created when the first item is added. When an item is added to the , the item's key is extracted once and saved in the lookup dictionary for faster searches. This constructor allows you to override that behavior. Specify 0 to create the dictionary when the first element is added, 1 to create the dictionary when the second element is added, and so on. If you specify -1 as the threshold, the lookup dictionary is never created. + By default, the includes a lookup dictionary that is created when the first item is added. When an item is added to the , the item's key is extracted once and saved in the lookup dictionary for faster searches. This constructor allows you to override that behavior. Specify 0 to create the dictionary when the first element is added, 1 to create the dictionary when the second element is added, and so on. If you specify -1 as the threshold, the lookup dictionary is never created. For very small collections the improvement in retrieval speed provided by the lookup dictionary might not be worth the extra memory required by the dictionary. Setting a threshold allows you to decide when to make that tradeoff. > [!NOTE] -> Because the class is abstract (`MustInherit` in Visual Basic), you must derive from it in order to use it. In the constructor for your derived type, call the appropriate constructor. It is not necessary to expose functionality like the equality comparer or the dictionary creation threshold in your constructors. +> Because the class is abstract (`MustInherit` in Visual Basic), you must derive from it in order to use it. In the constructor for your derived type, call the appropriate constructor. It is not necessary to expose functionality like the equality comparer or the dictionary creation threshold in your constructors. This constructor is an O(1) operation. ## Examples - The following code example shows how to override the protected , , , and methods, to provide custom behavior for the , , and methods, and for setting the default property (the indexer in C#). The custom behavior provided in this example is a notification event named `Changed`, which is raised at the end of each of the overridden methods. + The following code example shows how to override the protected , , , and methods, to provide custom behavior for the , , and methods, and for setting the default property (the indexer in C#). The custom behavior provided in this example is a notification event named `Changed`, which is raised at the end of each of the overridden methods. - The code example uses the constructor with a threshold of 0, so that the internal dictionary is created the first time an object is added to the collection. + The code example uses the constructor with a threshold of 0, so that the internal dictionary is created the first time an object is added to the collection. - The code example creates the `SimpleOrder` class, which derives from and represents a simple order form. The order form contains `OrderItem` objects representing items ordered. The code example also creates a `SimpleOrderChangedEventArgs` class to contain the event information, and an enumeration to identify the type of change. + The code example creates the `SimpleOrder` class, which derives from and represents a simple order form. The order form contains `OrderItem` objects representing items ordered. The code example also creates a `SimpleOrderChangedEventArgs` class to contain the event information, and an enumeration to identify the type of change. The code example demonstrates the custom behavior by calling the properties and methods of the derived class, in the `Main` method of the `Demo` class. - This code example uses objects with immutable keys. For a code example that uses mutable keys, see . + This code example uses objects with immutable keys. For a code example that uses mutable keys, see . :::code language="csharp" source="~/snippets/csharp/System.Collections.ObjectModel/KeyedCollectionTKey,TItem/Overview/source1.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.ObjectModel/KeyedCollectionTKey,TItem/Overview/source1.vb" id="Snippet1"::: @@ -408,11 +408,11 @@ For more information about this API, see Supplemental API remarks for KeyedCollection<TKey,TItem>.ChangeItemKey. method to support mutable keys, and how to override the protected , , , and methods to maintain the integrity of the keys and the collection. +The following code example shows how to override the protected method to support mutable keys, and how to override the protected , , , and methods to maintain the integrity of the keys and the collection. -The code example creates the `MutableKeys` collection, which derives from , and the `MutableKey` class. The `MutableKey` class has a settable `Key` property. When a new key is assigned to the property, the property setter calls the `internal` `ChangeKey` method of the collection to test whether the new key would conflict with an existing key. If so, an exception is thrown and the property value is not changed. +The code example creates the `MutableKeys` collection, which derives from , and the `MutableKey` class. The `MutableKey` class has a settable `Key` property. When a new key is assigned to the property, the property setter calls the `internal` `ChangeKey` method of the collection to test whether the new key would conflict with an existing key. If so, an exception is thrown and the property value is not changed. -In order to maintain the connection between a `MutableKey` object and the `MutableKeys` collection and to prevent an object from being inserted into two collections, the `MutableKey` class has an `internal` `Collection` field. This field is maintained by the protected methods that provide custom behavior for adding and removing items from the collection, such as the method. The field is set when the item is added to a collection and cleared when the item is removed. +In order to maintain the connection between a `MutableKey` object and the `MutableKeys` collection and to prevent an object from being inserted into two collections, the `MutableKey` class has an `internal` `Collection` field. This field is maintained by the protected methods that provide custom behavior for adding and removing items from the collection, such as the method. The field is set when the item is added to a collection and cleared when the item is removed. :::code language="csharp" source="~/snippets/csharp/System.Collections.ObjectModel/KeyedCollectionTKey,TItem/ChangeItemKey/source.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.ObjectModel/KeyedCollectionTKey,TItem/ClearItems/source.vb" id="Snippet1"::: @@ -481,40 +481,40 @@ In order to maintain the connection between a `MutableKey` object and the `Mutab If there is a lookup dictionary, this method clears it but does not delete it. - If the number of elements has exceeded the dictionary creation threshold and the is using a lookup dictionary, it will continue to use a lookup dictionary even though the number of elements is again under the threshold. + If the number of elements has exceeded the dictionary creation threshold and the is using a lookup dictionary, it will continue to use a lookup dictionary even though the number of elements is again under the threshold. - This method is an O(`n`) operation, where `n` is . + This method is an O(`n`) operation, where `n` is . ## Notes for Implementers - Override this method to provide customized behavior for the method, inherited from the generic class. + Override this method to provide customized behavior for the method, inherited from the generic class. Call the base class implementation of this method to clear the underlying collection and to clear the lookup dictionary. ## Examples - This section contains two code examples that demonstrate overriding the method to provide custom behavior for clearing all objects from the collection. The first example adds a custom notification event and the second provides support for a collection of objects with mutable keys. + This section contains two code examples that demonstrate overriding the method to provide custom behavior for clearing all objects from the collection. The first example adds a custom notification event and the second provides support for a collection of objects with mutable keys. Example 1 - The following code example shows how to override the protected , , , and methods, to provide custom behavior for the , , and methods, and for setting the default property (the indexer in C#). The custom behavior provided in this example is a notification event named `Changed`, which is raised at the end of each of the overridden methods. + The following code example shows how to override the protected , , , and methods, to provide custom behavior for the , , and methods, and for setting the default property (the indexer in C#). The custom behavior provided in this example is a notification event named `Changed`, which is raised at the end of each of the overridden methods. - The code example creates the `SimpleOrder` class, which derives from and represents a simple order form. The order form contains `OrderItem` objects representing items ordered. The code example also creates a `SimpleOrderChangedEventArgs` class to contain the event information, and an enumeration to identify the type of change. + The code example creates the `SimpleOrder` class, which derives from and represents a simple order form. The order form contains `OrderItem` objects representing items ordered. The code example also creates a `SimpleOrderChangedEventArgs` class to contain the event information, and an enumeration to identify the type of change. The code example demonstrates the custom behavior by calling the properties and methods of the derived class, in the `Main` method of the `Demo` class. - This code example uses objects with immutable keys. For a code example that uses mutable keys, see . + This code example uses objects with immutable keys. For a code example that uses mutable keys, see . :::code language="csharp" source="~/snippets/csharp/System.Collections.ObjectModel/KeyedCollectionTKey,TItem/Overview/source1.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.ObjectModel/KeyedCollectionTKey,TItem/Overview/source1.vb" id="Snippet1"::: Example 2 - The following code example shows how to override the protected method to support mutable keys, and how to override the protected , , , and methods to maintain the integrity of the keys and the collection. + The following code example shows how to override the protected method to support mutable keys, and how to override the protected , , , and methods to maintain the integrity of the keys and the collection. - The code example creates the `MutableKeys` collection, which derives from , and the `MutableKey` class. The `MutableKey` class has a settable `Key` property. When a new key is assigned to the property, the property setter calls the `internal` (`Friend` in Visual Basic) `ChangeKey` method of the collection to test whether the new key would conflict with an existing key. If so, an exception is thrown and the property value is not changed. + The code example creates the `MutableKeys` collection, which derives from , and the `MutableKey` class. The `MutableKey` class has a settable `Key` property. When a new key is assigned to the property, the property setter calls the `internal` (`Friend` in Visual Basic) `ChangeKey` method of the collection to test whether the new key would conflict with an existing key. If so, an exception is thrown and the property value is not changed. - In order to maintain the connection between a `MutableKey` object and the `MutableKeys` collection and to prevent an object from being inserted into two collections, the `MutableKey` class has an `internal` (`Friend` in Visual Basic) `Collection` field. This field is maintained by the protected methods that provide custom behavior for adding and removing items from the collection, such as the method. The field is set when the item is added to a collection and cleared when the item is removed. + In order to maintain the connection between a `MutableKey` object and the `MutableKeys` collection and to prevent an object from being inserted into two collections, the `MutableKey` class has an `internal` (`Friend` in Visual Basic) `Collection` field. This field is maintained by the protected methods that provide custom behavior for adding and removing items from the collection, such as the method. The field is set when the item is added to a collection and cleared when the item is removed. :::code language="csharp" source="~/snippets/csharp/System.Collections.ObjectModel/KeyedCollectionTKey,TItem/ChangeItemKey/source.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.ObjectModel/KeyedCollectionTKey,TItem/ClearItems/source.vb" id="Snippet1"::: @@ -624,16 +624,16 @@ In order to maintain the connection between a `MutableKey` object and the `Mutab has a lookup dictionary, `key` is used to search the dictionary. If there is no lookup dictionary, the key of each element is extracted using the method and compared with the specified key. + If the has a lookup dictionary, `key` is used to search the dictionary. If there is no lookup dictionary, the key of each element is extracted using the method and compared with the specified key. - This method is an O(1) operation if the has a lookup dictionary; otherwise it is an O(`n`) operation, where `n` is . + This method is an O(1) operation if the has a lookup dictionary; otherwise it is an O(`n`) operation, where `n` is . ## Examples - This code example shows the minimum code necessary to derive a collection class from : overriding the method and providing a public constructor that delegates to a base class constructor. The code example also demonstrates many of the properties and methods inherited from and classes. + This code example shows the minimum code necessary to derive a collection class from : overriding the method and providing a public constructor that delegates to a base class constructor. The code example also demonstrates many of the properties and methods inherited from and classes. - The `SimpleOrder` class is a very simple requisition list that contains `OrderItem` objects, each of which represents a line item in the order. The key of `OrderItem` is immutable, an important consideration for classes that derive from . For a code example that uses mutable keys, see . + The `SimpleOrder` class is a very simple requisition list that contains `OrderItem` objects, each of which represents a line item in the order. The key of `OrderItem` is immutable, an important consideration for classes that derive from . For a code example that uses mutable keys, see . :::code language="csharp" source="~/snippets/csharp/System.Collections.ObjectModel/KeyedCollectionTKey,TItem/Overview/source.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.ObjectModel/KeyedCollectionTKey,TItem/Overview/source.vb" id="Snippet1"::: @@ -696,18 +696,18 @@ In order to maintain the connection between a `MutableKey` object and the `Mutab includes a lookup dictionary that is created when the first item is added. When an item is added to the , the item's key is extracted once and saved in the lookup dictionary for faster searches. This behavior can be overridden by using the constructor and specifying a dictionary creation threshold. + By default, the includes a lookup dictionary that is created when the first item is added. When an item is added to the , the item's key is extracted once and saved in the lookup dictionary for faster searches. This behavior can be overridden by using the constructor and specifying a dictionary creation threshold. Retrieving the value of this property is an O(1) operation. ## Examples - The following code example shows how to override the protected method to support mutable keys, and how to override the protected , , , and methods to maintain the integrity of the keys and the collection. + The following code example shows how to override the protected method to support mutable keys, and how to override the protected , , , and methods to maintain the integrity of the keys and the collection. - The code example creates the `MutableKeys` collection, which derives from , and the `MutableKey` class. The `MutableKey` class has a settable `Key` property. When a new key is assigned to the property, the property setter calls the `internal` (`Friend` in Visual Basic) `ChangeKey` method of the collection to test whether the new key would conflict with an existing key. If so, an exception is thrown and the property value is not changed. + The code example creates the `MutableKeys` collection, which derives from , and the `MutableKey` class. The `MutableKey` class has a settable `Key` property. When a new key is assigned to the property, the property setter calls the `internal` (`Friend` in Visual Basic) `ChangeKey` method of the collection to test whether the new key would conflict with an existing key. If so, an exception is thrown and the property value is not changed. - In order to maintain the connection between a `MutableKey` object and the `MutableKeys` collection and to prevent an object from being inserted into two collections, the `MutableKey` class has an `internal` (`Friend` in Visual Basic) `Collection` field. This field is maintained by the protected methods that provide custom behavior for adding and removing items from the collection, such as the method. The field is set when the item is added to a collection and cleared when the item is removed. + In order to maintain the connection between a `MutableKey` object and the `MutableKeys` collection and to prevent an object from being inserted into two collections, the `MutableKey` class has an `internal` (`Friend` in Visual Basic) `Collection` field. This field is maintained by the protected methods that provide custom behavior for adding and removing items from the collection, such as the method. The field is set when the item is added to a collection and cleared when the item is removed. :::code language="csharp" source="~/snippets/csharp/System.Collections.ObjectModel/KeyedCollectionTKey,TItem/ChangeItemKey/source.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.ObjectModel/KeyedCollectionTKey,TItem/ClearItems/source.vb" id="Snippet1"::: @@ -766,7 +766,7 @@ In order to maintain the connection between a `MutableKey` object and the `Mutab ## Remarks - If the key in the lookup dictionary is different from the key that is embedded in `item`, you cannot access `item` by using the key returned by . + If the key in the lookup dictionary is different from the key that is embedded in `item`, you cannot access `item` by using the key returned by . You can implement this method to return `null` for a collection that contains items without keys, in which case the items can be accessed only by their index. This method is an O(1) operation. @@ -778,9 +778,9 @@ In order to maintain the connection between a `MutableKey` object and the `Mutab ## Examples - This code example shows the minimum code necessary to derive a collection class from : overriding the method and providing a public constructor that delegates to a base class constructor. The code example also demonstrates many of the properties and methods inherited from and classes. + This code example shows the minimum code necessary to derive a collection class from : overriding the method and providing a public constructor that delegates to a base class constructor. The code example also demonstrates many of the properties and methods inherited from and classes. - The `SimpleOrder` class is a very simple requisition list that contains `OrderItem` objects, each of which represents a line item in the order. The key of `OrderItem` is immutable, an important consideration for classes that derive from . For a code example that uses mutable keys, see . + The `SimpleOrder` class is a very simple requisition list that contains `OrderItem` objects, each of which represents a line item in the order. The key of `OrderItem` is immutable, an important consideration for classes that derive from . For a code example that uses mutable keys, see . :::code language="csharp" source="~/snippets/csharp/System.Collections.ObjectModel/KeyedCollectionTKey,TItem/Overview/source.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.ObjectModel/KeyedCollectionTKey,TItem/Overview/source.vb" id="Snippet1"::: @@ -841,42 +841,42 @@ In order to maintain the connection between a `MutableKey` object and the `Mutab ## Remarks - If `index` is equal to , `item` is added to the end of the . + If `index` is equal to , `item` is added to the end of the . - This method is an O(`n`) operation, where `n` is . + This method is an O(`n`) operation, where `n` is . - is called by the and methods. + is called by the and methods. ## Notes for Implementers - Override this method to provide customized behavior for the and methods, inherited from the generic class. + Override this method to provide customized behavior for the and methods, inherited from the generic class. Call the base class implementation of this method to insert the item into the underlying collection and to update the lookup dictionary. ## Examples - This section contains two code examples that demonstrate overriding the method to provide custom behavior for adding or inserting objects into the collection. The first example adds a custom notification event and the second provides support for a collection of objects with mutable keys. + This section contains two code examples that demonstrate overriding the method to provide custom behavior for adding or inserting objects into the collection. The first example adds a custom notification event and the second provides support for a collection of objects with mutable keys. Example 1 - The following code example shows how to override the protected , , , and methods, to provide custom behavior for the , , and methods, and for setting the default property (the indexer in C#). The custom behavior provided in this example is a notification event named `Changed`, which is raised at the end of each of the overridden methods. + The following code example shows how to override the protected , , , and methods, to provide custom behavior for the , , and methods, and for setting the default property (the indexer in C#). The custom behavior provided in this example is a notification event named `Changed`, which is raised at the end of each of the overridden methods. - The code example creates the `SimpleOrder` class, which derives from and represents a simple order form. The order form contains `OrderItem` objects representing items ordered. The code example also creates a `SimpleOrderChangedEventArgs` class to contain the event information, and an enumeration to identify the type of change. + The code example creates the `SimpleOrder` class, which derives from and represents a simple order form. The order form contains `OrderItem` objects representing items ordered. The code example also creates a `SimpleOrderChangedEventArgs` class to contain the event information, and an enumeration to identify the type of change. The code example demonstrates the custom behavior by calling the properties and methods of the derived class, in the `Main` method of the `Demo` class. - This code example uses objects with immutable keys. For a code example that uses mutable keys, see . + This code example uses objects with immutable keys. For a code example that uses mutable keys, see . :::code language="csharp" source="~/snippets/csharp/System.Collections.ObjectModel/KeyedCollectionTKey,TItem/Overview/source1.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.ObjectModel/KeyedCollectionTKey,TItem/Overview/source1.vb" id="Snippet1"::: Example 2 - The following code example shows how to override the protected method to support mutable keys, and how to override the protected , , , and methods to maintain the integrity of the keys and the collection. + The following code example shows how to override the protected method to support mutable keys, and how to override the protected , , , and methods to maintain the integrity of the keys and the collection. - The code example creates the `MutableKeys` collection, which derives from , and the `MutableKey` class. The `MutableKey` class has a settable `Key` property. When a new key is assigned to the property, the property setter calls the `internal` (`Friend` in Visual Basic) `ChangeKey` method of the collection to test whether the new key would conflict with an existing key. If so, an exception is thrown and the property value is not changed. + The code example creates the `MutableKeys` collection, which derives from , and the `MutableKey` class. The `MutableKey` class has a settable `Key` property. When a new key is assigned to the property, the property setter calls the `internal` (`Friend` in Visual Basic) `ChangeKey` method of the collection to test whether the new key would conflict with an existing key. If so, an exception is thrown and the property value is not changed. - In order to maintain the connection between a `MutableKey` object and the `MutableKeys` collection and to prevent an object from being inserted into two collections, the `MutableKey` class has an `internal` (`Friend` in Visual Basic) `Collection` field. This field is maintained by the protected methods that provide custom behavior for adding and removing items from the collection, such as the method. The field is set when the item is added to a collection and cleared when the item is removed. + In order to maintain the connection between a `MutableKey` object and the `MutableKeys` collection and to prevent an object from being inserted into two collections, the `MutableKey` class has an `internal` (`Friend` in Visual Basic) `Collection` field. This field is maintained by the protected methods that provide custom behavior for adding and removing items from the collection, such as the method. The field is set when the item is added to a collection and cleared when the item is removed. :::code language="csharp" source="~/snippets/csharp/System.Collections.ObjectModel/KeyedCollectionTKey,TItem/ChangeItemKey/source.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.ObjectModel/KeyedCollectionTKey,TItem/ClearItems/source.vb" id="Snippet1"::: @@ -943,20 +943,20 @@ In order to maintain the connection between a `MutableKey` object and the `Mutab This property provides the ability to access a specific element in the collection by using the following syntax: `myCollection[key]` (`myCollection(key)` in Visual Basic). > [!NOTE] -> This property is distinct from the inherited property, which gets and sets elements by numeric index. However, if `TKey` is of type , this property masks the inherited property. In that case, you can access the inherited property by casting the to its base type. For example, `KeyedCollection` (`KeyedCollection(Of Integer, MyType)` in Visual Basic) can be cast to `Collection` (`Collection(Of MyType)` in Visual Basic). +> This property is distinct from the inherited property, which gets and sets elements by numeric index. However, if `TKey` is of type , this property masks the inherited property. In that case, you can access the inherited property by casting the to its base type. For example, `KeyedCollection` (`KeyedCollection(Of Integer, MyType)` in Visual Basic) can be cast to `Collection` (`Collection(Of MyType)` in Visual Basic). - If the has a lookup dictionary, `key` is used to retrieve the element from the dictionary. If there is no lookup dictionary, the key of each element is extracted using the method and compared with the specified key. + If the has a lookup dictionary, `key` is used to retrieve the element from the dictionary. If there is no lookup dictionary, the key of each element is extracted using the method and compared with the specified key. - The C# language uses the [this](/dotnet/csharp/language-reference/keywords/this) keyword to define the indexers instead of implementing the property. Visual Basic implements as a [default property](/dotnet/visual-basic/language-reference/modifiers/default), which provides the same indexing functionality. + The C# language uses the [this](/dotnet/csharp/language-reference/keywords/this) keyword to define the indexers instead of implementing the property. Visual Basic implements as a [default property](/dotnet/visual-basic/language-reference/modifiers/default), which provides the same indexing functionality. - Retrieving the value of this property is an O(1) operation if the has a lookup dictionary; otherwise it is an O(`n`) operation, where `n` is . + Retrieving the value of this property is an O(1) operation if the has a lookup dictionary; otherwise it is an O(`n`) operation, where `n` is . ## Examples - This code example shows the minimum code necessary to derive a collection class from : overriding the method and providing a public constructor that delegates to a base class constructor. The code example also demonstrates many of the properties and methods inherited from and classes. + This code example shows the minimum code necessary to derive a collection class from : overriding the method and providing a public constructor that delegates to a base class constructor. The code example also demonstrates many of the properties and methods inherited from and classes. - The code example calls both the property, which is read-only and retrieves by key, and the property, which is settable and retrieves by index. It shows how to access the latter property when the objects in the derived collection have integer keys, indistinguishable from the integers used for indexed retrieval. + The code example calls both the property, which is read-only and retrieves by key, and the property, which is settable and retrieves by index. It shows how to access the latter property when the objects in the derived collection have integer keys, indistinguishable from the integers used for indexed retrieval. - The `SimpleOrder` class is a very simple requisition list that contains `OrderItem` objects, each of which represents a line item in the order. The key of `OrderItem` is immutable, an important consideration for classes that derive from . For a code example that uses mutable keys, see . + The `SimpleOrder` class is a very simple requisition list that contains `OrderItem` objects, each of which represents a line item in the order. The key of `OrderItem` is immutable, an important consideration for classes that derive from . For a code example that uses mutable keys, see . :::code language="csharp" source="~/snippets/csharp/System.Collections.ObjectModel/KeyedCollectionTKey,TItem/Overview/source.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.ObjectModel/KeyedCollectionTKey,TItem/Overview/source.vb" id="Snippet1"::: @@ -1020,21 +1020,21 @@ In order to maintain the connection between a `MutableKey` object and the `Mutab ## Remarks The key of the element is also removed from the lookup dictionary. - If the number of elements has exceeded the dictionary creation threshold and the is using a lookup dictionary, it will continue to use a lookup dictionary even though the number of elements is again under the threshold. + If the number of elements has exceeded the dictionary creation threshold and the is using a lookup dictionary, it will continue to use a lookup dictionary even though the number of elements is again under the threshold. > [!NOTE] -> To customize the behavior of this method, override the method. +> To customize the behavior of this method, override the method. - This method is an O(`n`) operation, where `n` is . + This method is an O(`n`) operation, where `n` is . ## Examples - This code example shows the minimum code necessary to derive a collection class from : overriding the method and providing a public constructor that delegates to a base class constructor. The code example also demonstrates many of the properties and methods inherited from and classes. + This code example shows the minimum code necessary to derive a collection class from : overriding the method and providing a public constructor that delegates to a base class constructor. The code example also demonstrates many of the properties and methods inherited from and classes. - The example demonstrates method inherited from , which removes the item with a specified key, and also the and methods inherited from , which remove by object and by index respectively. + The example demonstrates method inherited from , which removes the item with a specified key, and also the and methods inherited from , which remove by object and by index respectively. - The `SimpleOrder` class is a very simple requisition list that contains `OrderItem` objects, each of which represents a line item in the order. The key of `OrderItem` is immutable, an important consideration for classes that derive from . For a code example that uses mutable keys, see . + The `SimpleOrder` class is a very simple requisition list that contains `OrderItem` objects, each of which represents a line item in the order. The key of `OrderItem` is immutable, an important consideration for classes that derive from . For a code example that uses mutable keys, see . :::code language="csharp" source="~/snippets/csharp/System.Collections.ObjectModel/KeyedCollectionTKey,TItem/Overview/source.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.ObjectModel/KeyedCollectionTKey,TItem/Overview/source.vb" id="Snippet1"::: @@ -1097,40 +1097,40 @@ In order to maintain the connection between a `MutableKey` object and the `Mutab The key of the element is also removed from the lookup dictionary. - If the number of elements has exceeded the dictionary creation threshold and the is using a lookup dictionary, it will continue to use a lookup dictionary even though the number of elements is again under the threshold. + If the number of elements has exceeded the dictionary creation threshold and the is using a lookup dictionary, it will continue to use a lookup dictionary even though the number of elements is again under the threshold. - This method is an O(`n`) operation, where `n` is . + This method is an O(`n`) operation, where `n` is . ## Notes for Implementers - Override this method to provide customized behavior for the and methods, inherited from the generic class, and the method. + Override this method to provide customized behavior for the and methods, inherited from the generic class, and the method. Call the base class implementation of this method to remove the item from the underlying collection and to update the lookup dictionary. ## Examples - This section contains two code examples that demonstrate overriding the method to provide custom behavior for removing objects from the collection. The first example adds a custom notification event and the second provides support for a collection of objects with mutable keys. + This section contains two code examples that demonstrate overriding the method to provide custom behavior for removing objects from the collection. The first example adds a custom notification event and the second provides support for a collection of objects with mutable keys. Example 1 - The following code example shows how to override the protected , , , and methods, to provide custom behavior for the , , and methods, and for setting the default property (the indexer in C#). The custom behavior provided in this example is a notification event named `Changed`, which is raised at the end of each of the overridden methods. + The following code example shows how to override the protected , , , and methods, to provide custom behavior for the , , and methods, and for setting the default property (the indexer in C#). The custom behavior provided in this example is a notification event named `Changed`, which is raised at the end of each of the overridden methods. - The code example creates the `SimpleOrder` class, which derives from and represents a simple order form. The order form contains `OrderItem` objects representing items ordered. The code example also creates a `SimpleOrderChangedEventArgs` class to contain the event information, and an enumeration to identify the type of change. + The code example creates the `SimpleOrder` class, which derives from and represents a simple order form. The order form contains `OrderItem` objects representing items ordered. The code example also creates a `SimpleOrderChangedEventArgs` class to contain the event information, and an enumeration to identify the type of change. The code example demonstrates the custom behavior by calling the properties and methods of the derived class, in the `Main` method of the `Demo` class. - This code example uses objects with immutable keys. For a code example that uses mutable keys, see . + This code example uses objects with immutable keys. For a code example that uses mutable keys, see . :::code language="csharp" source="~/snippets/csharp/System.Collections.ObjectModel/KeyedCollectionTKey,TItem/Overview/source1.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.ObjectModel/KeyedCollectionTKey,TItem/Overview/source1.vb" id="Snippet1"::: Example 2 - The following code example shows how to override the protected method to support mutable keys, and how to override the protected , , , and methods to maintain the integrity of the keys and the collection. + The following code example shows how to override the protected method to support mutable keys, and how to override the protected , , , and methods to maintain the integrity of the keys and the collection. - The code example creates the `MutableKeys` collection, which derives from , and the `MutableKey` class. The `MutableKey` class has a settable `Key` property. When a new key is assigned to the property, the property setter calls the `internal` (`Friend` in Visual Basic) `ChangeKey` method of the collection to test whether the new key would conflict with an existing key. If so, an exception is thrown and the property value is not changed. + The code example creates the `MutableKeys` collection, which derives from , and the `MutableKey` class. The `MutableKey` class has a settable `Key` property. When a new key is assigned to the property, the property setter calls the `internal` (`Friend` in Visual Basic) `ChangeKey` method of the collection to test whether the new key would conflict with an existing key. If so, an exception is thrown and the property value is not changed. - In order to maintain the connection between a `MutableKey` object and the `MutableKeys` collection and to prevent an object from being inserted into two collections, the `MutableKey` class has an `internal` (`Friend` in Visual Basic) `Collection` field. This field is maintained by the protected methods that provide custom behavior for adding and removing items from the collection, such as the method. The field is set when the item is added to a collection and cleared when the item is removed. + In order to maintain the connection between a `MutableKey` object and the `MutableKeys` collection and to prevent an object from being inserted into two collections, the `MutableKey` class has an `internal` (`Friend` in Visual Basic) `Collection` field. This field is maintained by the protected methods that provide custom behavior for adding and removing items from the collection, such as the method. The field is set when the item is added to a collection and cleared when the item is removed. :::code language="csharp" source="~/snippets/csharp/System.Collections.ObjectModel/KeyedCollectionTKey,TItem/ChangeItemKey/source.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.ObjectModel/KeyedCollectionTKey,TItem/ClearItems/source.vb" id="Snippet1"::: @@ -1197,37 +1197,37 @@ In order to maintain the connection between a `MutableKey` object and the `Mutab ## Notes for Implementers - Override this method to provide customized behavior for setting the property inherited from the generic class. + Override this method to provide customized behavior for setting the property inherited from the generic class. > [!NOTE] -> This method does not affect the behavior of the property, which is read-only. +> This method does not affect the behavior of the property, which is read-only. Call the base class implementation of this method to set the item in the underlying collection and to update the lookup dictionary. ## Examples - This section contains two code examples that demonstrate overriding the method to provide custom behavior for setting the property. The first example adds a custom notification event and the second provides support for a collection of objects with mutable keys. + This section contains two code examples that demonstrate overriding the method to provide custom behavior for setting the property. The first example adds a custom notification event and the second provides support for a collection of objects with mutable keys. Example 1 - The following code example shows how to override the protected , , , and methods, to provide custom behavior for the , , and methods, and for setting the default property (the indexer in C#). The custom behavior provided in this example is a notification event named `Changed`, which is raised at the end of each of the overridden methods. + The following code example shows how to override the protected , , , and methods, to provide custom behavior for the , , and methods, and for setting the default property (the indexer in C#). The custom behavior provided in this example is a notification event named `Changed`, which is raised at the end of each of the overridden methods. - The code example creates the `SimpleOrder` class, which derives from and represents a simple order form. The order form contains `OrderItem` objects representing items ordered. The code example also creates a `SimpleOrderChangedEventArgs` class to contain the event information, and an enumeration to identify the type of change. + The code example creates the `SimpleOrder` class, which derives from and represents a simple order form. The order form contains `OrderItem` objects representing items ordered. The code example also creates a `SimpleOrderChangedEventArgs` class to contain the event information, and an enumeration to identify the type of change. The code example demonstrates the custom behavior by calling the properties and methods of the derived class, in the `Main` method of the `Demo` class. - This code example uses objects with immutable keys. For a code example that uses mutable keys, see . + This code example uses objects with immutable keys. For a code example that uses mutable keys, see . :::code language="csharp" source="~/snippets/csharp/System.Collections.ObjectModel/KeyedCollectionTKey,TItem/Overview/source1.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.ObjectModel/KeyedCollectionTKey,TItem/Overview/source1.vb" id="Snippet1"::: Example 2 - The following code example shows how to override the protected method to support mutable keys, and how to override the protected , , , and methods to maintain the integrity of the keys and the collection. + The following code example shows how to override the protected method to support mutable keys, and how to override the protected , , , and methods to maintain the integrity of the keys and the collection. - The code example creates the `MutableKeys` collection, which derives from , and the `MutableKey` class. The `MutableKey` class has a settable `Key` property. When a new key is assigned to the property, the property setter calls the `internal` (`Friend` in Visual Basic) `ChangeKey` method of the collection to test whether the new key would conflict with an existing key. If so, an exception is thrown and the property value is not changed. + The code example creates the `MutableKeys` collection, which derives from , and the `MutableKey` class. The `MutableKey` class has a settable `Key` property. When a new key is assigned to the property, the property setter calls the `internal` (`Friend` in Visual Basic) `ChangeKey` method of the collection to test whether the new key would conflict with an existing key. If so, an exception is thrown and the property value is not changed. - In order to maintain the connection between a `MutableKey` object and the `MutableKeys` collection and to prevent an object from being inserted into two collections, the `MutableKey` class has an `internal` (`Friend` in Visual Basic) `Collection` field. This field is maintained by the protected methods that provide custom behavior for adding and removing items from the collection, such as the method. The field is set when the item is added to a collection and cleared when the item is removed. + In order to maintain the connection between a `MutableKey` object and the `MutableKeys` collection and to prevent an object from being inserted into two collections, the `MutableKey` class has an `internal` (`Friend` in Visual Basic) `Collection` field. This field is maintained by the protected methods that provide custom behavior for adding and removing items from the collection, such as the method. The field is set when the item is added to a collection and cleared when the item is removed. :::code language="csharp" source="~/snippets/csharp/System.Collections.ObjectModel/KeyedCollectionTKey,TItem/ChangeItemKey/source.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.ObjectModel/KeyedCollectionTKey,TItem/ClearItems/source.vb" id="Snippet1"::: diff --git a/xml/System.Collections.ObjectModel/ObservableCollection`1.xml b/xml/System.Collections.ObjectModel/ObservableCollection`1.xml index a33ded038a7..ebacf664fab 100644 --- a/xml/System.Collections.ObjectModel/ObservableCollection`1.xml +++ b/xml/System.Collections.ObjectModel/ObservableCollection`1.xml @@ -204,7 +204,7 @@ in the same order they are read by the enumerator of the collection. + The elements are copied onto the in the same order they are read by the enumerator of the collection. ]]> @@ -259,7 +259,7 @@ in the same order they are read by the enumerator of the list. + The elements are copied onto the in the same order they are read by the enumerator of the list. ]]> @@ -317,7 +317,7 @@ call within a `using` scope, as in the following example: + The typical usage is to wrap an call within a `using` scope, as in the following example: :::code language="csharp" source="~/snippets/csharp/System.Collections.ObjectModel/ObservableCollectionT/BlockReentrancy/DataSource.cs" id="Snippetblockreentrancy"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.ObjectModel/ObservableCollectionT/BlockReentrancy/datasource.vb" id="Snippetblockreentrancy"::: @@ -430,7 +430,7 @@ ## Remarks The base class calls this method when the list is being cleared. This implementation raises the event. - For more information, see the method of the base class. + For more information, see the method of the base class. ]]> @@ -548,7 +548,7 @@ ## Remarks The base class calls this method when an item is added to the collection. This implementation raises the event. - For more information, see the method of the base class. + For more information, see the method of the base class. ]]> @@ -615,7 +615,7 @@ method to provide custom behavior for this method. + Subclasses can override the method to provide custom behavior for this method. ]]> @@ -678,7 +678,7 @@ ## Remarks This implementation raises the event. - Subclasses can override this protected method to provide custom behavior for the method. + Subclasses can override this protected method to provide custom behavior for the method. ]]> @@ -737,12 +737,12 @@ event through this `virtual` method. + Properties and methods that modify this collection raise the event through this `virtual` method. ## Examples - When overriding this method, either call the base implementation or use the method to handle reentrant collection changes, as in the following example: + When overriding this method, either call the base implementation or use the method to handle reentrant collection changes, as in the following example: :::code language="csharp" source="~/snippets/csharp/System.Collections.ObjectModel/ObservableCollectionT/BlockReentrancy/DataSource.cs" id="Snippetblockreentrancy"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.ObjectModel/ObservableCollectionT/BlockReentrancy/datasource.vb" id="Snippetblockreentrancy"::: @@ -912,7 +912,7 @@ ## Remarks The base class calls this method when an item is removed from the collection. This implementation raises the event. - For more information, see the method of the base class. + For more information, see the method of the base class. ]]> @@ -975,7 +975,7 @@ ## Remarks The base class calls this method when an item is set in the collection. This implementation raises the event. - For more information, see the method of the base class. + For more information, see the method of the base class. ]]> diff --git a/xml/System.Collections.ObjectModel/ReadOnlyCollection`1.xml b/xml/System.Collections.ObjectModel/ReadOnlyCollection`1.xml index 1b6a2ba432f..02dbc6f32d3 100644 --- a/xml/System.Collections.ObjectModel/ReadOnlyCollection`1.xml +++ b/xml/System.Collections.ObjectModel/ReadOnlyCollection`1.xml @@ -124,16 +124,16 @@ generic class is always read-only. A collection that is read-only is simply a collection with a wrapper that prevents modifying the collection; therefore, if changes are made to the underlying collection, the read-only collection reflects those changes. See for a modifiable version of this class. + An instance of the generic class is always read-only. A collection that is read-only is simply a collection with a wrapper that prevents modifying the collection; therefore, if changes are made to the underlying collection, the read-only collection reflects those changes. See for a modifiable version of this class. ## Examples - The following code example demonstrates several members of the class. The code example creates a of strings and adds four dinosaur names to it. The code example then wraps the list in a . + The following code example demonstrates several members of the class. The code example creates a of strings and adds four dinosaur names to it. The code example then wraps the list in a . - After demonstrating the , , , and members, the code example shows that the is just a wrapper for the original by adding a new item to the and displaying the contents of the . + After demonstrating the , , , and members, the code example shows that the is just a wrapper for the original by adding a new item to the and displaying the contents of the . - Finally, the code example creates an array larger than the collection and uses the method to insert the elements of the collection into the middle of the array. + Finally, the code example creates an array larger than the collection and uses the method to insert the elements of the collection into the middle of the array. :::code language="csharp" source="~/snippets/csharp/System.Collections.ObjectModel/ReadOnlyCollectionT/Overview/source.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.ObjectModel/ReadOnlyCollectionT/Overview/source.vb" id="Snippet1"::: @@ -204,13 +204,13 @@ ## Examples - The following code example demonstrates this constructor and several members of the class. + The following code example demonstrates this constructor and several members of the class. - The code example creates a of strings and adds four dinosaur names to it. The code example then wraps the list in a by passing it to the constructor. + The code example creates a of strings and adds four dinosaur names to it. The code example then wraps the list in a by passing it to the constructor. - After demonstrating the , , , and members, the code example shows that the is just a wrapper for the original by adding a new item to the and displaying the contents of the . + After demonstrating the , , , and members, the code example shows that the is just a wrapper for the original by adding a new item to the and displaying the contents of the . - Finally, the code example creates an array larger than the collection and uses the method to insert the elements of the collection into the middle of the array. + Finally, the code example creates an array larger than the collection and uses the method to insert the elements of the collection into the middle of the array. :::code language="csharp" source="~/snippets/csharp/System.Collections.ObjectModel/ReadOnlyCollectionT/Overview/source.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.ObjectModel/ReadOnlyCollectionT/Overview/source.vb" id="Snippet1"::: @@ -282,18 +282,18 @@ . + This method determines equality using the default equality comparer . - This method performs a linear search; therefore, this method is an O(`n`) operation, where `n` is . + This method performs a linear search; therefore, this method is an O(`n`) operation, where `n` is . ## Examples - The following code example demonstrates several members of the class. The code example creates a of strings and adds four dinosaur names to it. The code example then wraps the list in a . + The following code example demonstrates several members of the class. The code example creates a of strings and adds four dinosaur names to it. The code example then wraps the list in a . - After demonstrating the , , , and members, the code example shows that the is just a wrapper for the original by adding a new item to the and displaying the contents of the . + After demonstrating the , , , and members, the code example shows that the is just a wrapper for the original by adding a new item to the and displaying the contents of the . - Finally, the code example creates an array larger than the collection and uses the method to insert the elements of the collection into the middle of the array. + Finally, the code example creates an array larger than the collection and uses the method to insert the elements of the collection into the middle of the array. :::code language="csharp" source="~/snippets/csharp/System.Collections.ObjectModel/ReadOnlyCollectionT/Overview/source.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.ObjectModel/ReadOnlyCollectionT/Overview/source.vb" id="Snippet1"::: @@ -358,20 +358,20 @@ to copy the elements. + This method uses to copy the elements. - The elements are copied to the in the same order that the enumerator iterates through the . + The elements are copied to the in the same order that the enumerator iterates through the . - This method is an O(`n`) operation, where `n` is . + This method is an O(`n`) operation, where `n` is . ## Examples - The following code example demonstrates several members of the class. The code example creates a of strings and adds four dinosaur names to it. The code example then wraps the list in a . + The following code example demonstrates several members of the class. The code example creates a of strings and adds four dinosaur names to it. The code example then wraps the list in a . - After demonstrating the , , , and members, the code example shows that the is just a wrapper for the original by adding a new item to the and displaying the contents of the . + After demonstrating the , , , and members, the code example shows that the is just a wrapper for the original by adding a new item to the and displaying the contents of the . - Finally, the code example creates an array larger than the collection and uses the method to insert the elements of the collection into the middle of the array. + Finally, the code example creates an array larger than the collection and uses the method to insert the elements of the collection into the middle of the array. :::code language="csharp" source="~/snippets/csharp/System.Collections.ObjectModel/ReadOnlyCollectionT/Overview/source.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.ObjectModel/ReadOnlyCollectionT/Overview/source.vb" id="Snippet1"::: @@ -447,11 +447,11 @@ ## Examples - The following code example demonstrates several members of the class. The code example creates a of strings and adds four dinosaur names to it. The code example then wraps the list in a . + The following code example demonstrates several members of the class. The code example creates a of strings and adds four dinosaur names to it. The code example then wraps the list in a . - After demonstrating the , , , and members, the code example shows that the is just a wrapper for the original by adding a new item to the and displaying the contents of the . + After demonstrating the , , , and members, the code example shows that the is just a wrapper for the original by adding a new item to the and displaying the contents of the . - Finally, the code example creates an array larger than the collection and uses the method to insert the elements of the collection into the middle of the array. + Finally, the code example creates an array larger than the collection and uses the method to insert the elements of the collection into the middle of the array. :::code language="csharp" source="~/snippets/csharp/System.Collections.ObjectModel/ReadOnlyCollectionT/Overview/source.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.ObjectModel/ReadOnlyCollectionT/Overview/source.vb" id="Snippet1"::: @@ -550,11 +550,11 @@ Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection. - Initially, the enumerator is positioned before the first element in the collection. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . - returns the same object until is called. sets to the next element. + returns the same object until is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator instance instead. + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator instance instead. An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and its behavior is undefined. @@ -565,7 +565,7 @@ This method is an O(1) operation. ## Examples - The following code example uses the enumerator to display the contents of a that wraps a . The enumerator is concealed by the `foreach` statement (`For Each` in Visual Basic). + The following code example uses the enumerator to display the contents of a that wraps a . The enumerator is concealed by the `foreach` statement (`For Each` in Visual Basic). :::code language="csharp" source="~/snippets/csharp/System.Collections.ObjectModel/ReadOnlyCollectionT/Overview/source.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.ObjectModel/ReadOnlyCollectionT/Overview/source.vb" id="Snippet1"::: @@ -628,11 +628,11 @@ is searched forward starting at the first element and ending at the last element. + The is searched forward starting at the first element and ending at the last element. - This method determines equality using the default comparer . + This method determines equality using the default comparer . - This method performs a linear search; therefore, this method is an O(`n`) operation, where `n` is . + This method performs a linear search; therefore, this method is an O(`n`) operation, where `n` is . ]]> @@ -701,18 +701,18 @@ ## Remarks This property provides the ability to access a specific element in the collection by using the following C# syntax: `myCollection[index]` (`myCollection(index)` in Visual Basic). - The C# language uses the [this](/dotnet/csharp/language-reference/keywords/this) keyword to define the indexers instead of implementing the property. Visual Basic implements as a default property, which provides the same indexing functionality. + The C# language uses the [this](/dotnet/csharp/language-reference/keywords/this) keyword to define the indexers instead of implementing the property. Visual Basic implements as a default property, which provides the same indexing functionality. Retrieving the value of this property is an O(1) operation. ## Examples - The following code example demonstrates several members of the class. The code example creates a of strings and adds four dinosaur names to it. The code example then wraps the list in a . + The following code example demonstrates several members of the class. The code example creates a of strings and adds four dinosaur names to it. The code example then wraps the list in a . - After demonstrating the , , , and members, the code example shows that the is just a wrapper for the original by adding a new item to the and displaying the contents of the . + After demonstrating the , , , and members, the code example shows that the is just a wrapper for the original by adding a new item to the and displaying the contents of the . - Finally, the code example creates an array larger than the collection and uses the method to insert the elements of the collection into the middle of the array. + Finally, the code example creates an array larger than the collection and uses the method to insert the elements of the collection into the middle of the array. :::code language="csharp" source="~/snippets/csharp/System.Collections.ObjectModel/ReadOnlyCollectionT/Overview/source.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.ObjectModel/ReadOnlyCollectionT/Overview/source.vb" id="Snippet1"::: @@ -779,11 +779,11 @@ ## Examples - The following code example demonstrates several members of the class. The code example creates a of strings and adds four dinosaur names to it. The code example then wraps the list in a . + The following code example demonstrates several members of the class. The code example creates a of strings and adds four dinosaur names to it. The code example then wraps the list in a . - After demonstrating the , , , and members, the code example shows that the is just a wrapper for the original by adding a new item to the and displaying the contents of the . + After demonstrating the , , , and members, the code example shows that the is just a wrapper for the original by adding a new item to the and displaying the contents of the . - Finally, the code example creates an array larger than the collection and uses the method to insert the elements of the collection into the middle of the array. + Finally, the code example creates an array larger than the collection and uses the method to insert the elements of the collection into the middle of the array. :::code language="csharp" source="~/snippets/csharp/System.Collections.ObjectModel/ReadOnlyCollectionT/Overview/source.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.ObjectModel/ReadOnlyCollectionT/Overview/source.vb" id="Snippet1"::: @@ -847,7 +847,7 @@ instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -903,7 +903,7 @@ instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -966,7 +966,7 @@ Retrieving the value of this property is an O(1) operation. - This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -1026,7 +1026,7 @@ instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -1087,7 +1087,7 @@ instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -1147,7 +1147,7 @@ instance is cast to an interface. + Because the collection is read-only, you can only get this item at the specified index. An exception will occur if you try to set the item. This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -1206,7 +1206,7 @@ instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -1269,11 +1269,11 @@ ## Remarks > [!NOTE] -> If the type of the source cannot be cast automatically to the type of the destination `array`, the non-generic implementations of throw , whereas the generic implementations throw . +> If the type of the source cannot be cast automatically to the type of the destination `array`, the non-generic implementations of throw , whereas the generic implementations throw . - This method is an O(`n`) operation, where `n` is . + This method is an O(`n`) operation, where `n` is . - This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -1351,11 +1351,11 @@ Enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization. - returns an object that can be used to synchronize access to the . + returns an object that can be used to synchronize access to the . Retrieving the value of this property is an O(1) operation. - This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -1415,7 +1415,7 @@ Enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization. - returns an object that can be used to synchronize access to the . Synchronization is effective only if all threads lock this object before accessing the collection. The following code shows the use of the property. + returns an object that can be used to synchronize access to the . Synchronization is effective only if all threads lock this object before accessing the collection. The following code shows the use of the property. ```csharp ICollection ic = ...; @@ -1433,7 +1433,7 @@ End SyncLock Retrieving the value of this property is an O(1) operation. -This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. +This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -1494,11 +1494,11 @@ This member is an explicit interface member implementation. It can be used only Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection. - Initially, the enumerator is positioned before the first element in the collection. also brings the enumerator back to this position. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. also brings the enumerator back to this position. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . - returns the same object until either or is called. sets to the next element. + returns the same object until either or is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. To set to the first element of the collection again, you can call followed by . + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. To set to the first element of the collection again, you can call followed by . An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and its behavior is undefined. @@ -1508,7 +1508,7 @@ This member is an explicit interface member implementation. It can be used only This method is an O(1) operation. - This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -1568,7 +1568,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -1624,7 +1624,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -1685,11 +1685,11 @@ This member is an explicit interface member implementation. It can be used only . + This method determines equality using the default comparer . - This method performs a linear search; therefore, this method is an O(`n`) operation, where `n` is . + This method performs a linear search; therefore, this method is an O(`n`) operation, where `n` is . - This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -1750,11 +1750,11 @@ This member is an explicit interface member implementation. It can be used only . + This method determines equality using the default comparer . - This method performs a linear search; therefore, this method is an O(`n`) operation, where `n` is . + This method performs a linear search; therefore, this method is an O(`n`) operation, where `n` is . - This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -1816,7 +1816,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -1879,7 +1879,7 @@ This member is an explicit interface member implementation. It can be used only Retrieving the value of this property is an O(1) operation. - This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -1941,7 +1941,7 @@ This member is an explicit interface member implementation. It can be used only Retrieving the value of this property is an O(1) operation. - This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -2013,11 +2013,11 @@ This member is an explicit interface member implementation. It can be used only ## Remarks This property provides the ability to access a specific element in the collection by using the following syntax: `myCollection[index]`. - The C# language uses the [this](/dotnet/csharp/language-reference/keywords/this) keyword to define the indexers instead of implementing the property. Visual Basic implements as a default property, which provides the same indexing functionality. + The C# language uses the [this](/dotnet/csharp/language-reference/keywords/this) keyword to define the indexers instead of implementing the property. Visual Basic implements as a default property, which provides the same indexing functionality. Retrieving the value of this property is an O(1) operation. - This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -2078,7 +2078,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -2137,7 +2137,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> diff --git a/xml/System.Collections.ObjectModel/ReadOnlyDictionary`2+KeyCollection.xml b/xml/System.Collections.ObjectModel/ReadOnlyDictionary`2+KeyCollection.xml index d8772b137e2..79204a7a1fe 100644 --- a/xml/System.Collections.ObjectModel/ReadOnlyDictionary`2+KeyCollection.xml +++ b/xml/System.Collections.ObjectModel/ReadOnlyDictionary`2+KeyCollection.xml @@ -201,14 +201,14 @@ is less than 0. - is multidimensional. - - -or- - - The number of elements in the source collection is greater than the available space from to the end of the destination . - - -or- - + is multidimensional. + + -or- + + The number of elements in the source collection is greater than the available space from to the end of the destination . + + -or- + Type cannot be cast automatically to the type of the destination . @@ -360,11 +360,11 @@ The object to add to the collection. Throws a exception in all cases. - instance is cast to an interface. The interface specifies that the method should throw a exception if the collection that implements the interface is read-only. - + instance is cast to an interface. The interface specifies that the method should throw a exception if the collection that implements the interface is read-only. + ]]> In all cases. @@ -416,11 +416,11 @@ Throws a exception in all cases. - instance is cast to an interface. The interface specifies that the method should throw a exception if the collection that implements the interface is read-only. - + instance is cast to an interface. The interface specifies that the method should throw a exception if the collection that implements the interface is read-only. + ]]> In all cases. @@ -473,11 +473,11 @@ if is found in the collection; otherwise, . - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -529,11 +529,11 @@ in all cases. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -589,11 +589,11 @@ if was successfully removed from the collection; otherwise, . This method also returns if is not found in the original collection. - instance is cast to an interface. The interface specifies that the method should throw a exception if the collection that implements the interface is read-only. - + instance is cast to an interface. The interface specifies that the method should throw a exception if the collection that implements the interface is read-only. + ]]> In all cases. @@ -650,11 +650,11 @@ The zero-based index in at which copying begins. Copies the elements of the collection to an array, starting at a specific array index. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -662,10 +662,10 @@ is less than 0. - is multidimensional. - - -or- - + is multidimensional. + + -or- + The number of elements in the source collection is greater than the available space from to the end of the destination . @@ -716,11 +716,11 @@ if access to the collection is synchronized (thread safe); otherwise, . - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -771,11 +771,11 @@ Gets an object that can be used to synchronize access to the collection. An object that can be used to synchronize access to the collection. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -827,11 +827,11 @@ Returns an enumerator that iterates through the collection. An enumerator that can be used to iterate through the collection. - instance is cast to an interface. - + instance is cast to an interface. + ]]> diff --git a/xml/System.Collections.ObjectModel/ReadOnlyDictionary`2+ValueCollection.xml b/xml/System.Collections.ObjectModel/ReadOnlyDictionary`2+ValueCollection.xml index c4b68c0474c..e6d4012a697 100644 --- a/xml/System.Collections.ObjectModel/ReadOnlyDictionary`2+ValueCollection.xml +++ b/xml/System.Collections.ObjectModel/ReadOnlyDictionary`2+ValueCollection.xml @@ -165,14 +165,14 @@ is less than 0. - is multidimensional. - - -or- - - The number of elements in the source collection is greater than the available space from to the end of the destination . - - -or- - + is multidimensional. + + -or- + + The number of elements in the source collection is greater than the available space from to the end of the destination . + + -or- + Type cannot be cast automatically to the type of the destination . @@ -324,11 +324,11 @@ The object to add to the collection. Throws a exception in all cases. - instance is cast to an interface. The interface specifies that the method should throw a exception if the collection that implements the interface is read-only. - + instance is cast to an interface. The interface specifies that the method should throw a exception if the collection that implements the interface is read-only. + ]]> In all cases. @@ -380,11 +380,11 @@ Throws a exception in all cases. - instance is cast to an interface. The interface specifies that the method should throw a exception if the collection that implements the interface is read-only. - + instance is cast to an interface. The interface specifies that the method should throw a exception if the collection that implements the interface is read-only. + ]]> In all cases. @@ -441,11 +441,11 @@ if is found in the collection; otherwise, . - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -497,11 +497,11 @@ in all cases. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -557,11 +557,11 @@ if was successfully removed from the collection; otherwise, . This method also returns if item is not found in the original collection. - instance is cast to an interface. The interface specifies that the method should throw a exception if the collection that implements the interface is read-only. - + instance is cast to an interface. The interface specifies that the method should throw a exception if the collection that implements the interface is read-only. + ]]> In all cases. @@ -618,11 +618,11 @@ The zero-based index in at which copying begins. Copies the elements of the collection to an array, starting at a specific array index. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -630,10 +630,10 @@ is less than 0. - is multidimensional. - - -or- - + is multidimensional. + + -or- + The number of elements in the source collection is greater than the available space from to the end of the destination . @@ -684,11 +684,11 @@ if access to the collection is synchronized (thread safe); otherwise, . - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -745,11 +745,11 @@ Gets an object that can be used to synchronize access to the collection. An object that can be used to synchronize access to the collection. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -801,11 +801,11 @@ Returns an enumerator that iterates through the collection. An enumerator that can be used to iterate through the collection. - instance is cast to an interface. - + instance is cast to an interface. + ]]> diff --git a/xml/System.Collections.ObjectModel/ReadOnlyDictionary`2.xml b/xml/System.Collections.ObjectModel/ReadOnlyDictionary`2.xml index 409c8ff3698..a78863e255c 100644 --- a/xml/System.Collections.ObjectModel/ReadOnlyDictionary`2.xml +++ b/xml/System.Collections.ObjectModel/ReadOnlyDictionary`2.xml @@ -708,14 +708,14 @@ is less than 0. - is multidimensional. - --or- - -The number of elements in the source dictionary is greater than the available space from to the end of the destination . - --or- - + is multidimensional. + +-or- + +The number of elements in the source dictionary is greater than the available space from to the end of the destination . + +-or- + Type cannot be cast automatically to the type of the destination . @@ -1226,11 +1226,11 @@ Type cannot be cast automatically to the type of the desti The zero-based index in at which copying begins. Copies the elements of the dictionary to an array, starting at the specified array index. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -1238,14 +1238,14 @@ Type cannot be cast automatically to the type of the desti is less than zero. - is multidimensional. - - -or- - - The number of elements in the source dictionary is greater than the available space from to the end of the destination . - - -or- - + is multidimensional. + + -or- + + The number of elements in the source dictionary is greater than the available space from to the end of the destination . + + -or- + The type of the source dictionary cannot be cast automatically to the type of the destination . @@ -1296,11 +1296,11 @@ Type cannot be cast automatically to the type of the desti if access to the dictionary is synchronized (thread safe); otherwise, . - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -1351,11 +1351,11 @@ Type cannot be cast automatically to the type of the desti Gets an object that can be used to synchronize access to the dictionary. An object that can be used to synchronize access to the dictionary. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -1411,11 +1411,11 @@ Type cannot be cast automatically to the type of the desti The value of the element to add. Throws a exception in all cases. - instance is cast to an interface. The interface specifies that the method should throw a exception if the collection that implements the interface is read-only. - + instance is cast to an interface. The interface specifies that the method should throw a exception if the collection that implements the interface is read-only. + ]]> In all cases. @@ -1467,11 +1467,11 @@ Type cannot be cast automatically to the type of the desti Throws a exception in all cases. - instance is cast to an interface. The interface specifies that the method should throw a exception if the collection that implements the interface is read-only. - + instance is cast to an interface. The interface specifies that the method should throw a exception if the collection that implements the interface is read-only. + ]]> In all cases. @@ -1528,11 +1528,11 @@ Type cannot be cast automatically to the type of the desti if the dictionary contains an element that has the specified key; otherwise, . - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -1586,11 +1586,11 @@ Type cannot be cast automatically to the type of the desti Returns an enumerator for the dictionary. An enumerator for the dictionary. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -1642,11 +1642,11 @@ Type cannot be cast automatically to the type of the desti if the dictionary has a fixed size; otherwise, . - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -1698,11 +1698,11 @@ Type cannot be cast automatically to the type of the desti in all cases. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -1764,19 +1764,19 @@ Type cannot be cast automatically to the type of the desti Gets the element that has the specified key. The element that has the specified key. - instance is cast to an interface. - + instance is cast to an interface. + ]]> is . - The property is set. - - -or- - + The property is set. + + -or- + The property is set, does not exist in the collection, and the dictionary has a fixed size. @@ -1826,11 +1826,11 @@ Type cannot be cast automatically to the type of the desti Gets a collection that contains the keys of the dictionary. A collection that contains the keys of the dictionary. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -1884,11 +1884,11 @@ Type cannot be cast automatically to the type of the desti The key of the element to remove. Throws a exception in all cases. - instance is cast to an interface. The interface specifies that the method should throw a exception if the collection that implements the interface is read-only. - + instance is cast to an interface. The interface specifies that the method should throw a exception if the collection that implements the interface is read-only. + ]]> In all cases. @@ -1940,11 +1940,11 @@ Type cannot be cast automatically to the type of the desti Gets a collection that contains the values in the dictionary. A collection that contains the values in the dictionary. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -1996,11 +1996,11 @@ Type cannot be cast automatically to the type of the desti Returns an enumerator that iterates through a collection. An enumerator that can be used to iterate through the collection. - instance is cast to an interface. - + instance is cast to an interface. + ]]> diff --git a/xml/System.Collections.ObjectModel/ReadOnlyObservableCollection`1.xml b/xml/System.Collections.ObjectModel/ReadOnlyObservableCollection`1.xml index bd0d9809ea0..378de3505c2 100644 --- a/xml/System.Collections.ObjectModel/ReadOnlyObservableCollection`1.xml +++ b/xml/System.Collections.ObjectModel/ReadOnlyObservableCollection`1.xml @@ -94,11 +94,11 @@ The type of elements in the collection. Represents a read-only . - . If changes are made to the underlying collection, the reflects those changes. To be notified of the changes to this class, subscribe to the or event. - + . If changes are made to the underlying collection, the reflects those changes. To be notified of the changes to this class, subscribe to the or event. + ]]> @@ -205,11 +205,11 @@ Occurs when an item is added or removed. - . - + . + ]]> @@ -411,11 +411,11 @@ Occurs when a property value changes. - . - + . + ]]> @@ -469,11 +469,11 @@ Occurs when the collection changes. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -527,11 +527,11 @@ Occurs when a property value changes. - instance is cast to an interface. - + instance is cast to an interface. + ]]> diff --git a/xml/System.Collections.Specialized/BitVector32+Section.xml b/xml/System.Collections.Specialized/BitVector32+Section.xml index d3df0bd809b..08075c24410 100644 --- a/xml/System.Collections.Specialized/BitVector32+Section.xml +++ b/xml/System.Collections.Specialized/BitVector32+Section.xml @@ -66,13 +66,13 @@ to define a new section. A is a window into the and is composed of the smallest number of consecutive bits that can contain the maximum value specified in . For example, a section with a maximum value of 1 is composed of only one bit, whereas a section with a maximum value of 5 is composed of three bits. You can create a with a maximum value of 1 to serve as a Boolean, thereby allowing you to store integers and Booleans in the same . + Use to define a new section. A is a window into the and is composed of the smallest number of consecutive bits that can contain the maximum value specified in . For example, a section with a maximum value of 1 is composed of only one bit, whereas a section with a maximum value of 5 is composed of three bits. You can create a with a maximum value of 1 to serve as a Boolean, thereby allowing you to store integers and Booleans in the same . ## Examples The following code example uses a as a collection of sections. - + :::code language="csharp" source="~/snippets/csharp/System.Collections.Specialized/BitVector32+Section/Overview/bitvector32_sections.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Specialized/BitVector32+Section/Overview/bitvector32_sections.vb" id="Snippet1"::: @@ -202,7 +202,7 @@ . + This method overrides . Two instances are considered equal if both sections are of the same length and are in the same location within a . @@ -257,9 +257,9 @@ . + This method overrides . - This method generates the same hash code for two objects that are equal according to the method. + This method generates the same hash code for two objects that are equal according to the method. ]]> @@ -528,7 +528,7 @@ . + This method overrides . ]]> diff --git a/xml/System.Collections.Specialized/BitVector32.xml b/xml/System.Collections.Specialized/BitVector32.xml index 75bff006f0d..8805dfdd7db 100644 --- a/xml/System.Collections.Specialized/BitVector32.xml +++ b/xml/System.Collections.Specialized/BitVector32.xml @@ -61,9 +61,9 @@ ## Remarks is more efficient than for Boolean values and small integers that are used internally. A can grow indefinitely as needed, but it has the memory and performance overhead that a class instance requires. In contrast, a uses only 32 bits. - A structure can be set up to contain either sections for small integers or bit flags for Booleans, but not both. A is a window into the and is composed of the smallest number of consecutive bits that can contain the maximum value specified in . For example, a section with a maximum value of 1 is composed of only one bit, whereas a section with a maximum value of 5 is composed of three bits. You can create a with a maximum value of 1 to serve as a Boolean, thereby allowing you to store integers and Booleans in the same . + A structure can be set up to contain either sections for small integers or bit flags for Booleans, but not both. A is a window into the and is composed of the smallest number of consecutive bits that can contain the maximum value specified in . For example, a section with a maximum value of 1 is composed of only one bit, whereas a section with a maximum value of 5 is composed of three bits. You can create a with a maximum value of 1 to serve as a Boolean, thereby allowing you to store integers and Booleans in the same . - Some members can be used for a that is set up as sections, while other members can be used for one that is set up as bit flags. For example, the property is the indexer for a that is set up as sections, and the property is the indexer for a that is set up as bit flags. creates a series of masks that can be used to access individual bits in a that is set up as bit flags. + Some members can be used for a that is set up as sections, while other members can be used for one that is set up as bit flags. For example, the property is the indexer for a that is set up as sections, and the property is the indexer for a that is set up as bit flags. creates a series of masks that can be used to access individual bits in a that is set up as bit flags. Using a mask on a that is set up as sections might cause unexpected results. @@ -431,7 +431,7 @@ is a window into the and is composed of the smallest number of consecutive bits that can contain the maximum value specified in . For example, a section with a maximum value of 1 is composed of only one bit, whereas a section with a maximum value of 5 is composed of three bits. You can create a with a maximum value of 1 to serve as a Boolean, thereby allowing you to store integers and Booleans in the same . + A is a window into the and is composed of the smallest number of consecutive bits that can contain the maximum value specified in . For example, a section with a maximum value of 1 is composed of only one bit, whereas a section with a maximum value of 5 is composed of three bits. You can create a with a maximum value of 1 to serve as a Boolean, thereby allowing you to store integers and Booleans in the same . If sections already exist in the , those sections are still accessible; however, overlapping sections might cause unexpected results. @@ -494,7 +494,7 @@ is a window into the and is composed of the smallest number of consecutive bits that can contain the maximum value specified in . For example, a section with a maximum value of 1 is composed of only one bit, whereas a section with a maximum value of 5 is composed of three bits. You can create a with a maximum value of 1 to serve as a Boolean, thereby allowing you to store integers and Booleans in the same . + A is a window into the and is composed of the smallest number of consecutive bits that can contain the maximum value specified in . For example, a section with a maximum value of 1 is composed of only one bit, whereas a section with a maximum value of 5 is composed of three bits. You can create a with a maximum value of 1 to serve as a Boolean, thereby allowing you to store integers and Booleans in the same . If sections already exist after `previous` in the , those sections are still accessible; however, overlapping sections might cause unexpected results. @@ -666,7 +666,7 @@ if the type of `o` is compatible with the type and if the value of `o` is equal to the value of . + The object `o` is considered equal to the if the type of `o` is compatible with the type and if the value of `o` is equal to the value of . This method is an O(1) operation. @@ -728,7 +728,7 @@ is based on the value of . Two instances of with the same value for will also generate the same hash code. + The hash code of a is based on the value of . Two instances of with the same value for will also generate the same hash code. This method is an O(1) operation. @@ -795,11 +795,11 @@ [Section] property is the indexer for a that is set up as sections, and the [int] property is the indexer for a that is set up as bit flags. + The [Section] property is the indexer for a that is set up as sections, and the [int] property is the indexer for a that is set up as bit flags. - A is a window into the and is composed of the smallest number of consecutive bits that can contain the maximum value specified in . For example, a section with a maximum value of 1 is composed of only one bit, whereas a section with a maximum value of 5 is composed of three bits. You can create a with a maximum value of 1 to serve as a Boolean, thereby allowing you to store integers and Booleans in the same . + A is a window into the and is composed of the smallest number of consecutive bits that can contain the maximum value specified in . For example, a section with a maximum value of 1 is composed of only one bit, whereas a section with a maximum value of 5 is composed of three bits. You can create a with a maximum value of 1 to serve as a Boolean, thereby allowing you to store integers and Booleans in the same . - The C# language uses the [this](/dotnet/csharp/language-reference/keywords/this) keyword to define the indexers instead of implementing the property. Visual Basic implements as a [default property](/dotnet/visual-basic/language-reference/modifiers/default), which provides the same indexing functionality. + The C# language uses the [this](/dotnet/csharp/language-reference/keywords/this) keyword to define the indexers instead of implementing the property. Visual Basic implements as a [default property](/dotnet/visual-basic/language-reference/modifiers/default), which provides the same indexing functionality. Retrieving the value of this property is an O(1) operation; setting the property is also an O(1) operation. @@ -859,11 +859,11 @@ [Section] property is the indexer for a that is set up as sections, and the [int] property is the indexer for a that is set up as bit flags. + The [Section] property is the indexer for a that is set up as sections, and the [int] property is the indexer for a that is set up as bit flags. Using this property on a that is set up as sections might cause unexpected results. - The C# language uses the [this](/dotnet/csharp/language-reference/keywords/this) keyword to define the indexers instead of implementing the property. Visual Basic implements as a [default property](/dotnet/visual-basic/language-reference/modifiers/default), which provides the same indexing functionality. + The C# language uses the [this](/dotnet/csharp/language-reference/keywords/this) keyword to define the indexers instead of implementing the property. Visual Basic implements as a [default property](/dotnet/visual-basic/language-reference/modifiers/default), which provides the same indexing functionality. Retrieving the value of this property is an O(1) operation; setting the property is also an O(1) operation. @@ -928,7 +928,7 @@ . + This method overrides . This method is an O(1) operation. diff --git a/xml/System.Collections.Specialized/CollectionsUtil.xml b/xml/System.Collections.Specialized/CollectionsUtil.xml index 70a9329897c..c3be54b4f54 100644 --- a/xml/System.Collections.Specialized/CollectionsUtil.xml +++ b/xml/System.Collections.Specialized/CollectionsUtil.xml @@ -182,7 +182,7 @@ method, use the constructor to create a case-insensitive class. + Instead of using the method, use the constructor to create a case-insensitive class. ]]> @@ -241,7 +241,7 @@ method, use the constructor to create a case-insensitive class. + Instead of using the method, use the constructor to create a case-insensitive class. ]]> @@ -303,7 +303,7 @@ method, use the constructor to create a case-insensitive class. + Instead of using the method, use the constructor to create a case-insensitive class. ]]> diff --git a/xml/System.Collections.Specialized/HybridDictionary.xml b/xml/System.Collections.Specialized/HybridDictionary.xml index 9154c4c1c07..29682fe9cf2 100644 --- a/xml/System.Collections.Specialized/HybridDictionary.xml +++ b/xml/System.Collections.Specialized/HybridDictionary.xml @@ -77,7 +77,7 @@ If the initial size of the collection is greater than the optimal size for a , the collection is stored in a to avoid the overhead of copying elements from the to a . - The constructor accepts a Boolean parameter that allows the user to specify whether the collection ignores the case when comparing strings. If the collection is case-sensitive, it uses the key's implementations of and . If the collection is case-insensitive, it performs a simple ordinal case-insensitive comparison, which obeys the casing rules of the invariant culture only. By default, the collection is case-sensitive. For more information on the invariant culture, see . + The constructor accepts a Boolean parameter that allows the user to specify whether the collection ignores the case when comparing strings. If the collection is case-sensitive, it uses the key's implementations of and . If the collection is case-insensitive, it performs a simple ordinal case-insensitive comparison, which obeys the casing rules of the invariant culture only. By default, the collection is case-sensitive. For more information on the invariant culture, see . A key cannot be null, but a value can. @@ -169,7 +169,7 @@ as the hash code provider and the key's implementation of as the comparer. + By default, the collection is case-sensitive and uses the key's implementation of as the hash code provider and the key's implementation of as the comparer. The comparer determines whether two keys are equal. Every key in a must be unique. @@ -239,7 +239,7 @@ and . If `caseInsensitive` is `true`, the collection performs a simple ordinal case-insensitive comparison, which obeys the casing rules of the invariant culture only. For more information on the invariant culture, see . + If `caseInsensitive` is `false`, the collection uses the key's implementations of and . If `caseInsensitive` is `true`, the collection performs a simple ordinal case-insensitive comparison, which obeys the casing rules of the invariant culture only. For more information on the invariant culture, see . This constructor is an O(1) operation. @@ -301,7 +301,7 @@ ## Remarks If the initial size of the collection is greater than the optimal size for a , the collection is stored in a to avoid the overhead of copying elements from the to the . - By default, the collection is case-sensitive and uses the key's implementation of as the hash code provider and the key's implementation of as the comparer. + By default, the collection is case-sensitive and uses the key's implementation of as the hash code provider and the key's implementation of as the comparer. The comparer determines whether two keys are equal. Every key in a must be unique. @@ -363,7 +363,7 @@ ## Remarks If the initial size of the collection is greater than the optimal size for a , the collection is stored in a to avoid the overhead of copying elements from the to the . - If `caseInsensitive` is `false`, the collection uses the key's implementations of and . If `caseInsensitive` is `true`, the collection performs a simple ordinal case-insensitive comparison, which obeys the casing rules of the invariant culture only. For more information on the invariant culture, see . + If `caseInsensitive` is `false`, the collection uses the key's implementations of and . If `caseInsensitive` is `true`, the collection performs a simple ordinal case-insensitive comparison, which obeys the casing rules of the invariant culture only. For more information on the invariant culture, see . This constructor is an O(`n`) operation, where `n` is `initialSize`. @@ -437,7 +437,7 @@ A key cannot be `null`, but a value can. - You can also use the property to add new elements by setting the value of a key that does not exist in the ; for example, `myCollection["myNonexistentKey"] = myValue`. However, if the specified key already exists in the , setting the property overwrites the old value. In contrast, the method does not modify existing elements. + You can also use the property to add new elements by setting the value of a key that does not exist in the ; for example, `myCollection["myNonexistentKey"] = myValue`. However, if the specified key already exists in the , setting the property overwrites the old value. In contrast, the method does not modify existing elements. When the number of elements becomes greater than the optimal size for a , the elements are copied from the to a . However, this only happens once. If the collection is already stored in a and the number of elements falls below the optimal size for a , the collection remains in the . @@ -509,11 +509,11 @@ is set to zero, and references to other objects from elements of the collection are also released. + is set to zero, and references to other objects from elements of the collection are also released. If the collection is already stored in a , the collection remains in the . - This method is an O(`n`) operation, where `n` is . + This method is an O(`n`) operation, where `n` is . @@ -583,7 +583,7 @@ ## Remarks This method is an O(1) operation. -This method uses the collection's objects' and methods on `key` to determine whether `item` exists. +This method uses the collection's objects' and methods on `key` to determine whether `item` exists. ## Examples The following code example searches for an element in a . @@ -658,7 +658,7 @@ This method uses the collection's objects' and , use `HybridDictionary.Values.CopyTo`. - This method is an O(`n`) operation, where `n` is . + This method is an O(`n`) operation, where `n` is . ## Examples The following code example copies the elements of a to an array. @@ -796,11 +796,11 @@ This method uses the collection's objects' and also brings the enumerator back to this position. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. also brings the enumerator back to this position. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . - returns the same object until either or is called. sets to the next element. + returns the same object until either or is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. To set to the first element of the collection again, you can call followed by . + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. To set to the first element of the collection again, you can call followed by . An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and its behavior is undefined. @@ -999,7 +999,7 @@ This method uses the collection's objects' and during the entire enumeration. + The following code example shows how to lock the collection using the during the entire enumeration. :::code language="csharp" source="~/snippets/csharp/System.Collections.Specialized/HybridDictionary/Overview/source2.cs" id="Snippet3"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Specialized/HybridDictionary/Overview/source2.vb" id="Snippet3"::: @@ -1072,11 +1072,11 @@ This method uses the collection's objects' and property to add new elements by setting the value of a key that does not exist in the ; for example, `myCollection["myNonexistentKey"] = myValue`. However, if the specified key already exists in the , setting the property overwrites the old value. In contrast, the method does not modify existing elements. + You can also use the property to add new elements by setting the value of a key that does not exist in the ; for example, `myCollection["myNonexistentKey"] = myValue`. However, if the specified key already exists in the , setting the property overwrites the old value. In contrast, the method does not modify existing elements. - A key cannot be `null`, but a value can. To distinguish between `null` that is returned because the specified key is not found and `null` that is returned because the value of the specified key is `null`, use the method to determine if the key exists in the list. + A key cannot be `null`, but a value can. To distinguish between `null` that is returned because the specified key is not found and `null` that is returned because the value of the specified key is `null`, use the method to determine if the key exists in the list. - The C# language uses the [this](/dotnet/csharp/language-reference/keywords/this) keyword to define the indexers instead of implementing the property. Visual Basic implements as a default property, which provides the same indexing functionality. + The C# language uses the [this](/dotnet/csharp/language-reference/keywords/this) keyword to define the indexers instead of implementing the property. Visual Basic implements as a default property, which provides the same indexing functionality. Retrieving the value of this property is an O(1) operation; setting the property is also an O(1) operation. @@ -1144,7 +1144,7 @@ This method uses the collection's objects' and is unspecified, but it is the same order as the associated values in the returned by the method. + The order of the values in the is unspecified, but it is the same order as the associated values in the returned by the method. The returned is not a static copy; instead, the refers back to the keys in the original . Therefore, changes to the continue to be reflected in the . @@ -1286,14 +1286,14 @@ This method uses the collection's objects' and using the property. The synchronizing code must perform operations on the of the , not directly on the . This ensures proper operation of collections that are derived from other objects. Specifically, it maintains proper synchronization with other threads that might be simultaneously modifying the object. + Derived classes can provide their own synchronized version of the using the property. The synchronizing code must perform operations on the of the , not directly on the . This ensures proper operation of collections that are derived from other objects. Specifically, it maintains proper synchronization with other threads that might be simultaneously modifying the object. Enumerating through a collection is intrinsically not a thread-safe procedure. Even when a collection is synchronized, other threads can still modify the collection, which causes the enumerator to throw an exception. To guarantee thread safety during enumeration, you can either lock the collection during the entire enumeration or catch the exceptions resulting from changes made by other threads. ## Examples - The following code example shows how to lock the collection using the during the entire enumeration. + The following code example shows how to lock the collection using the during the entire enumeration. :::code language="csharp" source="~/snippets/csharp/System.Collections.Specialized/HybridDictionary/Overview/source2.cs" id="Snippet3"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Specialized/HybridDictionary/Overview/source2.vb" id="Snippet3"::: @@ -1358,13 +1358,13 @@ This method uses the collection's objects' and also brings the enumerator back to this position. At this position, calling throws an exception. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. also brings the enumerator back to this position. At this position, calling throws an exception. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . - returns the same object until either or is called. sets to the next element. + returns the same object until either or is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, calling throws an exception. To set to the first element of the collection again, you can call followed by . + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, calling throws an exception. To set to the first element of the collection again, you can call followed by . - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . If the collection is modified between and , returns the element that it is set to, even if the enumerator is already invalidated. + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . If the collection is modified between and , returns the element that it is set to, even if the enumerator is already invalidated. The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread-safe procedure. Even when a collection is synchronized, other threads can still modify the collection, which causes the enumerator to throw an exception. To guarantee thread safety during enumeration, you can either lock the collection during the entire enumeration or catch the exceptions resulting from changes made by other threads. @@ -1432,7 +1432,7 @@ This method uses the collection's objects' and is unspecified, but it is the same order as the associated keys in the returned by the method. + The order of the values in the is unspecified, but it is the same order as the associated keys in the returned by the method. The returned is not a static copy; instead, the refers back to the values in the original . Therefore, changes to the continue to be reflected in the . diff --git a/xml/System.Collections.Specialized/INotifyCollectionChanged.xml b/xml/System.Collections.Specialized/INotifyCollectionChanged.xml index 6a60be7f358..cf800d93a46 100644 --- a/xml/System.Collections.Specialized/INotifyCollectionChanged.xml +++ b/xml/System.Collections.Specialized/INotifyCollectionChanged.xml @@ -69,19 +69,19 @@ Notifies listeners of dynamic changes, such as when an item is added and removed or the whole list is cleared. - interface. However, to set up dynamic bindings so that insertions or deletions in the collection update the UI automatically, the collection must implement the interface. This interface exposes the event that must be raised whenever the underlying collection changes. - - WPF provides the class, which is a built-in implementation of a data collection that exposes the interface. For an example, see [How to: Create and Bind to an ObservableCollection](/dotnet/framework/wpf/data/how-to-create-and-bind-to-an-observablecollection). - - The individual data objects within the collection must satisfy the requirements described in the [Binding Sources Overview](/dotnet/framework/wpf/data/binding-sources-overview). - - Before implementing your own collection, consider using or one of the existing collection classes, such as , , and , among many others. - - If you have an advanced scenario and want to implement your own collection, consider using , which provides a non-generic collection of objects that can be individually accessed by index and provides the best performance. - + interface. However, to set up dynamic bindings so that insertions or deletions in the collection update the UI automatically, the collection must implement the interface. This interface exposes the event that must be raised whenever the underlying collection changes. + + WPF provides the class, which is a built-in implementation of a data collection that exposes the interface. For an example, see [How to: Create and Bind to an ObservableCollection](/dotnet/framework/wpf/data/how-to-create-and-bind-to-an-observablecollection). + + The individual data objects within the collection must satisfy the requirements described in the [Binding Sources Overview](/dotnet/framework/wpf/data/binding-sources-overview). + + Before implementing your own collection, consider using or one of the existing collection classes, such as , , and , among many others. + + If you have an advanced scenario and want to implement your own collection, consider using , which provides a non-generic collection of objects that can be individually accessed by index and provides the best performance. + ]]> ObservableCollection Simply Explained @@ -134,11 +134,11 @@ Occurs when the collection changes. - ,which contains data that is related to this event. - + ,which contains data that is related to this event. + ]]> diff --git a/xml/System.Collections.Specialized/IOrderedDictionary.xml b/xml/System.Collections.Specialized/IOrderedDictionary.xml index fc8e3fcc231..6552823f643 100644 --- a/xml/System.Collections.Specialized/IOrderedDictionary.xml +++ b/xml/System.Collections.Specialized/IOrderedDictionary.xml @@ -142,11 +142,11 @@ Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection. - Initially, the enumerator is positioned before the first element in the collection. also brings the enumerator back to this position. At this position, the property is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. also brings the enumerator back to this position. At this position, the property is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . - returns the same object until either or is called. sets to the next element. + returns the same object until either or is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. To set to the first element of the collection again, you can call followed by . + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. To set to the first element of the collection again, you can call followed by . An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and its behavior is undefined. @@ -225,7 +225,7 @@ ## Remarks accepts `null` as a valid value and allows duplicate elements. - If the `index` parameter is equal to , the `value` parameter is added to the end of the collection. + If the `index` parameter is equal to , the `value` parameter is added to the end of the collection. In collections of contiguous elements, such as lists, the elements that follow the insertion point move down to accommodate the new element. If the collection is indexed, the indexes of the elements that are moved are also updated. This behavior does not apply to collections where elements are conceptually grouped together, such as a hash table. @@ -313,7 +313,7 @@ accepts `null` as a valid value and allows duplicate elements. -The C# language uses the [this](/dotnet/csharp/language-reference/keywords/this) keyword to define the indexers instead of implementing the property. Visual Basic implements as a [default property](/dotnet/visual-basic/language-reference/modifiers/default), which provides the same indexing functionality. +The C# language uses the [this](/dotnet/csharp/language-reference/keywords/this) keyword to define the indexers instead of implementing the property. Visual Basic implements as a [default property](/dotnet/visual-basic/language-reference/modifiers/default), which provides the same indexing functionality. This property allows you to access a specific element in the collection by using the following syntax: diff --git a/xml/System.Collections.Specialized/ListDictionary.xml b/xml/System.Collections.Specialized/ListDictionary.xml index aeadaf88cd7..e9a0430acff 100644 --- a/xml/System.Collections.Specialized/ListDictionary.xml +++ b/xml/System.Collections.Specialized/ListDictionary.xml @@ -77,7 +77,7 @@ Items in a are not in any guaranteed order; code should not depend on the current order. The is implemented for fast keyed retrieval; the actual internal order of items is implementation-dependent and could change in future versions of the product. - Members, such as , , , and are O(`n`) operations, where `n` is . + Members, such as , , , and are O(`n`) operations, where `n` is . A key cannot be `null`, but a value can. @@ -165,7 +165,7 @@ must be unique. The default comparer is the key's implementation of . + The comparer determines whether two keys are equal. Every key in a must be unique. The default comparer is the key's implementation of . This constructor is an O(1) operation. @@ -238,7 +238,7 @@ must be unique. The default comparer is the key's implementation of . + The comparer determines whether two keys are equal. Every key in a must be unique. The default comparer is the key's implementation of . The custom comparer enables such scenarios as doing lookups with case-insensitive strings. @@ -314,9 +314,9 @@ ## Remarks An object that has no correlation between its state and its hash code value should typically not be used as the key. For example, String objects are better than StringBuilder objects for use as keys. - You can also use the property to add new elements by setting the value of a key that does not exist in the ; for example, `myCollection["myNonexistentKey"] = myValue`. However, if the specified key already exists in the , setting the property overwrites the old value. In contrast, the method does not modify existing elements. + You can also use the property to add new elements by setting the value of a key that does not exist in the ; for example, `myCollection["myNonexistentKey"] = myValue`. However, if the specified key already exists in the , setting the property overwrites the old value. In contrast, the method does not modify existing elements. - This method is an O(`n`) operation, where `n` is . + This method is an O(`n`) operation, where `n` is . @@ -384,7 +384,7 @@ is set to zero, and references to other objects from elements of the collection are also released. + is set to zero, and references to other objects from elements of the collection are also released. This method is an O(1) operation. @@ -454,9 +454,9 @@ . + This method is an O(`n`) operation, where `n` is . -This method uses the collection's objects' and methods on `key` to determine whether `item` exists. +This method uses the collection's objects' and methods on `key` to determine whether `item` exists. ## Examples The following code example searches for an element in a . @@ -531,7 +531,7 @@ This method uses the collection's objects' and , use `ListDictionary.Values.CopyTo`. - This method is an O(`n`) operation, where `n` is . + This method is an O(`n`) operation, where `n` is . @@ -680,11 +680,11 @@ This method uses the collection's objects' and also brings the enumerator back to this position. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. also brings the enumerator back to this position. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . - returns the same object until either or is called. sets to the next element. + returns the same object until either or is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. To set to the first element of the collection again, you can call followed by . + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. To set to the first element of the collection again, you can call followed by . An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and its behavior is undefined. @@ -883,7 +883,7 @@ This method uses the collection's objects' and during the entire enumeration. + The following code example shows how to lock the collection using the during the entire enumeration. :::code language="csharp" source="~/snippets/csharp/System.Collections.Specialized/ListDictionary/Overview/source2.cs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Specialized/ListDictionary/Overview/source2.vb" id="Snippet2"::: @@ -956,13 +956,13 @@ This method uses the collection's objects' and property to add new elements by setting the value of a key that does not exist in the ; for example, `myCollection["myNonexistentKey"] = myValue`. However, if the specified key already exists in the , setting the property overwrites the old value. In contrast, the method does not modify existing elements. + You can also use the property to add new elements by setting the value of a key that does not exist in the ; for example, `myCollection["myNonexistentKey"] = myValue`. However, if the specified key already exists in the , setting the property overwrites the old value. In contrast, the method does not modify existing elements. - A key cannot be `null`, but a value can. To distinguish between `null` that is returned because the specified key is not found and `null` that is returned because the value of the specified key is `null`, use the method to determine if the key exists in the list. + A key cannot be `null`, but a value can. To distinguish between `null` that is returned because the specified key is not found and `null` that is returned because the value of the specified key is `null`, use the method to determine if the key exists in the list. - The C# language uses the [this](/dotnet/csharp/language-reference/keywords/this) keyword to define the indexers instead of implementing the property. Visual Basic implements as a default property, which provides the same indexing functionality. + The C# language uses the [this](/dotnet/csharp/language-reference/keywords/this) keyword to define the indexers instead of implementing the property. Visual Basic implements as a default property, which provides the same indexing functionality. - This method is an O(`n`) operation, where `n` is . + This method is an O(`n`) operation, where `n` is . @@ -1028,7 +1028,7 @@ This method uses the collection's objects' and is unspecified, but it is the same order as the associated values in the returned by the method. + The order of the values in the is unspecified, but it is the same order as the associated values in the returned by the method. The returned is not a static copy; instead, the refers back to the keys in the original . Therefore, changes to the continue to be reflected in the . @@ -1101,7 +1101,7 @@ This method uses the collection's objects' and does not contain an element with the specified key, the remains unchanged. No exception is thrown. - This method is an O(`n`) operation, where `n` is . + This method is an O(`n`) operation, where `n` is . @@ -1168,14 +1168,14 @@ This method uses the collection's objects' and using the property. The synchronizing code must perform operations on the of the , not directly on the . This ensures proper operation of collections that are derived from other objects. Specifically, it maintains proper synchronization with other threads that might be simultaneously modifying the object. + Derived classes can provide their own synchronized version of the using the property. The synchronizing code must perform operations on the of the , not directly on the . This ensures proper operation of collections that are derived from other objects. Specifically, it maintains proper synchronization with other threads that might be simultaneously modifying the object. Enumerating through a collection is intrinsically not a thread-safe procedure. Even when a collection is synchronized, other threads can still modify the collection, which causes the enumerator to throw an exception. To guarantee thread safety during enumeration, you can either lock the collection during the entire enumeration or catch the exceptions resulting from changes made by other threads. ## Examples - The following code example shows how to lock the collection using the during the entire enumeration. + The following code example shows how to lock the collection using the during the entire enumeration. :::code language="csharp" source="~/snippets/csharp/System.Collections.Specialized/ListDictionary/Overview/source2.cs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Specialized/ListDictionary/Overview/source2.vb" id="Snippet2"::: @@ -1240,13 +1240,13 @@ This method uses the collection's objects' and also brings the enumerator back to this position. At this position, calling throws an exception. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. also brings the enumerator back to this position. At this position, calling throws an exception. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . - returns the same object until either or is called. sets to the next element. + returns the same object until either or is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, calling throws an exception. To set to the first element of the collection again, you can call followed by . + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, calling throws an exception. To set to the first element of the collection again, you can call followed by . - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . If the collection is modified between and , returns the element that it is set to, even if the enumerator is already invalidated. + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . If the collection is modified between and , returns the element that it is set to, even if the enumerator is already invalidated. The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread-safe procedure. Even when a collection is synchronized, other threads can still modify the collection, which causes the enumerator to throw an exception. To guarantee thread safety during enumeration, you can either lock the collection during the entire enumeration or catch the exceptions resulting from changes made by other threads. @@ -1314,7 +1314,7 @@ This method uses the collection's objects' and is unspecified, but it is the same order as the associated keys in the returned by the method. + The order of the values in the is unspecified, but it is the same order as the associated keys in the returned by the method. The returned is not a static copy; instead, the refers back to the values in the original . Therefore, changes to the continue to be reflected in the . diff --git a/xml/System.Collections.Specialized/NameObjectCollectionBase+KeysCollection.xml b/xml/System.Collections.Specialized/NameObjectCollectionBase+KeysCollection.xml index eea666a47d1..ca45b782c47 100644 --- a/xml/System.Collections.Specialized/NameObjectCollectionBase+KeysCollection.xml +++ b/xml/System.Collections.Specialized/NameObjectCollectionBase+KeysCollection.xml @@ -236,11 +236,11 @@ Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection. - Initially, the enumerator is positioned before the first element in the collection. also brings the enumerator back to this position. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. also brings the enumerator back to this position. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . - returns the same object until either or is called. sets to the next element. + returns the same object until either or is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. To set to the first element of the collection again, you can call followed by . + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. To set to the first element of the collection again, you can call followed by . An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and its behavior is undefined. @@ -314,7 +314,7 @@ ## Remarks This property provides the ability to access a specific element in the collection by using the following syntax: `myCollection[index]` (In Visual Basic, `myCollection(index)`). - The C# language uses the [this](/dotnet/csharp/language-reference/keywords/this) keyword to define the indexers instead of implementing the property. Visual Basic implements as a [default property](/dotnet/visual-basic/language-reference/modifiers/default), which provides the same indexing functionality. + The C# language uses the [this](/dotnet/csharp/language-reference/keywords/this) keyword to define the indexers instead of implementing the property. Visual Basic implements as a [default property](/dotnet/visual-basic/language-reference/modifiers/default), which provides the same indexing functionality. Retrieving the value of this property is an O(1) operation; setting the property is also an O(1) operation. @@ -379,9 +379,9 @@ ## Remarks The specified array must be of a compatible type. - This method uses to copy the elements. + This method uses to copy the elements. - This method is an O(`n`) operation, where `n` is . + This method is an O(`n`) operation, where `n` is . ]]> @@ -446,14 +446,14 @@ using the property. The synchronizing code must perform operations on the of the , not directly on the . This ensures proper operation of collections that are derived from other objects. Specifically, it maintains proper synchronization with other threads that might be simultaneously modifying the object. + Derived classes can provide their own synchronized version of the using the property. The synchronizing code must perform operations on the of the , not directly on the . This ensures proper operation of collections that are derived from other objects. Specifically, it maintains proper synchronization with other threads that might be simultaneously modifying the object. Enumerating through a collection is intrinsically not a thread-safe procedure. Even when a collection is synchronized, other threads can still modify the collection, which causes the enumerator to throw an exception. To guarantee thread safety during enumeration, you can either lock the collection during the entire enumeration or catch the exceptions resulting from changes made by other threads. ## Examples - The following code example shows how to lock the collection using the during the entire enumeration. + The following code example shows how to lock the collection using the during the entire enumeration. :::code language="csharp" source="~/snippets/csharp/System.Collections.Specialized/NameObjectCollectionBase+KeysCollection/System.Collections.ICollection.IsSynchronized/source.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Specialized/NameObjectCollectionBase+KeysCollection/System.Collections.ICollection.IsSynchronized/source.vb" id="Snippet1"::: @@ -518,14 +518,14 @@ using the property. The synchronizing code must perform operations on the of the , not directly on the . This ensures proper operation of collections that are derived from other objects. Specifically, it maintains proper synchronization with other threads that might be simultaneously modifying the object. + Derived classes can provide their own synchronized version of the using the property. The synchronizing code must perform operations on the of the , not directly on the . This ensures proper operation of collections that are derived from other objects. Specifically, it maintains proper synchronization with other threads that might be simultaneously modifying the object. Enumerating through a collection is intrinsically not a thread-safe procedure. Even when a collection is synchronized, other threads can still modify the collection, which causes the enumerator to throw an exception. To guarantee thread safety during enumeration, you can either lock the collection during the entire enumeration or catch the exceptions resulting from changes made by other threads. ## Examples - The following code example shows how to lock the collection using the during the entire enumeration. + The following code example shows how to lock the collection using the during the entire enumeration. :::code language="csharp" source="~/snippets/csharp/System.Collections.Specialized/NameObjectCollectionBase+KeysCollection/System.Collections.ICollection.IsSynchronized/source.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Specialized/NameObjectCollectionBase+KeysCollection/System.Collections.ICollection.IsSynchronized/source.vb" id="Snippet1"::: diff --git a/xml/System.Collections.Specialized/NameObjectCollectionBase.xml b/xml/System.Collections.Specialized/NameObjectCollectionBase.xml index 6b8f13e883c..f6ad45c3079 100644 --- a/xml/System.Collections.Specialized/NameObjectCollectionBase.xml +++ b/xml/System.Collections.Specialized/NameObjectCollectionBase.xml @@ -91,12 +91,12 @@ The comparer determines whether two keys are equal. The default comparer is the . - In .NET Framework version 1.0, this class uses culture-sensitive string comparisons. However, in .NET Framework version 1.1 and later, this class uses when comparing strings. For more information about how culture affects comparisons and sorting, see [Performing Culture-Insensitive String Operations](/dotnet/standard/globalization-localization/performing-culture-insensitive-string-operations). + In .NET Framework version 1.0, this class uses culture-sensitive string comparisons. However, in .NET Framework version 1.1 and later, this class uses when comparing strings. For more information about how culture affects comparisons and sorting, see [Performing Culture-Insensitive String Operations](/dotnet/standard/globalization-localization/performing-culture-insensitive-string-operations). `null` is allowed as a key or as a value. > [!CAUTION] -> The method does not distinguish between `null` that's returned because the specified key is not found and `null` that's returned because the value associated with the key is `null`. +> The method does not distinguish between `null` that's returned because the specified key is not found and `null` that's returned because the value associated with the key is `null`. ## Examples The following code example shows how to implement and use the class. @@ -645,14 +645,14 @@ already equals the capacity, the capacity of the is increased by automatically reallocating the internal array, and the existing elements are copied to the new array before the new element is added. + If already equals the capacity, the capacity of the is increased by automatically reallocating the internal array, and the existing elements are copied to the new array before the new element is added. - If is less than the capacity, this method is an O(1) operation. If the capacity needs to be increased to accommodate the new element, this method becomes an O(`n`) operation, where `n` is . + If is less than the capacity, this method is an O(1) operation. If the capacity needs to be increased to accommodate the new element, this method becomes an O(`n`) operation, where `n` is . ## Examples - The following code example uses to create a new with elements from an . + The following code example uses to create a new with elements from an . :::code language="csharp" source="~/snippets/csharp/System.Collections.Specialized/NameObjectCollectionBase/BaseAdd/nocb_baseadd.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Specialized/NameObjectCollectionBase/BaseAdd/nocb_baseadd.vb" id="Snippet1"::: @@ -707,14 +707,14 @@ is set to zero, and references to other objects from elements of the collection are also released. + is set to zero, and references to other objects from elements of the collection are also released. This method is an O(1) operation. ## Examples - The following code example uses to remove all elements from a . + The following code example uses to remove all elements from a . :::code language="csharp" source="~/snippets/csharp/System.Collections.Specialized/NameObjectCollectionBase/BaseClear/nocb_baseclear.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Specialized/NameObjectCollectionBase/BaseClear/nocb_baseclear.vb" id="Snippet1"::: @@ -736,7 +736,7 @@ and to get specific keys and values. + The following code example uses and to get specific keys and values. :::code language="csharp" source="~/snippets/csharp/System.Collections.Specialized/NameObjectCollectionBase/BaseGetKey/nocb_baseget.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Specialized/NameObjectCollectionBase/BaseGetKey/nocb_baseget.vb" id="Snippet1"::: @@ -912,12 +912,12 @@ . + This method is an O(`n`) operation, where `n` is . ## Examples - The following code example uses and to get an array of the keys or an array of the values. + The following code example uses and to get an array of the keys or an array of the values. :::code language="csharp" source="~/snippets/csharp/System.Collections.Specialized/NameObjectCollectionBase/BaseGetAllKeys/nocb_basegetall.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Specialized/NameObjectCollectionBase/BaseGetAllKeys/nocb_basegetall.vb" id="Snippet1"::: @@ -983,12 +983,12 @@ . + This method is an O(`n`) operation, where `n` is . ## Examples - The following code example uses and to get an array of the keys or an array of the values. + The following code example uses and to get an array of the keys or an array of the values. :::code language="csharp" source="~/snippets/csharp/System.Collections.Specialized/NameObjectCollectionBase/BaseGetAllKeys/nocb_basegetall.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Specialized/NameObjectCollectionBase/BaseGetAllKeys/nocb_basegetall.vb" id="Snippet1"::: @@ -1047,7 +1047,7 @@ . + This method is an O(`n`) operation, where `n` is . ]]> @@ -1113,7 +1113,7 @@ ## Examples - The following code example uses and to get specific keys and values. + The following code example uses and to get specific keys and values. :::code language="csharp" source="~/snippets/csharp/System.Collections.Specialized/NameObjectCollectionBase/BaseGetKey/nocb_baseget.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Specialized/NameObjectCollectionBase/BaseGetKey/nocb_baseget.vb" id="Snippet1"::: @@ -1176,7 +1176,7 @@ ## Examples - The following code example uses to determine if the collection contains keys that are not `null`. + The following code example uses to determine if the collection contains keys that are not `null`. :::code language="csharp" source="~/snippets/csharp/System.Collections.Specialized/NameObjectCollectionBase/BaseHasKeys/nocb_basehaskeys.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Specialized/NameObjectCollectionBase/BaseHasKeys/nocb_basehaskeys.vb" id="Snippet1"::: @@ -1238,12 +1238,12 @@ In collections of contiguous elements, such as lists, the elements that follow the removed element move up to occupy the vacated spot. If the collection is indexed, the indexes of the elements that are moved are also updated. This behavior does not apply to collections where elements are conceptually grouped into buckets, such as a hash table. - This method is an O(`n`) operation, where `n` is . + This method is an O(`n`) operation, where `n` is . ## Examples - The following code example uses and to remove elements from a . + The following code example uses and to remove elements from a . :::code language="csharp" source="~/snippets/csharp/System.Collections.Specialized/NameObjectCollectionBase/BaseRemove/nocb_baseremove.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Specialized/NameObjectCollectionBase/BaseRemove/nocb_baseremove.vb" id="Snippet1"::: @@ -1304,12 +1304,12 @@ ## Remarks In collections of contiguous elements, such as lists, the elements that follow the removed element move up to occupy the vacated spot. If the collection is indexed, the indexes of the elements that are moved are also updated. This behavior does not apply to collections where elements are conceptually grouped into buckets, such as a hash table. - This method is an O(`n`) operation, where `n` is . + This method is an O(`n`) operation, where `n` is . ## Examples - The following code example uses and to remove elements from a . + The following code example uses and to remove elements from a . :::code language="csharp" source="~/snippets/csharp/System.Collections.Specialized/NameObjectCollectionBase/BaseRemove/nocb_baseremove.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Specialized/NameObjectCollectionBase/BaseRemove/nocb_baseremove.vb" id="Snippet1"::: @@ -1333,7 +1333,7 @@ to set the value of a specific element. + The following code example uses to set the value of a specific element. :::code language="csharp" source="~/snippets/csharp/System.Collections.Specialized/NameObjectCollectionBase/BaseSet/nocb_baseset.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Specialized/NameObjectCollectionBase/BaseSet/nocb_baseset.vb" id="Snippet1"::: @@ -1513,9 +1513,9 @@ can store. is the number of elements that are actually in the . + The capacity is the number of elements that the can store. is the number of elements that are actually in the . - The capacity is always greater than or equal to . If exceeds the capacity while adding elements, the capacity is automatically increased by reallocating the internal array before copying the old elements and adding the new elements. + The capacity is always greater than or equal to . If exceeds the capacity while adding elements, the capacity is automatically increased by reallocating the internal array before copying the old elements and adding the new elements. Retrieving the value of this property is an O(1) operation. @@ -1580,11 +1580,11 @@ Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection. - Initially, the enumerator is positioned before the first element in the collection. also brings the enumerator back to this position. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. also brings the enumerator back to this position. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . - returns the same object until either or is called. sets to the next element. + returns the same object until either or is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. To set to the first element of the collection again, you can call followed by . + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. To set to the first element of the collection again, you can call followed by . An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and its behavior is undefined. @@ -1657,7 +1657,7 @@ . + This method is an O(`n`) operation, where `n` is . ]]> @@ -1849,9 +1849,9 @@ method is not visible to COM clients by default, inheriting the class can expose it and can cause undesirable behavior in COM clients. + While the method is not visible to COM clients by default, inheriting the class can expose it and can cause undesirable behavior in COM clients. - This method is an O(`n`) operation, where `n` is . + This method is an O(`n`) operation, where `n` is . ]]> @@ -1916,11 +1916,11 @@ ## Remarks The specified array must be of a compatible type. - This method uses to copy the elements. + This method uses to copy the elements. - While the method is not visible to COM clients by default, inheriting the class can expose it and can cause undesirable behavior in COM clients. + While the method is not visible to COM clients by default, inheriting the class can expose it and can cause undesirable behavior in COM clients. - This method is an O(`n`) operation, where `n` is . + This method is an O(`n`) operation, where `n` is . ]]> @@ -2058,7 +2058,7 @@ Enumerating through a collection is intrinsically not a thread-safe procedure. Even when a collection is synchronized, other threads can still modify the collection, which causes the enumerator to throw an exception. To guarantee thread safety during enumeration, you can either lock the collection during the entire enumeration or catch the exceptions resulting from changes made by other threads. - The following code example shows how to lock the collection using the during the entire enumeration. + The following code example shows how to lock the collection using the during the entire enumeration. :::code language="csharp" source="~/snippets/csharp/System.Collections.Specialized/NameObjectCollectionBase/Overview/remarks.cs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Specialized/NameObjectCollectionBase/Overview/remarks.vb" id="Snippet2"::: diff --git a/xml/System.Collections.Specialized/NameValueCollection.xml b/xml/System.Collections.Specialized/NameValueCollection.xml index ea32a8cdcc3..f3417aaadf2 100644 --- a/xml/System.Collections.Specialized/NameValueCollection.xml +++ b/xml/System.Collections.Specialized/NameValueCollection.xml @@ -78,7 +78,7 @@ `null` is allowed as a key or as a value. > [!CAUTION] -> The method does not distinguish between `null` that's returned because the specified key is not found and `null` that's returned because the value associated with the key is `null`. +> The method does not distinguish between `null` that's returned because the specified key is not found and `null` that's returned because the value associated with the key is `null`. ## Examples :::code language="csharp" source="~/snippets/csharp/System.Collections.Specialized/NameValueCollection/Overview/nvc.cs" id="Snippet1"::: @@ -796,9 +796,9 @@ ## Remarks If a key in `c` already exists in the target instance, the associated value in `c` is added to the existing comma-separated list of values associated with the same key in the target instance. - If already equals the capacity, the capacity of the is increased by automatically reallocating the internal array, and the existing elements are copied to the new array before the new element is added. + If already equals the capacity, the capacity of the is increased by automatically reallocating the internal array, and the existing elements are copied to the new array before the new element is added. - If is less than the capacity, this method is an O(1) operation. If the capacity needs to be increased to accommodate the new element, this method becomes an O(`n`) operation, where `n` is . + If is less than the capacity, this method is an O(1) operation. If the capacity needs to be increased to accommodate the new element, this method becomes an O(`n`) operation, where `n` is . ]]> @@ -861,9 +861,9 @@ ## Remarks If the specified key already exists in the target instance, the specified value is added to the existing comma-separated list of values in the form `"value1,value2,value3"`. The values are associated with the same key in the target instance. - If already equals the capacity, the capacity of the is increased by automatically reallocating the internal array, and the existing elements are copied to the new array before the new element is added. + If already equals the capacity, the capacity of the is increased by automatically reallocating the internal array, and the existing elements are copied to the new array before the new element is added. - If is less than the capacity, this method is an O(1) operation. If the capacity needs to be increased to accommodate the new element, this method becomes an O(`n`) operation, where `n` is . + If is less than the capacity, this method is an O(1) operation. If the capacity needs to be increased to accommodate the new element, this method becomes an O(`n`) operation, where `n` is . ]]> @@ -924,9 +924,9 @@ ## Remarks If the collection is empty, this method returns an empty array, not `null`. - The arrays returned by are cached for better performance and are automatically refreshed when the collection changes. A derived class can invalidate the cached version by calling , thereby forcing the arrays to be recreated. + The arrays returned by are cached for better performance and are automatically refreshed when the collection changes. A derived class can invalidate the cached version by calling , thereby forcing the arrays to be recreated. - This method is an O(`n`) operation, where `n` is . + This method is an O(`n`) operation, where `n` is . ]]> @@ -1044,9 +1044,9 @@ ## Remarks The specified array must be of a compatible type. - This method uses to copy the elements. + This method uses to copy the elements. - This method is an O(`n`) operation, where `n` is . + This method is an O(`n`) operation, where `n` is . ]]> @@ -1494,7 +1494,7 @@ are cached for better performance and are automatically refreshed when the collection changes. A derived class can invalidate the cached version by calling , thereby forcing the arrays to be recreated. + The arrays returned by are cached for better performance and are automatically refreshed when the collection changes. A derived class can invalidate the cached version by calling , thereby forcing the arrays to be recreated. This method is an O(1) operation. @@ -1573,7 +1573,7 @@ This property cannot be set. To set the value at a specified index, use `Item[GetKey(index)]`. - The C# language uses the [this](/dotnet/csharp/language-reference/keywords/this) keyword to define the indexers instead of implementing the property. Visual Basic implements as a [default property](/dotnet/visual-basic/language-reference/modifiers/default), which provides the same indexing functionality. + The C# language uses the [this](/dotnet/csharp/language-reference/keywords/this) keyword to define the indexers instead of implementing the property. Visual Basic implements as a [default property](/dotnet/visual-basic/language-reference/modifiers/default), which provides the same indexing functionality. Retrieving the values at the specified index is an O(`n`) operation, where `n` is the number of values. @@ -1647,14 +1647,14 @@ ## Remarks This property provides the ability to access a specific element in the collection by using the following syntax: `myCollection[name]`. - If the specified key already exists in the collection, setting this property overwrites the existing list of values with the specified value. To append the new value to the existing list of values, use the method. + If the specified key already exists in the collection, setting this property overwrites the existing list of values with the specified value. To append the new value to the existing list of values, use the method. If the specified key does not exist in the collection, setting this property creates a new entry using the specified key and the specified value. > [!CAUTION] > This property returns `null` in the following cases: 1) if the specified key is not found; and 2) if the specified key is found and its associated value is `null`. This property does not distinguish between the two cases. - The C# language uses the [this](/dotnet/csharp/language-reference/keywords/this) keyword to define the indexers instead of implementing the property. Visual Basic implements as a [default property](/dotnet/visual-basic/language-reference/modifiers/default), which provides the same indexing functionality. + The C# language uses the [this](/dotnet/csharp/language-reference/keywords/this) keyword to define the indexers instead of implementing the property. Visual Basic implements as a [default property](/dotnet/visual-basic/language-reference/modifiers/default), which provides the same indexing functionality. Retrieving or setting the values associated with the specified key is an O(`n`) operation, where `n` is the number of values. @@ -1720,7 +1720,7 @@ In collections of contiguous elements, such as lists, the elements that follow the removed element move up to occupy the vacated spot. If the collection is indexed, the indexes of the elements that are moved are also updated. This behavior does not apply to collections where elements are conceptually grouped into buckets, such as a hash table. - This method is an O(`n`) operation, where `n` is . + This method is an O(`n`) operation, where `n` is . ]]> @@ -1779,7 +1779,7 @@ method. + If the specified key already exists in the collection, this method overwrites the existing list of values with the specified value. To append the new value to the existing list of values, use the method. If the specified key does not exist in the collection, this method creates a new entry using the specified key and the specified value. diff --git a/xml/System.Collections.Specialized/OrderedDictionary.xml b/xml/System.Collections.Specialized/OrderedDictionary.xml index e8ebcab8fbe..272bcab62e3 100644 --- a/xml/System.Collections.Specialized/OrderedDictionary.xml +++ b/xml/System.Collections.Specialized/OrderedDictionary.xml @@ -92,7 +92,7 @@ ## Remarks Each element is a key/value pair stored in a object. A key cannot be `null`, but a value can be. - The elements of an are not sorted by the key, unlike the elements of a class. You can access elements either by the key or by the index. + The elements of an are not sorted by the key, unlike the elements of a class. You can access elements either by the key or by the index. The `foreach` statement of the C# language (`For Each` in Visual Basic) returns objects that are of the type of each element in the collection. Since each element of the collection is a key/value pair, the element type is not the type of the key or the type of the value. Instead, the element type is . The following code shows the syntax. @@ -104,7 +104,7 @@ ## Examples - The following code example demonstrates the creation, population and modification of an collection, as well as two techniques to display the contents of the : one using the and properties and the other creating an enumerator through the method. + The following code example demonstrates the creation, population and modification of an collection, as well as two techniques to display the contents of the : one using the and properties and the other creating an enumerator through the method. :::code language="csharp" source="~/snippets/csharp/System.Collections.Specialized/OrderedDictionary/Overview/OrderedDictionary1.cs" id="Snippet00"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Specialized/OrderedDictionary/Overview/OrderedDictionary1.vb" id="Snippet00"::: @@ -169,7 +169,7 @@ collection must be unique. The default comparer is the key's implementation of . + The comparer determines whether two keys are equal. Every key in a collection must be unique. The default comparer is the key's implementation of . @@ -238,7 +238,7 @@ collection must be unique. The default comparer is the key's implementation of . + The comparer determines whether two keys are equal. Every key in a collection must be unique. The default comparer is the key's implementation of . The custom comparer enables such scenarios as doing lookups with case-insensitive strings. @@ -296,7 +296,7 @@ collection must be unique. The default comparer is the key's implementation of . + The comparer determines whether two keys are equal. Every key in a collection must be unique. The default comparer is the key's implementation of . ]]> @@ -359,7 +359,7 @@ collection must be unique. The default comparer is the key's implementation of . + The comparer determines whether two keys are equal. Every key in a collection must be unique. The default comparer is the key's implementation of . The custom comparer enables such scenarios as doing lookups with case-insensitive strings. @@ -425,7 +425,7 @@ collection must be unique. The default comparer is the key's implementation of . + The comparer determines whether two keys are equal. Every key in a collection must be unique. The default comparer is the key's implementation of . ]]> @@ -493,7 +493,7 @@ ## Remarks A key cannot be `null`, but a value can be. - You can also use the property to add new elements by setting the value of a key that does not exist in the collection; however, if the specified key already exists in the , setting the property overwrites the old value. In contrast, the method does not modify existing elements but instead throws . + You can also use the property to add new elements by setting the value of a key that does not exist in the collection; however, if the specified key already exists in the , setting the property overwrites the old value. In contrast, the method does not modify existing elements but instead throws . @@ -554,7 +554,7 @@ method creates a read-only wrapper around the current collection. Changes made to the collection are reflected in the read-only copy. + The method creates a read-only wrapper around the current collection. Changes made to the collection are reflected in the read-only copy. ]]> @@ -607,12 +607,12 @@ method, the property is set to zero and references to other objects from elements of the collection are also released. The capacity is not changed as a result of calling this method. + After calling the method, the property is set to zero and references to other objects from elements of the collection are also released. The capacity is not changed as a result of calling this method. ## Examples - The following code example demonstrates the modification of an collection. In this example, the method is used to empty the , and then the is repopulated. This code is part of a larger code example that can be viewed at . + The following code example demonstrates the modification of an collection. In this example, the method is used to empty the , and then the is repopulated. This code is part of a larger code example that can be viewed at . :::code language="csharp" source="~/snippets/csharp/System.Collections.Specialized/OrderedDictionary/Overview/OrderedDictionary1.cs" id="Snippet03"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Specialized/OrderedDictionary/Overview/OrderedDictionary1.vb" id="Snippet03"::: @@ -674,12 +674,12 @@ property can return a null value if the key does not exist or if the key is `null`. Use the method to determine if a specific key exists in the collection. + Using the property can return a null value if the key does not exist or if the key is `null`. Use the method to determine if a specific key exists in the collection. -This method uses the collection's objects' and methods on `item` to determine whether `item` exists. +This method uses the collection's objects' and methods on `item` to determine whether `item` exists. ## Examples - The following code example demonstrates the modification of an collection. In this example, the method is used to determine if an entry exists before attempting to remove it. This code is part of a larger code example that can be viewed at . + The following code example demonstrates the modification of an collection. In this example, the method is used to determine if an entry exists before attempting to remove it. This code is part of a larger code example that can be viewed at . :::code language="csharp" source="~/snippets/csharp/System.Collections.Specialized/OrderedDictionary/Overview/OrderedDictionary1.cs" id="Snippet02"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Specialized/OrderedDictionary/Overview/OrderedDictionary1.vb" id="Snippet02"::: @@ -740,7 +740,7 @@ This method uses the collection's objects' and method is not guaranteed to preserve the order of the elements in the collection. + The method is not guaranteed to preserve the order of the elements in the collection. ]]> @@ -867,7 +867,7 @@ This method uses the collection's objects' and method to display the contents of the collection to the console. In this example, the method is used to obtain an object that is passed to a method that displays the contents. This code is part of a larger code example that can be viewed at . + The following code example demonstrates the use of the method to display the contents of the collection to the console. In this example, the method is used to obtain an object that is passed to a method that displays the contents. This code is part of a larger code example that can be viewed at . :::code language="csharp" source="~/snippets/csharp/System.Collections.Specialized/OrderedDictionary/Overview/OrderedDictionary1.cs" id="Snippet03"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Specialized/OrderedDictionary/Overview/OrderedDictionary1.vb" id="Snippet03"::: @@ -1009,7 +1009,7 @@ This method uses the collection's objects' and collection. In this example, the method is used to add a new entry to the beginning of the , moving the rest of the entries down. This code is part of a larger code example that can be viewed at . + The following code example demonstrates the modification of an collection. In this example, the method is used to add a new entry to the beginning of the , moving the rest of the entries down. This code is part of a larger code example that can be viewed at . :::code language="csharp" source="~/snippets/csharp/System.Collections.Specialized/OrderedDictionary/Overview/OrderedDictionary1.cs" id="Snippet02"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Specialized/OrderedDictionary/Overview/OrderedDictionary1.vb" id="Snippet02"::: @@ -1161,7 +1161,7 @@ This method uses the collection's objects' and property. Visual Basic implements as a [default property](/dotnet/visual-basic/language-reference/modifiers/default), which provides the same indexing functionality. + The C# language uses the [this](/dotnet/csharp/language-reference/keywords/this) keyword to define the indexers instead of implementing the property. Visual Basic implements as a [default property](/dotnet/visual-basic/language-reference/modifiers/default), which provides the same indexing functionality. ]]> @@ -1234,9 +1234,9 @@ This method uses the collection's objects' and property to add new elements by setting the value of a key that does not exist in the collection (for example, `myCollection["myNonexistentKey"] = myValue`). However, if the specified key already exists in the , setting the property overwrites the old value. In contrast, the method does not modify existing elements. + You can also use the property to add new elements by setting the value of a key that does not exist in the collection (for example, `myCollection["myNonexistentKey"] = myValue`). However, if the specified key already exists in the , setting the property overwrites the old value. In contrast, the method does not modify existing elements. - A key cannot be `null`, but a value can be. To distinguish between `null` that is returned because the specified key is not found and `null` that is returned because the value of the specified key is `null`, use the method to determine if the key exists in the . + A key cannot be `null`, but a value can be. To distinguish between `null` that is returned because the specified key is not found and `null` that is returned because the value of the specified key is `null`, use the method to determine if the key exists in the . @@ -1303,7 +1303,7 @@ This method uses the collection's objects' and collection, and then prints the contents to the console. In this example, the and properties are passed to a method that displays the contents. This code is part of a larger code example that can be viewed at . + The following code example demonstrates the creation and population of an collection, and then prints the contents to the console. In this example, the and properties are passed to a method that displays the contents. This code is part of a larger code example that can be viewed at . :::code language="csharp" source="~/snippets/csharp/System.Collections.Specialized/OrderedDictionary/Overview/OrderedDictionary1.cs" id="Snippet01"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Specialized/OrderedDictionary/Overview/OrderedDictionary1.vb" id="Snippet01"::: @@ -1425,7 +1425,7 @@ This method uses the collection's objects' and collection. In this example, the method is used to remove the entry with the key `"keyToDelete"` from the . This code is part of a larger code example that can be viewed at . + The following code example demonstrates the modification of an collection. In this example, the method is used to remove the entry with the key `"keyToDelete"` from the . This code is part of a larger code example that can be viewed at . :::code language="csharp" source="~/snippets/csharp/System.Collections.Specialized/OrderedDictionary/Overview/OrderedDictionary1.cs" id="Snippet02"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Specialized/OrderedDictionary/Overview/OrderedDictionary1.vb" id="Snippet02"::: @@ -1492,7 +1492,7 @@ This method uses the collection's objects' and collection. In this example, the method is used with the property to remove the last entry from the . This code is part of a larger code example that can be viewed at . + The following code example demonstrates the modification of an collection. In this example, the method is used with the property to remove the last entry from the . This code is part of a larger code example that can be viewed at . :::code language="csharp" source="~/snippets/csharp/System.Collections.Specialized/OrderedDictionary/Overview/OrderedDictionary1.cs" id="Snippet02"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Specialized/OrderedDictionary/Overview/OrderedDictionary1.vb" id="Snippet02"::: @@ -1831,7 +1831,7 @@ This member is an explicit interface member implementation. It can be used only ## Examples - The following code example demonstrates the creation and population of an collection, and then prints the contents to the console. In this example, the and properties are passed to a method that displays the contents. This code is part of a larger code example that can be viewed at . + The following code example demonstrates the creation and population of an collection, and then prints the contents to the console. In this example, the and properties are passed to a method that displays the contents. This code is part of a larger code example that can be viewed at . :::code language="csharp" source="~/snippets/csharp/System.Collections.Specialized/OrderedDictionary/Overview/OrderedDictionary1.cs" id="Snippet01"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Specialized/OrderedDictionary/Overview/OrderedDictionary1.vb" id="Snippet01"::: diff --git a/xml/System.Collections.Specialized/StringCollection.xml b/xml/System.Collections.Specialized/StringCollection.xml index 7817a3c213c..209b3b2d81d 100644 --- a/xml/System.Collections.Specialized/StringCollection.xml +++ b/xml/System.Collections.Specialized/StringCollection.xml @@ -196,7 +196,7 @@ ## Remarks accepts `null` as a valid value and allows duplicate elements. - If is less than the capacity, this method is an O(1) operation. If the capacity needs to be increased to accommodate the new element, this method becomes an O(`n`) operation, where `n` is . + If is less than the capacity, this method is an O(1) operation. If the capacity needs to be increased to accommodate the new element, this method becomes an O(`n`) operation, where `n` is . @@ -270,7 +270,7 @@ ## Remarks accepts `null` as a valid value and allows duplicate elements. - If the can accommodate the new elements without increasing the capacity, this method is an O(`n`) operation, where `n` is the number of elements to be added. If the capacity needs to be increased to accommodate the new elements, this method becomes an O(`n` + `m`) operation, where `n` is the number of elements to be added and `m` is . + If the can accommodate the new elements without increasing the capacity, this method is an O(`n`) operation, where `n` is the number of elements to be added. If the capacity needs to be increased to accommodate the new elements, this method becomes an O(`n` + `m`) operation, where `n` is the number of elements to be added and `m` is . @@ -336,9 +336,9 @@ is set to zero, and references to other objects from elements of the collection are also released. + is set to zero, and references to other objects from elements of the collection are also released. - This method is an O(`n`) operation, where `n` is . + This method is an O(`n`) operation, where `n` is . @@ -404,13 +404,13 @@ method can confirm the existence of a string before performing further operations. + The method can confirm the existence of a string before performing further operations. - This method determines equality by calling . String comparisons are case-sensitive. + This method determines equality by calling . String comparisons are case-sensitive. - This method performs a linear search; therefore, this method is an O(`n`) operation, where `n` is . + This method performs a linear search; therefore, this method is an O(`n`) operation, where `n` is . -This method uses the collection's objects' and methods on `item` to determine whether `item` exists. +This method uses the collection's objects' and methods on `item` to determine whether `item` exists. ## Examples The following code example searches the for an element. @@ -486,7 +486,7 @@ This method uses the collection's objects' and in the same order in which the enumerator of the iterates through the . - This method is an O(`n`) operation, where `n` is . + This method is an O(`n`) operation, where `n` is . @@ -626,11 +626,11 @@ This method uses the collection's objects' and also brings the enumerator back to this position. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. also brings the enumerator back to this position. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . - returns the same object until either or is called. sets to the next element. + returns the same object until either or is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. To set to the first element of the collection again, you can call followed by . + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. To set to the first element of the collection again, you can call followed by . An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and its behavior is undefined. @@ -694,11 +694,11 @@ This method uses the collection's objects' and . String comparisons are case-sensitive. + This method determines equality by calling . String comparisons are case-sensitive. - This method performs a linear search; therefore, this method is an O(`n`) operation, where `n` is . + This method performs a linear search; therefore, this method is an O(`n`) operation, where `n` is . -This method uses the collection's objects' and methods on `item` to determine whether `item` exists. +This method uses the collection's objects' and methods on `item` to determine whether `item` exists. ## Examples The following code example searches the for an element. @@ -765,11 +765,11 @@ This method uses the collection's objects' and . - If `index` is equal to , `value` is added to the end of . + If `index` is equal to , `value` is added to the end of . In collections of contiguous elements, such as lists, the elements that follow the insertion point move down to accommodate the new element. If the collection is indexed, the indexes of the elements that are moved are also updated. This behavior does not apply to collections where elements are conceptually grouped into buckets, such as a hash table. - This method is an O(`n`) operation, where `n` is . + This method is an O(`n`) operation, where `n` is . @@ -905,7 +905,7 @@ This method uses the collection's objects' and during the entire enumeration: + The following code example shows how to lock the collection using the during the entire enumeration: :::code language="csharp" source="~/snippets/csharp/System.Collections.Specialized/StringCollection/Overview/remarks.cs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Specialized/StringCollection/Overview/remarks.vb" id="Snippet2"::: @@ -971,7 +971,7 @@ This method uses the collection's objects' and accepts `null` as a valid value and allows duplicate elements. - The C# language uses the [this](/dotnet/csharp/language-reference/keywords/this) keyword to define the indexers instead of implementing the property. Visual Basic implements as a [default property](/dotnet/visual-basic/language-reference/modifiers/default), which provides the same indexing functionality. + The C# language uses the [this](/dotnet/csharp/language-reference/keywords/this) keyword to define the indexers instead of implementing the property. Visual Basic implements as a [default property](/dotnet/visual-basic/language-reference/modifiers/default), which provides the same indexing functionality. Retrieving the value of this property is an O(1) operation; setting the property is also an O(1) operation. @@ -1035,15 +1035,15 @@ This method uses the collection's objects' and . Only the first occurrence is removed. To remove all occurrences of the specified string, use `RemoveAt(IndexOf(value))` repeatedly while does not return -1. + Duplicate strings are allowed in . Only the first occurrence is removed. To remove all occurrences of the specified string, use `RemoveAt(IndexOf(value))` repeatedly while does not return -1. If the does not contain the specified object, the remains unchanged. No exception is thrown. In collections of contiguous elements, such as lists, the elements that follow the removed element move up to occupy the vacated spot. If the collection is indexed, the indexes of the elements that are moved are also updated. This behavior does not apply to collections where elements are conceptually grouped into buckets, such as a hash table. - This method determines equality by calling . String comparisons are case-sensitive. + This method determines equality by calling . String comparisons are case-sensitive. - This method performs a linear search; therefore, this method is an O(`n`) operation, where `n` is . + This method performs a linear search; therefore, this method is an O(`n`) operation, where `n` is . @@ -1111,7 +1111,7 @@ This method uses the collection's objects' and . + This method is an O(`n`) operation, where `n` is . @@ -1185,11 +1185,11 @@ This method uses the collection's objects' and using the property. The synchronizing code must perform operations on the of the , not directly on the . This ensures proper operation of collections that are derived from other objects. Specifically, it maintains proper synchronization with other threads that might be simultaneously modifying the object. + Derived classes can provide their own synchronized version of the using the property. The synchronizing code must perform operations on the of the , not directly on the . This ensures proper operation of collections that are derived from other objects. Specifically, it maintains proper synchronization with other threads that might be simultaneously modifying the object. Enumerating through a collection is intrinsically not a thread safe procedure. Even when a collection is synchronized, other threads can still modify the collection, which causes the enumerator to throw an exception. To guarantee thread safety during enumeration, you can either lock the collection during the entire enumeration or catch the exceptions resulting from changes made by other threads. - The following code example shows how to lock the collection using the during the entire enumeration: + The following code example shows how to lock the collection using the during the entire enumeration: :::code language="csharp" source="~/snippets/csharp/System.Collections.Specialized/StringCollection/Overview/remarks.cs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Specialized/StringCollection/Overview/remarks.vb" id="Snippet2"::: @@ -1257,9 +1257,9 @@ This method uses the collection's objects' and to copy the elements. + This method uses to copy the elements. - This method is an O(`n`) operation, where `n` is . + This method is an O(`n`) operation, where `n` is . ]]> @@ -1331,13 +1331,13 @@ This method uses the collection's objects' and also brings the enumerator back to this position. At this position, calling throws an exception. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. also brings the enumerator back to this position. At this position, calling throws an exception. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . - returns the same object until either or is called. sets to the next element. + returns the same object until either or is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, calling throws an exception. To set to the first element of the collection again, you can call followed by . + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, calling throws an exception. To set to the first element of the collection again, you can call followed by . - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . If the collection is modified between and , returns the element that it is set to, even if the enumerator is already invalidated. + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . If the collection is modified between and , returns the element that it is set to, even if the enumerator is already invalidated. The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread safe procedure. Even when a collection is synchronized, other threads can still modify the collection, which causes the enumerator to throw an exception. To guarantee thread safety during enumeration, you can either lock the collection during the entire enumeration or catch the exceptions resulting from changes made by other threads. @@ -1404,9 +1404,9 @@ This method uses the collection's objects' and accepts `null` as a valid value and allows duplicate elements. - If already equals the capacity, the capacity of the is increased by automatically reallocating the internal array, and the existing elements are copied to the new array before the new element is added. + If already equals the capacity, the capacity of the is increased by automatically reallocating the internal array, and the existing elements are copied to the new array before the new element is added. - If is less than the capacity, this method is an O(1) operation. If the capacity needs to be increased to accommodate the new element, this method becomes an O(`n`) operation, where `n` is . + If is less than the capacity, this method is an O(1) operation. If the capacity needs to be increased to accommodate the new element, this method becomes an O(`n`) operation, where `n` is . ]]> @@ -1474,11 +1474,11 @@ This method uses the collection's objects' and . + This method determines equality by calling . - This method performs a linear search; therefore, this method is an O(`n`) operation, where `n` is . + This method performs a linear search; therefore, this method is an O(`n`) operation, where `n` is . -This method uses the collection's objects' and methods on `item` to determine whether `item` exists. +This method uses the collection's objects' and methods on `item` to determine whether `item` exists. ]]> @@ -1541,11 +1541,11 @@ This method uses the collection's objects' and is searched forward starting at the first element and ending at the last element. - This method determines equality by calling . + This method determines equality by calling . - This method performs a linear search; therefore, this method is an O(`n`) operation, where `n` is . + This method performs a linear search; therefore, this method is an O(`n`) operation, where `n` is . -This method uses the collection's objects' and methods on `item` to determine whether `item` exists. +This method uses the collection's objects' and methods on `item` to determine whether `item` exists. ]]> @@ -1607,13 +1607,13 @@ This method uses the collection's objects' and already equals the capacity, the capacity of the is increased by automatically reallocating the internal array, and the existing elements are copied to the new array before the new element is added. + If already equals the capacity, the capacity of the is increased by automatically reallocating the internal array, and the existing elements are copied to the new array before the new element is added. - If `index` is equal to , `value` is added to the end of . + If `index` is equal to , `value` is added to the end of . In collections of contiguous elements, such as lists, the elements that follow the insertion point move down to accommodate the new element. If the collection is indexed, the indexes of the elements that are moved are also updated. This behavior does not apply to collections where elements are conceptually grouped into buckets, such as a hash table. - This method is an O(`n`) operation, where `n` is . + This method is an O(`n`) operation, where `n` is . ]]> @@ -1809,7 +1809,7 @@ This method uses the collection's objects' and property. Visual Basic implements as a default property, which provides the same indexing functionality. + The C# language uses the [this](/dotnet/csharp/language-reference/keywords/this) keyword to define the indexers instead of implementing the property. Visual Basic implements as a default property, which provides the same indexing functionality. accepts `null` as a valid value and allows duplicate elements. @@ -1882,9 +1882,9 @@ This method uses the collection's objects' and . + This method determines equality by calling . - This method performs a linear search; therefore, this method is an O(`n`) operation, where `n` is . + This method performs a linear search; therefore, this method is an O(`n`) operation, where `n` is . ]]> diff --git a/xml/System.Collections.Specialized/StringDictionary.xml b/xml/System.Collections.Specialized/StringDictionary.xml index 579e8ddfd27..0411e00924a 100644 --- a/xml/System.Collections.Specialized/StringDictionary.xml +++ b/xml/System.Collections.Specialized/StringDictionary.xml @@ -82,7 +82,7 @@ The key is handled in a case-insensitive manner; it is translated to lowercase before it is used with the string dictionary. - In .NET Framework version 1.0, this class uses culture-sensitive string comparisons. However, in .NET Framework version 1.1 and later, this class uses when comparing strings. For more information about how culture affects comparisons and sorting, see [Performing Culture-Insensitive String Operations](/dotnet/standard/globalization-localization/performing-culture-insensitive-string-operations). + In .NET Framework version 1.0, this class uses culture-sensitive string comparisons. However, in .NET Framework version 1.1 and later, this class uses when comparing strings. For more information about how culture affects comparisons and sorting, see [Performing Culture-Insensitive String Operations](/dotnet/standard/globalization-localization/performing-culture-insensitive-string-operations). @@ -282,7 +282,7 @@ . + This method is an O(`n`) operation, where `n` is . @@ -351,7 +351,7 @@ This method is an O(1) operation. -This method uses the collection's objects' and methods on `item` to determine whether `item` exists. +This method uses the collection's objects' and methods on `item` to determine whether `item` exists. ## Examples The following code example searches for an element in a . @@ -416,11 +416,11 @@ This method uses the collection's objects' and method. + The values of the elements of the StringDictionary are compared to the specified value using the method. - This method performs a linear search; therefore, the average execution time is proportional to . That is, this method is an O(`n`) operation, where `n` is . + This method performs a linear search; therefore, the average execution time is proportional to . That is, this method is an O(`n`) operation, where `n` is . -This method uses the collection's objects' and methods on `item` to determine whether `item` exists. +This method uses the collection's objects' and methods on `item` to determine whether `item` exists. ## Examples The following code example searches for an element in a . @@ -483,11 +483,11 @@ This method uses the collection's objects' and copies objects that can be typecast to . contains both the key and the value. + copies objects that can be typecast to . contains both the key and the value. The elements copied to the are sorted in the same order that the enumerator iterates through the . - This method is an O(`n`) operation, where `n` is . + This method is an O(`n`) operation, where `n` is . @@ -620,11 +620,11 @@ This method uses the collection's objects' and also brings the enumerator back to this position. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. also brings the enumerator back to this position. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . - returns the same object until either or is called. sets to the next element. + returns the same object until either or is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. To set to the first element of the collection again, you can call followed by . + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. To set to the first element of the collection again, you can call followed by . An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and its behavior is undefined. @@ -697,7 +697,7 @@ This method uses the collection's objects' and during the entire enumeration. + The following code example shows how to lock the collection using the during the entire enumeration. :::code language="csharp" source="~/snippets/csharp/System.Collections.Specialized/StringDictionary/Overview/source2.cs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Specialized/StringDictionary/Overview/source2.vb" id="Snippet2"::: @@ -766,9 +766,9 @@ This method uses the collection's objects' and method to determine if the key exists in the list. + A key cannot be `null`, but a value can. To distinguish between `null` that is returned because the specified key is not found and `null` that is returned because the value of the specified key is `null`, use the method to determine if the key exists in the list. - The C# language uses the [this](/dotnet/csharp/language-reference/keywords/this) keyword to define the indexers instead of implementing the property. Visual Basic implements as a default property, which provides the same indexing functionality. + The C# language uses the [this](/dotnet/csharp/language-reference/keywords/this) keyword to define the indexers instead of implementing the property. Visual Basic implements as a default property, which provides the same indexing functionality. Retrieving the value of this property is an O(1) operation; setting the property is also an O(1) operation. @@ -832,7 +832,7 @@ This method uses the collection's objects' and is unspecified, but it is the same order as the associated values in the returned by the method. + The order of the keys in the is unspecified, but it is the same order as the associated values in the returned by the method. The returned is not a static copy; instead, the refers back to the keys in the original . Therefore, changes to the continue to be reflected in the . @@ -965,14 +965,14 @@ This method uses the collection's objects' and using the property. The synchronizing code must perform operations on the of the , not directly on the . This ensures proper operation of collections that are derived from other objects. Specifically, it maintains proper synchronization with other threads that might be simultaneously modifying the object. + Derived classes can provide their own synchronized version of the using the property. The synchronizing code must perform operations on the of the , not directly on the . This ensures proper operation of collections that are derived from other objects. Specifically, it maintains proper synchronization with other threads that might be simultaneously modifying the object. Enumerating through a collection is intrinsically not a thread-safe procedure. Even when a collection is synchronized, other threads can still modify the collection, which causes the enumerator to throw an exception. To guarantee thread safety during enumeration, you can either lock the collection during the entire enumeration or catch the exceptions resulting from changes made by other threads. ## Examples - The following code example shows how to lock the collection using the during the entire enumeration. + The following code example shows how to lock the collection using the during the entire enumeration. :::code language="csharp" source="~/snippets/csharp/System.Collections.Specialized/StringDictionary/Overview/source2.cs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Specialized/StringDictionary/Overview/source2.vb" id="Snippet2"::: @@ -1028,7 +1028,7 @@ This method uses the collection's objects' and is unspecified, but it is the same order as the associated keys in the returned by the method. + The order of the values in the is unspecified, but it is the same order as the associated keys in the returned by the method. The returned is not a static copy; instead, the refers back to the values in the original . Therefore, changes to the continue to be reflected in the . diff --git a/xml/System.Collections.Specialized/StringEnumerator.xml b/xml/System.Collections.Specialized/StringEnumerator.xml index 3acd5714fc5..16132887a36 100644 --- a/xml/System.Collections.Specialized/StringEnumerator.xml +++ b/xml/System.Collections.Specialized/StringEnumerator.xml @@ -61,13 +61,13 @@ Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection. - Initially, the enumerator is positioned before the first element in the collection. also brings the enumerator back to this position. At this position, calling throws an exception. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. also brings the enumerator back to this position. At this position, calling throws an exception. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . - returns the same object until either or is called. sets to the next element. + returns the same object until either or is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, calling throws an exception. To set to the first element of the collection again, you can call followed by . + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, calling throws an exception. To set to the first element of the collection again, you can call followed by . - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . If the collection is modified between and , returns the element that it is set to, even if the enumerator is already invalidated. + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . If the collection is modified between and , returns the element that it is set to, even if the enumerator is already invalidated. The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread-safe procedure. Even when a collection is synchronized, other threads can still modify the collection, which causes the enumerator to throw an exception. To guarantee thread safety during enumeration, you can either lock the collection during the entire enumeration or catch the exceptions resulting from changes made by other threads. @@ -75,7 +75,7 @@ ## Examples The following code example demonstrates several of the properties and methods of . - + :::code language="csharp" source="~/snippets/csharp/System.Collections.Specialized/StringEnumerator/Overview/stringenumerator.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections.Specialized/StringEnumerator/Overview/stringenumerator.vb" id="Snippet1"::: @@ -135,13 +135,13 @@ is called, must be called to advance the enumerator to the first element of the collection before reading the value of ; otherwise, is undefined. + After an enumerator is created or after a is called, must be called to advance the enumerator to the first element of the collection before reading the value of ; otherwise, is undefined. - also throws an exception if the last call to returned `false`, which indicates the end of the collection. + also throws an exception if the last call to returned `false`, which indicates the end of the collection. - does not move the position of the enumerator, and consecutive calls to return the same object until either or is called. + does not move the position of the enumerator, and consecutive calls to return the same object until either or is called. - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . If the collection is modified between and , returns the element that it is set to, even if the enumerator is already invalidated. + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . If the collection is modified between and , returns the element that it is set to, even if the enumerator is already invalidated. @@ -206,11 +206,11 @@ is called, an enumerator is positioned before the first element of the collection, and the first call to moves the enumerator over the first element of the collection. + After an enumerator is created or after a is called, an enumerator is positioned before the first element of the collection, and the first call to moves the enumerator over the first element of the collection. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false` until is called. + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false` until is called. - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . If the collection is modified between and , returns the element that it is set to, even if the enumerator is already invalidated. + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . If the collection is modified between and , returns the element that it is set to, even if the enumerator is already invalidated. @@ -273,7 +273,7 @@ moves the enumerator to the beginning of the collection, before the first element. After , must be called to advance the enumerator to the first element of the collection before reading the value of . + moves the enumerator to the beginning of the collection, before the first element. After , must be called to advance the enumerator to the first element of the collection before reading the value of . diff --git a/xml/System.Collections/ArrayList.xml b/xml/System.Collections/ArrayList.xml index 00351d7bbb2..f5e97f3a9f1 100644 --- a/xml/System.Collections/ArrayList.xml +++ b/xml/System.Collections/ArrayList.xml @@ -119,15 +119,15 @@ ## Remarks > [!IMPORTANT] -> We don't recommend that you use the `ArrayList` class for new development. Instead, we recommend that you use the generic class. +> We don't recommend that you use the `ArrayList` class for new development. Instead, we recommend that you use the generic class. > The class is designed to hold heterogeneous collections of objects. However, it does not always offer the best performance. Instead, we recommend the following: > - For a heterogeneous collection of objects, use the `List` (in C#) or `List(Of Object)` (in Visual Basic) type. -> - For a homogeneous collection of objects, use the class. -> See [Performance Considerations](xref:System.Collections.Generic.List%601#performance-considerations) in the reference topic for a discussion of the relative performance of these classes. See [Non-generic collections shouldn't be used](https://github.com/dotnet/platform-compat/blob/master/docs/DE0006.md) on GitHub for general information on the use of generic instead of non-generic collection types. +> - For a homogeneous collection of objects, use the class. +> See [Performance Considerations](xref:System.Collections.Generic.List`1#performance-considerations) in the reference topic for a discussion of the relative performance of these classes. See [Non-generic collections shouldn't be used](https://github.com/dotnet/platform-compat/blob/master/docs/DE0006.md) on GitHub for general information on the use of generic instead of non-generic collection types. - The is not guaranteed to be sorted. You must sort the by calling its method prior to performing operations (such as ) that require the to be sorted. To maintain a collection that is automatically sorted as new elements are added, you can use the class. + The is not guaranteed to be sorted. You must sort the by calling its method prior to performing operations (such as ) that require the to be sorted. To maintain a collection that is automatically sorted as new elements are added, you can use the class. - The capacity of an is the number of elements the can hold. As elements are added to an , the capacity is automatically increased as required through reallocation. The capacity can be decreased by calling or by setting the property explicitly. + The capacity of an is the number of elements the can hold. As elements are added to an , the capacity is automatically increased as required through reallocation. The capacity can be decreased by calling or by setting the property explicitly. **.NET Framework only:** For very large objects, you can increase the maximum capacity to 2 billion elements on a 64-bit system by setting the `enabled` attribute of the [``](/dotnet/framework/configure-apps/file-schema/runtime/gcallowverylargeobjects-element) configuration element to `true` in the run-time environment. @@ -417,9 +417,9 @@ The wrapper around the . does not copy the contents of . Instead, it only creates an wrapper around ; therefore, changes to the also affect the . + does not copy the contents of . Instead, it only creates an wrapper around ; therefore, changes to the also affect the . -The class provides generic , and methods. This wrapper can be a means to use those methods on ; however, performing these generic operations through the wrapper might be less efficient than operations applied directly on the . +The class provides generic , and methods. This wrapper can be a means to use those methods on ; however, performing these generic operations through the wrapper might be less efficient than operations applied directly on the . This method is an `O(1)` operation. ]]> @@ -493,9 +493,9 @@ This method is an `O(1)` operation. ## Remarks accepts `null` as a valid value and allows duplicate elements. - If already equals , the capacity of the is increased by automatically reallocating the internal array, and the existing elements are copied to the new array before the new element is added. + If already equals , the capacity of the is increased by automatically reallocating the internal array, and the existing elements are copied to the new array before the new element is added. - If is less than , this method is an `O(1)` operation. If the capacity needs to be increased to accommodate the new element, this method becomes an `O(n)` operation, where `n` is . + If is less than , this method is an `O(1)` operation. If the capacity needs to be increased to accommodate the new element, this method becomes an `O(n)` operation, where `n` is . @@ -582,9 +582,9 @@ This method is an `O(1)` operation. The order of the elements in the is preserved in the . - If the new (the current plus the size of the collection) will be greater than , the capacity of the is increased by automatically reallocating the internal array to accommodate the new elements, and the existing elements are copied to the new array before the new elements are added. + If the new (the current plus the size of the collection) will be greater than , the capacity of the is increased by automatically reallocating the internal array to accommodate the new elements, and the existing elements are copied to the new array before the new elements are added. - If the can accommodate the new elements without increasing the , this method is an `O(n)` operation, where `n` is the number of elements to be added. If the capacity needs to be increased to accommodate the new elements, this method becomes an `O(n + m)` operation, where `n` is the number of elements to be added and `m` is . + If the can accommodate the new elements without increasing the , this method is an `O(n)` operation, where `n` is the number of elements to be added. If the capacity needs to be increased to accommodate the new elements, this method becomes an `O(n + m)` operation, where `n` is the number of elements to be added and `m` is . @@ -686,10 +686,10 @@ This method is an `O(1)` operation. If the does not contain the specified value, the method returns a negative integer. You can apply the bitwise complement operation (~) to this negative integer to get the index of the first element that is larger than the search value. When inserting the value into the , this index should be used as the insertion point to maintain the sort order. - This method is an `O(log n)` operation, where `n` is . + This method is an `O(log n)` operation, where `n` is . ## Examples - The following code example shows how to use to locate a specific object in the . + The following code example shows how to use to locate a specific object in the . :::code language="csharp" source="~/snippets/csharp/System.Collections/ArrayList/BinarySearch/source.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections/ArrayList/BinarySearch/source.vb" id="Snippet1"::: @@ -776,7 +776,7 @@ This method is an `O(1)` operation. If the does not contain the specified value, the method returns a negative integer. You can apply the bitwise complement operation (~) to this negative integer to get the index of the first element that is larger than the search value. When inserting the value into the , this index should be used as the insertion point to maintain the sort order. - This method is an `O(log n)` operation, where `n` is . + This method is an `O(log n)` operation, where `n` is . ## Examples The following example creates an of colored animals. The provided performs the string comparison for the binary search. The results of both an iterative search and a binary search are displayed. @@ -945,11 +945,11 @@ This method is an `O(1)` operation. is the number of elements that the can store. is the number of elements that are actually in the . + is the number of elements that the can store. is the number of elements that are actually in the . - is always greater than or equal to . If exceeds while adding elements, the capacity is automatically increased by reallocating the internal array before copying the old elements and adding the new elements. + is always greater than or equal to . If exceeds while adding elements, the capacity is automatically increased by reallocating the internal array before copying the old elements and adding the new elements. - The capacity can be decreased by calling or by setting the property explicitly. When the value of is set explicitly, the internal array is also reallocated to accommodate the specified capacity. + The capacity can be decreased by calling or by setting the property explicitly. When the value of is set explicitly, the internal array is also reallocated to accommodate the specified capacity. Retrieving the value of this property is an `O(1)` operation; setting the property is an `O(n)` operation, where `n` is the new capacity. @@ -1015,11 +1015,11 @@ This method is an `O(1)` operation. is set to zero, and references to other objects from elements of the collection are also released. + is set to zero, and references to other objects from elements of the collection are also released. - remains unchanged. To reset the capacity of the , call or set the property directly. Trimming an empty sets the capacity of the to the default capacity. + remains unchanged. To reset the capacity of the , call or set the property directly. Trimming an empty sets the capacity of the to the default capacity. - This method is an `O(n)` operation, where `n` is . + This method is an `O(n)` operation, where `n` is . @@ -1100,7 +1100,7 @@ This method is an `O(1)` operation. In contrast, a deep copy of a collection copies the elements and everything directly or indirectly referenced by the elements. - This method is an `O(n)` operation, where `n` is . + This method is an `O(n)` operation, where `n` is . ]]> @@ -1166,11 +1166,11 @@ This method is an `O(1)` operation. . + This method performs a linear search; therefore, this method is an `O(n)` operation, where `n` is . - This method determines equality by calling . + This method determines equality by calling . -This method uses the collection's objects' and methods on `item` to determine whether item exists. +This method uses the collection's objects' and methods on `item` to determine whether item exists. ]]> @@ -1244,11 +1244,11 @@ This method uses the collection's objects' and to copy the elements. + This method uses to copy the elements. The elements are copied to the in the same order in which the enumerator iterates through the . - This method is an `O(n)` operation, where `n` is . + This method is an `O(n)` operation, where `n` is . @@ -1332,11 +1332,11 @@ This method uses the collection's objects' and to copy the elements. + This method uses to copy the elements. The elements are copied to the in the same order in which the enumerator iterates through the . - This method is an `O(n)` operation, where `n` is . + This method is an `O(n)` operation, where `n` is . @@ -1423,7 +1423,7 @@ This method uses the collection's objects' and to copy the elements. + This method uses to copy the elements. The elements are copied to the in the same order in which the enumerator iterates through the . @@ -1518,9 +1518,9 @@ This method uses the collection's objects' and is the number of elements that the can store. is the number of elements that are actually in the . + is the number of elements that the can store. is the number of elements that are actually in the . - is always greater than or equal to . If exceeds while adding elements, the capacity is automatically increased by reallocating the internal array before copying the old elements and adding the new elements. + is always greater than or equal to . If exceeds while adding elements, the capacity is automatically increased by reallocating the internal array before copying the old elements and adding the new elements. Retrieving the value of this property is an `O(1)` operation. @@ -1754,11 +1754,11 @@ This method uses the collection's objects' and also brings the enumerator back to this position. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. also brings the enumerator back to this position. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . - returns the same object until either or is called. sets to the next element. + returns the same object until either or is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. To set to the first element of the collection again, you can call followed by . + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. To set to the first element of the collection again, you can call followed by . An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and its behavior is undefined. @@ -1846,11 +1846,11 @@ This method uses the collection's objects' and also brings the enumerator back to this position. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. also brings the enumerator back to this position. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . - returns the same object until either or is called. sets to the next element. + returns the same object until either or is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. To set to the first element of the collection again, you can call followed by . + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. To set to the first element of the collection again, you can call followed by . An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and its behavior is undefined. @@ -2038,11 +2038,11 @@ This method uses the collection's objects' and is searched forward starting at the first element and ending at the last element. - This method performs a linear search; therefore, this method is an `O(n)` operation, where `n` is . + This method performs a linear search; therefore, this method is an `O(n)` operation, where `n` is . - This method determines equality by calling . + This method determines equality by calling . -This method uses the collection's objects' and methods on `item` to determine whether item exists. +This method uses the collection's objects' and methods on `item` to determine whether item exists. ## Examples The following code example shows how to determine the index of the first occurrence of a specified element. @@ -2119,9 +2119,9 @@ This method uses the collection's objects' and . - This method determines equality by calling . + This method determines equality by calling . -This method uses the collection's objects' and methods on `item` to determine whether item exists. +This method uses the collection's objects' and methods on `item` to determine whether item exists. ## Examples The following code example shows how to determine the index of the first occurrence of a specified element. @@ -2202,9 +2202,9 @@ This method uses the collection's objects' and . + This method determines equality by calling . -This method uses the collection's objects' and methods on `item` to determine whether item exists. +This method uses the collection's objects' and methods on `item` to determine whether item exists. ## Examples The following code example shows how to determine the index of the first occurrence of a specified element. @@ -2291,13 +2291,13 @@ This method uses the collection's objects' and accepts `null` as a valid value and allows duplicate elements. - If already equals , the capacity of the is increased by automatically reallocating the internal array, and the existing elements are copied to the new array before the new element is added. + If already equals , the capacity of the is increased by automatically reallocating the internal array, and the existing elements are copied to the new array before the new element is added. - If `index` is equal to , `value` is added to the end of . + If `index` is equal to , `value` is added to the end of . In collections of contiguous elements, such as lists, the elements that follow the insertion point move down to accommodate the new element. If the collection is indexed, the indexes of the elements that are moved are also updated. This behavior does not apply to collections where elements are conceptually grouped into buckets, such as a hash table. - This method is an `O(n)` operation, where `n` is . + This method is an `O(n)` operation, where `n` is . @@ -2383,15 +2383,15 @@ This method uses the collection's objects' and accepts `null` as a valid value and allows duplicate elements. - If the new (the current plus the size of the collection) will be greater than , the capacity of the is increased by automatically reallocating the internal array to accommodate the new elements, and the existing elements are copied to the new array before the new elements are added. + If the new (the current plus the size of the collection) will be greater than , the capacity of the is increased by automatically reallocating the internal array to accommodate the new elements, and the existing elements are copied to the new array before the new elements are added. - If `index` is equal to , the elements are added to the end of . + If `index` is equal to , the elements are added to the end of . The order of the elements in the is preserved in the . In collections of contiguous elements, such as lists, the elements that follow the insertion point move down to accommodate the new element. If the collection is indexed, the indexes of the elements that are moved are also updated. This behavior does not apply to collections where elements are conceptually grouped into buckets, such as a hash table. - This method is an `O(n + m)` operation, where `n` is the number of elements to be added and `m` is . + This method is an `O(n + m)` operation, where `n` is the number of elements to be added and `m` is . @@ -2625,14 +2625,14 @@ This method uses the collection's objects' and , all operations must be done through the wrapper returned by the method. + To guarantee the thread safety of the , all operations must be done through the wrapper returned by the method. Enumerating through a collection is intrinsically not a thread-safe procedure. Even when a collection is synchronized, other threads can still modify the collection, which causes the enumerator to throw an exception. To guarantee thread safety during enumeration, you can either lock the collection during the entire enumeration or catch the exceptions resulting from changes made by other threads. ## Examples - The following code example shows how to lock the collection using the during the entire enumeration. + The following code example shows how to lock the collection using the during the entire enumeration. :::code language="csharp" source="~/snippets/csharp/System.Collections/ArrayList/IsSynchronized/source2.cs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections/ArrayList/IsSynchronized/source2.vb" id="Snippet2"::: @@ -2715,13 +2715,13 @@ This method uses the collection's objects' and returns an , so you may need to cast the returned value to the original type in order to manipulate it. It is important to note that is not a strongly-typed collection. For a strongly-typed alternative, see . + The returns an , so you may need to cast the returned value to the original type in order to manipulate it. It is important to note that is not a strongly-typed collection. For a strongly-typed alternative, see . accepts `null` as a valid value and allows duplicate elements. This property provides the ability to access a specific element in the collection by using the following syntax: `myCollection[index]`. - The C# language uses the [`this`](/dotnet/csharp/language-reference/keywords/this) keyword to define the indexers instead of implementing the property. Visual Basic implements as a default property, which provides the same indexing functionality. + The C# language uses the [`this`](/dotnet/csharp/language-reference/keywords/this) keyword to define the indexers instead of implementing the property. Visual Basic implements as a default property, which provides the same indexing functionality. Retrieving the value of this property is an `O(1)` operation; setting the property is also an `O(1)` operation. @@ -2816,9 +2816,9 @@ This method uses the collection's objects' and is searched backward starting at the last element and ending at the first element. - This method performs a linear search; therefore, this method is an `O(n)` operation, where `n` is . + This method performs a linear search; therefore, this method is an `O(n)` operation, where `n` is . -This method uses the collection's objects' and methods on `item` to determine whether item exists. +This method uses the collection's objects' and methods on `item` to determine whether item exists. ## Examples The following code example shows how to determine the index of the last occurrence of a specified element. @@ -2895,9 +2895,9 @@ This method uses the collection's objects' and to `startIndex`. - This method determines equality by calling . + This method determines equality by calling . -This method uses the collection's objects' and methods on `item` to determine whether item exists. +This method uses the collection's objects' and methods on `item` to determine whether item exists. ## Examples The following code example shows how to determine the index of the last occurrence of a specified element. @@ -2978,9 +2978,9 @@ This method uses the collection's objects' and . + This method determines equality by calling . -This method uses the collection's objects' and methods on `item` to determine whether item exists. +This method uses the collection's objects' and methods on `item` to determine whether item exists. ## Examples The following code example shows how to determine the index of the last occurrence of a specified element. Note that `LastIndexOf` is a backward search; therefore, `count` must be less than or equal to `startIndex` + 1. @@ -3224,9 +3224,9 @@ This method uses the collection's objects' and does not contain the specified object, the remains unchanged. No exception is thrown. - This method performs a linear search; therefore, this method is an `O(n)` operation, where `n` is . + This method performs a linear search; therefore, this method is an `O(n)` operation, where `n` is . - This method determines equality by calling . + This method determines equality by calling . In collections of contiguous elements, such as lists, the elements that follow the removed element move up to occupy the vacated spot. If the collection is indexed, the indexes of the elements that are moved are also updated. This behavior does not apply to collections where elements are conceptually grouped into buckets, such as a hash table. @@ -3313,7 +3313,7 @@ This method uses the collection's objects' and . + This method is an `O(n)` operation, where `n` is . @@ -3400,7 +3400,7 @@ This method uses the collection's objects' and . + This method is an `O(n)` operation, where `n` is . @@ -3576,9 +3576,9 @@ This method uses the collection's objects' and to reverse the order of the elements, such that the element at [i], where i is any index within the range, moves to [j], where j equals `index` + `index` + `count` - i - 1. + This method uses to reverse the order of the elements, such that the element at [i], where i is any index within the range, moves to [j], where j equals `index` + `index` + `count` - i - 1. - This method is an `O(n)` operation, where `n` is . + This method is an `O(n)` operation, where `n` is . @@ -3649,7 +3649,7 @@ This method uses the collection's objects' and to reverse the order of the elements, such that the element at [i], where i is any index within the range, moves to [j], where j equals `index` + `index` + `count` - i - 1. + This method uses to reverse the order of the elements, such that the element at [i], where i is any index within the range, moves to [j], where j equals `index` + `index` + `count` - i - 1. This method is an `O(n)` operation, where `n` is `count`. @@ -3734,7 +3734,7 @@ This method uses the collection's objects' and is preserved in the . - This method is an `O(n)` operation, where `n` is . + This method is an `O(n)` operation, where `n` is . @@ -3821,9 +3821,9 @@ This method uses the collection's objects' and , which uses the QuickSort algorithm. The QuickSort algorithm is a comparison sort (also called an unstable sort), which means that a "less than or equal to" comparison operation determines which of two elements should occur first in the final sorted list. However, if two elements are equal, their original order might not be preserved. In contrast, a stable sort preserves the order of elements that are equal. To perform a stable sort, you must implement a custom interface to use with the other overloads of this method. + This method uses , which uses the QuickSort algorithm. The QuickSort algorithm is a comparison sort (also called an unstable sort), which means that a "less than or equal to" comparison operation determines which of two elements should occur first in the final sorted list. However, if two elements are equal, their original order might not be preserved. In contrast, a stable sort preserves the order of elements that are equal. To perform a stable sort, you must implement a custom interface to use with the other overloads of this method. - On average, this method is an `O(n log n)` operation, where `n` is ; in the worst case it is an ``O(n^2)`` operation. + On average, this method is an `O(n log n)` operation, where `n` is ; in the worst case it is an ``O(n^2)`` operation. @@ -3898,11 +3898,11 @@ This method uses the collection's objects' and method to sort a list of objects with a custom comparer that implements the interface. If you pass `null` for `comparer`, this method uses the implementation of each element. In this case, you must make sure that the objects contained in the list implement the interface or an exception will occur. + Use the method to sort a list of objects with a custom comparer that implements the interface. If you pass `null` for `comparer`, this method uses the implementation of each element. In this case, you must make sure that the objects contained in the list implement the interface or an exception will occur. In addition, using the implementation means the list performs a comparison sort (also called an unstable sort); that is, if two elements are equal, their order might not be preserved. In contrast, a stable sort preserves the order of elements that are equal. To perform a stable sort, you must implement a custom interface. - On average, this method is an `O(n log n)` operation, where `n` is ; in the worst case it is an ``O(n^2)`` operation. + On average, this method is an `O(n log n)` operation, where `n` is ; in the worst case it is an ``O(n^2)`` operation. @@ -4082,7 +4082,7 @@ This method uses the collection's objects' and during the entire enumeration. + The following code example shows how to lock the collection using the during the entire enumeration. :::code language="csharp" source="~/snippets/csharp/System.Collections/ArrayList/IsSynchronized/source2.cs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections/ArrayList/IsSynchronized/source2.vb" id="Snippet2"::: @@ -4164,7 +4164,7 @@ This method uses the collection's objects' and during the entire enumeration. + The following code example shows how to lock the collection using the during the entire enumeration. :::code language="csharp" source="~/snippets/csharp/System.Collections/ArrayList/IsSynchronized/source2.cs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections/ArrayList/IsSynchronized/source2.vb" id="Snippet2"::: @@ -4233,14 +4233,14 @@ This method uses the collection's objects' and , use the method. However, derived classes can provide their own synchronized version of the using the property. The synchronizing code must perform operations on the of the , not directly on the . This ensures proper operation of collections that are derived from other objects. Specifically, it maintains proper synchronization with other threads that might be simultaneously modifying the object. + To create a synchronized version of the , use the method. However, derived classes can provide their own synchronized version of the using the property. The synchronizing code must perform operations on the of the , not directly on the . This ensures proper operation of collections that are derived from other objects. Specifically, it maintains proper synchronization with other threads that might be simultaneously modifying the object. Enumerating through a collection is intrinsically not a thread-safe procedure. Even when a collection is synchronized, other threads can still modify the collection, which causes the enumerator to throw an exception. To guarantee thread safety during enumeration, you can either lock the collection during the entire enumeration or catch the exceptions resulting from changes made by other threads. ## Examples - The following code example shows how to lock the collection using the during the entire enumeration. + The following code example shows how to lock the collection using the during the entire enumeration. :::code language="csharp" source="~/snippets/csharp/System.Collections/ArrayList/IsSynchronized/source2.cs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections/ArrayList/IsSynchronized/source2.vb" id="Snippet2"::: @@ -4315,7 +4315,7 @@ This method uses the collection's objects' and , which is an `O(n)` operation, where `n` is . + The elements are copied using , which is an `O(n)` operation, where `n` is . ]]> @@ -4388,7 +4388,7 @@ This method uses the collection's objects' and object will be cast to the specified in the `type` parameter. - The elements are copied using , which is an `O(n)` operation, where `n` is . + The elements are copied using , which is an `O(n)` operation, where `n` is . @@ -4459,9 +4459,9 @@ This method uses the collection's objects' and to its initial state, call the method before calling . Trimming an empty sets the capacity of the to the default capacity. + To reset a to its initial state, call the method before calling . Trimming an empty sets the capacity of the to the default capacity. - This method is an `O(n)` operation, where `n` is . + This method is an `O(n)` operation, where `n` is . diff --git a/xml/System.Collections/BitArray.xml b/xml/System.Collections/BitArray.xml index a955d95e6d1..1caaf590ddf 100644 --- a/xml/System.Collections/BitArray.xml +++ b/xml/System.Collections/BitArray.xml @@ -82,7 +82,7 @@ class is a collection class in which the capacity is always the same as the count. Elements are added to a by increasing the property; elements are deleted by decreasing the property. The size of a is controlled by the client; indexing past the end of the throws an . The class provides methods that are not found in other collections, including those that allow multiple elements to be modified at once using a filter, such as , , , , and . + The class is a collection class in which the capacity is always the same as the count. Elements are added to a by increasing the property; elements are deleted by decreasing the property. The size of a is controlled by the client; indexing past the end of the throws an . The class provides methods that are not found in other collections, including those that allow multiple elements to be modified at once using a filter, such as , , , , and . The class is a structure that provides the same functionality as , but with faster performance. is faster because it is a value type and therefore allocated on the stack, whereas is a reference type and, therefore, allocated on the heap. @@ -498,7 +498,7 @@ ## Remarks The bitwise AND operation returns `true` if both operands are `true`, and returns `false` if one or both operands are `false`. - This method is an `O(n)` operation, where `n` is . + This method is an `O(n)` operation, where `n` is . @@ -567,7 +567,7 @@ In contrast, a deep copy of a collection copies the elements and everything directly or indirectly referenced by the elements. - This method is an `O(n)` operation, where `n` is . + This method is an `O(n)` operation, where `n` is . ]]> @@ -626,7 +626,7 @@ ## Remarks The specified array must be of a compatible type. Only `bool`, `int`, and `byte` types of arrays are supported. - This method is an `O(n)` operation, where `n` is . + This method is an `O(n)` operation, where `n` is . @@ -699,7 +699,7 @@ and return the same value. can be set to a specific value, but is read-only. + and return the same value. can be set to a specific value, but is read-only. Retrieving the value of this property is an `O(1)` operation. @@ -829,11 +829,11 @@ Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection. - Initially, the enumerator is positioned before the first element in the collection. also brings the enumerator back to this position. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. also brings the enumerator back to this position. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . - returns the same object until either or is called. sets to the next element. + returns the same object until either or is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. To set to the first element of the collection again, you can call followed by . + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. To set to the first element of the collection again, you can call followed by . An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and its behavior is undefined. @@ -1018,7 +1018,7 @@ ## Examples - The following code example shows how to lock the collection using the during the entire enumeration. + The following code example shows how to lock the collection using the during the entire enumeration. :::code language="csharp" source="~/snippets/csharp/System.Collections/BitArray/Overview/source2.cs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections/BitArray/Overview/source2.vb" id="Snippet2"::: @@ -1081,7 +1081,7 @@ ## Remarks This property provides the ability to access a specific element in the collection by using the following syntax: `myCollection[index]`. - The C# language uses the [this](/dotnet/csharp/language-reference/keywords/this) keyword to define the indexers instead of implementing the property. Visual Basic implements as a default property, which provides the same indexing functionality. + The C# language uses the [this](/dotnet/csharp/language-reference/keywords/this) keyword to define the indexers instead of implementing the property. Visual Basic implements as a default property, which provides the same indexing functionality. Retrieving the value of this property is an `O(1)` operation; setting the property is also an `O(1)` operation. @@ -1192,11 +1192,11 @@ The current is updated and returned. and return the same value. can be set to a specific value, but is read-only. + and return the same value. can be set to a specific value, but is read-only. - If is set to a value that is less than , the is truncated and the elements after the index `value` -1 are deleted. + If is set to a value that is less than , the is truncated and the elements after the index `value` -1 are deleted. - If is set to a value that is greater than , the new elements are set to `false`. + If is set to a value that is greater than , the new elements are set to `false`. Retrieving the value of this property is an `O(1)` operation. Setting this property is an `O(n)` operation. @@ -1251,7 +1251,7 @@ The current is updated and returned. . + This method is an `O(n)` operation, where `n` is . @@ -1316,7 +1316,7 @@ The current is updated and returned. ## Remarks The bitwise OR operation returns `true` if one or both operands are `true`, and returns `false` if both operands are `false`. - This method is an `O(n)` operation, where `n` is . + This method is an `O(n)` operation, where `n` is . @@ -1531,7 +1531,7 @@ The current is updated and returned. . + This method is an `O(n)` operation, where `n` is . @@ -1591,14 +1591,14 @@ The current is updated and returned. using the property. The synchronizing code must perform operations on the of the , not directly on the . This ensures proper operation of collections that are derived from other objects. Specifically, it maintains proper synchronization with other threads that might be simultaneously modifying the object. + Derived classes can provide their own synchronized version of the using the property. The synchronizing code must perform operations on the of the , not directly on the . This ensures proper operation of collections that are derived from other objects. Specifically, it maintains proper synchronization with other threads that might be simultaneously modifying the object. Enumerating through a collection is intrinsically not a thread-safe procedure. Even when a collection is synchronized, other threads can still modify the collection, which causes the enumerator to throw an exception. To guarantee thread safety during enumeration, you can either lock the collection during the entire enumeration or catch the exceptions resulting from changes made by other threads. ## Examples - The following code example shows how to lock the collection using the during the entire enumeration. + The following code example shows how to lock the collection using the during the entire enumeration. :::code language="csharp" source="~/snippets/csharp/System.Collections/BitArray/Overview/source2.cs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections/BitArray/Overview/source2.vb" id="Snippet2"::: @@ -1812,7 +1812,7 @@ This member is an explicit interface member implementation. It can be used only ## Remarks The bitwise exclusive OR operation returns `true` if exactly one operand is `true`, and returns `false` if both operands have the same Boolean value. - This method is an `O(n)` operation, where `n` is . + This method is an `O(n)` operation, where `n` is . diff --git a/xml/System.Collections/CaseInsensitiveComparer.xml b/xml/System.Collections/CaseInsensitiveComparer.xml index 0d5faf1ad6b..8b39089bff7 100644 --- a/xml/System.Collections/CaseInsensitiveComparer.xml +++ b/xml/System.Collections/CaseInsensitiveComparer.xml @@ -78,7 +78,7 @@ The class is the default implementation of the interface and performs case-sensitive string comparisons. - The objects used as keys by a are required to override the method (or the interface) and the method (or the interface). The implementation of both methods or interfaces must handle case sensitivity the same way; otherwise, the might behave incorrectly. For example, when creating a , you must use this class with the class or any case-insensitive implementation. + The objects used as keys by a are required to override the method (or the interface) and the method (or the interface). The implementation of both methods or interfaces must handle case sensitivity the same way; otherwise, the might behave incorrectly. For example, when creating a , you must use this class with the class or any case-insensitive implementation. String comparisons might have different results depending on the culture. For more information on culture-specific comparisons, see the namespace and [Globalization and Localization](/dotnet/standard/globalization-localization/). @@ -86,7 +86,7 @@ The class is the default implementation of th ## Examples The following code example creates a case-sensitive hash table and a case-insensitive hash table and demonstrates the difference in their behavior, even if both contain the same elements. - + :::code language="csharp" source="~/snippets/csharp/System.Collections/CaseInsensitiveComparer/Overview/caseinsensitive.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections/CaseInsensitiveComparer/Overview/caseinsensitive.vb" id="Snippet1"::: @@ -153,7 +153,7 @@ The class is the default implementation of th instance is created using this constructor, the of the current thread is saved. Comparison procedures use the saved culture to determine the sort order and casing rules; therefore, string comparisons might have different results depending on the culture. For more information on culture-specific comparisons, see the namespace and [Globalization and Localization](/dotnet/standard/globalization-localization/). + When the instance is created using this constructor, the of the current thread is saved. Comparison procedures use the saved culture to determine the sort order and casing rules; therefore, string comparisons might have different results depending on the culture. For more information on culture-specific comparisons, see the namespace and [Globalization and Localization](/dotnet/standard/globalization-localization/). @@ -308,7 +308,7 @@ The class is the default implementation of th to compare the strings with the casing ignored; otherwise, it uses the implementation of either object. That is, if `a` implements , then this method returns the result of `a`. `CompareTo` (`b`); otherwise, if `b` implements , then it returns the negated result of `b`. `CompareTo` (`a`). + If `a` and `b` are both strings, this method uses to compare the strings with the casing ignored; otherwise, it uses the implementation of either object. That is, if `a` implements , then this method returns the result of `a`. `CompareTo` (`b`); otherwise, if `b` implements , then it returns the negated result of `b`. `CompareTo` (`a`). Comparing `null` with any type is allowed and does not generate an exception when using . When sorting, `null` is considered to be less than any other object. @@ -373,7 +373,7 @@ The class is the default implementation of th instance is created using the parameterless constructor, the of the current thread is saved. Comparison procedures use the saved culture to determine the sort order and casing rules; therefore, string comparisons might have different results depending on the culture. For more information on culture-specific comparisons, see the namespace and [Globalization and Localization](/dotnet/standard/globalization-localization/). + When the instance is created using the parameterless constructor, the of the current thread is saved. Comparison procedures use the saved culture to determine the sort order and casing rules; therefore, string comparisons might have different results depending on the culture. For more information on culture-specific comparisons, see the namespace and [Globalization and Localization](/dotnet/standard/globalization-localization/). ]]> @@ -427,7 +427,7 @@ The class is the default implementation of th to determine the sort order and casing rules. String comparisons might have different results depending on the culture. For more information on culture-specific comparisons, see the namespace and [Globalization and Localization](/dotnet/standard/globalization-localization/). + Comparison procedures use the to determine the sort order and casing rules. String comparisons might have different results depending on the culture. For more information on culture-specific comparisons, see the namespace and [Globalization and Localization](/dotnet/standard/globalization-localization/). diff --git a/xml/System.Collections/CaseInsensitiveHashCodeProvider.xml b/xml/System.Collections/CaseInsensitiveHashCodeProvider.xml index a3bf20810a9..b88c8596d33 100644 --- a/xml/System.Collections/CaseInsensitiveHashCodeProvider.xml +++ b/xml/System.Collections/CaseInsensitiveHashCodeProvider.xml @@ -82,7 +82,7 @@ > [!IMPORTANT] > We don't recommend that you use the `CaseInsensitiveHashCodeProvider` class for new development. Instead, we recommend that you use the object returned by the , , or property. - The objects used as keys by a are required to override the method (or the interface) and the method (or the interface). The implementation of both methods or interfaces must handle case sensitivity the same way; otherwise, the might behave incorrectly. For example, when creating a , you must use this class with the class or any case-insensitive implementation. + The objects used as keys by a are required to override the method (or the interface) and the method (or the interface). The implementation of both methods or interfaces must handle case sensitivity the same way; otherwise, the might behave incorrectly. For example, when creating a , you must use this class with the class or any case-insensitive implementation. ]]> @@ -143,7 +143,7 @@ instance is created using this constructor, the of the current thread is saved. Comparison procedures use the saved culture to determine the casing rules; therefore, hash code comparisons might have different results depending on the culture. For more information on culture-specific comparisons, see the namespace and [Globalization and Localization](/dotnet/standard/globalization-localization/). + When the instance is created using this constructor, the of the current thread is saved. Comparison procedures use the saved culture to determine the casing rules; therefore, hash code comparisons might have different results depending on the culture. For more information on culture-specific comparisons, see the namespace and [Globalization and Localization](/dotnet/standard/globalization-localization/). ]]> @@ -249,7 +249,7 @@ instance is created using the parameterless constructor, the of the current thread is saved. Comparison procedures use the saved culture to determine the casing rules; therefore, hash code comparisons might have different results depending on the culture. For more information on culture-specific comparisons, see the namespace and [Globalization and Localization](/dotnet/standard/globalization-localization/). + When the instance is created using the parameterless constructor, the of the current thread is saved. Comparison procedures use the saved culture to determine the casing rules; therefore, hash code comparisons might have different results depending on the culture. For more information on culture-specific comparisons, see the namespace and [Globalization and Localization](/dotnet/standard/globalization-localization/). ]]> @@ -300,7 +300,7 @@ to determine the casing rules. Hash code comparisons might have different results depending on the culture. For more information on culture-specific comparisons, see the namespace and [Globalization and Localization](/dotnet/standard/globalization-localization/). + Comparison procedures use the to determine the casing rules. Hash code comparisons might have different results depending on the culture. For more information on culture-specific comparisons, see the namespace and [Globalization and Localization](/dotnet/standard/globalization-localization/). ]]> diff --git a/xml/System.Collections/CollectionBase.xml b/xml/System.Collections/CollectionBase.xml index 147b19c3c2b..1cd45091ae4 100644 --- a/xml/System.Collections/CollectionBase.xml +++ b/xml/System.Collections/CollectionBase.xml @@ -79,7 +79,7 @@ ## Remarks > [!IMPORTANT] -> We don't recommend that you use the `CollectionBase` class for new development. Instead, we recommend that you use the generic class. For more information, see [Non-generic collections shouldn't be used](https://github.com/dotnet/platform-compat/blob/master/docs/DE0006.md) on GitHub. +> We don't recommend that you use the `CollectionBase` class for new development. Instead, we recommend that you use the generic class. For more information, see [Non-generic collections shouldn't be used](https://github.com/dotnet/platform-compat/blob/master/docs/DE0006.md) on GitHub. A instance is always modifiable. See for a read-only version of this class. @@ -277,11 +277,11 @@ A instance is always modifiable. See is the number of elements that the can store. is the number of elements that are actually in the . + is the number of elements that the can store. is the number of elements that are actually in the . - is always greater than or equal to . If exceeds while adding elements, the capacity is automatically increased by reallocating the internal array before copying the old elements and adding the new elements. + is always greater than or equal to . If exceeds while adding elements, the capacity is automatically increased by reallocating the internal array before copying the old elements and adding the new elements. - The capacity can be decreased by setting the property explicitly. When the value of is set explicitly, the internal array is also reallocated to accommodate the specified capacity. + The capacity can be decreased by setting the property explicitly. When the value of is set explicitly, the internal array is also reallocated to accommodate the specified capacity. Retrieving the value of this property is an `O(1)` operation; setting the property is an `O(n)` operation, where `n` is the new capacity. @@ -341,11 +341,11 @@ A instance is always modifiable. See is set to zero. + is set to zero. - This method is an `O(n)` operation, where `n` is . + This method is an `O(n)` operation, where `n` is . - To perform custom actions before or after the collection is cleared, override the protected or method. + To perform custom actions before or after the collection is cleared, override the protected or method. ]]> @@ -462,17 +462,17 @@ A instance is always modifiable. See also brings the enumerator back to this position. At this position, calling throws an exception. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. also brings the enumerator back to this position. At this position, calling throws an exception. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . - returns the same object until either or is called. sets to the next element. + returns the same object until either or is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, calling throws an exception. To set to the first element of the collection again, you can call followed by . + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, calling throws an exception. To set to the first element of the collection again, you can call followed by . - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . If the collection is modified between and , returns the element that it is set to, even if the enumerator is already invalidated. + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . If the collection is modified between and , returns the element that it is set to, even if the enumerator is already invalidated. The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread safe procedure. Even when a collection is synchronized, other threads can still modify the collection, which causes the enumerator to throw an exception. To guarantee thread safety during enumeration, you can either lock the collection during the entire enumeration or catch the exceptions resulting from changes made by other threads. - While the method is not visible to COM clients by default, inheriting the class can expose it and can cause undesirable behavior in COM clients. + While the method is not visible to COM clients by default, inheriting the class can expose it and can cause undesirable behavior in COM clients. This method is an `O(1)` operation. @@ -1333,7 +1333,7 @@ A instance is always modifiable. See . + This method is an `O(n)` operation, where `n` is . ]]> @@ -1403,9 +1403,9 @@ A instance is always modifiable. See to copy the elements. + This method uses to copy the elements. - This method is an `O(n)` operation, where `n` is . + This method is an `O(n)` operation, where `n` is . ]]> @@ -1475,7 +1475,7 @@ A instance is always modifiable. See during the entire enumeration: + The following code example shows how to lock the collection using the during the entire enumeration: :::code language="csharp" source="~/snippets/csharp/System.Collections/CollectionBase/Overview/remarks.cs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections/CollectionBase/Overview/remarks.vb" id="Snippet2"::: @@ -1535,11 +1535,11 @@ A instance is always modifiable. See using the property. The synchronizing code must perform operations on the of the , not directly on the . This ensures proper operation of collections that are derived from other objects. Specifically, it maintains proper synchronization with other threads that might be simultaneously modifying the object. + Derived classes can provide their own synchronized version of the using the property. The synchronizing code must perform operations on the of the , not directly on the . This ensures proper operation of collections that are derived from other objects. Specifically, it maintains proper synchronization with other threads that might be simultaneously modifying the object. Enumerating through a collection is intrinsically not a thread safe procedure. Even when a collection is synchronized, other threads can still modify the collection, which causes the enumerator to throw an exception. To guarantee thread safety during enumeration, you can either lock the collection during the entire enumeration or catch the exceptions resulting from changes made by other threads. - The following code example shows how to lock the collection using the during the entire enumeration: + The following code example shows how to lock the collection using the during the entire enumeration: :::code language="csharp" source="~/snippets/csharp/System.Collections/CollectionBase/Overview/remarks.cs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections/CollectionBase/Overview/remarks.vb" id="Snippet2"::: @@ -1603,9 +1603,9 @@ A instance is always modifiable. See already equals the capacity, the capacity of the list is doubled by automatically reallocating the internal array and copying the existing elements to the new array before the new element is added. + If already equals the capacity, the capacity of the list is doubled by automatically reallocating the internal array and copying the existing elements to the new array before the new element is added. - If is less than the capacity, this method is an `O(1)` operation. If the capacity needs to be increased to accommodate the new element, this method becomes an `O(n)` operation, where `n` is . + If is less than the capacity, this method is an `O(1)` operation. If the capacity needs to be increased to accommodate the new element, this method becomes an `O(n)` operation, where `n` is . @@ -1683,11 +1683,11 @@ A instance is always modifiable. See . + This method performs a linear search; therefore, this method is an `O(n)` operation, where `n` is . - This method determines equality by calling . + This method determines equality by calling . -This method uses the collection's objects' and methods on `item` to determine whether item exists. +This method uses the collection's objects' and methods on `item` to determine whether item exists. ## Examples The following code example implements the class and uses that implementation to create a collection of objects. @@ -1753,11 +1753,11 @@ This method uses the collection's objects' and . + This method performs a linear search; therefore, this method is an `O(n)` operation, where `n` is . - This method determines equality by calling . + This method determines equality by calling . -This method uses the collection's objects' and methods on `item` to determine whether item exists. +This method uses the collection's objects' and methods on `item` to determine whether item exists. ## Examples The following code example implements the class and uses that implementation to create a collection of objects. @@ -1824,13 +1824,13 @@ This method uses the collection's objects' and already equals the capacity, the capacity of the list is doubled by automatically reallocating the internal array before the new element is inserted. + If already equals the capacity, the capacity of the list is doubled by automatically reallocating the internal array before the new element is inserted. - If `index` is equal to , `value` is added to the end of . + If `index` is equal to , `value` is added to the end of . In collections of contiguous elements, such as lists, the elements that follow the insertion point move down to accommodate the new element. If the collection is indexed, the indexes of the elements that are moved are also updated. This behavior does not apply to collections where elements are conceptually grouped into buckets, such as a hash table. - This method is an `O(n)` operation, where `n` is . + This method is an `O(n)` operation, where `n` is . @@ -2116,9 +2116,9 @@ This method uses the collection's objects' and does not contain the specified object, the remains unchanged. No exception is thrown. - This method performs a linear search; therefore, this method is an `O(n)` operation, where `n` is . + This method performs a linear search; therefore, this method is an `O(n)` operation, where `n` is . - This method determines equality by calling . + This method determines equality by calling . In collections of contiguous elements, such as lists, the elements that follow the removed element move up to occupy the vacated spot. If the collection is indexed, the indexes of the elements that are moved are also updated. This behavior does not apply to collections where elements are conceptually grouped into buckets, such as a hash table. diff --git a/xml/System.Collections/Comparer.xml b/xml/System.Collections/Comparer.xml index 315be9e2b85..69ee891574a 100644 --- a/xml/System.Collections/Comparer.xml +++ b/xml/System.Collections/Comparer.xml @@ -101,14 +101,14 @@ interface. The class is the implementation of the interface that performs case-insensitive string comparisons. is the generic equivalent of this class. + This class is the default implementation of the interface. The class is the implementation of the interface that performs case-insensitive string comparisons. is the generic equivalent of this class. - Comparison procedures use the of the current thread unless otherwise specified. String comparisons might have different results depending on the culture. For more information on culture-specific comparisons, see the namespace and [Globalization and Localization](/dotnet/standard/globalization-localization/). + Comparison procedures use the of the current thread unless otherwise specified. String comparisons might have different results depending on the culture. For more information on culture-specific comparisons, see the namespace and [Globalization and Localization](/dotnet/standard/globalization-localization/). ## Examples - The following code example shows how returns different values depending on the culture associated with the . + The following code example shows how returns different values depending on the culture associated with the . :::code language="csharp" source="~/snippets/csharp/System.Collections/Comparer/Overview/comparercultures.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections/Comparer/Overview/comparercultures.vb" id="Snippet1"::: @@ -180,7 +180,7 @@ ## Examples - The following code example shows how returns different values depending on the culture associated with the . + The following code example shows how returns different values depending on the culture associated with the . :::code language="csharp" source="~/snippets/csharp/System.Collections/Comparer/Overview/comparercultures.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections/Comparer/Overview/comparercultures.vb" id="Snippet1"::: @@ -281,7 +281,7 @@ ## Examples - The following code example shows how returns different values depending on the culture associated with the . + The following code example shows how returns different values depending on the culture associated with the . :::code language="csharp" source="~/snippets/csharp/System.Collections/Comparer/Overview/comparercultures.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections/Comparer/Overview/comparercultures.vb" id="Snippet1"::: @@ -349,7 +349,7 @@ of the current thread to determine the sort order and casing rules. String comparisons might have different results depending on the culture. For more information on culture-specific comparisons, see the namespace and [Globalization and Localization](/dotnet/standard/globalization-localization/). + Comparison procedures use the of the current thread to determine the sort order and casing rules. String comparisons might have different results depending on the culture. For more information on culture-specific comparisons, see the namespace and [Globalization and Localization](/dotnet/standard/globalization-localization/). ]]> @@ -407,12 +407,12 @@ to determine the sort order and casing rules. String comparisons might have different results depending on the culture. For more information on culture-specific comparisons, see the namespace and [Globalization and Localization](/dotnet/standard/globalization-localization/). + Comparison procedures use the to determine the sort order and casing rules. String comparisons might have different results depending on the culture. For more information on culture-specific comparisons, see the namespace and [Globalization and Localization](/dotnet/standard/globalization-localization/). ## Examples - The following code example shows how returns different values depending on the culture associated with the . + The following code example shows how returns different values depending on the culture associated with the . :::code language="csharp" source="~/snippets/csharp/System.Collections/Comparer/Overview/comparercultures.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections/Comparer/Overview/comparercultures.vb" id="Snippet1"::: @@ -494,7 +494,7 @@ method is not visible to COM clients by default, inheriting the class can expose it and can cause undesirable behavior in COM clients. + While the method is not visible to COM clients by default, inheriting the class can expose it and can cause undesirable behavior in COM clients. ]]> diff --git a/xml/System.Collections/DictionaryBase.xml b/xml/System.Collections/DictionaryBase.xml index 1455cc240b4..93e2a8095ff 100644 --- a/xml/System.Collections/DictionaryBase.xml +++ b/xml/System.Collections/DictionaryBase.xml @@ -79,19 +79,19 @@ ## Remarks > [!IMPORTANT] -> We don't recommend that you use the `DictionaryBase` class for new development. Instead, we recommend that you use the generic or class . For more information, see [Non-generic collections shouldn't be used](https://github.com/dotnet/platform-compat/blob/master/docs/DE0006.md) on GitHub. +> We don't recommend that you use the `DictionaryBase` class for new development. Instead, we recommend that you use the generic or class . For more information, see [Non-generic collections shouldn't be used](https://github.com/dotnet/platform-compat/blob/master/docs/DE0006.md) on GitHub. The C# [foreach](/dotnet/csharp/language-reference/keywords/foreach-in) statement and the Visual Basic [For Each](/dotnet/visual-basic/language-reference/statements/for-each-next-statement) statement return an object of the type of the elements in the collection. Since each element of the is a key/value pair, the element type is not the type of the key or the type of the value. Instead, the element type is . The `foreach` statement is a wrapper around the enumerator, which only allows reading from, not writing to, the collection. > [!NOTE] -> Because keys can be inherited and their behavior changed, their absolute uniqueness cannot be guaranteed by comparisons using the method. +> Because keys can be inherited and their behavior changed, their absolute uniqueness cannot be guaranteed by comparisons using the method. ## Examples - The following code example implements the class and uses that implementation to create a dictionary of keys and values that have a of 5 characters or less. + The following code example implements the class and uses that implementation to create a dictionary of keys and values that have a of 5 characters or less. :::code language="csharp" source="~/snippets/csharp/System.Collections/DictionaryBase/Overview/dictionarybase.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections/DictionaryBase/Overview/dictionarybase.vb" id="Snippet1"::: @@ -209,9 +209,9 @@ The C# [foreach](/dotnet/csharp/language-reference/keywords/foreach-in) statemen is set to zero, and references to other objects from elements of the collection are also released. + is set to zero, and references to other objects from elements of the collection are also released. - This method is an `O(n)` operation, where `n` is . + This method is an `O(n)` operation, where `n` is . ]]> @@ -272,7 +272,7 @@ The C# [foreach](/dotnet/csharp/language-reference/keywords/foreach-in) statemen ## Remarks The elements are copied to the in the same order in which the enumerator iterates through the . - This method is an `O(n)` operation, where `n` is . + This method is an `O(n)` operation, where `n` is . ]]> @@ -398,7 +398,7 @@ The C# [foreach](/dotnet/csharp/language-reference/keywords/foreach-in) statemen ## Examples - The following code example implements the class and uses that implementation to create a dictionary of keys and values that have a of 5 characters or less. + The following code example implements the class and uses that implementation to create a dictionary of keys and values that have a of 5 characters or less. :::code language="csharp" source="~/snippets/csharp/System.Collections/DictionaryBase/Overview/dictionarybase.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections/DictionaryBase/Overview/dictionarybase.vb" id="Snippet1"::: @@ -460,11 +460,11 @@ The C# [foreach](/dotnet/csharp/language-reference/keywords/foreach-in) statemen Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection. - Initially, the enumerator is positioned before the first element in the collection. also brings the enumerator back to this position. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. also brings the enumerator back to this position. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . - returns the same object until either or is called. sets to the next element. + returns the same object until either or is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. To set to the first element of the collection again, you can call followed by . + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. To set to the first element of the collection again, you can call followed by . An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and its behavior is undefined. @@ -475,7 +475,7 @@ The C# [foreach](/dotnet/csharp/language-reference/keywords/foreach-in) statemen ## Examples - The following code example implements the class and uses that implementation to create a dictionary of keys and values that have a of 5 characters or less. + The following code example implements the class and uses that implementation to create a dictionary of keys and values that have a of 5 characters or less. :::code language="csharp" source="~/snippets/csharp/System.Collections/DictionaryBase/Overview/dictionarybase.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections/DictionaryBase/Overview/dictionarybase.vb" id="Snippet1"::: @@ -806,7 +806,7 @@ The C# [foreach](/dotnet/csharp/language-reference/keywords/foreach-in) statemen ## Examples - The following code example implements the class and uses that implementation to create a dictionary of keys and values that have a of 5 characters or less. + The following code example implements the class and uses that implementation to create a dictionary of keys and values that have a of 5 characters or less. :::code language="csharp" source="~/snippets/csharp/System.Collections/DictionaryBase/Overview/dictionarybase.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections/DictionaryBase/Overview/dictionarybase.vb" id="Snippet1"::: @@ -967,7 +967,7 @@ The C# [foreach](/dotnet/csharp/language-reference/keywords/foreach-in) statemen ## Examples - The following code example implements the class and uses that implementation to create a dictionary of keys and values that have a of 5 characters or less. + The following code example implements the class and uses that implementation to create a dictionary of keys and values that have a of 5 characters or less. :::code language="csharp" source="~/snippets/csharp/System.Collections/DictionaryBase/Overview/dictionarybase.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections/DictionaryBase/Overview/dictionarybase.vb" id="Snippet1"::: @@ -1129,7 +1129,7 @@ The C# [foreach](/dotnet/csharp/language-reference/keywords/foreach-in) statemen ## Examples - The following code example implements the class and uses that implementation to create a dictionary of keys and values that have a of 5 characters or less. + The following code example implements the class and uses that implementation to create a dictionary of keys and values that have a of 5 characters or less. :::code language="csharp" source="~/snippets/csharp/System.Collections/DictionaryBase/Overview/dictionarybase.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections/DictionaryBase/Overview/dictionarybase.vb" id="Snippet1"::: @@ -1292,7 +1292,7 @@ The C# [foreach](/dotnet/csharp/language-reference/keywords/foreach-in) statemen ## Examples - The following code example implements the class and uses that implementation to create a dictionary of keys and values that have a of 5 characters or less. + The following code example implements the class and uses that implementation to create a dictionary of keys and values that have a of 5 characters or less. :::code language="csharp" source="~/snippets/csharp/System.Collections/DictionaryBase/Overview/dictionarybase.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections/DictionaryBase/Overview/dictionarybase.vb" id="Snippet1"::: @@ -1500,14 +1500,14 @@ The C# [foreach](/dotnet/csharp/language-reference/keywords/foreach-in) statemen ## Remarks An object that has no correlation between its state and its hash code value should typically not be used as the key. For example, objects are better than objects for use as keys. - You can also use the property to add new elements by setting the value of a key that does not exist in the ; for example, `myCollection["myNonexistentKey"] = myValue`. However, if the specified key already exists in the , setting the property overwrites the old value. In contrast, the method does not modify existing elements. + You can also use the property to add new elements by setting the value of a key that does not exist in the ; for example, `myCollection["myNonexistentKey"] = myValue`. However, if the specified key already exists in the , setting the property overwrites the old value. In contrast, the method does not modify existing elements. This method is an `O(1)` operation. ## Examples - The following code example implements the class and uses that implementation to create a dictionary of keys and values that have a of 5 characters or less. + The following code example implements the class and uses that implementation to create a dictionary of keys and values that have a of 5 characters or less. :::code language="csharp" source="~/snippets/csharp/System.Collections/DictionaryBase/Overview/dictionarybase.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections/DictionaryBase/Overview/dictionarybase.vb" id="Snippet1"::: @@ -1582,10 +1582,10 @@ The C# [foreach](/dotnet/csharp/language-reference/keywords/foreach-in) statemen ## Remarks This method is an `O(1)` operation. -This method uses the collection's objects' and methods on `key` to determine whether `item` exists. +This method uses the collection's objects' and methods on `key` to determine whether `item` exists. ## Examples - The following code example implements the class and uses that implementation to create a dictionary of keys and values that have a of 5 characters or less. + The following code example implements the class and uses that implementation to create a dictionary of keys and values that have a of 5 characters or less. :::code language="csharp" source="~/snippets/csharp/System.Collections/DictionaryBase/Overview/dictionarybase.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections/DictionaryBase/Overview/dictionarybase.vb" id="Snippet1"::: @@ -1776,14 +1776,14 @@ This method uses the collection's objects' and property to add new elements by setting the value of a key that does not exist in the ; for example, `myCollection["myNonexistentKey"] = myValue`. However, if the specified key already exists in the , setting the property overwrites the old value. In contrast, the method does not modify existing elements. + You can also use the property to add new elements by setting the value of a key that does not exist in the ; for example, `myCollection["myNonexistentKey"] = myValue`. However, if the specified key already exists in the , setting the property overwrites the old value. In contrast, the method does not modify existing elements. Retrieving the value of this property is an `O(1)` operation; setting the property is also an `O(1)` operation. ## Examples - The following code example implements the class and uses that implementation to create a dictionary of keys and values that have a of 5 characters or less. + The following code example implements the class and uses that implementation to create a dictionary of keys and values that have a of 5 characters or less. :::code language="csharp" source="~/snippets/csharp/System.Collections/DictionaryBase/Overview/dictionarybase.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections/DictionaryBase/Overview/dictionarybase.vb" id="Snippet1"::: @@ -1926,7 +1926,7 @@ This method uses the collection's objects' and class and uses that implementation to create a dictionary of keys and values that have a of 5 characters or less. + The following code example implements the class and uses that implementation to create a dictionary of keys and values that have a of 5 characters or less. :::code language="csharp" source="~/snippets/csharp/System.Collections/DictionaryBase/Overview/dictionarybase.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections/DictionaryBase/Overview/dictionarybase.vb" id="Snippet1"::: @@ -2066,13 +2066,13 @@ This method uses the collection's objects' and also brings the enumerator back to this position. At this position, calling throws an exception. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. also brings the enumerator back to this position. At this position, calling throws an exception. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . - returns the same object until either or is called. sets to the next element. + returns the same object until either or is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, calling throws an exception. To set to the first element of the collection again, you can call followed by . + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, calling throws an exception. To set to the first element of the collection again, you can call followed by . - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . If the collection is modified between and , returns the element that it is set to, even if the enumerator is already invalidated. + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . If the collection is modified between and , returns the element that it is set to, even if the enumerator is already invalidated. The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread-safe procedure. Even when a collection is synchronized, other threads can still modify the collection, which causes the enumerator to throw an exception. To guarantee thread safety during enumeration, you can either lock the collection during the entire enumeration or catch the exceptions resulting from changes made by other threads. diff --git a/xml/System.Collections/DictionaryEntry.xml b/xml/System.Collections/DictionaryEntry.xml index 3543112bdcc..5d4189665b9 100644 --- a/xml/System.Collections/DictionaryEntry.xml +++ b/xml/System.Collections/DictionaryEntry.xml @@ -69,10 +69,10 @@ method returns an instance of this type. +The method returns an instance of this type. > [!IMPORTANT] -> We don't recommend that you use the `DictionaryEntry` structure for new development. Instead, we recommend that you use a generic structure along with the class. For more information, see [Non-generic collections shouldn't be used](https://github.com/dotnet/platform-compat/blob/master/docs/DE0006.md) on GitHub. +> We don't recommend that you use the `DictionaryEntry` structure for new development. Instead, we recommend that you use a generic structure along with the class. For more information, see [Non-generic collections shouldn't be used](https://github.com/dotnet/platform-compat/blob/master/docs/DE0006.md) on GitHub. The C# [foreach](/dotnet/csharp/language-reference/keywords/foreach-in) statement and the Visual Basic [For Each](/dotnet/visual-basic/language-reference/statements/for-each-next-statement) statement require the type of each element in the collection. Since each element of the is a key/value pair, the element type is not the type of the key or the type of the value. Instead, the element type is . For example: diff --git a/xml/System.Collections/Hashtable.xml b/xml/System.Collections/Hashtable.xml index f12eb671752..2f365c58e47 100644 --- a/xml/System.Collections/Hashtable.xml +++ b/xml/System.Collections/Hashtable.xml @@ -127,11 +127,11 @@ Each element is a key/value pair stored in a object. A key cannot be `null`, but a value can be. > [!IMPORTANT] -> We don't recommend that you use the `Hashtable` class for new development. Instead, we recommend that you use the generic class. For more information, see [Non-generic collections shouldn't be used](https://github.com/dotnet/platform-compat/blob/master/docs/DE0006.md) on GitHub. +> We don't recommend that you use the `Hashtable` class for new development. Instead, we recommend that you use the generic class. For more information, see [Non-generic collections shouldn't be used](https://github.com/dotnet/platform-compat/blob/master/docs/DE0006.md) on GitHub. - The objects used as keys by a are required to override the method (or the interface) and the method (or the interface). The implementation of both methods and interfaces must handle case sensitivity the same way; otherwise, the might behave incorrectly. For example, when creating a , you must use the class (or any case-insensitive implementation) with the class (or any case-insensitive implementation). + The objects used as keys by a are required to override the method (or the interface) and the method (or the interface). The implementation of both methods and interfaces must handle case sensitivity the same way; otherwise, the might behave incorrectly. For example, when creating a , you must use the class (or any case-insensitive implementation) with the class (or any case-insensitive implementation). - Furthermore, these methods must produce the same results when called with the same parameters while the key exists in the . An alternative is to use a constructor with an parameter. If key equality were simply reference equality, the inherited implementation of and would suffice. + Furthermore, these methods must produce the same results when called with the same parameters while the key exists in the . An alternative is to use a constructor with an parameter. If key equality were simply reference equality, the inherited implementation of and would suffice. Key objects must be immutable as long as they are used as keys in the . @@ -141,7 +141,7 @@ Each element is a key/value pair stored in a , the actual load factor of the increases. When the actual load factor reaches the specified load factor, the number of buckets in the is automatically increased to the smallest prime number that is larger than twice the current number of buckets. - Each key object in the must provide its own hash function, which can be accessed by calling . However, any object implementing can be passed to a constructor, and that hash function is used for all objects in the table. + Each key object in the must provide its own hash function, which can be accessed by calling . However, any object implementing can be passed to a constructor, and that hash function is used for all objects in the table. The capacity of a is the number of elements the can hold. As elements are added to a , the capacity is automatically increased as required through reallocation. @@ -154,10 +154,10 @@ Each element is a key/value pair stored in a can cause the elements to become reordered, it is not possible to continue enumeration without calling the method. + Because serializing and deserializing an enumerator for a can cause the elements to become reordered, it is not possible to continue enumeration without calling the method. > [!NOTE] -> Because keys can be inherited and their behavior changed, their absolute uniqueness cannot be guaranteed by comparisons using the method. +> Because keys can be inherited and their behavior changed, their absolute uniqueness cannot be guaranteed by comparisons using the method. @@ -245,9 +245,9 @@ Each element is a key/value pair stored in a object. The default hash code provider is the key's implementation of . + The hash code provider dispenses hash codes for keys in the object. The default hash code provider is the key's implementation of . - The comparer determines whether two keys are equal. Every key in a must be unique. The default comparer is the key's implementation of . + The comparer determines whether two keys are equal. Every key in a must be unique. The default comparer is the key's implementation of . This constructor is an `O(1)` operation. @@ -322,9 +322,9 @@ Each element is a key/value pair stored in a object. The default hash code provider is the key's implementation of . + The hash code provider dispenses hash codes for keys in the object. The default hash code provider is the key's implementation of . - The comparer determines whether two keys are equal. Every key in a must be unique. The default comparer is the key's implementation of . + The comparer determines whether two keys are equal. Every key in a must be unique. The default comparer is the key's implementation of . The elements of the new are sorted in the same order in which the enumerator iterates through the object. @@ -408,11 +408,11 @@ Each element is a key/value pair stored in a object includes both the hash code provider and the comparer. If an is used in the constructor, the objects used as keys in the object are not required to override the and methods. + The object includes both the hash code provider and the comparer. If an is used in the constructor, the objects used as keys in the object are not required to override the and methods. - The hash code provider dispenses hash codes for keys in the . The default hash code provider is the key's implementation of . + The hash code provider dispenses hash codes for keys in the . The default hash code provider is the key's implementation of . - The comparer determines whether two keys are equal. Every key in a must be unique. The default comparer is the key's implementation of . + The comparer determines whether two keys are equal. Every key in a must be unique. The default comparer is the key's implementation of . The enables scenarios such as doing lookups with case-insensitive strings. @@ -488,9 +488,9 @@ Each element is a key/value pair stored in a . The default hash code provider is the key's implementation of . + The hash code provider dispenses hash codes for keys in the . The default hash code provider is the key's implementation of . - The comparer determines whether two keys are equal. Every key in a must be unique. The default comparer is the key's implementation of . + The comparer determines whether two keys are equal. Every key in a must be unique. The default comparer is the key's implementation of . This constructor is an `O(n)` operation, where `n` is `capacity`. @@ -580,11 +580,11 @@ Each element is a key/value pair stored in a object includes both the hash code provider and the comparer. If an is used in the constructor, the objects used as keys in the object are not required to override the and methods. + The object includes both the hash code provider and the comparer. If an is used in the constructor, the objects used as keys in the object are not required to override the and methods. - The hash code provider dispenses hash codes for keys in the . The default hash code provider is the key's implementation of . + The hash code provider dispenses hash codes for keys in the . The default hash code provider is the key's implementation of . - The comparer determines whether two keys are equal. Every key in a must be unique. The default comparer is the key's implementation of . + The comparer determines whether two keys are equal. Every key in a must be unique. The default comparer is the key's implementation of . The enables scenarios such as doing lookups with case-insensitive strings. @@ -667,9 +667,9 @@ Each element is a key/value pair stored in a object. The default hash code provider is the key's implementation of . + The hash code provider dispenses hash codes for keys in the object. The default hash code provider is the key's implementation of . - The comparer determines whether two keys are equal. Every key in a must be unique. The default comparer is the key's implementation of . + The comparer determines whether two keys are equal. Every key in a must be unique. The default comparer is the key's implementation of . The elements of the new are sorted in the same order in which the enumerator iterates through the object. @@ -778,9 +778,9 @@ Each element is a key/value pair stored in a object. The default hash code provider is the key's implementation of . + The hash code provider dispenses hash codes for keys in the object. The default hash code provider is the key's implementation of . - The comparer determines whether two keys are equal. Every key in a must be unique. The default comparer is the key's implementation of . + The comparer determines whether two keys are equal. Every key in a must be unique. The default comparer is the key's implementation of . The custom hash code provider and the custom comparer enable scenarios such as doing lookups with case-insensitive strings. @@ -857,11 +857,11 @@ Each element is a key/value pair stored in a object includes both the hash code provider and the comparer. If an is used in the constructor, the objects used as keys in the are not required to override the and methods. + The object includes both the hash code provider and the comparer. If an is used in the constructor, the objects used as keys in the are not required to override the and methods. - The hash code provider dispenses hash codes for keys in the . The default hash code provider is the key's implementation of . + The hash code provider dispenses hash codes for keys in the . The default hash code provider is the key's implementation of . - The comparer determines whether two keys are equal. Every key in a must be unique. The default comparer is the key's implementation of . + The comparer determines whether two keys are equal. Every key in a must be unique. The default comparer is the key's implementation of . The enables scenarios such as doing lookups with case-insensitive strings. @@ -941,9 +941,9 @@ Each element is a key/value pair stored in a . The default hash code provider is the key's implementation of . + The hash code provider dispenses hash codes for keys in the . The default hash code provider is the key's implementation of . - The comparer determines whether two keys are equal. Every key in a must be unique. The default comparer is the key's implementation of . + The comparer determines whether two keys are equal. Every key in a must be unique. The default comparer is the key's implementation of . This constructor is an `O(n)` operation, where `n` is the `capacity` parameter. @@ -1040,13 +1040,13 @@ Each element is a key/value pair stored in a object. The default hash code provider is the key's implementation of . + The hash code provider dispenses hash codes for keys in the object. The default hash code provider is the key's implementation of . - The comparer determines whether two keys are equal. Every key in a must be unique. The default comparer is the key's implementation of . + The comparer determines whether two keys are equal. Every key in a must be unique. The default comparer is the key's implementation of . - This constructor is an `O(n)` operation, where `n` is . + This constructor is an `O(n)` operation, where `n` is . - Because serializing and deserializing an enumerator for a can cause the elements to become reordered, it is not possible to continue enumeration without calling the method. + Because serializing and deserializing an enumerator for a can cause the elements to become reordered, it is not possible to continue enumeration without calling the method. ]]> @@ -1145,9 +1145,9 @@ Each element is a key/value pair stored in a object. The default hash code provider is the key's implementation of . + The hash code provider dispenses hash codes for keys in the object. The default hash code provider is the key's implementation of . - The comparer determines whether two keys are equal. Every key in a must be unique. The default comparer is the key's implementation of . + The comparer determines whether two keys are equal. Every key in a must be unique. The default comparer is the key's implementation of . The custom hash code provider and the custom comparer enable scenarios such as doing lookups with case-insensitive strings. @@ -1238,11 +1238,11 @@ Each element is a key/value pair stored in a object includes both the hash code provider and the comparer. If an is used in the constructor, the objects used as keys in the object are not required to override the and methods. + The object includes both the hash code provider and the comparer. If an is used in the constructor, the objects used as keys in the object are not required to override the and methods. - The hash code provider dispenses hash codes for keys in the . The default hash code provider is the key's implementation of . + The hash code provider dispenses hash codes for keys in the . The default hash code provider is the key's implementation of . - The comparer determines whether two keys are equal. Every key in a must be unique. The default comparer is the key's implementation of . + The comparer determines whether two keys are equal. Every key in a must be unique. The default comparer is the key's implementation of . The enables scenarios such as doing lookups with case-insensitive strings. @@ -1349,9 +1349,9 @@ Each element is a key/value pair stored in a . The default hash code provider is the key's implementation of . + The hash code provider dispenses hash codes for keys in the . The default hash code provider is the key's implementation of . - The comparer determines whether two keys are equal. Every key in a must be unique. The default comparer is the key's implementation of . + The comparer determines whether two keys are equal. Every key in a must be unique. The default comparer is the key's implementation of . The custom hash code provider and the custom comparer enable scenarios such as doing lookups with case-insensitive strings. @@ -1432,11 +1432,11 @@ Each element is a key/value pair stored in a object includes both the hash code provider and the comparer. If an is used in the constructor, the objects used as keys in the are not required to override the and methods. + The object includes both the hash code provider and the comparer. If an is used in the constructor, the objects used as keys in the are not required to override the and methods. - The hash code provider dispenses hash codes for keys in the . The default hash code provider is the key's implementation of . + The hash code provider dispenses hash codes for keys in the . The default hash code provider is the key's implementation of . - The comparer determines whether two keys are equal. Every key in a must be unique. The default comparer is the key's implementation of . + The comparer determines whether two keys are equal. Every key in a must be unique. The default comparer is the key's implementation of . The enables scenarios such as doing lookups with case-insensitive strings. @@ -1552,9 +1552,9 @@ Each element is a key/value pair stored in a object. The default hash code provider is the key's implementation of . + The hash code provider dispenses hash codes for keys in the object. The default hash code provider is the key's implementation of . - The comparer determines whether two keys are equal. Every key in a must be unique. The default comparer is the key's implementation of . + The comparer determines whether two keys are equal. Every key in a must be unique. The default comparer is the key's implementation of . The custom hash code provider and the custom comparer enable scenarios such as doing lookups with case-insensitive strings. @@ -1654,9 +1654,9 @@ Each element is a key/value pair stored in a . The default hash code provider is the key's implementation of . + The hash code provider dispenses hash codes for keys in the . The default hash code provider is the key's implementation of . - The comparer determines whether two keys are equal. Every key in a must be unique. The default comparer is the key's implementation of . + The comparer determines whether two keys are equal. Every key in a must be unique. The default comparer is the key's implementation of . The custom hash code provider and the custom comparer enable scenarios such as doing lookups with case-insensitive strings. @@ -1757,9 +1757,9 @@ Each element is a key/value pair stored in a property to add new elements by setting the value of a key that does not exist in the ; for example, `myCollection["myNonexistentKey"] = myValue`. However, if the specified key already exists in the , setting the property overwrites the old value. In contrast, the method does not modify existing elements. + You can also use the property to add new elements by setting the value of a key that does not exist in the ; for example, `myCollection["myNonexistentKey"] = myValue`. However, if the specified key already exists in the , setting the property overwrites the old value. In contrast, the method does not modify existing elements. - If is less than the capacity of the , this method is an `O(1)` operation. If the capacity needs to be increased to accommodate the new element, this method becomes an `O(n)` operation, where `n` is . + If is less than the capacity of the , this method is an `O(1)` operation. If the capacity needs to be increased to accommodate the new element, this method becomes an `O(n)` operation, where `n` is . @@ -1844,9 +1844,9 @@ Each element is a key/value pair stored in a is set to zero, and references to other objects from elements of the collection are also released. The capacity remains unchanged. + is set to zero, and references to other objects from elements of the collection are also released. The capacity remains unchanged. - This method is an `O(n)` operation, where `n` is . + This method is an `O(n)` operation, where `n` is . @@ -1923,7 +1923,7 @@ Each element is a key/value pair stored in a clone has the same count, the same capacity, the same implementation, and the same implementation as the original . - This method is an `O(n)` operation, where `n` is . + This method is an `O(n)` operation, where `n` is . ]]> @@ -2067,11 +2067,11 @@ Each element is a key/value pair stored in a implements . It behaves exactly as . + implements . It behaves exactly as . This method is an `O(1)` operation. -This method uses the collection's objects' and methods on `item` to determine whether item exists. +This method uses the collection's objects' and methods on `item` to determine whether item exists. ## Examples The following example shows how to determine whether the contains a specific element. @@ -2142,11 +2142,11 @@ This method uses the collection's objects' and . + This method behaves exactly as . This method is an `O(1)` operation. -This method uses the collection's objects' and methods on `item` to determine whether item exists. +This method uses the collection's objects' and methods on `item` to determine whether item exists. ## Examples The following example shows how to determine whether the contains a specific element. @@ -2219,11 +2219,11 @@ This method uses the collection's objects' and are compared to the specified value using the method. + The values of the elements of the are compared to the specified value using the method. - This method performs a linear search; therefore, this method is an `O(n)` operation, where `n` is . + This method performs a linear search; therefore, this method is an `O(n)` operation, where `n` is . -This method uses the collection's objects' and methods on `item` to determine whether item exists. +This method uses the collection's objects' and methods on `item` to determine whether item exists. ## Examples The following example shows how to determine whether the contains a specific element. @@ -2302,7 +2302,7 @@ This method uses the collection's objects' and , use `Hashtable.Values.CopyTo`. - This method is an `O(n)` operation, where `n` is . + This method is an `O(n)` operation, where `n` is . @@ -2447,7 +2447,7 @@ This method uses the collection's objects' and includes both the comparer and the hash code provider. If an is used in the constructor, the objects used as keys in the are not required to override the and methods. + The includes both the comparer and the hash code provider. If an is used in the constructor, the objects used as keys in the are not required to override the and methods. Retrieving the value of this property is an `O(1)` operation. @@ -2524,11 +2524,11 @@ This method uses the collection's objects' and also brings the enumerator back to this position. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. also brings the enumerator back to this position. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . - returns the same object until either or is called. sets to the next element. + returns the same object until either or is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. To set to the first element of the collection again, you can call followed by . + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. To set to the first element of the collection again, you can call followed by . An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and its behavior is undefined. @@ -2536,12 +2536,12 @@ This method uses the collection's objects' and can cause the elements to become reordered, it is not possible to continue enumeration without calling the method. + Because serializing and deserializing an enumerator for a can cause the elements to become reordered, it is not possible to continue enumeration without calling the method. ## Examples - The following example compares the use of and `foreach` to enumerate the contents of a . + The following example compares the use of and `foreach` to enumerate the contents of a . :::code language="csharp" source="~/snippets/csharp/System.Collections/Hashtable/GetEnumerator/source2.cs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections/Hashtable/GetEnumerator/source2.vb" id="Snippet2"::: @@ -2613,7 +2613,7 @@ This method uses the collection's objects' and implementation, this method uses that hash code provider; otherwise, it uses the implementation of `key`. + If the hash table was created with a specific implementation, this method uses that hash code provider; otherwise, it uses the implementation of `key`. This method is an `O(1)` operation. @@ -2697,7 +2697,7 @@ This method uses the collection's objects' and . + This method is an `O(n)` operation, where `n` is . ]]> @@ -2967,11 +2967,11 @@ This method uses the collection's objects' and can support one writer and multiple readers concurrently. To support multiple writers, all operations must be done through the wrapper returned by the method. + A can support one writer and multiple readers concurrently. To support multiple writers, all operations must be done through the wrapper returned by the method. Enumerating through a collection is intrinsically not a thread safe procedure. Even when a collection is synchronized, other threads can still modify the collection, which causes the enumerator to throw an exception. To guarantee thread safety during enumeration, you can either lock the collection during the entire enumeration or catch the exceptions resulting from changes made by other threads. - The following code example shows how to lock the collection using the during the entire enumeration: + The following code example shows how to lock the collection using the during the entire enumeration: :::code language="csharp" source="~/snippets/csharp/System.Collections/Hashtable/IsSynchronized/remarks.cs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections/Hashtable/IsSynchronized/remarks.vb" id="Snippet2"::: @@ -3061,13 +3061,13 @@ This method uses the collection's objects' and property to add new elements by setting the value of a key that does not exist in the ; for example, `myCollection["myNonexistentKey"] = myValue`. However, if the specified key already exists in the , setting the property overwrites the old value. In contrast, the method does not modify existing elements. + You can also use the property to add new elements by setting the value of a key that does not exist in the ; for example, `myCollection["myNonexistentKey"] = myValue`. However, if the specified key already exists in the , setting the property overwrites the old value. In contrast, the method does not modify existing elements. - A key cannot be `null`, but a value can be. To distinguish between `null` that is returned because the specified key is not found and `null` that is returned because the value of the specified key is `null`, use the method or the method to determine if the key exists in the list. + A key cannot be `null`, but a value can be. To distinguish between `null` that is returned because the specified key is not found and `null` that is returned because the value of the specified key is `null`, use the method or the method to determine if the key exists in the list. Retrieving the value of this property is an `O(1)` operation; setting the property is also an `O(1)` operation. - The C# language uses the [`this`](/dotnet/csharp/language-reference/keywords/this) keyword to define the indexers instead of implementing the property. Visual Basic implements as a default property, which provides the same indexing functionality. + The C# language uses the [`this`](/dotnet/csharp/language-reference/keywords/this) keyword to define the indexers instead of implementing the property. Visual Basic implements as a default property, which provides the same indexing functionality. ]]> @@ -3147,7 +3147,7 @@ This method uses the collection's objects' and implementation, this method uses that comparer; that is, (`item`, `key`). Otherwise, it uses `item.Equals(key)`. + If the hash table was created with a specific implementation, this method uses that comparer; that is, (`item`, `key`). Otherwise, it uses `item.Equals(key)`. This method is an `O(1)` operation. @@ -3224,7 +3224,7 @@ This method uses the collection's objects' and is unspecified, but it is the same order as the associated values in the returned by the method. + The order of the keys in the is unspecified, but it is the same order as the associated values in the returned by the method. The returned is not a static copy; instead, the refers back to the keys in the original . Therefore, changes to the continue to be reflected in the . @@ -3292,9 +3292,9 @@ This method uses the collection's objects' and . + This method is an `O(n)` operation, where `n` is . - Because serializing and deserializing an enumerator for a can cause the elements to become reordered, it is not possible to continue enumeration without calling the method. + Because serializing and deserializing an enumerator for a can cause the elements to become reordered, it is not possible to continue enumeration without calling the method. ]]> @@ -3446,11 +3446,11 @@ This method uses the collection's objects' and method is thread safe for multiple readers and writers. Furthermore, the synchronized wrapper ensures that there is only one writer writing at a time. + The method is thread safe for multiple readers and writers. Furthermore, the synchronized wrapper ensures that there is only one writer writing at a time. Enumerating through a collection is intrinsically not a thread-safe procedure. Even when a collection is synchronized, other threads can still modify the collection, which causes the enumerator to throw an exception. To guarantee thread safety during enumeration, you can either lock the collection during the entire enumeration or catch the exceptions resulting from changes made by other threads. - The following code example shows how to lock the collection using the during the entire enumeration: + The following code example shows how to lock the collection using the during the entire enumeration: :::code language="csharp" source="~/snippets/csharp/System.Collections/Hashtable/IsSynchronized/remarks.cs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections/Hashtable/IsSynchronized/remarks.vb" id="Snippet2"::: @@ -3527,11 +3527,11 @@ This method uses the collection's objects' and , use the method. However, derived classes can provide their own synchronized version of the using the property. The synchronizing code must perform operations on the of the , not directly on the . This ensures proper operation of collections that are derived from other objects. Specifically, it maintains proper synchronization with other threads that might be simultaneously modifying the object. + To create a synchronized version of the , use the method. However, derived classes can provide their own synchronized version of the using the property. The synchronizing code must perform operations on the of the , not directly on the . This ensures proper operation of collections that are derived from other objects. Specifically, it maintains proper synchronization with other threads that might be simultaneously modifying the object. Enumerating through a collection is intrinsically not a thread safe procedure. Even when a collection is synchronized, other threads can still modify the collection, which causes the enumerator to throw an exception. To guarantee thread safety during enumeration, you can either lock the collection during the entire enumeration or catch the exceptions resulting from changes made by other threads. - The following code example shows how to lock the collection using the during the entire enumeration: + The following code example shows how to lock the collection using the during the entire enumeration: :::code language="csharp" source="~/snippets/csharp/System.Collections/Hashtable/IsSynchronized/remarks.cs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections/Hashtable/IsSynchronized/remarks.vb" id="Snippet2"::: @@ -3608,13 +3608,13 @@ This method uses the collection's objects' and also brings the enumerator back to this position. At this position, calling throws an exception. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. also brings the enumerator back to this position. At this position, calling throws an exception. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . - returns the same object until either or is called. sets to the next element. + returns the same object until either or is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, calling throws an exception. To set to the first element of the collection again, you can call followed by . + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, calling throws an exception. To set to the first element of the collection again, you can call followed by . - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator can be invalidated and the next call to or throws an . If the collection is modified between and , returns the element that it is set to, even if the enumerator is already invalidated. + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator can be invalidated and the next call to or throws an . If the collection is modified between and , returns the element that it is set to, even if the enumerator is already invalidated. The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread safe procedure. Even when a collection is synchronized, other threads can still modify the collection, which causes the enumerator to throw an exception. To guarantee thread safety during enumeration, you can either lock the collection during the entire enumeration or catch the exceptions resulting from changes made by other threads. @@ -3685,7 +3685,7 @@ This method uses the collection's objects' and is unspecified, but it is the same order as the associated keys in the returned by the method. + The order of the values in the is unspecified, but it is the same order as the associated keys in the returned by the method. The returned is not a static copy; instead, the refers back to the values in the original . Therefore, changes to the continue to be reflected in the . diff --git a/xml/System.Collections/ICollection.xml b/xml/System.Collections/ICollection.xml index ae71e04b0c3..b4fa128ea9d 100644 --- a/xml/System.Collections/ICollection.xml +++ b/xml/System.Collections/ICollection.xml @@ -63,7 +63,7 @@ ## Remarks -The interface is the base interface for classes in the namespace. Its generic equivalent is the interface. +The interface is the base interface for classes in the namespace. Its generic equivalent is the interface. The interface extends ; and are more specialized interfaces that extend . An implementation is a collection of key/value pairs, like the class. An implementation is a collection of values and its members can be accessed by index, like the class. @@ -71,7 +71,7 @@ The interface is the base interface for cl If neither the interface nor the interface meet the requirements of the required collection, derive the new collection class from the interface instead for more flexibility. - For the generic version of this interface, see . + For the generic version of this interface, see . ]]> @@ -239,7 +239,7 @@ The interface is the base interface for cl returns an object, which can be used to synchronize access to the . + returns an object, which can be used to synchronize access to the . Most collection classes in the namespace also implement a Synchronized method, which provides a synchronized wrapper around the underlying collection. @@ -306,7 +306,7 @@ The interface is the base interface for cl Most collection classes in the namespace also implement a `Synchronized` method, which provides a synchronized wrapper around the underlying collection. However, derived classes can provide their own synchronized version of the collection using the property. The synchronizing code must perform operations on the property of the collection, not directly on the collection. This ensures proper operation of collections that are derived from other objects. Specifically, it maintains proper synchronization with other threads that might be simultaneously modifying the collection instance. - In the absence of a `Synchronized` method on a collection, the expected usage for looks as follows: + In the absence of a `Synchronized` method on a collection, the expected usage for looks as follows: :::code language="csharp" source="~/snippets/csharp/System.Collections/ICollection/IsSynchronized/remarks.cs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections/ICollection/IsSynchronized/remarks.vb" id="Snippet2"::: diff --git a/xml/System.Collections/IComparer.xml b/xml/System.Collections/IComparer.xml index 8bf9a293be8..c76f1f270aa 100644 --- a/xml/System.Collections/IComparer.xml +++ b/xml/System.Collections/IComparer.xml @@ -55,22 +55,22 @@ Exposes a method that compares two objects. - and methods. It provides a way to customize the sort order of a collection. See the method for notes on parameters and return value. Its generic equivalent is the interface. - - The default implementation of this interface is the class. For the generic version of this interface, see . - - - -## Examples - -The following example uses the interface to sort a string array. In this example, the method is implemented using the class to reverse the order of the contents of the array. - + and methods. It provides a way to customize the sort order of a collection. See the method for notes on parameters and return value. Its generic equivalent is the interface. + + The default implementation of this interface is the class. For the generic version of this interface, see . + + + +## Examples + +The following example uses the interface to sort a string array. In this example, the method is implemented using the class to reverse the order of the contents of the array. + :::code language="csharp" source="~/snippets/csharp/System.Collections/IComparer/reverse.cs"::: -:::code language="vb" source="~/snippets/visualbasic/api/system.collections/icomparer/reverse.vb"::: - +:::code language="vb" source="~/snippets/visualbasic/api/system.collections/icomparer/reverse.vb"::: + ]]> @@ -131,28 +131,28 @@ The following example uses the interface to Compares two objects and returns a value indicating whether one is less than, equal to, or greater than the other. A signed integer that indicates the relative values of and :
- If less than 0, is less than .
- If 0, equals .
- If greater than 0, is greater than .
- method of one of the parameters. - - Comparing `null` with any type is allowed and does not generate an exception when using . When sorting, `null` is considered to be less than any other object. - - - -## Examples - -The following example uses the interface to sort a string array. In this example, the method is implemented using the class to reverse the order of the contents of the array. - + method of one of the parameters. + + Comparing `null` with any type is allowed and does not generate an exception when using . When sorting, `null` is considered to be less than any other object. + + + +## Examples + +The following example uses the interface to sort a string array. In this example, the method is implemented using the class to reverse the order of the contents of the array. + :::code language="csharp" source="~/snippets/csharp/System.Collections/IComparer/reverse.cs"::: :::code language="vb" source="~/snippets/visualbasic/api/system.collections/icomparer/reverse.vb"::: ]]> - Neither nor implements the interface. - - -or- - + Neither nor implements the interface. + + -or- + and are of different types and neither one can handle comparisons with the other. diff --git a/xml/System.Collections/IDictionary.xml b/xml/System.Collections/IDictionary.xml index 179d65819cc..685c1c458d7 100644 --- a/xml/System.Collections/IDictionary.xml +++ b/xml/System.Collections/IDictionary.xml @@ -65,7 +65,7 @@ interface is the base interface for nongeneric collections of key/value pairs. For the generic version of this interface, see . + The interface is the base interface for nongeneric collections of key/value pairs. For the generic version of this interface, see . Each element is a key/value pair stored in a object. @@ -157,14 +157,14 @@ property to add new elements by setting the value of a key that does not exist in the dictionary (for example, `myCollection["myNonexistentKey"] = myValue`). However, if the specified key already exists in the dictionary, setting the property overwrites the old value. In contrast, the method does not modify existing elements. + You can also use the property to add new elements by setting the value of a key that does not exist in the dictionary (for example, `myCollection["myNonexistentKey"] = myValue`). However, if the specified key already exists in the dictionary, setting the property overwrites the old value. In contrast, the method does not modify existing elements. Implementations can vary in whether they allow the key to be `null`. ## Examples - The following code example demonstrates how to implement the method. This code example is part of a larger example provided for the class. + The following code example demonstrates how to implement the method. This code example is part of a larger example provided for the class. :::code language="csharp" source="~/snippets/csharp/System.Collections/DictionaryEntry/Key/Dictionary.cs" id="Snippet9"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections/DictionaryEntry/Key/Dictionary.vb" id="Snippet9"::: @@ -229,7 +229,7 @@ method. This code example is part of a larger example provided for the class. + The following code example demonstrates how to implement the method. This code example is part of a larger example provided for the class. :::code language="csharp" source="~/snippets/csharp/System.Collections/DictionaryEntry/Key/Dictionary.cs" id="Snippet8"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections/DictionaryEntry/Key/Dictionary.vb" id="Snippet8"::: @@ -293,10 +293,10 @@ ## Remarks Implementations can vary in whether they allow the key to be `null`. -This method uses the collection's objects' and methods on `item` to determine whether item exists. +This method uses the collection's objects' and methods on `item` to determine whether item exists. ## Examples - The following code example demonstrates how to implement the method. This code example is part of a larger example provided for the class. + The following code example demonstrates how to implement the method. This code example is part of a larger example provided for the class. :::code language="csharp" source="~/snippets/csharp/System.Collections/DictionaryEntry/Key/Dictionary.cs" id="Snippet5"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections/DictionaryEntry/Key/Dictionary.vb" id="Snippet5"::: @@ -360,11 +360,11 @@ This method uses the collection's objects' and also brings the enumerator back to this position. At this position, the property is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. also brings the enumerator back to this position. At this position, the property is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . - returns the same object until either or is called. sets to the next element. + returns the same object until either or is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. To set to the first element of the collection again, you can call followed by . + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. To set to the first element of the collection again, you can call followed by . An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and its behavior is undefined. @@ -562,11 +562,11 @@ This method uses the collection's objects' and property to add new elements by setting the value of a key that does not exist in the dictionary (for example, `myCollection["myNonexistentKey"] = myValue`). However, if the specified key already exists in the dictionary, setting the property overwrites the old value. In contrast, the method does not modify existing elements. + You can also use the property to add new elements by setting the value of a key that does not exist in the dictionary (for example, `myCollection["myNonexistentKey"] = myValue`). However, if the specified key already exists in the dictionary, setting the property overwrites the old value. In contrast, the method does not modify existing elements. Implementations can vary in whether they allow the key to be `null`. - The C# language uses the `this`[this](/dotnet/csharp/language-reference/keywords/this) keyword to define the indexers instead of implementing the property. Visual Basic implements as a default property, which provides the same indexing functionality. + The C# language uses the `this`[this](/dotnet/csharp/language-reference/keywords/this) keyword to define the indexers instead of implementing the property. Visual Basic implements as a default property, which provides the same indexing functionality. @@ -705,7 +705,7 @@ This method uses the collection's objects' and method. This code example is part of a larger example provided for the class. + The following code example demonstrates how to implement the method. This code example is part of a larger example provided for the class. :::code language="csharp" source="~/snippets/csharp/System.Collections/DictionaryEntry/Key/Dictionary.cs" id="Snippet7"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections/DictionaryEntry/Key/Dictionary.vb" id="Snippet7"::: diff --git a/xml/System.Collections/IDictionaryEnumerator.xml b/xml/System.Collections/IDictionaryEnumerator.xml index e5f2bef4f27..b401db6a674 100644 --- a/xml/System.Collections/IDictionaryEnumerator.xml +++ b/xml/System.Collections/IDictionaryEnumerator.xml @@ -66,13 +66,13 @@ Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection. - Initially, the enumerator is positioned before the first element in the collection. The method also brings the enumerator back to this position. At this position, is undefined. Therefore, you must call the method to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. The method also brings the enumerator back to this position. At this position, is undefined. Therefore, you must call the method to advance the enumerator to the first element of the collection before reading the value of . - returns the same object until either or is called. sets to the next element. + returns the same object until either or is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. To set to the first element of the collection again, you can call followed by . + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. To set to the first element of the collection again, you can call followed by . - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread-safe procedure. Even when a collection is synchronized, other threads can still modify the collection, which causes the enumerator to throw an exception. To guarantee thread safety during enumeration, you can either lock the collection during the entire enumeration or catch the exceptions resulting from changes made by other threads. @@ -142,15 +142,15 @@ ## Remarks - is undefined under any of the following conditions: + is undefined under any of the following conditions: -- The enumerator is positioned before the first element in the collection, immediately after the enumerator is created. must be called to advance the enumerator to the first element of the collection before reading the value of . +- The enumerator is positioned before the first element in the collection, immediately after the enumerator is created. must be called to advance the enumerator to the first element of the collection before reading the value of . -- The last call to returned `false`, which indicates the end of the collection. +- The last call to returned `false`, which indicates the end of the collection. - The enumerator is invalidated due to changes made in the collection, such as adding, modifying, or deleting elements. - returns the same object until is called. sets to the next element. + returns the same object until is called. sets to the next element. ]]> @@ -212,15 +212,15 @@ ## Remarks - is undefined under any of the following conditions: + is undefined under any of the following conditions: -- The enumerator is positioned before the first element in the collection, immediately after the enumerator is created. must be called to advance the enumerator to the first element of the collection before reading the value of . +- The enumerator is positioned before the first element in the collection, immediately after the enumerator is created. must be called to advance the enumerator to the first element of the collection before reading the value of . -- The last call to returned `false`, which indicates the end of the collection. +- The last call to returned `false`, which indicates the end of the collection. - The enumerator is invalidated due to changes made in the collection, such as adding, modifying, or deleting elements. - returns the same object until is called. sets to the key of the next element in enumeration. + returns the same object until is called. sets to the key of the next element in enumeration. ]]> @@ -285,15 +285,15 @@ is undefined under any of the following conditions: + is undefined under any of the following conditions: -- The enumerator is positioned before the first element in the collection, immediately after the enumerator is created. must be called to advance the enumerator to the first element of the collection before reading the value of . +- The enumerator is positioned before the first element in the collection, immediately after the enumerator is created. must be called to advance the enumerator to the first element of the collection before reading the value of . -- The last call to returned `false`, which indicates the end of the collection. +- The last call to returned `false`, which indicates the end of the collection. - The enumerator is invalidated due to changes made in the collection, such as adding, modifying, or deleting elements. - returns the same object until is called. sets to the value of the next element in enumeration. + returns the same object until is called. sets to the value of the next element in enumeration. ]]> diff --git a/xml/System.Collections/IEnumerable.xml b/xml/System.Collections/IEnumerable.xml index 8c25c823f8f..6fa06caff0b 100644 --- a/xml/System.Collections/IEnumerable.xml +++ b/xml/System.Collections/IEnumerable.xml @@ -62,7 +62,7 @@ is the base interface for all non-generic collections that can be enumerated. For the generic version of this interface see . contains a single method, , which returns an . provides the ability to iterate through the collection by exposing a property and and methods. + is the base interface for all non-generic collections that can be enumerated. For the generic version of this interface see . contains a single method, , which returns an . provides the ability to iterate through the collection by exposing a property and and methods. It is a best practice to implement and on your collection classes to enable the `foreach` (`For Each` in Visual Basic) syntax, however implementing is not required. If your collection does not implement , you must still follow the iterator pattern to support this syntax by providing a `GetEnumerator` method that returns an interface, class or struct. When using Visual Basic, you must provide an implementation, which is returned by `GetEnumerator`. When developing with C# you must provide a class that contains a `Current` property, and `MoveNext` and `Reset` methods as described by , but the class does not have to implement . @@ -138,11 +138,11 @@ Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection. - Initially, the enumerator is positioned before the first element in the collection. The method also brings the enumerator back to this position. At this position, the property is undefined. Therefore, you must call the method to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. The method also brings the enumerator back to this position. At this position, the property is undefined. Therefore, you must call the method to advance the enumerator to the first element of the collection before reading the value of . - returns the same object until either or is called. sets to the next element. + returns the same object until either or is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returns `false`, is undefined. To set to the first element of the collection again, you can call followed by . + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returns `false`, is undefined. To set to the first element of the collection again, you can call followed by . If changes are made to the collection, such as adding, modifying, or deleting elements, the behavior of the enumerator is undefined. @@ -151,7 +151,7 @@ ## Examples - The following code example demonstrates the implementation of the interfaces for a custom collection. In this example, is not explicitly called, but it is implemented to support the use of `foreach` (`For Each` in Visual Basic). This code example is part of a larger example for the interface. + The following code example demonstrates the implementation of the interfaces for a custom collection. In this example, is not explicitly called, but it is implemented to support the use of `foreach` (`For Each` in Visual Basic). This code example is part of a larger example for the interface. :::code language="csharp" source="~/snippets/csharp/System.Collections/IEnumerable/Overview/ienumerator.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections/IEnumerable/Overview/ienumerator.vb" id="Snippet1"::: diff --git a/xml/System.Collections/IEnumerator.xml b/xml/System.Collections/IEnumerator.xml index 27cdce92ad1..9439d7a523a 100644 --- a/xml/System.Collections/IEnumerator.xml +++ b/xml/System.Collections/IEnumerator.xml @@ -62,21 +62,21 @@ is the base interface for all non-generic enumerators. Its generic equivalent is the interface. + is the base interface for all non-generic enumerators. Its generic equivalent is the interface. The `foreach` statement of the C# language (`for each` in Visual Basic) hides the complexity of the enumerators. Therefore, using `foreach` is recommended instead of directly manipulating the enumerator. Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection. - The method is provided for COM interoperability and does not need to be fully implemented; instead, the implementer can throw a . + The method is provided for COM interoperability and does not need to be fully implemented; instead, the implementer can throw a . - Initially, the enumerator is positioned before the first element in the collection. You must call the method to advance the enumerator to the first element of the collection before reading the value of ; otherwise, is undefined. + Initially, the enumerator is positioned before the first element in the collection. You must call the method to advance the enumerator to the first element of the collection before reading the value of ; otherwise, is undefined. - returns the same object until either or is called. sets to the next element. + returns the same object until either or is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. - To set to the first element of the collection again, you can call , if it's implemented, followed by . If is not implemented, you must create a new enumerator instance to return to the first element of the collection. + To set to the first element of the collection again, you can call , if it's implemented, followed by . If is not implemented, you must create a new enumerator instance to return to the first element of the collection. If changes are made to the collection, such as adding, modifying, or deleting elements, the behavior of the enumerator is undefined. @@ -145,20 +145,20 @@ is undefined under any of the following conditions: + is undefined under any of the following conditions: -- The enumerator is positioned before the first element in the collection, immediately after the enumerator is created. must be called to advance the enumerator to the first element of the collection before reading the value of . +- The enumerator is positioned before the first element in the collection, immediately after the enumerator is created. must be called to advance the enumerator to the first element of the collection before reading the value of . -- The last call to returned `false`, which indicates the end of the collection. +- The last call to returned `false`, which indicates the end of the collection. - The enumerator is invalidated due to changes made in the collection, such as adding, modifying, or deleting elements. - returns the same object until is called. sets to the next element. + returns the same object until is called. sets to the next element. ## Examples - The following code example demonstrates the implementation of the interfaces for a custom collection. In this example, is not explicitly called, but it is implemented to support the use of `foreach` (`for each` in Visual Basic). This code example is part of a larger example for the interface. + The following code example demonstrates the implementation of the interfaces for a custom collection. In this example, is not explicitly called, but it is implemented to support the use of `foreach` (`for each` in Visual Basic). This code example is part of a larger example for the interface. :::code language="csharp" source="~/snippets/csharp/System.Collections/IEnumerable/Overview/ienumerator.cs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections/IEnumerable/Overview/ienumerator.vb" id="Snippet2"::: @@ -218,16 +218,16 @@ method is called, an enumerator is positioned before the first element of the collection, and the first call to the method moves the enumerator over the first element of the collection. + After an enumerator is created or after the method is called, an enumerator is positioned before the first element of the collection, and the first call to the method moves the enumerator over the first element of the collection. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false` until is called. + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false` until is called. - If changes are made to the collection, such as adding, modifying, or deleting elements, the behavior of is undefined. + If changes are made to the collection, such as adding, modifying, or deleting elements, the behavior of is undefined. ## Examples - The following code example demonstrates the implementation of the interfaces for a custom collection. In this example, is not explicitly called, but it is implemented to support the use of `foreach` (`for each` in Visual Basic). This code example is part of a larger example for the interface. + The following code example demonstrates the implementation of the interfaces for a custom collection. In this example, is not explicitly called, but it is implemented to support the use of `foreach` (`for each` in Visual Basic). This code example is part of a larger example for the interface. :::code language="csharp" source="~/snippets/csharp/System.Collections/IEnumerable/Overview/ienumerator.cs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections/IEnumerable/Overview/ienumerator.vb" id="Snippet2"::: @@ -286,14 +286,14 @@ is undefined. + If changes are made to the collection, such as adding, modifying, or deleting elements, the behavior of is undefined. - The method is provided for COM interoperability. It does not necessarily need to be implemented; instead, the implementer can simply throw a . + The method is provided for COM interoperability. It does not necessarily need to be implemented; instead, the implementer can simply throw a . ## Examples - The following code example demonstrates the implementation of the interfaces for a custom collection. In this example, is not explicitly called, but it is implemented to support the use of `foreach` (`for each` in Visual Basic). This code example is part of a larger example for the interface. + The following code example demonstrates the implementation of the interfaces for a custom collection. In this example, is not explicitly called, but it is implemented to support the use of `foreach` (`for each` in Visual Basic). This code example is part of a larger example for the interface. :::code language="csharp" source="~/snippets/csharp/System.Collections/IEnumerable/Overview/ienumerator.cs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections/IEnumerable/Overview/ienumerator.vb" id="Snippet2"::: diff --git a/xml/System.Collections/IEqualityComparer.xml b/xml/System.Collections/IEqualityComparer.xml index bfd6e3ec5f4..da9d377ca10 100644 --- a/xml/System.Collections/IEqualityComparer.xml +++ b/xml/System.Collections/IEqualityComparer.xml @@ -60,7 +60,7 @@ This interface allows the implementation of customized equality comparison for collections. That is, you can create your own definition of equality, and specify that this definition be used with a collection type that accepts the interface. In the .NET Framework, constructors of the , , and collection types accept this interface. -For the generic version of this interface, see . +For the generic version of this interface, see . The `IEqualityComparer` interface supports only equality comparisons. Customization of comparisons for sorting and ordering is provided by the interface. @@ -131,7 +131,7 @@ The `IEqualityComparer` interface supports only equality comparisons. Customizat ## Examples - The following code example demonstrates the implementation of a case-insensitive . In this example, the method is used to determine whether two objects are equal, based on the provided . + The following code example demonstrates the implementation of a case-insensitive . In this example, the method is used to determine whether two objects are equal, based on the provided . :::code language="csharp" source="~/snippets/csharp/System.Collections/Hashtable/.ctor/hashtable_ctor.cs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections/Hashtable/.ctor/hashtable_ctor.vb" id="Snippet2"::: @@ -197,10 +197,10 @@ The `IEqualityComparer` interface supports only equality comparisons. Customizat method. + Implement this method to provide customized hash codes for objects, corresponding to the customized equality comparison provided by the method. ## Examples - The following code example demonstrates the implementation of a case-insensitive . In this example, the method returns the hash code provided by the type. + The following code example demonstrates the implementation of a case-insensitive . In this example, the method returns the hash code provided by the type. :::code language="csharp" source="~/snippets/csharp/System.Collections/Hashtable/.ctor/hashtable_ctor.cs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections/Hashtable/.ctor/hashtable_ctor.vb" id="Snippet2"::: diff --git a/xml/System.Collections/IHashCodeProvider.xml b/xml/System.Collections/IHashCodeProvider.xml index 771ac967868..c74fa1df36e 100644 --- a/xml/System.Collections/IHashCodeProvider.xml +++ b/xml/System.Collections/IHashCodeProvider.xml @@ -81,17 +81,17 @@ Supplies a hash code for an object, using a custom hash function. - [!IMPORTANT] -> We don't recommend that you use the `IHashCodeProvider` interface for new development. Its recommended replacement is the or interface. +> We don't recommend that you use the `IHashCodeProvider` interface for new development. Its recommended replacement is the or interface. + +The interface is used in conjunction with the class. The objects used as keys by a object must override the and methods. or the key's implementation of is used as the hash code provider. or the key's implementation of is used as the comparer. + + However, some overloads of the constructor take a parameter that is an implementation, or a parameter that is an implementation, or both. If an implementation is passed to the constructor, the method of that implementation is used as the hash code provider. If an implementation is passed to the constructor, the method of that implementation is used as the comparer. -The interface is used in conjunction with the class. The objects used as keys by a object must override the and methods. or the key's implementation of is used as the hash code provider. or the key's implementation of is used as the comparer. - - However, some overloads of the constructor take a parameter that is an implementation, or a parameter that is an implementation, or both. If an implementation is passed to the constructor, the method of that implementation is used as the hash code provider. If an implementation is passed to the constructor, the method of that implementation is used as the comparer. - ]]> @@ -152,11 +152,11 @@ The interface is used in conjunction Returns a hash code for the specified object. A hash code for the specified object. - The type of is a reference type and is . diff --git a/xml/System.Collections/IList.xml b/xml/System.Collections/IList.xml index 6711b38cfa9..0585b437dee 100644 --- a/xml/System.Collections/IList.xml +++ b/xml/System.Collections/IList.xml @@ -67,7 +67,7 @@ ## Remarks is a descendant of the interface and is the base interface of all non-generic lists. implementations fall into three categories: read-only, fixed-size, and variable-size. A read-only cannot be modified. A fixed-size does not allow the addition or removal of elements, but it allows the modification of existing elements. A variable-size allows the addition, removal, and modification of elements. - For the generic version of this interface, see . + For the generic version of this interface, see . @@ -197,7 +197,7 @@ and the capacity of a collection. Typically, the count is set to zero, and references to other objects from elements of the collection are also released. The capacity can be set to zero or a default value, or it can remain unchanged. + Implementations of this method can vary in how they handle the and the capacity of a collection. Typically, the count is set to zero, and references to other objects from elements of the collection are also released. The capacity can be set to zero or a default value, or it can remain unchanged. @@ -266,7 +266,7 @@ ## Remarks -This method uses the collection's objects' and methods on `item` to determine whether item exists. +This method uses the collection's objects' and methods on `item` to determine whether item exists. ## Examples The following example demonstrates the implementation of the interface to create a simple, fixed-size list. This code is part of a larger example for the interface. @@ -331,7 +331,7 @@ This method uses the collection's objects' and and methods on `item` to determine whether item exists. +This method uses the collection's objects' and methods on `item` to determine whether item exists. ## Examples The following example demonstrates the implementation of the interface to create a simple, fixed-size list. This code is part of a larger example for the interface. @@ -599,7 +599,7 @@ This method uses the collection's objects' and property. Visual Basic implements as a default property, which provides the same indexing functionality. + The C# language uses the [this](/dotnet/csharp/language-reference/keywords/this) keyword to define the indexers instead of implementing the property. Visual Basic implements as a default property, which provides the same indexing functionality. diff --git a/xml/System.Collections/IStructuralComparable.xml b/xml/System.Collections/IStructuralComparable.xml index f3c89e5397b..8b123f07b3e 100644 --- a/xml/System.Collections/IStructuralComparable.xml +++ b/xml/System.Collections/IStructuralComparable.xml @@ -52,23 +52,23 @@ ## Remarks The interface enables you to implement customized comparisons for collection members. That is, you can define precisely what it means for one collection object to precede, follow, or occur in the same position in the sort order as a second collection object. You can then specify that this definition be used with a collection type that accepts the interface. - The interface has a single member, , which determines whether the current collection object is less than, equal to, or greater than a second object in the sort order. The actual comparison of the members or elements in the current instance with those in a second object is performed by an interface implementation, which contains the definition of your custom comparison. + The interface has a single member, , which determines whether the current collection object is less than, equal to, or greater than a second object in the sort order. The actual comparison of the members or elements in the current instance with those in a second object is performed by an interface implementation, which contains the definition of your custom comparison. > [!NOTE] > The interface supports only structural comparisons for sorting or ordering. The interface supports custom comparisons for structural equality. - The .NET Framework provides two default comparers. One is returned by the property; the other is returned by the property. + The .NET Framework provides two default comparers. One is returned by the property; the other is returned by the property. - The generic tuple classes (, , , and so on) and the class provide explicit implementations of the interface. By casting (in C#) or converting (in Visual Basic) the current instance of an array or tuple to an interface value and providing your implementation as an argument to the method, you can define a custom sort order for the array or collection. However, you do not call the method directly in most cases. Instead, the method is called by sorting methods such as . In this case, you define your implementation and pass it as an argument to a sorting method or collection object's class constructor. The method with your custom comparer is then called automatically whenever the collection is sorted. + The generic tuple classes (, , , and so on) and the class provide explicit implementations of the interface. By casting (in C#) or converting (in Visual Basic) the current instance of an array or tuple to an interface value and providing your implementation as an argument to the method, you can define a custom sort order for the array or collection. However, you do not call the method directly in most cases. Instead, the method is called by sorting methods such as . In this case, you define your implementation and pass it as an argument to a sorting method or collection object's class constructor. The method with your custom comparer is then called automatically whenever the collection is sorted. ## Examples - The following example creates an array of objects that contains population data for three U.S. cities from 1960 to 2000. The sextuple's first component is the city name. The remaining five components represent the population at ten-year intervals from 1960 to 2000. + The following example creates an array of objects that contains population data for three U.S. cities from 1960 to 2000. The sextuple's first component is the city name. The remaining five components represent the population at ten-year intervals from 1960 to 2000. The `PopulationComparer` class provides an implementation that allows the array of sextuples to be sorted by any one of its components. Two values are provided to the `PopulationComparer` class in its constructor: the position of the component that defines the sort order, and a Boolean value that indicates whether the tuple objects should be sorted in ascending or descending order. - The example then displays the elements in the array in unsorted order, sorts them by the third component (the population in 1970) and displays them, and then sorts them by the sixth component (the population in 2000) and displays them. Note that the example does not directly call the method. The method is called implicitly by the method for each tuple object in the array. + The example then displays the elements in the array in unsorted order, sorts them by the third component (the population in 1970) and displays them, and then sorts them by the sixth component (the population in 2000) and displays them. Note that the example does not directly call the method. The method is called implicitly by the method for each tuple object in the array. :::code language="csharp" source="~/snippets/csharp/System/TupleT1,T2,T3,T4,T5,T6/System.Collections.IStructuralComparable.CompareTo/compareto2.cs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System/TupleT1,T2,T3,T4,T5,T6/System.Collections.IStructuralComparable.CompareTo/compareto2.vb" id="Snippet2"::: @@ -157,22 +157,22 @@ method supports custom structural comparison and sorting of array and tuple objects. The method calls the `comparer` object's method to compare individual array elements or tuple components, starting with the first element or component. The individual calls to end and the method returns a value when one of the following conditions becomes true: + The method supports custom structural comparison and sorting of array and tuple objects. The method calls the `comparer` object's method to compare individual array elements or tuple components, starting with the first element or component. The individual calls to end and the method returns a value when one of the following conditions becomes true: -- The method returns -1. +- The method returns -1. -- The method returns 1. +- The method returns 1. -- The method is called for the last element or component in the collection object. +- The method is called for the last element or component in the collection object. ## Examples - The following example creates an array of objects that contains population data for three U.S. cities from 1960 to 2000. The sextuple's first component is the city name. The remaining five components represent the population at ten-year intervals from 1960 to 2000. + The following example creates an array of objects that contains population data for three U.S. cities from 1960 to 2000. The sextuple's first component is the city name. The remaining five components represent the population at ten-year intervals from 1960 to 2000. The `PopulationComparer` class provides an implementation that allows the array of sextuples to be sorted by any one of its components. Two values are provided to the `PopulationComparer` class in its constructor: the position of the component that defines the sort order, and a value that indicates whether the tuple objects should be sorted in ascending or descending order. - The example then displays the elements in the array in unsorted order, sorts them by the third component (the population in 1970) and displays them, and then sorts them by the sixth component (the population in 2000) and displays them. Note that the example does not directly call the implementation. The method is called implicitly by the method for each tuple object in the array. + The example then displays the elements in the array in unsorted order, sorts them by the third component (the population in 1970) and displays them, and then sorts them by the sixth component (the population in 2000) and displays them. Note that the example does not directly call the implementation. The method is called implicitly by the method for each tuple object in the array. :::code language="csharp" source="~/snippets/csharp/System/TupleT1,T2,T3,T4,T5,T6/System.Collections.IStructuralComparable.CompareTo/compareto2.cs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System/TupleT1,T2,T3,T4,T5,T6/System.Collections.IStructuralComparable.CompareTo/compareto2.vb" id="Snippet2"::: diff --git a/xml/System.Collections/IStructuralEquatable.xml b/xml/System.Collections/IStructuralEquatable.xml index 62ee082b3df..2a652f3ea7d 100644 --- a/xml/System.Collections/IStructuralEquatable.xml +++ b/xml/System.Collections/IStructuralEquatable.xml @@ -50,14 +50,14 @@ interface enables you to implement customized comparisons to check for the structural equality of collection objects. That is, you can create your own definition of structural equality and specify that this definition be used with a collection type that accepts the interface. The interface has two members: , which tests for equality by using a specified implementation, and , which returns identical hash codes for objects that are equal. + Structural equality means that two objects are equal because they have equal values. It differs from reference equality, which indicates that two object references are equal because they reference the same physical object. The interface enables you to implement customized comparisons to check for the structural equality of collection objects. That is, you can create your own definition of structural equality and specify that this definition be used with a collection type that accepts the interface. The interface has two members: , which tests for equality by using a specified implementation, and , which returns identical hash codes for objects that are equal. > [!NOTE] > The interface supports only custom comparisons for structural equality. The interface supports custom structural comparisons for sorting and ordering. - The .NET Framework also provides default equality comparers, which are returned by the and properties. For more information, see the example. + The .NET Framework also provides default equality comparers, which are returned by the and properties. For more information, see the example. - The generic tuple classes (, , , and so on) and the class provide explicit implementations of the interface. By casting (in C#) or converting (in Visual Basic) the current instance of an array or tuple to an interface value and providing your implementation as an argument to the method, you can define a custom equality comparison for the array or collection. + The generic tuple classes (, , , and so on) and the class provide explicit implementations of the interface. By casting (in C#) or converting (in Visual Basic) the current instance of an array or tuple to an interface value and providing your implementation as an argument to the method, you can define a custom equality comparison for the array or collection. @@ -68,7 +68,7 @@ The default equality comparer, `EqualityComparer.Default.Equals`, consid :::code language="csharp" source="~/snippets/csharp/System.Collections/IStructuralEquatable/Overview/nanexample1.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections/IStructuralEquatable/Overview/nanexample1.vb" id="Snippet1"::: - The following example creates two identical 3-tuple objects whose components consist of three values. The value of the second component is . The example then calls the method, and it calls the method three times. The first time, it passes the default equality comparer that is returned by the property. The second time, it passes the default equality comparer that is returned by the property. The third time, it passes the custom `NanComparer` object. As the output from the example shows, the first three method calls return `true`, whereas the fourth call returns `false`. + The following example creates two identical 3-tuple objects whose components consist of three values. The value of the second component is . The example then calls the method, and it calls the method three times. The first time, it passes the default equality comparer that is returned by the property. The second time, it passes the default equality comparer that is returned by the property. The third time, it passes the custom `NanComparer` object. As the output from the example shows, the first three method calls return `true`, whereas the fourth call returns `false`. :::code language="csharp" source="~/snippets/csharp/System.Collections/IStructuralEquatable/Overview/nanexample1.cs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections/IStructuralEquatable/Overview/nanexample1.vb" id="Snippet2"::: @@ -140,7 +140,7 @@ The default equality comparer, `EqualityComparer.Default.Equals`, consid method supports custom structural comparison of array and tuple objects. This method in turn calls the `comparer` object's method to compare individual array elements or tuple components, starting with the first element or component. The individual calls to end and the method returns a value either when a method call returns `false` or after all array elements or tuple components have been compared. + The method supports custom structural comparison of array and tuple objects. This method in turn calls the `comparer` object's method to compare individual array elements or tuple components, starting with the first element or component. The individual calls to end and the method returns a value either when a method call returns `false` or after all array elements or tuple components have been compared. @@ -150,7 +150,7 @@ The default equality comparer, `EqualityComparer.Default.Equals`, consid :::code language="csharp" source="~/snippets/csharp/System.Collections/IStructuralEquatable/Overview/nanexample1.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections/IStructuralEquatable/Overview/nanexample1.vb" id="Snippet1"::: - The following example creates two identical 3-tuple objects whose components consist of three values. The value of the second component is . The example then calls the method, and it calls the method three times. The first time, it passes the default equality comparer that is returned by the property. The second time, it passes the default equality comparer that is returned by the property. The third time, it passes the custom `NanComparer` object. As the output from the example shows, the first three method calls return `true`, whereas the fourth call returns `false`. + The following example creates two identical 3-tuple objects whose components consist of three values. The value of the second component is . The example then calls the method, and it calls the method three times. The first time, it passes the default equality comparer that is returned by the property. The second time, it passes the default equality comparer that is returned by the property. The third time, it passes the custom `NanComparer` object. As the output from the example shows, the first three method calls return `true`, whereas the fourth call returns `false`. :::code language="csharp" source="~/snippets/csharp/System.Collections/IStructuralEquatable/Overview/nanexample1.cs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections/IStructuralEquatable/Overview/nanexample1.vb" id="Snippet2"::: @@ -209,7 +209,7 @@ The default equality comparer, `EqualityComparer.Default.Equals`, consid method. + Implement this method to return customized hash codes for collection objects that correspond to the customized comparison for structural equality provided by the method. ]]> diff --git a/xml/System.Collections/Queue.xml b/xml/System.Collections/Queue.xml index f588cab8c18..af575b97cf3 100644 --- a/xml/System.Collections/Queue.xml +++ b/xml/System.Collections/Queue.xml @@ -93,25 +93,25 @@ This class implements a queue as a circular array. Objects stored in a are inserted at one end and removed from the other. > [!IMPORTANT] -> We don't recommend that you use the `Queue` class for new development. Instead, we recommend that you use the generic class. For more information, see [Non-generic collections shouldn't be used](https://github.com/dotnet/platform-compat/blob/master/docs/DE0006.md) on GitHub. +> We don't recommend that you use the `Queue` class for new development. Instead, we recommend that you use the generic class. For more information, see [Non-generic collections shouldn't be used](https://github.com/dotnet/platform-compat/blob/master/docs/DE0006.md) on GitHub. - Queues and stacks are useful when you need temporary storage for information; that is, when you might want to discard an element after retrieving its value. Use if you need to access the information in the same order that it is stored in the collection. Use if you need to access the information in reverse order. Use or if you need to access the collection from multiple threads concurrently. + Queues and stacks are useful when you need temporary storage for information; that is, when you might want to discard an element after retrieving its value. Use if you need to access the information in the same order that it is stored in the collection. Use if you need to access the information in reverse order. Use or if you need to access the collection from multiple threads concurrently. Three main operations can be performed on a and its elements: -- adds an element to the end of the . +- adds an element to the end of the . -- removes the oldest element from the start of the . +- removes the oldest element from the start of the . -- returns the oldest element that is at the start of the but does not remove it from the . +- returns the oldest element that is at the start of the but does not remove it from the . - The capacity of a is the number of elements the can hold. As elements are added to a , the capacity is automatically increased as required through reallocation. The capacity can be decreased by calling . + The capacity of a is the number of elements the can hold. As elements are added to a , the capacity is automatically increased as required through reallocation. The capacity can be decreased by calling . The growth factor is the number by which the current capacity is multiplied when a greater capacity is required. The growth factor is determined when the is constructed. The default growth factor is 2.0. The capacity of the will always increase by at least a minimum of four, regardless of the growth factor. For example, a with a growth factor of 1.0 will always increase in capacity by four when a greater capacity is required. accepts `null` as a valid value and allows duplicate elements. - For the generic version of this collection, see + For the generic version of this collection, see @@ -182,7 +182,7 @@ This class implements a queue as a circular array. Objects stored in a is the number of elements the can hold. As elements are added to a , the capacity is automatically increased as required through reallocation. The capacity can be decreased by calling . + The capacity of a is the number of elements the can hold. As elements are added to a , the capacity is automatically increased as required through reallocation. The capacity can be decreased by calling . The growth factor is the number by which the current capacity is multiplied when a greater capacity is required. The growth factor is determined when the is constructed. @@ -237,7 +237,7 @@ This class implements a queue as a circular array. Objects stored in a is the number of elements the can hold. As elements are added to a , the capacity is automatically increased as required through reallocation. The capacity can be decreased by calling . + The capacity of a is the number of elements the can hold. As elements are added to a , the capacity is automatically increased as required through reallocation. The capacity can be decreased by calling . The growth factor is the number by which the current capacity is multiplied when a greater capacity is required. The growth factor is determined when the is constructed. @@ -297,7 +297,7 @@ This class implements a queue as a circular array. Objects stored in a is the number of elements the can hold. As elements are added to a , the capacity is automatically increased as required through reallocation. The capacity can be decreased by calling . + The capacity of a is the number of elements the can hold. As elements are added to a , the capacity is automatically increased as required through reallocation. The capacity can be decreased by calling . The growth factor is the number by which the current capacity is multiplied when a greater capacity is required. The growth factor is determined when the is constructed. @@ -358,7 +358,7 @@ This class implements a queue as a circular array. Objects stored in a is the number of elements the can hold. As elements are added to a , the capacity is automatically increased as required through reallocation. The capacity can be decreased by calling . + The capacity of a is the number of elements the can hold. As elements are added to a , the capacity is automatically increased as required through reallocation. The capacity can be decreased by calling . The growth factor is the number by which the current capacity is multiplied when a greater capacity is required. The growth factor is determined when the is constructed. The capacity of the will always increase by a minimum value, regardless of the growth factor; a growth factor of 1.0 will not prevent the from increasing in size. @@ -421,11 +421,11 @@ This class implements a queue as a circular array. Objects stored in a is set to zero, and references to other objects from elements of the collection are also released. + is set to zero, and references to other objects from elements of the collection are also released. - The capacity remains unchanged. To reset the capacity of the , call . Trimming an empty sets the capacity of the to the default capacity. + The capacity remains unchanged. To reset the capacity of the , call . Trimming an empty sets the capacity of the to the default capacity. - This method is an `O(n)` operation, where `n` is . + This method is an `O(n)` operation, where `n` is . @@ -493,7 +493,7 @@ This class implements a queue as a circular array. Objects stored in a . + This method is an `O(n)` operation, where `n` is . ]]> @@ -550,11 +550,11 @@ This class implements a queue as a circular array. Objects stored in a . + This method determines equality by calling . - This method performs a linear search; therefore, this method is an `O(n)` operation, where `n` is . + This method performs a linear search; therefore, this method is an `O(n)` operation, where `n` is . -This method uses the collection's objects' and methods on `obj` to determine whether `item` exists. +This method uses the collection's objects' and methods on `obj` to determine whether `item` exists. ]]> @@ -616,7 +616,7 @@ This method uses the collection's objects' and in the same order in which the enumerator iterates through the . - This method is an `O(n)` operation, where `n` is . + This method is an `O(n)` operation, where `n` is . @@ -689,11 +689,11 @@ This method uses the collection's objects' and is the number of elements that the can store. is the number of elements that are actually in the . + The capacity of a is the number of elements that the can store. is the number of elements that are actually in the . - The capacity of a is always greater than or equal to . If exceeds the capacity while adding elements, the capacity is automatically increased by reallocating the internal array before copying the old elements and adding the new elements. The new capacity is determined by multiplying the current capacity by the growth factor, which is determined when the is constructed. The capacity of the will always increase by a minimum value, regardless of the growth factor; a growth factor of 1.0 will not prevent the from increasing in size. + The capacity of a is always greater than or equal to . If exceeds the capacity while adding elements, the capacity is automatically increased by reallocating the internal array before copying the old elements and adding the new elements. The new capacity is determined by multiplying the current capacity by the growth factor, which is determined when the is constructed. The capacity of the will always increase by a minimum value, regardless of the growth factor; a growth factor of 1.0 will not prevent the from increasing in size. - The capacity can be decreased by calling . + The capacity can be decreased by calling . Retrieving the value of this property is an `O(1)` operation. @@ -748,7 +748,7 @@ This method uses the collection's objects' and method, but does not modify the . + This method is similar to the method, but does not modify the . `null` can be added to the as a value. To distinguish between a null value and the end of the , check the property or catch the , which is thrown when the is empty. @@ -818,11 +818,11 @@ This method uses the collection's objects' and is the number of elements the can hold. As elements are added to a , the capacity is automatically increased as required through reallocation. The capacity can be decreased by calling . + The capacity of a is the number of elements the can hold. As elements are added to a , the capacity is automatically increased as required through reallocation. The capacity can be decreased by calling . The growth factor is the number by which the current capacity is multiplied when a greater capacity is required. The growth factor is determined when the is constructed. The capacity of the will always increase by a minimum value, regardless of the growth factor; a growth factor of 1.0 will not prevent the from increasing in size. - If is less than the capacity of the internal array, this method is an `O(1)` operation. If the internal array needs to be reallocated to accommodate the new element, this method becomes an `O(n)` operation, where `n` is . + If is less than the capacity of the internal array, this method is an `O(1)` operation. If the internal array needs to be reallocated to accommodate the new element, this method becomes an `O(n)` operation, where `n` is . @@ -891,11 +891,11 @@ This method uses the collection's objects' and also brings the enumerator back to this position. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. also brings the enumerator back to this position. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . - returns the same object until either or is called. sets to the next element. + returns the same object until either or is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. To set to the first element of the collection again, you can call followed by . + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. To set to the first element of the collection again, you can call followed by . An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and its behavior is undefined. @@ -957,14 +957,14 @@ This method uses the collection's objects' and , all operations must be done through the wrapper returned by the method. + To guarantee the thread safety of the , all operations must be done through the wrapper returned by the method. Enumerating through a collection is intrinsically not a thread-safe procedure. Even when a collection is synchronized, other threads can still modify the collection, which causes the enumerator to throw an exception. To guarantee thread safety during enumeration, you can either lock the collection during the entire enumeration or catch the exceptions resulting from changes made by other threads. ## Examples - The following code example shows how to lock the collection using the during the entire enumeration. Retrieving the value of this property is an `O(1)` operation. + The following code example shows how to lock the collection using the during the entire enumeration. Retrieving the value of this property is an `O(1)` operation. :::code language="csharp" source="~/snippets/csharp/System.Collections/Queue/IsSynchronized/source2.cs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections/Queue/IsSynchronized/source2.vb" id="Snippet2"::: @@ -1027,7 +1027,7 @@ This method uses the collection's objects' and method, but does not modify the . + This method is similar to the method, but does not modify the . `null` can be added to the as a value. To distinguish between a null value and the end of the , check the property or catch the , which is thrown when the is empty. @@ -1106,7 +1106,7 @@ This method uses the collection's objects' and during the entire enumeration. This method is an `O(1)` operation. + The following code example shows how to lock the collection using the during the entire enumeration. This method is an `O(1)` operation. :::code language="csharp" source="~/snippets/csharp/System.Collections/Queue/IsSynchronized/source2.cs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections/Queue/IsSynchronized/source2.vb" id="Snippet2"::: @@ -1172,14 +1172,14 @@ This method uses the collection's objects' and , use the method. However, derived classes can provide their own synchronized version of the using the property. The synchronizing code must perform operations on the of the , not directly on the . This ensures proper operation of collections that are derived from other objects. Specifically, it maintains proper synchronization with other threads that might be simultaneously modifying the object. + To create a synchronized version of the , use the method. However, derived classes can provide their own synchronized version of the using the property. The synchronizing code must perform operations on the of the , not directly on the . This ensures proper operation of collections that are derived from other objects. Specifically, it maintains proper synchronization with other threads that might be simultaneously modifying the object. Enumerating through a collection is intrinsically not a thread-safe procedure. Even when a collection is synchronized, other threads can still modify the collection, which causes the enumerator to throw an exception. To guarantee thread safety during enumeration, you can either lock the collection during the entire enumeration or catch the exceptions resulting from changes made by other threads. ## Examples - The following code example shows how to lock the collection using the during the entire enumeration. Retrieving the value of this property is an `O(1)` operation. + The following code example shows how to lock the collection using the during the entire enumeration. Retrieving the value of this property is an `O(1)` operation. :::code language="csharp" source="~/snippets/csharp/System.Collections/Queue/IsSynchronized/source2.cs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections/Queue/IsSynchronized/source2.vb" id="Snippet2"::: @@ -1239,7 +1239,7 @@ This method uses the collection's objects' and is not modified. The order of the elements in the new array is the same as the order of the elements from the beginning of the to its end. - This method is an `O(n)` operation, where `n` is . + This method is an `O(n)` operation, where `n` is . @@ -1300,9 +1300,9 @@ This method uses the collection's objects' and to its initial state, call the method before calling . Trimming an empty sets the capacity of the to the default capacity. + To reset a to its initial state, call the method before calling . Trimming an empty sets the capacity of the to the default capacity. - This method is an `O(n)` operation, where `n` is . + This method is an `O(n)` operation, where `n` is . ]]> diff --git a/xml/System.Collections/ReadOnlyCollectionBase.xml b/xml/System.Collections/ReadOnlyCollectionBase.xml index 6c637011be3..ef664227ffc 100644 --- a/xml/System.Collections/ReadOnlyCollectionBase.xml +++ b/xml/System.Collections/ReadOnlyCollectionBase.xml @@ -77,7 +77,7 @@ A instance is always read-only. See for a modifiable version of this class. > [!IMPORTANT] -> We don't recommend that you use the `ReadOnlyCollectionBase` class for new development. Instead, we recommend that you use the generic class. For more information, see [Non-generic collections shouldn't be used](https://github.com/dotnet/platform-compat/blob/master/docs/DE0006.md) on GitHub. +> We don't recommend that you use the `ReadOnlyCollectionBase` class for new development. Instead, we recommend that you use the generic class. For more information, see [Non-generic collections shouldn't be used](https://github.com/dotnet/platform-compat/blob/master/docs/DE0006.md) on GitHub. ## Examples @@ -265,11 +265,11 @@ A instance is always read-only. Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection. - Initially, the enumerator is positioned before the first element in the collection. also brings the enumerator back to this position. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. also brings the enumerator back to this position. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . - returns the same object until either or is called. sets to the next element. + returns the same object until either or is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. To set to the first element of the collection again, you can call followed by . + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. To set to the first element of the collection again, you can call followed by . An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and its behavior is undefined. @@ -407,9 +407,9 @@ A instance is always read-only. ## Remarks The specified array must be of a compatible type. - This method uses to copy the elements. + This method uses to copy the elements. - This method is an `O(n)` operation, where `n` is . + This method is an `O(n)` operation, where `n` is . ]]> diff --git a/xml/System.Collections/SortedList.xml b/xml/System.Collections/SortedList.xml index d7f2eafb98f..f957d5b3e71 100644 --- a/xml/System.Collections/SortedList.xml +++ b/xml/System.Collections/SortedList.xml @@ -97,11 +97,11 @@ A element can be accessed by its key, like an element in any implementation, or by its index, like an element in any implementation. > [!IMPORTANT] -> We don't recommend that you use the `SortedList` class for new development. Instead, we recommend that you use the generic class. For more information, see [Non-generic collections shouldn't be used](https://github.com/dotnet/platform-compat/blob/master/docs/DE0006.md) on GitHub. +> We don't recommend that you use the `SortedList` class for new development. Instead, we recommend that you use the generic class. For more information, see [Non-generic collections shouldn't be used](https://github.com/dotnet/platform-compat/blob/master/docs/DE0006.md) on GitHub. A object internally maintains two arrays to store the elements of the list; that is, one array for the keys and another array for the associated values. Each element is a key/value pair that can be accessed as a object. A key cannot be `null`, but a value can be. - The capacity of a object is the number of elements the can hold. As elements are added to a , the capacity is automatically increased as required through reallocation. The capacity can be decreased by calling or by setting the property explicitly. + The capacity of a object is the number of elements the can hold. As elements are added to a , the capacity is automatically increased as required through reallocation. The capacity can be decreased by calling or by setting the property explicitly. **.NET Framework only:** For very large objects, you can increase the maximum capacity to 2 billion elements on a 64-bit system by setting the `enabled` attribute of the [``](/dotnet/framework/configure-apps/file-schema/runtime/gcallowverylargeobjects-element) configuration element to `true` in the run-time environment. @@ -670,15 +670,15 @@ A element can be accessed by its key, like ## Remarks The insertion point is determined based on the comparer selected, either explicitly or by default, when the object was created. - If already equals , the capacity of the object is increased by automatically reallocating the internal array, and the existing elements are copied to the new array before the new element is added. + If already equals , the capacity of the object is increased by automatically reallocating the internal array, and the existing elements are copied to the new array before the new element is added. - You can also use the property to add new elements by setting the value of a key that does not exist in the object (for example, `myCollection["myNonexistentKey"] = myValue`). However, if the specified key already exists in the , setting the property overwrites the old value. In contrast, the method does not modify existing elements. + You can also use the property to add new elements by setting the value of a key that does not exist in the object (for example, `myCollection["myNonexistentKey"] = myValue`). However, if the specified key already exists in the , setting the property overwrites the old value. In contrast, the method does not modify existing elements. The elements of a object are sorted by the keys either according to a specific implementation specified when the is created or according to the implementation provided by the keys themselves. A key cannot be `null`, but a value can be. - This method is an `O(n)` operation for unsorted data, where `n` is . It is an `O(log n)` operation if the new element is added at the end of the list. If insertion causes a resize, the operation is `O(n)`. + This method is an `O(n)` operation for unsorted data, where `n` is . It is an `O(log n)` operation if the new element is added at the end of the list. If insertion causes a resize, the operation is `O(n)`. @@ -755,11 +755,11 @@ A element can be accessed by its key, like is the number of elements that the object can store. is the number of elements that are actually in the . + is the number of elements that the object can store. is the number of elements that are actually in the . - is always greater than or equal to . If exceeds while adding elements, the capacity is automatically increased by reallocating the internal array before copying the old elements and adding the new elements. + is always greater than or equal to . If exceeds while adding elements, the capacity is automatically increased by reallocating the internal array before copying the old elements and adding the new elements. - The capacity can be decreased by calling or by setting the property explicitly. When the value of is set explicitly, the internal array is also reallocated to accommodate the specified capacity. + The capacity can be decreased by calling or by setting the property explicitly. When the value of is set explicitly, the internal array is also reallocated to accommodate the specified capacity. Retrieving the value of this property is an `O(1)` operation; setting the property is an `O(n)` operation, where `n` is the new capacity. @@ -818,11 +818,11 @@ A element can be accessed by its key, like is set to zero and references to other objects from elements of the collection are also released. + is set to zero and references to other objects from elements of the collection are also released. - remains unchanged. To reset the capacity of the object, call or set the property directly. Trimming an empty sets the capacity of the to the default capacity. + remains unchanged. To reset the capacity of the object, call or set the property directly. Trimming an empty sets the capacity of the to the default capacity. - This method is an `O(n)` operation, where `n` is . + This method is an `O(n)` operation, where `n` is . @@ -897,7 +897,7 @@ A element can be accessed by its key, like In contrast, a deep copy of a collection copies the elements and everything directly or indirectly referenced by the elements. - This method is an `O(n)` operation, where `n` is . + This method is an `O(n)` operation, where `n` is . ]]> @@ -959,11 +959,11 @@ A element can be accessed by its key, like ## Remarks The elements of a object are sorted by the keys either according to a specific implementation specified when the is created or according to the implementation provided by the keys themselves. - implements . It behaves exactly as . + implements . It behaves exactly as . - This method uses a binary search algorithm; therefore, this method is an `O(log n)` operation, where `n` is . + This method uses a binary search algorithm; therefore, this method is an `O(log n)` operation, where `n` is . -This method uses the collection's objects' and methods on `item` to determine whether `item` exists. +This method uses the collection's objects' and methods on `item` to determine whether `item` exists. ## Examples The following code example shows how to determine whether a object contains a specific element. @@ -1033,11 +1033,11 @@ This method uses the collection's objects' and object are sorted by the keys either according to a specific implementation specified when the is created or according to the implementation provided by the keys themselves. - This method behaves exactly as the method. + This method behaves exactly as the method. - This method uses a binary search algorithm; therefore, this method is an `O(log n)` operation, where `n` is . + This method uses a binary search algorithm; therefore, this method is an `O(log n)` operation, where `n` is . -This method uses the collection's objects' and methods on `item` to determine whether `item` exists. +This method uses the collection's objects' and methods on `item` to determine whether `item` exists. ## Examples The following code example shows how to determine whether a object contains a specific element. @@ -1107,11 +1107,11 @@ This method uses the collection's objects' and object are compared to the specified value using the method. + The values of the elements of the object are compared to the specified value using the method. - This method performs a linear search; therefore, the average execution time is proportional to . That is, this method is an `O(n)` operation, where `n` is . + This method performs a linear search; therefore, the average execution time is proportional to . That is, this method is an `O(n)` operation, where `n` is . -This method uses the collection's objects' and methods on `item` to determine whether `item` exists. +This method uses the collection's objects' and methods on `item` to determine whether `item` exists. ## Examples The following code example shows how to determine whether a object contains a specific element. @@ -1185,7 +1185,7 @@ This method uses the collection's objects' and , use `SortedList.Values.CopyTo`. - This method is an `O(n)` operation, where `n` is . + This method is an `O(n)` operation, where `n` is . @@ -1263,9 +1263,9 @@ This method uses the collection's objects' and object. - is the number of elements that the object can store. is the number of elements that are actually in the . + is the number of elements that the object can store. is the number of elements that are actually in the . - is always greater than or equal to . If exceeds while adding elements, the capacity is automatically increased by reallocating the internal array before copying the old elements and adding the new elements. + is always greater than or equal to . If exceeds while adding elements, the capacity is automatically increased by reallocating the internal array before copying the old elements and adding the new elements. Retrieving the value of this property is an `O(1)` operation. @@ -1397,11 +1397,11 @@ This method uses the collection's objects' and also brings the enumerator back to this position. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. also brings the enumerator back to this position. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . - returns the same object until either or is called. sets to the next element. + returns the same object until either or is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. To set to the first element of the collection again, you can call followed by . + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. To set to the first element of the collection again, you can call followed by . An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and its behavior is undefined. @@ -1673,9 +1673,9 @@ This method uses the collection's objects' and in the correct sort order, and the indexing adjusts accordingly. When an element is removed, the indexing also adjusts accordingly. Therefore, the index of a specific key/value pair might change as elements are added or removed from the . - This method uses a binary search algorithm; therefore, this method is an `O(log n)` operation, where `n` is . + This method uses a binary search algorithm; therefore, this method is an `O(log n)` operation, where `n` is . -This method uses the collection's objects' and methods on `item` to determine whether `item` exists. +This method uses the collection's objects' and methods on `item` to determine whether `item` exists. ## Examples The following code example shows how to determine the index of a key or a value in a object. @@ -1745,11 +1745,11 @@ This method uses the collection's objects' and in the correct sort order, and the indexing adjusts accordingly. When an element is removed, the indexing also adjusts accordingly. Therefore, the index of a specific key/value pair might change as elements are added or removed from the object. - The values of the elements of the are compared to the specified value using the method. + The values of the elements of the are compared to the specified value using the method. - This method uses a linear search; therefore, this method is an `O(n)` operation, where `n` is . + This method uses a linear search; therefore, this method is an `O(n)` operation, where `n` is . -This method uses the collection's objects' and methods on `item` to determine whether `item` exists. +This method uses the collection's objects' and methods on `item` to determine whether `item` exists. ## Examples The following code example shows how to determine the index of a key or a value in a object. @@ -1931,7 +1931,7 @@ This method uses the collection's objects' and object, all operations must be done through the wrapper returned by the method. + To guarantee the thread safety of a object, all operations must be done through the wrapper returned by the method. Enumerating through a collection is intrinsically not a thread-safe procedure. Even when a collection is synchronized, other threads can still modify the collection, which causes the enumerator to throw an exception. To guarantee thread safety during enumeration, you can either lock the collection during the entire enumeration or catch the exceptions resulting from changes made by other threads. @@ -2017,15 +2017,15 @@ This method uses the collection's objects' and property to access a specific element in a collection by specifying the following syntax: `myCollection[key]`. - You can also use this property to add new elements by setting the value of a key that does not exist in the object (for example, `myCollection["myNonexistentKey"] = myValue)`. However, if the specified key already exists in the , setting the property overwrites the old value. In contrast, the method does not modify existing elements. + You can also use this property to add new elements by setting the value of a key that does not exist in the object (for example, `myCollection["myNonexistentKey"] = myValue)`. However, if the specified key already exists in the , setting the property overwrites the old value. In contrast, the method does not modify existing elements. - A key cannot be `null`, but a value can be. To distinguish between `null` that is returned because the specified key is not found and `null` that is returned because the value of the specified key is `null`, use the method or the method to determine if the key exists in the list. + A key cannot be `null`, but a value can be. To distinguish between `null` that is returned because the specified key is not found and `null` that is returned because the value of the specified key is `null`, use the method or the method to determine if the key exists in the list. The elements of a are sorted by the keys either according to a specific implementation specified when the is created or according to the implementation provided by the keys themselves. - The C# language uses the [`this`](/dotnet/csharp/language-reference/keywords/this) keyword to define the indexers instead of implementing the property. Visual Basic implements as a default property, which provides the same indexing functionality. + The C# language uses the [`this`](/dotnet/csharp/language-reference/keywords/this) keyword to define the indexers instead of implementing the property. Visual Basic implements as a default property, which provides the same indexing functionality. - Retrieving the value of this property is an `O(log n)` operation, where `n` is . Setting the property is an `O(log n)` operation if the key is already in the . If the key is not in the list, setting the property is an `O(n)` operation for unsorted data, or `O(log n)` if the new element is added at the end of the list. If insertion causes a resize, the operation is `O(n)`. + Retrieving the value of this property is an `O(log n)` operation, where `n` is . Setting the property is an `O(log n)` operation if the key is already in the . If the key is not in the list, setting the property is an `O(n)` operation for unsorted data, or `O(log n)` if the new element is added at the end of the list. If insertion causes a resize, the operation is `O(n)`. ]]> @@ -2096,7 +2096,7 @@ This method uses the collection's objects' and are sorted in the same order as the keys of the . - This property is similar to the method, but returns an object instead of an object. + This property is similar to the method, but returns an object instead of an object. This method is an `O(1)` operation. @@ -2163,7 +2163,7 @@ This method uses the collection's objects' and . + This method is an `O(n)` operation, where `n` is . @@ -2238,7 +2238,7 @@ This method uses the collection's objects' and . + This method is an `O(n)` operation, where `n` is . @@ -2455,7 +2455,7 @@ This method uses the collection's objects' and object, use the method. However, derived classes can provide their own synchronized version of the using the property. The synchronizing code must perform operations on the of the , not directly on the . This ensures proper operation of collections that are derived from other objects. Specifically, it maintains proper synchronization with other threads that might be simultaneously modifying the object. + To create a synchronized version of the object, use the method. However, derived classes can provide their own synchronized version of the using the property. The synchronizing code must perform operations on the of the , not directly on the . This ensures proper operation of collections that are derived from other objects. Specifically, it maintains proper synchronization with other threads that might be simultaneously modifying the object. Enumerating through a collection is intrinsically not a thread-safe procedure. Even when a collection is synchronized, other threads can still modify the collection, which causes the enumerator to throw an exception. To guarantee thread safety during enumeration, you can either lock the collection during the entire enumeration or catch the exceptions resulting from changes made by other threads. @@ -2529,13 +2529,13 @@ This method uses the collection's objects' and also brings the enumerator back to this position. At this position, calling throws an exception. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. also brings the enumerator back to this position. At this position, calling throws an exception. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . - returns the same object until either or is called. sets to the next element. + returns the same object until either or is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, calling throws an exception. To set to the first element of the collection again, you can call followed by . + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, calling throws an exception. To set to the first element of the collection again, you can call followed by . - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . If the collection is modified between and , returns the element that it is set to, even if the enumerator is already invalidated. + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . If the collection is modified between and , returns the element that it is set to, even if the enumerator is already invalidated. The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread-safe procedure. Even when a collection is synchronized, other threads can still modify the collection, which causes the enumerator to throw an exception. To guarantee thread safety during enumeration, you can either lock the collection during the entire enumeration or catch the exceptions resulting from changes made by other threads. @@ -2594,9 +2594,9 @@ This method uses the collection's objects' and object to its initial state, call the method before calling . Trimming an empty sets the capacity of the to the default capacity. + To reset a object to its initial state, call the method before calling . Trimming an empty sets the capacity of the to the default capacity. - This method is an `O(n)` operation, where `n` is . + This method is an `O(n)` operation, where `n` is . @@ -2670,7 +2670,7 @@ This method uses the collection's objects' and are sorted in the same order as the values of the . - This property is similar to the method, but returns an object instead of an object. + This property is similar to the method, but returns an object instead of an object. This method is an `O(1)` operation. diff --git a/xml/System.Collections/Stack.xml b/xml/System.Collections/Stack.xml index f7de981b4b7..debe7f25b0d 100644 --- a/xml/System.Collections/Stack.xml +++ b/xml/System.Collections/Stack.xml @@ -93,9 +93,9 @@ The capacity of a is the number of elements the can hold. As elements are added to a , the capacity is automatically increased as required through reallocation. > [!IMPORTANT] -> We don't recommend that you use the `Stack` class for new development. Instead, we recommend that you use the generic class. For more information, see [Non-generic collections shouldn't be used](https://github.com/dotnet/platform-compat/blob/master/docs/DE0006.md) on GitHub. +> We don't recommend that you use the `Stack` class for new development. Instead, we recommend that you use the generic class. For more information, see [Non-generic collections shouldn't be used](https://github.com/dotnet/platform-compat/blob/master/docs/DE0006.md) on GitHub. -If is less than the capacity of the stack, is an `O(1)` operation. If the capacity needs to be increased to accommodate the new element, becomes an `O(n)` operation, where `n` is . is an `O(1)` operation. +If is less than the capacity of the stack, is an `O(1)` operation. If the capacity needs to be increased to accommodate the new element, becomes an `O(n)` operation, where `n` is . is an `O(1)` operation. accepts `null` as a valid value and allows duplicate elements. @@ -341,9 +341,9 @@ If is less than the capacity of the sta is set to zero, and references to other objects from elements of the collection are also released. + is set to zero, and references to other objects from elements of the collection are also released. - This method is an `O(n)` operation, where `n` is . + This method is an `O(n)` operation, where `n` is . @@ -410,7 +410,7 @@ If is less than the capacity of the sta In contrast, a deep copy of a collection copies the elements and everything directly or indirectly referenced by the elements. - This method is an `O(n)` operation, where `n` is . + This method is an `O(n)` operation, where `n` is . ]]> @@ -467,11 +467,11 @@ If is less than the capacity of the sta method. + This method determines equality by calling the method. - This method performs a linear search; therefore, this method is an `O(n)` operation, where `n` is . + This method performs a linear search; therefore, this method is an `O(n)` operation, where `n` is . -This method tests for equality by passing the `obj` argument to the method of individual objects in the collection. +This method tests for equality by passing the `obj` argument to the method of individual objects in the collection. ]]> @@ -531,9 +531,9 @@ This method tests for equality by passing the `obj` argument to the . + The elements are copied onto the array in last-in-first-out (LIFO) order, similar to the order of the elements returned by a succession of calls to . - This method is an `O(n)` operation, where `n` is . + This method is an `O(n)` operation, where `n` is . @@ -607,9 +607,9 @@ This method tests for equality by passing the `obj` argument to the can store. is the number of elements that are actually in the . + The capacity is the number of elements that the can store. is the number of elements that are actually in the . - The capacity is always greater than or equal to . If exceeds the capacity while adding elements, the capacity is automatically increased by reallocating the internal array before copying the old elements and adding the new elements. + The capacity is always greater than or equal to . If exceeds the capacity while adding elements, the capacity is automatically increased by reallocating the internal array before copying the old elements and adding the new elements. Retrieving the value of this property is an `O(1)` operation. @@ -671,11 +671,11 @@ This method tests for equality by passing the `obj` argument to the also brings the enumerator back to this position. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. also brings the enumerator back to this position. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . - returns the same object until either or is called. sets to the next element. + returns the same object until either or is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. To set to the first element of the collection again, you can call followed by . + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. To set to the first element of the collection again, you can call followed by . An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and its behavior is undefined. @@ -737,11 +737,11 @@ This method tests for equality by passing the `obj` argument to the , all operations must be done through the wrapper returned by the method. + To guarantee the thread safety of the , all operations must be done through the wrapper returned by the method. Enumerating through a collection is intrinsically not a thread-safe procedure. Even when a collection is synchronized, other threads can still modify the collection, which causes the enumerator to throw an exception. To guarantee thread safety during enumeration, you can either lock the collection during the entire enumeration or catch the exceptions resulting from changes made by other threads. - The following code example shows how to lock the collection using the during the entire enumeration. + The following code example shows how to lock the collection using the during the entire enumeration. :::code language="csharp" source="~/snippets/csharp/System.Collections/Stack/IsSynchronized/source2.cs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections/Stack/IsSynchronized/source2.vb" id="Snippet2"::: @@ -807,7 +807,7 @@ This method tests for equality by passing the `obj` argument to the method, but does not modify the . + This method is similar to the method, but does not modify the . `null` can be pushed onto the as a placeholder, if needed. To distinguish between a null value and the end of the stack, check the property or catch the , which is thrown when the is empty. @@ -875,7 +875,7 @@ This method tests for equality by passing the `obj` argument to the method, but does not modify the . + This method is similar to the method, but does not modify the . `null` can be pushed onto the as a placeholder, if needed. To distinguish between a null value and the end of the stack, check the property or catch the , which is thrown when the is empty. @@ -945,11 +945,11 @@ This method tests for equality by passing the `obj` argument to the already equals the capacity, the capacity of the is increased by automatically reallocating the internal array, and the existing elements are copied to the new array before the new element is added. + If already equals the capacity, the capacity of the is increased by automatically reallocating the internal array, and the existing elements are copied to the new array before the new element is added. `null` can be pushed onto the as a placeholder, if needed. It occupies a slot in the stack and is treated like any object. - If is less than the capacity of the stack, is an `O(1)` operation. If the capacity needs to be increased to accommodate the new element, becomes an `O(n)` operation, where `n` is . + If is less than the capacity of the stack, is an `O(1)` operation. If the capacity needs to be increased to accommodate the new element, becomes an `O(n)` operation, where `n` is . @@ -1018,7 +1018,7 @@ This method tests for equality by passing the `obj` argument to the during the entire enumeration. + The following code example shows how to lock the collection using the during the entire enumeration. :::code language="csharp" source="~/snippets/csharp/System.Collections/Stack/IsSynchronized/source2.cs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections/Stack/IsSynchronized/source2.vb" id="Snippet2"::: @@ -1087,11 +1087,11 @@ This method tests for equality by passing the `obj` argument to the , use the method. However, derived classes can provide their own synchronized version of the using the property. The synchronizing code must perform operations on the of the , not directly on the . This ensures proper operation of collections that are derived from other objects. Specifically, it maintains proper synchronization with other threads that might be simultaneously modifying the object. + To create a synchronized version of the , use the method. However, derived classes can provide their own synchronized version of the using the property. The synchronizing code must perform operations on the of the , not directly on the . This ensures proper operation of collections that are derived from other objects. Specifically, it maintains proper synchronization with other threads that might be simultaneously modifying the object. Enumerating through a collection is intrinsically not a thread-safe procedure. Even when a collection is synchronized, other threads can still modify the collection, which causes the enumerator to throw an exception. To guarantee thread safety during enumeration, you can either lock the collection during the entire enumeration or catch the exceptions resulting from changes made by other threads. - The following code example shows how to lock the collection using the during the entire enumeration. + The following code example shows how to lock the collection using the during the entire enumeration. :::code language="csharp" source="~/snippets/csharp/System.Collections/Stack/IsSynchronized/source2.cs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System.Collections/Stack/IsSynchronized/source2.vb" id="Snippet2"::: @@ -1149,9 +1149,9 @@ This method tests for equality by passing the `obj` argument to the . + The elements are copied onto the array in last-in-first-out (LIFO) order, similar to the order of the elements returned by a succession of calls to . - This method is an `O(n)` operation, where `n` is . + This method is an `O(n)` operation, where `n` is . diff --git a/xml/System.Collections/StructuralComparisons.xml b/xml/System.Collections/StructuralComparisons.xml index b649baa9a9f..476ce362e3c 100644 --- a/xml/System.Collections/StructuralComparisons.xml +++ b/xml/System.Collections/StructuralComparisons.xml @@ -58,9 +58,9 @@ ## Remarks The class returns the following two predefined comparison objects: -- An implementation that can be passed to a method such as or to perform a structural comparison of two objects. It is designed to indicate whether the first object precedes, follows, or occurs in the same position as the second object in the sort order. +- An implementation that can be passed to a method such as or to perform a structural comparison of two objects. It is designed to indicate whether the first object precedes, follows, or occurs in the same position as the second object in the sort order. -- An implementation that can be passed to a method such as or to perform a comparison for structural equality. +- An implementation that can be passed to a method such as or to perform a comparison for structural equality. The objects can be used to perform a structural comparison or a structural equality comparison of two collection objects, such as array or tuple objects. In structural comparison, two objects are compared based on their values. Objects can be ordered based on some criteria, and two objects are considered equal when they have equal values, not because they reference the same physical object @@ -111,11 +111,11 @@ object returned by this property is passed to the comparison method of a collection object, such as or , its method is called for each member of an array or for each component of a tuple. This implementation of the method behaves as follows when it compares each item of a collection object with the corresponding item of another collection object: + When the object returned by this property is passed to the comparison method of a collection object, such as or , its method is called for each member of an array or for each component of a tuple. This implementation of the method behaves as follows when it compares each item of a collection object with the corresponding item of another collection object: - It considers two items that are `null` to be equal, and considers a null item to be less than an item that is not null. -- If the first item in the comparison can be cast to an object (in other words, if it is a collection object that implements the interface), it calls the method. +- If the first item in the comparison can be cast to an object (in other words, if it is a collection object that implements the interface), it calls the method. - If the first item in the comparison cannot be cast to an object (in other words, if it is not a collection object that implements the interface), it calls the `Comparer.Default.Compare` method. @@ -167,13 +167,13 @@ object returned by this property is passed to the equality comparison method of a collection object, such as or , its method is called for each member of an array or for each component of a tuple. This implementation of the method behaves as follows when it compares each item of a collection object with the corresponding item of another collection object: + When the object returned by this property is passed to the equality comparison method of a collection object, such as or , its method is called for each member of an array or for each component of a tuple. This implementation of the method behaves as follows when it compares each item of a collection object with the corresponding item of another collection object: - If both items are `null`, it considers the two items to be equal. - If one item is null but the other item is not, it considers the two items to be unequal. -- If the first item in the comparison can be cast to an object (in other words, if it is a collection object that implements the interface), it calls the method. +- If the first item in the comparison can be cast to an object (in other words, if it is a collection object that implements the interface), it calls the method. - If the first item in the comparison cannot be cast to an object (in other words, if it is not a collection object that implements the interface), it calls the item's `Equals` method. diff --git a/xml/System.ComponentModel.Composition.Hosting/AggregateCatalog.xml b/xml/System.ComponentModel.Composition.Hosting/AggregateCatalog.xml index c82420660f4..76302d4e1c0 100644 --- a/xml/System.ComponentModel.Composition.Hosting/AggregateCatalog.xml +++ b/xml/System.ComponentModel.Composition.Hosting/AggregateCatalog.xml @@ -35,13 +35,13 @@ A catalog that combines the elements of objects. - [!IMPORTANT] -> This type implements the interface. When you have finished using the type, you should dispose of it either directly or indirectly. To dispose of the type directly, call its method in a `try`/`catch` block. To dispose of it indirectly, use a language construct such as `using` (in C#) or `Using` (in Visual Basic). For more information, see the "Using an Object that Implements IDisposable" section in the interface topic. - +> This type implements the interface. When you have finished using the type, you should dispose of it either directly or indirectly. To dispose of the type directly, call its method in a `try`/`catch` block. To dispose of it indirectly, use a language construct such as `using` (in C#) or `Using` (in Visual Basic). For more information, see the "Using an Object that Implements IDisposable" section in the interface topic. + ]]> diff --git a/xml/System.ComponentModel.Composition.Hosting/AggregateExportProvider.xml b/xml/System.ComponentModel.Composition.Hosting/AggregateExportProvider.xml index 9068ea4e585..8335800bb49 100644 --- a/xml/System.ComponentModel.Composition.Hosting/AggregateExportProvider.xml +++ b/xml/System.ComponentModel.Composition.Hosting/AggregateExportProvider.xml @@ -35,13 +35,13 @@ Retrieves exports provided by a collection of objects. - [!IMPORTANT] -> This type implements the interface. When you have finished using the type, you should dispose of it either directly or indirectly. To dispose of the type directly, call its method in a `try`/`catch` block. To dispose of it indirectly, use a language construct such as `using` (in C#) or `Using` (in Visual Basic). For more information, see the "Using an Object that Implements IDisposable" section in the interface topic. - +> This type implements the interface. When you have finished using the type, you should dispose of it either directly or indirectly. To dispose of the type directly, call its method in a `try`/`catch` block. To dispose of it indirectly, use a language construct such as `using` (in C#) or `Using` (in Visual Basic). For more information, see the "Using an Object that Implements IDisposable" section in the interface topic. + ]]> @@ -84,13 +84,13 @@ The prioritized list of export providers. The providers are consulted in the order in which they are supplied. Initializes a new instance of the class. - class consults the providers in the order in which they have been specified when it calls . - - The does not take ownership of the specified providers. That is, it tries to dispose of any of the providers when it is disposed. - + class consults the providers in the order in which they have been specified when it calls . + + The does not take ownership of the specified providers. That is, it tries to dispose of any of the providers when it is disposed. + ]]> One or more elements of are . @@ -128,13 +128,13 @@ The prioritized list of export providers. Initializes a new instance of the class. - class consults the providers in the order in which they have been specified when it calls . - - The does not take ownership of the specified providers. That is, it tries to dispose of any of the providers when it is disposed. - + class consults the providers in the order in which they have been specified when it calls . + + The does not take ownership of the specified providers. That is, it tries to dispose of any of the providers when it is disposed. + ]]> @@ -175,16 +175,16 @@ Releases all resources used by the current instance of the class. - . The `Dispose` method leaves the in an unusable state. After calling `Dispose`, you must release all references to the so the garbage collector can reclaim the memory that the was occupying. - - For more information, see [Cleaning Up Unmanaged Resources](/dotnet/standard/garbage-collection/unmanaged) and [Implementing a Dispose Method](/dotnet/standard/garbage-collection/implementing-dispose). - + . The `Dispose` method leaves the in an unusable state. After calling `Dispose`, you must release all references to the so the garbage collector can reclaim the memory that the was occupying. + + For more information, see [Cleaning Up Unmanaged Resources](/dotnet/standard/garbage-collection/unmanaged) and [Implementing a Dispose Method](/dotnet/standard/garbage-collection/implementing-dispose). + > [!NOTE] -> Always call `Dispose` before you release your last reference to the . Otherwise, the resources it is using will not be freed until the garbage collector calls the object's `Finalize` method. - +> Always call `Dispose` before you release your last reference to the . Otherwise, the resources it is using will not be freed until the garbage collector calls the object's `Finalize` method. + ]]> @@ -249,13 +249,13 @@ Gets all the exports that match the conditions of the specified import. A collection that contains all the exports that match the specified condition. - collection of . - + collection of . + ]]> diff --git a/xml/System.ComponentModel.Composition.Hosting/ApplicationCatalog.xml b/xml/System.ComponentModel.Composition.Hosting/ApplicationCatalog.xml index 80515df9f92..3e6883c5d56 100644 --- a/xml/System.ComponentModel.Composition.Hosting/ApplicationCatalog.xml +++ b/xml/System.ComponentModel.Composition.Hosting/ApplicationCatalog.xml @@ -35,13 +35,13 @@ Discovers attributed parts in the dynamic link library (DLL) and EXE files in an application's directory and path. - [!IMPORTANT] -> This type implements the interface. When you have finished using the type, you should dispose of it either directly or indirectly. To dispose of the type directly, call its method in a `try`/`catch` block. To dispose of it indirectly, use a language construct such as `using` (in C#) or `Using` (in Visual Basic). For more information, see the "Using an Object that Implements IDisposable" section in the interface topic. - +> This type implements the interface. When you have finished using the type, you should dispose of it either directly or indirectly. To dispose of the type directly, call its method in a `try`/`catch` block. To dispose of it indirectly, use a language construct such as `using` (in C#) or `Using` (in Visual Basic). For more information, see the "Using an Object that Implements IDisposable" section in the interface topic. + ]]> @@ -243,11 +243,11 @@ Gets the display name of the application catalog. A string that contains a human-readable display name of the object. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -282,11 +282,11 @@ Gets the composition element from which the application catalog originated. Always . - instance is cast to an interface. - + instance is cast to an interface. + ]]> diff --git a/xml/System.ComponentModel.Composition.Hosting/AssemblyCatalog.xml b/xml/System.ComponentModel.Composition.Hosting/AssemblyCatalog.xml index 6376c70b154..f690e145b43 100644 --- a/xml/System.ComponentModel.Composition.Hosting/AssemblyCatalog.xml +++ b/xml/System.ComponentModel.Composition.Hosting/AssemblyCatalog.xml @@ -45,7 +45,7 @@ An is used to parse all the parts present in a specified assembly. The target assembly can be indicated either by object reference or by path. > [!IMPORTANT] -> This type implements the interface. When you have finished using the type, you should dispose of it either directly or indirectly. To dispose of the type directly, call its method in a `try`/`catch` block. To dispose of it indirectly, use a language construct such as `using` (in C#) or `Using` (in Visual Basic). For more information, see the "Using an Object that Implements IDisposable" section in the interface topic. +> This type implements the interface. When you have finished using the type, you should dispose of it either directly or indirectly. To dispose of the type directly, call its method in a `try`/`catch` block. To dispose of it indirectly, use a language construct such as `using` (in C#) or `Using` (in Visual Basic). For more information, see the "Using an Object that Implements IDisposable" section in the interface topic. This type is thread safe. @@ -490,7 +490,7 @@ The assembly referenced by `codeBase` is loaded into the Load context. matches the conditions defined by `definition`; instead, return an empty . +Overriders of this property should never return `null` if no matches the conditions defined by `definition`; instead, return an empty . ]]> diff --git a/xml/System.ComponentModel.Composition.Hosting/AtomicComposition.xml b/xml/System.ComponentModel.Composition.Hosting/AtomicComposition.xml index 5d95b0560df..b32d4036629 100644 --- a/xml/System.ComponentModel.Composition.Hosting/AtomicComposition.xml +++ b/xml/System.ComponentModel.Composition.Hosting/AtomicComposition.xml @@ -35,13 +35,13 @@ Represents a single composition operation for transactional composition. - [!IMPORTANT] -> This type implements the interface. When you have finished using the type, you should dispose of it either directly or indirectly. To dispose of the type directly, call its method in a `try`/`catch` block. To dispose of it indirectly, use a language construct such as `using` (in C#) or `Using` (in Visual Basic). For more information, see the "Using an Object that Implements IDisposable" section in the interface topic. - +> This type implements the interface. When you have finished using the type, you should dispose of it either directly or indirectly. To dispose of the type directly, call its method in a `try`/`catch` block. To dispose of it indirectly, use a language construct such as `using` (in C#) or `Using` (in Visual Basic). For more information, see the "Using an Object that Implements IDisposable" section in the interface topic. + ]]> @@ -173,11 +173,11 @@ Marks this composition operation as complete. - is nested, completion actions will not be executed until the parent composition operation has also completed. - + is nested, completion actions will not be executed until the parent composition operation has also completed. + ]]> @@ -215,16 +215,16 @@ Releases all resources used by the current instance of the class, and mark this composition operation as failed. - . The `Dispose` method leaves the in an unusable state. After calling `Dispose`, you must release all references to the so the garbage collector can reclaim the memory that the was occupying. - - For more information, see [Cleaning Up Unmanaged Resources](/dotnet/standard/garbage-collection/unmanaged) and [Implementing a Dispose Method](/dotnet/standard/garbage-collection/implementing-dispose). - + . The `Dispose` method leaves the in an unusable state. After calling `Dispose`, you must release all references to the so the garbage collector can reclaim the memory that the was occupying. + + For more information, see [Cleaning Up Unmanaged Resources](/dotnet/standard/garbage-collection/unmanaged) and [Implementing a Dispose Method](/dotnet/standard/garbage-collection/implementing-dispose). + > [!NOTE] -> Always call `Dispose` before you release your last reference to the . Otherwise, the resources it is using will not be freed until the garbage collector calls the object's `Finalize` method. - +> Always call `Dispose` before you release your last reference to the . Otherwise, the resources it is using will not be freed until the garbage collector calls the object's `Finalize` method. + ]]> diff --git a/xml/System.ComponentModel.Composition.Hosting/CatalogExportProvider.xml b/xml/System.ComponentModel.Composition.Hosting/CatalogExportProvider.xml index 1d2b6f57569..4bd00e0b71d 100644 --- a/xml/System.ComponentModel.Composition.Hosting/CatalogExportProvider.xml +++ b/xml/System.ComponentModel.Composition.Hosting/CatalogExportProvider.xml @@ -40,7 +40,7 @@ ## Remarks > [!IMPORTANT] -> This type implements the interface. When you have finished using the type, you should dispose of it either directly or indirectly. To dispose of the type directly, call its method in a `try`/`catch` block. To dispose of it indirectly, use a language construct such as `using` (in C#) or `Using` (in Visual Basic). For more information, see the "Using an Object that Implements IDisposable" section in the interface topic. +> This type implements the interface. When you have finished using the type, you should dispose of it either directly or indirectly. To dispose of the type directly, call its method in a `try`/`catch` block. To dispose of it indirectly, use a language construct such as `using` (in C#) or `Using` (in Visual Basic). For more information, see the "Using an Object that Implements IDisposable" section in the interface topic. ]]> @@ -272,7 +272,7 @@ method should return an empty collection of objects. + Implementers should not treat cardinality-related mismatches as errors and should not throw exceptions for cardinality-related mismatches. For example, if the import requests exactly one export and the provider has either no matching exports or more than one, the method should return an empty collection of objects. ]]> diff --git a/xml/System.ComponentModel.Composition.Hosting/ComposablePartExportProvider.xml b/xml/System.ComponentModel.Composition.Hosting/ComposablePartExportProvider.xml index 44a08beeb66..4ae4c710b44 100644 --- a/xml/System.ComponentModel.Composition.Hosting/ComposablePartExportProvider.xml +++ b/xml/System.ComponentModel.Composition.Hosting/ComposablePartExportProvider.xml @@ -40,7 +40,7 @@ ## Remarks > [!IMPORTANT] -> This type implements the interface. When you have finished using the type, you should dispose of it either directly or indirectly. To dispose of the type directly, call its method in a `try`/`catch` block. To dispose of it indirectly, use a language construct such as `using` (in C#) or `Using` (in Visual Basic). For more information, see the "Using an Object that Implements IDisposable" section in the interface topic. +> This type implements the interface. When you have finished using the type, you should dispose of it either directly or indirectly. To dispose of the type directly, call its method in a `try`/`catch` block. To dispose of it indirectly, use a language construct such as `using` (in C#) or `Using` (in Visual Basic). For more information, see the "Using an Object that Implements IDisposable" section in the interface topic. ]]> @@ -267,7 +267,7 @@ method should return an empty collection of objects. + Implementers should not treat cardinality-related mismatches as errors and should not throw exceptions for cardinality-related mismatches. For example, if the import requests exactly one export and the provider has no matching exports or more than one, the method should return an empty collection of objects. ]]> diff --git a/xml/System.ComponentModel.Composition.Hosting/CompositionContainer.xml b/xml/System.ComponentModel.Composition.Hosting/CompositionContainer.xml index a84e85a93e1..a27f9135796 100644 --- a/xml/System.ComponentModel.Composition.Hosting/CompositionContainer.xml +++ b/xml/System.ComponentModel.Composition.Hosting/CompositionContainer.xml @@ -44,17 +44,17 @@ A object serves two major purposes in an application. First, it keeps track of which parts are available for composition and what their dependencies are, and performs composition whenever the set of available parts changes. Second, it provides the methods by which the application gets instances of composed parts or fills the dependencies of a composable part. > [!IMPORTANT] -> This type implements the interface. When you have finished using the type, you should dispose of it either directly or indirectly. To dispose of the type directly, call its method in a `try`/`catch` block. To dispose of it indirectly, use a language construct such as `using` (in C#) or `Using` (in Visual Basic). For more information, see the "Using an Object that Implements IDisposable" section in the interface topic. +> This type implements the interface. When you have finished using the type, you should dispose of it either directly or indirectly. To dispose of the type directly, call its method in a `try`/`catch` block. To dispose of it indirectly, use a language construct such as `using` (in C#) or `Using` (in Visual Basic). For more information, see the "Using an Object that Implements IDisposable" section in the interface topic. Parts can be made available to the container either directly or through the property. All the parts discoverable in this are available to the container to fulfill imports, along with any parts added directly. - The method allows instantiated parts to be added to an existing container. Assuming composition is successful, these parts will have their imports filled with parts retrieved from the container, and their exports will be available to other parts. Imports marked as recomposable will be registered for recomposition. + The method allows instantiated parts to be added to an existing container. Assuming composition is successful, these parts will have their imports filled with parts retrieved from the container, and their exports will be available to other parts. Imports marked as recomposable will be registered for recomposition. - The method allows a part to have its imports filled without being added to the container. If the composition is successful, the part's imports will be filled, but the part's exports will not be available to other parts and no imports will be registered for recomposition. + The method allows a part to have its imports filled without being added to the container. If the composition is successful, the part's imports will be filled, but the part's exports will not be available to other parts and no imports will be registered for recomposition. - objects should always be disposed. When the method is called, the object also disposes all the parts that it has created. + objects should always be disposed. When the method is called, the object also disposes all the parts that it has created. - A object that can be accessed from multiple threads must be constructed with the `isThreadSafe` parameter set to `true`, using the constructor. Performance will be slightly slower when `isThreadSafe` is `true`, so we recommend that you set this parameter to `false` in single-threaded scenarios. The default is `false`. + A object that can be accessed from multiple threads must be constructed with the `isThreadSafe` parameter set to `true`, using the constructor. Performance will be slightly slower when `isThreadSafe` is `true`, so we recommend that you set this parameter to `false` in single-threaded scenarios. The default is `false`. > [!WARNING] > A should never import itself, or a part that has a reference to it. Such a reference could allow an untrusted part to gain access all the parts in the container. @@ -367,9 +367,9 @@ will always maintain a stable, composed state. Therefore, calling with an empty is never necessary to start composition. Instead, call the method whenever you need to make changes to the parts available to the . + This method is the primary way of directly adding or removing parts from the container. The will always maintain a stable, composed state. Therefore, calling with an empty is never necessary to start composition. Instead, call the method whenever you need to make changes to the parts available to the . - The can contain both parts to be added and parts to be removed. Recomposition will take place only once for each call to . + The can contain both parts to be added and parts to be removed. Recomposition will take place only once for each call to . @@ -500,7 +500,7 @@ method should return an empty collection of objects. + Implementations should not treat cardinality-related mismatches as errors and should not throw exceptions for cardinality-related mismatches. For example, if the import requests exactly one export and the provider has either no matching exports or more than one, the method should return an empty collection of objects. ]]> @@ -629,7 +629,7 @@ was constructed. For more information, see the method. + The behavior of this method may vary depending on the context in which the was constructed. For more information, see the method. ]]> diff --git a/xml/System.ComponentModel.Composition.Hosting/CompositionScopeDefinition.xml b/xml/System.ComponentModel.Composition.Hosting/CompositionScopeDefinition.xml index 8230a665350..6e35ea208d2 100644 --- a/xml/System.ComponentModel.Composition.Hosting/CompositionScopeDefinition.xml +++ b/xml/System.ComponentModel.Composition.Hosting/CompositionScopeDefinition.xml @@ -44,7 +44,7 @@ ## Remarks > [!IMPORTANT] -> This type implements the interface. When you have finished using the type, you should dispose of it either directly or indirectly. To dispose of the type directly, call its method in a `try`/`catch` block. To dispose of it indirectly, use a language construct such as `using` (in C#) or `Using` (in Visual Basic). For more information, see the "Using an Object that Implements IDisposable" section in the interface topic. +> This type implements the interface. When you have finished using the type, you should dispose of it either directly or indirectly. To dispose of the type directly, call its method in a `try`/`catch` block. To dispose of it indirectly, use a language construct such as `using` (in C#) or `Using` (in Visual Basic). For more information, see the "Using an Object that Implements IDisposable" section in the interface topic. ]]> @@ -303,7 +303,7 @@ For more information, see [Implementing a Dispose method](/dotnet/standard/garba that matches the conditions defined by `definition`, return an empty . +Overriders of this property should never return `null`. If there is no that matches the conditions defined by `definition`, return an empty . ]]> diff --git a/xml/System.ComponentModel.Composition.Hosting/CompositionService.xml b/xml/System.ComponentModel.Composition.Hosting/CompositionService.xml index f5fab7d3cc9..8fcd61ce4dd 100644 --- a/xml/System.ComponentModel.Composition.Hosting/CompositionService.xml +++ b/xml/System.ComponentModel.Composition.Hosting/CompositionService.xml @@ -32,13 +32,13 @@ Provides methods to satisfy imports on an existing part instance. - [!IMPORTANT] -> This type implements the interface. When you have finished using the type, you should dispose of it either directly or indirectly. To dispose of the type directly, call its method in a `try`/`catch` block. To dispose of it indirectly, use a language construct such as `using` (in C#) or `Using` (in Visual Basic). For more information, see the "Using an Object that Implements IDisposable" section in the interface topic. - +> This type implements the interface. When you have finished using the type, you should dispose of it either directly or indirectly. To dispose of the type directly, call its method in a `try`/`catch` block. To dispose of it indirectly, use a language construct such as `using` (in C#) or `Using` (in Visual Basic). For more information, see the "Using an Object that Implements IDisposable" section in the interface topic. + ]]> @@ -66,16 +66,16 @@ Releases all resources used by the current instance of the class. - . The `Dispose` method leaves the in an unusable state. After calling `Dispose`, you must release all references to the so the garbage collector can reclaim the memory that the was occupying. - - For more information, see [Cleaning Up Unmanaged Resources](/dotnet/standard/garbage-collection/unmanaged) and [Implementing a Dispose Method](/dotnet/standard/garbage-collection/implementing-dispose). - + . The `Dispose` method leaves the in an unusable state. After calling `Dispose`, you must release all references to the so the garbage collector can reclaim the memory that the was occupying. + + For more information, see [Cleaning Up Unmanaged Resources](/dotnet/standard/garbage-collection/unmanaged) and [Implementing a Dispose Method](/dotnet/standard/garbage-collection/implementing-dispose). + > [!NOTE] -> Always call `Dispose` before you release your last reference to the . Otherwise, the resources it is using will not be freed until the garbage collector calls the object's `Finalize` method. - +> Always call `Dispose` before you release your last reference to the . Otherwise, the resources it is using will not be freed until the garbage collector calls the object's `Finalize` method. + ]]> diff --git a/xml/System.ComponentModel.Composition.Hosting/DirectoryCatalog.xml b/xml/System.ComponentModel.Composition.Hosting/DirectoryCatalog.xml index 1beb9251459..d17bfb183a3 100644 --- a/xml/System.ComponentModel.Composition.Hosting/DirectoryCatalog.xml +++ b/xml/System.ComponentModel.Composition.Hosting/DirectoryCatalog.xml @@ -42,29 +42,29 @@ Discovers attributed parts in the assemblies in a specified directory. - object to parse the contents of a designated directory. Any attributed parts contained in dynamic link library (DLL) files are extracted and made available through the catalog.To restrict parsing to specific DLLs, you can specify a search pattern by using the same syntax as the method. - + object to parse the contents of a designated directory. Any attributed parts contained in dynamic link library (DLL) files are extracted and made available through the catalog.To restrict parsing to specific DLLs, you can specify a search pattern by using the same syntax as the method. + > [!WARNING] -> The designated directory should not allow access to non-administrators. For example, using a folder that contains temporary Internet files could create vulnerabilities in your application. - - This type implements the interface. When you have finished using the type, you should dispose of it either directly or indirectly. To dispose of the type directly, call its method in a `try`/`catch` block. To dispose of it indirectly, use a language construct such as `using` (in C#) or `Using` (in Visual Basic). For more information, see the "Using an Object that Implements IDisposable" section in the interface topic. - - - -## Examples - The following example creates a object that searches the directory the application runs from for parts. It uses a simple import to test the catalog. To fulfill this import, a DLL in the directory must have a matching export, as illustrated in the second code block. - +> The designated directory should not allow access to non-administrators. For example, using a folder that contains temporary Internet files could create vulnerabilities in your application. + + This type implements the interface. When you have finished using the type, you should dispose of it either directly or indirectly. To dispose of the type directly, call its method in a `try`/`catch` block. To dispose of it indirectly, use a language construct such as `using` (in C#) or `Using` (in Visual Basic). For more information, see the "Using an Object that Implements IDisposable" section in the interface topic. + + + +## Examples + The following example creates a object that searches the directory the application runs from for parts. It uses a simple import to test the catalog. To fulfill this import, a DLL in the directory must have a matching export, as illustrated in the second code block. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel.Composition.Hosting/DirectoryCatalog/consoleapplication7/program.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Misc/composition.directorycatalog/vb/consoleapplication8/module1.vb" id="Snippet1"::: - - To create the matching export, the following code must be in a DLL file. To create a DLL file in Visual Studio, add a new project of the type "Class Library" to your solution, and place this code in it. - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Misc/composition.directorycatalog/vb/consoleapplication8/module1.vb" id="Snippet1"::: + + To create the matching export, the following code must be in a DLL file. To create a DLL file in Visual Studio, add a new project of the type "Class Library" to your solution, and place this code in it. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel.Composition.Hosting/DirectoryCatalog/classlibrary1/class1.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Misc/composition.directorycatalog/vb/classlibrary1/class1.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Misc/composition.directorycatalog/vb/classlibrary1/class1.vb" id="Snippet2"::: + ]]> @@ -102,8 +102,8 @@ - The path to the directory to scan for assemblies to add to the catalog. - + The path to the directory to scan for assemblies to add to the catalog. + The path must be absolute or relative to . Initializes a new instance of the class by using objects based on all the DLL files in the specified directory path. To be added. @@ -134,8 +134,8 @@ - The path to the directory to scan for assemblies to add to the catalog. - + The path to the directory to scan for assemblies to add to the catalog. + The path must be absolute or relative to . The element used by diagnostics to identify the source for parts. Initializes a new instance of the class by using objects based on all the DLL files in the specified directory path with the specified source for parts. @@ -167,8 +167,8 @@ - The path to the directory to scan for assemblies to add to the catalog. - + The path to the directory to scan for assemblies to add to the catalog. + The path must be absolute or relative to . The context used to create parts. Initializes a new instance of the class by using objects based on all the DLL files in the specified directory path, in the specified reflection context. @@ -200,8 +200,8 @@ - The path to the directory to scan for assemblies to add to the catalog. - + The path to the directory to scan for assemblies to add to the catalog. + The path must be absolute or relative to . The search string. The format of the string should be the same as specified for the method. Initializes a new instance of the class by using objects that match a specified search pattern in the specified directory path. @@ -211,10 +211,10 @@ or is . The caller does not have the required permission. - is a zero-length string, contains only white space, or contains one or more implementation-specific invalid characters. - - -or- - + is a zero-length string, contains only white space, or contains one or more implementation-specific invalid characters. + + -or- + does not contain a valid pattern. The specified , file name, or both exceed the system-defined maximum length. @@ -238,8 +238,8 @@ - The path to the directory to scan for assemblies to add to the catalog. - + The path to the directory to scan for assemblies to add to the catalog. + The path must be absolute or relative to . The context used to create parts. The element used by diagnostics to identify the source for parts. @@ -273,8 +273,8 @@ - The path to the directory to scan for assemblies to add to the catalog. - + The path to the directory to scan for assemblies to add to the catalog. + The path must be absolute or relative to . The search string. The format of the string should be the same as specified for the method. The element used by diagnostics to identify the source for parts. @@ -285,10 +285,10 @@ or is . The caller does not have the required permission. - is a zero-length string, contains only white space, or contains one or more implementation-specific invalid characters. - - -or- - + is a zero-length string, contains only white space, or contains one or more implementation-specific invalid characters. + + -or- + does not contain a valid pattern. The specified , file name, or both exceed the system-defined maximum length. @@ -312,8 +312,8 @@ - The path to the directory to scan for assemblies to add to the catalog. - + The path to the directory to scan for assemblies to add to the catalog. + The path must be absolute or relative to . The search string. The format of the string should be the same as specified for the method. The context used to create parts. @@ -324,10 +324,10 @@ or is . The caller does not have the required permission. - is a zero-length string, contains only white space, or contains one or more implementation-specific invalid characters. - - -or- - + is a zero-length string, contains only white space, or contains one or more implementation-specific invalid characters. + + -or- + does not contain a valid pattern. The specified , file name, or both exceed the system-defined maximum length. @@ -352,8 +352,8 @@ - The path to the directory to scan for assemblies to add to the catalog. - + The path to the directory to scan for assemblies to add to the catalog. + The path must be absolute or relative to . The search string. The format of the string should be the same as specified for the method. The context used to create parts. @@ -365,10 +365,10 @@ or is . The caller does not have the required permission. - is a zero-length string, contains only white space, or contains one or more implementation-specific invalid characters. - - -or- - + is a zero-length string, contains only white space, or contains one or more implementation-specific invalid characters. + + -or- + does not contain a valid pattern. The specified , file name, or both exceed the system-defined maximum length. @@ -686,11 +686,11 @@ Refreshes the objects with the latest files in the directory that match the search pattern. - objects for those files will be removed only from the catalog. - + objects for those files will be removed only from the catalog. + ]]> The specified path has been removed since object construction. @@ -753,11 +753,11 @@ Gets the display name of the directory catalog. A string that contains a human-readable display name of the directory catalog. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -792,11 +792,11 @@ Gets the composition element from which the directory catalog originated. Always . - instance is cast to an interface. - + instance is cast to an interface. + ]]> diff --git a/xml/System.ComponentModel.Composition.Hosting/ExportProvider.xml b/xml/System.ComponentModel.Composition.Hosting/ExportProvider.xml index a24a6d20a1e..494ebd4a59e 100644 --- a/xml/System.ComponentModel.Composition.Hosting/ExportProvider.xml +++ b/xml/System.ComponentModel.Composition.Hosting/ExportProvider.xml @@ -166,7 +166,7 @@ method on `T`. + The contract name is the result of calling the method on `T`. The contract name is compared by using the property to perform a case-sensitive, non-linguistic comparison. @@ -224,7 +224,7 @@ method on `T`. + The default contract name is the result of calling the method on `T`. The contract name is compared by using the property to perform a case-sensitive, non-linguistic comparison. @@ -281,7 +281,7 @@ method on `T`. + The contract name is the result of calling the method on `T`. The contract name is compared by using the property to perform a case-sensitive, non-linguistic comparison. @@ -343,7 +343,7 @@ method on `T`. + The default contract name is the result of calling the method on `T`. The contract name is compared by using the property to perform a case-sensitive, non-linguistic comparison. @@ -404,7 +404,7 @@ method on `T`. + The contract name is the result of calling the method on `T`. The contract name is compared by using the property to perform a case-sensitive, non-linguistic comparison. @@ -458,7 +458,7 @@ method on `T`. + The default contract name is the result of calling the method on `T`. The contract name is compared by using the property to perform a case-sensitive, non-linguistic comparison. @@ -521,7 +521,7 @@ ## Remarks If the exported object is not found, this method returns the appropriate default value for `T`; for example, zero for integer types, `false` for Boolean types, and `null` for reference types. - The contract name is the result of calling the method on `T`. + The contract name is the result of calling the method on `T`. The contract name is compared by using the property to perform a case-sensitive, non-linguistic comparison. @@ -573,7 +573,7 @@ ## Remarks If the exported object is not found, this method returns the appropriate default value for `T`; for example, zero for integer types, `false` for Boolean types, and `null` for reference types. - The default contract name is the result of calling the method on `T`. + The default contract name is the result of calling the method on `T`. The contract name is compared by using the property to perform a case-sensitive, non-linguistic comparison. @@ -636,7 +636,7 @@ method on `T`. + The contract name is the result of calling the method on `T`. The contract name is compared by using the property to perform a case-sensitive, non-linguistic comparison. @@ -691,7 +691,7 @@ method on `T`. + The default contract name is the result of calling the method on `T`. The contract name is compared by using the property to perform a case-sensitive, non-linguistic comparison. @@ -846,7 +846,7 @@ method on `type`. + The default contract name is the result of calling the method on `type`. The contract name is compared by using the property to perform a case-sensitive, non-linguistic comparison. @@ -900,7 +900,7 @@ method on `T`. + The contract name is the result of calling the method on `T`. The contract name is compared by using the property to perform a case-sensitive, non-linguistic comparison. @@ -953,7 +953,7 @@ method on `T`. + The default contract name is the result of calling the method on `T`. The contract name is compared by using the property to perform a case-sensitive, non-linguistic comparison. @@ -1004,7 +1004,7 @@ method on `T`. + The contract name is the result of calling the method on `T`. The contract name is compared by using the property to perform a case-sensitive, non-linguistic comparison. @@ -1061,7 +1061,7 @@ method on `T`. + The default contract name is the result of calling the method on `T`. The contract name is compared by using the property to perform a case-sensitive, non-linguistic comparison. @@ -1115,7 +1115,7 @@ is and there are zero objects that match the conditions of the specified , an empty collection should be returned. + Overrides of this method should not treat cardinality-related mismatches as errors, and should not throw exceptions in those cases. For example, if is and there are zero objects that match the conditions of the specified , an empty collection should be returned. ]]> diff --git a/xml/System.ComponentModel.Composition.Hosting/FilteredCatalog.xml b/xml/System.ComponentModel.Composition.Hosting/FilteredCatalog.xml index 412892e9074..364facebdeb 100644 --- a/xml/System.ComponentModel.Composition.Hosting/FilteredCatalog.xml +++ b/xml/System.ComponentModel.Composition.Hosting/FilteredCatalog.xml @@ -40,7 +40,7 @@ ## Remarks > [!IMPORTANT] -> This type implements the interface. When you have finished using the type, you should dispose of it either directly or indirectly. To dispose of the type directly, call its method in a `try`/`catch` block. To dispose of it indirectly, use a language construct such as `using` (in C#) or `Using` (in Visual Basic). For more information, see the "Using an Object that Implements IDisposable" section in the interface topic. +> This type implements the interface. When you have finished using the type, you should dispose of it either directly or indirectly. To dispose of the type directly, call its method in a `try`/`catch` block. To dispose of it indirectly, use a language construct such as `using` (in C#) or `Using` (in Visual Basic). For more information, see the "Using an Object that Implements IDisposable" section in the interface topic. ]]> @@ -245,7 +245,7 @@ matches the conditions defined by `definition`; instead, return an empty . +Overriders of this property should never return `null` if no matches the conditions defined by `definition`; instead, return an empty . ]]> diff --git a/xml/System.ComponentModel.Composition.Hosting/ImportEngine.xml b/xml/System.ComponentModel.Composition.Hosting/ImportEngine.xml index 7116c232f33..1fa59e1e6fd 100644 --- a/xml/System.ComponentModel.Composition.Hosting/ImportEngine.xml +++ b/xml/System.ComponentModel.Composition.Hosting/ImportEngine.xml @@ -38,14 +38,14 @@ Performs composition for containers. - . You should generally not use it unless you are authoring a container. - + . You should generally not use it unless you are authoring a container. + > [!IMPORTANT] -> This type implements the interface. When you have finished using the type, you should dispose of it either directly or indirectly. To dispose of the type directly, call its method in a `try`/`catch` block. To dispose of it indirectly, use a language construct such as `using` (in C#) or `Using` (in Visual Basic). For more information, see the "Using an Object that Implements IDisposable" section in the interface topic. - +> This type implements the interface. When you have finished using the type, you should dispose of it either directly or indirectly. To dispose of the type directly, call its method in a `try`/`catch` block. To dispose of it indirectly, use a language construct such as `using` (in C#) or `Using` (in Visual Basic). For more information, see the "Using an Object that Implements IDisposable" section in the interface topic. + ]]> @@ -170,16 +170,16 @@ Releases all resources used by the current instance of the class. - . The `Dispose` method leaves the in an unusable state. After calling `Dispose`, you must release all references to the so the garbage collector can reclaim the memory that the was occupying. - - For more information, see [Cleaning Up Unmanaged Resources](/dotnet/standard/garbage-collection/unmanaged) and [Implementing a Dispose Method](/dotnet/standard/garbage-collection/implementing-dispose). - + . The `Dispose` method leaves the in an unusable state. After calling `Dispose`, you must release all references to the so the garbage collector can reclaim the memory that the was occupying. + + For more information, see [Cleaning Up Unmanaged Resources](/dotnet/standard/garbage-collection/unmanaged) and [Implementing a Dispose Method](/dotnet/standard/garbage-collection/implementing-dispose). + > [!NOTE] -> Always call `Dispose` before you release your last reference to the . Otherwise, the resources it is using will not be freed until the garbage collector calls the object's `Finalize` method. - +> Always call `Dispose` before you release your last reference to the . Otherwise, the resources it is using will not be freed until the garbage collector calls the object's `Finalize` method. + ]]> diff --git a/xml/System.ComponentModel.Composition.Hosting/TypeCatalog.xml b/xml/System.ComponentModel.Composition.Hosting/TypeCatalog.xml index 9dafad7d862..03e3b65fbf9 100644 --- a/xml/System.ComponentModel.Composition.Hosting/TypeCatalog.xml +++ b/xml/System.ComponentModel.Composition.Hosting/TypeCatalog.xml @@ -39,15 +39,15 @@ Discovers attributed parts from a collection of types. - [!IMPORTANT] -> This type implements the interface. When you have finished using the type, you should dispose of it either directly or indirectly. To dispose of the type directly, call its method in a `try`/`catch` block. To dispose of it indirectly, use a language construct such as `using` (in C#) or `Using` (in Visual Basic). For more information, see the "Using an Object that Implements IDisposable" section in the interface topic. - - This class is thread safe. - +> This type implements the interface. When you have finished using the type, you should dispose of it either directly or indirectly. To dispose of the type directly, call its method in a `try`/`catch` block. To dispose of it indirectly, use a language construct such as `using` (in C#) or `Using` (in Visual Basic). For more information, see the "Using an Object that Implements IDisposable" section in the interface topic. + + This class is thread safe. + ]]> @@ -91,10 +91,10 @@ is . - contains an element that is . - - -or- - + contains an element that is . + + -or- + contains an element that was loaded in the reflection-only context. @@ -134,10 +134,10 @@ is . - contains an element that is . - - -or- - + contains an element that is . + + -or- + contains an element that was loaded in the reflection-only context. @@ -166,10 +166,10 @@ is . - contains an element that is . - - -or- - + contains an element that is . + + -or- + contains an element that was loaded in the reflection-only context. @@ -198,10 +198,10 @@ is . - contains an element that is . - - -or- - + contains an element that is . + + -or- + contains an element that was loaded in the reflection-only context. @@ -232,10 +232,10 @@ is . - contains an element that is . - - -or- - + contains an element that is . + + -or- + contains an element that was loaded in the reflection-only context. @@ -365,11 +365,11 @@ Gets the display name of the type catalog. A string containing a human-readable display name of the . - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -404,11 +404,11 @@ Gets the composition element from which the type catalog originated. Always . - instance is cast to an interface. - + instance is cast to an interface. + ]]> diff --git a/xml/System.ComponentModel.Composition.Primitives/ComposablePart.xml b/xml/System.ComponentModel.Composition.Primitives/ComposablePart.xml index 33f1b1c0c13..e4ffb456cc1 100644 --- a/xml/System.ComponentModel.Composition.Primitives/ComposablePart.xml +++ b/xml/System.ComponentModel.Composition.Primitives/ComposablePart.xml @@ -77,11 +77,11 @@ Called when all the imports of the part have been set, and exports can be retrieved. - The has been disposed of. @@ -109,13 +109,13 @@ Gets a collection of the objects that describe the exported objects provided by the part. A collection of objects that describe the exported objects provided by the . - object was created from a object, this property should return the result of . - - Overrides of this property should never return `null`. If the does not have exports, return an empty collection instead. - + object was created from a object, this property should return the result of . + + Overrides of this property should never return `null`. If the does not have exports, return an empty collection instead. + ]]> The object has been disposed of. @@ -181,13 +181,13 @@ Gets a collection of the objects that describe the imported objects required by the part. A collection of objects that describe the imported objects required by the . - object was created from a object, this property should return the result of . - - Overrides of this property should never return `null`. If the does not have imports, return an empty collection instead. - + object was created from a object, this property should return the result of . + + Overrides of this property should never return `null`. If the does not have imports, return an empty collection instead. + ]]> The object has been disposed of. @@ -224,13 +224,13 @@ Gets the metadata of the object. The metadata of the object. The default is an empty, read-only object. - object was created from a object, this property should return the result of . - - Overrides of this property should return a read-only object with a case-sensitive, non-linguistic comparer, such as , and should never return `null`. If the does not contain metadata, return an empty instead. - + object was created from a object, this property should return the result of . + + Overrides of this property should return a read-only object with a case-sensitive, non-linguistic comparer, such as , and should never return `null`. If the does not contain metadata, return an empty instead. + ]]> The object has been disposed of. @@ -263,25 +263,25 @@ To be added. The object has been disposed of. - is . - - -or- - + is . + + -or- + is . An error occurred setting the import described by the object. - did not originate from the property on the . - - -or- - - contains an element that is . - - -or- - - is empty and is . - - -or- - + did not originate from the property on the . + + -or- + + contains an element that is . + + -or- + + is empty and is . + + -or- + contains more than one element and is or . has been previously called and is . diff --git a/xml/System.ComponentModel.Composition.Primitives/ComposablePartCatalog.xml b/xml/System.ComponentModel.Composition.Primitives/ComposablePartCatalog.xml index 693c648accf..aa55b4c37b6 100644 --- a/xml/System.ComponentModel.Composition.Primitives/ComposablePartCatalog.xml +++ b/xml/System.ComponentModel.Composition.Primitives/ComposablePartCatalog.xml @@ -50,15 +50,15 @@ Represents the abstract base class for composable part catalogs, which collect and return objects. - [!IMPORTANT] -> This type implements the interface. When you have finished using the type, you should dispose of it either directly or indirectly. To dispose of the type directly, call its method in a `try`/`catch` block. To dispose of it indirectly, use a language construct such as `using` (in C#) or `Using` (in Visual Basic). For more information, see the "Using an Object that Implements IDisposable" section in the interface topic. - - This type is thread safe. - +> This type implements the interface. When you have finished using the type, you should dispose of it either directly or indirectly. To dispose of the type directly, call its method in a `try`/`catch` block. To dispose of it indirectly, use a language construct such as `using` (in C#) or `Using` (in Visual Basic). For more information, see the "Using an Object that Implements IDisposable" section in the interface topic. + + This type is thread safe. + ]]> @@ -120,16 +120,16 @@ Releases all resources used by the . - . The `Dispose` method leaves the in an unusable state. After calling `Dispose`, you must release all references to the so the garbage collector can reclaim the memory that the was occupying. - - For more information, see [Cleaning Up Unmanaged Resources](/dotnet/standard/garbage-collection/unmanaged) and [Implementing a Dispose Method](/dotnet/standard/garbage-collection/implementing-dispose). - + . The `Dispose` method leaves the in an unusable state. After calling `Dispose`, you must release all references to the so the garbage collector can reclaim the memory that the was occupying. + + For more information, see [Cleaning Up Unmanaged Resources](/dotnet/standard/garbage-collection/unmanaged) and [Implementing a Dispose Method](/dotnet/standard/garbage-collection/implementing-dispose). + > [!NOTE] -> Always call `Dispose` before you release your last reference to the . Otherwise, the resources it is using will not be freed until the garbage collector calls the object's `Finalize` method. - +> Always call `Dispose` before you release your last reference to the . Otherwise, the resources it is using will not be freed until the garbage collector calls the object's `Finalize` method. + ]]> @@ -210,11 +210,11 @@ Gets a list of export definitions that match the constraint defined by the specified object. A collection of containing the objects and their associated objects for objects that match the constraint specified by . - matches the conditions defined by `definition`, return an empty object. - + matches the conditions defined by `definition`, return an empty object. + ]]> The object has been disposed of. @@ -251,11 +251,11 @@ Gets the part definitions that are contained in the catalog. The contained in the . - The object has been disposed of. @@ -285,11 +285,11 @@ Returns an enumerator that iterates through the catalog. An enumerator that can be used to iterate through the catalog. - instance is cast to an interface. - + instance is cast to an interface. + ]]> diff --git a/xml/System.ComponentModel.Composition.Primitives/ComposablePartDefinition.xml b/xml/System.ComponentModel.Composition.Primitives/ComposablePartDefinition.xml index 46f255edd3b..4076ff1558c 100644 --- a/xml/System.ComponentModel.Composition.Primitives/ComposablePartDefinition.xml +++ b/xml/System.ComponentModel.Composition.Primitives/ComposablePartDefinition.xml @@ -78,11 +78,11 @@ Creates a new instance of a part that the describes. The created part. - object every time that the method is invoked and should never return `null`. - + object every time that the method is invoked and should never return `null`. + ]]> @@ -107,11 +107,11 @@ Gets a collection of objects that describe the objects exported by the part defined by this object. A collection of objects that describe the exported objects provided by objects created by the . - objects created by the do not provide exported objects, return an empty collection instead. - + objects created by the do not provide exported objects, return an empty collection instead. + ]]> @@ -136,11 +136,11 @@ Gets a collection of objects that describe the imports required by the part defined by this object. A collection of objects that describe the imports required by objects created by the . - objects created by the do not have imports, return an empty collection instead. - + objects created by the do not have imports, return an empty collection instead. + ]]> @@ -176,11 +176,11 @@ Gets a collection of the metadata for this object. A collection that contains the metadata for the . The default is an empty, read-only object. - object with a case-sensitive, non-linguistic comparer, such as , and should never return `null`. If the does not contain metadata, return an empty object instead. - + object with a case-sensitive, non-linguistic comparer, such as , and should never return `null`. If the does not contain metadata, return an empty object instead. + ]]> diff --git a/xml/System.ComponentModel.Composition.Primitives/ContractBasedImportDefinition.xml b/xml/System.ComponentModel.Composition.Primitives/ContractBasedImportDefinition.xml index da03ca24d7e..0d266d3c0cc 100644 --- a/xml/System.ComponentModel.Composition.Primitives/ContractBasedImportDefinition.xml +++ b/xml/System.ComponentModel.Composition.Primitives/ContractBasedImportDefinition.xml @@ -333,7 +333,7 @@ Overrides of this method can provide a more optimized execution of the collection that contains an element that is `null`. If the definition does not contain required metadata, return an empty collection instead. + Overrides of this property should never return `null` or return an collection that contains an element that is `null`. If the definition does not contain required metadata, return an empty collection instead. ]]> diff --git a/xml/System.ComponentModel.Composition.Primitives/Export.xml b/xml/System.ComponentModel.Composition.Primitives/Export.xml index c58731bfbf3..e0125071f1b 100644 --- a/xml/System.ComponentModel.Composition.Primitives/Export.xml +++ b/xml/System.ComponentModel.Composition.Primitives/Export.xml @@ -62,7 +62,7 @@ property and the method. + Derived types that call this constructor must override the property and the method. ]]> @@ -289,7 +289,7 @@ Overrides of this method should never return `null`. of the property. + This property returns the value of of the property. ]]> diff --git a/xml/System.ComponentModel.Composition.Primitives/ExportDefinition.xml b/xml/System.ComponentModel.Composition.Primitives/ExportDefinition.xml index 43f5ce810e8..70c1bdf5161 100644 --- a/xml/System.ComponentModel.Composition.Primitives/ExportDefinition.xml +++ b/xml/System.ComponentModel.Composition.Primitives/ExportDefinition.xml @@ -62,7 +62,7 @@ property and optionally, the property. By default, returns an empty, read-only dictionary. + Derived types that call this constructor must override the property and optionally, the property. By default, returns an empty, read-only dictionary. ]]> @@ -168,9 +168,9 @@ object with a case-sensitive, non-linguistic comparer, such as , and should never return `null`. + Overrides of this property should return a read-only object with a case-sensitive, non-linguistic comparer, such as , and should never return `null`. - If the does not contain metadata, return an empty instead. + If the does not contain metadata, return an empty instead. ]]> diff --git a/xml/System.ComponentModel.Composition.Primitives/ImportDefinition.xml b/xml/System.ComponentModel.Composition.Primitives/ImportDefinition.xml index d192679fb4c..33424ef66cf 100644 --- a/xml/System.ComponentModel.Composition.Primitives/ImportDefinition.xml +++ b/xml/System.ComponentModel.Composition.Primitives/ImportDefinition.xml @@ -62,7 +62,7 @@ property, and optionally, the , and properties. + Derived types that call this constructor must override the property, and optionally, the , and properties. ]]> @@ -371,7 +371,7 @@ Overrides of this method can provide a more optimized execution of the collection. + This property should never return null. Imports with no metadata should return an empty collection. ]]> diff --git a/xml/System.ComponentModel.Composition/ChangeRejectedException.xml b/xml/System.ComponentModel.Composition/ChangeRejectedException.xml index 46ce844f4fa..ad735a2831e 100644 --- a/xml/System.ComponentModel.Composition/ChangeRejectedException.xml +++ b/xml/System.ComponentModel.Composition/ChangeRejectedException.xml @@ -79,8 +79,8 @@ |Property|Value| |--------------|-----------| -||`null`.| -||The localized error message string.| +||`null`.| +||The localized error message string.| ]]> @@ -151,8 +151,8 @@ |Property|Value| |--------------|-----------| -||`null`.| -||The error message string specified in `message`.| +||`null`.| +||The error message string specified in `message`.| ]]> @@ -191,8 +191,8 @@ |Property|Value| |--------------|-----------| -||`null`.| -||The error message string specified in `message`.| +||`null`.| +||The error message string specified in `message`.| ]]> diff --git a/xml/System.ComponentModel.Composition/CompositionContractMismatchException.xml b/xml/System.ComponentModel.Composition/CompositionContractMismatchException.xml index ac53416cd5d..05fcab1e165 100644 --- a/xml/System.ComponentModel.Composition/CompositionContractMismatchException.xml +++ b/xml/System.ComponentModel.Composition/CompositionContractMismatchException.xml @@ -79,8 +79,8 @@ |Property|Value| |--------------|-----------| -||`null`.| -||The localized error message string.| +||`null`.| +||The localized error message string.| ]]> @@ -121,8 +121,8 @@ |Property|Value| |--------------|-----------| -||`null`.| -||The error message string specified in `message`.| +||`null`.| +||The error message string specified in `message`.| ]]> @@ -223,8 +223,8 @@ |Property|Value| |--------------|-----------| -||`null`.| -||The error message string specified in `message`.| +||`null`.| +||The error message string specified in `message`.| ]]> diff --git a/xml/System.ComponentModel.Composition/CreationPolicy.xml b/xml/System.ComponentModel.Composition/CreationPolicy.xml index 5a7c25dd54b..014a26ee633 100644 --- a/xml/System.ComponentModel.Composition/CreationPolicy.xml +++ b/xml/System.ComponentModel.Composition/CreationPolicy.xml @@ -29,9 +29,9 @@ ## Remarks In the course of composition, the needs instances of the objects described by exports in order to fill imports. If a one export is used to fill multiple imports, there are two possible behaviors. Either a single instance of the exported object is created, and a reference to the same object is given to every importer, or a separate instance of the exported object is created for each importer. - Which behavior occurs depends on the property of the attached to the export and the of the . Both of which will contain a value from the enumeration. If the policies are incompatible, that export will not be considered a match for the given import. The following table summarizes the interaction of these two properties. + Which behavior occurs depends on the property of the attached to the export and the of the . Both of which will contain a value from the enumeration. If the policies are incompatible, that export will not be considered a match for the given import. The following table summarizes the interaction of these two properties. -||Export's specifies Any or none specified.|Export's specifies Shared|Export's specifies NonShared| +||Export's specifies Any or none specified.|Export's specifies Shared|Export's specifies NonShared| |---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| |Any|A single, shared instance of the exported object will be created.|A single, shared instance of the exported object will be created.|A new instance of the exported object will be created for each importer.| |Shared|A single, shared instance of the exported object will be created.|A single, shared instance of the exported object will be created.|The export will not be considered a match for the import.| diff --git a/xml/System.ComponentModel.Composition/ExportAttribute.xml b/xml/System.ComponentModel.Composition/ExportAttribute.xml index a8043b108f7..f4bfcb6726b 100644 --- a/xml/System.ComponentModel.Composition/ExportAttribute.xml +++ b/xml/System.ComponentModel.Composition/ExportAttribute.xml @@ -93,9 +93,9 @@ method on the property or field type, or on the type that is marked with this attribute. + The default contract name is the result of calling the method on the property or field type, or on the type that is marked with this attribute. - Methods marked with this attribute must specify a contract name or a type by using either or . + Methods marked with this attribute must specify a contract name or a type by using either or . The contract name is compared by using the property to perform a case-sensitive, non-linguistic comparison. @@ -133,9 +133,9 @@ method on the property or field type, or on the type that this is marked with this attribute. + The default contract name is the result of calling the method on the property or field type, or on the type that this is marked with this attribute. - Methods marked with this attribute must specify a contract name or a type by using either or . + Methods marked with this attribute must specify a contract name or a type by using either or . The contract name is compared by using the property to perform a case-sensitive, non-linguistic comparison. @@ -173,11 +173,11 @@ method on `contractType`. + The contract name is the result of calling the method on `contractType`. - The default contract name is the result of calling the method on the property or field type, or on the type that is marked with this attribute. + The default contract name is the result of calling the method on the property or field type, or on the type that is marked with this attribute. - Methods marked with this attribute must specify a contract name or a type by using either or . + Methods marked with this attribute must specify a contract name or a type by using either or . The contract name is compared by using the property to perform a case-sensitive, non-linguistic comparison. diff --git a/xml/System.ComponentModel.Composition/ExportFactory`1.xml b/xml/System.ComponentModel.Composition/ExportFactory`1.xml index ec03baf3218..7d28b7812ae 100644 --- a/xml/System.ComponentModel.Composition/ExportFactory`1.xml +++ b/xml/System.ComponentModel.Composition/ExportFactory`1.xml @@ -45,9 +45,9 @@ object, the property always returns a reference to the same object. In some circumstances, you might want each reference to result in the creation of a new object. is designed for those scenarios. + When you refer indirectly to a part by using a object, the property always returns a reference to the same object. In some circumstances, you might want each reference to result in the creation of a new object. is designed for those scenarios. - can be used in a similar fashion to when creating attributed parts. That is, an import contract that is defined on with a generic parameter of `T` will match an export that is defined on `T`. For example, the follow export and import match: + can be used in a similar fashion to when creating attributed parts. That is, an import contract that is defined on with a generic parameter of `T` will match an export that is defined on `T`. For example, the follow export and import match: ```csharp [Export] @@ -65,7 +65,7 @@ Public myData As String = "Example Data." Public Property theData As ExportFactory(Of String) ``` - The method returns an object, which has two pieces. The property provides access to the created part. Calling the method of the object cleans up the created part and all of its dependencies, thereby allowing the part's lifetime to be managed without reference to the container that created it. + The method returns an object, which has two pieces. The property provides access to the created part. Calling the method of the object cleans up the created part and all of its dependencies, thereby allowing the part's lifetime to be managed without reference to the container that created it. ]]> diff --git a/xml/System.ComponentModel.Composition/ExportFactory`2.xml b/xml/System.ComponentModel.Composition/ExportFactory`2.xml index 3815deded2c..b34f3feadc4 100644 --- a/xml/System.ComponentModel.Composition/ExportFactory`2.xml +++ b/xml/System.ComponentModel.Composition/ExportFactory`2.xml @@ -54,11 +54,11 @@ The type of the created part's metadata. A factory that creates new instances of a part that provides the specified export, with attached metadata. - extends to include a metadata object, in much the same way that extends . For more information, see and . - + extends to include a metadata object, in much the same way that extends . For more information, see and . + ]]> diff --git a/xml/System.ComponentModel.Composition/ExportLifetimeContext`1.xml b/xml/System.ComponentModel.Composition/ExportLifetimeContext`1.xml index 074a17c1ee2..9ff136510c7 100644 --- a/xml/System.ComponentModel.Composition/ExportLifetimeContext`1.xml +++ b/xml/System.ComponentModel.Composition/ExportLifetimeContext`1.xml @@ -46,13 +46,13 @@ The type of the exported value. Holds an exported value created by an object and a reference to a method to release that object. - [!IMPORTANT] -> This type implements the interface. When you have finished using the type, you should dispose of it either directly or indirectly. To dispose of the type directly, call its method in a `try`/`catch` block. To dispose of it indirectly, use a language construct such as `using` (in C#) or `Using` (in Visual Basic). For more information, see the "Using an Object that Implements IDisposable" section in the interface topic. - +> This type implements the interface. When you have finished using the type, you should dispose of it either directly or indirectly. To dispose of the type directly, call its method in a `try`/`catch` block. To dispose of it indirectly, use a language construct such as `using` (in C#) or `Using` (in Visual Basic). For more information, see the "Using an Object that Implements IDisposable" section in the interface topic. + ]]> @@ -104,18 +104,18 @@ Releases all resources used by the current instance of the class, including its associated export. - object calls the referenced method to release its associated export. - - Call `Dispose` when you are finished using the . The `Dispose` method leaves the in an unusable state. After calling `Dispose`, you must release all references to the so the garbage collector can reclaim the memory that the was occupying. - - For more information, see [Cleaning Up Unmanaged Resources](https://go.microsoft.com/fwlink/?LinkId=187455) and [Implementing a Dispose Method](https://go.microsoft.com/fwlink/?LinkId=187456). - + object calls the referenced method to release its associated export. + + Call `Dispose` when you are finished using the . The `Dispose` method leaves the in an unusable state. After calling `Dispose`, you must release all references to the so the garbage collector can reclaim the memory that the was occupying. + + For more information, see [Cleaning Up Unmanaged Resources](https://go.microsoft.com/fwlink/?LinkId=187455) and [Implementing a Dispose Method](https://go.microsoft.com/fwlink/?LinkId=187456). + > [!NOTE] -> Always call `Dispose` before you release your last reference to the . Otherwise, the resources it is using will not be freed until the garbage collector calls the object's `Finalize` method. - +> Always call `Dispose` before you release your last reference to the . Otherwise, the resources it is using will not be freed until the garbage collector calls the object's `Finalize` method. + ]]> diff --git a/xml/System.ComponentModel.Composition/ImportAttribute.xml b/xml/System.ComponentModel.Composition/ImportAttribute.xml index 5e09c5ee75f..caf7cbb1861 100644 --- a/xml/System.ComponentModel.Composition/ImportAttribute.xml +++ b/xml/System.ComponentModel.Composition/ImportAttribute.xml @@ -91,7 +91,7 @@ method on the property, field, or parameter type that this is marked with this attribute. + The default contract name is the result of calling the method on the property, field, or parameter type that this is marked with this attribute. The contract name is compared by using the property to perform a case-sensitive, non-linguistic comparison. @@ -129,7 +129,7 @@ method on the property, field, or parameter type that is marked with this attribute. + The default contract name is the result of calling the method on the property, field, or parameter type that is marked with this attribute. The contract name is compared by using the property to perform a case-sensitive, non-linguistic comparison. @@ -167,9 +167,9 @@ method on `contractType`. + The contract name is the result of calling the method on `contractType`. - The default contract name is the result of calling the method on the property, field, or parameter type that is marked with this attribute. + The default contract name is the result of calling the method on the property, field, or parameter type that is marked with this attribute. The contract name is compared by using the property to perform a case-sensitive, non-linguistic comparison. diff --git a/xml/System.ComponentModel.Composition/ImportCardinalityMismatchException.xml b/xml/System.ComponentModel.Composition/ImportCardinalityMismatchException.xml index fb3893a1f4f..3ef5db333d4 100644 --- a/xml/System.ComponentModel.Composition/ImportCardinalityMismatchException.xml +++ b/xml/System.ComponentModel.Composition/ImportCardinalityMismatchException.xml @@ -87,8 +87,8 @@ |Property|Value| |--------------|-----------| -||`null`.| -||The localized error message string.| +||`null`.| +||The localized error message string.| ]]> @@ -129,8 +129,8 @@ |Property|Value| |--------------|-----------| -||`null`.| -||The error message string specified in `message`.| +||`null`.| +||The error message string specified in `message`.| ]]> @@ -231,8 +231,8 @@ |Property|Value| |--------------|-----------| -||`null`.| -||The error message string specified in `message`.| +||`null`.| +||The error message string specified in `message`.| ]]> diff --git a/xml/System.ComponentModel.Composition/ImportManyAttribute.xml b/xml/System.ComponentModel.Composition/ImportManyAttribute.xml index d3e864b9b8b..b9cf4926a3a 100644 --- a/xml/System.ComponentModel.Composition/ImportManyAttribute.xml +++ b/xml/System.ComponentModel.Composition/ImportManyAttribute.xml @@ -72,7 +72,7 @@ method on the type of the property, field, or parameter that is marked with this attribute. + The default contract name is the result of calling the method on the type of the property, field, or parameter that is marked with this attribute. The contract name is compared by using the property to perform a case-sensitive, non-linguistic comparison. @@ -110,7 +110,7 @@ method on the property, field, or parameter type that is marked with this attribute. + The default contract name is the result of calling the method on the property, field, or parameter type that is marked with this attribute. The contract name is compared by using the property to perform a case-sensitive, non-linguistic comparison. @@ -148,9 +148,9 @@ method on `contractType`. + The contract name is the result of calling the method on `contractType`. - The default contract name is the result of calling the method on the property, field, or parameter type that is marked with this attribute. + The default contract name is the result of calling the method on the property, field, or parameter type that is marked with this attribute. The contract name is compared by using the property to perform a case-sensitive, non-linguistic comparison. diff --git a/xml/System.ComponentModel.DataAnnotations/CustomValidationAttribute.xml b/xml/System.ComponentModel.DataAnnotations/CustomValidationAttribute.xml index bbaef6c493e..dacb453ae39 100644 --- a/xml/System.ComponentModel.DataAnnotations/CustomValidationAttribute.xml +++ b/xml/System.ComponentModel.DataAnnotations/CustomValidationAttribute.xml @@ -49,7 +49,7 @@ attribute is used to perform custom validation when the method is invoked to perform validation. The method then redirects the call to the method that is identified by the property, which in turn performs the actual validation. + The attribute is used to perform custom validation when the method is invoked to perform validation. The method then redirects the call to the method that is identified by the property, which in turn performs the actual validation. The attribute can be applied to types, properties, fields, methods, and method parameters. When it is applied to a property, the attribute is invoked whenever a value is assigned to that property. When it is applied to a method, the attribute is invoked whenever the program calls that method. When it is applied to a method parameter, the attribute is invoked before the method is called. @@ -263,7 +263,7 @@ The custom method can also take parameters that specify a input value and a output value. The parameter provides additional context information that the method can use to determine the context that it is used in. The output parameter enables the method to return an error message. - If the method returns `null` for the parameter or if it returns an empty value for the property, the default method will be called to compose the error message. + If the method returns `null` for the parameter or if it returns an empty value for the property, the default method will be called to compose the error message. ]]> @@ -342,7 +342,7 @@ constructor overload. + This property returns the type that is passed to the ctor constructor overload. ]]> diff --git a/xml/System.ComponentModel.DataAnnotations/DataTypeAttribute.xml b/xml/System.ComponentModel.DataAnnotations/DataTypeAttribute.xml index 9c9a7937333..77da738defc 100644 --- a/xml/System.ComponentModel.DataAnnotations/DataTypeAttribute.xml +++ b/xml/System.ComponentModel.DataAnnotations/DataTypeAttribute.xml @@ -164,7 +164,7 @@ ## Examples - The following example shows how to use the constructor to specify an alternative type for a data field. + The following example shows how to use the constructor to specify an alternative type for a data field. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.ComponentModel.DataAnnotations.DataTypeAttribute/CS/Customer.cs" id="Snippet11"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.ComponentModel.DataAnnotations.DataTypeAttribute/VB/Customer.vb" id="Snippet11"::: diff --git a/xml/System.ComponentModel.DataAnnotations/DisplayAttribute.xml b/xml/System.ComponentModel.DataAnnotations/DisplayAttribute.xml index 5bb6ce26141..50a0531ca66 100644 --- a/xml/System.ComponentModel.DataAnnotations/DisplayAttribute.xml +++ b/xml/System.ComponentModel.DataAnnotations/DisplayAttribute.xml @@ -53,7 +53,7 @@ instance. + The properties of this class can be used either as literals or as resource identifiers for a specified instance. ]]> @@ -93,7 +93,7 @@ , , , and properties to an empty string. + The constructor initializes the , , , and properties to an empty string. ]]> @@ -138,7 +138,7 @@ property. Use the method instead. + Do not use this property to access the property. Use the method instead. ]]> @@ -184,7 +184,7 @@ property. Use the method instead. + Do not use this property to get the value of the property. Use the method instead. Setting this property overrides the default behavior for specifying which columns are included as filters. @@ -269,7 +269,7 @@ End Class property. Use the method instead. + Do not use this property to get the value of the property. Use the method instead. The property is typically used as a tooltip or description UI element that is bound to the member using this attribute. The Dynamic Data Edit.ascx template will display the description as a tooltip in text-entry fields. A `null` value or empty string is valid. @@ -609,7 +609,7 @@ End Class property is typically used as a prompt or watermark for a UI element that is bound to the property that is annotated with the attribute. + The property is typically used as a prompt or watermark for a UI element that is bound to the property that is annotated with the attribute. ]]> @@ -656,7 +656,7 @@ End Class is not `null`. + The short name is used as the grid column label for a UI element that is bound to the property that is annotated with this attribute. This property returns either the literal, non-localized string, or a localized string if is not `null`. ]]> @@ -703,7 +703,7 @@ but a public static property with a name matching the property. Use the method instead. A `null` value or empty string is valid. + Do not use this property to get the value of the property. Use the method instead. A `null` value or empty string is valid. ]]> @@ -748,7 +748,7 @@ but a public static property with a name matching the property. Use the method instead. + Do not use this property to get the value of the property. Use the method instead. The name is typically used as the field label for a UI element that is bound to the property that is annotated with this attribute. The Dynamic Data List.aspx, ListDetails.aspx, and Details.aspx page templates use the property for the field label. A `null` value or empty string is valid. @@ -914,7 +914,7 @@ End Class method instead. + This property is typically used as a prompt or watermark for a UI element that is bound to the property that is annotated with this attribute. Do not use this method to access the prompt string. Use the method instead. @@ -1006,7 +1006,7 @@ End Class , , , and properties are assumed to be literal, non-localized strings. If this value is not `null`, the string properties are assumed to be the names of public static properties that return the actual string value. + If this value is `null`, the , , , and properties are assumed to be literal, non-localized strings. If this value is not `null`, the string properties are assumed to be the names of public static properties that return the actual string value. ]]> @@ -1051,7 +1051,7 @@ End Class for the field label. This property returns the localized string for if the property has been specified and if the property represents a resource key. If the property has not been specified or if the property is not a resource key, this property returns a non-localized string. + The short name is used as the grid column label for a UI element that is bound to the property that is annotated with this attribute. The Dynamic Data Insert.aspx and Edit.aspx page templates use the for the field label. This property returns the localized string for if the property has been specified and if the property represents a resource key. If the property has not been specified or if the property is not a resource key, this property returns a non-localized string. ]]> diff --git a/xml/System.ComponentModel.DataAnnotations/DisplayFormatAttribute.xml b/xml/System.ComponentModel.DataAnnotations/DisplayFormatAttribute.xml index 0d70842b4f2..656b56bebf6 100644 --- a/xml/System.ComponentModel.DataAnnotations/DisplayFormatAttribute.xml +++ b/xml/System.ComponentModel.DataAnnotations/DisplayFormatAttribute.xml @@ -234,7 +234,7 @@ The following example shows how to use the to enable the conversion of empty string values to `null`. + The following example shows how to use the to enable the conversion of empty string values to `null`. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.ComponentModel.DataAnnotations.DisplayFormatAttribute/CS/product.cs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.ComponentModel.DataAnnotations.DisplayFormatAttribute/VB/product.vb" id="Snippet2"::: @@ -469,7 +469,7 @@ The following example shows how to use the to define a caption to display when the data field is `null`. + The following example shows how to use the to define a caption to display when the data field is `null`. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.ComponentModel.DataAnnotations.DisplayFormatAttribute/CS/product.cs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.ComponentModel.DataAnnotations.DisplayFormatAttribute/VB/product.vb" id="Snippet2"::: diff --git a/xml/System.ComponentModel.DataAnnotations/EditableAttribute.xml b/xml/System.ComponentModel.DataAnnotations/EditableAttribute.xml index 66a465ccde5..48a5ea48ab1 100644 --- a/xml/System.ComponentModel.DataAnnotations/EditableAttribute.xml +++ b/xml/System.ComponentModel.DataAnnotations/EditableAttribute.xml @@ -42,13 +42,13 @@ Indicates whether a data field is editable. - attribute on a data field indicates whether the user should be able to change the field's value. - - This class neither enforces nor guarantees that a field is editable. The underlying data store might allow the field to be changed regardless of the presence of this attribute. - + attribute on a data field indicates whether the user should be able to change the field's value. + + This class neither enforces nor guarantees that a field is editable. The underlying data store might allow the field to be changed regardless of the presence of this attribute. + ]]> @@ -181,11 +181,11 @@ if an initial value is enabled; otherwise, . - constructor. - + constructor. + ]]> diff --git a/xml/System.ComponentModel.DataAnnotations/RangeAttribute.xml b/xml/System.ComponentModel.DataAnnotations/RangeAttribute.xml index 07334f671d2..5c1bd9e408b 100644 --- a/xml/System.ComponentModel.DataAnnotations/RangeAttribute.xml +++ b/xml/System.ComponentModel.DataAnnotations/RangeAttribute.xml @@ -175,7 +175,7 @@ to specify the range for an integer data field. + The following example shows how to use the to specify the range for an integer data field. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.ComponentModel.DataAnnotations.RangeAttribute/CS/Product.cs" id="Snippet11"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.ComponentModel.DataAnnotations.RangeAttribute/VB/Product.vb" id="Snippet11"::: @@ -249,7 +249,7 @@ ## Examples - The following example shows how to use the method to specify the range for a `DateTime` field. It also includes a custom error message that shows how to use the formatting capabilities of the method. + The following example shows how to use the method to specify the range for a `DateTime` field. It also includes a custom error message that shows how to use the formatting capabilities of the method. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.ComponentModel.DataAnnotations.RangeAttribute/CS/Product.cs" id="Snippet13"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.ComponentModel.DataAnnotations.RangeAttribute/VB/Product.vb" id="Snippet13"::: @@ -341,7 +341,7 @@ This property has no effect on the constructors with or creates the error message by using the name of the data field that caused the validation failure. You can override this method in a custom validation attribute to customize how errors are created, or to provide a more complex message that contains parameters that you evaluate at run time. For an example, see the constructor. + The creates the error message by using the name of the data field that caused the validation failure. You can override this method in a custom validation attribute to customize how errors are created, or to provide a more complex message that contains parameters that you evaluate at run time. For an example, see the constructor. ]]> diff --git a/xml/System.ComponentModel.DataAnnotations/RegularExpressionAttribute.xml b/xml/System.ComponentModel.DataAnnotations/RegularExpressionAttribute.xml index 56841b6f7a8..0c682e96e85 100644 --- a/xml/System.ComponentModel.DataAnnotations/RegularExpressionAttribute.xml +++ b/xml/System.ComponentModel.DataAnnotations/RegularExpressionAttribute.xml @@ -51,23 +51,23 @@ Specifies that a data field value in ASP.NET Dynamic Data must match the specified regular expression. - attribute to validate the FirstName and LastName data fields. The regular expression allows up to 40 uppercase and lowercase characters. The example performs the following tasks: - +The following example shows how to use the attribute to validate the FirstName and LastName data fields. The regular expression allows up to 40 uppercase and lowercase characters. The example performs the following tasks: + - Implements a metadata partial class and the associated metadata class. - In the associated metadata class, applies the attribute to the FirstName and LastName data fields, specifying the pattern and custom error messages. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.ComponentModel.DataAnnotations.RegularExpressionAttribute/CS/Customer.cs" id="Snippet1"::: -:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.ComponentModel.DataAnnotations.RegularExpressionAttribute/VB/Customer.vb" id="Snippet1"::: +:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.ComponentModel.DataAnnotations.RegularExpressionAttribute/VB/Customer.vb" id="Snippet1"::: ]]> @@ -174,7 +174,7 @@ The following example shows how to use the creates the error message by using the name of the data field that caused the validation failure. You can override this method in custom validation attributes to customize how errors are created or to provide a more complex message that contains parameters that you evaluate at run time. + The creates the error message by using the name of the data field that caused the validation failure. You can override this method in custom validation attributes to customize how errors are created or to provide a more complex message that contains parameters that you evaluate at run time. ]]> diff --git a/xml/System.ComponentModel.DataAnnotations/RequiredAttribute.xml b/xml/System.ComponentModel.DataAnnotations/RequiredAttribute.xml index 7ce145d451f..3c0ff0bd094 100644 --- a/xml/System.ComponentModel.DataAnnotations/RequiredAttribute.xml +++ b/xml/System.ComponentModel.DataAnnotations/RequiredAttribute.xml @@ -108,7 +108,7 @@ constructor. If validation fails, the example displays a validation error message that is provided by Dynamic Data. + The following example shows how to use the constructor. If validation fails, the example displays a validation error message that is provided by Dynamic Data. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.ComponentModel.DataAnnotations.RequiredAttribute/CS/Customer.cs" id="Snippet3"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.ComponentModel.DataAnnotations.RequiredAttribute/VB/Customer.vb" id="Snippet3"::: @@ -166,9 +166,9 @@ to `true` for a data field, Dynamic Data does not perform validation and transforms the empty string to a `null` value. This value is then passed to the database. + When you set to `true` for a data field, Dynamic Data does not perform validation and transforms the empty string to a `null` value. This value is then passed to the database. - If the database does not allow `null` values, it raises an error. To avoid this error, you must also set the to `false`. + If the database does not allow `null` values, it raises an error. To avoid this error, you must also set the to `false`. ]]> diff --git a/xml/System.ComponentModel.DataAnnotations/StringLengthAttribute.xml b/xml/System.ComponentModel.DataAnnotations/StringLengthAttribute.xml index 5ab8ba224c8..e7462b18967 100644 --- a/xml/System.ComponentModel.DataAnnotations/StringLengthAttribute.xml +++ b/xml/System.ComponentModel.DataAnnotations/StringLengthAttribute.xml @@ -47,58 +47,58 @@ Specifies the minimum and maximum length of characters that are allowed in a data field. - and properties identify the largest number of bytes that are required in order to store a string. - + and properties identify the largest number of bytes that are required in order to store a string. + You can use [composite formatting](/dotnet/standard/base-types/composite-formatting) placeholders in the error message: {0} is the name of the property; {1} is the maximum length; and {2} is the minimum length. -The placeholders correspond to arguments that are passed to the method at runtime. - -## Examples - The following example shows how to limit the number of characters in a field. This example works with the ThumbnailPhotoFileName field in the Products table in the AdventureWorksLT database. The field is limited 4 characters by applying the attribute to the partial class that represents the Product entity. +The placeholders correspond to arguments that are passed to the method at runtime. + +## Examples + The following example shows how to limit the number of characters in a field. This example works with the ThumbnailPhotoFileName field in the Products table in the AdventureWorksLT database. The field is limited 4 characters by applying the attribute to the partial class that represents the Product entity. + +```csharp +[MetadataType(typeof(ProductMetadata))] +public partial class Product +{ + +} + +public class ProductMetadata +{ + + [ScaffoldColumn(true)] + [StringLength(4, ErrorMessage = "The ThumbnailPhotoFileName value cannot exceed 4 characters. ")] + public object ThumbnailPhotoFileName; + + [ScaffoldColumn(true)] + [StringLength(4, ErrorMessage = "The {0} value cannot exceed {1} characters. ")] + public object PhotoFileName; + +} +``` + +```vb + _ +Public Partial Class Product -```csharp -[MetadataType(typeof(ProductMetadata))] -public partial class Product -{ - -} - -public class ProductMetadata -{ - - [ScaffoldColumn(true)] - [StringLength(4, ErrorMessage = "The ThumbnailPhotoFileName value cannot exceed 4 characters. ")] - public object ThumbnailPhotoFileName; - - [ScaffoldColumn(true)] - [StringLength(4, ErrorMessage = "The {0} value cannot exceed {1} characters. ")] - public object PhotoFileName; +End Class + +Public Class ProductMetadata + + _ + _ + Public ThumbnailPhotoFileName As Object + + _ + _ + Public PhotoFileName As Object + +End Class +``` -} -``` - -```vb - _ -Public Partial Class Product - -End Class - -Public Class ProductMetadata - - _ - _ - Public ThumbnailPhotoFileName As Object - - _ - _ - Public PhotoFileName As Object - -End Class -``` - ]]> @@ -182,10 +182,10 @@ End Class The formatted error message. To be added. - is negative. - - -or- - + is negative. + + -or- + is less than . The current attribute is ill-formed. @@ -232,18 +232,18 @@ End Class if the specified object is valid; otherwise, . - - is negative. - - -or- - + is negative. + + -or- + is less than . The current attribute is ill-formed. diff --git a/xml/System.ComponentModel.DataAnnotations/ValidationAttribute.xml b/xml/System.ComponentModel.DataAnnotations/ValidationAttribute.xml index 927d478be3a..b331f66443f 100644 --- a/xml/System.ComponentModel.DataAnnotations/ValidationAttribute.xml +++ b/xml/System.ComponentModel.DataAnnotations/ValidationAttribute.xml @@ -390,7 +390,7 @@ This property is the error message that you associate with the validation contro property or by evaluating the and properties. The two cases are mutually exclusive. The second case is used if you want to display a localized error message. + The error message string is obtained by evaluating the property or by evaluating the and properties. The two cases are mutually exclusive. The second case is used if you want to display a localized error message. ]]> @@ -498,7 +498,7 @@ This property is the error message that you associate with the validation contro method checks validity without throwing an exception. + The method checks validity without throwing an exception. ]]> @@ -732,7 +732,7 @@ This property is the error message that you associate with the validation contro method to determine whether the object that is specified by the `value` parameter is valid. If the method returns `false`, this method calls the method to get a localized message that states the problem. It then throws a exception. + This method calls the method to determine whether the object that is specified by the `value` parameter is valid. If the method returns `false`, this method calls the method to get a localized message that states the problem. It then throws a exception. ]]> @@ -794,7 +794,7 @@ This property is the error message that you associate with the validation contro attribute is declared. It calls the method and passes `value` as a parameter. If validation fails, a exception is thrown. + This method validates the value of the object or property on which the attribute is declared. It calls the method and passes `value` as a parameter. If validation fails, a exception is thrown. ]]> diff --git a/xml/System.ComponentModel.DataAnnotations/ValidationContext.xml b/xml/System.ComponentModel.DataAnnotations/ValidationContext.xml index 0473206ebd7..f5e835dbbb9 100644 --- a/xml/System.ComponentModel.DataAnnotations/ValidationContext.xml +++ b/xml/System.ComponentModel.DataAnnotations/ValidationContext.xml @@ -259,7 +259,7 @@ method in order to perform custom validation. + The `serviceProvider` parameter represents a service that can be used by the method in order to perform custom validation. If the `items` parameter is `null`, an empty dictionary is created. If the parameter is not `null`, the set of key/value pairs is copied into a new dictionary, which prevents the service consumers from modifying the original dictionary. @@ -363,7 +363,7 @@ value is the name that is shown to the user. If a display name is not explicitly set, this property uses the value that is assigned by the associated object. If that attribute does not exist, the property returns the value of the property. + The value is the name that is shown to the user. If a display name is not explicitly set, this property uses the value that is assigned by the associated object. If that attribute does not exist, the property returns the value of the property. ]]> @@ -415,9 +415,9 @@ object is defined at the application level, the method accesses it to retrieve the requested service. + If the object is defined at the application level, the method accesses it to retrieve the requested service. - If the object is not defined or it does not return the service, the method queries the object that is passed to the method in order to obtain the service. + If the object is not defined or it does not return the service, the method queries the object that is passed to the method in order to obtain the service. ]]> diff --git a/xml/System.ComponentModel.DataAnnotations/ValidationException.xml b/xml/System.ComponentModel.DataAnnotations/ValidationException.xml index d5a62a463bd..05157349803 100644 --- a/xml/System.ComponentModel.DataAnnotations/ValidationException.xml +++ b/xml/System.ComponentModel.DataAnnotations/ValidationException.xml @@ -53,7 +53,7 @@ ## Remarks A validation exception occurs if an input value does not match the expected data type, range or pattern of the data field. For example, if a user enters an integer value in a data field that expects a value, a validation exception occurs. - This class uses the class to customize validations. A is thrown if a validation error occurs. The exception is thrown when the method is called. All the exceptions that are thrown during validation are contained in the collection. You can retrieve each validation exception by iterating through the collection. + This class uses the class to customize validations. A is thrown if a validation error occurs. The exception is thrown when the method is called. All the exceptions that are thrown during validation are contained in the collection. You can retrieve each validation exception by iterating through the collection. ]]> diff --git a/xml/System.ComponentModel.DataAnnotations/Validator.xml b/xml/System.ComponentModel.DataAnnotations/Validator.xml index d64af266231..a47b9dbcb31 100644 --- a/xml/System.ComponentModel.DataAnnotations/Validator.xml +++ b/xml/System.ComponentModel.DataAnnotations/Validator.xml @@ -124,11 +124,11 @@ if the object validates; otherwise, . - instance that is attached to the object type. It also checks whether each property that is marked with is provided. It does not recursively validate the property values of the object. - + instance that is attached to the object type. It also checks whether each property that is marked with is provided. It does not recursively validate the property values of the object. + ]]> @@ -206,11 +206,11 @@ if the object validates; otherwise, . - instance that is attached to the object type. It also checks whether each property that is marked with is provided. It validates the property values of the object if `validateAllProperties` is `true` but does not recursively validate properties of the objects returned by the properties. - + instance that is attached to the object type. It also checks whether each property that is marked with is provided. It validates the property values of the object if `validateAllProperties` is `true` but does not recursively validate properties of the objects returned by the properties. + ]]> @@ -284,18 +284,18 @@ if the property validates; otherwise, . - instance that is associated with the property that is identified by the `validationContext` parameter. - + instance that is associated with the property that is identified by the `validationContext` parameter. + ]]> - cannot be assigned to the property. - - -or- - + cannot be assigned to the property. + + -or- + is . The property of is not a valid property. @@ -362,11 +362,11 @@ if the object validates; otherwise, . - object for each validation failure to the validation results collection. If the `validationResults` parameter is `null`, this method does not add a object to the collection. If a attribute is included in the `validationAttributes` parameter, the attribute is evaluated first. - + object for each validation failure to the validation results collection. If the `validationResults` parameter is `null`, this method does not add a object to the collection. If a attribute is included in the `validationAttributes` parameter, the attribute is evaluated first. + ]]> @@ -439,11 +439,11 @@ The context that describes the object to validate. Determines whether the specified object is valid using the validation context. - instance that is attached to the object type. - + instance that is attached to the object type. + ]]> The object is not valid. @@ -510,11 +510,11 @@ to validate all properties; otherwise, . Determines whether the specified object is valid using the validation context, and a value that specifies whether to validate all properties. - instance that is attached to the object type. - + instance that is attached to the object type. + ]]> @@ -579,11 +579,11 @@ The context that describes the property to validate. Validates the property. - instance that is associated with the property identified by the `validationContext` parameter. - + instance that is associated with the property identified by the `validationContext` parameter. + ]]> @@ -641,11 +641,11 @@ The validation attributes. Validates the specified attributes. - attribute is included, the attribute is evaluated first. - + attribute is included, the attribute is evaluated first. + ]]> The parameter is . diff --git a/xml/System.ComponentModel.Design.Data/DataSourceProviderService.xml b/xml/System.ComponentModel.Design.Data/DataSourceProviderService.xml index 6b33b92c6eb..8457b382267 100644 --- a/xml/System.ComponentModel.Design.Data/DataSourceProviderService.xml +++ b/xml/System.ComponentModel.Design.Data/DataSourceProviderService.xml @@ -75,13 +75,13 @@ When overridden in a derived class, creates and returns an instance of the given data source, and adds it to the design surface. An representing an instance of the added data source. - method on data sources that are designable for example, if the value is `true`. - - This method enables the service implementer to perform custom actions when a data source is added to the design surface. - + method on data sources that are designable for example, if the value is `true`. + + This method enables the service implementer to perform custom actions when a data source is added to the design surface. + ]]> The type name cannot be created or resolved. diff --git a/xml/System.ComponentModel.Design.Data/DesignerDataColumn.xml b/xml/System.ComponentModel.Design.Data/DesignerDataColumn.xml index ab30664e6c4..8e3542d6ff0 100644 --- a/xml/System.ComponentModel.Design.Data/DesignerDataColumn.xml +++ b/xml/System.ComponentModel.Design.Data/DesignerDataColumn.xml @@ -17,11 +17,11 @@ Represents a column of a table or view in the data store accessed through a data connection. This class cannot be inherited. - class is one of several types that represent the schema of a data store at design-time. These schema items are made available to controls by designers implementing the interface. Controls access schema objects by calling the method of the interface. - + class is one of several types that represent the schema of a data store at design-time. These schema items are made available to controls by designers implementing the interface. Controls access schema objects by calling the method of the interface. + ]]> @@ -63,11 +63,11 @@ One of the values. Initializes a new instance of the class with the specified name and data type. - to set the and properties. All other properties are set to their default values. - + to set the and properties. All other properties are set to their default values. + ]]> @@ -102,11 +102,11 @@ The default value of the column. Initializes a new instance of the class with the specified name, data type, and default value. - constructor to set the , , and properties. All other properties are set to their default values. - + constructor to set the , , and properties. All other properties are set to their default values. + ]]> @@ -156,11 +156,11 @@ The length of the data field, in bytes. Initializes a new instance of the class with the specified values. - constructor to set all the properties of a object. - + constructor to set all the properties of a object. + ]]> diff --git a/xml/System.ComponentModel.Design.Data/DesignerDataConnection.xml b/xml/System.ComponentModel.Design.Data/DesignerDataConnection.xml index 635d63e8ac0..31d939ae0f9 100644 --- a/xml/System.ComponentModel.Design.Data/DesignerDataConnection.xml +++ b/xml/System.ComponentModel.Design.Data/DesignerDataConnection.xml @@ -20,7 +20,7 @@ object represents a connection to a data store in the design tool. Typically a object is returned as part of the property, and is created either by reading the application's configuration file or by calling the method. + The object represents a connection to a data store in the design tool. Typically a object is returned as part of the property, and is created either by reading the application's configuration file or by calling the method. ]]> @@ -145,7 +145,7 @@ property contains the connection string used by the application for connecting to the data store. You must use the method to return a connection string suitable for use in the design environment. + The property contains the connection string used by the application for connecting to the data store. You must use the method to return a connection string suitable for use in the design environment. ]]> @@ -181,9 +181,9 @@ property will be `true` if the object was read from the application's configuration file, or if the object was written to the application's configuration file by the method. + The property will be `true` if the object was read from the application's configuration file, or if the object was written to the application's configuration file by the method. - When the is `true`, the property is set to the name of the connection as defined in the [connectionStrings Element (ASP.NET Settings Schema)](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/bf7sd233(v=vs.100)) of the configuration file. + When the is `true`, the property is set to the name of the connection as defined in the [connectionStrings Element (ASP.NET Settings Schema)](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/bf7sd233(v=vs.100)) of the configuration file. ]]> @@ -218,7 +218,7 @@ property contains the name that identifies a specific connection in an application configuration file or a list of data connections. When the property is `true`, property is used as the `name` attribute in the [connectionStrings Element (ASP.NET Settings Schema)](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/bf7sd233(v=vs.100)) configuration element, or is returned from the method. + The property contains the name that identifies a specific connection in an application configuration file or a list of data connections. When the property is `true`, property is used as the `name` attribute in the [connectionStrings Element (ASP.NET Settings Schema)](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/bf7sd233(v=vs.100)) configuration element, or is returned from the method. ]]> diff --git a/xml/System.ComponentModel.Design.Data/DesignerDataParameter.xml b/xml/System.ComponentModel.Design.Data/DesignerDataParameter.xml index b9c3b651e55..68c629a9c45 100644 --- a/xml/System.ComponentModel.Design.Data/DesignerDataParameter.xml +++ b/xml/System.ComponentModel.Design.Data/DesignerDataParameter.xml @@ -20,7 +20,7 @@ class is one of several types that represent the schema of a data store at design-time. These schema items are made available to controls by designers implementing the interface. Controls access schema objects by calling the method of the interface. + The class is one of several types that represent the schema of a data store at design-time. These schema items are made available to controls by designers implementing the interface. Controls access schema objects by calling the method of the interface. The class represents the parameters required to call a stored procedure in the data store. The property contains a collection of objects. diff --git a/xml/System.ComponentModel.Design.Data/DesignerDataSchemaClass.xml b/xml/System.ComponentModel.Design.Data/DesignerDataSchemaClass.xml index fac6b0a732b..2feb7b8dabe 100644 --- a/xml/System.ComponentModel.Design.Data/DesignerDataSchemaClass.xml +++ b/xml/System.ComponentModel.Design.Data/DesignerDataSchemaClass.xml @@ -17,13 +17,13 @@ Specifies the types of objects that can be retrieved from a data-store schema. This class cannot be inherited. - class is one of several types that represent the schema of a data store at design-time. These schema items are made available to controls by designers implementing the interface. Controls access schema objects by calling the method of the interface. - - Use fields from the class when calling the method to specify the types of objects you want to retrieve from a data-store schema. - + class is one of several types that represent the schema of a data store at design-time. These schema items are made available to controls by designers implementing the interface. Controls access schema objects by calling the method of the interface. + + Use fields from the class when calling the method to specify the types of objects you want to retrieve from a data-store schema. + ]]> diff --git a/xml/System.ComponentModel.Design.Data/DesignerDataStoredProcedure.xml b/xml/System.ComponentModel.Design.Data/DesignerDataStoredProcedure.xml index b48ef3360a9..4616a7a2960 100644 --- a/xml/System.ComponentModel.Design.Data/DesignerDataStoredProcedure.xml +++ b/xml/System.ComponentModel.Design.Data/DesignerDataStoredProcedure.xml @@ -20,9 +20,9 @@ class is one of several types that represent the schema of a data store at design-time. These schema items are made available to controls by designers implementing the interface. Controls access schema objects by calling the method of the interface. + The class is one of several types that represent the schema of a data store at design-time. These schema items are made available to controls by designers implementing the interface. Controls access schema objects by calling the method of the interface. - The class represents a single table in the data store. A collection of objects is returned when you call the method with the `schemaClass` parameter set to . + The class represents a single table in the data store. A collection of objects is returned when you call the method with the `schemaClass` parameter set to . ]]> @@ -119,7 +119,7 @@ method is called the first time the property is accessed to populate the collection of stored-procedure parameters. + The method is called the first time the property is accessed to populate the collection of stored-procedure parameters. ]]> @@ -204,7 +204,7 @@ property is populated by the method the first time the property is accessed. + The property is populated by the method the first time the property is accessed. ]]> diff --git a/xml/System.ComponentModel.Design.Data/DesignerDataTable.xml b/xml/System.ComponentModel.Design.Data/DesignerDataTable.xml index b15a0cb76f7..f5123085458 100644 --- a/xml/System.ComponentModel.Design.Data/DesignerDataTable.xml +++ b/xml/System.ComponentModel.Design.Data/DesignerDataTable.xml @@ -20,9 +20,9 @@ class is one of several types that represent the schema of a data store at design-time. These schema items are made available to controls by designers implementing the interface. Controls access schema objects by calling the method of the interface. + The class is one of several types that represent the schema of a data store at design-time. These schema items are made available to controls by designers implementing the interface. Controls access schema objects by calling the method of the interface. - The class represents a single table in the data store. A collection of objects is returned when you call the method with the `schemaClass` parameter set to . + The class represents a single table in the data store. A collection of objects is returned when you call the method with the `schemaClass` parameter set to . ]]> @@ -119,7 +119,7 @@ method is called the first time the property is accessed, to populate the collection of data table relationships. + The method is called the first time the property is accessed, to populate the collection of data table relationships. ]]> diff --git a/xml/System.ComponentModel.Design.Data/DesignerDataTableBase.xml b/xml/System.ComponentModel.Design.Data/DesignerDataTableBase.xml index a24cc2c3de0..b25b17cfc95 100644 --- a/xml/System.ComponentModel.Design.Data/DesignerDataTableBase.xml +++ b/xml/System.ComponentModel.Design.Data/DesignerDataTableBase.xml @@ -20,11 +20,11 @@ class is one of several types that represent the schema of a data store at design-time. These schema items are made available to controls by designers implementing the interface. Controls access schema objects by calling the method of the interface. + The class is one of several types that represent the schema of a data store at design-time. These schema items are made available to controls by designers implementing the interface. Controls access schema objects by calling the method of the interface. The class provides the properties and methods shared between data tables in a data store and views defined on those data tables. - When you inherit from the class, you must override the method. + When you inherit from the class, you must override the method. ]]> @@ -134,7 +134,7 @@ property is populated by the method the first time the property is accessed. + The property is populated by the method the first time the property is accessed. ]]> @@ -164,7 +164,7 @@ method is called the first time the property is accessed, to populate the collection of data-store columns. + The method is called the first time the property is accessed, to populate the collection of data-store columns. ]]> diff --git a/xml/System.ComponentModel.Design.Data/DesignerDataView.xml b/xml/System.ComponentModel.Design.Data/DesignerDataView.xml index 41a238d14d0..ee9066d1b7d 100644 --- a/xml/System.ComponentModel.Design.Data/DesignerDataView.xml +++ b/xml/System.ComponentModel.Design.Data/DesignerDataView.xml @@ -17,13 +17,13 @@ Represents a data view in the data store. - class is one of several types that represent the schema of a data store at design-time. These schema items are made available to controls by designers implementing the interface. Controls access schema objects by calling the method of the interface. - - The class represents a single data view in the data store. A collection of objects is returned when you call the method with the `schemaClass` parameter set to . - + class is one of several types that represent the schema of a data store at design-time. These schema items are made available to controls by designers implementing the interface. Controls access schema objects by calling the method of the interface. + + The class represents a single data view in the data store. A collection of objects is returned when you call the method with the `schemaClass` parameter set to . + ]]> diff --git a/xml/System.ComponentModel.Design.Data/IDataEnvironment.xml b/xml/System.ComponentModel.Design.Data/IDataEnvironment.xml index df5debec78d..b91873b4fed 100644 --- a/xml/System.ComponentModel.Design.Data/IDataEnvironment.xml +++ b/xml/System.ComponentModel.Design.Data/IDataEnvironment.xml @@ -54,13 +54,13 @@ method to activate the design environment's user interface for creating or editing data connections. If the `initialConnection` parameter is `null`, it indicates the user wants to create a new connection. If the `initialConnection` parameter is a object, it indicates the user wants to edit an existing connection. + Use the method to activate the design environment's user interface for creating or editing data connections. If the `initialConnection` parameter is `null`, it indicates the user wants to create a new connection. If the `initialConnection` parameter is a object, it indicates the user wants to edit an existing connection. Your design environment is responsible for creating the data connection, adding the connection either to a global list of connections or to the Web application's configuration file, and adding the new connection to the property. - The new connection should include the information that the application needs to create a data connection at run time. If you need to use the data connection in the design environment, use the method to return a object that will connect to the data store from the design environment. + The new connection should include the information that the application needs to create a data connection at run time. If you need to use the data connection in the design environment, use the method to return a object that will connect to the data store from the design environment. - If the user chooses to cancel the new connection creation process, the method should return `null`. + If the user chooses to cancel the new connection creation process, the method should return `null`. ]]> @@ -99,7 +99,7 @@ method launches the design environment's UI for editing or creating SQL query strings. If the `initialQueryText` parameter is , it indicates the user wants to create a new query. If the `initialQueryText` parameter contains a string, it indicates the user wants to edit the existing query. + The method launches the design environment's UI for editing or creating SQL query strings. If the `initialQueryText` parameter is , it indicates the user wants to create a new query. If the `initialQueryText` parameter contains a string, it indicates the user wants to edit the existing query. The `mode` parameter indicates the type of query the user wants to build; either select, update, insert, or delete. Your user interface can use the `mode` parameter to configure itself for the type of query desired, limit the user to using SQL statements valid only for the type of query desired, and/or validate the query against the desired type. @@ -138,14 +138,14 @@ method writes a connection to the application's configuration file. The connection string and provider name are written to the [connectionStrings Element (ASP.NET Settings Schema)](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/bf7sd233(v=vs.100)) configuration element named according to the `name` parameter. The property of the `connection` parameter is ignored. + The method writes a connection to the application's configuration file. The connection string and provider name are written to the [connectionStrings Element (ASP.NET Settings Schema)](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/bf7sd233(v=vs.100)) configuration element named according to the `name` parameter. The property of the `connection` parameter is ignored. - Implementations of the method should throw the following exceptions. + Implementations of the method should throw the following exceptions. |Exception|Reason| |---------------|------------| ||A duplicate name exists in the application's configuration file.| -|, , or other appropriate file IO exception.|The application's configuration file cannot be updated. Your method implementation should throw an appropriate exception.| +|, , or other appropriate file IO exception.|The application's configuration file cannot be updated. Your method implementation should throw an appropriate exception.| ||The application's configuration file cannot be checked out from the source control system.| Consider using the configuration-management APIs in the namespace to read and write the application's configuration file. The class will read and write the [connectionStrings Element (ASP.NET Settings Schema)](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/bf7sd233(v=vs.100)) configuration element. @@ -238,7 +238,7 @@ method returns the database schema for the specified data connection. If the schema is unavailable, or if the provider for the connection is unavailable, the should return `null`. + The method returns the database schema for the specified data connection. If the schema is unavailable, or if the provider for the connection is unavailable, the should return `null`. ]]> @@ -271,9 +271,9 @@ method returns a valid, open connection to the data store that can be used by the control designer. + The method returns a valid, open connection to the data store that can be used by the control designer. - Control designers should use the to obtain a data connection and should not attempt to open a connection using the property. + Control designers should use the to obtain a data connection and should not attempt to open a connection using the property. ]]> diff --git a/xml/System.ComponentModel.Design.Data/IDesignerDataSchema.xml b/xml/System.ComponentModel.Design.Data/IDesignerDataSchema.xml index 5b5e41fa931..5c2b18af37e 100644 --- a/xml/System.ComponentModel.Design.Data/IDesignerDataSchema.xml +++ b/xml/System.ComponentModel.Design.Data/IDesignerDataSchema.xml @@ -14,13 +14,13 @@ Defines methods for retrieving data-store schema information. - interface retrieve schema information from a data store and return it to the user interface, typically to populate UI elements that enable the user to specify the data-store object that they want to work with. - - The interface provides two methods: the method, which returns the requested schema objects, and the method, which indicates whether a specified data-schema object is supported by the data store. - + interface retrieve schema information from a data store and return it to the user interface, typically to populate UI elements that enable the user to specify the data-store object that they want to work with. + + The interface provides two methods: the method, which returns the requested schema objects, and the method, which indicates whether a specified data-schema object is supported by the data store. + ]]> @@ -49,17 +49,17 @@ Gets a collection of specified schema items. A collection of schema objects of the specified type. - method returns a collection of all the specified schema objects in the data store. - - See the class for the list of schema objects supported by the .NET Framework. Additional schema objects can be added to the class by creating a derived type. - - If the data store does not support the requested schema object, the method should return `null`. You can use the method to determine whether a data store supports the requested schema object before calling the method, to avoid returning `null` to your application. - - If the data store supports the requested object, but does not contain any instances, the method should return an empty collection. - + method returns a collection of all the specified schema objects in the data store. + + See the class for the list of schema objects supported by the .NET Framework. Additional schema objects can be added to the class by creating a derived type. + + If the data store does not support the requested schema object, the method should return `null`. You can use the method to determine whether a data store supports the requested schema object before calling the method, to avoid returning `null` to your application. + + If the data store supports the requested object, but does not contain any instances, the method should return an empty collection. + ]]> @@ -89,13 +89,13 @@ if the data store supports the specified data-schema object; otherwise, . - method indicates whether the data store supports a specified data-schema object. If the data store does not support the specified object, the method should return `false`. - - You can add tests for additional data-schema objects by deriving from the class. - + method indicates whether the data store supports a specified data-schema object. If the data store does not support the specified object, the method should return `false`. + + You can add tests for additional data-schema objects by deriving from the class. + ]]> diff --git a/xml/System.ComponentModel.Design.Data/QueryBuilderMode.xml b/xml/System.ComponentModel.Design.Data/QueryBuilderMode.xml index e5420def4b4..cb09d448bed 100644 --- a/xml/System.ComponentModel.Design.Data/QueryBuilderMode.xml +++ b/xml/System.ComponentModel.Design.Data/QueryBuilderMode.xml @@ -16,11 +16,11 @@ Specifies the type of data-store query the design environment should construct. - enumeration is used when you call the method to indicate the type of query desired. - + enumeration is used when you call the method to indicate the type of query desired. + ]]> diff --git a/xml/System.ComponentModel.Design.Serialization/BasicDesignerLoader.xml b/xml/System.ComponentModel.Design.Serialization/BasicDesignerLoader.xml index be3f1eda9fd..9f339814cfb 100644 --- a/xml/System.ComponentModel.Design.Serialization/BasicDesignerLoader.xml +++ b/xml/System.ComponentModel.Design.Serialization/BasicDesignerLoader.xml @@ -145,15 +145,15 @@ method. You do not need to override this method in your own class. The method performs the following actions: + This is an implementation of the abstract method. You do not need to override this method in your own class. The method performs the following actions: - It verifies that the design surface has not already loaded. -- On the first call, it adds relevant services and calls the method. +- On the first call, it adds relevant services and calls the method. -- It calls the , , and methods. +- It calls the , , and methods. - If the designer loader service has not been removed from the service container, will call the and methods instead of the and methods. In this situation, it is the responsibility of the designer loader service to call and . + If the designer loader service has not been removed from the service container, will call the and methods instead of the and methods. In this situation, it is the responsibility of the designer loader service to call and . ]]> @@ -199,12 +199,12 @@ method does not flush changes to the designer loader. If you want changes to be saved, call before calling . + Calling the method does not flush changes to the designer loader. If you want changes to be saved, call before calling . - Call when you are finished using the . The method leaves the in an unusable state. After calling , you must release all references to the so the garbage collector can reclaim the memory that the was occupying. For more information, see [Cleaning Up Unmanaged Resources](/dotnet/standard/garbage-collection/unmanaged) and [Implementing a Dispose Method](/dotnet/standard/garbage-collection/implementing-dispose). + Call when you are finished using the . The method leaves the in an unusable state. After calling , you must release all references to the so the garbage collector can reclaim the memory that the was occupying. For more information, see [Cleaning Up Unmanaged Resources](/dotnet/standard/garbage-collection/unmanaged) and [Implementing a Dispose Method](/dotnet/standard/garbage-collection/implementing-dispose). > [!NOTE] -> Always call before you release your last reference to the . Otherwise, the resources it is using will not be freed until the garbage collector calls the object's `Finalize` method. +> Always call before you release your last reference to the . Otherwise, the resources it is using will not be freed until the garbage collector calls the object's `Finalize` method. ]]> @@ -283,7 +283,7 @@ method returns immediately. Otherwise, asks the serialization manager to create a serialization session and then calls . + If the designer loader has not been loaded or has not been marked as modified, the method returns immediately. Otherwise, asks the serialization manager to create a serialization session and then calls . ]]> @@ -328,7 +328,7 @@ is a helper method that allows classes deriving from to access services offered by the designer loader host. + is a helper method that allows classes deriving from to access services offered by the designer loader host. ]]> @@ -368,7 +368,7 @@ method is called the first time is invoked. You can add any services necessary to the designer loader host at this time. The base implementation adds services that provides, so after calling the base implementation you may replace existing services. You must remove any custom services you add here by overriding . + The method is called the first time is invoked. You can add any services necessary to the designer loader host at this time. The base implementation adds services that provides, so after calling the base implementation you may replace existing services. You must remove any custom services you add here by overriding . ]]> @@ -412,7 +412,7 @@ method is used by some designer loaders to optimize reloading. This method can be overridden if your designer loader supports intelligent reloading. Some designer loaders can detect changes made to their underlying document and determine if a reload of the designer is actually necessary. If not, they should return `false` from this method. The default implementation always returns `true`, indicating that any call to will succeed. + The method is used by some designer loaders to optimize reloading. This method can be overridden if your designer loader supports intelligent reloading. Some designer loaders can detect changes made to their underlying document and determine if a reload of the designer is actually necessary. If not, they should return `false` from this method. The default implementation always returns `true`, indicating that any call to will succeed. ]]> @@ -452,7 +452,7 @@ has not been called yet, or if this designer loader has been disposed. + This method returns the loader host that was given to this designer loader. This can be `null` if has not been called yet, or if this designer loader has been disposed. ]]> @@ -537,7 +537,7 @@ method is called, the designer loader will call the method. + Determines if the designer loader has detected that the designer has been modified. If this property is `true` when the designer loader's method is called, the designer loader will call the method. ]]> @@ -577,11 +577,11 @@ method is invoked to start the loading process. You should perform any necessary initialization for loading at this time. This method should not be used to perform the actual load. The default implementation disables change notifications and sets up the for loading. + The method is invoked to start the loading process. You should perform any necessary initialization for loading at this time. This method should not be used to perform the actual load. The default implementation disables change notifications and sets up the for loading. - If you implement to provide dependent load support, you should call when the first dependent load occurs. Call the method after the last call to the method. By default, implements and does this for you. If is not available when is called, will directly call . + If you implement to provide dependent load support, you should call when the first dependent load occurs. Call the method after the last call to the method. By default, implements and does this for you. If is not available when is called, will directly call . - If you provide your own loader service, or if you choose not to provide a loader service, you are responsible for calling this method. The method will automatically call this, either indirectly by calling if is available, or directly if it is not. + If you provide your own loader service, or if you choose not to provide a loader service, you are responsible for calling this method. The method will automatically call this, either indirectly by calling if is available, or directly if it is not. ]]> @@ -621,9 +621,9 @@ method is invoked when the designer loader is about to unload the document. + The method is invoked when the designer loader is about to unload the document. - The document may be unloaded in preparation for reloading, or if the document failed to load. If you added document-specific services in or , remove them here. + The document may be unloaded in preparation for reloading, or if the document failed to load. If you added document-specific services in or , remove them here. ]]> @@ -670,11 +670,11 @@ method is invoked when loading is finished. It is always called, even if an exception is thrown during loading. The value of `successful` will be set to `true` if the load succeeded, or `false` if a fatal error occurred. The `errors` collection will contain objects that were reported as errors. Usually, these objects are exceptions. + The method is invoked when loading is finished. It is always called, even if an exception is thrown during loading. The value of `successful` will be set to `true` if the load succeeded, or `false` if a fatal error occurred. The `errors` collection will contain objects that were reported as errors. Usually, these objects are exceptions. - If you implement to provide dependent load support, you should call the method after the last call to the method. By default, implements and does this for you. If is not available when is called, will directly call after calling . + If you implement to provide dependent load support, you should call the method after the last call to the method. By default, implements and does this for you. If is not available when is called, will directly call after calling . - This method should be called by the designer loader service when all dependent loads have been completed. This stops the loading process that was initiated by the method. If you provide your own loader service, or if you choose not to provide a loader service, you are responsible for calling this method. The method will automatically call this, either indirectly by calling the method if is available, or directly if it is not. + This method should be called by the designer loader service when all dependent loads have been completed. This stops the loading process that was initiated by the method. If you provide your own loader service, or if you choose not to provide a loader service, you are responsible for calling this method. The method will automatically call this, either indirectly by calling the method if is available, or directly if it is not. ]]> @@ -716,7 +716,7 @@ method is called in response to a component changing, adding, or removing event which indicates that the designer is about to be modified. You can implement source code control by overriding this method. A call to does not mean that the property will later be set to `true`; it merely indicates an intention to do so. + The method is called in response to a component changing, adding, or removing event which indicates that the designer is about to be modified. You can implement source code control by overriding this method. A call to does not mean that the property will later be set to `true`; it merely indicates an intention to do so. ]]> @@ -759,7 +759,7 @@ method is invoked when the designer loader needs to flush to persistence any changes made to the designers. It is invoked in response to a call to the method. + The method is invoked when the designer loader needs to flush to persistence any changes made to the designers. It is invoked in response to a call to the method. ]]> @@ -803,7 +803,7 @@ method is invoked when the designer loader needs to load its state. is called before the method. You must implement this method to load the designer contents. + The method is invoked when the designer loader needs to load its state. is called before the method. You must implement this method to load the designer contents. ]]> @@ -895,7 +895,7 @@ method can be invoked by the designer loader to request a reload of the designer. Because reloads are performed at idle time, this method does not actually reload the designer; it just queues the reload. + The method can be invoked by the designer loader to request a reload of the designer. Because reloads are performed at idle time, this method does not actually reload the designer; it just queues the reload. ]]> @@ -974,7 +974,7 @@ method is called during if one or more errors occurred while flushing changes. The values in the `errors` collection can be exceptions or objects with values that describe the error. The default implementation of raises the last exception in the collection. + The method is called during if one or more errors occurred while flushing changes. The values in the `errors` collection can be exceptions or objects with values that describe the error. The default implementation of raises the last exception in the collection. ]]> @@ -1018,7 +1018,7 @@ method should be called during loading to establish the full name of the component a designer is designing. + The method should be called during loading to establish the full name of the component a designer is designing. ]]> @@ -1063,7 +1063,7 @@ method once for each external object participating in the load process. The method is called when the work of the load process is done. + Call the method once for each external object participating in the load process. The method is called when the work of the load process is done. ]]> @@ -1114,7 +1114,7 @@ method is called to signal that a dependent loading operation has completed. Call the method once for every process that was registered by calling the method, which has already completed. + The method is called to signal that a dependent loading operation has completed. Call the method once for every process that was registered by calling the method, which has already completed. If the dependent load succeeds, the caller sets the `successful` parameter to `true` and passes either an empty collection or `null` to the `errorCollection` parameter. If the dependent load encounters errors, the caller sets the `successful` parameter to `false` and passes a collection of exceptions that indicate the reason or reasons for failure to the `errorCollection` parameter. @@ -1163,7 +1163,7 @@ method to request that the loader reload the design document. If the loader supports reloading and complies with the reload, the designer loader can return `true`. Otherwise, it returns `false`, indicating that the reload will not occur. Callers cannot rely on the reload happening immediately; the designer loader can schedule this for some other time, or it can try to reload the designer at once. + Any object can call the method to request that the loader reload the design document. If the loader supports reloading and complies with the reload, the designer loader can return `true`. Otherwise, it returns `false`, indicating that the reload will not occur. Callers cannot rely on the reload happening immediately; the designer loader can schedule this for some other time, or it can try to reload the designer at once. The caller can display a message to the user if the designer cannot be reloaded. diff --git a/xml/System.ComponentModel.Design.Serialization/CodeDomComponentSerializationService.xml b/xml/System.ComponentModel.Design.Serialization/CodeDomComponentSerializationService.xml index aac321b8c03..3b037826946 100644 --- a/xml/System.ComponentModel.Design.Serialization/CodeDomComponentSerializationService.xml +++ b/xml/System.ComponentModel.Design.Serialization/CodeDomComponentSerializationService.xml @@ -44,13 +44,13 @@ Serializes a set of components into a serialization store. - class serializes a set of components or serializable objects into a serialization store. The store can then be deserialized at a later time. The class differs from other serialization schemes in that the serialization format is opaque, and it allows for partial serialization of objects. For example, you can choose to serialize only selected properties for an object. - - The base class, , replaces the interface from the .NET Framework version 1.0, although the latter is retained for backward compatibility. The class does not implement the interface, but if you query for , the provides a bridge implementation to ensure backward compatibility. - + class serializes a set of components or serializable objects into a serialization store. The store can then be deserialized at a later time. The class differs from other serialization schemes in that the serialization format is opaque, and it allows for partial serialization of objects. For example, you can choose to serialize only selected properties for an object. + + The base class, , replaces the interface from the .NET Framework version 1.0, although the latter is retained for backward compatibility. The class does not implement the interface, but if you query for , the provides a bridge implementation to ensure backward compatibility. + ]]> @@ -178,11 +178,11 @@ Creates a new . A new serialization store. - methods to build up serialization state for a group of objects. - + methods to build up serialization state for a group of objects. + ]]> @@ -280,11 +280,11 @@ Deserializes the given store and populates the given with deserialized objects. A collection of deserialized components. - interface will be added to the `container` parameter. - + interface will be added to the `container` parameter. + ]]> @@ -335,11 +335,11 @@ to apply default property values; otherwise, . Deserializes the given to the given container, optionally applying default property values. - method deserializes the given store, but rather than producing new objects, the data in the store is applied to an existing set of objects that are taken from the `container` parameter. As a result, the caller can create in advance an object however it sees fit. If an object has deserialization state and the object is not named in the set of existing objects, a new object will be created. If that object also implements , it will be added to the given container. Objects in the container must have names and types that match objects in the serialization store in order for an existing object to be used. - + method deserializes the given store, but rather than producing new objects, the data in the store is applied to an existing set of objects that are taken from the `container` parameter. As a result, the caller can create in advance an object however it sees fit. If an object has deserialization state and the object is not named in the set of existing objects, a new object will be created. If that object also implements , it will be added to the given container. Objects in the container must have names and types that match objects in the serialization store in order for an existing object to be used. + ]]> @@ -383,11 +383,11 @@ Loads a from the given stream. The loaded . - methods. - + methods. + ]]> @@ -432,11 +432,11 @@ The object to serialize. Serializes the given object to the given . - @@ -481,11 +481,11 @@ The object to serialize. Serializes the given object, accounting for default property values. - @@ -532,11 +532,11 @@ The given member. Serializes the given member on the given object. - @@ -583,11 +583,11 @@ The given member. Serializes the given member on the given object, but also serializes the member if it contains the default property value. - method takes this into account and would clear the state of the property in this case. - + method takes this into account and would clear the state of the property in this case. + ]]> diff --git a/xml/System.ComponentModel.Design.Serialization/CodeDomDesignerLoader.xml b/xml/System.ComponentModel.Design.Serialization/CodeDomDesignerLoader.xml index 5a22d2c49f5..fcedf1d1be9 100644 --- a/xml/System.ComponentModel.Design.Serialization/CodeDomDesignerLoader.xml +++ b/xml/System.ComponentModel.Design.Serialization/CodeDomDesignerLoader.xml @@ -139,7 +139,7 @@ , but it does use the provider to obtain an that it can use to validate identifiers in the name-creation service. The designer loader will also check the to see if it implements the interface. For more information on parsing or generating code, see the and methods. + The designer loader does not parse or generate code from the returned , but it does use the provider to obtain an that it can use to validate identifiers in the name-creation service. The designer loader will also check the to see if it implements the interface. For more information on parsing or generating code, see the and methods. ]]> @@ -179,12 +179,12 @@ method removes services added by the method. + The method removes services added by the method. - Call when you are finished using the . The method leaves the in an unusable state. After calling , you must release all references to the so the garbage collector can reclaim the memory that the was occupying. For more information, see [Cleaning Up Unmanaged Resources](/dotnet/standard/garbage-collection/unmanaged) and [Implementing a Dispose Method](/dotnet/standard/garbage-collection/implementing-dispose). + Call when you are finished using the . The method leaves the in an unusable state. After calling , you must release all references to the so the garbage collector can reclaim the memory that the was occupying. For more information, see [Cleaning Up Unmanaged Resources](/dotnet/standard/garbage-collection/unmanaged) and [Implementing a Dispose Method](/dotnet/standard/garbage-collection/implementing-dispose). > [!NOTE] -> Always call before you release your last reference to the . Otherwise, the resources it is using will not be freed until the garbage collector calls the object's `Finalize` method. +> Always call before you release your last reference to the . Otherwise, the resources it is using will not be freed until the garbage collector calls the object's `Finalize` method. ]]> @@ -281,7 +281,7 @@ method checks for the presence of the interface on the . The provider will reparse the CodeDOM tree and pass the resulting parse tree to the method. If this method returns `false`, the designer will not be reloaded. + The method checks for the presence of the interface on the . The provider will reparse the CodeDOM tree and pass the resulting parse tree to the method. If this method returns `false`, the designer will not be reloaded. ]]> @@ -323,7 +323,7 @@ method, see . + For more information on the method, see . ]]> @@ -363,7 +363,7 @@ method, see . + For more information on the method, see . ]]> @@ -459,7 +459,7 @@ method, see . + For more information on the method, see . ]]> @@ -500,7 +500,7 @@ method is called when the needs to parse the source code. The source code location and format must be specified by deriving classes. + The method is called when the needs to parse the source code. The source code location and format must be specified by deriving classes. ]]> @@ -545,9 +545,9 @@ method obtains the root for the root component of the designer and invokes the serializer to serialize the component. If the result of this operation is a , then integrates the with the existing CodeDOM tree. The result is the original CodeDOM tree with matching members and statements replaced. Finally, calls the abstract method to save this CodeDOM tree. + The method obtains the root for the root component of the designer and invokes the serializer to serialize the component. If the result of this operation is a , then integrates the with the existing CodeDOM tree. The result is the original CodeDOM tree with matching members and statements replaced. Finally, calls the abstract method to save this CodeDOM tree. - If the serialization of the root designer component does not result in a , then does nothing further. + If the serialization of the root designer component does not result in a , then does nothing further. > [!IMPORTANT] > It is the responsibility of the caller to ensure that a CodeDOM originates from a trusted source. Accepting a CodeDOM object from an untrusted party could allow that party to run malicious code. When flushing a CodeDOM into a file, the framework will run code represented by the CodeDOM object and the serialized content of the object as provided. @@ -595,7 +595,7 @@ method obtains an from the CodeDOM provider and parses the code. locates the first class in the file, obtains a root for the data type, and then invokes the serializer to deserialize the data type. assumes that this process will create all necessary components in the of the property. Finally, calls the method with the fully qualified name of the type it passed to the CodeDOM serializer. + The method obtains an from the CodeDOM provider and parses the code. locates the first class in the file, obtains a root for the data type, and then invokes the serializer to deserialize the data type. assumes that this process will create all necessary components in the of the property. Finally, calls the method with the fully qualified name of the type it passed to the CodeDOM serializer. > [!IMPORTANT] > It is the responsibility of the caller to ensure that a CodeDOM originates from a trusted source. Accepting a CodeDOM object from an untrusted party could allow that party to run malicious code. When loading a CodeDOM into the design surface, the framework will run code represented by the CodeDOM object and the serialized content of the object as provided. @@ -878,7 +878,7 @@ automatically adds this to the service container when the method is invoked. While the type resolution service is optional in many scenarios, it is required for code interpretation because source code contains type names, but no assembly references. + The automatically adds this to the service container when the method is invoked. While the type resolution service is optional in many scenarios, it is required for code interpretation because source code contains type names, but no assembly references. ]]> @@ -923,7 +923,7 @@ method saves a to persistent storage. The deriving class is responsible for invoking the on the appropriate text writer to save the code. The ensures that the CodeDOM objects that are passed to are the same instances of objects that were retrieved from , except in cases where the serialization process had to make changes to the code. This allows an optimized designer loader to store additional data in the property of code elements. This data will be available during the method for any elements that were not replaced by the serialization process. + The method saves a to persistent storage. The deriving class is responsible for invoking the on the appropriate text writer to save the code. The ensures that the CodeDOM objects that are passed to are the same instances of objects that were retrieved from , except in cases where the serialization process had to make changes to the code. This allows an optimized designer loader to store additional data in the property of code elements. This data will be available during the method for any elements that were not replaced by the serialization process. ]]> diff --git a/xml/System.ComponentModel.Design.Serialization/CodeDomLocalizationProvider.xml b/xml/System.ComponentModel.Design.Serialization/CodeDomLocalizationProvider.xml index 560885957da..2420155e5a0 100644 --- a/xml/System.ComponentModel.Design.Serialization/CodeDomLocalizationProvider.xml +++ b/xml/System.ComponentModel.Design.Serialization/CodeDomLocalizationProvider.xml @@ -50,13 +50,13 @@ Provides CodeDOM resource serialization services. This class cannot be inherited. - class is a serialization provider that provides a localization feature. It supports serializing to resources through , and it adds two properties to the root component: `Language` and `Localizable`. If `Localizable` is set to `true`, this provider changes the way that component properties are generated and routes their values to a resource file. Two localization models are supported. - - You can control the cultures that are offered and the style of localization with constructor parameters. - + class is a serialization provider that provides a localization feature. It supports serializing to resources through , and it adds two properties to the root component: `Language` and `Localizable`. If `Localizable` is set to `true`, this provider changes the way that component properties are generated and routes their values to a resource file. Two localization models are supported. + + You can control the cultures that are offered and the style of localization with constructor parameters. + ]]> @@ -105,13 +105,13 @@ A value indicating the localization model to be used by the CodeDOM resource adapter. Initializes a new instance of the class. - constructor creates a new adapter and attaches it to the serialization manager. This adds itself as a serializer for resources into the serialization manager, and, if not already added, adds itself as an extender provider to the root component. - - If the `model` parameter is not , the provides the `Language` and `Localizable` properties. - + constructor creates a new adapter and attaches it to the serialization manager. This adds itself as a serializer for resources into the serialization manager, and, if not already added, adds itself as an extender provider to the root component. + + If the `model` parameter is not , the provides the `Language` and `Localizable` properties. + ]]> @@ -161,15 +161,15 @@ An array of cultures that this resource adapter should support. Initializes a new instance of the class. - constructor creates a new adapter and attaches it to the serialization manager. This adds itself as a serializer for resources into the serialization manager, and, if not already added, adds itself as an extender provider to the root component. - - If the `model` parameter is not , the provides the `Language` and `Localizable` properties. - - If `supportedCultures` is not provided, the default is all cultures that are currently installed on the computer. If an array of cultures is provided, and it includes cultures that are not installed on the computer, those cultures are not available. - + constructor creates a new adapter and attaches it to the serialization manager. This adds itself as a serializer for resources into the serialization manager, and, if not already added, adds itself as an extender provider to the root component. + + If the `model` parameter is not , the provides the `Language` and `Localizable` properties. + + If `supportedCultures` is not provided, the default is all cultures that are currently installed on the computer. If an array of cultures is provided, and it includes cultures that are not installed on the computer, those cultures are not available. + ]]> @@ -270,11 +270,11 @@ For a description of this member, see . An instance of a serializer of the type requested, or if the request cannot be satisfied. - instance is cast to an interface. - + instance is cast to an interface. + ]]> diff --git a/xml/System.ComponentModel.Design.Serialization/CodeDomSerializer.xml b/xml/System.ComponentModel.Design.Serialization/CodeDomSerializer.xml index 75d6f23d54b..3639a862bdd 100644 --- a/xml/System.ComponentModel.Design.Serialization/CodeDomSerializer.xml +++ b/xml/System.ComponentModel.Design.Serialization/CodeDomSerializer.xml @@ -55,38 +55,38 @@ Serializes an object graph to a series of CodeDOM statements. This class provides an abstract base class for a serializer. - to control the generation of component initialization code for a type of component at design time. - - To implement a custom for a type, you must: - -1. Define a class that derives from . - -2. Implement method overrides for serialization or deserialization methods. (See the information below for details.) - -3. Associate your custom implementation with a type of component using a . - - To implement a serialization method for generating configuration code for a component: - -1. Within a class that derives from , override an appropriate serialization or deserialization method of the base class. - -2. If you want the default serializer to generate code statements that perform the default component configuration, you must obtain and call the base serializer for the component. To obtain the base serializer for the component, call the method of the passed to your method override. Pass the method the type of the component to serialize the configuration of, along with the base type of serializer you are requesting, which is . Call the method of the same name you are overriding on the base serializer, using the and object passed to your method override. If you are implementing the method, the method of the base serializer will return an object. The type of this object depends on the type of base serializer which depends on the type of component you are serializing the values of. If you are implementing the , , or method, you must create a new to contain the generated code statements, and pass it to the method. - -3. If you have called a base serializer method, you will have a that contains the statements to generate to initialize the component. Otherwise you should create a . You can add objects representing statements to generate in the component configuration code to this collection. - -4. Return the that represents the source code to generate to configure the component. - - - -## Examples - The following code example illustrates how to create a custom CodeDOM serializer that derives from . - + to control the generation of component initialization code for a type of component at design time. + + To implement a custom for a type, you must: + +1. Define a class that derives from . + +2. Implement method overrides for serialization or deserialization methods. (See the information below for details.) + +3. Associate your custom implementation with a type of component using a . + + To implement a serialization method for generating configuration code for a component: + +1. Within a class that derives from , override an appropriate serialization or deserialization method of the base class. + +2. If you want the default serializer to generate code statements that perform the default component configuration, you must obtain and call the base serializer for the component. To obtain the base serializer for the component, call the method of the passed to your method override. Pass the method the type of the component to serialize the configuration of, along with the base type of serializer you are requesting, which is . Call the method of the same name you are overriding on the base serializer, using the and object passed to your method override. If you are implementing the method, the method of the base serializer will return an object. The type of this object depends on the type of base serializer which depends on the type of component you are serializing the values of. If you are implementing the , , or method, you must create a new to contain the generated code statements, and pass it to the method. + +3. If you have called a base serializer method, you will have a that contains the statements to generate to initialize the component. Otherwise you should create a . You can add objects representing statements to generate in the component configuration code to this collection. + +4. Return the that represents the source code to generate to configure the component. + + + +## Examples + The following code example illustrates how to create a custom CodeDOM serializer that derives from . + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/IDesignerSerializationManagerSample/CPP/idesignerserializationmanagersample.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel.Design.Serialization/CodeDomSerializer/Overview/idesignerserializationmanagersample.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel.Design.Serialization/CodeDomSerializer/Overview/idesignerserializationmanagersample.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel.Design.Serialization/CodeDomSerializer/Overview/idesignerserializationmanagersample.vb" id="Snippet1"::: + ]]> @@ -179,11 +179,11 @@ Deserializes the specified serialized CodeDOM object into an object. The deserialized CodeDOM object. - @@ -322,11 +322,11 @@ Deserializes a single statement. An object instance resulting from deserializing . - is equivalent of calling , except that it returns an object instance if the resulting statement was a variable assign statement, a variable declaration with an init expression, or a field assignment statement. - + is equivalent of calling , except that it returns an object instance if the resulting statement was a variable assign statement, a variable declaration with an init expression, or a field assignment statement. + ]]> @@ -792,11 +792,11 @@ Serializes the specified value to a CodeDOM expression. The serialized value. This returns if no reference expression can be obtained for the specified value, or the value cannot be serialized. - , except that it stops if it cannot obtain a simple reference expression for the value. Call this method when you expect the resulting expression to be used as a parameter or target of a statement. - + , except that it stops if it cannot obtain a simple reference expression for the value. Call this method when you expect the resulting expression to be used as a parameter or target of a statement. + ]]> diff --git a/xml/System.ComponentModel.Design.Serialization/CodeDomSerializerBase.xml b/xml/System.ComponentModel.Design.Serialization/CodeDomSerializerBase.xml index c5e083cc0df..331beec96b2 100644 --- a/xml/System.ComponentModel.Design.Serialization/CodeDomSerializerBase.xml +++ b/xml/System.ComponentModel.Design.Serialization/CodeDomSerializerBase.xml @@ -116,11 +116,11 @@ |Expression|Behavior| |----------------|--------------| -||This expression represents `this` or `Me`. To locate the object that is associated with this expression, the method will look in the context stack for a . This object contains the root object of the graph and the expression that represents it. If the object is present and the expression matches, the root object will be returned. An error is reported if an instance cannot be located.| -||If the target of the field reference evaluates to the root object, the method of the manager parameter will be used to retrieve the object instance based on name. Otherwise, standard reflection is used against the target object to locate the requested field. An error is reported if the field cannot be located.| -||The method of the `manager` parameter is used to locate the instance representing the given variable name. An error is reported if an instance cannot be located.| +||This expression represents `this` or `Me`. To locate the object that is associated with this expression, the method will look in the context stack for a . This object contains the root object of the graph and the expression that represents it. If the object is present and the expression matches, the root object will be returned. An error is reported if an instance cannot be located.| +||If the target of the field reference evaluates to the root object, the method of the manager parameter will be used to retrieve the object instance based on name. Otherwise, standard reflection is used against the target object to locate the requested field. An error is reported if the field cannot be located.| +||The method of the `manager` parameter is used to locate the instance representing the given variable name. An error is reported if an instance cannot be located.| - continues to interpret expressions until they are completely resolved to an object, or until it can no longer simplify the expression. In this case, will return a that contains the most simplified expression. The following expressions are not supported: + continues to interpret expressions until they are completely resolved to an object, or until it can no longer simplify the expression. In this case, will return a that contains the most simplified expression. The following expressions are not supported: - @@ -197,7 +197,7 @@ method is invoked during deserialization to obtain an instance of an object. When this is called, an instance of the requested type should be returned. The default implementation invokes the method of the `manager` parameter. + The method is invoked during deserialization to obtain an instance of an object. When this is called, an instance of the requested type should be returned. The default implementation invokes the method of the `manager` parameter. ]]> @@ -256,11 +256,11 @@ method is a helper method that derived classes can call. It looks for properties on the given object and attempts to load their values out of the invariant culture's resource bundle. This is generally used to handle design-time properties that are not emitted into source code. It should not be used for localized properties because it only operates on the invariant culture. + The method is a helper method that derived classes can call. It looks for properties on the given object and attempts to load their values out of the invariant culture's resource bundle. This is generally used to handle design-time properties that are not emitted into source code. It should not be used for localized properties because it only operates on the invariant culture. This method inspects all of the properties of the `value` parameter that match the attributes specified by the `filter` parameter, and then checks for those properties in a resource binary object. This is useful for deserializing properties that cannot be represented in code, such as design-time properties. - This method requires that a designer loader offers an to read resources. If the provides a for the invariant culture, then will read resources from the XML resource (.resx) file's metadata section, which is not included in final compiled code. If this service is not available, no resources will be read. + This method requires that a designer loader offers an to read resources. If the provides a for the invariant culture, then will read resources from the XML resource (.resx) file's metadata section, which is not included in final compiled code. If this service is not available, no resources will be read. ]]> @@ -307,7 +307,7 @@ method is a helper method that derived classes can call. It interprets the `statement` parameter. + The method is a helper method that derived classes can call. It interprets the `statement` parameter. The being deserialized will be pushed on the context stack. @@ -483,17 +483,17 @@ method returns an expression representing the given object. It can return `null`, indicating that no expression has been set that describes the object. Expressions are acquired in one of three ways: + The method returns an expression representing the given object. It can return `null`, indicating that no expression has been set that describes the object. Expressions are acquired in one of three ways: -- The expression could be the result of a prior call to the method. +- The expression could be the result of a prior call to the method. - The expression could have been found in the . - The expression could be derived through . - To derive expressions through , the method queries the reference service for a name for the given object. If the expression service returns a valid name, , the method checks to see if there is a "." in the name. This indicates that the expression service found this object as the return value of a read-only property on another object. If there is a ".", will split the reference into parts. The leftmost part is a name that will be evaluated with the method. For each subsequent part, a property reference expression will be built. The final expression will then be returned. + To derive expressions through , the method queries the reference service for a name for the given object. If the expression service returns a valid name, , the method checks to see if there is a "." in the name. This indicates that the expression service found this object as the return value of a read-only property on another object. If there is a ".", will split the reference into parts. The leftmost part is a name that will be evaluated with the method. For each subsequent part, a property reference expression will be built. The final expression will then be returned. - If the object did not have an expression set, or if the object was not found in the reference service, will return `null`, indicating there is no existing expression for the object. + If the object did not have an expression set, or if the object was not found in the reference service, will return `null`, indicating there is no existing expression for the object. ]]> @@ -699,7 +699,7 @@ method is an extension to the method. The method takes an object type, rather than an object value. If an external party had overridden metadata for a specific object through , that metadata override would not be seen by the method, which only takes a type. The method checks the metadata of the value and the value's type. If the two differ, will look to see if there is a custom designer serializer attribute on the value. If so, will attempt to use it. Otherwise, it will defer to . + The method is an extension to the method. The method takes an object type, rather than an object value. If an external party had overridden metadata for a specific object through , that metadata override would not be seen by the method, which only takes a type. The method checks the metadata of the value and the value's type. If the two differ, will look to see if there is a custom designer serializer attribute on the value. If so, will attempt to use it. Otherwise, it will defer to . ]]> @@ -750,7 +750,7 @@ method is an extension to the method. The method takes an object type, rather than an object value. + The method is an extension to the method. The method takes an object type, rather than an object value. ]]> @@ -839,7 +839,7 @@ method calls the method. If this method does not return a name, then uses to fabricate a valid name for the object. If the service is not available, will fabricate a name based on the short type name combined with an index number to make it unique. The resulting name is associated with the serialization manager by calling the method before the new name is returned. + The method calls the method. If this method does not return a name, then uses to fabricate a valid name for the object. If the service is not available, will fabricate a name based on the short type name combined with an index number to make it unique. The resulting name is associated with the serialization manager by calling the method before the new name is returned. ]]> @@ -906,7 +906,7 @@ method to create a relationship between `value` and a referring expression. + For the `value` parameter to be considered serialized, the `manager` parameter or another serializer must have called the method to create a relationship between `value` and a referring expression. ]]> @@ -960,7 +960,7 @@ method to create a relationship between `value` and a referring expression. + For the `value` parameter to be considered serialized, the `manager` parameter or another serializer must have called the method to create a relationship between `value` and a referring expression. ]]> @@ -1014,7 +1014,7 @@ method can be used to serialize an expression that represents the creation of the `value` parameter. It is aware of instance descriptors. + The method can be used to serialize an expression that represents the creation of the `value` parameter. It is aware of instance descriptors. The `isComplete` parameter is set to `true` if the expression represents a fully configured object, or `false` if further serialization must be done on the object's properties. @@ -1069,11 +1069,11 @@ method is a helper method that derived classes can call to serialize a single event into the given . queries the serialization manager for a for the given event, and then asks the to serialize it. + The method is a helper method that derived classes can call to serialize a single event into the given . queries the serialization manager for a for the given event, and then asks the to serialize it. - places the `statements` and `descriptor` parameters on the . + places the `statements` and `descriptor` parameters on the . - requires an to discover event bindings to methods that are not compiled. If this service is not present, event bindings to non-compiled methods will not be written. Event bindings to compiled methods will still be serialized if the objects to which the events are bound can be converted into expressions. + requires an to discover event bindings to methods that are not compiled. If this service is not present, event bindings to non-compiled methods will not be written. Event bindings to compiled methods will still be serialized if the objects to which the events are bound can be converted into expressions. ]]> @@ -1144,9 +1144,9 @@ method is a helper method that derived classes can call. It looks at events on the `value` parameter that match the `filter` parameter, and then it calls the method for each event. + The method is a helper method that derived classes can call. It looks at events on the `value` parameter that match the `filter` parameter, and then it calls the method for each event. - The method places the for `value` on the . + The method places the for `value` on the . ]]> @@ -1209,9 +1209,9 @@ method is a helper method that derived classes can call. It looks at properties on the `value` parameter that match the `filter` parameter, and then it calls the method for each property. + The method is a helper method that derived classes can call. It looks at properties on the `value` parameter that match the `filter` parameter, and then it calls the method for each property. - The method places the for `value` on the . + The method places the for `value` on the . ]]> @@ -1274,11 +1274,11 @@ method is a helper method that derived classes can call. It looks at properties on the `value` parameter that match the `filter` parameter, and then it serializes the properties into the invariant culture resource bundle. If the resource service returns a , the property values will be stored in the metadata section of the XML resource (.resx) file. The `statements` parameter is not used. + The method is a helper method that derived classes can call. It looks at properties on the `value` parameter that match the `filter` parameter, and then it serializes the properties into the invariant culture resource bundle. If the resource service returns a , the property values will be stored in the metadata section of the XML resource (.resx) file. The `statements` parameter is not used. To be serialized as a resource, a property must be simple (not a content property) and its value must be serializable. Properties that do not conform to this pattern will be skipped. - requires an to obtain a to write resources for the invariant culture. If this service is not available, no resources will be written. + requires an to obtain a to write resources for the invariant culture. If this service is not available, no resources will be written. ]]> @@ -1335,9 +1335,9 @@ method retrieves a for the `propertyToSerialize` parameter and delegates to it. + The method retrieves a for the `propertyToSerialize` parameter and delegates to it. - places the `statements` and `propertyToSerialize` parameters on the . + places the `statements` and `propertyToSerialize` parameters on the . ]]> @@ -1398,9 +1398,9 @@ method is a helper method that serializes a value to a resource bundle under the given name. The culture that the resource is written to is determined by searching the serialization manager's collection for a property called `ResourceCulture`. If this property exists, resources will be written to that culture. Otherwise, resources will be written to the invariant culture. The `value` parameter must be serializable. + The method is a helper method that serializes a value to a resource bundle under the given name. The culture that the resource is written to is determined by searching the serialization manager's collection for a property called `ResourceCulture`. If this property exists, resources will be written to that culture. Otherwise, resources will be written to the invariant culture. The `value` parameter must be serializable. - requires an to obtain a to write resources for the correct culture. If this service is not available, will instead build a binary object in code that represents the resource. + requires an to obtain a to write resources for the correct culture. If this service is not available, will instead build a binary object in code that represents the resource. ]]> @@ -1465,7 +1465,7 @@ ## Remarks The resource is always written to the invariant culture. The `value` parameter must be serializable. - The method requires an to obtain a to write resources for the correct culture. If this service is not available, will instead build a binary object in code that represents the resource. + The method requires an to obtain a to write resources for the correct culture. If this service is not available, will instead build a binary object in code that represents the resource. ]]> @@ -1525,24 +1525,24 @@ ## Remarks The `value` parameter can be `null`, in which case a primitive expression will be returned. - The method uses the following rules for serializing types: + The method uses the following rules for serializing types: -1. It first calls the method to see if an expression has already been created for the object. If so, it returns the existing expression. +1. It first calls the method to see if an expression has already been created for the object. If so, it returns the existing expression. 2. It then locates the object's serializer, and asks it to serialize. 3. If the return value of the object's serializer is a , the expression is returned. -4. It makes one last call to to see if the serializer added an expression. +4. It makes one last call to to see if the serializer added an expression. 5. Finally, it returns `null`. If no expression could be created and no suitable serializer could be found, an error will be reported through the serialization manager. No error will be reported if a serializer was found but it failed to produce an expression. In this case, it is assumed that the serializer either already reported the error or it did not attempt to serialize the object. - If the serializer returned a statement or a collection of statements, those statements will not be discarded. The method will first look for a on the context stack and add statements to the statement context object's property. If there is no statement context, the method will look in the context for a and add the statements there. If no place can be found to add the statements, an error will be generated. + If the serializer returned a statement or a collection of statements, those statements will not be discarded. The method will first look for a on the context stack and add statements to the statement context object's property. If there is no statement context, the method will look in the context for a and add the statements there. If no place can be found to add the statements, an error will be generated. > [!NOTE] -> You should not call the method within when serializing your own object. Instead, you should call . If it returns `null`, create your own expression and call . Then proceed with the rest of your serialization. +> You should not call the method within when serializing your own object. Instead, you should call . If it returns `null`, create your own expression and call . Then proceed with the rest of your serialization. ]]> @@ -1618,9 +1618,9 @@ method is a helper method that serializes a value to a resource expression. This is in contrast to the method, which writes a value to a resource binary object. goes one step further and returns an expression that can be used to recover the resource. For example, the return value might be "rm.GetValue("SomeBitmap");". The name of the resource is calculated from the , if one can be found on the context stack. + The method is a helper method that serializes a value to a resource expression. This is in contrast to the method, which writes a value to a resource binary object. goes one step further and returns an expression that can be used to recover the resource. For example, the return value might be "rm.GetValue("SomeBitmap");". The name of the resource is calculated from the , if one can be found on the context stack. - The method will look on the for the following objects: + The method will look on the for the following objects: - - a collection of statements to add a resource manager to, if one needs to be declared. @@ -1688,7 +1688,7 @@ method will also write the resource value into the invariant culture's resource file if the current `ResourceCulture` is not the invariant culture. + If the `ensureInvariant` parameter is `true`, the method will also write the resource value into the invariant culture's resource file if the current `ResourceCulture` is not the invariant culture. ]]> @@ -1755,7 +1755,7 @@ method is a helper method that associates a with an object. Objects that have been associated with expressions in this way are accessible through the method. stores its expression table as an appended object on the context stack so it is accessible by any serializer's method. + The method is a helper method that associates a with an object. Objects that have been associated with expressions in this way are accessible through the method. stores its expression table as an appended object on the context stack so it is accessible by any serializer's method. ]]> @@ -1810,7 +1810,7 @@ method is a helper method that associates a with an object. Objects that have been associated with expressions in this way are accessible through the method. The stores its expression table as an appended object on the context stack so it is accessible by any serializer's method. + The method is a helper method that associates a with an object. Objects that have been associated with expressions in this way are accessible through the method. The stores its expression table as an appended object on the context stack so it is accessible by any serializer's method. ]]> diff --git a/xml/System.ComponentModel.Design.Serialization/CollectionCodeDomSerializer.xml b/xml/System.ComponentModel.Design.Serialization/CollectionCodeDomSerializer.xml index 6f636040732..d770c4e0873 100644 --- a/xml/System.ComponentModel.Design.Serialization/CollectionCodeDomSerializer.xml +++ b/xml/System.ComponentModel.Design.Serialization/CollectionCodeDomSerializer.xml @@ -44,11 +44,11 @@ Serializes collections. - class can create either statements or expressions. If the object to serialize is an array, the will create an expression and assign it to the statement in the current context stack. If the object is a collection with an *AddRange* or similar method, the will create a statement that calls the method. - + class can create either statements or expressions. If the object to serialize is an array, the will create an expression and assign it to the statement in the current context stack. If the object is a collection with an *AddRange* or similar method, the will create a statement that calls the method. + ]]> Dynamic Source Code Generation and Compilation @@ -125,11 +125,11 @@ if the supports serialization; otherwise, . - @@ -176,21 +176,21 @@ Serializes the given collection into a CodeDOM object. A CodeDOM object representing . - , the method will cast the collection to an and add through that interface. - - 1. If the collection has no *Add* method, but is marked with , will enumerate the collection and serialize each element. - + , the method will cast the collection to an and add through that interface. + + 1. If the collection has no *Add* method, but is marked with , will enumerate the collection and serialize each element. + ]]> @@ -250,11 +250,11 @@ Serializes the given collection. Serialized collection if the serialization process succeeded; otherwise, . - that refers to the collection can be `null`. - + that refers to the collection can be `null`. + ]]> diff --git a/xml/System.ComponentModel.Design.Serialization/ComponentSerializationService.xml b/xml/System.ComponentModel.Design.Serialization/ComponentSerializationService.xml index ebe9eb8297d..61ff558c3fb 100644 --- a/xml/System.ComponentModel.Design.Serialization/ComponentSerializationService.xml +++ b/xml/System.ComponentModel.Design.Serialization/ComponentSerializationService.xml @@ -159,7 +159,7 @@ or method. Once closed, a serialization store can be used for deserialization, or it can be saved into a stream. + Multiple objects can be serialized into the same serialization store. When you are finished with the store, you can call its or method. Once closed, a serialization store can be used for deserialization, or it can be saved into a stream. The serialization store can be passed to any of the various serializing methods to build up serialization state for a group of objects. @@ -362,7 +362,7 @@ method deserializes `store`, but instead of producing new objects, it applies the data in the store to an existing set of objects that are taken from the provided container. As a result, the caller can create in advance an object however it sees fit. If an object has a deserialization state and the object is not named in the set of existing objects, a new object will be created. If that object also implements , it will be added to `container`. Objects in the container must have names and types that match objects in the serialization store in order for an existing object to be used. + The method deserializes `store`, but instead of producing new objects, it applies the data in the store to an existing set of objects that are taken from the provided container. As a result, the caller can create in advance an object however it sees fit. If an object has a deserialization state and the object is not named in the set of existing objects, a new object will be created. If that object also implements , it will be added to `container`. Objects in the container must have names and types that match objects in the serialization store in order for an existing object to be used. ]]> @@ -430,7 +430,7 @@ method deserializes `store`, but instead of producing new objects, it applies the data in the store to an existing set of objects that are taken from the provided container. As a result, the caller can create in advance an object however it sees fit. If an object has a deserialization state and the object is not named in the set of existing objects, a new object will be created. If that object also implements , it will be added to `container`. Objects in the container must have names and types that match objects in the serialization store in order for an existing object to be used. + The method deserializes `store`, but instead of producing new objects, it applies the data in the store to an existing set of objects that are taken from the provided container. As a result, the caller can create in advance an object however it sees fit. If an object has a deserialization state and the object is not named in the set of existing objects, a new object will be created. If that object also implements , it will be added to `container`. Objects in the container must have names and types that match objects in the serialization store in order for an existing object to be used. ]]> @@ -495,7 +495,7 @@ method deserializes `store`, but instead of producing new objects, it applies the data in the store to an existing set of objects that are taken from the provided container. As a result, the caller can create in advance an object however it sees fit. If an object has a deserialization state and the object is not named in the set of existing objects, a new object will be created. If that object also implements , it will be added to `container`. Objects in the container must have names and types that match objects in the serialization store in order for an existing object to be used. + The method deserializes `store`, but instead of producing new objects, it applies the data in the store to an existing set of objects that are taken from the provided container. As a result, the caller can create in advance an object however it sees fit. If an object has a deserialization state and the object is not named in the set of existing objects, a new object will be created. If that object also implements , it will be added to `container`. Objects in the container must have names and types that match objects in the serialization store in order for an existing object to be used. ]]> @@ -553,7 +553,7 @@ methods. + You can use the returned store to deserialize objects by passing it to one of the methods. ]]> @@ -673,9 +673,9 @@ method, only serializes values that differ from the component's default state. This provides the most compact serialization mechanism but assumes that a newly created object will be used during deserialization. If an existing object is used, the resulting deserialized object is not guaranteed to duplicate the original state of the serialized object; the properties that contained default values during serialization will not be reset back to their defaults during deserialization. + Standard serialization, as implemented through the method, only serializes values that differ from the component's default state. This provides the most compact serialization mechanism but assumes that a newly created object will be used during deserialization. If an existing object is used, the resulting deserialized object is not guaranteed to duplicate the original state of the serialized object; the properties that contained default values during serialization will not be reset back to their defaults during deserialization. - The method does not use this shortcut. It serializes all properties of the source object so that deserialization can restore all the object's properties, regardless of default state. + The method does not use this shortcut. It serializes all properties of the source object so that deserialization can restore all the object's properties, regardless of default state. This method is particularly useful for serializing collections, because the order of the constituent items within the collection can change. In this circumstance, the safest process to restore the original state of the entire collection is to overwrite all the items with all their original property values. @@ -741,7 +741,7 @@ method can be invoked multiple times for the same object to build up a list of serialized members within the serialization store. In general, the member should be a property or an event. + The method can be invoked multiple times for the same object to build up a list of serialized members within the serialization store. In general, the member should be a property or an event. ]]> @@ -804,9 +804,9 @@ method serializes the `member` on `owningObject`, even if `member` contains the default property value. + The method serializes the `member` on `owningObject`, even if `member` contains the default property value. - Note that for some members, containing the default value and restoring the setting of the same value to the member are different concepts. For example, if a property inherits its value from a parent object when no local value is set, setting the value back to the property may not be what is desired. The method takes this into account and would clear the state of the property in this case. + Note that for some members, containing the default value and restoring the setting of the same value to the member are different concepts. For example, if a property inherits its value from a parent object when no local value is set, setting the value back to the property may not be what is desired. The method takes this into account and would clear the state of the property in this case. ]]> diff --git a/xml/System.ComponentModel.Design.Serialization/DesignerLoader.xml b/xml/System.ComponentModel.Design.Serialization/DesignerLoader.xml index 02848c08a71..def8a3225f4 100644 --- a/xml/System.ComponentModel.Design.Serialization/DesignerLoader.xml +++ b/xml/System.ComponentModel.Design.Serialization/DesignerLoader.xml @@ -52,15 +52,15 @@ Provides a basic designer loader interface that can be used to implement a custom designer loader. - can be implemented to support custom loading of a designer and designer components. A designer loader is also responsible for writing changes to an open document back to the storage the loader used when loading the document after the method is called. - - By default, the Visual Studio development environment creates its own variety of that can load basic designer projects. To create a custom designer loader, you must inherit from and implement the abstract class. You cannot directly instantiate , as it has no public constructor. - - When is invoked, the designer loader loads the design document, displays the designer surface using the interface, and calls on the interface when done. The implementation is usually the same class that implements . - + can be implemented to support custom loading of a designer and designer components. A designer loader is also responsible for writing changes to an open document back to the storage the loader used when loading the document after the method is called. + + By default, the Visual Studio development environment creates its own variety of that can load basic designer projects. To create a custom designer loader, you must inherit from and implement the abstract class. You cannot directly instantiate , as it has no public constructor. + + When is invoked, the designer loader loads the design document, displays the designer surface using the interface, and calls on the interface when done. The implementation is usually the same class that implements . + ]]> @@ -152,11 +152,11 @@ The loader host through which this loader loads components. Begins loading a designer. - that is passed to the `host` parameter is typically the same object as the designer host. Through this reference to the loader host, the designer loader can reload the design document and indicate that it has finished loading the design document. - + that is passed to the `host` parameter is typically the same object as the designer host. Through this reference to the loader host, the designer loader can reload the design document and indicate that it has finished loading the design document. + ]]> @@ -201,14 +201,14 @@ Releases all resources used by the . - when you are finished using the . The method leaves the in an unusable state. After calling , you must release all references to the so the garbage collector can reclaim the memory that the was occupying. For more information, see [Cleaning Up Unmanaged Resources](/dotnet/standard/garbage-collection/unmanaged) and [Implementing a Dispose Method](/dotnet/standard/garbage-collection/implementing-dispose). - + when you are finished using the . The method leaves the in an unusable state. After calling , you must release all references to the so the garbage collector can reclaim the memory that the was occupying. For more information, see [Cleaning Up Unmanaged Resources](/dotnet/standard/garbage-collection/unmanaged) and [Implementing a Dispose Method](/dotnet/standard/garbage-collection/implementing-dispose). + > [!NOTE] -> Always call before you release your last reference to the . Otherwise, the resources it is using will not be freed until the garbage collector calls the object's `Finalize` method. - +> Always call before you release your last reference to the . Otherwise, the resources it is using will not be freed until the garbage collector calls the object's `Finalize` method. + ]]> @@ -253,11 +253,11 @@ Writes cached changes to the location that the designer was loaded from. - diff --git a/xml/System.ComponentModel.Design.Serialization/DesignerSerializationManager.xml b/xml/System.ComponentModel.Design.Serialization/DesignerSerializationManager.xml index 8776c4cf87b..30329e4ce0e 100644 --- a/xml/System.ComponentModel.Design.Serialization/DesignerSerializationManager.xml +++ b/xml/System.ComponentModel.Design.Serialization/DesignerSerializationManager.xml @@ -112,7 +112,7 @@ | event|The event is attached by a serializer to provide additional resolution of names. All handlers are detached from this event when a session terminates.| | event|The event is raised just before a session is disposed. Then, all handlers are detached from this event.| |Name table|The serialization manager maintains a table that maps between objects and their names. Serializers may give objects names for easy identification. This name table is cleared when the session terminates.| -|Serializer cache|The serialization manager maintains a cache of serializers it has been asked to supply. This cache is cleared when the session terminates. The public method can safely be called at any time, but its value is cached only if it is called from within a session.| +|Serializer cache|The serialization manager maintains a cache of serializers it has been asked to supply. This cache is cleared when the session terminates. The public method can safely be called at any time, but its value is cached only if it is called from within a session.| |Context stack|The serialization manager maintains an object called the context stack, which you can access with the property. Serializers can use this stack to store additional information that is available to other serializers. For example, a serializer that is serializing a property value can push the property name on the serialization stack before asking the value to serialize. This stack is cleared when the session is terminated.| |Error list|The serialization manager maintains a list of errors that occurred during serialization. This list, which is accessed through the property, is cleared when the session is terminated. Accessing the property between sessions will result in an exception.| @@ -163,7 +163,7 @@ and properties to `true`. + This constructor sets the and properties to `true`. ]]> @@ -208,7 +208,7 @@ ## Remarks If a serializer requests services that cannot be satisfied by the serialization manager, the default implementation will forward those requests to the `provider` parameter. - This constructor sets the and properties to `true`. + This constructor sets the and properties to `true`. ]]> @@ -327,7 +327,7 @@ and properties. The method uses reflection to create instances and will perform some generic transformations on parameters to find a matching constructor. + This method is called by serializers when they attempt to create an instance of a type. The default implementation creates a new instance of the type, or it may return an existing instance depending on the values of the and properties. The method uses reflection to create instances and will perform some generic transformations on parameters to find a matching constructor. ]]> @@ -558,7 +558,7 @@ method provides access to the underlying container or service provider that was set in the constructor. + The method provides access to the underlying container or service provider that was set in the constructor. ]]> @@ -603,7 +603,7 @@ method will search the service provider for an and, if available, it will delegate to that service to resolve the type. If an is not available, will call the method. + The method will search the service provider for an and, if available, it will delegate to that service to resolve the type. If an is not available, will call the method. ]]> @@ -648,7 +648,7 @@ ## Remarks Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). - The method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + The method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. ]]> @@ -699,7 +699,7 @@ ## Remarks Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). - The method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + The method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. ]]> @@ -749,7 +749,7 @@ ## Remarks Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). - The method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + The method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. ]]> @@ -801,7 +801,7 @@ property determines the behavior of the method. If `true`, will pass the given component name. If `false`, will check for the presence of the given name in the container. If the name does not exist in the container, will use the given name. If the name does exist in the container, will pass a null value as the name of a component when adding it to the container, thereby giving it a new name. This second variation is useful for implementing a serializer that always duplicates objects, rather than assuming those objects do not exist. Paste commands often use this type of serializer. + The property determines the behavior of the method. If `true`, will pass the given component name. If `false`, will check for the presence of the given name in the container. If the name does not exist in the container, will use the given name. If the name does exist in the container, will pass a null value as the name of a component when adding it to the container, thereby giving it a new name. This second variation is useful for implementing a serializer that always duplicates objects, rather than assuming those objects do not exist. Paste commands often use this type of serializer. You can only change this property when you are not in a serialization session. @@ -906,9 +906,9 @@ property is `false`, the method will always create a new instance of a type. If is `true`, will first search the name table and container for an object of the same name. If such an object exists and is of the same type, will return the existing instance. This second variation is useful for implementing a serializer that applies serialization state to an existing set of objects, rather than always creating a new tree. The **Undo** command often uses this type of serializer. + If the property is `false`, the method will always create a new instance of a type. If is `true`, will first search the name table and container for an object of the same name. If such an object exists and is of the same type, will return the existing instance. This second variation is useful for implementing a serializer that applies serialization state to an existing set of objects, rather than always creating a new tree. The **Undo** command often uses this type of serializer. - In the case where the property is `true`, the property will further modify the behavior of depending on the types of the two objects. + In the case where the property is `true`, the property will further modify the behavior of depending on the types of the two objects. ]]> @@ -1035,7 +1035,7 @@ method is used to request a serialization provider, the serialization manager queries the custom serialization providers first before looking in the type's metadata for the appropriate serializer. + When the method is used to request a serialization provider, the serialization manager queries the custom serialization providers first before looking in the type's metadata for the appropriate serializer. ]]> @@ -1239,7 +1239,7 @@ method cannot find a corresponding name for the `value` parameter, it raises the event before it returns `null`. + If the method cannot find a corresponding name for the `value` parameter, it raises the event before it returns `null`. ]]> @@ -1434,7 +1434,7 @@ This member is an explicit interface member implementation. It can be used only method removes a custom serialization provider that was previously added by a call to the method. + The method removes a custom serialization provider that was previously added by a call to the method. ]]> @@ -1482,9 +1482,9 @@ This member is an explicit interface member implementation. It can be used only method with the error information. The serialization manager may support reporting a list of errors after it completes, or it may throw an exception from this method and abort the serialization process. The serializer should continue after calling this function. + Serializers can be written to handle recoverable errors gracefully by calling the method with the error information. The serialization manager may support reporting a list of errors after it completes, or it may throw an exception from this method and abort the serialization process. The serializer should continue after calling this function. - adds the `errorInformation` parameter to the collection. If `errorInformation` is `null`, no action is taken. + adds the `errorInformation` parameter to the collection. If `errorInformation` is `null`, no action is taken. ]]> @@ -1528,7 +1528,7 @@ This member is an explicit interface member implementation. It can be used only method is called, but it fails to find the specified name in the serialization manager's name table. +The `ResolveName` event is raised when the method is called, but it fails to find the specified name in the serialization manager's name table. This event provides a way for a serializer to demand-create an object so the serializer does not have to order object creation by dependency. This delegate is cleared immediately after serialization or deserialization is complete. @@ -1628,7 +1628,7 @@ In a related use, this event can be used to remove a temporary service installed method provides a way to set the name of an existing object. This enables creation of an instance of the object through a call to the method, avoiding the overhead of the method. + The method provides a way to set the name of an existing object. This enables creation of an instance of the object through a call to the method, avoiding the overhead of the method. ]]> @@ -1739,7 +1739,7 @@ In a related use, this event can be used to remove a temporary service installed property modifies the behavior of the method when the property is `true`, as detailed in the following table. + The property modifies the behavior of the method when the property is `true`, as detailed in the following table. |`RecycleInstances`|`ValidateRecycledTypes`|Behavior of `CreateInstance`| |------------------------|-----------------------------|----------------------------------| @@ -1747,7 +1747,7 @@ In a related use, this event can be used to remove a temporary service installed |`true`|`false`|If a matching instance is found it is returned, regardless of its type.| |`true`|`true`|If a matching instance is found, it is returned only if its type is the same as specified in the method call.| - is useful for morphing one type of object to another if they have similar properties but share no common parent or interface. + is useful for morphing one type of object to another if they have similar properties but share no common parent or interface. ]]> diff --git a/xml/System.ComponentModel.Design.Serialization/ExpressionContext.xml b/xml/System.ComponentModel.Design.Serialization/ExpressionContext.xml index 5995ec217ec..414731ca893 100644 --- a/xml/System.ComponentModel.Design.Serialization/ExpressionContext.xml +++ b/xml/System.ComponentModel.Design.Serialization/ExpressionContext.xml @@ -303,7 +303,7 @@ button1.Text = rm.GetString("button1_Text"); property of an instance of called `button1`, returns `button1`. + If the expression is a property reference to the property of an instance of called `button1`, returns `button1`. ]]> @@ -356,7 +356,7 @@ button1.Text = rm.GetString("button1_Text"); property of a , the property contains the instance of the property. This is because the property is read-only and preset by the object to contain a value. On the other hand, a property such as or does not have a preset value and therefore the property returns `null`. + Contains the preset value of an expression, should one exist. For example, if the expression is a property reference expression referring to the property of a , the property contains the instance of the property. This is because the property is read-only and preset by the object to contain a value. On the other hand, a property such as or does not have a preset value and therefore the property returns `null`. The following C# code shows how serializers can use this information to guide serialization. @@ -368,7 +368,7 @@ button1.Padding = p; button1.Padding.Left = 5; ``` - The serializer of the structure needs to be informed if it should generate the first or second form. The first form is generated by default. The second form is only generated if there is an on the context stack that contains a equal to the value of the currently being serialized. + The serializer of the structure needs to be informed if it should generate the first or second form. The first form is generated by default. The second form is only generated if there is an on the context stack that contains a equal to the value of the currently being serialized. ]]> diff --git a/xml/System.ComponentModel.Design.Serialization/ICodeDomDesignerReload.xml b/xml/System.ComponentModel.Design.Serialization/ICodeDomDesignerReload.xml index 0f3345ea31e..7e63fc64091 100644 --- a/xml/System.ComponentModel.Design.Serialization/ICodeDomDesignerReload.xml +++ b/xml/System.ComponentModel.Design.Serialization/ICodeDomDesignerReload.xml @@ -36,13 +36,13 @@ Provides an interface that can be used to optimize the reloading of a designer. - can implement this interface to support optimized reloading by the designer. When a designer reparses a file for display, it can use this interface to improve performance. - - To support this performance optimization method, the designer can pass a that represents the document code to the method. returns a value that indicates whether the code has changed and typically, whether your code should reload the designer. Otherwise, it is unnecessary to spend time reloading the designer. - + can implement this interface to support optimized reloading by the designer. When a designer reparses a file for display, it can use this interface to improve performance. + + To support this performance optimization method, the designer can pass a that represents the document code to the method. returns a value that indicates whether the code has changed and typically, whether your code should reload the designer. Otherwise, it is unnecessary to spend time reloading the designer. + ]]> diff --git a/xml/System.ComponentModel.Design.Serialization/IDesignerLoaderHost.xml b/xml/System.ComponentModel.Design.Serialization/IDesignerLoaderHost.xml index 77e27c2b665..a5b997b2bea 100644 --- a/xml/System.ComponentModel.Design.Serialization/IDesignerLoaderHost.xml +++ b/xml/System.ComponentModel.Design.Serialization/IDesignerLoaderHost.xml @@ -57,15 +57,15 @@ Provides an interface that can extend a designer host to support loading from a serialized state. - can implement this interface to enable support for loading by a . - - The designer loader informs the designer host that it needs to invoke a load or reload so that the designer host can perform additional tasks at these times. - - This class is isolated from to emphasize that the designer loader, not the designer host, must initiate all loading and reloading of the design document. - + can implement this interface to enable support for loading by a . + + The designer loader informs the designer host that it needs to invoke a load or reload so that the designer host can perform additional tasks at these times. + + This class is isolated from to emphasize that the designer loader, not the designer host, must initiate all loading and reloading of the design document. + ]]> @@ -130,13 +130,13 @@ A collection containing the errors encountered during load, if any. If no errors were encountered, pass either an empty collection or . Ends the designer loading operation. - that loads the design document calls this method to indicate that the load terminated. - - If errors are encountered during loading, they must be passed in the `errorCollection` parameter as a collection of exceptions. If they are not exceptions, the designer loader host can call on them and pass them as a collection. If the load is successful, then the `errorCollection` parameter must be either `null` or an empty collection. - + that loads the design document calls this method to indicate that the load terminated. + + If errors are encountered during loading, they must be passed in the `errorCollection` parameter as a collection of exceptions. If they are not exceptions, the designer loader host can call on them and pass them as a collection. If the load is successful, then the `errorCollection` parameter must be either `null` or an empty collection. + ]]> @@ -182,11 +182,11 @@ Reloads the design document. - calls this method to reload the design document. - + calls this method to reload the design document. + ]]> diff --git a/xml/System.ComponentModel.Design.Serialization/IDesignerLoaderHost2.xml b/xml/System.ComponentModel.Design.Serialization/IDesignerLoaderHost2.xml index 665c9c4b38f..e4b248f015f 100644 --- a/xml/System.ComponentModel.Design.Serialization/IDesignerLoaderHost2.xml +++ b/xml/System.ComponentModel.Design.Serialization/IDesignerLoaderHost2.xml @@ -169,7 +169,7 @@ property can only be set to `true` if is `true`. If is `false`, the value of is ignored. + The property can only be set to `true` if is `true`. If is `false`, the value of is ignored. ]]> diff --git a/xml/System.ComponentModel.Design.Serialization/IDesignerLoaderService.xml b/xml/System.ComponentModel.Design.Serialization/IDesignerLoaderService.xml index 7152065513d..605ed09c7a5 100644 --- a/xml/System.ComponentModel.Design.Serialization/IDesignerLoaderService.xml +++ b/xml/System.ComponentModel.Design.Serialization/IDesignerLoaderService.xml @@ -44,13 +44,13 @@ Provides an interface that can extend a designer loader to support asynchronous loading of external components. - can implement this interface to manage designer loading that involves external components. This interface also allows external components to initiate a reload of the design surface by calling . A designer loader does not have to implement this interface if it does not require support for asynchronous loading. - - Designer loading using a custom implementation of the can occur in a variety of ways. Sometimes external components are involved in the loading process. To facilitate loading with external dependencies, the designer loader service interface provides a mechanism that determines when loading is complete and allows each portion of loading to signal that it has completed. The typically determines when loading is complete by testing a counter that tracks the number of load dependencies remaining. When each portion of the load completes, is called, and the service decrements the counter. To set the number of dependent load processes, call once for each load process that calls when its loading is complete. When the final loading is complete, the service calls on the loader host. - + can implement this interface to manage designer loading that involves external components. This interface also allows external components to initiate a reload of the design surface by calling . A designer loader does not have to implement this interface if it does not require support for asynchronous loading. + + Designer loading using a custom implementation of the can occur in a variety of ways. Sometimes external components are involved in the loading process. To facilitate loading with external dependencies, the designer loader service interface provides a mechanism that determines when loading is complete and allows each portion of loading to signal that it has completed. The typically determines when loading is complete by testing a counter that tracks the number of load dependencies remaining. When each portion of the load completes, is called, and the service decrements the counter. To set the number of dependent load processes, call once for each load process that calls when its loading is complete. When the final loading is complete, the service calls on the loader host. + ]]> @@ -95,11 +95,11 @@ Registers an external component as part of the load process managed by this interface. - once for each external object participating in the load process. is called when the work of the load process is done. - + once for each external object participating in the load process. is called when the work of the load process is done. + ]]> @@ -151,13 +151,13 @@ A collection of errors that occurred during the load, if any. If no errors occurred, pass either an empty collection or . Signals that a dependent load has finished. - once for every process that was registered by calling , which has already completed. - - If the dependent load succeeds, the caller sets the `successful` parameter to `true` and passes either an empty collection or `null` to the `errorCollection` parameter. If the dependent load encounters errors, the caller sets the `successful` parameter to `false` and passes a collection of exceptions that indicate the reason or reasons for failure to the `errorCollection` parameter. - + once for every process that was registered by calling , which has already completed. + + If the dependent load succeeds, the caller sets the `successful` parameter to `true` and passes either an empty collection or `null` to the `errorCollection` parameter. If the dependent load encounters errors, the caller sets the `successful` parameter to `false` and passes a collection of exceptions that indicate the reason or reasons for failure to the `errorCollection` parameter. + ]]> @@ -204,13 +204,13 @@ if the reload request is accepted, or if the loader does not allow the reload. - diff --git a/xml/System.ComponentModel.Design.Serialization/IDesignerSerializationManager.xml b/xml/System.ComponentModel.Design.Serialization/IDesignerSerializationManager.xml index 6205f9c74b2..1b757d62b5c 100644 --- a/xml/System.ComponentModel.Design.Serialization/IDesignerSerializationManager.xml +++ b/xml/System.ComponentModel.Design.Serialization/IDesignerSerializationManager.xml @@ -48,20 +48,20 @@ Provides an interface that can manage design-time serialization. - to access services useful to managing design-time serialization processes. For example, a class that implements the designer serialization manager can use this interface to create objects, look up types, identify objects, and customize the serialization of particular types. - - - -## Examples - The following example illustrates how to use to serialize and deserialize Code DOM statements. - + to access services useful to managing design-time serialization processes. For example, a class that implements the designer serialization manager can use this interface to create objects, look up types, identify objects, and customize the serialization of particular types. + + + +## Examples + The following example illustrates how to use to serialize and deserialize Code DOM statements. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/IDesignerSerializationManagerSample/CPP/idesignerserializationmanagersample.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel.Design.Serialization/CodeDomSerializer/Overview/idesignerserializationmanagersample.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel.Design.Serialization/CodeDomSerializer/Overview/idesignerserializationmanagersample.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel.Design.Serialization/CodeDomSerializer/Overview/idesignerserializationmanagersample.vb" id="Snippet1"::: + ]]> @@ -110,11 +110,11 @@ The serialization provider to add. Adds the specified serialization provider to the serialization manager. - @@ -159,11 +159,11 @@ Gets a stack-based, user-defined storage area that is useful for communication between serializers. A that stores data. - . - + . + ]]> @@ -233,11 +233,11 @@ Creates an instance of the specified type and adds it to a collection of named instances. The newly created object instance. - are added to the design-time container if the `addToContainer` parameter is `true`. - + are added to the design-time container if the `addToContainer` parameter is `true`. + ]]> @@ -293,11 +293,11 @@ Gets an instance of a created object of the specified name, or if that object does not exist. An instance of the object with the given name, or if no object by that name can be found. - . - + . + ]]> @@ -504,11 +504,11 @@ Indicates custom properties that can be serializable with available serializers. A containing the properties to be serialized. - defines the set of properties that are exposed here. - + defines the set of properties that are exposed here. + ]]> @@ -604,14 +604,14 @@ The error to report. This information object can be of any object type. If it is an exception, the message of the exception is extracted and reported to the user. If it is any other type, is called to display the information to the user. Reports an error in serialization. - , it can store the error information object for a future report where all the errors encountered can be displayed at once. If this method stores multiple errors, serialization can continue after a call to this method. If this method does not support logging multiple errors, this method should throw an exception, which aborts serialization. - + , it can store the error information object for a future report where all the errors encountered can be displayed at once. If this method stores multiple errors, serialization can continue after a call to this method. If this method does not support logging multiple errors, this method should throw an exception, which aborts serialization. + > [!NOTE] -> The serialization manager should never throw an exception for errors encountered during serialization. It should only throw an exception during deserialization. Otherwise, users become confused because saving the document should never fail. - +> The serialization manager should never throw an exception for errors encountered during serialization. It should only throw an exception during deserialization. Otherwise, users become confused because saving the document should never fail. + ]]> @@ -655,11 +655,11 @@ Occurs when cannot locate the specified name in the serialization manager's name table. - @@ -703,15 +703,15 @@ Occurs when serialization is complete. - event, and clear the data after serialization. Restoring the proper state after serialization can be important because serializers can be reused during serialization, and leftover state data or open streams might not be correct. - - For example, if a serializer needs to write to another file, such as a resource file, it is inefficient to design the serializer to close the file when finished. Serializing an object graph usually requires several serializers. The resource file would be opened and closed many times. Instead, the resource file can be closed at the end of serialization by an object that listened to the event. - + event, and clear the data after serialization. Restoring the proper state after serialization can be important because serializers can be reused during serialization, and leftover state data or open streams might not be correct. + + For example, if a serializer needs to write to another file, such as a resource file, it is inefficient to design the serializer to close the file when finished. Serializing an object graph usually requires several serializers. The resource file would be opened and closed many times. Instead, the resource file can be closed at the end of serialization by an object that listened to the event. + ]]> @@ -761,11 +761,11 @@ The name to give the instance. Sets the name of the specified existing object. - . An exception is thrown if you try to rename an existing object or if you try to give a new object a name that is already taken. - + . An exception is thrown if you try to rename an existing object or if you try to give a new object a name that is already taken. + ]]> diff --git a/xml/System.ComponentModel.Design.Serialization/IDesignerSerializationProvider.xml b/xml/System.ComponentModel.Design.Serialization/IDesignerSerializationProvider.xml index 81cb8dda62b..ba203ce6615 100644 --- a/xml/System.ComponentModel.Design.Serialization/IDesignerSerializationProvider.xml +++ b/xml/System.ComponentModel.Design.Serialization/IDesignerSerializationProvider.xml @@ -44,11 +44,11 @@ Provides an interface that enables access to a serializer. - , and no properties or events. This interface and this method exist so that the serialization manager and other objects can obtain a serializer for a given object type. - + , and no properties or events. This interface and this method exist so that the serialization manager and other objects can obtain a serializer for a given object type. + ]]> @@ -119,11 +119,11 @@ Gets a serializer using the specified attributes. An instance of a serializer of the type requested, or if the request cannot be satisfied. - diff --git a/xml/System.ComponentModel.Design.Serialization/INameCreationService.xml b/xml/System.ComponentModel.Design.Serialization/INameCreationService.xml index 102a282cc85..c2c2d5034db 100644 --- a/xml/System.ComponentModel.Design.Serialization/INameCreationService.xml +++ b/xml/System.ComponentModel.Design.Serialization/INameCreationService.xml @@ -44,20 +44,20 @@ Provides a service that can generate unique names for objects. - can implement this service to provide a way for a designer to create new, unique names for objects. If this service is not available, the designer uses a default implementation. - - - -## Examples - The following example code provides an example implementation. The service can create a unique name based on a type that does not match any names in the specified container. It can also validate a specified name string. - + can implement this service to provide a way for a designer to create new, unique names for objects. If this service is not available, the designer uses a default implementation. + + + +## Examples + The following example code provides an example implementation. The service can create a unique name based on a type that does not match any names in the specified container. It can also validate a specified name string. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/INameCreationServiceExample/CPP/class1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel.Design.Serialization/INameCreationService/Overview/class1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel.Design.Serialization/INameCreationService/Overview/class1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel.Design.Serialization/INameCreationService/Overview/class1.vb" id="Snippet1"::: + ]]> @@ -116,20 +116,20 @@ Creates a new name that is unique to all components in the specified container. A unique name for the data type. - method implementation. The method can create a name based on the name of a specified type that is unique to the names of the components within the specified container. - + method implementation. The method can create a name based on the name of a specified type that is unique to the names of the components within the specified container. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/INameCreationServiceExample/CPP/class1.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel.Design.Serialization/INameCreationService/Overview/class1.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel.Design.Serialization/INameCreationService/Overview/class1.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel.Design.Serialization/INameCreationService/Overview/class1.vb" id="Snippet2"::: + ]]> @@ -182,20 +182,20 @@ if the name is valid; otherwise, . - can have rules that define the parameters for valid names. This method can be implemented to validate a name and enforce those rules. - - - -## Examples - The following code example provides an example method implementation. The method uses a string validation scheme that examines each character of the specified string to determine whether the specified string is a valid name. The method returns `true` if the string is valid, or `false` otherwise. - + can have rules that define the parameters for valid names. This method can be implemented to validate a name and enforce those rules. + + + +## Examples + The following code example provides an example method implementation. The method uses a string validation scheme that examines each character of the specified string to determine whether the specified string is a valid name. The method returns `true` if the string is valid, or `false` otherwise. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/INameCreationServiceExample/CPP/class1.cpp" id="Snippet3"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel.Design.Serialization/INameCreationService/Overview/class1.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel.Design.Serialization/INameCreationService/Overview/class1.vb" id="Snippet3"::: - + :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel.Design.Serialization/INameCreationService/Overview/class1.vb" id="Snippet3"::: + ]]> @@ -243,22 +243,22 @@ The name to validate. Gets a value indicating whether the specified name is valid. - can have rules that define the parameters for valid names. This method can be implemented to validate a name and enforce those rules. - - This method is similar to , except that this method throws an exception if the name is invalid. This allows implementers to provide detailed information in the exception message. - - - -## Examples - The following code example provides an example method implementation that uses a string validation scheme that examines each character of the specified string to determine whether the specified string is a valid name. The method throws an exception if the string is not valid. - + can have rules that define the parameters for valid names. This method can be implemented to validate a name and enforce those rules. + + This method is similar to , except that this method throws an exception if the name is invalid. This allows implementers to provide detailed information in the exception message. + + + +## Examples + The following code example provides an example method implementation that uses a string validation scheme that examines each character of the specified string to determine whether the specified string is a valid name. The method throws an exception if the string is not valid. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/INameCreationServiceExample/CPP/class1.cpp" id="Snippet4"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel.Design.Serialization/INameCreationService/Overview/class1.cs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel.Design.Serialization/INameCreationService/Overview/class1.vb" id="Snippet4"::: - + :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel.Design.Serialization/INameCreationService/Overview/class1.vb" id="Snippet4"::: + ]]> diff --git a/xml/System.ComponentModel.Design.Serialization/InstanceDescriptor.xml b/xml/System.ComponentModel.Design.Serialization/InstanceDescriptor.xml index 48716cf63b0..3f7a285a7cd 100644 --- a/xml/System.ComponentModel.Design.Serialization/InstanceDescriptor.xml +++ b/xml/System.ComponentModel.Design.Serialization/InstanceDescriptor.xml @@ -67,7 +67,7 @@ - A Boolean property that indicates whether the object is completely represented by the current information. -- An method that can be used to create an instance of the represented object. +- An method that can be used to create an instance of the represented object. @@ -373,7 +373,7 @@ completely describes a particular instance. However, some objects are too complex for a single method or constructor to represent. indicates whether an is incomplete, so a user can identify these objects and perform additional processing, if necessary, to further describe their state. + Typically, an completely describes a particular instance. However, some objects are too complex for a single method or constructor to represent. indicates whether an is incomplete, so a user can identify these objects and perform additional processing, if necessary, to further describe their state. ]]> diff --git a/xml/System.ComponentModel.Design.Serialization/MemberRelationship.xml b/xml/System.ComponentModel.Design.Serialization/MemberRelationship.xml index 5501b71f2c4..09994879032 100644 --- a/xml/System.ComponentModel.Design.Serialization/MemberRelationship.xml +++ b/xml/System.ComponentModel.Design.Serialization/MemberRelationship.xml @@ -439,7 +439,7 @@ Tests whether two specified structures are equivalent. This operator returns if the two structures are equal; otherwise, . - .]]> + .]]> @@ -490,7 +490,7 @@ Tests whether two specified structures are different. This operator returns if the two structures are different; otherwise, . - .]]> + .]]> diff --git a/xml/System.ComponentModel.Design.Serialization/MemberRelationshipService.xml b/xml/System.ComponentModel.Design.Serialization/MemberRelationshipService.xml index 2eb336c206a..36027a29644 100644 --- a/xml/System.ComponentModel.Design.Serialization/MemberRelationshipService.xml +++ b/xml/System.ComponentModel.Design.Serialization/MemberRelationshipService.xml @@ -345,7 +345,7 @@ ms[titleLabel, titleLabelText] = new MemberRelationship(form, formText); method clears any existing relationship if the relationship parameter is . The default implementation stores relationships in a dictionary using weak references so the relationship table does not keep objects alive. + The method clears any existing relationship if the relationship parameter is . The default implementation stores relationships in a dictionary using weak references so the relationship table does not keep objects alive. ]]> diff --git a/xml/System.ComponentModel.Design.Serialization/ObjectStatementCollection.xml b/xml/System.ComponentModel.Design.Serialization/ObjectStatementCollection.xml index 044cd9f2933..fe46c4e853b 100644 --- a/xml/System.ComponentModel.Design.Serialization/ObjectStatementCollection.xml +++ b/xml/System.ComponentModel.Design.Serialization/ObjectStatementCollection.xml @@ -222,7 +222,7 @@ method if you want statement tables to be used to store values for certain objects. + If you are the creator of the statement context, you should call the method if you want statement tables to be used to store values for certain objects. ]]> @@ -269,7 +269,7 @@ method if you want statement tables to be used to store values for certain objects. + If you are the creator of the statement context, you should call the method if you want statement tables to be used to store values for certain objects. ]]> diff --git a/xml/System.ComponentModel.Design.Serialization/RootDesignerSerializerAttribute.xml b/xml/System.ComponentModel.Design.Serialization/RootDesignerSerializerAttribute.xml index 40aaf1ed097..01817aa1fa4 100644 --- a/xml/System.ComponentModel.Design.Serialization/RootDesignerSerializerAttribute.xml +++ b/xml/System.ComponentModel.Design.Serialization/RootDesignerSerializerAttribute.xml @@ -72,28 +72,28 @@ Indicates the base serializer to use for a root designer object. This class cannot be inherited. - indicates the serializer to use when the serialization manager serializes the design document, and whether the specified serializer supports automatic reloading of the design document without first completely disposing of the document. - - This attribute contains the following significant members: - -- indicates what serialization object to use to serialize the class at design time. - -- indicates the fully qualified name of the serialization object's base type. - -- indicates whether the serializer supports reloading a design document without user interaction to open a new designer view. - - - -## Examples - The following example code applies a to a component. - + indicates the serializer to use when the serialization manager serializes the design document, and whether the specified serializer supports automatic reloading of the design document without first completely disposing of the document. + + This attribute contains the following significant members: + +- indicates what serialization object to use to serialize the class at design time. + +- indicates the fully qualified name of the serialization object's base type. + +- indicates whether the serializer supports reloading a design document without user interaction to open a new designer view. + + + +## Examples + The following example code applies a to a component. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/IDesignerSerializationManagerSample/CPP/idesignerserializationmanagersample.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel.Design.Serialization/CodeDomSerializer/Overview/idesignerserializationmanagersample.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel.Design.Serialization/CodeDomSerializer/Overview/idesignerserializationmanagersample.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel.Design.Serialization/CodeDomSerializer/Overview/idesignerserializationmanagersample.vb" id="Snippet2"::: + ]]> @@ -161,11 +161,11 @@ if this serializer supports dynamic reloading of the document; otherwise, . Initializes a new instance of the class using the specified attributes. - @@ -215,11 +215,11 @@ if this serializer supports dynamic reloading of the document; otherwise, . Initializes a new instance of the class using the specified attributes. - @@ -269,11 +269,11 @@ if this serializer supports dynamic reloading of the document; otherwise, . Initializes a new instance of the class using the specified attributes. - @@ -325,13 +325,13 @@ if the root serializer supports reloading; otherwise, . - will be set to `false`, and the designer host must be recreated by user interaction (launching the designer for the document) after the design document is disposed. The events and services that were connected to the designer host, except through deserialization, do not remain and may need to be set again. If is `true`, the design document can be reloaded after changes outside the designer are made to the code, without closing the designer window and reopening it. - + will be set to `false`, and the designer host must be recreated by user interaction (launching the designer for the document) after the design document is disposed. The events and services that were connected to the designer host, except through deserialization, do not remain and may need to be set again. If is `true`, the design document can be reloaded after changes outside the designer are made to the code, without closing the designer window and reopening it. + ]]> @@ -480,11 +480,11 @@ Gets a unique ID for this attribute type. An object containing a unique ID for this attribute type. - instance for the attribute. overrides this to include the type of the editor base type. - + instance for the attribute. overrides this to include the type of the editor base type. + ]]> diff --git a/xml/System.ComponentModel.Design.Serialization/SerializationStore.xml b/xml/System.ComponentModel.Design.Serialization/SerializationStore.xml index 2d7a49045fe..31f1b2817cd 100644 --- a/xml/System.ComponentModel.Design.Serialization/SerializationStore.xml +++ b/xml/System.ComponentModel.Design.Serialization/SerializationStore.xml @@ -58,7 +58,7 @@ class is an implementation-specific class that stores serialization data for the . The service adds state to this serialization store. Once the store is closed, it can be saved to a stream. A serialization store can be deserialized at a later time by the same type of serialization service. The class implements the interface so that simply calls the method. + The class is an implementation-specific class that stores serialization data for the . The service adds state to this serialization store. Once the store is closed, it can be saved to a stream. A serialization store can be deserialized at a later time by the same type of serialization service. The class implements the interface so that simply calls the method. ]]> @@ -153,7 +153,7 @@ method closes this store and prevents any objects from being serialized into it. Once closed, the serialization store may be saved. + The method closes this store and prevents any objects from being serialized into it. Once closed, the serialization store may be saved. ]]> @@ -305,7 +305,7 @@ method will automatically close it for you. You can call as many times as you wish to save the store to different streams. + If the store is open, the method will automatically close it for you. You can call as many times as you wish to save the store to different streams. ]]> diff --git a/xml/System.ComponentModel.Design.Serialization/StatementContext.xml b/xml/System.ComponentModel.Design.Serialization/StatementContext.xml index 71071693e88..f96dae47f5f 100644 --- a/xml/System.ComponentModel.Design.Serialization/StatementContext.xml +++ b/xml/System.ComponentModel.Design.Serialization/StatementContext.xml @@ -44,11 +44,11 @@ Provides a location into which statements can be serialized. This class cannot be inherited. - method with a collection of objects whose statements you want stored in the statement table. As each object is serialized in the method, it has its contents placed in the statement table and saved in the context. If you push this object on the stack, it is your responsibility to integrate the statements added to it into your own collection of statements. - + method with a collection of objects whose statements you want stored in the statement table. As each object is serialized in the method, it has its contents placed in the statement table and saved in the context. If you push this object on the stack, it is your responsibility to integrate the statements added to it into your own collection of statements. + ]]> diff --git a/xml/System.ComponentModel.Design.Serialization/TypeCodeDomSerializer.xml b/xml/System.ComponentModel.Design.Serialization/TypeCodeDomSerializer.xml index fdc79dbde37..a620868be28 100644 --- a/xml/System.ComponentModel.Design.Serialization/TypeCodeDomSerializer.xml +++ b/xml/System.ComponentModel.Design.Serialization/TypeCodeDomSerializer.xml @@ -136,7 +136,7 @@ method deserializes a previously serialized code type declaration. The following table shows the tasks default implementation performs. + The method deserializes a previously serialized code type declaration. The following table shows the tasks default implementation performs. |Task|Description| |----------|-----------------| @@ -144,7 +144,7 @@ |Statement Sorting|All member variables and local variables from init methods are stored in a table. Then each statement in an init method is added to a statement collection grouped according to its left-hand side, so all statements assigning or operating on a particular variable are grouped under that variable. Variables that have no statements are discarded.| |Deserialization|The statement collections for each variable are deserialized according to the variable.| - The following table shows the services the method requires. + The following table shows the services the method requires. |Service|Description| |-------------|-----------------| @@ -204,7 +204,7 @@ method returns the method to emit all of the initialization code for the given member. The default implementation returns an empty constructor. If the same method is to be returned for multiple values, the same instance of the method should be returned. You can use the dictionary to remember methods you have created. The `typeDecl` parameter can also be used to add infrastructure methods. For example, if you want to emit a separate method for each object, you need a single method that calls all of these methods in turn. This method can be added to the code type declaration as needed. + The method returns the method to emit all of the initialization code for the given member. The default implementation returns an empty constructor. If the same method is to be returned for multiple values, the same instance of the method should be returned. You can use the dictionary to remember methods you have created. The `typeDecl` parameter can also be used to add infrastructure methods. For example, if you want to emit a separate method for each object, you need a single method that calls all of these methods in turn. This method can be added to the code type declaration as needed. ]]> @@ -320,22 +320,22 @@ method serializes the given root object and optional collection of members to create a new type definition. If the `members` collection contains values, these values are serialized. Values themselves may serialize as either member variables or local variables. This determination is done by searching for an extender property on the object called `GenerateMember`. If `true`, a member is generated. Otherwise, a local variable is generated. For convenience, the `members` collection can contain the root object. In this case, the root object is not also added as a member or local variable. + The method serializes the given root object and optional collection of members to create a new type definition. If the `members` collection contains values, these values are serialized. Values themselves may serialize as either member variables or local variables. This determination is done by searching for an extender property on the object called `GenerateMember`. If `true`, a member is generated. Otherwise, a local variable is generated. For convenience, the `members` collection can contain the root object. In this case, the root object is not also added as a member or local variable. The name of the returned type is taken from the root object's name, if it was a named object. If not, a name is fabricated from the simple type name of the root class. - The following table shows the tasks performed by the default implementation of the method. + The following table shows the tasks performed by the default implementation of the method. |Task|Description| |----------|-----------------| |Context Seeding|The serialization context is initialized with data including the and | -|Member Serialization|Next, walks all of the members and calls . Because serialization is done opportunistically in , this ensures that serialization is not done twice.| +|Member Serialization|Next, walks all of the members and calls . Because serialization is done opportunistically in , this ensures that serialization is not done twice.| |Root Serialization|Next, the root object is serialized and its statements are added to the statement collection.| -|Statement Integration|After all objects are serialized, the method orders the statements and adds them to a method returned from . Finally, a constructor is fabricated that calls all of the methods returned from .| +|Statement Integration|After all objects are serialized, the method orders the statements and adds them to a method returned from . Finally, a constructor is fabricated that calls all of the methods returned from .| - - The following table shows the objects the method places on the context stack. + The following table shows the objects the method places on the context stack. |Instance|Description| |--------------|-----------------| diff --git a/xml/System.ComponentModel.Design/ActiveDesignerEventArgs.xml b/xml/System.ComponentModel.Design/ActiveDesignerEventArgs.xml index faee6b5c3f7..9b958924e89 100644 --- a/xml/System.ComponentModel.Design/ActiveDesignerEventArgs.xml +++ b/xml/System.ComponentModel.Design/ActiveDesignerEventArgs.xml @@ -52,22 +52,22 @@ Provides data for the event. - event occurs when the currently active document changes. The active document changes when a new document is created, an existing document is opened, or a document is closed. - - When you create an delegate, you identify the method that will handle the event. To associate the event with your event handler, add an instance of the delegate to the event. The event handler is called whenever the event occurs, unless you remove the delegate. For more information about event-handler delegates, see [Handling and Raising Events](/dotnet/standard/events/). - - - -## Examples - The following example method returns an that contains a specified reference to the for the designer losing focus and a specified reference to the for the designer gaining focus. - + event occurs when the currently active document changes. The active document changes when a new document is created, an existing document is opened, or a document is closed. + + When you create an delegate, you identify the method that will handle the event. To associate the event with your event handler, add an instance of the delegate to the event. The event handler is called whenever the event occurs, unless you remove the delegate. For more information about event-handler delegates, see [Handling and Raising Events](/dotnet/standard/events/). + + + +## Examples + The following example method returns an that contains a specified reference to the for the designer losing focus and a specified reference to the for the designer gaining focus. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/ActiveDesignerEventArgs/CPP/class1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel.Design/ActiveDesignerEventArgs/Overview/class1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel.Design/ActiveDesignerEventArgs/Overview/class1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel.Design/ActiveDesignerEventArgs/Overview/class1.vb" id="Snippet1"::: + ]]> diff --git a/xml/System.ComponentModel.Design/CollectionEditor+CollectionForm.xml b/xml/System.ComponentModel.Design/CollectionEditor+CollectionForm.xml index ad0052698d7..39d691fac26 100644 --- a/xml/System.ComponentModel.Design/CollectionEditor+CollectionForm.xml +++ b/xml/System.ComponentModel.Design/CollectionEditor+CollectionForm.xml @@ -142,13 +142,13 @@ if it is permissible to remove this value from the collection; otherwise, . By default, this method returns the value from of the for this form. - of the for this form. - - This method is called when the user tries to remove from the collection an item that is an original member of the collection. This method is not called when removing items that were added in this editing session, because they are not yet part of the collection. - + of the for this form. + + This method is called when the user tries to remove from the collection an item that is an original member of the collection. This method is not called when removing items that were added in this editing session, because they are not yet part of the collection. + ]]> @@ -190,11 +190,11 @@ if it multiple collection members can be selected at the same time; otherwise, . By default, this method returns the value from of the for this form. - @@ -234,11 +234,11 @@ Gets the data type of each item in the collection. The data type of the collection items. - @@ -278,11 +278,11 @@ Gets the data type of the collection object. The data type of the collection object. - @@ -370,11 +370,11 @@ Creates a new instance of the specified collection item type. A new instance of the specified object, or if the user chose to cancel the creation of this instance. - @@ -584,11 +584,11 @@ Gets or sets the array of items for this form to display. An array of objects for the form to display. - @@ -628,11 +628,11 @@ Gets the available item types that can be created for this collection. The types of items that can be created. - . If more than one type is returned, the collection editor UI provides a way to choose which item type to create. - + . If more than one type is returned, the collection editor UI provides a way to choose which item type to create. + ]]> @@ -672,11 +672,11 @@ Provides an opportunity to perform processing when a collection value has changed. - diff --git a/xml/System.ComponentModel.Design/CollectionEditor.xml b/xml/System.ComponentModel.Design/CollectionEditor.xml index 650260f61f0..c5f630d614f 100644 --- a/xml/System.ComponentModel.Design/CollectionEditor.xml +++ b/xml/System.ComponentModel.Design/CollectionEditor.xml @@ -988,7 +988,7 @@ . If more than one type is returned, the collection editor UI provides a way to choose which item type to create. + This property indicates the data types that can be added to the collection. By default, this returns a single type of . If more than one type is returned, the collection editor UI provides a way to choose which item type to create. ]]> diff --git a/xml/System.ComponentModel.Design/ComponentActionsType.xml b/xml/System.ComponentModel.Design/ComponentActionsType.xml index 48517d4c51e..eb3f097c6dc 100644 --- a/xml/System.ComponentModel.Design/ComponentActionsType.xml +++ b/xml/System.ComponentModel.Design/ComponentActionsType.xml @@ -24,7 +24,7 @@ |Smart-tag model|Description| |----------------------|-----------------| |Pull|The class derived from that is associated with the component overrides the property to return the collection of smart tags for that component.| -|Push|A call to the method explicitly associates the specified smart tags with the specified component.| +|Push|A call to the method explicitly associates the specified smart tags with the specified component.| For more information about these smart-tag models, see the and classes. diff --git a/xml/System.ComponentModel.Design/ComponentDesigner+ShadowPropertyCollection.xml b/xml/System.ComponentModel.Design/ComponentDesigner+ShadowPropertyCollection.xml index f3f950c723c..974fddbd56c 100644 --- a/xml/System.ComponentModel.Design/ComponentDesigner+ShadowPropertyCollection.xml +++ b/xml/System.ComponentModel.Design/ComponentDesigner+ShadowPropertyCollection.xml @@ -44,11 +44,11 @@ Represents a collection of shadow properties that should override inherited default or assigned values for specific properties. This class cannot be inherited. - stores a collection of values for specific properties that override any other value for these properties at design time. This is useful for ensuring that a specific property is set to a specific value, for example, in situations when the background form should always have its visible property set to `true`. - + stores a collection of values for specific properties that override any other value for these properties at design time. This is useful for ensuring that a specific property is set to a specific value, for example, in situations when the background form should always have its visible property set to `true`. + ]]> @@ -136,11 +136,11 @@ Gets or sets the object at the specified index. The value of the specified property, if it exists in the collection. Otherwise, the value is retrieved from the current value of the nonshadowed property. - . - + . + ]]> diff --git a/xml/System.ComponentModel.Design/ComponentDesigner.xml b/xml/System.ComponentModel.Design/ComponentDesigner.xml index a1cae788656..a08a43e5a85 100644 --- a/xml/System.ComponentModel.Design/ComponentDesigner.xml +++ b/xml/System.ComponentModel.Design/ComponentDesigner.xml @@ -86,7 +86,7 @@ ## Examples - The following code example provides an example implementation and an example component associated with the designer. The designer implements an override of the method that calls the base `Initialize` method, an override of the method that displays a when the component is double-clicked, and an override of the property accessor that supplies a custom menu command to the shortcut menu for the component. + The following code example provides an example implementation and an example component associated with the designer. The designer implements an override of the method that calls the base `Initialize` method, an override of the method that displays a when the component is double-clicked, and an override of the property accessor that supplies a custom menu command to the shortcut menu for the component. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/ComponentDesignerExample/CPP/examplecomponent.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel.Design/ComponentDesigner/Overview/examplecomponent.cs" id="Snippet1"::: @@ -259,10 +259,10 @@ method of sets this property. + The method of sets this property. > [!NOTE] -> When overriding the method, be sure to call the base class method before using this property. +> When overriding the method, be sure to call the base class method before using this property. ]]> @@ -317,10 +317,10 @@ when you are finished using the . The method leaves the in an unusable state. After calling , you must release all references to the so the garbage collector can reclaim the memory that the was occupying. For more information, see [Cleaning Up Unmanaged Resources](/dotnet/standard/garbage-collection/unmanaged) and [Implementing a Dispose Method](/dotnet/standard/garbage-collection/implementing-dispose). + Call when you are finished using the . The method leaves the in an unusable state. After calling , you must release all references to the so the garbage collector can reclaim the memory that the was occupying. For more information, see [Cleaning Up Unmanaged Resources](/dotnet/standard/garbage-collection/unmanaged) and [Implementing a Dispose Method](/dotnet/standard/garbage-collection/implementing-dispose). > [!NOTE] -> Always call before you release your last reference to the . Otherwise, the resources it is using will not be freed until the garbage collector calls the object's `Finalize` method. +> Always call before you release your last reference to the . Otherwise, the resources it is using will not be freed until the garbage collector calls the object's `Finalize` method. ]]> @@ -453,9 +453,9 @@ and cleans up resources by calling `Dispose(false)`. Override `Dispose(Boolean)` to customize the cleanup. + This method overrides and cleans up resources by calling `Dispose(false)`. Override `Dispose(Boolean)` to customize the cleanup. - Application code should not call this method; an object's `Finalize` method is automatically invoked during garbage collection, unless finalization by the garbage collector has been disabled by a call to the method. + Application code should not call this method; an object's `Finalize` method is automatically invoked during garbage collection, unless finalization by the garbage collector has been disabled by a call to the method. For more information, see [Finalize Methods and Destructors](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/0s71x931(v%3dvs.100)), [Cleaning Up Unmanaged Resources](/dotnet/standard/garbage-collection/unmanaged), and [Overriding the Finalize Method](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/ddae83kx(v=vs.100)). @@ -508,7 +508,7 @@ ## Examples - The following code example demonstrates the use of the method to access designer services. + The following code example demonstrates the use of the method to access designer services. :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/TypeDescriptor/GetProperties/Form1.cs" id="Snippet7"::: :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/TypeDescriptor/GetProperties/Form1.vb" id="Snippet7"::: @@ -697,7 +697,7 @@ method is called when an existing component is being reinitialized. For example, this may occur after the user drags a component to another container. + The method is called when an existing component is being reinitialized. For example, this may occur after the user drags a component to another container. You may use the `defaultValues` dictionary to apply recommended defaults to properties; however, you should not modify component properties aside from those stored in the dictionary, because this existing component may already have properties set on it. @@ -748,7 +748,7 @@ method is called when a component is first initialized, typically after being first added to a design surface. + The method is called when a component is first initialized, typically after being first added to a design surface. You may perform any necessary initialization of this component, and you may ignore the `defaultValues` dictionary altogether. @@ -901,7 +901,7 @@ is called when the designer is initialized. This allows the designer to provide default values for the base component. + is called when the designer is initialized. This allows the designer to provide default values for the base component. This method is called only once: when you first create the component by dragging it from the Toolbox to the design surface. Subsequent initializations of the designer do not invoke this method. @@ -998,7 +998,7 @@ ## Remarks This method provides a way to change or remove the items within the dictionary of attributes that are exposed through a . - The keys in the dictionary of attributes are the type identifiers of the attributes, as specified by the value of their property. The objects are of type . This method is called immediately after the method. + The keys in the dictionary of attributes are the type identifiers of the attributes, as specified by the value of their property. The objects are of type . This method is called immediately after the method. ]]> @@ -1049,7 +1049,7 @@ ## Remarks This method provides a way to change or remove the items within the dictionary of events that are exposed through a . - The keys in the dictionary of events are the names of the events. The objects are of type . This method is called immediately after the method. + The keys in the dictionary of events are the names of the events. The objects are of type . This method is called immediately after the method. ]]> @@ -1100,7 +1100,7 @@ ## Remarks This method provides a way to change or remove the items within the dictionary of properties that are exposed through a . - The keys in the dictionary of properties are the names of the properties. The objects are of type . This method is called immediately after the method. + The keys in the dictionary of properties are the names of the properties. The objects are of type . This method is called immediately after the method. ]]> @@ -1152,7 +1152,7 @@ ## Remarks This method provides a way to add items to the dictionary of attributes that a designer exposes through a . - The keys in the dictionary of attributes are the type identifiers of the attributes, as specified by the value of their property. The objects are of type . This method is called immediately before the method. + The keys in the dictionary of attributes are the type identifiers of the attributes, as specified by the value of their property. The objects are of type . This method is called immediately before the method. ]]> @@ -1203,7 +1203,7 @@ ## Remarks This method provides a way to add items to the dictionary of events that a designer exposes through a . - The keys in the dictionary of events are the names of the events. The objects are of type . This method is called immediately before the method. + The keys in the dictionary of events are the names of the events. The objects are of type . This method is called immediately before the method. ]]> @@ -1254,7 +1254,7 @@ ## Remarks This method provides a way to add items to the dictionary of properties that a designer exposes through a . - The keys in the dictionary of properties are the names of the properties. The objects are of type . This method is called immediately before the method. + The keys in the dictionary of properties are the names of the properties. The objects are of type . This method is called immediately before the method. ]]> @@ -1884,7 +1884,7 @@ ## Remarks This method returns `null` if the component has no design-time verbs. - The design-time environment typically displays verbs returned by this method in a shortcut (right-click) menu. When a user selects one of the verbs, the method of the corresponding is invoked. + The design-time environment typically displays verbs returned by this method in a shortcut (right-click) menu. When a user selects one of the verbs, the method of the corresponding is invoked. > [!NOTE] > A design-time environment typically provides a **Properties** command on a component's shortcut menu. Therefore, do not include such an entry in the collection of designer-specified verbs. diff --git a/xml/System.ComponentModel.Design/DesignSurface.xml b/xml/System.ComponentModel.Design/DesignSurface.xml index f779b5fc2d7..a0beca9fd2e 100644 --- a/xml/System.ComponentModel.Design/DesignSurface.xml +++ b/xml/System.ComponentModel.Design/DesignSurface.xml @@ -237,10 +237,10 @@ constructor, it creates a simple designer loader that, in turn, creates a component of the given type and then ends the loading process. This is a straightforward way to create a designer, under the assumption that all saving of state will be done externally. Internally, this calls and passes the root component type. + When you use the constructor, it creates a simple designer loader that, in turn, creates a component of the given type and then ends the loading process. This is a straightforward way to create a designer, under the assumption that all saving of state will be done externally. Internally, this calls and passes the root component type. > [!NOTE] -> The overload is not affected by . The must be in the service container before the design surface loads. If you need access to , call the empty constructor, add the to the and call with `rootComponentType`. +> The overload is not affected by . The must be in the service container before the design surface loads. If you need access to , call the empty constructor, add the to the and call with `rootComponentType`. ]]> @@ -293,7 +293,7 @@ constructor creates a simple designer loader that creates a component of the given type and then ends the loading process. This is a straightforward way to create a designer, under the assumption that all saving of state will be done externally. Internally, this calls and passes the root component type. + Using the constructor creates a simple designer loader that creates a component of the given type and then ends the loading process. This is a straightforward way to create a designer, under the assumption that all saving of state will be done externally. Internally, this calls and passes the root component type. ]]> @@ -351,7 +351,7 @@ ## Remarks Designer loading can be asynchronous, so the loading may continue to progress after this call has returned. Attach an event handler to the event to be notified when the design surface has completed loading. - After is called, you can immediately obtain the view for the designer, because designer loaders must provide at least the root component when loading asynchronously. + After is called, you can immediately obtain the view for the designer, because designer loaders must provide at least the root component when loading asynchronously. ]]> @@ -401,10 +401,10 @@ ## Remarks When `rootComponentType` is specified, a default designer loader that simply creates an instance of `rootComponentType` will be used. Designer loading can be asynchronous, so the loading may continue to progress after this call has returned. Attach an event handler to the event to be notified when the design surface has completed loading. - After is called, you can immediately obtain the view for the designer, because designer loaders must provide at least the root component when loading asynchronously. + After is called, you can immediately obtain the view for the designer, because designer loaders must provide at least the root component when loading asynchronously. > [!NOTE] -> The method creates an instance of the component type and initializes a designer for this instance. The event is raised before this method returns. +> The method creates an instance of the component type and initializes a designer for this instance. The event is raised before this method returns. ]]> @@ -447,7 +447,7 @@ property holds all objects that are currently in design mode. When components are added to , their designer, if any, is loaded. The component is sited with a site that provides full access to the design surface. + The property holds all objects that are currently in design mode. When components are added to , their designer, if any, is loaded. The component is sited with a site that provides full access to the design surface. ]]> @@ -499,7 +499,7 @@ method is called by the design surface's method to create an instance of a component. The component should be created and added to the public container on the design surface. + The method is called by the design surface's method to create an instance of a component. The component should be created and added to the public container on the design surface. ]]> @@ -550,9 +550,9 @@ method is called by the design surface's when a component is added to the container. This method creates a designer, but does not initialize it. When it returns, the designer is initialized by the container. + The method is called by the design surface's when a component is added to the container. This method creates a designer, but does not initialize it. When it returns, the designer is initialized by the container. - can create two different types of designers: root designers and normal designers. A root designer is a designer for the root component in the design surface, which by definition is the first component added to the container. Root designers differ from normal designers because they are responsible for the user interface presented to the end user. Root designers typically coordinate with the rest of the designers on a design surface to provide this interface. + can create two different types of designers: root designers and normal designers. A root designer is a designer for the root component in the design surface, which by definition is the first component added to the container. Root designers differ from normal designers because they are responsible for the user interface presented to the end user. Root designers typically coordinate with the rest of the designers on a design surface to provide this interface. The default implementation of this method delegates to , passing in as the designer type for root designers, or for normal designers. You can override this method to request a specific type of designer. @@ -602,7 +602,7 @@ , searches for a constructor of type first, followed by an empty constructor. + If `type` is an , searches for a constructor of type first, followed by an empty constructor. ]]> @@ -723,7 +723,7 @@ ## Remarks Adding a component to a nested container creates its designer and makes it eligible for all services available from the design surface. Components added to nested containers do not participate in serialization. - You can provide an additional name for the method by passing a value into `containerName`. + You can provide an additional name for the method by passing a value into `containerName`. ]]> @@ -784,15 +784,15 @@ method follows the standard pattern. Calling this method destroys the design surface. The protected version of this method is `virtual` and follows the normal pattern. + The public method follows the standard pattern. Calling this method destroys the design surface. The protected version of this method is `virtual` and follows the normal pattern. > [!NOTE] -> Because does not have any native code to clean up, it does not have a finalizer that calls . If you need to call , you must add a finalizer yourself. +> Because does not have any native code to clean up, it does not have a finalizer that calls . If you need to call , you must add a finalizer yourself. - Call when you are finished using the . The method leaves the in an unusable state. After calling , you must release all references to the so the garbage collector can reclaim the memory that the was occupying. For more information, see [Cleaning Up Unmanaged Resources](/dotnet/standard/garbage-collection/unmanaged) and [Implementing a Dispose Method](/dotnet/standard/garbage-collection/implementing-dispose). + Call when you are finished using the . The method leaves the in an unusable state. After calling , you must release all references to the so the garbage collector can reclaim the memory that the was occupying. For more information, see [Cleaning Up Unmanaged Resources](/dotnet/standard/garbage-collection/unmanaged) and [Implementing a Dispose Method](/dotnet/standard/garbage-collection/implementing-dispose). > [!NOTE] -> Always call before you release your last reference to the . Otherwise, the resources it is using will not be freed until the garbage collector calls the object's `Finalize` method. +> Always call before you release your last reference to the . Otherwise, the resources it is using will not be freed until the garbage collector calls the object's `Finalize` method. ]]> @@ -839,7 +839,7 @@ The public method follows the standard pattern. Calling this method destroys the design surface. The protected version of this method is `virtual` and follows the normal pattern. > [!NOTE] -> Because does not have any native code to clean up, it does not have a finalizer that calls . If you need to call , you must add a finalizer yourself. +> Because does not have any native code to clean up, it does not have a finalizer that calls . If you need to call , you must add a finalizer yourself. This method is called by the public `Dispose()` method and the method, if it has been overridden. `Dispose()` invokes this method with the `disposing` parameter set to `true`. `Finalize` invokes this method with `disposing` set to `false`. @@ -896,7 +896,7 @@ method on is called. + The surface is only disposed when the public method on is called. ]]> @@ -980,7 +980,7 @@ method can be called to push changes made to the design surface down to the serializer. This ensures that the design surface and its serialized state are synchronized. The actual implementation of this method is forwarded to the designer loader associated with design surface. The designer loader may choose to defer changes until is called, or it may choose to keep the serialized data up to date with all user changes. The method ensures that regardless of the model the designer loader chooses to use, the serialized state is synchronized with the actual design surface. + The method can be called to push changes made to the design surface down to the serializer. This ensures that the design surface and its serialized state are synchronized. The actual implementation of this method is forwarded to the designer loader associated with design surface. The designer loader may choose to defer changes until is called, or it may choose to keep the serialized data up to date with all user changes. The method ensures that regardless of the model the designer loader chooses to use, the serialized state is synchronized with the actual design surface. ]]> @@ -1075,7 +1075,7 @@ method retrieves a service in the design surface's service container. In addition, this will forward to any service provider that was given to the design surface at construction time. + The method retrieves a service in the design surface's service container. In addition, this will forward to any service provider that was given to the design surface at construction time. ]]> @@ -1588,14 +1588,14 @@ method must be called beforehand to start the loading process. It is possible to return a view before the designer loader finishes loading because the root designer, which supplies the view, is the first object created by the designer loader. If a view is unavailable, raises an exception. + The method must be called beforehand to start the loading process. It is possible to return a view before the designer loader finishes loading because the root designer, which supplies the view, is the first object created by the designer loader. If a view is unavailable, raises an exception. The notion of a view technology is obsolete. But, it remains in the interfaces for root designers for backward compatibility. Its use is hidden from anyone using objects. The property hides view technologies by passing the supported technologies back into the root designer. ## Examples - The following code example shows how hides view technologies. + The following code example shows how hides view technologies. ```csharp IRootDesigner d; @@ -1653,7 +1653,7 @@ method, your event handler should activate the window for this design surface. + If you want to support the method, your event handler should activate the window for this design surface. ]]> diff --git a/xml/System.ComponentModel.Design/DesignSurfaceManager.xml b/xml/System.ComponentModel.Design/DesignSurfaceManager.xml index 7ce5c8b64ba..9cc07795f24 100644 --- a/xml/System.ComponentModel.Design/DesignSurfaceManager.xml +++ b/xml/System.ComponentModel.Design/DesignSurfaceManager.xml @@ -308,9 +308,9 @@ method creates a merged service provider that can satisfy service requests from both the given service provider as well as the itself. The method then passes this service provider into the method. + If you want to conveniently add additional per-designer services, use the `parentProvider` parameter to provide a service provider for this design surface. The method creates a merged service provider that can satisfy service requests from both the given service provider as well as the itself. The method then passes this service provider into the method. - After returns the design surface, the method tries to obtain the . If it is present, and if it is the instance of the service that provided by default, the method raises the event. + After returns the design surface, the method tries to obtain the . If it is present, and if it is the instance of the service that provided by default, the method raises the event. ]]> @@ -361,7 +361,7 @@ method is called by both methods. It is the implementation that actually creates the design surface. The default implementation just returns a new . You may override this method to provide a custom object that derives from the class. + The method is called by both methods. It is the implementation that actually creates the design surface. The default implementation just returns a new . You may override this method to provide a custom object that derives from the class. ]]> @@ -535,10 +535,10 @@ method follows the standard pattern. Calling this method destroys the design surface manager. It also disposes the service container, which causes all services that implement to also be disposed. The protected version of this method is `virtual` and follows the normal pattern. + The public method follows the standard pattern. Calling this method destroys the design surface manager. It also disposes the service container, which causes all services that implement to also be disposed. The protected version of this method is `virtual` and follows the normal pattern. > [!NOTE] -> Because does not have any native code to clean up, it does not have a finalizer that calls . If you need to call , you must add a finalizer yourself. +> Because does not have any native code to clean up, it does not have a finalizer that calls . If you need to call , you must add a finalizer yourself. ]]> @@ -582,10 +582,10 @@ method follows the standard pattern. Calling this method destroys the design surface manager. It also disposes the service container, which causes all services that implement to also be disposed. The protected version of this method is `virtual` and follows the normal pattern. + The public method follows the standard pattern. Calling this method destroys the design surface manager. It also disposes the service container, which causes all services that implement to also be disposed. The protected version of this method is `virtual` and follows the normal pattern. > [!NOTE] -> Because does not have any native code to clean up, it does not have a finalizer that calls . If you need to call , you must add a finalizer yourself. +> Because does not have any native code to clean up, it does not have a finalizer that calls . If you need to call , you must add a finalizer yourself. This method is called by the public `Dispose()` method and the method, if it has been overridden. `Dispose()` invokes this method with the `disposing` parameter set to `true`. `Finalize` invokes this method with `disposing` set to `false`. @@ -643,7 +643,7 @@ method forwards to any service provider that was given to the design surface manager at construction time. + The method forwards to any service provider that was given to the design surface manager at construction time. ]]> diff --git a/xml/System.ComponentModel.Design/DesignerActionHeaderItem.xml b/xml/System.ComponentModel.Design/DesignerActionHeaderItem.xml index 7acef618df4..20858401788 100644 --- a/xml/System.ComponentModel.Design/DesignerActionHeaderItem.xml +++ b/xml/System.ComponentModel.Design/DesignerActionHeaderItem.xml @@ -49,7 +49,7 @@ ## Remarks Like the base class, represents individual static text items in a smart tag panel. However, entries are displayed using bold text. Typically, a header item is used to create a heading for a group of items in a panel. Clicking on a header item causes no action. - Individual panel items are associated together to form a panel by calling the method of the class. + Individual panel items are associated together to form a panel by calling the method of the class. @@ -116,7 +116,7 @@ and the properties to the value of the `displayName` parameter and sets the property to `null`. + This constructor sets both the and the properties to the value of the `displayName` parameter and sets the property to `null`. diff --git a/xml/System.ComponentModel.Design/DesignerActionItem.xml b/xml/System.ComponentModel.Design/DesignerActionItem.xml index 6a7398202e8..5e1462a27a0 100644 --- a/xml/System.ComponentModel.Design/DesignerActionItem.xml +++ b/xml/System.ComponentModel.Design/DesignerActionItem.xml @@ -49,7 +49,7 @@ ## Remarks The class serves as an abstract base for classes that represent individual panel items in a smart tag panel, which represents a menu-like user interface (UI) for smart tags. The .NET Framework supplies derived classes that represent the different common entries in a smart tag panel, including plain text, header text, properties and methods of the associated class, and designer verbs. - Typically, your `DesignerAction` feature is defined in a programmer-supplied class derived from , which contains a method that groups individual panel items together to form the smart tag panel. The and types are associated with members of the class derived from , and objects are activated when their associated panel entry is selected by the user. + Typically, your `DesignerAction` feature is defined in a programmer-supplied class derived from , which contains a method that groups individual panel items together to form the smart tag panel. The and types are associated with members of the class derived from , and objects are activated when their associated panel entry is selected by the user. > [!NOTE] > Forms and dialog boxes can be displayed by members of the class derived from . By default, the parent of these windows will be the container window for the smart tag panel. Explicitly parenting these child windows to another service or window may cause items to display improperly. @@ -111,9 +111,9 @@ is an abstract class, the constructor is intended to be called from derived classes only. + Because is an abstract class, the constructor is intended to be called from derived classes only. - For more information about how the `category` parameter is used to group items on a panel, see the method. + For more information about how the `category` parameter is used to group items on a panel, see the method. ]]> @@ -172,9 +172,9 @@ The property is used in conjunction with the property on the and types. - For example, ASP.NET uses a data-bound control like to connect to a data source control like . Both have a with its own set of objects. The control has items like , `Edit Fields`, and `AutoFormat`. The class has `Configure` and `Refresh Items`, which have set to `true`. + For example, ASP.NET uses a data-bound control like to connect to a data source control like . Both have a with its own set of objects. The control has items like , `Edit Fields`, and `AutoFormat`. The class has `Configure` and `Refresh Items`, which have set to `true`. - The control's item has a related component, which is the object. All the object's items that have set to `true` are automatically included in the control's action list. The following table shows how the two lists are merged in the control's designer action list. + The control's item has a related component, which is the object. All the object's items that have set to `true` are automatically included in the control's action list. The following table shows how the two lists are merged in the control's designer action list. |GridView items|SqlDataSource items| |--------------------|-------------------------| @@ -235,7 +235,7 @@ ## Remarks Item categories are defined by their names, which are case-sensitive. - For more information about how items are grouped by category, see the method. + For more information about how items are grouped by category, see the method. ]]> @@ -386,7 +386,7 @@ property allows the programmer to store arbitrary data within an item. The standard properties for this class, such as and , are not stored in this collection. + The property allows the programmer to store arbitrary data within an item. The standard properties for this class, such as and , are not stored in this collection. The type of this property is actually . diff --git a/xml/System.ComponentModel.Design/DesignerActionList.xml b/xml/System.ComponentModel.Design/DesignerActionList.xml index 3f398c72ece..2d62ea831d8 100644 --- a/xml/System.ComponentModel.Design/DesignerActionList.xml +++ b/xml/System.ComponentModel.Design/DesignerActionList.xml @@ -51,9 +51,9 @@ is the base class, derived from by component developers in order to populate a smart tag panel. A smart tag panel represents the menu-like user interface (UI) for smart tags. - This derived class may implement the `virtual` method to return a collection of objects derived from . These objects represent the smart tag panel items. Each item is displayed in the panel according to its type. For example, a is displayed as a static text label. Active panel items, represented by the and types, have a corresponding publicly accessible property or method, respectively, that implements the functionality for that item. + This derived class may implement the `virtual` method to return a collection of objects derived from . These objects represent the smart tag panel items. Each item is displayed in the panel according to its type. For example, a is displayed as a static text label. Active panel items, represented by the and types, have a corresponding publicly accessible property or method, respectively, that implements the functionality for that item. - For more information about how to add items to the smart tag panel, see the method. + For more information about how to add items to the smart tag panel, see the method. > [!NOTE] > Forms and dialog boxes can be displayed by members of the class derived from . By default, the parent of these windows will be the container window for the smart tag panel. Explicitly parenting these child windows to another service or window may cause smart tags to display improperly. @@ -315,7 +315,7 @@ method is implemented to return, in the expected display order, a collection of objects derived from the class. These items can be of the following specific types. + The `virtual` method is implemented to return, in the expected display order, a collection of objects derived from the class. These items can be of the following specific types. |Type|Description| |----------|-----------------| @@ -336,7 +336,7 @@ - If an item does not have a category, it is placed in a miscellaneous group at the end of the panel. This group also contains items whose property is set to `false`. - The method is called when the panel is first created. You must call the method to update the list of items displayed in the panel. + The method is called when the panel is first created. You must call the method to update the list of items displayed in the panel. diff --git a/xml/System.ComponentModel.Design/DesignerActionListCollection.xml b/xml/System.ComponentModel.Design/DesignerActionListCollection.xml index 1227d3b6f5a..091e87125b6 100644 --- a/xml/System.ComponentModel.Design/DesignerActionListCollection.xml +++ b/xml/System.ComponentModel.Design/DesignerActionListCollection.xml @@ -62,7 +62,7 @@ |Technique|Description| |---------------|-----------------| |Pull model|The designer for the component class, which is derived from the class, supplies this collection through the property. The designer infrastructure reads this property when it must display the panel.| -|Push model|A or is supplied as a parameter in a call to the method of the associated with the component.| +|Push model|A or is supplied as a parameter in a call to the method of the associated with the component.| The designer infrastructure constructs a panel by creating a smart tag panel, whose constructor takes two parameters of type . The collections of lists, which contain the pulled and pushed items, are merged into one panel. @@ -136,7 +136,7 @@ constructor creates an empty collection, containing zero objects. + The constructor creates an empty collection, containing zero objects. ]]> @@ -186,7 +186,7 @@ constructor creates a collection that contains the supplied objects. + The constructor creates a collection that contains the supplied objects. ]]> @@ -310,7 +310,7 @@ ## Remarks The new elements are added to the end of the internal list. - After validating the `value` parameter, the method makes a series of calls to the method to individually add each element. + After validating the `value` parameter, the method makes a series of calls to the method to individually add each element. ]]> @@ -360,7 +360,7 @@ ## Remarks The new elements are added to the end of the internal list. - After validating the `value` parameter, the method makes a series of calls to the method to individually add each element. + After validating the `value` parameter, the method makes a series of calls to the method to individually add each element. ]]> @@ -466,7 +466,7 @@ method throws an exception while copying, the state of the destination array is undefined. For example, if an or occurs, the destination array may be left in a partially filled state. + If the method throws an exception while copying, the state of the destination array is undefined. For example, if an or occurs, the destination array may be left in a partially filled state. ]]> diff --git a/xml/System.ComponentModel.Design/DesignerActionListsChangedEventArgs.xml b/xml/System.ComponentModel.Design/DesignerActionListsChangedEventArgs.xml index 72fb0459a6a..10787c0cf41 100644 --- a/xml/System.ComponentModel.Design/DesignerActionListsChangedEventArgs.xml +++ b/xml/System.ComponentModel.Design/DesignerActionListsChangedEventArgs.xml @@ -49,7 +49,7 @@ ## Remarks A event occurs when a is added or removed from a managed collection of such lists. This event is not raised when an individual list element changes its value. - The event is generated by the class when its , , and methods are executed. + The event is generated by the class when its , , and methods are executed. ]]> diff --git a/xml/System.ComponentModel.Design/DesignerActionMethodItem.xml b/xml/System.ComponentModel.Design/DesignerActionMethodItem.xml index 3e12f494d48..8e99a73bb1c 100644 --- a/xml/System.ComponentModel.Design/DesignerActionMethodItem.xml +++ b/xml/System.ComponentModel.Design/DesignerActionMethodItem.xml @@ -49,7 +49,7 @@ ## Remarks The class represents individual items in a smart tag panel. An item of this type is displayed as an active user interface element, such as a hyperlink, that invokes a programmer-supplied method in a class derived from . The association between the item and the method is maintained through the value of the property. The method that this item invokes must neither take parameters nor return a value. - Individual panel items are associated together to form a panel by a call to the method of the class. + Individual panel items are associated together to form a panel by a call to the method of the class. @@ -123,7 +123,7 @@ constructor sets the and properties to `null`, and the property to `false`. + The constructor sets the and properties to `null`, and the property to `false`. ]]> @@ -180,9 +180,9 @@ ; therefore, it will be added to the component's design-time shortcut menu. In Visual Studio, a command will also be added to the **Attributes** pane of the Properties window. A list of designer verbs can be accessed through the designer's collection property. + If the `includeAsDesignerVerb` parameter is set to `true`, then this item is also considered a ; therefore, it will be added to the component's design-time shortcut menu. In Visual Studio, a command will also be added to the **Attributes** pane of the Properties window. A list of designer verbs can be accessed through the designer's collection property. - The constructor sets the and properties to `null`. + The constructor sets the and properties to `null`. ]]> @@ -239,9 +239,9 @@ constructor sets the property to `null` and the property to `false`. + The constructor sets the property to `null` and the property to `false`. - For more information about how the `category` parameter is used to group items on a panel, see the method. + For more information about how the `category` parameter is used to group items on a panel, see the method. ]]> @@ -300,11 +300,11 @@ ; therefore, it will be added to the component's design-time shortcut menu. A list of designer verbs can be accessed through the designer's collection property. + If the `includeAsDesignerVerb` parameter is set to `true`, then the item is also considered a ; therefore, it will be added to the component's design-time shortcut menu. A list of designer verbs can be accessed through the designer's collection property. - The constructor sets the property to `null`. + The constructor sets the property to `null`. - For more information on how the `category` parameter is used to group items on a panel, see the method. + For more information on how the `category` parameter is used to group items on a panel, see the method. ]]> @@ -363,9 +363,9 @@ constructor sets the property to `false`. + The constructor sets the property to `false`. - For more information on how the `category` parameter is used to group items on a panel, see the method. + For more information on how the `category` parameter is used to group items on a panel, see the method. ]]> @@ -426,9 +426,9 @@ ; therefore, it will be added to the component's design-time shortcut menu. A list of designer verbs can be accessed through the designer's collection property. + If the `includeAsDesignerVerb` parameter is set to `true`, then this item is also considered a ; therefore, it will be added to the component's design-time shortcut menu. A list of designer verbs can be accessed through the designer's collection property. - For more information about how the `category` parameter is used to group items on a panel, see the method. + For more information about how the `category` parameter is used to group items on a panel, see the method. @@ -489,7 +489,7 @@ property is set to `true`, then the item is also considered a ; therefore, it will be added to the component's design-time shortcut menu. A list of designer verbs can be accessed through the designer's collection property. + If the property is set to `true`, then the item is also considered a ; therefore, it will be added to the component's design-time shortcut menu. A list of designer verbs can be accessed through the designer's collection property. The value of the property is set in the constructor for this class. diff --git a/xml/System.ComponentModel.Design/DesignerActionPropertyItem.xml b/xml/System.ComponentModel.Design/DesignerActionPropertyItem.xml index bec41086097..5bcbbc35e3c 100644 --- a/xml/System.ComponentModel.Design/DesignerActionPropertyItem.xml +++ b/xml/System.ComponentModel.Design/DesignerActionPropertyItem.xml @@ -49,7 +49,7 @@ ## Remarks The class represents individual items in a smart tag panel. Each item is typically associated with a property in a class that is derived from the class and supplied by the component author. The association is maintained through the name of the property, as stored in the property. - Individual panel items are associated together to form a panel by a call to the method of the class. + Individual panel items are associated together to form a panel by a call to the method of the class. To display the value of the associated property, that property must have a `get` accessor method; to allow editing, the property must have a `set` accessor method. The way in which the panel allows direct editing of a property item by the user depends on the supporting type information present for the data type of the associated property. The following table shows the likely scheme. @@ -58,7 +58,7 @@ |Has an associated type editor ()|The type editor associated with the underlying property is displayed for editing the property's value.| |Has an associated type converter to a known type ()|The type editor for the known type is displayed for editing the property's value. For example, a type converter to will likely display a .| |Boolean value|The item is displayed using a binary UI, such as a check mark.| -|None of the above.|The item is displayed as a non-editable text string using the data type's method.| +|None of the above.|The item is displayed as a non-editable text string using the data type's method.| All fundamental types, such as , and common .NET Framework data types, such as , supply standard type converters and editors. For more information about type converters, see [How to: Implement a Type Converter](https://learn.microsoft.com/previous-versions/visualstudio/visual-studio-2013/ayybcxe5(v=vs.120)) or [Generalized Type Conversion](/previous-versions/visualstudio/visual-studio-2013/yy580hbd(v=vs.120)). For more information about type editors, see [How to: Implement a UI Type Editor](/previous-versions/visualstudio/visual-studio-2013/53c49eck(v=vs.120)). @@ -137,7 +137,7 @@ constructor sets the and properties to `null`. + The constructor sets the and properties to `null`. The `memberName` parameter refers to the name of the associated property that is a member of the programmer-supplied class derived from the class. @@ -199,9 +199,9 @@ constructor sets the property to `null`. + The constructor sets the property to `null`. - For more information about how the `category` parameter is used to group items on a panel, see the method. + For more information about how the `category` parameter is used to group items on a panel, see the method. The `memberName` parameter refers to the name of the associated property that is a member of the programmer-supplied class derived from . @@ -266,7 +266,7 @@ method. + For more information about how the `category` parameter is used to group items on a panel, see the method. The `memberName` parameter refers to the name of the associated property that is a member of the programmer-supplied class derived from the class. @@ -331,7 +331,7 @@ ## Remarks The property specifies which property - in the class derived from the class - the item should be bound to. When the programmer interacts with the panel item through the user interface (UI), this associated property will be set. - is set in the constructor. Its value is case-sensitive. + is set in the constructor. Its value is case-sensitive. ]]> diff --git a/xml/System.ComponentModel.Design/DesignerActionService.xml b/xml/System.ComponentModel.Design/DesignerActionService.xml index a532c5f6932..1f71a0e4b10 100644 --- a/xml/System.ComponentModel.Design/DesignerActionService.xml +++ b/xml/System.ComponentModel.Design/DesignerActionService.xml @@ -62,17 +62,17 @@ provides a straightforward interface for accessing and manipulating the items for each component, including the following methods and events: -- The method determines whether the is currently managing a particular component. +- The method determines whether the is currently managing a particular component. -- The method supports the enumeration of the lists of items. +- The method supports the enumeration of the lists of items. -- The method allows adding a or to the set of existing items for a component instance. In contrast, the method removes one or all of the item lists associated with a component. +- The method allows adding a or to the set of existing items for a component instance. In contrast, the method removes one or all of the item lists associated with a component. > [!NOTE] - > The method represents the direct push model of associating panel items with a component. In contrast, the pull model relies on overriding the property of the designer class for that component. The design environment is responsible for adding these items into the current when a component is created on the design surface. + > The method represents the direct push model of associating panel items with a component. In contrast, the pull model relies on overriding the property of the designer class for that component. The design environment is responsible for adding these items into the current when a component is created on the design surface. > [!IMPORTANT] - > The , , , and methods only consider or affect push-model items. + > The , , , and methods only consider or affect push-model items. - The event indicates when the collection of items changes for a component. @@ -82,7 +82,7 @@ If you want a to be used both as a panel entry and a design-time shortcut menu entry, then you can set the `includeAsDesignerVerb` parameter in the item's constructor. - Use the to control the display of your designer's . + Use the to control the display of your designer's . ]]> @@ -130,7 +130,7 @@ ## Remarks A service provider is necessary for monitoring selection and component changes. It is expected to support the and types. The class uses an internal table to manage components and their associated smart tags. - Typically, component developers will not need to create an instance of this class; instead, they can acquire an existing instance through a call to the method. + Typically, component developers will not need to create an instance of this class; instead, they can acquire an existing instance through a call to the method. ]]> @@ -189,9 +189,9 @@ method represents the push model of adding smart tag items. The alternate pull model relies on overriding the property in the designer for the corresponding component. + The method represents the push model of adding smart tag items. The alternate pull model relies on overriding the property in the designer for the corresponding component. - When this method is called, the lists to be added are scanned for any with the property set to `true`. These items are added to the list of designer verbs for this component, through a call to the method. + When this method is called, the lists to be added are scanned for any with the property set to `true`. These items are added to the list of designer verbs for this component, through a call to the method. Smart tags are managed on a component instance basis. The managed collection may contain duplicate entries. @@ -246,9 +246,9 @@ method represents the push model of adding smart tag items. The alternate pull model relies on overriding the property in the designer for the corresponding component. + The method represents the push model of adding smart tag items. The alternate pull model relies on overriding the property in the designer for the corresponding component. - When this method is called, the lists to be added are scanned for any with the property set to `true`. These items are added to the list of designer verbs for this component, through a call to the method. + When this method is called, the lists to be added are scanned for any with the property set to `true`. These items are added to the list of designer verbs for this component, through a call to the method. Smart tags are managed on a component instance basis. The managed collection may contain duplicate entries. @@ -298,10 +298,10 @@ method empties the internal table used to store information about components and their push-model smart tag lists. + The method empties the internal table used to store information about components and their push-model smart tag lists. > [!CAUTION] -> Because this method affects all components managed by the current service, and not just the current component, this method should be used judiciously. Typically, the design-time tool developer uses it when resetting a design surface. Component developers should use one of the methods instead to remove individual smart tag items or lists. +> Because this method affects all components managed by the current service, and not just the current component, this method should be used judiciously. Typically, the design-time tool developer uses it when resetting a design surface. Component developers should use one of the methods instead to remove individual smart tag items or lists. A event is raised for each component that was previously managed by the current service. @@ -350,7 +350,7 @@ method only recognizes push-model smart tags, which are associated to a component with the method. + The method only recognizes push-model smart tags, which are associated to a component with the method. Although there is no structural limitation on the number of concurrent instances created by a design-time tool, typically only a single instance of the service is created per design surface. @@ -476,16 +476,16 @@ method is the implementation of the only method mandated by the interface. Call this method when you are finished using the . It performs two main actions: + The method is the implementation of the only method mandated by the interface. Call this method when you are finished using the . It performs two main actions: -- Removes the current service from the list of available services in the design environment through a call to the method. +- Removes the current service from the list of available services in the design environment through a call to the method. - Unsubscribes to component change events from the associated interface. - Call when you are finished using the . The method leaves the in an unusable state. After calling , you must release all references to the so the garbage collector can reclaim the memory that the was occupying. For more information, see [Cleaning Up Unmanaged Resources](/dotnet/standard/garbage-collection/unmanaged) and [Implementing a Dispose Method](/dotnet/standard/garbage-collection/implementing-dispose). + Call when you are finished using the . The method leaves the in an unusable state. After calling , you must release all references to the so the garbage collector can reclaim the memory that the was occupying. For more information, see [Cleaning Up Unmanaged Resources](/dotnet/standard/garbage-collection/unmanaged) and [Implementing a Dispose Method](/dotnet/standard/garbage-collection/implementing-dispose). > [!NOTE] -> Always call before you release your last reference to the . Otherwise, the resources it is using will not be freed until the garbage collector calls the object's `Finalize` method. +> Always call before you release your last reference to the . Otherwise, the resources it is using will not be freed until the garbage collector calls the object's `Finalize` method. ]]> @@ -532,9 +532,9 @@ method is the implementation of the only method mandated by the interface. Call this method when you are finished using the . It performs two main actions: + The method is the implementation of the only method mandated by the interface. Call this method when you are finished using the . It performs two main actions: -- Removes the current service from the list of available services in the design environment through a call to the method. +- Removes the current service from the list of available services in the design environment through a call to the method. - Unsubscribes to component change events from the associated interface. @@ -608,9 +608,9 @@ method is equivalent to a call to the method using a `type` parameter of . Therefore, the collection returned will contain both the push and pull lists of smart tags. + The method is equivalent to a call to the method using a `type` parameter of . Therefore, the collection returned will contain both the push and pull lists of smart tags. - The returned is the union of item lists added through the methods and also the lists obtained from the instance obtained from the component's site. + The returned is the union of item lists added through the methods and also the lists obtained from the instance obtained from the component's site. ]]> @@ -655,7 +655,7 @@ method filters on the `type` parameter, which can have one of the following values. + This version of the overloaded method filters on the `type` parameter, which can have one of the following values. |Value|Description| |-----------|-----------------| @@ -663,7 +663,7 @@ ||Pull-model smart tags only.| ||Push-model smart tags only.| - If the associated designer for a component does not supply a pull-model smart tag list, then the method will instead use the designer's design-time shortcut menu items from the property. + If the associated designer for a component does not supply a pull-model smart tag list, then the method will instead use the designer's design-time shortcut menu items from the property. ]]> @@ -715,7 +715,7 @@ method filters on the `type` parameter, which can have one of the following values. + This version of the overloaded method filters on the `type` parameter, which can have one of the following values. |Value|Description| |-----------|-----------------| @@ -723,7 +723,7 @@ ||Pull-model designer actions only.| ||Push-model designer actions only.| - If the associated designer for a component does not supply a pull-model designer action list, then the method will instead use the designer's design-time shortcut menu items from the property. + If the associated designer for a component does not supply a pull-model designer action list, then the method will instead use the designer's design-time shortcut menu items from the property. ]]> @@ -770,7 +770,7 @@ method is a helper method for the methods. searches for pull-model smart tags of type , and then adds these to the supplied `actionLists` collection. + The method is a helper method for the methods. searches for pull-model smart tags of type , and then adds these to the supplied `actionLists` collection. If the component's developer does not explicitly supply a collection of smart tags through the property of its designer, this method will reuse the design-time shortcut menu entries, which are obtained through the property of the designer. @@ -823,7 +823,7 @@ method is a helper method for the methods. It searches for push-model smart tags of type , and then adds these to the supplied `actionLists` collection. + The method is a helper method for the methods. It searches for push-model smart tags of type , and then adds these to the supplied `actionLists` collection. ]]> @@ -879,7 +879,7 @@ method is typically used by design tool developers, because component developers typically do not know what other components exist in the current design space. + This version of the method is typically used by design tool developers, because component developers typically do not know what other components exist in the current design space. If successful, this method raises the event. @@ -930,7 +930,7 @@ method raises the event. + If successful, the method raises the event. ]]> @@ -981,7 +981,7 @@ method raises the event. + If successful, the method raises the event. ]]> diff --git a/xml/System.ComponentModel.Design/DesignerActionTextItem.xml b/xml/System.ComponentModel.Design/DesignerActionTextItem.xml index fc7d30273cd..0a956647a5c 100644 --- a/xml/System.ComponentModel.Design/DesignerActionTextItem.xml +++ b/xml/System.ComponentModel.Design/DesignerActionTextItem.xml @@ -41,7 +41,7 @@ class represents individual static text items in a smart tag panel. Individual items are associated together to form a panel by returning the group from a call to the method. + The class represents individual static text items in a smart tag panel. Individual items are associated together to form a panel by returning the group from a call to the method. Most commonly, a static text item is used to create an informative label in a panel. Clicking on a static text item causes no action. The derived type is typically used to create labels to separate categories. @@ -99,9 +99,9 @@ constructor sets the property to `null`. + The constructor sets the property to `null`. - For more information about how the `category` parameter is used to group items on a panel, see the method. + For more information about how the `category` parameter is used to group items on a panel, see the method. diff --git a/xml/System.ComponentModel.Design/DesignerActionUIService.xml b/xml/System.ComponentModel.Design/DesignerActionUIService.xml index 056f18605f3..011ed624726 100644 --- a/xml/System.ComponentModel.Design/DesignerActionUIService.xml +++ b/xml/System.ComponentModel.Design/DesignerActionUIService.xml @@ -51,9 +51,9 @@ with the class. provides a straightforward interface for displaying the items for each component, including the following methods and events: + You can control the display of your designer's with the class. provides a straightforward interface for displaying the items for each component, including the following methods and events: -- The and methods display and hide the items for a component. +- The and methods display and hide the items for a component. - The event indicates when the UI changes for a component. @@ -62,7 +62,7 @@ ## Examples - The following code example demonstrates how to use the method to update a smart tag panel. This example is part of a larger example available in the class overview. + The following code example demonstrates how to use the method to update a smart tag panel. This example is part of a larger example available in the class overview. :::code language="csharp" source="~/snippets/csharp/System.ComponentModel.Design/DesignerActionHeaderItem/Overview/designeractions.cs" id="Snippet11"::: :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel.Design/DesignerActionHeaderItem/Overview/designeractions.vb" id="Snippet11"::: @@ -167,10 +167,10 @@ when you are finished using the . The method leaves the in an unusable state. After calling , you must release all references to the so the garbage collector can reclaim the memory that the was occupying. For more information, see [Cleaning Up Unmanaged Resources](/dotnet/standard/garbage-collection/unmanaged) and [Implementing a Dispose Method](/dotnet/standard/garbage-collection/implementing-dispose). + Call when you are finished using the . The method leaves the in an unusable state. After calling , you must release all references to the so the garbage collector can reclaim the memory that the was occupying. For more information, see [Cleaning Up Unmanaged Resources](/dotnet/standard/garbage-collection/unmanaged) and [Implementing a Dispose Method](/dotnet/standard/garbage-collection/implementing-dispose). > [!NOTE] -> Always call before you release your last reference to the . Otherwise, the resources it is using will not be freed until the garbage collector calls the object's `Finalize` method. +> Always call before you release your last reference to the . Otherwise, the resources it is using will not be freed until the garbage collector calls the object's `Finalize` method. ]]> @@ -214,10 +214,10 @@ method will hide it. This method raises the event, stipulating as the event type. + If the smart tag panel is currently being displayed, the method will hide it. This method raises the event, stipulating as the event type. > [!NOTE] -> The and methods are implemented only to raise their corresponding events. The actual functionality is found in the handlers for these events, which are part of the design-time environment. +> The and methods are implemented only to raise their corresponding events. The actual functionality is found in the handlers for these events, which are part of the design-time environment. ]]> @@ -265,12 +265,12 @@ method updates the internal `DesignerAction` , as well as the smart tag panel. + The method updates the internal `DesignerAction` , as well as the smart tag panel. ## Examples - The following code example demonstrates how to use the method to update a smart tag panel. This example is part of a larger example available in the class overview. + The following code example demonstrates how to use the method to update a smart tag panel. This example is part of a larger example available in the class overview. :::code language="csharp" source="~/snippets/csharp/System.ComponentModel.Design/DesignerActionHeaderItem/Overview/designeractions.cs" id="Snippet11"::: :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel.Design/DesignerActionHeaderItem/Overview/designeractions.vb" id="Snippet11"::: @@ -356,10 +356,10 @@ method will display the panel. This method raises the event, stipulating as the event type. + If the smart tag panel is currently hidden, the method will display the panel. This method raises the event, stipulating as the event type. > [!NOTE] -> The and methods are implemented only to raise their corresponding events. The actual functionality is found in the handlers for these events, which are part of the design-time environment. +> The and methods are implemented only to raise their corresponding events. The actual functionality is found in the handlers for these events, which are part of the design-time environment. ]]> diff --git a/xml/System.ComponentModel.Design/DesignerActionUIStateChangeEventArgs.xml b/xml/System.ComponentModel.Design/DesignerActionUIStateChangeEventArgs.xml index f101d141ff7..a412efb6d2e 100644 --- a/xml/System.ComponentModel.Design/DesignerActionUIStateChangeEventArgs.xml +++ b/xml/System.ComponentModel.Design/DesignerActionUIStateChangeEventArgs.xml @@ -47,7 +47,7 @@ event occurs when a smart tag panel is displayed or hidden. This event is not generated directly by the panel but rather by the class when its and methods are executed. + A event occurs when a smart tag panel is displayed or hidden. This event is not generated directly by the panel but rather by the class when its and methods are executed. ]]> @@ -151,7 +151,7 @@ method, this property has a value of . If the panel is being shown through a call to , this property has a value of . + If the panel is being hidden through a call to the method, this property has a value of . If the panel is being shown through a call to , this property has a value of . ]]> diff --git a/xml/System.ComponentModel.Design/DesignerCommandSet.xml b/xml/System.ComponentModel.Design/DesignerCommandSet.xml index 31767e26c81..538fb762b32 100644 --- a/xml/System.ComponentModel.Design/DesignerCommandSet.xml +++ b/xml/System.ComponentModel.Design/DesignerCommandSet.xml @@ -47,15 +47,15 @@ class provides the and properties to query for the and collections, respectively. However, if a design-time tool author decides not to derive from this class, the class represents an alternative base class to provide this functionality. + The class provides the and properties to query for the and collections, respectively. However, if a design-time tool author decides not to derive from this class, the class represents an alternative base class to provide this functionality. The class contains only three members, described in the following table. |Public member|Description| |-------------------|-----------------| -||Returns the collection of either the smart tags or designer verbs associated with the designed component. The base implementation returns `null`.| -||Gets the collection of all the smart tags associated with the designed component. The base implementation simply calls .| -||Gets the collection of all the designer verbs associated with the designed component. The base implementation simply calls .| +||Returns the collection of either the smart tags or designer verbs associated with the designed component. The base implementation returns `null`.| +||Gets the collection of all the smart tags associated with the designed component. The base implementation simply calls .| +||Gets the collection of all the designer verbs associated with the designed component. The base implementation simply calls .| A should be added as a site-specific service. Externally, a service of this type should first be queried to discover smart tag and designer verb functionality. If this service is not found, then the property should be used instead. This procedure provides a path for backwards compatibility. @@ -143,7 +143,7 @@ with the string parameter "ActionLists". + The base implementation simply calls with the string parameter "ActionLists". ]]> @@ -191,7 +191,7 @@ and properties specify the following values and meanings for this parameter. + Although the base implementation always returns `null`, the overridden version supplied by the programmer should return a collection of command objects of the type described by `name`. The base implementation of the and properties specify the following values and meanings for this parameter. |String|Meaning| |------------|-------------| @@ -241,7 +241,7 @@ with the string parameter "Verbs". + The base implementation simply calls with the string parameter "Verbs". ]]> diff --git a/xml/System.ComponentModel.Design/DesignerOptionService+DesignerOptionCollection.xml b/xml/System.ComponentModel.Design/DesignerOptionService+DesignerOptionCollection.xml index c8eca59b20d..7dfaf40ea6f 100644 --- a/xml/System.ComponentModel.Design/DesignerOptionService+DesignerOptionCollection.xml +++ b/xml/System.ComponentModel.Design/DesignerOptionService+DesignerOptionCollection.xml @@ -554,7 +554,7 @@ objects are taken directly from the value passed to the method and are wrapped in an additional property descriptor that hides the value object from the user. This means that any value may be passed into the `component` parameter of the various methods. The value is not recognized and is replaced with the correct value internally. + objects are taken directly from the value passed to the method and are wrapped in an additional property descriptor that hides the value object from the user. This means that any value may be passed into the `component` parameter of the various methods. The value is not recognized and is replaced with the correct value internally. ]]> diff --git a/xml/System.ComponentModel.Design/DesignerOptionService.xml b/xml/System.ComponentModel.Design/DesignerOptionService.xml index 21b665527e5..9cbd3d027b9 100644 --- a/xml/System.ComponentModel.Design/DesignerOptionService.xml +++ b/xml/System.ComponentModel.Design/DesignerOptionService.xml @@ -74,7 +74,7 @@ :::code language="csharp" source="~/snippets/csharp/System.ComponentModel.Design/DesignerOptionService/Overview/idesigneroptionservicecontrol.cs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel.Design/DesignerOptionService/Overview/idesigneroptionservicecontrol.vb" id="Snippet2"::: - This works, until you want to move to another page. Also, provides no discovery mechanism. If you do not know what string to pass in, the service cannot find the property value. + This works, until you want to move to another page. Also, provides no discovery mechanism. If you do not know what string to pass in, the service cannot find the property value. The class addresses these issues. You can query collections, and there is a type converter defined on the object that marks the collection as expandable. With this type converter, you can pass the entire designer option service to a property window and visually inspect the service. @@ -185,7 +185,7 @@ collection of the option collection. The `value` parameter can be `null` if this options collection does not offer any properties. Properties are wrapped in such a way that passing anything into the component parameter of the is ignored, and the `value` object is substituted. + The `value` parameter specifies an object whose public properties are used in the collection of the option collection. The `value` parameter can be `null` if this options collection does not offer any properties. Properties are wrapped in such a way that passing anything into the component parameter of the is ignored, and the `value` object is substituted. ]]> @@ -300,9 +300,9 @@ method is called on demand the first time a user asks for child options or properties of an options collection. + The method is called on demand the first time a user asks for child options or properties of an options collection. - You can populate the `options` collection by calling the method and passing this collection as the parent. + You can populate the `options` collection by calling the method and passing this collection as the parent. ]]> @@ -359,7 +359,7 @@ method must be implemented for the `optionObject` parameter's options dialog box to be shown. + The method must be implemented for the `optionObject` parameter's options dialog box to be shown. ]]> diff --git a/xml/System.ComponentModel.Design/DesignerTransaction.xml b/xml/System.ComponentModel.Design/DesignerTransaction.xml index 4e624052754..e4819d1c387 100644 --- a/xml/System.ComponentModel.Design/DesignerTransaction.xml +++ b/xml/System.ComponentModel.Design/DesignerTransaction.xml @@ -65,20 +65,20 @@ To use transactions for reversible or multiple operations, have your designer create a for each operation or series of operations which should be reversible. Be careful not to perform actions outside the transactions that might prevent a sequence of undo events from completing successfully. - You can obtain a new by calling the method of an . Be sure to obtain each from the active in order to correctly integrate with the designer transaction processing mechanism, rather than creating a new directly. + You can obtain a new by calling the method of an . Be sure to obtain each from the active in order to correctly integrate with the designer transaction processing mechanism, rather than creating a new directly. - To perform an action within a transaction, you must first create a transaction. Then you must call the method before each change or set of changes occurs, and the method after each change or set of changes occur. Finally, complete and close the transaction by calling the method. + To perform an action within a transaction, you must first create a transaction. Then you must call the method before each change or set of changes occurs, and the method after each change or set of changes occur. Finally, complete and close the transaction by calling the method. > [!NOTE] -> When making changes to property values, use the method of a , which calls the component change methods of the and creates a representing the change automatically. +> When making changes to property values, use the method of a , which calls the component change methods of the and creates a representing the change automatically. To perform a transaction, complete the following steps: -1. Call to obtain a that can be used to control the transaction. +1. Call to obtain a that can be used to control the transaction. -2. Within a `try` block, for each action that you want to track with a , call the method, make the change or changes, then call the method to signal that the change or changes have been made. +2. Within a `try` block, for each action that you want to track with a , call the method, make the change or changes, then call the method to signal that the change or changes have been made. -3. To complete the transaction, call from within a `finally` block. +3. To complete the transaction, call from within a `finally` block. In C#, you can use the `using` statement rather than a `try/finally` block, such as in the following example. @@ -88,7 +88,7 @@ using (host.CreateTransaction() { } ``` - To cancel and attempt to roll back a transaction before it has been committed, call the method. When the method is invoked, the actions tracked by the are reversed to attempt to roll back the changes. To undo actions that occurred as part of earlier transactions, you must use the undo command provided by the development environment. + To cancel and attempt to roll back a transaction before it has been committed, call the method. When the method is invoked, the actions tracked by the are reversed to attempt to roll back the changes. To undo actions that occurred as part of earlier transactions, you must use the undo command provided by the development environment. ## Examples The following code example program demonstrates how to create a from a designer. To run this sample, compile the source code into a class library. You must add a reference to the System.Design assembly. In a new project, add a reference to the compiled DLL and add the component in the library to the **Toolbox**. @@ -601,9 +601,9 @@ using (host.CreateTransaction() { and cleans up resources by calling `Dispose(false)`. Override `Dispose(Boolean)` to customize the cleanup. + This method overrides and cleans up resources by calling `Dispose(false)`. Override `Dispose(Boolean)` to customize the cleanup. - Application code should not call this method; an object's `Finalize` method is automatically invoked during garbage collection, unless finalization by the garbage collector has been disabled by a call to the method. + Application code should not call this method; an object's `Finalize` method is automatically invoked during garbage collection, unless finalization by the garbage collector has been disabled by a call to the method. For more information, see [Finalize Methods and Destructors](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/0s71x931(v%3dvs.100)), [Cleaning Up Unmanaged Resources](/dotnet/standard/garbage-collection/unmanaged), and [Overriding the Finalize Method](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/ddae83kx(v=vs.100)). diff --git a/xml/System.ComponentModel.Design/DesignerVerbCollection.xml b/xml/System.ComponentModel.Design/DesignerVerbCollection.xml index 1259868b8d9..814ec44dffb 100644 --- a/xml/System.ComponentModel.Design/DesignerVerbCollection.xml +++ b/xml/System.ComponentModel.Design/DesignerVerbCollection.xml @@ -56,20 +56,20 @@ Represents a collection of objects. - objects. - - - -## Examples - The following code example demonstrates how to use the class. The example creates a new instance of the class and uses several methods to add statements to the collection, return their index, and add or remove attributes at a specific index point. - + objects. + + + +## Examples + The following code example demonstrates how to use the class. The example creates a new instance of the class and uses several methods to add statements to the collection, return their index, and add or remove attributes at a specific index point. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/DesignerVerbCollectionExample/CPP/class1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel.Design/DesignerVerbCollection/Overview/class1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel.Design/DesignerVerbCollection/Overview/class1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel.Design/DesignerVerbCollection/Overview/class1.vb" id="Snippet1"::: + ]]> @@ -126,20 +126,20 @@ Initializes a new instance of the class. - . - + . + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/DesignerVerbCollectionExample/CPP/class1.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel.Design/DesignerVerbCollection/Overview/class1.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel.Design/DesignerVerbCollection/Overview/class1.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel.Design/DesignerVerbCollection/Overview/class1.vb" id="Snippet2"::: + ]]> @@ -233,15 +233,15 @@ Adds the specified to the collection. The index in the collection at which the verb was added. - to a . - + to a . + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/DesignerVerbCollectionExample/CPP/class1.cpp" id="Snippet3"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel.Design/DesignerVerbCollection/Overview/class1.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel.Design/DesignerVerbCollection/Overview/class1.vb" id="Snippet3"::: - + :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel.Design/DesignerVerbCollection/Overview/class1.vb" id="Snippet3"::: + ]]> @@ -307,15 +307,15 @@ An array of objects to add to the collection. Adds the specified set of designer verbs to the collection. - objects to a . - + objects to a . + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/DesignerVerbCollectionExample/CPP/class1.cpp" id="Snippet4"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel.Design/DesignerVerbCollection/Overview/class1.cs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel.Design/DesignerVerbCollection/Overview/class1.vb" id="Snippet4"::: - + :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel.Design/DesignerVerbCollection/Overview/class1.vb" id="Snippet4"::: + ]]> @@ -365,15 +365,15 @@ A to add to the collection. Adds the specified collection of designer verbs to the collection. - objects to a . - + objects to a . + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/DesignerVerbCollectionExample/CPP/class1.cpp" id="Snippet4"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel.Design/DesignerVerbCollection/Overview/class1.cs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel.Design/DesignerVerbCollection/Overview/class1.vb" id="Snippet4"::: - + :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel.Design/DesignerVerbCollection/Overview/class1.vb" id="Snippet4"::: + ]]> @@ -426,15 +426,15 @@ if the specified object exists in the collection; otherwise, . - method to search for the presence of a specific object and subsequently retrieves the index value at which it was found. - + method to search for the presence of a specific object and subsequently retrieves the index value at which it was found. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/DesignerVerbCollectionExample/CPP/class1.cpp" id="Snippet5"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel.Design/DesignerVerbCollection/Overview/class1.cs" id="Snippet5"::: - :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel.Design/DesignerVerbCollection/Overview/class1.vb" id="Snippet5"::: - + :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel.Design/DesignerVerbCollection/Overview/class1.vb" id="Snippet5"::: + ]]> @@ -492,15 +492,15 @@ The destination index to begin copying to. Copies the collection members to the specified array beginning at the specified destination index. - objects to an array. - + objects to an array. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/DesignerVerbCollectionExample/CPP/class1.cpp" id="Snippet6"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel.Design/DesignerVerbCollection/Overview/class1.cs" id="Snippet6"::: - :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel.Design/DesignerVerbCollection/Overview/class1.vb" id="Snippet6"::: - + :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel.Design/DesignerVerbCollection/Overview/class1.vb" id="Snippet6"::: + ]]> @@ -550,15 +550,15 @@ Gets the index of the specified . The index of the specified object if it is found in the list; otherwise, -1. - in a . - + in a . + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/DesignerVerbCollectionExample/CPP/class1.cpp" id="Snippet5"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel.Design/DesignerVerbCollection/Overview/class1.cs" id="Snippet5"::: - :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel.Design/DesignerVerbCollection/Overview/class1.vb" id="Snippet5"::: - + :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel.Design/DesignerVerbCollection/Overview/class1.vb" id="Snippet5"::: + ]]> @@ -609,15 +609,15 @@ The to insert in the collection. Inserts the specified at the specified index. - into a at index 0. - + into a at index 0. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/DesignerVerbCollectionExample/CPP/class1.cpp" id="Snippet8"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel.Design/DesignerVerbCollection/Overview/class1.cs" id="Snippet8"::: - :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel.Design/DesignerVerbCollection/Overview/class1.vb" id="Snippet8"::: - + :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel.Design/DesignerVerbCollection/Overview/class1.vb" id="Snippet8"::: + ]]> @@ -703,11 +703,11 @@ Raises the event. - @@ -751,11 +751,11 @@ The object to insert. Raises the event. - @@ -799,11 +799,11 @@ The object to remove. Raises the event. - @@ -849,11 +849,11 @@ The new object. Raises the event. - @@ -901,11 +901,11 @@ The object to validate. Raises the event. - @@ -954,15 +954,15 @@ The to remove from the collection. Removes the specified from the collection. - from a . - + from a . + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/DesignerVerbCollectionExample/CPP/class1.cpp" id="Snippet9"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel.Design/DesignerVerbCollection/Overview/class1.cs" id="Snippet9"::: - :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel.Design/DesignerVerbCollection/Overview/class1.vb" id="Snippet9"::: - + :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel.Design/DesignerVerbCollection/Overview/class1.vb" id="Snippet9"::: + ]]> diff --git a/xml/System.ComponentModel.Design/EventBindingService.xml b/xml/System.ComponentModel.Design/EventBindingService.xml index 34d2d5848a7..a36425bd2cf 100644 --- a/xml/System.ComponentModel.Design/EventBindingService.xml +++ b/xml/System.ComponentModel.Design/EventBindingService.xml @@ -139,7 +139,7 @@ method must be compatible with the script language being used and it must not conflict with any other name in your code. + The name returned by the method must be compatible with the script language being used and it must not conflict with any other name in your code. ]]> @@ -191,7 +191,7 @@ and , an implementation can infer when a method is no longer needed. + Some implementations may intend to remove the event handler when no events are using it. By overriding and , an implementation can infer when a method is no longer needed. ]]> @@ -238,7 +238,7 @@ should return an empty collection if no names are compatible. + Each string returned in the collection is the method name of a method whose signature is compatible with the delegate contained in `e`. should return an empty collection if no names are compatible. ]]> @@ -332,7 +332,7 @@ method does not display any particular code; generally it displays the last code the user typed. + The method does not display any particular code; generally it displays the last code the user typed. ]]> @@ -426,7 +426,7 @@ method displays the body of the user code with the given method name. + The method displays the body of the user code with the given method name. ]]> @@ -520,7 +520,7 @@ should return an empty collection if no names are compatible. + Each string returned in the collection is the method name of a method whose signature is compatible with the delegate contained in `e`. should return an empty collection if no names are compatible. ]]> @@ -849,7 +849,7 @@ This member is an explicit interface member implementation. It can be used only and , an implementation can infer when a method is no longer needed. + Some implementations may intend to remove the event handler when no events are using it. By overriding and , an implementation can infer when a method is no longer needed. ]]> diff --git a/xml/System.ComponentModel.Design/IComponentChangeService.xml b/xml/System.ComponentModel.Design/IComponentChangeService.xml index f5e7b230848..fb7c87dc0f8 100644 --- a/xml/System.ComponentModel.Design/IComponentChangeService.xml +++ b/xml/System.ComponentModel.Design/IComponentChangeService.xml @@ -71,7 +71,7 @@ Typically, the design environment raises these component add, change, remove, or rename events. Designers should call the methods of this interface when using objects to provide undo and redo functionality for design-time actions that affect components. More information is available in the documentation for . Generally, only the root designer handles these change notifications. - This service also provides methods that raise a component changed event or component changing event. A or a component can indicate that a component has changed or is changing with the and methods, respectively. + This service also provides methods that raise a component changed event or component changing event. A or a component can indicate that a component has changed or is changing with the and methods, respectively. @@ -509,7 +509,7 @@ Most designers that ship with the Windows SDK, as well as the Visual Studio design-time environment, typically raise this event for you when a component in a project is changed, so most of the time you do not need to explicitly call this method. The appropriate events are automatically raised when a is used to change a property value or components are added or removed from the container. - Before calling , first call to indicate that a component is about to change, and make the change. Then call to raise the event. + Before calling , first call to indicate that a component is about to change, and make the change. Then call to raise the event. ]]> diff --git a/xml/System.ComponentModel.Design/IComponentDesignerDebugService.xml b/xml/System.ComponentModel.Design/IComponentDesignerDebugService.xml index e25d75e927f..d8a7fe764a8 100644 --- a/xml/System.ComponentModel.Design/IComponentDesignerDebugService.xml +++ b/xml/System.ComponentModel.Design/IComponentDesignerDebugService.xml @@ -47,7 +47,7 @@ method enables a designer to assert on a condition inside a design-time environment. + The method enables a designer to assert on a condition inside a design-time environment. ]]> @@ -81,7 +81,7 @@ method enables a designer to log failure messages inside a design-time environment. + The method enables a designer to log failure messages inside a design-time environment. ]]> @@ -179,7 +179,7 @@ method enables a designer to log debug messages inside a design-time environment. + The method enables a designer to log debug messages inside a design-time environment. ]]> diff --git a/xml/System.ComponentModel.Design/IComponentDiscoveryService.xml b/xml/System.ComponentModel.Design/IComponentDiscoveryService.xml index 6dd7a83130c..efe41ad1475 100644 --- a/xml/System.ComponentModel.Design/IComponentDiscoveryService.xml +++ b/xml/System.ComponentModel.Design/IComponentDiscoveryService.xml @@ -43,21 +43,21 @@ Enables enumeration of components at design time. - interface enables design-time enumeration of components in the Toolbox. - - You could provide a custom implementation that enumerates across other types available at design time. For example, your implementation could enumerate the components that are present in a particular designer. - - - -## Examples - The following code example demonstrates how to use to find all the types that derive from the type. - + interface enables design-time enumeration of components in the Toolbox. + + You could provide a custom implementation that enumerates across other types available at design time. For example, your implementation could enumerate the components that are present in a particular designer. + + + +## Examples + The following code example demonstrates how to use to find all the types that derive from the type. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/TypeDescriptor/GetProperties/Form1.cs" id="Snippet13"::: - :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/TypeDescriptor/GetProperties/Form1.vb" id="Snippet13"::: - + :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/TypeDescriptor/GetProperties/Form1.vb" id="Snippet13"::: + ]]> @@ -116,23 +116,23 @@ Gets the list of available component types. The list of available component types. - method retrieves the list of available component types, which are types implementing the interface. If the `baseType` parameter is `null`, all components are retrieved; otherwise, only component types derived from `baseType` are returned. - - When you pass in a value for the `designerHost` parameter, type resolution is scoped to `designerHost`. This means that if there is a whose type is on disk, and not in the global assembly cache, its type will fail to load through `designerHost`. - - If you pass in `null` for `designerHost`, it returns all types that can be queried from the global assembly cache or the method. - - - -## Examples - The following code example demonstrates how to use the method to find all the types that derive from the type. - + method retrieves the list of available component types, which are types implementing the interface. If the `baseType` parameter is `null`, all components are retrieved; otherwise, only component types derived from `baseType` are returned. + + When you pass in a value for the `designerHost` parameter, type resolution is scoped to `designerHost`. This means that if there is a whose type is on disk, and not in the global assembly cache, its type will fail to load through `designerHost`. + + If you pass in `null` for `designerHost`, it returns all types that can be queried from the global assembly cache or the method. + + + +## Examples + The following code example demonstrates how to use the method to find all the types that derive from the type. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/TypeDescriptor/GetProperties/Form1.cs" id="Snippet13"::: - :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/TypeDescriptor/GetProperties/Form1.vb" id="Snippet13"::: - + :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/TypeDescriptor/GetProperties/Form1.vb" id="Snippet13"::: + ]]> diff --git a/xml/System.ComponentModel.Design/IComponentInitializer.xml b/xml/System.ComponentModel.Design/IComponentInitializer.xml index fd2dbe64ae1..80be12c27ef 100644 --- a/xml/System.ComponentModel.Design/IComponentInitializer.xml +++ b/xml/System.ComponentModel.Design/IComponentInitializer.xml @@ -48,7 +48,7 @@ ## Remarks The interface can be implemented by any designer, which is a component that also implements , which receives a recommended set of default values for the component it is designing. is queried during new component creation. Recommended default values for the component's properties are passed in as name/value pairs in a dictionary. - This design provides two customization points: the toolbox item itself can be replaced or changed to perform custom actions, or the designer for a component can be changed to provide a custom action. A designer that implements should not depend on either of its methods - or - being called, because toolbox items are not obligated to call these methods. + This design provides two customization points: the toolbox item itself can be replaced or changed to perform custom actions, or the designer for a component can be changed to provide a custom action. A designer that implements should not depend on either of its methods - or - being called, because toolbox items are not obligated to call these methods. For an overview of creating design components, see [Extending Design-Time Support](https://learn.microsoft.com/previous-versions/visualstudio/visual-studio-2010/37899azc(v=vs.100)). @@ -106,7 +106,7 @@ method is called when a designer will re-initialize an existing component. For example, is commonly called after a drag-and-drop operation. The `defaultValues` parameter is a dictionary containing name/value pairs of default values that should be applied to properties of the associated component. This dictionary may be `null` if no default values have been specified. + The method is called when a designer will re-initialize an existing component. For example, is commonly called after a drag-and-drop operation. The `defaultValues` parameter is a dictionary containing name/value pairs of default values that should be applied to properties of the associated component. This dictionary may be `null` if no default values have been specified. > [!CAUTION] > When implementing this method, generally you should not modify the component properties beyond those recommendations found in `defaultValue`. The existing component may already have had its properties set by the user or other design-time code. @@ -163,7 +163,7 @@ method is called after a new component is created. It is typically called by the toolbox item itself and is used to configure the component's default values. + The method is called after a new component is created. It is typically called by the toolbox item itself and is used to configure the component's default values. This dictionary may be `null` if no default values are specified. If the dictionary is `null`, the component properties should be left in their implicit default states. diff --git a/xml/System.ComponentModel.Design/IDesigner.xml b/xml/System.ComponentModel.Design/IDesigner.xml index ab4293b2628..9aba499e152 100644 --- a/xml/System.ComponentModel.Design/IDesigner.xml +++ b/xml/System.ComponentModel.Design/IDesigner.xml @@ -61,11 +61,11 @@ The interface provides methods and properties that you can implement in order to provide custom behavior at design time. - Implement the method of a designer to perform actions when a component is created. This can be useful if a component should have a special configuration at design-time, or if its configuration should change depending on conditions that the designer can determine. + Implement the method of a designer to perform actions when a component is created. This can be useful if a component should have a special configuration at design-time, or if its configuration should change depending on conditions that the designer can determine. A designer can provide menu commands on the shortcut menu that is displayed when a user right-clicks a component or control in the design-time environment. You can implement the property to define a get accessor that returns a containing the objects for generating menu commands. - A designer for a component that appears in the component tray can perform a default action when the component is double-clicked. Implement the method to specify the behavior to perform when the component is double-clicked. + A designer for a component that appears in the component tray can perform a default action when the component is double-clicked. Implement the method to specify the behavior to perform when the component is double-clicked. A designer can also use the available design-time services to perform a variety of tasks, including surveying the current design-time environment for components and their properties, reading and setting the values of properties of components, managing the toolbox, managing selected components, or displaying a user interface that can be used to configure values or to apply further processing. diff --git a/xml/System.ComponentModel.Design/IDesignerFilter.xml b/xml/System.ComponentModel.Design/IDesignerFilter.xml index 1a9b5d24fa0..c0d577f94e9 100644 --- a/xml/System.ComponentModel.Design/IDesignerFilter.xml +++ b/xml/System.ComponentModel.Design/IDesignerFilter.xml @@ -49,14 +49,14 @@ ## Remarks enables a designer to filter the set of property, attribute, and event descriptors that its associated component exposes through a . The methods of this interface whose names begin with `Pre` are called immediately before the methods whose names begin with `Post`. - If you want to add attribute, event, or property descriptors, use a , , or method. + If you want to add attribute, event, or property descriptors, use a , , or method. - If you want to change or remove attribute, event, or property descriptors, use a , , or method. + If you want to change or remove attribute, event, or property descriptors, use a , , or method. ## Examples - The following example demonstrates an override of that adds a property of the designer to the Properties window when the designer's control is selected at design time. See the example for the class for a complete designer example that uses the interface. + The following example demonstrates an override of that adds a property of the designer to the Properties window when the designer's control is selected at design time. See the example for the class for a complete designer example that uses the interface. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/ControlDesignerExample/CPP/controldesignerexample.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel.Design/IDesignerFilter/Overview/controldesignerexample.cs" id="Snippet2"::: @@ -116,11 +116,11 @@ ## Remarks This method provides a way to change or remove items within the dictionary of attributes that the associated component of the designer implementing this interface exposes through a . - The keys in the dictionary of attributes are the type IDs of the attributes. The objects are of type . This method is called immediately after . + The keys in the dictionary of attributes are the type IDs of the attributes. The objects are of type . This method is called immediately after . - The type ID of an attribute can be any object. By default, returns its as the value of its property. You can check the of an attribute in the dictionary for equivalence with a known for an attribute to identify it, or use to identify the attribute object itself. + The type ID of an attribute can be any object. By default, returns its as the value of its property. You can check the of an attribute in the dictionary for equivalence with a known for an attribute to identify it, or use to identify the attribute object itself. - When an attribute that has the same as an existing or inherited attribute is added to a component, the new attribute replaces the old attribute. For many attributes, a new attribute of the same type will replace any previous attribute of the type. However, some types of attributes return a that distinguishes the attribute selectively. For example, in order to provide different types of simultaneously active designers for a type, such as an and an , the class returns a that uniquely identifies both the attribute and the base designer type. The constructor allows you to specify the base designer type of the designer in addition to its specific type, and returns a that reflects this. Therefore when you add a new with a base designer type of the same type as the base designer type of an existing , the old attribute is replaced with the new attribute. + When an attribute that has the same as an existing or inherited attribute is added to a component, the new attribute replaces the old attribute. For many attributes, a new attribute of the same type will replace any previous attribute of the type. However, some types of attributes return a that distinguishes the attribute selectively. For example, in order to provide different types of simultaneously active designers for a type, such as an and an , the class returns a that uniquely identifies both the attribute and the base designer type. The constructor allows you to specify the base designer type of the designer in addition to its specific type, and returns a that reflects this. Therefore when you add a new with a base designer type of the same type as the base designer type of an existing , the old attribute is replaced with the new attribute. ]]> @@ -178,7 +178,7 @@ ## Remarks This method provides a way to change or remove items within the dictionary of events that are exposed through a . - The keys in the dictionary of events are the names of the events. The objects are of type . This method is called immediately after . + The keys in the dictionary of events are the names of the events. The objects are of type . This method is called immediately after . ]]> @@ -236,7 +236,7 @@ ## Remarks This method provides a way to change or remove items within the dictionary of properties that are exposed through a . - The keys in the dictionary of properties are the names of the properties. The objects are of type . This method is called immediately after . + The keys in the dictionary of properties are the names of the properties. The objects are of type . This method is called immediately after . ]]> @@ -294,11 +294,11 @@ ## Remarks This method provides a way to add items to the dictionary of attributes that the associated component of the designer implementing this interface exposes through a . - The keys in the dictionary of attributes are the type IDs of the attributes. The objects are of type . This method is called immediately before . + The keys in the dictionary of attributes are the type IDs of the attributes. The objects are of type . This method is called immediately before . - The type ID of an attribute can be any object. By default, returns its as the value of its property. You can check the of an attribute in the dictionary for equivalence with a known for an attribute to identify it, or use to identify the attribute object itself. + The type ID of an attribute can be any object. By default, returns its as the value of its property. You can check the of an attribute in the dictionary for equivalence with a known for an attribute to identify it, or use to identify the attribute object itself. - When an attribute that has the same as an existing or inherited attribute is added to a component, the new attribute replaces the old attribute. For many attributes, a new attribute of the same type will replace any previous attribute of the type. However, some types of attributes return a that distinguishes the attribute selectively. For example, in order to provide different types of simultaneously active designers for a type, such as an and an , the class returns a that uniquely identifies both the attribute and the base designer type. The constructor allows you to specify the base designer type of the designer in addition to its specific type, and returns a that reflects this. Therefore when you add a new with a base designer type of the same type as the base designer type of an existing , the old attribute is replaced with the new attribute. + When an attribute that has the same as an existing or inherited attribute is added to a component, the new attribute replaces the old attribute. For many attributes, a new attribute of the same type will replace any previous attribute of the type. However, some types of attributes return a that distinguishes the attribute selectively. For example, in order to provide different types of simultaneously active designers for a type, such as an and an , the class returns a that uniquely identifies both the attribute and the base designer type. The constructor allows you to specify the base designer type of the designer in addition to its specific type, and returns a that reflects this. Therefore when you add a new with a base designer type of the same type as the base designer type of an existing , the old attribute is replaced with the new attribute. ]]> @@ -356,7 +356,7 @@ ## Remarks This method provides a way to add items to the dictionary of events that a designer exposes through a . - The keys in the dictionary of events are the names of the events. The objects are of type . This method is called immediately before . + The keys in the dictionary of events are the names of the events. The objects are of type . This method is called immediately before . ]]> @@ -414,7 +414,7 @@ ## Remarks This method provides a way to add items to the dictionary of properties that a designer exposes through a . - The keys in the dictionary of properties are the names of the properties. The objects are of type . This method is called immediately before . + The keys in the dictionary of properties are the names of the properties. The objects are of type . This method is called immediately before . ]]> diff --git a/xml/System.ComponentModel.Design/IDesignerHost.xml b/xml/System.ComponentModel.Design/IDesignerHost.xml index a67a89c8e82..85ad038e0d1 100644 --- a/xml/System.ComponentModel.Design/IDesignerHost.xml +++ b/xml/System.ComponentModel.Design/IDesignerHost.xml @@ -277,7 +277,7 @@ contains the components of the current design mode document. You can list or access any of the components of the current design mode document through the member of this . + This contains the components of the current design mode document. You can list or access any of the components of the current design mode document through the member of this . ]]> @@ -1103,7 +1103,7 @@ . + The description is the last description specified with . ]]> @@ -1208,7 +1208,7 @@ ## Remarks This event occurs when a transaction is about to begin. - This method allows designer host clients to perform operations before other handlers are notified that a transaction has begun. The specified handler is called only when the first call to is made. Subsequent calls do not generate this event until all transaction objects have been disposed. + This method allows designer host clients to perform operations before other handlers are notified that a transaction has begun. The specified handler is called only when the first call to is made. Subsequent calls do not generate this event until all transaction objects have been disposed. ]]> diff --git a/xml/System.ComponentModel.Design/IDesignerOptionService.xml b/xml/System.ComponentModel.Design/IDesignerOptionService.xml index 2bc7b26e292..f9cf7e7bb3e 100644 --- a/xml/System.ComponentModel.Design/IDesignerOptionService.xml +++ b/xml/System.ComponentModel.Design/IDesignerOptionService.xml @@ -44,20 +44,20 @@ Provides access to the designer options located on the **Tools** menu under the **Options** command in the Visual Studio development environment. - provides an interface that can be used to retrieve and update the values of the Windows Forms Designer options, which are listed within the dialog displayed by the **Options** command of the **Tools** menu of the Visual Studio development environment. The method retrieves the value of a specified option. The method sets a specified value for a specified option. - - - -## Examples - The following code example demonstrates accessing the to display the current values of the standard options. - + provides an interface that can be used to retrieve and update the values of the Windows Forms Designer options, which are listed within the dialog displayed by the **Options** command of the **Tools** menu of the Visual Studio development environment. The method retrieves the value of a specified option. The method sets a specified value for a specified option. + + + +## Examples + The following code example demonstrates accessing the to display the current values of the standard options. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/IDesignerOptionServiceExample/CPP/idesigneroptionservicecontrol.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel.Design/DesignerOptionService/Overview/idesigneroptionservicecontrol.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel.Design/DesignerOptionService/Overview/idesigneroptionservicecontrol.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel.Design/DesignerOptionService/Overview/idesigneroptionservicecontrol.vb" id="Snippet1"::: + ]]> @@ -123,37 +123,37 @@ Gets the value of the specified Windows Forms Designer option. The value of the specified option. - [!NOTE] -> The page and value names are always expected in English. Therefore, the following table is provided to help you access the options you want. - - The following table indicates the English value names, their data format, and a description of each: - -|Value Name|Value Format|Description| -|----------------|------------------|-----------------| -|GridSize||The size of each grid square.| -|GridSize.Width||The width of each grid square. This nested property is read-only when accessed through the designer option service.| -|GridSize.Height||The height of each grid square. This nested property is read-only when accessed through the designer option service.| -|ShowGrid||`true` if the grid should be shown; `false` if the grid should not be shown.| -|SnapToGrid||`true` if the positions of the components should be aligned to the grid; `false` if the positions should not necessarily be aligned.| -|LayoutMode|`Microsoft.VisualStudio.Windows.Forms.LayoutMode`|`SnapLines` to use snaplines, or `SnapToGrid` to align controls to the grid,| -|ObjectBoundSmartTagAutoShow||`true` to allow a component's smart tag panel to open automatically upon creation; otherwise, `false`.| -|AutoToolboxPopulate||`true` to automatically add a solution's custom controls and components to the **Toolbox**; otherwise, `false`.| -|UseOptimizedCodeGeneration||`true` if the component cache is enabled; otherwise, `false`.| - - - -## Examples - The following code example demonstrates using the method to query for the value of the `GridSize` option. - +> The page and value names are always expected in English. Therefore, the following table is provided to help you access the options you want. + + The following table indicates the English value names, their data format, and a description of each: + +|Value Name|Value Format|Description| +|----------------|------------------|-----------------| +|GridSize||The size of each grid square.| +|GridSize.Width||The width of each grid square. This nested property is read-only when accessed through the designer option service.| +|GridSize.Height||The height of each grid square. This nested property is read-only when accessed through the designer option service.| +|ShowGrid||`true` if the grid should be shown; `false` if the grid should not be shown.| +|SnapToGrid||`true` if the positions of the components should be aligned to the grid; `false` if the positions should not necessarily be aligned.| +|LayoutMode|`Microsoft.VisualStudio.Windows.Forms.LayoutMode`|`SnapLines` to use snaplines, or `SnapToGrid` to align controls to the grid,| +|ObjectBoundSmartTagAutoShow||`true` to allow a component's smart tag panel to open automatically upon creation; otherwise, `false`.| +|AutoToolboxPopulate||`true` to automatically add a solution's custom controls and components to the **Toolbox**; otherwise, `false`.| +|UseOptimizedCodeGeneration||`true` if the component cache is enabled; otherwise, `false`.| + + + +## Examples + The following code example demonstrates using the method to query for the value of the `GridSize` option. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/IDesignerOptionServiceExample/CPP/idesigneroptionservicecontrol.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel.Design/DesignerOptionService/Overview/idesigneroptionservicecontrol.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel.Design/DesignerOptionService/Overview/idesigneroptionservicecontrol.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel.Design/DesignerOptionService/Overview/idesigneroptionservicecontrol.vb" id="Snippet2"::: + ]]> @@ -213,28 +213,28 @@ The new value. Sets the value of the specified Windows Forms Designer option. - [!NOTE] -> The page and value names are always expected in English. Therefore, the following table is provided to help you access the options you want. - - The following table indicates the English value names, their data format, and a description of each: - -|Value Name|Value Format|Description| -|----------------|------------------|-----------------| -|GridSize||The size of each grid square.| -|GridSize.Width||The width of each grid square. This nested property is read-only when accessed through the designer option service.| -|GridSize.Height||The height of each grid square. This nested property is read-only when accessed through the designer option service.| -|ShowGrid||`true` if the grid should be shown; `false` if the grid should not be shown.| -|SnapToGrid||`true` if the positions of the components should be aligned to the grid; `false` if the positions should not necessarily be aligned.| -|LayoutMode|`Microsoft.VisualStudio.Windows.Forms.LayoutMode`|`SnapLines` to use snaplines, or `SnapToGrid` to align controls to the grid,| -|ObjectBoundSmartTagAutoShow||`true` to allow a component's smart tag panel to open automatically upon creation; otherwise, `false`.| -|AutoToolboxPopulate||`true` to automatically add a solution's custom controls and components to the **Toolbox**; otherwise, `false`.| -|UseOptimizedCodeGeneration||`true` if the component cache is enabled; otherwise, `false`.| - +> The page and value names are always expected in English. Therefore, the following table is provided to help you access the options you want. + + The following table indicates the English value names, their data format, and a description of each: + +|Value Name|Value Format|Description| +|----------------|------------------|-----------------| +|GridSize||The size of each grid square.| +|GridSize.Width||The width of each grid square. This nested property is read-only when accessed through the designer option service.| +|GridSize.Height||The height of each grid square. This nested property is read-only when accessed through the designer option service.| +|ShowGrid||`true` if the grid should be shown; `false` if the grid should not be shown.| +|SnapToGrid||`true` if the positions of the components should be aligned to the grid; `false` if the positions should not necessarily be aligned.| +|LayoutMode|`Microsoft.VisualStudio.Windows.Forms.LayoutMode`|`SnapLines` to use snaplines, or `SnapToGrid` to align controls to the grid,| +|ObjectBoundSmartTagAutoShow||`true` to allow a component's smart tag panel to open automatically upon creation; otherwise, `false`.| +|AutoToolboxPopulate||`true` to automatically add a solution's custom controls and components to the **Toolbox**; otherwise, `false`.| +|UseOptimizedCodeGeneration||`true` if the component cache is enabled; otherwise, `false`.| + ]]> diff --git a/xml/System.ComponentModel.Design/IEventBindingService.xml b/xml/System.ComponentModel.Design/IEventBindingService.xml index 53726a72a14..0bcc91f3a57 100644 --- a/xml/System.ComponentModel.Design/IEventBindingService.xml +++ b/xml/System.ComponentModel.Design/IEventBindingService.xml @@ -57,7 +57,7 @@ To link an event handler with a component event using the , you must first obtain an for the event of the component you intend to link. The provides methods that can convert an to a , which you can use to configure the event with an event handler method name. - The object provides a method that you can use to obtain an containing objects for each event of a component. The and methods of the return a for each passed to either method. Each returned from or has a property type of string. You can set this string to a value that indicates the name of the event-handler method to link the event with using the method of the . + The object provides a method that you can use to obtain an containing objects for each event of a component. The and methods of the return a for each passed to either method. Each returned from or has a property type of string. You can set this string to a value that indicates the name of the event-handler method to link the event with using the method of the . @@ -284,7 +284,7 @@ has a of string. + Each returned has a of string. ]]> @@ -337,7 +337,7 @@ has a of string. + The returned has a of string. ]]> diff --git a/xml/System.ComponentModel.Design/IHelpService.xml b/xml/System.ComponentModel.Design/IHelpService.xml index 989ab117b6e..a8542c6151f 100644 --- a/xml/System.ComponentModel.Design/IHelpService.xml +++ b/xml/System.ComponentModel.Design/IHelpService.xml @@ -44,26 +44,26 @@ Provides methods for showing Help topics and adding and removing Help keywords at design time. - can be used to invoke the help service with a specified keyword using the method, or to invoke a help topic from a specified URL using the method. - - The can also be used to add or remove Help keywords at design time. Selecting a component or property at design time sets a default context keyword consisting of the fully qualified type or member name of the selection, and removes the keywords for any previously selected and no longer selected components or properties. - - Because the Help system does not automatically remove custom Help keywords, you must explicitly remove a custom keyword when it no longer applies. You can monitor the events defined by the interface to determine when a component selection changes. Based on those events, you can add a Help context attribute for a component when it is selected and then remove the Help context attribute when the selection no longer includes the component. - - - -## Examples - The following example demonstrates a designer that uses the to add and remove Help context attributes for the included control. To use this sample, compile it to a class library and add an instance of the control to a . In design view, selecting the component and pressing F1 attempts to look up relevant Help topics based on the current Help context keyword or keywords. Right-click the component and the shortcut menu displays commands, including two custom commands named `Add IHelpService Help Keyword` and `Remove IHelpService Help Keyword`. These commands can be used to add or remove a Help context keyword of the value "IHelpService", which attempts to raise the topic when F1 is pressed. - + can be used to invoke the help service with a specified keyword using the method, or to invoke a help topic from a specified URL using the method. + + The can also be used to add or remove Help keywords at design time. Selecting a component or property at design time sets a default context keyword consisting of the fully qualified type or member name of the selection, and removes the keywords for any previously selected and no longer selected components or properties. + + Because the Help system does not automatically remove custom Help keywords, you must explicitly remove a custom keyword when it no longer applies. You can monitor the events defined by the interface to determine when a component selection changes. Based on those events, you can add a Help context attribute for a component when it is selected and then remove the Help context attribute when the selection no longer includes the component. + + + +## Examples + The following example demonstrates a designer that uses the to add and remove Help context attributes for the included control. To use this sample, compile it to a class library and add an instance of the control to a . In design view, selecting the component and pressing F1 attempts to look up relevant Help topics based on the current Help context keyword or keywords. Right-click the component and the shortcut menu displays commands, including two custom commands named `Add IHelpService Help Keyword` and `Remove IHelpService Help Keyword`. These commands can be used to add or remove a Help context keyword of the value "IHelpService", which attempts to raise the topic when F1 is pressed. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/IHelpServiceExample/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel.Design/IHelpService/Overview/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel.Design/IHelpService/Overview/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel.Design/IHelpService/Overview/source.vb" id="Snippet1"::: + ]]> @@ -117,11 +117,11 @@ The type of the keyword, from the enumeration . Adds a context attribute to the document. - @@ -352,11 +352,11 @@ The keyword of the Help topic to display. Shows the Help topic that corresponds to the specified keyword. - @@ -404,11 +404,11 @@ The URL of the Help topic to display. Shows the Help topic that corresponds to the specified URL. - diff --git a/xml/System.ComponentModel.Design/IInheritanceService.xml b/xml/System.ComponentModel.Design/IInheritanceService.xml index c3195e2f167..c3cd1e87b7b 100644 --- a/xml/System.ComponentModel.Design/IInheritanceService.xml +++ b/xml/System.ComponentModel.Design/IInheritanceService.xml @@ -44,13 +44,13 @@ Provides methods for identifying the components of a component. - method and pass the component to search and an to store references to the identified components. Call the method to retrieve an for a component that has been identified by the method. - + method and pass the component to search and an to store references to the identified components. Call the method to retrieve an for a component that has been identified by the method. + ]]> @@ -101,11 +101,11 @@ The to add components to. Searches the specified component for fields that implement the interface and adds each to the specified container, storing the inheritance level of each which can be retrieved using the method. - , adds each to the specified container, and stores an for each. The for a component indicates whether the field is inherited from a base class and can be retrieved using the method. - + , adds each to the specified container, and stores an for each. The for a component indicates whether the field is inherited from a base class and can be retrieved using the method. + ]]> @@ -154,13 +154,13 @@ Gets the inheritance attribute for the specified component. An instance of that describes the level of inheritance of the specified component. - method, this method returns the value . Otherwise, it returns the inheritance attribute for this component. - - You should call on the specified component or a parent of the specified component before attempting to obtain an that reflects the inheritance level of the specified component. - + method, this method returns the value . Otherwise, it returns the inheritance attribute for this component. + + You should call on the specified component or a parent of the specified component before attempting to obtain an that reflects the inheritance level of the specified component. + ]]> diff --git a/xml/System.ComponentModel.Design/IMenuCommandService.xml b/xml/System.ComponentModel.Design/IMenuCommandService.xml index 8f8eb5e138a..a7fcd0b5f6b 100644 --- a/xml/System.ComponentModel.Design/IMenuCommandService.xml +++ b/xml/System.ComponentModel.Design/IMenuCommandService.xml @@ -65,19 +65,19 @@ Designer verbs represent custom-defined commands that are listed on the shortcut menu in design mode. A designer verb can provide a specified text label. Each designer verb is automatically assigned a unique . A designer can provide designer verbs through its property, but these are only available when the designer's component is currently selected. Global designer verbs are designer verb commands that can be accessed from a design-mode shortcut menu regardless of the selected component. This interface allows you to manage the set of global designer verbs that are available in design mode. - You can add a global designer verb using the method, and you can remove a global designer verb using the method. You can invoke a designer verb using the method if you know the of the verb. The property of this interface contains the current set of designer verb commands to display in a shortcut menu. This set of designer verb commands consists of all global designer verbs and any designer verbs offered by the designer of any currently selected component. This set of verbs is updated each time a component with a designer offering designer verb commands is selected or deselected. + You can add a global designer verb using the method, and you can remove a global designer verb using the method. You can invoke a designer verb using the method if you know the of the verb. The property of this interface contains the current set of designer verb commands to display in a shortcut menu. This set of designer verb commands consists of all global designer verbs and any designer verbs offered by the designer of any currently selected component. This set of verbs is updated each time a component with a designer offering designer verb commands is selected or deselected. Menu commands are limited to the set of predefined standard commands. Most of the predefined standard commands are defined in the and enumerations. You can add, remove, and invoke menu commands, and search for menu commands that have been added to a menu using methods of this interface. - You can add a standard menu command using the method, and remove a standard menu command using the method. You can attach an event handler to a predefined standard menu command by following the procedure detailed in the documentation for the method. You can retrieve a menu command by if it has been added to a menu using the method. You can invoke a menu command or designer verb command by using the method. + You can add a standard menu command using the method, and remove a standard menu command using the method. You can attach an event handler to a predefined standard menu command by following the procedure detailed in the documentation for the method. You can retrieve a menu command by if it has been added to a menu using the method. You can invoke a menu command or designer verb command by using the method. > [!NOTE] -> An attempt to add a menu command with an already existing will throw an . When adding a menu command, be sure to check that it is not already on a menu using the method, or use exception handling wisely. +> An attempt to add a menu command with an already existing will throw an . When adding a menu command, be sure to check that it is not already on a menu using the method, or use exception handling wisely. > [!NOTE] -> A menu command can be added to a menu, and have its or properties set to `false`. If you cannot visually locate a menu command that has been added on a menu, one of these properties may have been set to `false`. +> A menu command can be added to a menu, and have its or properties set to `false`. If you cannot visually locate a menu command that has been added on a menu, one of these properties may have been set to `false`. - You can show certain standard shortcut menus containing menu commands at a specified location using the method. The documentation for this method contains a table listing the command IDs that specify the valid menus to show. + You can show certain standard shortcut menus containing menu commands at a specified location using the method. The documentation for this method contains a table listing the command IDs that specify the valid menus to show. @@ -146,17 +146,17 @@ The and enumerations contain identifiers for predefined standard commands and menu commands that are already associated with a location on a particular menu. > [!NOTE] -> An attempt to add a menu command with an already existing will throw an . When adding a menu command, be sure to check that it is not already on a menu using the method, or use exception handling wisely. +> An attempt to add a menu command with an already existing will throw an . When adding a menu command, be sure to check that it is not already on a menu using the method, or use exception handling wisely. You can attach an event handler to a predefined menu command with the following procedure: -1. If the menu command to link with an event handler has been added to a menu, or is located with the method, consider whether you wish to restore this menu command later, and whether you want to invoke the current event handler from your new event handler. If your code might restore the menu command or chain the invocation of event handlers, be sure to store a reference to the menu command somewhere. +1. If the menu command to link with an event handler has been added to a menu, or is located with the method, consider whether you wish to restore this menu command later, and whether you want to invoke the current event handler from your new event handler. If your code might restore the menu command or chain the invocation of event handlers, be sure to store a reference to the menu command somewhere. -2. Ensure that any previously existing menu command with the same has been removed from the menu using the method. +2. Ensure that any previously existing menu command with the same has been removed from the menu using the method. 3. Create a new and specify your event handler in the constructor, along with a representing the command to add. Each standard menu command is associated with a predefined menu location where it is added to. The supported command IDs are defined in the and enumerations. -4. If you want to invoke any preexisting event handler for the menu command, call the method of the menu command you have replaced on the menu from the event handler that handles the invoke event of your menu command. +4. If you want to invoke any preexisting event handler for the menu command, call the method of the menu command you have replaced on the menu from the event handler that handles the invoke event of your menu command. 5. If you are interested in restoring the event handler of a preexisting menu command that you have replaced, add the stored, preexisting menu command after you remove the replacement menu command you created. You may want to add this behavior to the `Dispose` method for your type. @@ -375,7 +375,7 @@ if it is found. This method does not raise an exception or return a value if the specified is not found. Use the method to determine whether a matching a specified is located on a menu. + This method removes the specified if it is found. This method does not raise an exception or return a value if the specified is not found. Use the method to determine whether a matching a specified is located on a menu. ]]> @@ -428,7 +428,7 @@ method. + This method removes the specified global designer verb if it is within the global designer verbs collection. You can add a designer verb to the global designer verbs collection using the method. ]]> @@ -485,7 +485,7 @@ method can display any of the following Visual Studio shortcut menus containing menu commands at a specified point: + The method can display any of the following Visual Studio shortcut menus containing menu commands at a specified point: |Menu|CommandID| |----------|---------------| @@ -544,7 +544,7 @@ method on this interface, and individual designer verbs, which are offered by the property of individual designers. If the name of a global verb conflicts with the name of a designer verb, the designer-provided designer verb takes precedence. + The set of currently available designer verbs consists of all global designer verbs, which are added by the method on this interface, and individual designer verbs, which are offered by the property of individual designers. If the name of a global verb conflicts with the name of a designer verb, the designer-provided designer verb takes precedence. ]]> diff --git a/xml/System.ComponentModel.Design/IReferenceService.xml b/xml/System.ComponentModel.Design/IReferenceService.xml index bdc0f887f2b..ffa2046ece9 100644 --- a/xml/System.ComponentModel.Design/IReferenceService.xml +++ b/xml/System.ComponentModel.Design/IReferenceService.xml @@ -49,18 +49,18 @@ ## Remarks The interface provides the following methods: -- The method returns the component with the specified name, or `null` if no component with the specified name was found. +- The method returns the component with the specified name, or `null` if no component with the specified name was found. -- The method returns the name associated with the specified component. +- The method returns the name associated with the specified component. -- The method returns the parent container of the specified component. +- The method returns the parent container of the specified component. -- The method returns an array of references to all project components, or all project components of an optionally specified type. +- The method returns an array of references to all project components, or all project components of an optionally specified type. ## Examples - The following example control uses the method of the interface to obtain a list of components in the current design mode project of the type of the currently selected component. + The following example control uses the method of the interface to obtain a list of components in the current design mode project of the type of the currently selected component. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/IReferenceServiceExample/CPP/ireferenceserviceexample.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel.Design/IReferenceService/Overview/ireferenceserviceexample.cs" id="Snippet1"::: diff --git a/xml/System.ComponentModel.Design/IRootDesigner.xml b/xml/System.ComponentModel.Design/IRootDesigner.xml index 41d1ea1b9b2..e5382172906 100644 --- a/xml/System.ComponentModel.Design/IRootDesigner.xml +++ b/xml/System.ComponentModel.Design/IRootDesigner.xml @@ -60,22 +60,22 @@ Provides support for root-level designer view technologies. - interface. A root designer typically manages the background view in designer view mode, and usually displays the controls within the base container of the current design time project. - - - -## Examples - The following code example demonstrates a implementation associated with a sample user control. This implementation displays a control for the background view in designer view by overriding the method. You need to add a reference to the System.Design assembly to compile the example. - - To use this example, add the source code to a project and show the `RootViewSampleComponent` in designer view to display the custom root designer view. - + interface. A root designer typically manages the background view in designer view mode, and usually displays the controls within the base container of the current design time project. + + + +## Examples + The following code example demonstrates a implementation associated with a sample user control. This implementation displays a control for the background view in designer view by overriding the method. You need to add a reference to the System.Design assembly to compile the example. + + To use this example, add the source code to a project and show the `RootViewSampleComponent` in designer view to display the custom root designer view. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/IRootDesigner Sample/CPP/class1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel.Design/IRootDesigner/Overview/class1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel.Design/IRootDesigner/Overview/class1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel.Design/IRootDesigner/Overview/class1.vb" id="Snippet1"::: + ]]> @@ -124,14 +124,14 @@ Gets a view object for the specified view technology. An object that represents the view for this designer. - , because there can be a variety of different user interface technologies. Development environments typically support more than one technology. - + , because there can be a variety of different user interface technologies. Development environments typically support more than one technology. + > [!NOTE] -> The and fields are obsolete. Use for new designer implementations. - +> The and fields are obsolete. Use for new designer implementations. + ]]> The specified view technology is not supported or does not exist. @@ -177,14 +177,14 @@ Gets the set of technologies that this designer can support for its display. An array of supported values. - enumeration indicates the supported view technologies. - + enumeration indicates the supported view technologies. + > [!NOTE] -> The and fields are obsolete. Use for new designer implementations. - +> The and fields are obsolete. Use for new designer implementations. + ]]> diff --git a/xml/System.ComponentModel.Design/ISelectionService.xml b/xml/System.ComponentModel.Design/ISelectionService.xml index 0831bee0745..2a1d38bbb8f 100644 --- a/xml/System.ComponentModel.Design/ISelectionService.xml +++ b/xml/System.ComponentModel.Design/ISelectionService.xml @@ -50,20 +50,20 @@ Provides an interface for a designer to select components. - to handle the and events. - + to handle the and events. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/ISelectionServiceSample/CPP/selectioncomponent.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel.Design/ISelectionService/Overview/selectioncomponent.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel.Design/ISelectionService/Overview/selectioncomponent.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel.Design/ISelectionService/Overview/selectioncomponent.vb" id="Snippet1"::: + ]]> @@ -113,11 +113,11 @@ if the component is part of the user's current selection; otherwise, . - @@ -212,11 +212,11 @@ Gets the object that is currently the primary selected object. The object that is currently the primary selected object. - @@ -260,23 +260,23 @@ Occurs when the current selection changes. - event. - + event. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/ISelectionService/CPP/csiselectionserviceexample.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel.Design/ISelectionService/SelectionChanged/csiselectionserviceexample.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel.Design/ISelectionService/SelectionChanged/csiselectionserviceexample.vb" id="Snippet2"::: + :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel.Design/ISelectionService/SelectionChanged/csiselectionserviceexample.vb" id="Snippet2"::: :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/ISelectionService/CPP/csiselectionserviceexample.cpp" id="Snippet3"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel.Design/ISelectionService/SelectionChanged/csiselectionserviceexample.cs" id="Snippet3"::: -:::code language="vb" source="~/snippets/visualbasic/System.ComponentModel.Design/ISelectionService/SelectionChanged/csiselectionserviceexample.vb" id="Snippet3"::: - +:::code language="vb" source="~/snippets/visualbasic/System.ComponentModel.Design/ISelectionService/SelectionChanged/csiselectionserviceexample.vb" id="Snippet3"::: + ]]> @@ -322,23 +322,23 @@ Occurs when the current selection is about to change. - event. - + event. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/ISelectionService/CPP/csiselectionserviceexample.cpp" id="Snippet4"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel.Design/ISelectionService/SelectionChanged/csiselectionserviceexample.cs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel.Design/ISelectionService/SelectionChanged/csiselectionserviceexample.vb" id="Snippet4"::: + :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel.Design/ISelectionService/SelectionChanged/csiselectionserviceexample.vb" id="Snippet4"::: :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/ISelectionService/CPP/csiselectionserviceexample.cpp" id="Snippet5"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel.Design/ISelectionService/SelectionChanged/csiselectionserviceexample.cs" id="Snippet5"::: -:::code language="vb" source="~/snippets/visualbasic/System.ComponentModel.Design/ISelectionService/SelectionChanged/csiselectionserviceexample.vb" id="Snippet5"::: - +:::code language="vb" source="~/snippets/visualbasic/System.ComponentModel.Design/ISelectionService/SelectionChanged/csiselectionserviceexample.vb" id="Snippet5"::: + ]]> @@ -441,11 +441,11 @@ The collection of components to select. Selects the specified collection of components. - selects the top-level component in the designer. - + selects the top-level component in the designer. + ]]> @@ -496,11 +496,11 @@ A value from the enumeration. The default is . Selects the components from within the specified collection of components that match the specified selection type. - selects the top-level component in the designer. - + selects the top-level component in the designer. + ]]> diff --git a/xml/System.ComponentModel.Design/IServiceContainer.xml b/xml/System.ComponentModel.Design/IServiceContainer.xml index 3cd14c28d00..a6e24757c53 100644 --- a/xml/System.ComponentModel.Design/IServiceContainer.xml +++ b/xml/System.ComponentModel.Design/IServiceContainer.xml @@ -54,24 +54,24 @@ Provides a container for services. - method of a component sited in design mode. Designers and other objects can add or remove services at design time through the interface. - - Service containers can be contained by other service containers, forming a tree of service containers. By default, the interface adds services to the closest service container. When a service is added, it can be added with instructions to promote it. When a service is promoted, it is added to any parent service container, on up until the top of the service container tree is reached. This allows a designer to provide a global service that other objects in the process can use. - - - -## Examples - The following code example contains the code for a that is configured to demonstrate the behavior of a network of linked service containers. - + method of a component sited in design mode. Designers and other objects can add or remove services at design time through the interface. + + Service containers can be contained by other service containers, forming a tree of service containers. By default, the interface adds services to the closest service container. When a service is added, it can be added with instructions to promote it. When a service is promoted, it is added to any parent service container, on up until the top of the service container tree is reached. This allows a designer to provide a global service that other objects in the process can use. + + + +## Examples + The following code example contains the code for a that is configured to demonstrate the behavior of a network of linked service containers. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/IServiceContainerExample/CPP/serviceform.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel.Design/IServiceContainer/Overview/serviceform.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel.Design/IServiceContainer/Overview/serviceform.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel.Design/IServiceContainer/Overview/serviceform.vb" id="Snippet1"::: + ]]> @@ -133,15 +133,15 @@ A callback object that is used to create the service. This allows a service to be declared as available, but delays the creation of the object until the service is requested. Adds the specified service to the service container. - . - + . + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/ServiceContainerExample/CPP/form1.cpp" id="Snippet3"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel.Design/IServiceContainer/AddService/form1.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel.Design/IServiceContainer/AddService/form1.vb" id="Snippet3"::: - + :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel.Design/IServiceContainer/AddService/form1.vb" id="Snippet3"::: + ]]> @@ -191,15 +191,15 @@ An instance of the service type to add. This object must implement or inherit from the type indicated by the parameter. Adds the specified service to the service container. - . - + . + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/ServiceContainerExample/CPP/form1.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel.Design/IServiceContainer/AddService/form1.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel.Design/IServiceContainer/AddService/form1.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel.Design/IServiceContainer/AddService/form1.vb" id="Snippet2"::: + ]]> @@ -357,15 +357,15 @@ The type of service to remove. Removes the specified service type from the service container. - . - + . + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/ServiceContainerExample/CPP/form1.cpp" id="Snippet4"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel.Design/IServiceContainer/AddService/form1.cs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel.Design/IServiceContainer/AddService/form1.vb" id="Snippet4"::: - + :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel.Design/IServiceContainer/AddService/form1.vb" id="Snippet4"::: + ]]> @@ -416,15 +416,15 @@ to promote this request to any parent service containers; otherwise, . Removes the specified service type from the service container, and optionally promotes the service to parent service containers. - . - + . + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/ServiceContainerExample/CPP/form1.cpp" id="Snippet4"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel.Design/IServiceContainer/AddService/form1.cs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel.Design/IServiceContainer/AddService/form1.vb" id="Snippet4"::: - + :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel.Design/IServiceContainer/AddService/form1.vb" id="Snippet4"::: + ]]> diff --git a/xml/System.ComponentModel.Design/ITreeDesigner.xml b/xml/System.ComponentModel.Design/ITreeDesigner.xml index bf6e1c868dc..9f804f2474d 100644 --- a/xml/System.ComponentModel.Design/ITreeDesigner.xml +++ b/xml/System.ComponentModel.Design/ITreeDesigner.xml @@ -58,7 +58,7 @@ ## Remarks The interface derives from the interface and provides support for flexibly navigating a hierarchy of related designers. With this interface, a programmer can supply a number of designers for the component, with the appropriate one being determined dynamically. - This interface is a simple extension of its base class, adding just two properties for navigating a tree hierarchy: and . + This interface is a simple extension of its base class, adding just two properties for navigating a tree hierarchy: and . For an overview of creating design components, see [Extending Design-Time Support](https://learn.microsoft.com/previous-versions/visualstudio/visual-studio-2010/37899azc(v=vs.100)). diff --git a/xml/System.ComponentModel.Design/ITypeDescriptorFilterService.xml b/xml/System.ComponentModel.Design/ITypeDescriptorFilterService.xml index 0dc104e0ab8..0fd5527d845 100644 --- a/xml/System.ComponentModel.Design/ITypeDescriptorFilterService.xml +++ b/xml/System.ComponentModel.Design/ITypeDescriptorFilterService.xml @@ -45,36 +45,36 @@ Provides an interface to modify the set of member descriptors for a component in design mode. - interface provides an interface that allows modification of the properties, events, and class-level attributes of a component at design time. This modification occurs through the set of descriptors that a component provides through a . The type descriptor will query a component's site for the service and, if it exists, the type descriptor will pass all metadata it has collected to this service. The service can then modify the metadata by adding, removing, and altering existing characteristics of the component. - - For example, the properties of a component can be modified through a call to the method. The filter service obtains a dictionary that contains property names and their property descriptors of type . The modifications are implemented using the following logic. - -|Modification|Implementation| -|------------------|--------------------| -|Removal|Delete the corresponding entry in the dictionary.| -|Addition|Add the appropriate entry to the dictionary.| -|Alteration|Call existing property descriptor methods, replace the associated property descriptor entry, or replace the entire property key/value pair in the dictionary.| - - The return value of determines if this set of properties is fixed. If this method returns `true`, the for this component can cache the results. This cache is maintained until either the component is garbage collected or the method of the type descriptor is called. - - - -## Examples - The following code example demonstrates a designer that uses the to filter the attributes collection of any new or existing to add a designer attribute for a new designer before loading or reloading the designer for the button. - - To use the example, add the code to a Windows Forms project and load the components from the class library into the Toolbox. - - Also see [Walkthrough: Automatically Populating the Toolbox with Custom Components](/dotnet/desktop/winforms/controls/walkthrough-automatically-populating-the-toolbox-with-custom-components). - - Add some buttons to your form. Add a `ButtonDesignerFilterComponent` to your form, and it will appear in the component tray. The `ButtonDesignerFilterComponent` will add a `ButtonDesignerFilterService`, which implements , as a design mode service provider. Existing or new objects on the form will begin color cycling after the `ButtonDesignerFilterService` replaces the designer for each existing and new button with a `ColorCycleButtonDesigner`. The buttons will color cycle when you move the mouse pointer over them, and alternately continue cycling or reset the background and foreground colors on `MouseLeave` events. New objects will be given the `ColorCycleButtonDesigner` through the method of the `ButtonDesignerFilterService` that has been loaded, until the `ButtonDesignerFilterComponent` is disposed and replaces the original . The `ColorCycleButton` class in this example is a associated with a `ColorCycleButtonDesigner`. - + interface provides an interface that allows modification of the properties, events, and class-level attributes of a component at design time. This modification occurs through the set of descriptors that a component provides through a . The type descriptor will query a component's site for the service and, if it exists, the type descriptor will pass all metadata it has collected to this service. The service can then modify the metadata by adding, removing, and altering existing characteristics of the component. + + For example, the properties of a component can be modified through a call to the method. The filter service obtains a dictionary that contains property names and their property descriptors of type . The modifications are implemented using the following logic. + +|Modification|Implementation| +|------------------|--------------------| +|Removal|Delete the corresponding entry in the dictionary.| +|Addition|Add the appropriate entry to the dictionary.| +|Alteration|Call existing property descriptor methods, replace the associated property descriptor entry, or replace the entire property key/value pair in the dictionary.| + + The return value of determines if this set of properties is fixed. If this method returns `true`, the for this component can cache the results. This cache is maintained until either the component is garbage collected or the method of the type descriptor is called. + + + +## Examples + The following code example demonstrates a designer that uses the to filter the attributes collection of any new or existing to add a designer attribute for a new designer before loading or reloading the designer for the button. + + To use the example, add the code to a Windows Forms project and load the components from the class library into the Toolbox. + + Also see [Walkthrough: Automatically Populating the Toolbox with Custom Components](/dotnet/desktop/winforms/controls/walkthrough-automatically-populating-the-toolbox-with-custom-components). + + Add some buttons to your form. Add a `ButtonDesignerFilterComponent` to your form, and it will appear in the component tray. The `ButtonDesignerFilterComponent` will add a `ButtonDesignerFilterService`, which implements , as a design mode service provider. Existing or new objects on the form will begin color cycling after the `ButtonDesignerFilterService` replaces the designer for each existing and new button with a `ColorCycleButtonDesigner`. The buttons will color cycle when you move the mouse pointer over them, and alternately continue cycling or reset the background and foreground colors on `MouseLeave` events. New objects will be given the `ColorCycleButtonDesigner` through the method of the `ButtonDesignerFilterService` that has been loaded, until the `ButtonDesignerFilterComponent` is disposed and replaces the original . The `ColorCycleButton` class in this example is a associated with a `ColorCycleButtonDesigner`. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/ITypeDescriptorFilterService/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel.Design/ITypeDescriptorFilterService/Overview/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel.Design/ITypeDescriptorFilterService/Overview/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel.Design/ITypeDescriptorFilterService/Overview/source.vb" id="Snippet1"::: + ]]> @@ -134,11 +134,11 @@ if the set of filtered attributes is to be cached; if the filter service must query again. - as the keys and the actual attribute as the value. Implementers of this service can add, remove, or alter existing attribute entries in the dictionary. - + as the keys and the actual attribute as the value. Implementers of this service can add, remove, or alter existing attribute entries in the dictionary. + ]]> @@ -196,11 +196,11 @@ if the set of filtered events is to be cached; if the filter service must query again. - objects as the values. Implementers of this service can add, remove, or alter event entries in the dictionary. - + objects as the values. Implementers of this service can add, remove, or alter event entries in the dictionary. + ]]> @@ -257,11 +257,11 @@ if the set of filtered properties is to be cached; if the filter service must query again. - objects as the values. Implementers of this service can add, remove, or alter property entries in the dictionary. - + objects as the values. Implementers of this service can add, remove, or alter property entries in the dictionary. + ]]> diff --git a/xml/System.ComponentModel.Design/InheritanceService.xml b/xml/System.ComponentModel.Design/InheritanceService.xml index 4420133997a..369d4ec03c8 100644 --- a/xml/System.ComponentModel.Design/InheritanceService.xml +++ b/xml/System.ComponentModel.Design/InheritanceService.xml @@ -260,7 +260,7 @@ allows the resources used by the to be reallocated for other purposes. For more information about , see [Cleaning Up Unmanaged Resources](/dotnet/standard/garbage-collection/unmanaged). + Calling allows the resources used by the to be reallocated for other purposes. For more information about , see [Cleaning Up Unmanaged Resources](/dotnet/standard/garbage-collection/unmanaged). ]]> diff --git a/xml/System.ComponentModel.Design/LocalizationExtenderProvider.xml b/xml/System.ComponentModel.Design/LocalizationExtenderProvider.xml index d967b92745b..a494a009b99 100644 --- a/xml/System.ComponentModel.Design/LocalizationExtenderProvider.xml +++ b/xml/System.ComponentModel.Design/LocalizationExtenderProvider.xml @@ -82,7 +82,7 @@ sets the current language to , which is the generic and default language resource setting. This setting causes a designer to generate code that references the generic language resource. You can create other objects to represent and identify other localized resource data that a program can use at run time. + By default, a new sets the current language to , which is the generic and default language resource setting. This setting causes a designer to generate code that references the generic language resource. You can create other objects to represent and identify other localized resource data that a program can use at run time. ]]> @@ -161,10 +161,10 @@ when you are finished using the . The method leaves the in an unusable state. After calling , you must release all references to the so the garbage collector can reclaim the memory that the was occupying. For more information, see [Cleaning Up Unmanaged Resources](/dotnet/standard/garbage-collection/unmanaged) and [Implementing a Dispose Method](/dotnet/standard/garbage-collection/implementing-dispose). + Call when you are finished using the . The method leaves the in an unusable state. After calling , you must release all references to the so the garbage collector can reclaim the memory that the was occupying. For more information, see [Cleaning Up Unmanaged Resources](/dotnet/standard/garbage-collection/unmanaged) and [Implementing a Dispose Method](/dotnet/standard/garbage-collection/implementing-dispose). > [!NOTE] -> Always call before you release your last reference to the . Otherwise, the resources it is using will not be freed until the garbage collector calls the object's `Finalize` method. +> Always call before you release your last reference to the . Otherwise, the resources it is using will not be freed until the garbage collector calls the object's `Finalize` method. ]]> @@ -361,7 +361,7 @@ . + If the specified object was initialized with localized resources when the designer loaded, this method sets the resource culture for the specified object to the resource culture used to initialize the values of the specified object when the designer loaded. If the specified object had no previous resource culture setting, the current resource culture is set to . ]]> diff --git a/xml/System.ComponentModel.Design/MenuCommand.xml b/xml/System.ComponentModel.Design/MenuCommand.xml index 0a3e36d22d4..6f8e5558071 100644 --- a/xml/System.ComponentModel.Design/MenuCommand.xml +++ b/xml/System.ComponentModel.Design/MenuCommand.xml @@ -67,15 +67,15 @@ - A property that uniquely identifies the command. -- An method that executes the command. +- An method that executes the command. -- An method that can be overridden to handle the event that occurs when a new command is selected. +- An method that can be overridden to handle the event that occurs when a new command is selected. -- Boolean flag states that indicate whether the command is , , , or . +- Boolean flag states that indicate whether the command is , , , or . - An property that indicates the OLE command status code for the command. -- An override for the method. +- An override for the method. @@ -563,7 +563,7 @@ ## Remarks Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). - The method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + The method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. ]]> @@ -620,7 +620,7 @@ collection. The key in the properties dictionary is the property name. This allows for generic enumeration of properties and provides a consistent substrate from which new properties can be added without modifying the class definition. + All menu commands store their public properties in the collection. The key in the properties dictionary is the property name. This allows for generic enumeration of properties and provides a consistent substrate from which new properties can be added without modifying the class definition. ]]> diff --git a/xml/System.ComponentModel.Design/MenuCommandService.xml b/xml/System.ComponentModel.Design/MenuCommandService.xml index 7eea3de8afc..28dfcee0a4c 100644 --- a/xml/System.ComponentModel.Design/MenuCommandService.xml +++ b/xml/System.ComponentModel.Design/MenuCommandService.xml @@ -154,7 +154,7 @@ method adds a command handler to the menu command service. Command handlers do not define the text, shortcut, or placement of a menu item. Rather, they define the menu item's behavior if the item is clicked. + The method adds a command handler to the menu command service. Command handlers do not define the text, shortcut, or placement of a menu item. Rather, they define the menu item's behavior if the item is clicked. ]]> @@ -275,10 +275,10 @@ when you are finished using the . The method leaves the in an unusable state. After calling , you must release all references to the so the garbage collector can reclaim the memory that the was occupying. For more information, see [Cleaning Up Unmanaged Resources](/dotnet/standard/garbage-collection/unmanaged) and [Implementing a Dispose Method](/dotnet/standard/garbage-collection/implementing-dispose). + Call when you are finished using the . The method leaves the in an unusable state. After calling , you must release all references to the so the garbage collector can reclaim the memory that the was occupying. For more information, see [Cleaning Up Unmanaged Resources](/dotnet/standard/garbage-collection/unmanaged) and [Implementing a Dispose Method](/dotnet/standard/garbage-collection/implementing-dispose). > [!NOTE] -> Always call before you release your last reference to the . Otherwise, the resources it is using will not be freed until the garbage collector calls the object's `Finalize` method. +> Always call before you release your last reference to the . Otherwise, the resources it is using will not be freed until the garbage collector calls the object's `Finalize` method. ]]> @@ -368,7 +368,7 @@ method creates the verb list if it has not already been created. + The method creates the verb list if it has not already been created. ]]> @@ -749,11 +749,11 @@ method is called by a menu command when its status has changed. + The method is called by a menu command when its status has changed. Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). - The method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + The method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. ]]> @@ -952,11 +952,11 @@ ## Remarks The property provides a collection of verbs. These verbs come from two places: -- Verbs added through the method of . +- Verbs added through the method of . - Verbs offered by the currently selected designer. - Verbs added to this service through the method are called global verbs because they are global to this service, but generally there is one instance of this service for each tool or document window. Designer verbs are obtained by querying the service provider for and . If the selection service offers a primary selection, and a designer can be obtained for that selection from , the designer's verbs are added to this list. If the name of a global verb conflicts with the name of a designer verb, the designer-provided designer verb takes precedence. + Verbs added to this service through the method are called global verbs because they are global to this service, but generally there is one instance of this service for each tool or document window. Designer verbs are obtained by querying the service provider for and . If the selection service offers a primary selection, and a designer can be obtained for that selection from , the designer's verbs are added to this list. If the name of a global verb conflicts with the name of a designer verb, the designer-provided designer verb takes precedence. ]]> diff --git a/xml/System.ComponentModel.Design/SelectionTypes.xml b/xml/System.ComponentModel.Design/SelectionTypes.xml index b6541bad90e..939a9679c85 100644 --- a/xml/System.ComponentModel.Design/SelectionTypes.xml +++ b/xml/System.ComponentModel.Design/SelectionTypes.xml @@ -55,13 +55,13 @@ Defines identifiers that indicate the type of a selection. - method of the . Some types of actions can operate on a selected component or group of selected components. The keeps track of the selection type of the current selection. These selection type identifiers indicate whether the selection was completed using a single click, a mouse down or mouse up selection, whether the selection should replace the previous selection, or use the default selection mode. - - Use the enumeration to specify the type of a selection when setting a new selection using the method. - + method of the . Some types of actions can operate on a selected component or group of selected components. The keeps track of the selection type of the current selection. These selection type identifiers indicate whether the selection was completed using a single click, a mouse down or mouse up selection, whether the selection should replace the previous selection, or use the default selection mode. + + Use the enumeration to specify the type of a selection when setting a new selection using the method. + ]]> diff --git a/xml/System.ComponentModel.Design/ServiceContainer.xml b/xml/System.ComponentModel.Design/ServiceContainer.xml index 4cc3d728cce..d7667fee958 100644 --- a/xml/System.ComponentModel.Design/ServiceContainer.xml +++ b/xml/System.ComponentModel.Design/ServiceContainer.xml @@ -75,7 +75,7 @@ ## Remarks The object can be used to store and provide services. implements the interface. - The object can be created using a constructor that adds a parent through which services can be optionally added to or removed from all parent objects, including the immediate parent . To add or remove a service from all implementations that are linked to this through parenting, call the or method overload that accepts a Boolean value indicating whether to promote the service request. + The object can be created using a constructor that adds a parent through which services can be optionally added to or removed from all parent objects, including the immediate parent . To add or remove a service from all implementations that are linked to this through parenting, call the or method overload that accepts a Boolean value indicating whether to promote the service request. > [!NOTE] > The attribute applied to this class has the following property value: . The does not affect desktop applications (which are typically started by double-clicking an icon, typing a command, or entering a URL in a browser). For more information, see the class or [SQL Server Programming and Host Protection Attributes](/dotnet/framework/performance/sql-server-programming-and-host-protection-attributes). @@ -83,7 +83,7 @@ ## Examples - The following example program demonstrates service chaining and the resultant service availability of a chain of linked objects. The program provides a user interface that allows you to see the availability of services within a chain of linked services, and uses the , , and methods as well as linked service containers. + The following example program demonstrates service chaining and the resultant service availability of a chain of linked objects. The program provides a user interface that allows you to see the availability of services within a chain of linked services, and uses the , , and methods as well as linked service containers. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/ServiceArchitectureExample/CPP/serviceform.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel.Design/ServiceContainer/Overview/serviceform.cs" id="Snippet1"::: @@ -524,7 +524,7 @@ . the default implementation of this property is to return the and types. You may override this property and return your own types, modifying the default behavior of . + This property returns the default services that are implemented directly on this . the default implementation of this property is to return the and types. You may override this property and return your own types, modifying the default behavior of . ]]> @@ -591,12 +591,12 @@ walks all instantiated services within the container and disposes any that implement , and clears the service list. + walks all instantiated services within the container and disposes any that implement , and clears the service list. - Call when you are finished using the . The method leaves the in an unusable state. After calling , you must release all references to the so the garbage collector can reclaim the memory that the was occupying. For more information, see [Cleaning Up Unmanaged Resources](/dotnet/standard/garbage-collection/unmanaged) and [Implementing a Dispose Method](/dotnet/standard/garbage-collection/implementing-dispose). + Call when you are finished using the . The method leaves the in an unusable state. After calling , you must release all references to the so the garbage collector can reclaim the memory that the was occupying. For more information, see [Cleaning Up Unmanaged Resources](/dotnet/standard/garbage-collection/unmanaged) and [Implementing a Dispose Method](/dotnet/standard/garbage-collection/implementing-dispose). > [!NOTE] -> Always call before you release your last reference to the . Otherwise, the resources it is using will not be freed until the garbage collector calls the object's `Finalize` method. +> Always call before you release your last reference to the . Otherwise, the resources it is using will not be freed until the garbage collector calls the object's `Finalize` method. ]]> @@ -648,7 +648,7 @@ walks all instantiated services within the container and disposes any that implement , and clears the service list. + walks all instantiated services within the container and disposes any that implement , and clears the service list. This method is called by the public `Dispose()` method and the method, if it has been overridden. `Dispose()` invokes this method with the `disposing` parameter set to `true`. `Finalize` invokes this method with `disposing` set to `false`. diff --git a/xml/System.ComponentModel.Design/ServiceCreatorCallback.xml b/xml/System.ComponentModel.Design/ServiceCreatorCallback.xml index 2f87c3a16df..65e689bd3b2 100644 --- a/xml/System.ComponentModel.Design/ServiceCreatorCallback.xml +++ b/xml/System.ComponentModel.Design/ServiceCreatorCallback.xml @@ -68,20 +68,20 @@ Provides a callback mechanism that can create an instance of a service on demand. The service specified by , or if the service could not be created. - provides a mechanism to publish services that you can request to have created when needed, rather than the service being created immediately when the designer loads. You can use a callback function if the service is not essential and may not be used. A service published by using a does not use as many additional resources if it is not requested and created. To use a callback function to publish your service, pass a to the method of an . - - - -## Examples - The following code example shows how to publish a service using a callback function. - + provides a mechanism to publish services that you can request to have created when needed, rather than the service being created immediately when the designer loads. You can use a callback function if the service is not essential and may not be used. A service published by using a does not use as many additional resources if it is not requested and created. To use a callback function to publish your service, pass a to the method of an . + + + +## Examples + The following code example shows how to publish a service using a callback function. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic ServiceCreatorCallback Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel.Design/ServiceCreatorCallback/Overview/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel.Design/ServiceCreatorCallback/Overview/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel.Design/ServiceCreatorCallback/Overview/source.vb" id="Snippet1"::: + ]]> diff --git a/xml/System.ComponentModel.Design/StandardCommands.xml b/xml/System.ComponentModel.Design/StandardCommands.xml index 39b67172a28..fad1801fc47 100644 --- a/xml/System.ComponentModel.Design/StandardCommands.xml +++ b/xml/System.ComponentModel.Design/StandardCommands.xml @@ -57,7 +57,7 @@ ## Remarks This class defines identifiers for standard commands that are available to designers. - To add a command from the class to a designer menu, you must call the method of an and add a that contains a from . + To add a command from the class to a designer menu, you must call the method of an and add a that contains a from . diff --git a/xml/System.ComponentModel.Design/UndoEngine+UndoUnit.xml b/xml/System.ComponentModel.Design/UndoEngine+UndoUnit.xml index 112f64be8f3..29e2bc55fa3 100644 --- a/xml/System.ComponentModel.Design/UndoEngine+UndoUnit.xml +++ b/xml/System.ComponentModel.Design/UndoEngine+UndoUnit.xml @@ -43,11 +43,11 @@ Encapsulates a unit of work that a user can undo. - class is a nested class within that encapsulates an action that a user can undo. The default implementation monitors change notifications and builds up a list of events for each change. It saves these events using . An receives event notifications for changes directly from through several `public virtual` methods. You can derive from and perform any additional logic. If desired, you can completely bypass the default implementation. - + class is a nested class within that encapsulates an action that a user can undo. The default implementation monitors change notifications and builds up a list of events for each change. It saves these events using . An receives event notifications for changes directly from through several `public virtual` methods. You can derive from and perform any additional logic. If desired, you can completely bypass the default implementation. + ]]> @@ -131,11 +131,11 @@ Receives a call from the undo engine to close this unit. - itself may take action here to ensure that any events that are currently open are closed. - + itself may take action here to ensure that any events that are currently open are closed. + ]]> @@ -476,11 +476,11 @@ if the contains no events; otherwise, . - @@ -595,15 +595,15 @@ Performs an undo or redo action. - twice sets the object back to its original state. - - The class initially assumes that the undoable work has already been done, so the first call to undoes the work. The next call undoes the previous undo operation, performing a redo. - - The method calls the method to perform an undo operation. The method itself works to maintain consistent state within the , even in the event of an exception thrown by . - + twice sets the object back to its original state. + + The class initially assumes that the undoable work has already been done, so the first call to undoes the work. The next call undoes the previous undo operation, performing a redo. + + The method calls the method to perform an undo operation. The method itself works to maintain consistent state within the , even in the event of an exception thrown by . + ]]> @@ -645,11 +645,11 @@ Called by to perform an undo action. - method calls the method to perform an undo operation. The method itself works to maintain consistent state within the , even in the event of an exception thrown by . - + method calls the method to perform an undo operation. The method itself works to maintain consistent state within the , even in the event of an exception thrown by . + ]]> diff --git a/xml/System.ComponentModel.Design/UndoEngine.xml b/xml/System.ComponentModel.Design/UndoEngine.xml index 27c09081723..5f61e10a9e6 100644 --- a/xml/System.ComponentModel.Design/UndoEngine.xml +++ b/xml/System.ComponentModel.Design/UndoEngine.xml @@ -171,7 +171,7 @@ method. + Create the `unit` parameter by calling the method. ]]> @@ -227,7 +227,7 @@ method simply returns a new . + The default implementation of the method simply returns a new . By default, does nothing with the `primary` parameter, but some implementations of undo, such as those involving the COM `Microsoft.VisualStudio.OLE.Interop.IOleParentUndoUnit` design pattern, may need to identify the difference between a primary unit and its children. @@ -272,7 +272,7 @@ method is called, the undo unit is closed and then undone. + Before the method is called, the undo unit is closed and then undone. ]]> diff --git a/xml/System.ComponentModel.Design/ViewTechnology.xml b/xml/System.ComponentModel.Design/ViewTechnology.xml index 365fc6fee4c..dcbaf5ca37e 100644 --- a/xml/System.ComponentModel.Design/ViewTechnology.xml +++ b/xml/System.ComponentModel.Design/ViewTechnology.xml @@ -51,33 +51,33 @@ Defines identifiers for a set of technologies that designer hosts support. - feature; however, the feature is retained for both backward compatibility and future use, if you choose. - - defines identifiers that can indicate the mode to use for controlling the display of a designer-hosted document. - - You should only use the `Default` value in your designer hosting environment. In previous versions of the .NET Framework, the `ViewTechnology` enumeration specified the type of UI model supported by a root designer. Because this model is not extensible, you should instead use a *view adapter* model. A view adapter is a type that adapts an object of one type to another. - - For example, an HTML designer might return a `DemoDOM` tree as its view. The HTML designer returns a view technology of `Default`. A Windows Forms hosting environment would have one or more view adapter classes available. If one such class could convert the `DemoDOM` into a Windows Forms control, the hosting application can support this type of designer. If no adapter can handle the data type returned from the designer's method, the load of the designer will fail, and the user will be presented with an error. - + + defines identifiers that can indicate the mode to use for controlling the display of a designer-hosted document. + + You should only use the `Default` value in your designer hosting environment. In previous versions of the .NET Framework, the `ViewTechnology` enumeration specified the type of UI model supported by a root designer. Because this model is not extensible, you should instead use a *view adapter* model. A view adapter is a type that adapts an object of one type to another. + + For example, an HTML designer might return a `DemoDOM` tree as its view. The HTML designer returns a view technology of `Default`. A Windows Forms hosting environment would have one or more view adapter classes available. If one such class could convert the `DemoDOM` into a Windows Forms control, the hosting application can support this type of designer. If no adapter can handle the data type returned from the designer's method, the load of the designer will fail, and the user will be presented with an error. + Visual Studio has an extensible scheme for providing view adapters, so it can adapt to any UI technology. Third-party technology providers can also offer an appropriate view adapter, and their object models are immediately consumable. - + ## Examples -The following example demonstrates how to use `ViewTechnology.Default` in a designer. This example is part of a larger example provided for the interface. - +The following example demonstrates how to use `ViewTechnology.Default` in a designer. This example is part of a larger example provided for the interface. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/IRootDesigner Sample/CPP/class1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel.Design/IRootDesigner/Overview/class1.cs" id="Snippet1"::: -:::code language="vb" source="~/snippets/visualbasic/System.ComponentModel.Design/IRootDesigner/Overview/class1.vb" id="Snippet1"::: +:::code language="vb" source="~/snippets/visualbasic/System.ComponentModel.Design/IRootDesigner/Overview/class1.vb" id="Snippet1"::: The following example demonstrates how to use the `ViewTechnology> enumeration in a designer. This example is part of a larger example provided for the class. - + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/LocalizationExtenderProviderExample/CPP/class1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel.Design/LocalizationExtenderProvider/Overview/class1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel.Design/ViewTechnology/Overview/class1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel.Design/ViewTechnology/Overview/class1.vb" id="Snippet1"::: + ]]> @@ -120,7 +120,7 @@ The following example demonstrates how to use the `ViewTechnology> enumeration i 2 Specifies the default view technology support. - + The root designer may return any type of object, but the object must be compatible with an adapter for the technology of the host. Hosting environments such as Visual Studio provide a way to plug in new view technology adapters. The default view object for the Windows Forms designer is a instance. @@ -181,7 +181,7 @@ The root designer may return any type of object, but the object must be compatib 0 Represents a mode in which the view object is passed directly to the development environment. - + The view object must implement any interfaces the development environment requires. The Visual Studio development environment supports view objects that are either an ActiveX control, active document, or an object that implements the `IVsWindowPane` interface that is available through the Visual Studio VSI (Visual Studio Integration) program. The Visual Studio development environment provides support for this view technology. Support for this view technology is not necessarily available in all development environments. diff --git a/xml/System.ComponentModel/AddingNewEventArgs.xml b/xml/System.ComponentModel/AddingNewEventArgs.xml index 79075161f10..afe98035ed7 100644 --- a/xml/System.ComponentModel/AddingNewEventArgs.xml +++ b/xml/System.ComponentModel/AddingNewEventArgs.xml @@ -58,7 +58,7 @@ If the collection also implements the interface, the item will be provisionally added, waiting a subsequent commit or rollback. - This event is commonly used in data-binding scenarios, within classes such as and . + This event is commonly used in data-binding scenarios, within classes such as and . For more information about how to handle events, see [Handling and Raising Events](/dotnet/standard/events/). @@ -189,7 +189,7 @@ constructor sets the property to the `newObject` parameter. This object will be used as the new item to be added to the associated collection, unless this property is updated by the event handler. + The constructor sets the property to the `newObject` parameter. This object will be used as the new item to be added to the associated collection, unless this property is updated by the event handler. ]]> diff --git a/xml/System.ComponentModel/AddingNewEventHandler.xml b/xml/System.ComponentModel/AddingNewEventHandler.xml index cac168a06e1..464c71b2d32 100644 --- a/xml/System.ComponentModel/AddingNewEventHandler.xml +++ b/xml/System.ComponentModel/AddingNewEventHandler.xml @@ -66,7 +66,7 @@ ## Remarks The event occurs prior to adding a new item to a collection, typically in data-binding scenarios. The handler of this event can supply the new item to be added, overriding the standard action of the collection class. This is accomplished by setting the property of the parameter `e` to this new item. Typically this item must be of a type expected by the recipient collection, or the collection will throw an exception of type . - This event is commonly used in data-binding scenarios, within classes such as and . + This event is commonly used in data-binding scenarios, within classes such as and . When you create an delegate, you identify the method that will handle the event. To associate the event with your event handler, add an instance of the delegate to the event. The event handler is called whenever the event occurs, unless you remove the delegate. For more information about event-handler delegates, see [Handling and Raising Events](/dotnet/standard/events/). diff --git a/xml/System.ComponentModel/AmbientValueAttribute.xml b/xml/System.ComponentModel/AmbientValueAttribute.xml index 0597b86e9f0..0feec62c48f 100644 --- a/xml/System.ComponentModel/AmbientValueAttribute.xml +++ b/xml/System.ComponentModel/AmbientValueAttribute.xml @@ -61,7 +61,7 @@ ## Remarks If a property on a control has ambient behavior, this attribute must be present. Ambient properties query their parent for their value, for example, a property or a property. - Typically, a visual designer uses the attribute to decide which value to persist for a property. This is usually a value that causes the property to get its value from another source. An example of an ambient value is as the ambient value for the property. If you have a control on a form and the property of the control is set to a different color than the property of the form, you can reset the property of the control to that of the form by setting the of the control to . + Typically, a visual designer uses the attribute to decide which value to persist for a property. This is usually a value that causes the property to get its value from another source. An example of an ambient value is as the ambient value for the property. If you have a control on a form and the property of the control is set to a different color than the property of the form, you can reset the property of the control to that of the form by setting the of the control to . diff --git a/xml/System.ComponentModel/ArrayConverter.xml b/xml/System.ComponentModel/ArrayConverter.xml index cee0ce8924c..bb1421e06e7 100644 --- a/xml/System.ComponentModel/ArrayConverter.xml +++ b/xml/System.ComponentModel/ArrayConverter.xml @@ -60,7 +60,7 @@ For more information about type converters, see the base class and [How to: Implement a Type Converter](https://learn.microsoft.com/previous-versions/visualstudio/visual-studio-2013/ayybcxe5(v=vs.120)). > [!NOTE] -> You should never create an instance of the class. Instead, call the method of the class. For more information, see the examples in the base class. +> You should never create an instance of the class. Instead, call the method of the class. For more information, see the examples in the base class. ]]> diff --git a/xml/System.ComponentModel/AsyncCompletedEventArgs.xml b/xml/System.ComponentModel/AsyncCompletedEventArgs.xml index 228e9b42bc1..8605ac150d6 100644 --- a/xml/System.ComponentModel/AsyncCompletedEventArgs.xml +++ b/xml/System.ComponentModel/AsyncCompletedEventArgs.xml @@ -308,7 +308,7 @@ property. The client application's event-handler delegate should check the property before accessing any properties in a class derived from ; otherwise, the property will raise a with its property holding a reference to . + If an exception is raised during an asynchronous operation, the class will assign the exception to the property. The client application's event-handler delegate should check the property before accessing any properties in a class derived from ; otherwise, the property will raise a with its property holding a reference to . The value of the property is `null` if the operation was canceled. @@ -376,7 +376,7 @@ in derived class properties. + The following code example demonstrates using in derived class properties. :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/AsyncCompletedEventArgs/Overview/primenumbercalculatormain.cs" id="Snippet6"::: diff --git a/xml/System.ComponentModel/AsyncOperation.xml b/xml/System.ComponentModel/AsyncOperation.xml index 1514bdef51c..6ece651b944 100644 --- a/xml/System.ComponentModel/AsyncOperation.xml +++ b/xml/System.ComponentModel/AsyncOperation.xml @@ -59,11 +59,11 @@ The following list identifies ways to use an object: -- To report progress and interim results to the client, call from your asynchronous worker code. +- To report progress and interim results to the client, call from your asynchronous worker code. -- To indicate that an asynchronous task has completed, or to cancel a pending asynchronous task, call . +- To indicate that an asynchronous task has completed, or to cancel a pending asynchronous task, call . - Your class should get an object for each asynchronous task by calling when each task starts. To allow the client to distinguish separate asynchronous tasks, takes a parameter for a unique client-provided token, which becomes the property. It can then be used by client code to identify the particular asynchronous task that is raising progress or completion events. + Your class should get an object for each asynchronous task by calling when each task starts. To allow the client to distinguish separate asynchronous tasks, takes a parameter for a unique client-provided token, which becomes the property. It can then be used by client code to identify the particular asynchronous task that is raising progress or completion events. @@ -170,7 +170,7 @@ method to end the lifetime of an asynchronous operation. After this method is called for a particular task, calls to its corresponding will raise an exception. + Call the method to end the lifetime of an asynchronous operation. After this method is called for a particular task, calls to its corresponding will raise an exception. ]]> @@ -234,16 +234,16 @@ method invokes the delegate specified by the `arg` parameter without ending the lifetime of the asynchronous operation. + The method invokes the delegate specified by the `arg` parameter without ending the lifetime of the asynchronous operation. - You can call the method as often as you like while the lifetime of the asynchronous operation has not been ended by a call to . You can use the method to report progress or interim results back to clients. + You can call the method as often as you like while the lifetime of the asynchronous operation has not been ended by a call to . You can use the method to report progress or interim results back to clients. The `d` parameter wraps the delegate you want called when you want to post an update about the status of the asynchronous task. The object will ensure that your delegate is invoked on the thread or context appropriate for the application model. Your method can optionally raise an event that notifies clients of a status change, progress update, or newly available incremental results. The `arg` parameter should be used to pass state to the delegate wrapped by the `d` parameter. It might be a reference to an , or it might be a object. It may be desirable to derive your own class from to provide additional state storage. ## Examples - The following code example demonstrates using the method for reporting progress and incremental results of an asynchronous operation. This code example is part of a larger example provided for the class. + The following code example demonstrates using the method for reporting progress and incremental results of an asynchronous operation. This code example is part of a larger example provided for the class. :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/AsyncCompletedEventArgs/Overview/primenumbercalculatormain.cs" id="Snippet5"::: @@ -322,7 +322,7 @@ Note: Console applications do not synchronize the execution of method to end the lifetime of an asynchronous operation. After this method is called for a particular task, calls to its corresponding object will raise an exception. + Call the method to end the lifetime of an asynchronous operation. After this method is called for a particular task, calls to its corresponding object will raise an exception. The `d` parameter wraps the delegate you want your class to call when the task's lifetime ends due to completion, cancellation, or failure of the task. The object will ensure that your delegate is invoked on the thread or context appropriate for the application model. Your delegate can optionally raise an event that notifies clients that the asynchronous task's lifetime has ended. @@ -331,7 +331,7 @@ Note: Console applications do not synchronize the execution of that will act as a task ID. You will use this task ID when you call the , method and this will associate the client's task ID with a particular invocation of your asynchronous operation. This task ID is made available to your implementation through the property. + If your class supports multiple asynchronous methods or multiple invocations of a single asynchronous method, clients will need a way to determine which asynchronous task is raising events. Your `MethodNameAsync` method should take a parameter of type that will act as a task ID. You will use this task ID when you call the , method and this will associate the client's task ID with a particular invocation of your asynchronous operation. This task ID is made available to your implementation through the property. > [!CAUTION] > Client code must be careful to provide a unique value for the property. Non-unique task IDs may cause your implementation to report progress and other events incorrectly. Your code should check for a non-unique task ID and raise an if one is detected. @@ -463,7 +463,7 @@ Note: Console applications do not synchronize the execution of provides a convenient way to create a class that runs properly under all application models supported by the .NET Framework. - The class has one method, , which returns an that can be used to track the duration of a particular asynchronous task. The for a task can be used to alert clients when a task completes. It can also be used to post progress updates and incremental results without terminating the operation. + The class has one method, , which returns an that can be used to track the duration of a particular asynchronous task. The for a task can be used to alert clients when a task completes. It can also be used to post progress updates and incremental results without terminating the operation. For more information about implementing asynchronous classes, see [Implementing the Event-based Asynchronous Pattern](/dotnet/standard/asynchronous-programming-patterns/implementing-the-event-based-asynchronous-pattern). @@ -133,21 +133,21 @@ method returns an that you can use to track the duration of a particular asynchronous operation and to alert the application model when the operation completes. You can also use it to post progress updates and incremental results without terminating the operation. The will correctly marshal these calls to the appropriate thread or context for the application model. + The method returns an that you can use to track the duration of a particular asynchronous operation and to alert the application model when the operation completes. You can also use it to post progress updates and incremental results without terminating the operation. The will correctly marshal these calls to the appropriate thread or context for the application model. - If you implement a class that supports the Event-based Asynchronous Pattern, your class should call each time your *MethodName*`Async` method is called. The client application that makes calls to the method can use the `userSuppliedState` parameter to uniquely identify each invocation, so as to distinguish events raised during the execution of the asynchronous operation. + If you implement a class that supports the Event-based Asynchronous Pattern, your class should call each time your *MethodName*`Async` method is called. The client application that makes calls to the method can use the `userSuppliedState` parameter to uniquely identify each invocation, so as to distinguish events raised during the execution of the asynchronous operation. > [!CAUTION] > Client code must provide a unique value for the `userSuppliedState` parameter. Non-unique task IDs may cause your implementation to report progress and other events incorrectly. Your code should check for a non-unique task ID and throw an if one is detected. - Your code should track every returned by and use the object in the corresponding underlying asynchronous operation to post updates and terminate the operation. This tracking can be as simple as passing the as a parameter among delegates. In more sophisticated designs, your class can maintain a collection of objects, adding objects when tasks are started and removing them when tasks are completed or canceled. This approach allows you to check for unique `userSuppliedState` parameter values, and is the method you should use when working with classes that support multiple concurrent invocations. + Your code should track every returned by and use the object in the corresponding underlying asynchronous operation to post updates and terminate the operation. This tracking can be as simple as passing the as a parameter among delegates. In more sophisticated designs, your class can maintain a collection of objects, adding objects when tasks are started and removing them when tasks are completed or canceled. This approach allows you to check for unique `userSuppliedState` parameter values, and is the method you should use when working with classes that support multiple concurrent invocations. For more information about implementing asynchronous classes, see [Implementing the Event-based Asynchronous Pattern](/dotnet/standard/asynchronous-programming-patterns/implementing-the-event-based-asynchronous-pattern). ## Examples - The following code example demonstrates using the method to create an for tracking the duration of asynchronous operations. This code example is part of a larger example provided for the class. + The following code example demonstrates using the method to create an for tracking the duration of asynchronous operations. This code example is part of a larger example provided for the class. :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/AsyncCompletedEventArgs/Overview/primenumbercalculatormain.cs" id="Snippet3"::: :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/AsyncCompletedEventArgs/Overview/primenumbercalculatormain.vb" id="Snippet3"::: diff --git a/xml/System.ComponentModel/AttributeCollection.xml b/xml/System.ComponentModel/AttributeCollection.xml index 25598863f6f..4382cbb5b1c 100644 --- a/xml/System.ComponentModel/AttributeCollection.xml +++ b/xml/System.ComponentModel/AttributeCollection.xml @@ -72,7 +72,7 @@ Use the property to find the number of attributes that exist in the collection. - You can also use the methods of this class to query the collection about its contents. Call the method to verify that a specified attribute or attribute array exists in the collection. Call the method to verify that a specified attribute or array of attributes exists in the collection, and that the values of the specified attributes are the same as the values in the collection. + You can also use the methods of this class to query the collection about its contents. Call the method to verify that a specified attribute or attribute array exists in the collection. Call the method to verify that a specified attribute or array of attributes exists in the collection, and that the values of the specified attributes are the same as the values in the collection. While most attributes have default values, default values are not required. If an attribute has no default value, `null` is returned from the indexed property that takes a type. When defining your own attributes, you can declare a default value by either providing a constructor that takes no arguments, or defining a public static field of your attribute type named "Default". @@ -338,9 +338,9 @@ ## Remarks This collection has the specified attribute if the specified type of attribute exists in the collection, and if the value of the specified attribute is the same as the value of the instance of the attribute in the collection. - The difference between the and methods is that calls the method on an attribute, and calls the method. + The difference between the and methods is that calls the method on an attribute, and calls the method. - For most attributes, these methods do the same thing. For attributes that may have multiple flags, however, is typically implemented so that it returns `true` if any of the flags are satisfied. For example, consider a data binding attribute with the Boolean flags "SupportsSql", "SupportsOleDb", and "SupportsXml". This attribute may be present on a property that supports all three data-binding approaches. It will often be the case that a programmer needs to know only if a particular approach is available, not all three. Therefore, a programmer could use with an instance of the attribute containing only the flags the programmer needs. + For most attributes, these methods do the same thing. For attributes that may have multiple flags, however, is typically implemented so that it returns `true` if any of the flags are satisfied. For example, consider a data binding attribute with the Boolean flags "SupportsSql", "SupportsOleDb", and "SupportsXml". This attribute may be present on a property that supports all three data-binding approaches. It will often be the case that a programmer needs to know only if a particular approach is available, not all three. Therefore, a programmer could use with an instance of the attribute containing only the flags the programmer needs. @@ -1001,9 +1001,9 @@ ## Remarks An attribute can provide support for matching. - The difference between the and methods is that calls the method on an attribute, and calls the method. + The difference between the and methods is that calls the method on an attribute, and calls the method. - For most attributes, these methods do the same thing. For attributes that may have multiple flags, however, is typically implemented so that it returns `true` if any of the flags are satisfied. For example, consider a data binding attribute with the Boolean flags "SupportsSql", "SupportsOleDb", and "SupportsXml". This attribute may be present on a property that supports all three data binding approaches. It will often be the case that a programmer needs to know only if a particular approach is available, not all three. Therefore, a programmer could use with an instance of the attribute containing only the flags the programmer needs. + For most attributes, these methods do the same thing. For attributes that may have multiple flags, however, is typically implemented so that it returns `true` if any of the flags are satisfied. For example, consider a data binding attribute with the Boolean flags "SupportsSql", "SupportsOleDb", and "SupportsXml". This attribute may be present on a property that supports all three data binding approaches. It will often be the case that a programmer needs to know only if a particular approach is available, not all three. Therefore, a programmer could use with an instance of the attribute containing only the flags the programmer needs. diff --git a/xml/System.ComponentModel/AttributeProviderAttribute.xml b/xml/System.ComponentModel/AttributeProviderAttribute.xml index 54b3f6c58d6..c25a2d08aea 100644 --- a/xml/System.ComponentModel/AttributeProviderAttribute.xml +++ b/xml/System.ComponentModel/AttributeProviderAttribute.xml @@ -62,7 +62,7 @@ ## Remarks There are a few cases in the .NET Framework object model where a property is purposely typed to be vague. For example, the property is typed as `object`. The reason for this is that this property can accept several types of input. Unfortunately, this provides no common place to add metadata to describe the characteristics of the property. Each `DataSource` property throughout the .NET Framework needs to have identical metadata for type converters, UI type editors, and other services that require metadata. The remedies this situation. - Once this attribute is placed on a property, the rules for obtaining attributes for the property descriptor's collection differ. Typically, the property descriptor gathers local attributes, and then merges these with attributes from the property type. In this case, the attributes are taken from the type returned from the , not from the actual property type. This attribute is used on to point the object's specific type to , and the appropriate metadata is placed on to enable data binding. In so doing, external parties can easily add metadata to all data sources. + Once this attribute is placed on a property, the rules for obtaining attributes for the property descriptor's collection differ. Typically, the property descriptor gathers local attributes, and then merges these with attributes from the property type. In this case, the attributes are taken from the type returned from the , not from the actual property type. This attribute is used on to point the object's specific type to , and the appropriate metadata is placed on to enable data binding. In so doing, external parties can easily add metadata to all data sources. Attributes obtained from a type declared in the have a priority in between the attributes of the property's type and the attributes on the property. The following list, in priority order, shows the full set of available merged attributes: diff --git a/xml/System.ComponentModel/BackgroundWorker.xml b/xml/System.ComponentModel/BackgroundWorker.xml index bea78c0d204..d92fba39c3b 100644 --- a/xml/System.ComponentModel/BackgroundWorker.xml +++ b/xml/System.ComponentModel/BackgroundWorker.xml @@ -73,14 +73,14 @@ To execute a time-consuming operation in the background, create a and listen for events that report the progress of your operation and signal when your operation is finished. You can create the programmatically or you can drag it onto your form from the **Components** tab of the **Toolbox**. If you create the in the Windows Forms Designer, it will appear in the Component Tray, and its properties will be displayed in the Properties window. - To set up for a background operation, add an event handler for the event. Call your time-consuming operation in this event handler. To start the operation, call . To receive notifications of progress updates, handle the event. To receive a notification when the operation is completed, handle the event. + To set up for a background operation, add an event handler for the event. Call your time-consuming operation in this event handler. To start the operation, call . To receive notifications of progress updates, handle the event. To receive a notification when the operation is completed, handle the event. > [!NOTE] > You must be careful not to manipulate any user-interface objects in your event handler. Instead, communicate to the user interface through the and events. > > events are not marshaled across boundaries. Do not use a component to perform multithreaded operations in more than one . - If your background operation requires a parameter, call with your parameter. Inside the event handler, you can extract the parameter from the property. + If your background operation requires a parameter, call with your parameter. Inside the event handler, you can extract the parameter from the property. For more information about , see [How to: Run an Operation in the Background](/dotnet/framework/winforms/controls/how-to-run-an-operation-in-the-background). @@ -203,17 +203,17 @@ submits a request to terminate the pending background operation and sets the property to `true`. + submits a request to terminate the pending background operation and sets the property to `true`. - When you call , your worker method has an opportunity to stop its execution and exit. The worker code should periodically check the property to see if it has been set to `true`. + When you call , your worker method has an opportunity to stop its execution and exit. The worker code should periodically check the property to see if it has been set to `true`. > [!CAUTION] -> Be aware that your code in the event handler may finish its work as a cancellation request is being made, and your polling loop may miss being set to `true`. In this case, the flag of in your event handler will not be set to `true`, even though a cancellation request was made. This situation is called a *race condition* and is a common concern in multithreaded programming. For more information about multithreading design issues, see [Managed Threading Best Practices](/dotnet/standard/threading/managed-threading-best-practices). +> Be aware that your code in the event handler may finish its work as a cancellation request is being made, and your polling loop may miss being set to `true`. In this case, the flag of in your event handler will not be set to `true`, even though a cancellation request was made. This situation is called a *race condition* and is a common concern in multithreaded programming. For more information about multithreading design issues, see [Managed Threading Best Practices](/dotnet/standard/threading/managed-threading-best-practices). ## Examples - The following code example demonstrates the use of the method to cancel an asynchronous ("background") operation. This code example is part of a larger example provided for the class. + The following code example demonstrates the use of the method to cancel an asynchronous ("background") operation. This code example is part of a larger example provided for the class. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.ComponentModel.BackgroundWorker/CPP/fibonacciform.cpp" id="Snippet4"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/BackgroundWorker/Overview/fibonacciform.cs" id="Snippet4"::: @@ -281,9 +281,9 @@ is `true`, then the method has been called on the . + If is `true`, then the method has been called on the . - This property is meant for use by the worker thread, which should periodically check and abort the background operation when it is set to `true`. + This property is meant for use by the worker thread, which should periodically check and abort the background operation when it is set to `true`. @@ -412,12 +412,12 @@ method. This is where you start the operation that performs the potentially time-consuming work. + This event is raised when you call the method. This is where you start the operation that performs the potentially time-consuming work. - Your code in the event handler should periodically check the property value and abort the operation if it is `true`. When this occurs, you can set the flag of to `true`, and the flag of in your event handler will be set to `true`. + Your code in the event handler should periodically check the property value and abort the operation if it is `true`. When this occurs, you can set the flag of to `true`, and the flag of in your event handler will be set to `true`. > [!CAUTION] -> Be aware that your code in the event handler may finish its work as a cancellation request is being made, and your polling loop may miss being set to `true`. In this case, the flag of in your event handler will not be set to `true`, even though a cancellation request was made. This situation is called a *race condition* and is a common concern in multithreaded programming. For more information about multithreading design issues, see [Managed Threading Best Practices](/dotnet/standard/threading/managed-threading-best-practices). +> Be aware that your code in the event handler may finish its work as a cancellation request is being made, and your polling loop may miss being set to `true`. In this case, the flag of in your event handler will not be set to `true`, even though a cancellation request was made. This situation is called a *race condition* and is a common concern in multithreaded programming. For more information about multithreading design issues, see [Managed Threading Best Practices](/dotnet/standard/threading/managed-threading-best-practices). If your operation produces a result, you can assign the result to the property. This will be available to the event handler in the property. @@ -497,7 +497,7 @@ starts an asynchronous operation when you call . + The starts an asynchronous operation when you call . @@ -609,12 +609,12 @@ ## Remarks Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). - The method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + The method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. ## Examples - The following code example demonstrates the use of the method to report the progress of an asynchronous operation. This code example is part of a larger example provided for the class. + The following code example demonstrates the use of the method to report the progress of an asynchronous operation. This code example is part of a larger example provided for the class. :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/AsyncCompletedEventArgs/Overview/primenumbercalculatormain.cs" id="Snippet24"::: :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/AsyncCompletedEventArgs/Overview/primenumbercalculatormain.vb" id="Snippet24"::: @@ -677,7 +677,7 @@ ## Remarks Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). - The method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + The method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. ]]> @@ -732,7 +732,7 @@ method. + This event is raised when you call the method. For more information about how to handle events, see [Handling and Raising Events](/dotnet/standard/events/). @@ -813,16 +813,16 @@ method to raise the event. The property value must be `true`, or will throw an . + If you need the background operation to report on its progress, you can call the method to raise the event. The property value must be `true`, or will throw an . It is up to you to implement a meaningful way of measuring your background operation's progress as a percentage of the total task completed. - The call to the method is asynchronous and returns immediately. The event handler executes on the thread that created the . + The call to the method is asynchronous and returns immediately. The event handler executes on the thread that created the . ## Examples - The following code example demonstrates the use of the method to report the progress of an asynchronous operation to the user. This code example is part of a larger example provided for the class. + The following code example demonstrates the use of the method to report the progress of an asynchronous operation to the user. This code example is part of a larger example provided for the class. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.ComponentModel.BackgroundWorker/CPP/fibonacciform.cpp" id="Snippet8"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/BackgroundWorker/Overview/fibonacciform.cs" id="Snippet8"::: @@ -884,14 +884,14 @@ method to raise the event. The property value must `true`, or will throw an . + If you need the background operation to report on its progress, you can call the method to raise the event. The property value must `true`, or will throw an . It is up to you to implement a meaningful way of measuring your background operation's progress as a percentage of the total task completed. ## Examples - The following code example demonstrates the use of the method to report the progress of an asynchronous operation to the user. This code example is part of a larger example provided for the class. + The following code example demonstrates the use of the method to report the progress of an asynchronous operation to the user. This code example is part of a larger example provided for the class. :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/BackgroundWorker/ReportProgress/form1.cs" id="Snippet10"::: :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/BackgroundWorker/ReportProgress/form1.vb" id="Snippet10"::: @@ -962,14 +962,14 @@ method submits a request to start the operation running asynchronously. When the request is serviced, the event is raised, which in turn starts execution of your background operation. + The method submits a request to start the operation running asynchronously. When the request is serviced, the event is raised, which in turn starts execution of your background operation. - If the background operation is already running, calling again will raise an . + If the background operation is already running, calling again will raise an . ## Examples - The following code example demonstrates the use of the method to start an asynchronous operation. It is part of a larger example described in [How to: Download a File in the Background](/dotnet/framework/winforms/controls/how-to-download-a-file-in-the-background). + The following code example demonstrates the use of the method to start an asynchronous operation. It is part of a larger example described in [How to: Download a File in the Background](/dotnet/framework/winforms/controls/how-to-download-a-file-in-the-background). :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/BackgroundWorker/IsBusy/Form1.cs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/BackgroundWorker/IsBusy/Form1.vb" id="Snippet2"::: @@ -1031,16 +1031,16 @@ method submits a request to start the operation running asynchronously. When the request is serviced, the event is raised, which in turn starts execution of your background operation. + The method submits a request to start the operation running asynchronously. When the request is serviced, the event is raised, which in turn starts execution of your background operation. - If your operation requires a parameter, you can provide it as the `argument` parameter to . + If your operation requires a parameter, you can provide it as the `argument` parameter to . - If the background operation is already running, calling again will raise an . + If the background operation is already running, calling again will raise an . ## Examples - The following code example demonstrates the use of the method to start an asynchronous operation. This code example is part of a larger example provided for the class. + The following code example demonstrates the use of the method to start an asynchronous operation. This code example is part of a larger example provided for the class. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.ComponentModel.BackgroundWorker/CPP/fibonacciform.cpp" id="Snippet3"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/BackgroundWorker/Overview/fibonacciform.cs" id="Snippet3"::: @@ -1105,12 +1105,12 @@ The property of indicates that an exception was thrown by the operation. - The property of indicates whether a cancellation request was processed by the background operation. If your code in the event handler detects a cancellation request by checking the flag and setting the flag of to `true`, the flag of also will be set to `true`. + The property of indicates whether a cancellation request was processed by the background operation. If your code in the event handler detects a cancellation request by checking the flag and setting the flag of to `true`, the flag of also will be set to `true`. > [!CAUTION] -> Be aware that your code in the event handler may finish its work as a cancellation request is being made, and your polling loop may miss being set to `true`. In this case, the flag of in your event handler will not be set to `true`, even though a cancellation request was made. This situation is called a *race condition* and is a common concern in multithreaded programming. For more information about multithreading design issues, see [Managed Threading Best Practices](/dotnet/standard/threading/managed-threading-best-practices). +> Be aware that your code in the event handler may finish its work as a cancellation request is being made, and your polling loop may miss being set to `true`. In this case, the flag of in your event handler will not be set to `true`, even though a cancellation request was made. This situation is called a *race condition* and is a common concern in multithreaded programming. For more information about multithreading design issues, see [Managed Threading Best Practices](/dotnet/standard/threading/managed-threading-best-practices). - Your event handler should always check the and properties before accessing the property. If an exception was raised or if the operation was canceled, accessing the property raises an exception. + Your event handler should always check the and properties before accessing the property. If an exception was raised or if the operation was canceled, accessing the property raises an exception. @@ -1185,7 +1185,7 @@ property to `true` if you want the to support progress updates. When this property is `true`, user code can call the method to raise the event. + Set the property to `true` if you want the to support progress updates. When this property is `true`, user code can call the method to raise the event. ]]> @@ -1252,7 +1252,7 @@ property to `true` if you want the to support cancellation. When this property is `true`, you can call the method to interrupt a background operation. + Set the property to `true` if you want the to support cancellation. When this property is `true`, you can call the method to interrupt a background operation. ]]> diff --git a/xml/System.ComponentModel/BindableAttribute.xml b/xml/System.ComponentModel/BindableAttribute.xml index 93745662b63..08d8bc4edd1 100644 --- a/xml/System.ComponentModel/BindableAttribute.xml +++ b/xml/System.ComponentModel/BindableAttribute.xml @@ -61,10 +61,10 @@ ## Remarks You can specify this attribute for multiple members, typically properties, on a control. - If a property has been marked with the set to `true`, then a property change notification should be raised for that property. This means that if the property is , then two-way data binding is supported. If is , you can still bind to the property, but it should not be shown in the default set of properties to bind to, because it might or might not raise a property change notification. + If a property has been marked with the set to `true`, then a property change notification should be raised for that property. This means that if the property is , then two-way data binding is supported. If is , you can still bind to the property, but it should not be shown in the default set of properties to bind to, because it might or might not raise a property change notification. > [!NOTE] -> When you mark a property with set to `true`, the value of this attribute is set to the constant member . For a property marked with the set to `false`, the value is . Therefore, to check the value of this attribute in your code, you must specify the attribute as or . +> When you mark a property with set to `true`, the value of this attribute is set to the constant member . For a property marked with the set to `false`, the value is . Therefore, to check the value of this attribute in your code, you must specify the attribute as or . > [!CAUTION] > You can use this attribute at design time only. Nothing prevents you from binding to any property during run time. @@ -80,7 +80,7 @@ :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/BindableAttribute/Overview/source.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/BindableAttribute/Overview/source.vb" id="Snippet1"::: - The next code example shows how to check the value of the for `MyProperty`. First, the code gets a with all the properties for the object. Next, the code indexes into the to get `MyProperty`. Finally, the code returns the attributes for this property and saves them in the attributes variable. The code example presents two different ways to check the value of the . In the second code fragment, the example calls the method. In the last code fragment, the example uses the property to check the value. + The next code example shows how to check the value of the for `MyProperty`. First, the code gets a with all the properties for the object. Next, the code indexes into the to get `MyProperty`. Finally, the code returns the attributes for this property and saves them in the attributes variable. The code example presents two different ways to check the value of the . In the second code fragment, the example calls the method. In the last code fragment, the example uses the property to check the value. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic BindableAttribute Example/CPP/source.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/BindableAttribute/Overview/source.cs" id="Snippet2"::: @@ -696,7 +696,7 @@ ## Remarks The field is the default setting for the . - When you mark a property with the constructor of the value `false,` the value of this attribute is set to the constant member . Therefore, to check whether the attribute is set to this value in your code, you must specify the attribute as . + When you mark a property with the constructor of the value `false,` the value of this attribute is set to the constant member . Therefore, to check whether the attribute is set to this value in your code, you must specify the attribute as . ]]> @@ -746,7 +746,7 @@ constructor of the value `true`, the value of the is set to the constant member . Therefore, to check whether the attribute is set to this value in your code, you must specify the attribute as . + When you mark a property with the constructor of the value `true`, the value of the is set to the constant member . Therefore, to check whether the attribute is set to this value in your code, you must specify the attribute as . ]]> diff --git a/xml/System.ComponentModel/BindableSupport.xml b/xml/System.ComponentModel/BindableSupport.xml index 78fc1371d9c..e242af24d40 100644 --- a/xml/System.ComponentModel/BindableSupport.xml +++ b/xml/System.ComponentModel/BindableSupport.xml @@ -45,16 +45,16 @@ Specifies values to indicate whether a property can be bound to a data element or another property. - enumeration to indicate whether a property can be bound, see the sample code in . - + enumeration to indicate whether a property can be bound, see the sample code in . + ]]> diff --git a/xml/System.ComponentModel/BindingList`1.xml b/xml/System.ComponentModel/BindingList`1.xml index 1c9c584e6b0..414a37f0648 100644 --- a/xml/System.ComponentModel/BindingList`1.xml +++ b/xml/System.ComponentModel/BindingList`1.xml @@ -101,14 +101,14 @@ class can be used as a base class to create a two-way data-binding mechanism. provides a concrete, generic implementation of the interface. This is an alternative to implementing the complete interface, which can be difficult because of the subtle interaction between , , and the associated . However, the typical solutions programmer will use a class that provides data binding functionality, such as , instead of directly using . + The class can be used as a base class to create a two-way data-binding mechanism. provides a concrete, generic implementation of the interface. This is an alternative to implementing the complete interface, which can be difficult because of the subtle interaction between , , and the associated . However, the typical solutions programmer will use a class that provides data binding functionality, such as , instead of directly using . - supports factory-created instances through the extensible method. (This same type of extensibility is also found in other classes, such as ) In addition, since this class implements the interface, it enables transactional commits or rollbacks of the new item through the and methods. + supports factory-created instances through the extensible method. (This same type of extensibility is also found in other classes, such as ) In addition, since this class implements the interface, it enables transactional commits or rollbacks of the new item through the and methods. ## Examples - The following code example demonstrates binding to a component containing a business object. This is a complete example that contains a `Main` method. + The following code example demonstrates binding to a component containing a business object. This is a complete example that contains a `Main` method. :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/BindingListT/Overview/Form1.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/BindingListT/Overview/Form1.vb" id="Snippet1"::: @@ -177,19 +177,19 @@ class. + The following table shows initial property values for an instance of class. |Property|Initial Value| |--------------|-------------------| -||`true`| -||`true` if the list type has a parameterless constructor; otherwise, `false`.| -||`true`| -||`true`| +||`true`| +||`true` if the list type has a parameterless constructor; otherwise, `false`.| +||`true`| +||`true`| ## Examples - The following code example demonstrates how to construct a new . For the complete example, see the class overview topic. + The following code example demonstrates how to construct a new . For the complete example, see the class overview topic. :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/BindingListT/Overview/Form1.cs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/BindingListT/Overview/Form1.vb" id="Snippet2"::: @@ -247,16 +247,16 @@ to create a that is backed by `list`, which ensures that changes to `list` are reflected in the . + Use this to create a that is backed by `list`, which ensures that changes to `list` are reflected in the . - The following table shows initial property values for an instance of class. + The following table shows initial property values for an instance of class. |Property|Initial Value| |--------------|-------------------| -||`true`| -||`true` if the list type has a parameterless constructor; otherwise, `false`.| -||`true`| -||`true`| +||`true`| +||`true` if the list type has a parameterless constructor; otherwise, `false`.| +||`true`| +||`true`| ]]> @@ -304,14 +304,14 @@ event occurs before a new object is added to the collection represented by the property. This event is raised after the method is called, but before the new item is created and added to the internal list. By handling this event, the programmer can provide custom item creation and insertion behavior without being forced to derive from the class. + The event occurs before a new object is added to the collection represented by the property. This event is raised after the method is called, but before the new item is created and added to the internal list. By handling this event, the programmer can provide custom item creation and insertion behavior without being forced to derive from the class. - For more information about supplying custom new item functionality, see the method. For more information about how to handle events, see [Handling and Raising Events](/dotnet/standard/events/). + For more information about supplying custom new item functionality, see the method. For more information about how to handle events, see [Handling and Raising Events](/dotnet/standard/events/). ## Examples - The following code example demonstrates how to handle the event. For the complete example, see the class overview topic. + The following code example demonstrates how to handle the event. For the complete example, see the class overview topic. :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/BindingListT/Overview/Form1.cs" id="Snippet3"::: :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/BindingListT/Overview/Form1.vb" id="Snippet3"::: @@ -366,9 +366,9 @@ method adds a new item to the collection represented by the property. To add a new item, the following logic is used: + The method adds a new item to the collection represented by the property. To add a new item, the following logic is used: -1. The event is automatically raised. +1. The event is automatically raised. This event can be programmatically handled to construct a new custom item. This is accomplished in the event handler by setting the property of the parameter to the new item. @@ -376,18 +376,18 @@ 2. The position of the new item is tracked, but it is not added to the list until one of the following conditions are met: - - The item is explicitly committed by a call to . + - The item is explicitly committed by a call to . - The item is implicitly committed by some other operation that changed the contents of the list, such as an insertion or removal of an item. - In contrast, calling the method before the item is committed will cause the new item to be discarded. + In contrast, calling the method before the item is committed will cause the new item to be discarded. - This method raises the event when the new item is committed. + This method raises the event when the new item is committed. ## Examples - The following code example demonstrates how to use the method. . For the complete example, see the class overview topic. + The following code example demonstrates how to use the method. . For the complete example, see the class overview topic. :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/BindingListT/Overview/Form1.cs" id="Snippet4"::: :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/BindingListT/Overview/Form1.vb" id="Snippet4"::: @@ -454,7 +454,7 @@ method adds a new item to the collection represented by the property. raises the event. This allows you to add a new item by setting the property of the parameter to the new item. Otherwise, the new item is automatically created through its public parameterless constructor. + The method adds a new item to the collection represented by the property. raises the event. This allows you to add a new item by setting the property of the parameter to the new item. Otherwise, the new item is automatically created through its public parameterless constructor. ]]> @@ -515,12 +515,12 @@ property is typically used by other components to determine if editing of items in the list is allowed. When is set to a new value, a event of type will occur. + The property is typically used by other components to determine if editing of items in the list is allowed. When is set to a new value, a event of type will occur. ## Examples - The following code example demonstrates how to set the property. For the complete example, see the class overview topic. + The following code example demonstrates how to set the property. For the complete example, see the class overview topic. :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/BindingListT/Overview/Form1.cs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/BindingListT/Overview/Form1.vb" id="Snippet2"::: @@ -574,14 +574,14 @@ property is typically used by other components to determine if the creation of new items is allowed. defaults to `true` if the type contained in the list has a parameterless constructor or the event is handled. If the event is not handled or the list type does not have a parameterless constructor, then defaults to `false`. + The property is typically used by other components to determine if the creation of new items is allowed. defaults to `true` if the type contained in the list has a parameterless constructor or the event is handled. If the event is not handled or the list type does not have a parameterless constructor, then defaults to `false`. - If is explicitly set, the set value will always be used by bound objects to determine if new items can be added to the list. Whether is `true` or `false`, new items can be added by explicitly calling if the list type has a parameterless constructor or the event is handled. In addition, setting causes a event of type to occur. + If is explicitly set, the set value will always be used by bound objects to determine if new items can be added to the list. Whether is `true` or `false`, new items can be added by explicitly calling if the list type has a parameterless constructor or the event is handled. In addition, setting causes a event of type to occur. ## Examples - The following code example demonstrates how to set the property. For the complete example, see the class overview topic. + The following code example demonstrates how to set the property. For the complete example, see the class overview topic. :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/BindingListT/Overview/Form1.cs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/BindingListT/Overview/Form1.vb" id="Snippet2"::: @@ -642,14 +642,14 @@ property is typically used by other components to determine if the removal of items is allowed. + The property is typically used by other components to determine if the removal of items is allowed. - When is set to a new value, a event of type occurs. + When is set to a new value, a event of type occurs. ## Examples - The following code example demonstrates how to set the property. For the complete example, see the class overview topic. + The following code example demonstrates how to set the property. For the complete example, see the class overview topic. :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/BindingListT/Overview/Form1.cs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/BindingListT/Overview/Form1.vb" id="Snippet2"::: @@ -708,15 +708,15 @@ class does not provide a base implementation of sorting, so always throws a by default. To enable sorting, derive from and perform the following tasks: + The class does not provide a base implementation of sorting, so always throws a by default. To enable sorting, derive from and perform the following tasks: -- Override and implement sorting, raising the event when sorting is complete. +- Override and implement sorting, raising the event when sorting is complete. -- Override and implement sort removal. +- Override and implement sort removal. -- Override and set to `true`. +- Override and set to `true`. - In addition, you may want to implement the supplemental and sorting properties. + In addition, you may want to implement the supplemental and sorting properties. ]]> @@ -771,14 +771,14 @@ method rolls back a pending new item that was added through the method, but has not yet been committed. + The method rolls back a pending new item that was added through the method, but has not yet been committed. - For more information about adding and committing new items, see the method + For more information about adding and committing new items, see the method ## Examples - The following code example demonstrates how use the method. For the complete example, see the class overview topic. + The following code example demonstrates how use the method. For the complete example, see the class overview topic. :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/BindingListT/Overview/Form1.cs" id="Snippet4"::: :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/BindingListT/Overview/Form1.vb" id="Snippet4"::: @@ -833,9 +833,9 @@ method removes all the items from the collection represented by the property. + The method removes all the items from the collection represented by the property. - calls the method before clearing out the collection and raises the event after it has been cleared. + calls the method before clearing out the collection and raises the event after it has been cleared. ]]> @@ -892,9 +892,9 @@ method commits a pending new item that was added through the method. If there is no new item waiting to be committed, then this method does nothing. + The method commits a pending new item that was added through the method. If there is no new item waiting to be committed, then this method does nothing. - For more information about adding and committing new items, see the method. + For more information about adding and committing new items, see the method. ]]> @@ -952,16 +952,16 @@ class does not provide a base implementation of searching, and so always throws a by default. To enable searching, derive from and perform the following tasks: + The class does not provide a base implementation of searching, and so always throws a by default. To enable searching, derive from and perform the following tasks: -- Override to set the property to `true`. +- Override to set the property to `true`. -- Override to implement the find algorithm. +- Override to implement the find algorithm. ## Examples - The following code example demonstrates how to use the member. + The following code example demonstrates how to use the member. :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/BindingListT/FindCore/Form1.cs" id="Snippet3"::: :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/BindingListT/FindCore/Form1.vb" id="Snippet3"::: @@ -1019,13 +1019,13 @@ performs the following operations: + performs the following operations: -- Calls to commit any uncommitted items added through the event. +- Calls to commit any uncommitted items added through the event. - Inserts the item at the specified index -- Raises a event of type indicating the index of the item that was inserted. +- Raises a event of type indicating the index of the item that was inserted. ]]> @@ -1074,17 +1074,17 @@ class does not provide a base implementation of sorting, so always returns `false` by default. + The class does not provide a base implementation of sorting, so always returns `false` by default. - The class does not provide a base implementation of sorting. To enable sorting, derive a class from and: + The class does not provide a base implementation of sorting. To enable sorting, derive a class from and: -- Override and implement sorting raising the event when sorting is complete. +- Override and implement sorting raising the event when sorting is complete. -- Override and implement sort removal. +- Override and implement sort removal. -- Override and set to `true`. +- Override and set to `true`. - In addition, you may want to implement the supplemental and s sorting properties. + In addition, you may want to implement the supplemental and s sorting properties. ]]> @@ -1134,14 +1134,14 @@ notifications for item value changes are only raised if the list item type implements the interface. + notifications for item value changes are only raised if the list item type implements the interface. For more information about how to handle events, see [Handling and Raising Events](/dotnet/standard/events/). ## Examples - The following code example demonstrates how handle the event. For the complete example, see the class overview topic. + The following code example demonstrates how handle the event. For the complete example, see the class overview topic. :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/BindingListT/Overview/Form1.cs" id="Snippet5"::: @@ -1197,11 +1197,11 @@ event and the method allow custom-created items to be added to the list. + The event and the method allow custom-created items to be added to the list. Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). - The method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + The method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. ]]> @@ -1258,7 +1258,7 @@ method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + The method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. ]]> @@ -1318,12 +1318,12 @@ property to `false` if you wish to suppress events from occurring on the list. + Set the property to `false` if you wish to suppress events from occurring on the list. ## Examples - The following code example demonstrates how use the method. For the complete example, see the class overview topic. + The following code example demonstrates how use the method. For the complete example, see the class overview topic. :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/BindingListT/Overview/Form1.cs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/BindingListT/Overview/Form1.vb" id="Snippet2"::: @@ -1377,7 +1377,7 @@ event of type . + This method raises the event of type . ]]> @@ -1428,7 +1428,7 @@ class does not provide a base implementation of sorting, so always throws a by default. For more information about sorting, see the method. + The class does not provide a base implementation of sorting, so always throws a by default. For more information about sorting, see the method. ]]> @@ -1483,7 +1483,7 @@ is bound to Windows Forms controls, the method causes a refresh of all controls bound to the list. + When the is bound to Windows Forms controls, the method causes a refresh of all controls bound to the list. ]]> @@ -1540,7 +1540,7 @@ is bound to Windows Forms controls, the method causes a refresh of controls bound to the item at the specified position. + When the is bound to Windows Forms controls, the method causes a refresh of controls bound to the item at the specified position. ]]> @@ -1593,7 +1593,7 @@ raises a event of type indicating the index of the item that was set. + After the item is set, raises a event of type indicating the index of the item that was set. ]]> @@ -1649,7 +1649,7 @@ class does not provide a base implementation of sorting, so always returns by default. For more information about sorting, see the method. + The class does not provide a base implementation of sorting, so always returns by default. For more information about sorting, see the method. ]]> @@ -1704,15 +1704,15 @@ returns `null` by default because the class does not provide a base implementation of sorting. To enable sorting, derive a class from and: + returns `null` by default because the class does not provide a base implementation of sorting. To enable sorting, derive a class from and: -- Override and implement sorting. +- Override and implement sorting. -- Override and implement sort removal. +- Override and implement sort removal. -- Override and set to `true`. +- Override and set to `true`. -- Optionally, override the to return the used for sorting. +- Optionally, override the to return the used for sorting. ]]> @@ -1761,7 +1761,7 @@ provides the implementation for . You can derive a class from and override the default value. + provides the implementation for . You can derive a class from and override the default value. ]]> @@ -1810,12 +1810,12 @@ class does not provide a base implementation of searching, so always returns `false` by default. For more information about implementing searching, see the method. + The class does not provide a base implementation of searching, so always returns `false` by default. For more information about implementing searching, see the method. ## Examples - The following code example demonstrates how to use the member. + The following code example demonstrates how to use the member. :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/BindingListT/FindCore/Form1.cs" id="Snippet3"::: :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/BindingListT/FindCore/Form1.vb" id="Snippet3"::: @@ -1867,9 +1867,9 @@ property indicates whether the supports sorting with the method. + The property indicates whether the supports sorting with the method. - The class does not provide a base implementation of sorting, so always returns `false` by default. For more information about implementing sorting, see the method. + The class does not provide a base implementation of sorting, so always returns `false` by default. For more information about implementing sorting, see the method. ]]> @@ -1925,7 +1925,7 @@ ## Remarks The base implementation of this method does nothing. If this functionality is desired, a derived class must implement it. - This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -1978,9 +1978,9 @@ instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. - This implementation calls to add a new item to the list. + This implementation calls to add a new item to the list. ]]> @@ -2039,7 +2039,7 @@ property is typically used by other components to determine if editing of items in the list is allowed. + The property is typically used by other components to determine if editing of items in the list is allowed. ]]> @@ -2219,7 +2219,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -2282,7 +2282,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -2340,7 +2340,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -2396,7 +2396,7 @@ This member is an explicit interface member implementation. It can be used only ## Remarks The base implementation of this method does nothing. If this functionality is desired, a derived class must implement it. - This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -2454,7 +2454,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -2511,7 +2511,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -2573,7 +2573,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -2631,7 +2631,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -2689,7 +2689,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -2747,7 +2747,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -2799,7 +2799,7 @@ This member is an explicit interface member implementation. It can be used only checks the list type to see if it implements the interface to indicate that it raises events of when property values are changed on individual list items. This member cannot be overridden in a derived class. + checks the list type to see if it implements the interface to indicate that it raises events of when property values are changed on individual list items. This member cannot be overridden in a derived class. ]]> diff --git a/xml/System.ComponentModel/BooleanConverter.xml b/xml/System.ComponentModel/BooleanConverter.xml index 5f0cb187519..5db8a619805 100644 --- a/xml/System.ComponentModel/BooleanConverter.xml +++ b/xml/System.ComponentModel/BooleanConverter.xml @@ -54,25 +54,25 @@ Provides a type converter to convert objects to and from various other representations. - object to and from a string. - - For more information about type converters, see the base class and [How to: Implement a Type Converter](https://learn.microsoft.com/previous-versions/visualstudio/visual-studio-2013/ayybcxe5(v=vs.120)). - + object to and from a string. + + For more information about type converters, see the base class and [How to: Implement a Type Converter](https://learn.microsoft.com/previous-versions/visualstudio/visual-studio-2013/ayybcxe5(v=vs.120)). + > [!NOTE] -> You should never create an instance of a . Instead, call the method of the class. For more information, see the examples in the base class. - - - -## Examples - The following code example converts a variable of type to and from a string. - +> You should never create an instance of a . Instead, call the method of the class. For more information, see the examples in the base class. + + + +## Examples + The following code example converts a variable of type to and from a string. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Converters/CPP/converters.cpp" id="Snippet3"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/BooleanConverter/Overview/converters.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/BooleanConverter/Overview/converters.vb" id="Snippet3"::: - + :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/BooleanConverter/Overview/converters.vb" id="Snippet3"::: + ]]> @@ -178,13 +178,13 @@ if this object can perform the conversion; otherwise, . - @@ -247,13 +247,13 @@ Converts the given value object to a Boolean object. An that represents the converted . - @@ -315,11 +315,11 @@ Gets a collection of standard values for the Boolean data type. A that holds a standard set of valid values. - @@ -371,11 +371,11 @@ because the returned from is an exhaustive list of possible values. This method never returns . - returned from this method has all possible values. Therefore, this method always returns `true`. - + returned from this method has all possible values. Therefore, this method always returns `true`. + ]]> @@ -427,11 +427,11 @@ because can be called to find a common set of values the object supports. This method never returns . - diff --git a/xml/System.ComponentModel/BrowsableAttribute.xml b/xml/System.ComponentModel/BrowsableAttribute.xml index 7d314f3101c..63d1f9f0b18 100644 --- a/xml/System.ComponentModel/BrowsableAttribute.xml +++ b/xml/System.ComponentModel/BrowsableAttribute.xml @@ -60,7 +60,7 @@ constructor's `browsable` parameter set to `true`. These members can be modified at design time. Members marked with the constructor's `browsable` parameter set to `false` are not appropriate for design-time editing and therefore are not displayed in a visual designer. The default is `true`. + A visual designer typically displays in the Properties window those members that either have no browsable attribute or are marked with the constructor's `browsable` parameter set to `true`. These members can be modified at design time. Members marked with the constructor's `browsable` parameter set to `false` are not appropriate for design-time editing and therefore are not displayed in a visual designer. The default is `true`. > [!NOTE] > When you mark a property with `Browsable(true)`, the value of this attribute is set to the constant member . For a property marked with `Browsable(false)`, the value is . Therefore, when you check the value of this attribute in your code, you must specify the attribute as or . @@ -78,7 +78,7 @@ The next example shows how to check the value of the for `MyProperty`. First, the code gets a with all the properties for the object. Next, the code indexes into the to get `MyProperty`. Then it returns the attributes for this property and saves them in the attributes variable. - The example presents two different ways of checking the value of the . In the second code fragment, the example calls the method. In the last code fragment, the example uses the property to check the value. + The example presents two different ways of checking the value of the . In the second code fragment, the example calls the method. In the last code fragment, the example uses the property to check the value. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic BrowsableAttribute Example/CPP/source.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/BrowsableAttribute/Overview/source.cs" id="Snippet2"::: @@ -144,7 +144,7 @@ constructor of the value `true`, the value of this attribute is set to the constant member . For a property marked with the constructor of the value `false`, the value is . Therefore, when you want to check the value of this attribute in your code, you must specify the attribute as or . + When you mark a property with the constructor of the value `true`, the value of this attribute is set to the constant member . For a property marked with the constructor of the value `false`, the value is . Therefore, when you want to check the value of this attribute in your code, you must specify the attribute as or . @@ -474,7 +474,7 @@ constructor of the value `false`, this attribute is set to the constant member . Therefore, when you check whether the attribute is set to this value in your code, you must specify the attribute as . + When you mark a property with the constructor of the value `false`, this attribute is set to the constant member . Therefore, when you check whether the attribute is set to this value in your code, you must specify the attribute as . ]]> @@ -527,7 +527,7 @@ ## Remarks This field is the default setting for this attribute. - When you mark a property with the constructor of the value `true`, this attribute is set to the constant member . Therefore, when you check whether the attribute is set to this value in your code, you must specify the attribute as . + When you mark a property with the constructor of the value `true`, this attribute is set to the constant member . Therefore, when you check whether the attribute is set to this value in your code, you must specify the attribute as . ]]> diff --git a/xml/System.ComponentModel/ByteConverter.xml b/xml/System.ComponentModel/ByteConverter.xml index 266f6efc60f..0209d132fcb 100644 --- a/xml/System.ComponentModel/ByteConverter.xml +++ b/xml/System.ComponentModel/ByteConverter.xml @@ -48,25 +48,25 @@ Provides a type converter to convert 8-bit unsigned integer objects to and from various other representations. - base class and [How to: Implement a Type Converter](https://learn.microsoft.com/previous-versions/visualstudio/visual-studio-2013/ayybcxe5(v=vs.120)). - + base class and [How to: Implement a Type Converter](https://learn.microsoft.com/previous-versions/visualstudio/visual-studio-2013/ayybcxe5(v=vs.120)). + > [!NOTE] -> You should never create an instance of a . Instead, call the method of . For more information, see the examples in the base class. - - - -## Examples - The following code example declares and initializes an 8-bit unsigned integer and a string. The code then converts each of them to the other's type, respectively. - +> You should never create an instance of a . Instead, call the method of . For more information, see the examples in the base class. + + + +## Examples + The following code example declares and initializes an 8-bit unsigned integer and a string. The code then converts each of them to the other's type, respectively. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Converters/CPP/converters.cpp" id="Snippet4"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/BooleanConverter/Overview/converters.cs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/BooleanConverter/Overview/converters.vb" id="Snippet4"::: - + :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/BooleanConverter/Overview/converters.vb" id="Snippet4"::: + ]]> diff --git a/xml/System.ComponentModel/CategoryAttribute.xml b/xml/System.ComponentModel/CategoryAttribute.xml index 7abef1c564a..8a042a89cbf 100644 --- a/xml/System.ComponentModel/CategoryAttribute.xml +++ b/xml/System.ComponentModel/CategoryAttribute.xml @@ -228,7 +228,7 @@ ## Remarks If the name you provide for the `category` parameter is one of the predefined category names, the name will be automatically localized by the property. - If the name you provide is not a predefined category name, and you do not override the method to provide a localized name, the category name will not be localized. + If the name you provide is not a predefined category name, and you do not override the method to provide a localized name, the category name will not be localized. ]]> @@ -449,7 +449,7 @@ to get the localized name of the category the first time it is accessed. + This property calls to get the localized name of the category the first time it is accessed. ]]> diff --git a/xml/System.ComponentModel/CharConverter.xml b/xml/System.ComponentModel/CharConverter.xml index 15afb8e8fdf..240b58f2731 100644 --- a/xml/System.ComponentModel/CharConverter.xml +++ b/xml/System.ComponentModel/CharConverter.xml @@ -54,25 +54,25 @@ Provides a type converter to convert Unicode character objects to and from various other representations. - base class and [How to: Implement a Type Converter](https://learn.microsoft.com/previous-versions/visualstudio/visual-studio-2013/ayybcxe5(v=vs.120)). - + base class and [How to: Implement a Type Converter](https://learn.microsoft.com/previous-versions/visualstudio/visual-studio-2013/ayybcxe5(v=vs.120)). + > [!NOTE] -> You should never create an instance of a . Instead, call the method of the class. For more information, see the examples in the base class. - - - -## Examples - The following code example converts a variable of type to a string variable, and vice versa. - +> You should never create an instance of a . Instead, call the method of the class. For more information, see the examples in the base class. + + + +## Examples + The following code example converts a variable of type to a string variable, and vice versa. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Converters/CPP/converters.cpp" id="Snippet5"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/BooleanConverter/Overview/converters.cs" id="Snippet5"::: - :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/BooleanConverter/Overview/converters.vb" id="Snippet5"::: - + :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/BooleanConverter/Overview/converters.vb" id="Snippet5"::: + ]]> @@ -178,13 +178,13 @@ if this converter can perform the conversion; otherwise, . - @@ -247,13 +247,13 @@ Converts the given object to a Unicode character object. An that represents the converted . - diff --git a/xml/System.ComponentModel/CollectionChangeEventArgs.xml b/xml/System.ComponentModel/CollectionChangeEventArgs.xml index 06822094f14..61c9c873220 100644 --- a/xml/System.ComponentModel/CollectionChangeEventArgs.xml +++ b/xml/System.ComponentModel/CollectionChangeEventArgs.xml @@ -54,21 +54,21 @@ Provides data for the event. - event is raised when you change which items are in a collection, for example, by adding an element to a collection or removing an element from the collection. This event is not raised when an individual element changes its value. - - - -## Examples - The following code example demonstrates the use of this type. In the example, an event handler reports on the occurrence of the event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing with or appending the message to a multiline . - - To run the example code, paste it into a project that contains an instance of type named `AutoCompleteStringCollection1`. Then ensure that the event handler is associated with the event. - + event is raised when you change which items are in a collection, for example, by adding an element to a collection or removing an element from the collection. This event is not raised when an individual element changes its value. + + + +## Examples + The following code example demonstrates the use of this type. In the example, an event handler reports on the occurrence of the event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing with or appending the message to a multiline . + + To run the example code, paste it into a project that contains an instance of type named `AutoCompleteStringCollection1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet76"::: - :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.vb" id="Snippet76"::: - + :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.vb" id="Snippet76"::: + ]]> @@ -177,27 +177,27 @@ Gets an action that specifies how the collection changed. One of the values. - event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing with or appending the message to a multiline . - - To run the example code, paste it into a project that contains an instance of type named `AutoCompleteStringCollection1`. Then ensure that the event handler is associated with the event. - + event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing with or appending the message to a multiline . + + To run the example code, paste it into a project that contains an instance of type named `AutoCompleteStringCollection1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet76"::: - :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.vb" id="Snippet76"::: - + :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.vb" id="Snippet76"::: + ]]> @@ -252,16 +252,16 @@ Gets the instance of the collection with the change. An that represents the instance of the collection with the change, or if you refresh the collection. - event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing with or appending the message to a multiline . - - To run the example code, paste it into a project that contains an instance of type named `AutoCompleteStringCollection1`. Then ensure that the event handler is associated with the event. - + event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing with or appending the message to a multiline . + + To run the example code, paste it into a project that contains an instance of type named `AutoCompleteStringCollection1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet76"::: - :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.vb" id="Snippet76"::: - + :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.vb" id="Snippet76"::: + ]]> diff --git a/xml/System.ComponentModel/CollectionConverter.xml b/xml/System.ComponentModel/CollectionConverter.xml index 279255aa379..815d9bb68e4 100644 --- a/xml/System.ComponentModel/CollectionConverter.xml +++ b/xml/System.ComponentModel/CollectionConverter.xml @@ -51,12 +51,12 @@ method for this type converter always returns `null`, and the method always returns `false`. + The method for this type converter always returns `null`, and the method always returns `false`. For more information about type converters, see the base class and [How to: Implement a Type Converter](https://learn.microsoft.com/previous-versions/visualstudio/visual-studio-2013/ayybcxe5(v=vs.120)). > [!NOTE] -> You should never create an instance of the class. Instead, call the method of the class. For more information, see the examples in the base class. +> You should never create an instance of the class. Instead, call the method of the class. For more information, see the examples in the base class. ]]> diff --git a/xml/System.ComponentModel/ComplexBindingPropertiesAttribute.xml b/xml/System.ComponentModel/ComplexBindingPropertiesAttribute.xml index 19f7d2f7527..e5926a26303 100644 --- a/xml/System.ComponentModel/ComplexBindingPropertiesAttribute.xml +++ b/xml/System.ComponentModel/ComplexBindingPropertiesAttribute.xml @@ -130,7 +130,7 @@ and properties to `null`. + The parameterless constructor sets the and properties to `null`. ]]> @@ -470,7 +470,7 @@ method returns `true` if `obj` is of type and the and properties of the two objects are equal. + The method returns `true` if `obj` is of type and the and properties of the two objects are equal. ]]> diff --git a/xml/System.ComponentModel/Component.xml b/xml/System.ComponentModel/Component.xml index 4df08582b0f..2deb50d7c50 100644 --- a/xml/System.ComponentModel/Component.xml +++ b/xml/System.ComponentModel/Component.xml @@ -94,7 +94,7 @@ You can host a in any object that implements the interface, and you can query and get services from its container. The container creates an for each it contains. The container uses the site to manage the and is used by the to communicate with its container. - A should release resources explicitly by calls to its method, without waiting for automatic memory management through an implicit call to the method. When a is disposed, all components within the are also disposed. + A should release resources explicitly by calls to its method, without waiting for automatic memory management through an implicit call to the method. When a is disposed, all components within the are also disposed. ]]> @@ -400,10 +400,10 @@ when you are finished using the . The method leaves the in an unusable state. After calling , you must release all references to the so the garbage collector can reclaim the memory that the was occupying. For more information, see [Cleaning Up Unmanaged Resources](/dotnet/standard/garbage-collection/unmanaged) and [Implementing a Dispose Method](/dotnet/standard/garbage-collection/implementing-dispose). + Call when you are finished using the . The method leaves the in an unusable state. After calling , you must release all references to the so the garbage collector can reclaim the memory that the was occupying. For more information, see [Cleaning Up Unmanaged Resources](/dotnet/standard/garbage-collection/unmanaged) and [Implementing a Dispose Method](/dotnet/standard/garbage-collection/implementing-dispose). > [!NOTE] -> Always call before you release your last reference to the . Otherwise, the resources it is using will not be freed until the garbage collector calls the object's `Finalize` method. +> Always call before you release your last reference to the . Otherwise, the resources it is using will not be freed until the garbage collector calls the object's `Finalize` method. ]]> @@ -647,7 +647,7 @@ . Application code should not call this method; an object's `Finalize` method is automatically invoked during garbage collection, unless finalization by the garbage collector has been disabled by a call to the method. + This method overrides . Application code should not call this method; an object's `Finalize` method is automatically invoked during garbage collection, unless finalization by the garbage collector has been disabled by a call to the method. For more information, see [Finalize Methods and Destructors](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/0s71x931(v%3dvs.100)), [Cleaning Up Unmanaged Resources](/dotnet/standard/garbage-collection/unmanaged), and [Overriding the Finalize Method](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/ddae83kx(v=vs.100)). diff --git a/xml/System.ComponentModel/ComponentCollection.xml b/xml/System.ComponentModel/ComponentCollection.xml index bfd39cf3414..8ba05cbcb38 100644 --- a/xml/System.ComponentModel/ComponentCollection.xml +++ b/xml/System.ComponentModel/ComponentCollection.xml @@ -68,7 +68,7 @@ ## Remarks This collection inherits from . The only way to add objects to this collection is to use the class constructor. - This collection provides two indexer properties, a string indexer and an integer indexer. The string indexer property returns a component in the collection by name if the property of a component in the collection is not `null` and the property of the property of the component matches the specified string. The integer indexer property returns the at the specified collection index. The method copies the contents of the collection to a specified array, beginning writing to the array at the specified index. + This collection provides two indexer properties, a string indexer and an integer indexer. The string indexer property returns a component in the collection by name if the property of a component in the collection is not `null` and the property of the property of the component matches the specified string. The integer indexer property returns the at the specified collection index. The method copies the contents of the collection to a specified array, beginning writing to the array at the specified index. diff --git a/xml/System.ComponentModel/ComponentConverter.xml b/xml/System.ComponentModel/ComponentConverter.xml index fb75b009ce4..8640c6780ec 100644 --- a/xml/System.ComponentModel/ComponentConverter.xml +++ b/xml/System.ComponentModel/ComponentConverter.xml @@ -55,12 +55,12 @@ and by returning the properties through the method of . + This class implements and by returning the properties through the method of . For more information about type converters, see the base class and [How to: Implement a Type Converter](https://learn.microsoft.com/previous-versions/visualstudio/visual-studio-2013/ayybcxe5(v=vs.120)). > [!NOTE] -> You should never create an instance of . Instead, call the method of . For more information, see the examples in the base class. +> You should never create an instance of . Instead, call the method of . For more information, see the examples in the base class. This converter converts an object that implements and displays its properties in the Properties window. diff --git a/xml/System.ComponentModel/ComponentResourceManager.xml b/xml/System.ComponentModel/ComponentResourceManager.xml index 211bf4deccc..6c7a703343f 100644 --- a/xml/System.ComponentModel/ComponentResourceManager.xml +++ b/xml/System.ComponentModel/ComponentResourceManager.xml @@ -318,7 +318,7 @@ ## Remarks This method examines all the resources for the provided culture. If `culture` is `null`, the current culture is assumed. - The method attempts to find a resource with a key in the format of `objectName.propertyName`, where `objectName` is passed in as a parameter and `propertyName` is the name of a property. It will then apply that resource's `value` to the corresponding property of the object. If there is no matching property, the resource will be ignored. + The method attempts to find a resource with a key in the format of `objectName.propertyName`, where `objectName` is passed in as a parameter and `propertyName` is the name of a property. It will then apply that resource's `value` to the corresponding property of the object. If there is no matching property, the resource will be ignored. ]]> diff --git a/xml/System.ComponentModel/Container.xml b/xml/System.ComponentModel/Container.xml index 276892768aa..666308198cf 100644 --- a/xml/System.ComponentModel/Container.xml +++ b/xml/System.ComponentModel/Container.xml @@ -381,7 +381,7 @@ ## Remarks If the `name` parameter is `null`, the is added to the without an identifying name. - This method can be overridden by a derived class. Implementers that need to override the method can provide a custom implementation through a class that implements the interface. + This method can be overridden by a derived class. Implementers that need to override the method can provide a custom implementation through a class that implements the interface. ]]> @@ -443,10 +443,10 @@ when you are finished using the . The method leaves the in an unusable state. After calling , you must release all references to the so the garbage collector can reclaim the memory that the was occupying. For more information, see [Cleaning Up Unmanaged Resources](/dotnet/standard/garbage-collection/unmanaged) and [Implementing a Dispose Method](/dotnet/standard/garbage-collection/implementing-dispose). + Call when you are finished using the . The method leaves the in an unusable state. After calling , you must release all references to the so the garbage collector can reclaim the memory that the was occupying. For more information, see [Cleaning Up Unmanaged Resources](/dotnet/standard/garbage-collection/unmanaged) and [Implementing a Dispose Method](/dotnet/standard/garbage-collection/implementing-dispose). > [!NOTE] -> Always call before you release your last reference to the . Otherwise, the resources it is using will not be freed until the garbage collector calls the object's `Finalize` method. +> Always call before you release your last reference to the . Otherwise, the resources it is using will not be freed until the garbage collector calls the object's `Finalize` method. ]]> @@ -556,7 +556,7 @@ . Application code should not call this method; an object's `Finalize` method is automatically invoked during garbage collection, unless finalization by the garbage collector has been disabled by a call to the method. + This method overrides . Application code should not call this method; an object's `Finalize` method is automatically invoked during garbage collection, unless finalization by the garbage collector has been disabled by a call to the method. For more information, see [Finalize Methods and Destructors](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/0s71x931(v%3dvs.100)), [Cleaning Up Unmanaged Resources](/dotnet/standard/garbage-collection/unmanaged), and [Overriding the Finalize Method](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/ddae83kx(v=vs.100)). @@ -618,7 +618,7 @@ ; otherwise, it returns `null`. You can override this method to provide a custom implementation to return a service object. For more information, see the method. + The default implementation of this method returns the current instance of the class if `service` is an ; otherwise, it returns `null`. You can override this method to provide a custom implementation to return a service object. For more information, see the method. ]]> @@ -740,7 +740,7 @@ method cleans up the site as usual, but it does not set the component's property to `null`. + The method cleans up the site as usual, but it does not set the component's property to `null`. ]]> @@ -808,7 +808,7 @@ method is called by the method to determine if the name of the `component` being added is unique for this . If the `name` parameter is not `null` and is not unique, an is thrown. + The method is called by the method to determine if the name of the `component` being added is unique for this . If the `name` parameter is not `null` and is not unique, an is thrown. ]]> diff --git a/xml/System.ComponentModel/ContainerFilterService.xml b/xml/System.ComponentModel/ContainerFilterService.xml index 187c0049ac1..ef387983494 100644 --- a/xml/System.ComponentModel/ContainerFilterService.xml +++ b/xml/System.ComponentModel/ContainerFilterService.xml @@ -45,11 +45,11 @@ Provides a base class for the container filter service. - and classes call the method each time they need to construct a component collection for return to a caller. may return an updated collection of components. This enables an external service to modify the view of components that are returned from a container. - + and classes call the method each time they need to construct a component collection for return to a caller. may return an updated collection of components. This enables an external service to modify the view of components that are returned from a container. + ]]> @@ -140,11 +140,11 @@ Filters the component collection. A that represents a modified collection. - method filters the component collection by optionally returning a new, modified collection. The default implementation returns the input collection, thereby performing no filtering. - + method filters the component collection by optionally returning a new, modified collection. The default implementation returns the input collection, thereby performing no filtering. + ]]> diff --git a/xml/System.ComponentModel/CultureInfoConverter.xml b/xml/System.ComponentModel/CultureInfoConverter.xml index 2972db02d30..e86f4e55a8f 100644 --- a/xml/System.ComponentModel/CultureInfoConverter.xml +++ b/xml/System.ComponentModel/CultureInfoConverter.xml @@ -52,25 +52,25 @@ Provides a type converter to convert objects to and from various other representations. - object to and from a string. - - For more information about type converters, see the base class and [How to: Implement a Type Converter](https://learn.microsoft.com/previous-versions/visualstudio/visual-studio-2013/ayybcxe5(v=vs.120)). - + object to and from a string. + + For more information about type converters, see the base class and [How to: Implement a Type Converter](https://learn.microsoft.com/previous-versions/visualstudio/visual-studio-2013/ayybcxe5(v=vs.120)). + > [!NOTE] -> You should never create an instance of the class. Instead, call the method of the class. For more information, see the examples in the base class. - - - -## Examples - The following code example converts a variable of type to a string, and vice versa. First it constructs a variable using the Greek culture (represented by "el") and converts it to the string "Greek". Then it converts the string "Russian" to the representation "ru". - +> You should never create an instance of the class. Instead, call the method of the class. For more information, see the examples in the base class. + + + +## Examples + The following code example converts a variable of type to a string, and vice versa. First it constructs a variable using the Greek culture (represented by "el") and converts it to the string "Greek". Then it converts the string "Russian" to the representation "ru". + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Converters/CPP/converters.cpp" id="Snippet8"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/BooleanConverter/Overview/converters.cs" id="Snippet8"::: - :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/BooleanConverter/Overview/converters.vb" id="Snippet8"::: - + :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/BooleanConverter/Overview/converters.vb" id="Snippet8"::: + ]]> @@ -174,13 +174,13 @@ if this converter can perform the conversion; otherwise, . - object to and from a string. - - The `context` parameter can be used to extract additional information about the environment this converter is being invoked from. This can be `null`, so always check. Also, properties on the context object can return `null`. - + object to and from a string. + + The `context` parameter can be used to extract additional information about the environment this converter is being invoked from. This can be `null`, so always check. Also, properties on the context object can return `null`. + ]]> @@ -241,11 +241,11 @@ if this converter can perform the conversion; otherwise, . - @@ -310,13 +310,13 @@ Converts the specified value object to a . An that represents the converted value. - object to and from a string. - - The `context` parameter can be used to extract additional information about the environment this converter is being invoked from. This can be `null`, so always check. Also, properties on the context object can return `null`. - + object to and from a string. + + The `context` parameter can be used to extract additional information about the environment this converter is being invoked from. This can be `null`, so always check. Also, properties on the context object can return `null`. + ]]> @@ -383,13 +383,13 @@ Converts the given value object to the specified destination type. An that represents the converted . - object to and from a string. - - The `context` parameter can be used to extract additional information about the environment this converter is being invoked from. This can be `null`, so always check. Also, properties on the context object can return `null`. - + object to and from a string. + + The `context` parameter can be used to extract additional information about the environment this converter is being invoked from. This can be `null`, so always check. Also, properties on the context object can return `null`. + ]]> @@ -493,11 +493,11 @@ Gets a collection of standard values for a object using the specified context. A containing a standard set of valid values, or if the data type does not support a standard set of values. - @@ -548,13 +548,13 @@ because the returned from is not an exhaustive list of possible values (that is, other values are possible). This method never returns . - provides. - + provides. + ]]> @@ -605,11 +605,11 @@ because should be called to find a common set of values the object supports. This method never returns . - diff --git a/xml/System.ComponentModel/CurrentChangingEventArgs.xml b/xml/System.ComponentModel/CurrentChangingEventArgs.xml index 4406bc49861..c1322297240 100644 --- a/xml/System.ComponentModel/CurrentChangingEventArgs.xml +++ b/xml/System.ComponentModel/CurrentChangingEventArgs.xml @@ -27,9 +27,9 @@ raises this event when the is changing or when the content of the collection has been reset. + A collection that supports raises this event when the is changing or when the content of the collection has been reset. - By default, the event is cancelable when the cause is a move-current operation (such as the and similar methods) and uncancelable when the cause is an irreversible change operation on the collection. + By default, the event is cancelable when the cause is a move-current operation (such as the and similar methods) and uncancelable when the cause is an irreversible change operation on the collection. ]]> @@ -182,7 +182,7 @@ and similar methods) and uncancelable when the cause is an irreversible change operation on the collection. + By default, the event is cancelable when the cause is a move-current operation (such as the and similar methods) and uncancelable when the cause is an irreversible change operation on the collection. ]]> diff --git a/xml/System.ComponentModel/CustomTypeDescriptor.xml b/xml/System.ComponentModel/CustomTypeDescriptor.xml index 18216b76530..79d0e958b39 100644 --- a/xml/System.ComponentModel/CustomTypeDescriptor.xml +++ b/xml/System.ComponentModel/CustomTypeDescriptor.xml @@ -124,7 +124,7 @@ constructor with a parameter that is `null`. + This constructor is equivalent to calling the other constructor with a parameter that is `null`. All methods of a created with this constructor will return default values. @@ -189,10 +189,10 @@ |Method|Default return value| |------------|--------------------------| -||An empty attribute collection ().| -||The default instance.| -||An empty events collection ().| -||An empty property collection ().| +||An empty attribute collection ().| +||The default instance.| +||An empty events collection ().| +||An empty property collection ().| ]]> @@ -246,7 +246,7 @@ constructor, the method will call the parent's corresponding method. + If a parent custom type descriptor was passed to the constructor, the method will call the parent's corresponding method. ]]> @@ -307,9 +307,9 @@ ## Remarks > [!NOTE] -> is not a static method and thus, is not guaranteed to be thread-safe. +> is not a static method and thus, is not guaranteed to be thread-safe. - If a parent custom type descriptor was passed to the constructor, the method will call the parent's corresponding method. + If a parent custom type descriptor was passed to the constructor, the method will call the parent's corresponding method. ]]> @@ -365,7 +365,7 @@ constructor, the method will call the parent's corresponding method. + If a parent custom type descriptor was passed to the constructor, the method will call the parent's corresponding method. ]]> @@ -427,7 +427,7 @@ constructor, the method will call the parent's corresponding method. + If a parent custom type descriptor was passed into the constructor, the method will call the parent's corresponding method. ]]> @@ -523,7 +523,7 @@ constructor, the method will call the parent's corresponding method. + If a parent custom type descriptor was passed into the constructor, the method will call the parent's corresponding method. ]]> @@ -586,7 +586,7 @@ constructor, the method will call the parent's corresponding method. + If a parent custom type descriptor was passed into the constructor, the method will call the parent's corresponding method. ]]> @@ -662,7 +662,7 @@ constructor, the method will call the parent's corresponding method. + If a parent custom type descriptor was passed into the constructor, the method will call the parent's corresponding method. ]]> @@ -681,7 +681,7 @@ method returns a collection of event descriptors for the object this type descriptor is representing. An optional attribute array may be provided to filter the collection that is returned. If no parent is provided, the method will return . + The method returns a collection of event descriptors for the object this type descriptor is representing. An optional attribute array may be provided to filter the collection that is returned. If no parent is provided, the method will return . ]]> @@ -734,7 +734,7 @@ constructor, the method will call the parent's corresponding method. + If a parent custom type descriptor was passed into the constructor, the method will call the parent's corresponding method. ]]> @@ -810,7 +810,7 @@ ## Remarks You can use the `attributes` parameter to filter the collection that is returned. - If a parent custom type descriptor was passed into the constructor, the method will call the parent's corresponding method. + If a parent custom type descriptor was passed into the constructor, the method will call the parent's corresponding method. ]]> @@ -864,7 +864,7 @@ method returns a collection of property descriptors for the object this type descriptor is representing. An optional attribute array may be provided to filter the collection that is returned. If no parent is provided, the method will return . + The method returns a collection of property descriptors for the object this type descriptor is representing. An optional attribute array may be provided to filter the collection that is returned. If no parent is provided, the method will return . ]]> @@ -923,7 +923,7 @@ constructor, the method will call the parent's corresponding method. + If a parent custom type descriptor was passed into the constructor, the method will call the parent's corresponding method. ]]> @@ -998,9 +998,9 @@ . + You can use the `attributes` parameter to filter the collection that is returned. For filtering rules, see . - If a parent custom type descriptor was passed into the constructor, the method will call the parent's corresponding method. + If a parent custom type descriptor was passed into the constructor, the method will call the parent's corresponding method. ]]> @@ -1096,7 +1096,7 @@ constructor, the method will call the parent's corresponding method. + If a parent custom type descriptor was passed into the constructor, the method will call the parent's corresponding method. ]]> diff --git a/xml/System.ComponentModel/DataObjectAttribute.xml b/xml/System.ComponentModel/DataObjectAttribute.xml index 1b8cd95f26a..130ab7e1c27 100644 --- a/xml/System.ComponentModel/DataObjectAttribute.xml +++ b/xml/System.ComponentModel/DataObjectAttribute.xml @@ -191,7 +191,7 @@ constructor to indicate to a design-time class such as the class that an object should be excluded from the list of suitable objects for binding to an object. + Use the constructor to indicate to a design-time class such as the class that an object should be excluded from the list of suitable objects for binding to an object. The property is set to the value of the `isDataObject` parameter. @@ -287,7 +287,7 @@ field defines an instance of the class initialized with the constructor, which sets the property to `true`. + The field defines an instance of the class initialized with the constructor, which sets the property to `true`. ]]> diff --git a/xml/System.ComponentModel/DataObjectMethodAttribute.xml b/xml/System.ComponentModel/DataObjectMethodAttribute.xml index ff045287950..0d41c170b41 100644 --- a/xml/System.ComponentModel/DataObjectMethodAttribute.xml +++ b/xml/System.ComponentModel/DataObjectMethodAttribute.xml @@ -130,7 +130,7 @@ property is set to `false` when you create a object using this constructor. + The property is set to `false` when you create a object using this constructor. @@ -358,9 +358,9 @@ ## Remarks The control uses the property to distinguish between multiple methods that match the signature requirements for a specific method type. If two methods match the signature requirements, the method with the property set to `true` is selected. - At design-time the property is used to automatically set the , , , and properties on an instance. + At design-time the property is used to automatically set the , , , and properties on an instance. - If the is created using the constructor that only takes a parameter, the property is set to `false`. + If the is created using the constructor that only takes a parameter, the property is set to `false`. ]]> @@ -421,7 +421,7 @@ fits the pattern of another. Its implementation is not the same as that of , however, because it does not test for true equality. + This method determines whether one fits the pattern of another. Its implementation is not the same as that of , however, because it does not test for true equality. ]]> diff --git a/xml/System.ComponentModel/DateTimeConverter.xml b/xml/System.ComponentModel/DateTimeConverter.xml index 5e553afe1b9..78173571169 100644 --- a/xml/System.ComponentModel/DateTimeConverter.xml +++ b/xml/System.ComponentModel/DateTimeConverter.xml @@ -59,14 +59,14 @@ ## Remarks This converter can only convert a object to and from a string. - The method uses the method of the class to convert from a string. + The method uses the method of the class to convert from a string. - The method uses the current culture, if a is not supplied. Generally, uses the property to format a date and with the property to format a date and time. If the property is passed, uses yyyy-MM-dd to format a date and to format a date and time. + The method uses the current culture, if a is not supplied. Generally, uses the property to format a date and with the property to format a date and time. If the property is passed, uses yyyy-MM-dd to format a date and to format a date and time. For more information about type converters, see the base class and [How to: Implement a Type Converter](https://learn.microsoft.com/previous-versions/visualstudio/visual-studio-2013/ayybcxe5(v=vs.120)). > [!NOTE] -> You should never create an instance of . Instead, call the method of the class. For more information, see the examples in the base class. +> You should never create an instance of . Instead, call the method of the class. For more information, see the examples in the base class. diff --git a/xml/System.ComponentModel/DecimalConverter.xml b/xml/System.ComponentModel/DecimalConverter.xml index 8307fa333b3..1e0df5b462c 100644 --- a/xml/System.ComponentModel/DecimalConverter.xml +++ b/xml/System.ComponentModel/DecimalConverter.xml @@ -54,25 +54,25 @@ Provides a type converter to convert objects to and from various other representations. - [!NOTE] -> You should never create an instance of the class. Instead, call the method of the class. For more information, see the examples in the base class. - - For more information about type converters, see the base class and [How to: Implement a Type Converter](https://learn.microsoft.com/previous-versions/visualstudio/visual-studio-2013/ayybcxe5(v=vs.120)). - - - -## Examples - The following code example converts a variable of type to a string, and vice versa. - +> You should never create an instance of the class. Instead, call the method of the class. For more information, see the examples in the base class. + + For more information about type converters, see the base class and [How to: Implement a Type Converter](https://learn.microsoft.com/previous-versions/visualstudio/visual-studio-2013/ayybcxe5(v=vs.120)). + + + +## Examples + The following code example converts a variable of type to a string, and vice versa. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Converters/CPP/converters.cpp" id="Snippet10"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/BooleanConverter/Overview/converters.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/BooleanConverter/Overview/converters.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/BooleanConverter/Overview/converters.vb" id="Snippet10"::: + ]]> @@ -178,11 +178,11 @@ if this converter can perform the conversion; otherwise, . - diff --git a/xml/System.ComponentModel/DefaultBindingPropertyAttribute.xml b/xml/System.ComponentModel/DefaultBindingPropertyAttribute.xml index 501ce70cd44..3630860cf4a 100644 --- a/xml/System.ComponentModel/DefaultBindingPropertyAttribute.xml +++ b/xml/System.ComponentModel/DefaultBindingPropertyAttribute.xml @@ -297,7 +297,7 @@ method returns `true` if the value of the `obj` parameter is of type and the properties of the two objects are equal. + The method returns `true` if the value of the `obj` parameter is of type and the properties of the two objects are equal. ]]> diff --git a/xml/System.ComponentModel/DependencyPropertyDescriptor.xml b/xml/System.ComponentModel/DependencyPropertyDescriptor.xml index cf077b0f106..519dec73f2d 100644 --- a/xml/System.ComponentModel/DependencyPropertyDescriptor.xml +++ b/xml/System.ComponentModel/DependencyPropertyDescriptor.xml @@ -24,13 +24,13 @@ Provides an extension of that accounts for the additional property characteristics of a dependency property. - available to serve as a , call either , or . If either method returns `null`, then the property is not a dependency property. If the method returns a valid , then the property is a dependency property. - + available to serve as a , call either , or . If either method returns `null`, then the property is not a dependency property. If the method returns a valid , then the property is a dependency property. + ]]> @@ -130,11 +130,11 @@ if resetting the component changes its value; otherwise, . - . - + . + ]]> @@ -167,11 +167,11 @@ Gets the name of the category that the member belongs to, as specified in the . The name of the category to which the member belongs. If there is no , the category name is set to the default category, . - . - + . + ]]> @@ -209,11 +209,11 @@ Gets the type of the component this property is bound to. A that represents the type of component this property is bound to. When or are invoked, the object specified might be an instance of this type. - . - + . + ]]> @@ -245,11 +245,11 @@ Gets the type converter for this property. A that is used to convert the of this property. - is not a public class. - + is not a public class. + ]]> @@ -288,11 +288,11 @@ Returns the dependency property identifier. The dependency property identifier. - instance was created for a property that is not a dependency property. - + instance was created for a property that is not a dependency property. + ]]> @@ -324,11 +324,11 @@ Gets the description of the member, as specified in the . The description of the member. If there is no , the property value is set to the default, which is an empty string (""). - . - + . + ]]> @@ -390,11 +390,11 @@ if this member should be set only at design time; if the member can be set during run time. If there is no , the return value is the default, which is . - . - + . + ]]> @@ -426,11 +426,11 @@ Gets the name that can be displayed in a window, such as a Properties window. The name to display for the property. - . - + . + ]]> @@ -514,11 +514,11 @@ Returns a for a provided property name. The requested . - or call that defined the property in question. `ownerType` is the type of object that owns the property, again as passed to or . `targetType` is the type of object you want to set the property for. For dependency properties, `ownerType` and `targetType` are the same type. For attached properties they usually differ. - + or call that defined the property in question. `ownerType` is the type of object that owns the property, again as passed to or . `targetType` is the type of object you want to set the property for. For dependency properties, `ownerType` and `targetType` are the same type. For attached properties they usually differ. + ]]> @@ -559,11 +559,11 @@ Returns a for a provided property name. The requested . - or call that defined the property in question. `ownerType` is the type of object that owns the property, again as passed to or . `targetType` is the type of object you want to set the property for. For dependency properties, `ownerType` and `targetType` are the same type. For attached properties they usually differ. - + or call that defined the property in question. `ownerType` is the type of object that owns the property, again as passed to or . `targetType` is the type of object you want to set the property for. For dependency properties, `ownerType` and `targetType` are the same type. For attached properties they usually differ. + ]]> @@ -608,11 +608,11 @@ Returns a for a provided . If the property described by is a dependency property, returns a valid . Otherwise, returns a . - on basis of checking all properties for a . - + on basis of checking all properties for a . + ]]> @@ -650,11 +650,11 @@ Returns a for a provided dependency property and target type. A for the provided dependency property. - for the `dependencyProperty`. For attached properties the `targetType` is typically some other type. - + for the `dependencyProperty`. For attached properties the `targetType` is typically some other type. + ]]> @@ -692,11 +692,11 @@ Returns a . A with the properties that match the specified attributes for the specified component. - . - + . + ]]> @@ -732,11 +732,11 @@ Gets an editor of the specified type. An instance of the requested editor type, or if an editor cannot be found. - . - + . + ]]> @@ -769,11 +769,11 @@ Returns the hash code for this . A 32-bit signed integer hash code. - is based both on the identifier for a dependency property and on the type on which it is set. This implementation assures that a does not improperly return the same hash code for properties that are inherited by the many possible derived classes, or for properties that are otherwise re-assigned through the property system. - + is based both on the identifier for a dependency property and on the type on which it is set. This implementation assures that a does not improperly return the same hash code for properties that are inherited by the many possible derived classes, or for properties that are otherwise re-assigned through the property system. + ]]> @@ -809,11 +809,11 @@ Returns the current value of the property on a component. The requested value. - . - + . + ]]> @@ -882,11 +882,11 @@ if the was specified on the property; otherwise, . - . - + . + ]]> @@ -919,11 +919,11 @@ if the member is marked with the constructor of the value true; otherwise, . - . - + . + ]]> @@ -956,13 +956,13 @@ if the property is read-only; otherwise, . - . - - Dependency properties are registered as read-only using particular method calls, and by convention the CLR wrapper properties that are the properties viewed by reflection and the descriptors must also be read-only. However, since this is a convention and not a requirement to compile, you might want to double check the dependency property identifier read-only state. To do this, get the identifier () value for this and then check the value of . Note that the is on the identifier itself, not metadata. - + . + + Dependency properties are registered as read-only using particular method calls, and by convention the CLR wrapper properties that are the properties viewed by reflection and the descriptors must also be read-only. However, since this is a convention and not a requirement to compile, you might want to double check the dependency property identifier read-only state. To do this, get the identifier () value for this and then check the value of . Note that the is on the identifier itself, not metadata. + ]]> @@ -1000,13 +1000,13 @@ Gets the metadata associated with the dependency property. The dependency property metadata. - collection. - + collection. + ]]> @@ -1038,11 +1038,11 @@ Gets the represented of the dependency property. The of the dependency property. - that the dependency property was registered with. - + that the dependency property was registered with. + ]]> @@ -1079,11 +1079,11 @@ The delegate to add as a listener. Enables other objects to be notified when this property changes. - . - + . + ]]> @@ -1118,11 +1118,11 @@ The component with the property value that is to be reset to the default value. Resets the value for this property of the component to the default value. - . - + . + ]]> @@ -1159,11 +1159,11 @@ The new value. Sets the value of the component to a different value. - . - + . + ]]> @@ -1230,13 +1230,13 @@ if notifications for this property may originate from outside the property descriptor, such as from the component itself. if notifications will only originate from direct calls made to . - interface, or may have an explicit `propertyName.Changed` event for this property. - - This property relies on the underlying . - + interface, or may have an explicit `propertyName.Changed` event for this property. + + This property relies on the underlying . + ]]> diff --git a/xml/System.ComponentModel/DescriptionAttribute.xml b/xml/System.ComponentModel/DescriptionAttribute.xml index 927962d0668..b266050e480 100644 --- a/xml/System.ComponentModel/DescriptionAttribute.xml +++ b/xml/System.ComponentModel/DescriptionAttribute.xml @@ -60,7 +60,7 @@ to access the value of this attribute. + A visual designer can display the specified description when referencing the component member, such as in a Properties window. Call to access the value of this attribute. For more information, see [Attributes](/dotnet/standard/attributes/). diff --git a/xml/System.ComponentModel/DesignerProperties.xml b/xml/System.ComponentModel/DesignerProperties.xml index 270962d4b2c..7ec9f52d0f6 100644 --- a/xml/System.ComponentModel/DesignerProperties.xml +++ b/xml/System.ComponentModel/DesignerProperties.xml @@ -102,13 +102,13 @@ ## Remarks Component and control developers might use this property to perform different logic when running in the context of a designer than they would when running in an application. - Designers might change the value of this property to move a control from design mode to run mode and back. Components that make changes to their state based on the value of this property should override the virtual method and update their state if their **IsInDesignMode** property value changes. + Designers might change the value of this property to move a control from design mode to run mode and back. Components that make changes to their state based on the value of this property should override the virtual method and update their state if their **IsInDesignMode** property value changes. ## Dependency Property Information | Identifier field | Metadata properties set to `true` | |------------------|-----------------------------------| -| | , | +| | , | ]]> @@ -143,7 +143,7 @@ attached property. + The identifier for the attached property. ]]> diff --git a/xml/System.ComponentModel/DesignerSerializationVisibilityAttribute.xml b/xml/System.ComponentModel/DesignerSerializationVisibilityAttribute.xml index 7ab7795c972..c65cb692d1c 100644 --- a/xml/System.ComponentModel/DesignerSerializationVisibilityAttribute.xml +++ b/xml/System.ComponentModel/DesignerSerializationVisibilityAttribute.xml @@ -506,7 +506,7 @@ ## Examples The following code example shows how to check the value of the for `MyProperty`. First the code gets a with all the properties for the object. Next, the code indexes into the to get `MyProperty`. Then, the code returns the attributes for this property and saves them in the attributes variable. - This example presents two different ways to check the value of the . In the second code fragment, the example calls the method with a `static` value. In the last code fragment, the example uses the property to check the value. + This example presents two different ways to check the value of the . In the second code fragment, the example calls the method with a `static` value. In the last code fragment, the example uses the property to check the value. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic DesignerSerializationVisibilityAttribute.Visibility Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/DesignerSerializationVisibilityAttribute/Visibility/source.cs" id="Snippet1"::: diff --git a/xml/System.ComponentModel/DisplayNameAttribute.xml b/xml/System.ComponentModel/DisplayNameAttribute.xml index 54253dffd00..120d1336191 100644 --- a/xml/System.ComponentModel/DisplayNameAttribute.xml +++ b/xml/System.ComponentModel/DisplayNameAttribute.xml @@ -59,7 +59,7 @@ uses reflection to search the public properties and public void methods that take no arguments. searches for the on each property and method and, if found, uses that string instead of the property or method name. + The default is the name of the property or event. The default implementation of uses reflection to search the public properties and public void methods that take no arguments. searches for the on each property and method and, if found, uses that string instead of the property or method name. diff --git a/xml/System.ComponentModel/DoubleConverter.xml b/xml/System.ComponentModel/DoubleConverter.xml index 171b92418de..1a15f13c881 100644 --- a/xml/System.ComponentModel/DoubleConverter.xml +++ b/xml/System.ComponentModel/DoubleConverter.xml @@ -48,25 +48,25 @@ Provides a type converter to convert double-precision, floating point number objects to and from various other representations. - object to and from a string. - + object to and from a string. + > [!NOTE] -> You should never create an instance of . Instead, call the method of . For more information, see the examples in the base class. - - For more information about type converters, see the base class and [How to: Implement a Type Converter](https://learn.microsoft.com/previous-versions/visualstudio/visual-studio-2013/ayybcxe5(v=vs.120)). - - - -## Examples - The following code example converts a variable of type to a string, and vice versa. - +> You should never create an instance of . Instead, call the method of . For more information, see the examples in the base class. + + For more information about type converters, see the base class and [How to: Implement a Type Converter](https://learn.microsoft.com/previous-versions/visualstudio/visual-studio-2013/ayybcxe5(v=vs.120)). + + + +## Examples + The following code example converts a variable of type to a string, and vice versa. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Converters/CPP/converters.cpp" id="Snippet11"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/BooleanConverter/Overview/converters.cs" id="Snippet11"::: - :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/BooleanConverter/Overview/converters.vb" id="Snippet11"::: - + :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/BooleanConverter/Overview/converters.vb" id="Snippet11"::: + ]]> diff --git a/xml/System.ComponentModel/EditorAttribute.xml b/xml/System.ComponentModel/EditorAttribute.xml index 795c38ba788..54170c8a4e7 100644 --- a/xml/System.ComponentModel/EditorAttribute.xml +++ b/xml/System.ComponentModel/EditorAttribute.xml @@ -217,7 +217,7 @@ format. + The `typeName` parameter must be in the format. The represented by the `typeName` parameter must either derive from or implement the base class. @@ -290,7 +290,7 @@ format. + The `typeName` parameter must be in the format. The represented by the `typeName` must either derive from or implement the base class. diff --git a/xml/System.ComponentModel/EnumConverter.xml b/xml/System.ComponentModel/EnumConverter.xml index 4fad65afe8b..171eb968492 100644 --- a/xml/System.ComponentModel/EnumConverter.xml +++ b/xml/System.ComponentModel/EnumConverter.xml @@ -62,7 +62,7 @@ For more information about type converters, see the base class and [How to: Implement a Type Converter](https://learn.microsoft.com/previous-versions/visualstudio/visual-studio-2013/ayybcxe5(v=vs.120)). > [!NOTE] -> You should never create an instance of an . Instead, call the method of the class. For more information, see the examples in the base class. +> You should never create an instance of an . Instead, call the method of the class. For more information, see the examples in the base class. ## Examples The following code example converts a variable of type to a string, and vice versa. The example requires that you have declared an called `Servers` and that it has the following members: @@ -479,7 +479,7 @@ Windows=1, Exchange=2, BizTalk=3 The `context` parameter can be used to extract additional information about the environment this converter is being invoked from. This can be `null`, so always check. Also, properties on the context object can return `null`. > [!NOTE] -> The behavior of the method is undefined if the enumeration has multiple fields with the same value. +> The behavior of the method is undefined if the enumeration has multiple fields with the same value. ]]> diff --git a/xml/System.ComponentModel/EventDescriptor.xml b/xml/System.ComponentModel/EventDescriptor.xml index d7fd1eba283..212ce57ae79 100644 --- a/xml/System.ComponentModel/EventDescriptor.xml +++ b/xml/System.ComponentModel/EventDescriptor.xml @@ -58,34 +58,34 @@ Provides information about an event. - consists of a name, its attributes, the component that the event is bound to, the event delegate, the type of delegate, and whether the delegate is multicast. - - provides the following `abstract` properties and methods: - -- contains the type of the component this event is declared on. - -- contains the type of delegate for the event. - -- contains a value indicating whether the event delegate is a multicast delegate. - -- binds the event to a component. - -- unbinds the delegate from the component so that the delegate no longer receives events from the component. - - For more information about events, see [Handling and Raising Events](/dotnet/standard/events/). For more information about reflection, see the topics in [Reflection](/dotnet/framework/reflection-and-codedom/reflection). - - - -## Examples - The following code example is built upon the example in the class. It prints the information (category, description, and display name) of each event on a button in a text box. It requires that `button1` and `textbox1` have been instantiated on a form. - + consists of a name, its attributes, the component that the event is bound to, the event delegate, the type of delegate, and whether the delegate is multicast. + + provides the following `abstract` properties and methods: + +- contains the type of the component this event is declared on. + +- contains the type of delegate for the event. + +- contains a value indicating whether the event delegate is a multicast delegate. + +- binds the event to a component. + +- unbinds the delegate from the component so that the delegate no longer receives events from the component. + + For more information about events, see [Handling and Raising Events](/dotnet/standard/events/). For more information about reflection, see the topics in [Reflection](/dotnet/framework/reflection-and-codedom/reflection). + + + +## Examples + The following code example is built upon the example in the class. It prints the information (category, description, and display name) of each event on a button in a text box. It requires that `button1` and `textbox1` have been instantiated on a form. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/EventDescriptor/CPP/eventdescriptor.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/EventDescriptor/Overview/eventdescriptor.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/EventDescriptor/Overview/eventdescriptor.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/EventDescriptor/Overview/eventdescriptor.vb" id="Snippet1"::: + ]]> @@ -208,11 +208,11 @@ An array with the attributes you want to add to this event description. Initializes a new instance of the class with the name in the specified and the attributes in both the and the array. - array to the attributes in the . - + array to the attributes in the . + ]]> @@ -322,13 +322,13 @@ A delegate that represents the method that handles the event. When overridden in a derived class, binds the event to the component. - @@ -378,11 +378,11 @@ When overridden in a derived class, gets the type of component this event is bound to. A that represents the type of component the event is bound to. - @@ -430,11 +430,11 @@ When overridden in a derived class, gets the type of delegate for the event. A that represents the type of delegate for the event. - @@ -483,13 +483,13 @@ if the event delegate is multicast; otherwise, . - @@ -542,13 +542,13 @@ The delegate to unbind from the component. When overridden in a derived class, unbinds the delegate from the component so that the delegate will no longer receive events from the component. - diff --git a/xml/System.ComponentModel/EventDescriptorCollection.xml b/xml/System.ComponentModel/EventDescriptorCollection.xml index 30753027167..08e44bb950b 100644 --- a/xml/System.ComponentModel/EventDescriptorCollection.xml +++ b/xml/System.ComponentModel/EventDescriptorCollection.xml @@ -76,7 +76,7 @@ Using the properties available in the class, you can query the collection about its contents. Use the property to determine the number of elements in the collection. Use the property to get a specific property by index number or by name. - You can also use the method to get a description of the event with the specified name from the collection. + You can also use the method to get a description of the event with the specified name from the collection. @@ -944,7 +944,7 @@ ## Examples - The following code example defines the sort order for the method. If the contains four objects with the names `A`, `B`, `C`, and `D`, the properties of this would be sorted in the order `D`, `B`, `A`, and `C`. + The following code example defines the sort order for the method. If the contains four objects with the names `A`, `B`, `C`, and `D`, the properties of this would be sorted in the order `D`, `B`, `A`, and `C`. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic EventDescriptorCollection.InternalSort Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/EventDescriptorCollection/InternalSort/source.cs" id="Snippet1"::: @@ -1288,7 +1288,7 @@ ## Examples - The following code example defines the sort order for the method. If the contains four objects with the names `A`, `B`, `C`, and `D`, the properties of `myNewColl` would be sorted in the order `D`, `B`, `A`, and `C`. + The following code example defines the sort order for the method. If the contains four objects with the names `A`, `B`, `C`, and `D`, the properties of `myNewColl` would be sorted in the order `D`, `B`, `A`, and `C`. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic EventDescriptorCollection.Sort Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/EventDescriptorCollection/Sort/source.cs" id="Snippet1"::: @@ -1354,7 +1354,7 @@ ## Examples - The following code example defines the sort order for the method. If the contains four objects with the names `A`, `B`, `C`, and `D`, the properties of `myNewColl` would be sorted in the order `D`, `B`, `A`, and `C`. + The following code example defines the sort order for the method. If the contains four objects with the names `A`, `B`, `C`, and `D`, the properties of `myNewColl` would be sorted in the order `D`, `B`, `A`, and `C`. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic EventDescriptorCollection.Sort Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/EventDescriptorCollection/Sort/source.cs" id="Snippet1"::: @@ -1421,7 +1421,7 @@ ## Examples - The following code example defines the sort order for the method. If the contains four objects with the names `A`, `B`, `C`, and `D`, the properties of `myNewColl` would be sorted in the order `D`, `B`, `A`, and `C`. + The following code example defines the sort order for the method. If the contains four objects with the names `A`, `B`, `C`, and `D`, the properties of `myNewColl` would be sorted in the order `D`, `B`, `A`, and `C`. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic EventDescriptorCollection.Sort Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/EventDescriptorCollection/Sort/source.cs" id="Snippet1"::: @@ -1490,7 +1490,7 @@ ## Examples - The following code example defines the sort order for the method. If the contains four objects with the names `A`, `B`, `C`, and `D`, the properties of `myNewColl` would be sorted in the order `D`, `B`, `A`, and `C`. + The following code example defines the sort order for the method. If the contains four objects with the names `A`, `B`, `C`, and `D`, the properties of `myNewColl` would be sorted in the order `D`, `B`, `A`, and `C`. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic EventDescriptorCollection.Sort Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/EventDescriptorCollection/Sort/source.cs" id="Snippet1"::: diff --git a/xml/System.ComponentModel/EventHandlerList.xml b/xml/System.ComponentModel/EventHandlerList.xml index 8d07ac8561e..629fae88bb2 100644 --- a/xml/System.ComponentModel/EventHandlerList.xml +++ b/xml/System.ComponentModel/EventHandlerList.xml @@ -57,16 +57,16 @@ Provides a simple list of delegates. This class cannot be inherited. - , see [How to: Handle Multiple Events Using Event Properties](/dotnet/standard/events/how-to-handle-multiple-events-using-event-properties). - + , see [How to: Handle Multiple Events Using Event Properties](/dotnet/standard/events/how-to-handle-multiple-events-using-event-properties). + ]]> @@ -261,14 +261,14 @@ Disposes the delegate list. - when you are finished using the . The method leaves the in an unusable state. After calling , you must release all references to the so the memory it was occupying can be reclaimed by garbage collection. - + when you are finished using the . The method leaves the in an unusable state. After calling , you must release all references to the so the memory it was occupying can be reclaimed by garbage collection. + > [!NOTE] -> Always call before you release your last reference to the . Otherwise, the resources the is using will not be freed until garbage collection calls the object's destructor. - +> Always call before you release your last reference to the . Otherwise, the resources the is using will not be freed until garbage collection calls the object's destructor. + ]]> @@ -325,11 +325,11 @@ Gets or sets the delegate for the specified object. The delegate for the specified key, or if a delegate does not exist. - diff --git a/xml/System.ComponentModel/ExpandableObjectConverter.xml b/xml/System.ComponentModel/ExpandableObjectConverter.xml index 4889e117463..d9c5ea6ccb6 100644 --- a/xml/System.ComponentModel/ExpandableObjectConverter.xml +++ b/xml/System.ComponentModel/ExpandableObjectConverter.xml @@ -49,7 +49,7 @@ . To make a type of property expandable in the , specify this for standard implementations of and . Mark child properties with the to ensure correct behavior in a control. + This class adds support for properties on an object to the methods and properties provided by . To make a type of property expandable in the , specify this for standard implementations of and . Mark child properties with the to ensure correct behavior in a control. > [!NOTE] > You should never access a type converter directly. Instead, call the appropriate converter by using . For more information, see the examples in the base class. diff --git a/xml/System.ComponentModel/GroupDescription.xml b/xml/System.ComponentModel/GroupDescription.xml index 9d9192d4df4..4d7594dbd07 100644 --- a/xml/System.ComponentModel/GroupDescription.xml +++ b/xml/System.ComponentModel/GroupDescription.xml @@ -81,13 +81,13 @@ Gets or sets a custom comparer that sorts groups using an object that implements . A custom comparer that sorts groups using an object that implements . - [!NOTE] -> Setting the custom comparer object will clear previously set . - +> Setting the custom comparer object will clear previously set . + ]]> @@ -162,11 +162,11 @@ Gets the collection of names that are used to initialize a group with a set of subgroups with the given names. The collection of names that are used to initialize a group with a set of subgroups with the given names. - @@ -237,11 +237,11 @@ Arguments of the event being raised. Raises the event. - event. - + event. + ]]> diff --git a/xml/System.ComponentModel/GuidConverter.xml b/xml/System.ComponentModel/GuidConverter.xml index d3ea9b0d36d..a0210650c00 100644 --- a/xml/System.ComponentModel/GuidConverter.xml +++ b/xml/System.ComponentModel/GuidConverter.xml @@ -54,25 +54,25 @@ Provides a type converter to convert objects to and from various other representations. - base class and [How to: Implement a Type Converter](https://learn.microsoft.com/previous-versions/visualstudio/visual-studio-2013/ayybcxe5(v=vs.120)). - + base class and [How to: Implement a Type Converter](https://learn.microsoft.com/previous-versions/visualstudio/visual-studio-2013/ayybcxe5(v=vs.120)). + > [!CAUTION] -> You should never create an instance of a . Instead, call the method of the class. For more information, see the examples in the base class. - - - -## Examples - The following code example converts a variable of type to a string, and vice versa. - +> You should never create an instance of a . Instead, call the method of the class. For more information, see the examples in the base class. + + + +## Examples + The following code example converts a variable of type to a string, and vice versa. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Converters/CPP/converters.cpp" id="Snippet13"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/BooleanConverter/Overview/converters.cs" id="Snippet13"::: - :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/BooleanConverter/Overview/converters.vb" id="Snippet13"::: - + :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/BooleanConverter/Overview/converters.vb" id="Snippet13"::: + ]]> @@ -178,13 +178,13 @@ if this converter can perform the conversion; otherwise, . - @@ -246,11 +246,11 @@ if this converter can perform the conversion; otherwise, . - @@ -316,13 +316,13 @@ Converts the given object to a GUID object. An that represents the converted . - The conversion cannot be performed. @@ -388,13 +388,13 @@ Converts the given object to another type. The converted object. - on the object if the object is valid and if the destination type is `string`. - - The `context` parameter can be used to extract additional information about the environment this converter is being invoked from. This can be `null`, so always check. Also, properties on the context object can return `null`. - + on the object if the object is valid and if the destination type is `string`. + + The `context` parameter can be used to extract additional information about the environment this converter is being invoked from. This can be `null`, so always check. Also, properties on the context object can return `null`. + ]]> diff --git a/xml/System.ComponentModel/IBindingList.xml b/xml/System.ComponentModel/IBindingList.xml index ef43a268acf..088bc4ffd0a 100644 --- a/xml/System.ComponentModel/IBindingList.xml +++ b/xml/System.ComponentModel/IBindingList.xml @@ -60,11 +60,11 @@ ## Remarks This interface is implemented by the class. Implementation of a method should exhibit the same behavior as the implementation of that method in the class. - When you call the or methods, you should raise a event with the enumeration. + When you call the or methods, you should raise a event with the enumeration. - When you call the method, you should raise a event with the enumeration carrying the appropriate index. The added row is in a state where pressing the ESC on a control can remove the new row. Raising the event with the enumeration a second time on this row indicates that the item is now a row not in the "new" state. + When you call the method, you should raise a event with the enumeration carrying the appropriate index. The added row is in a state where pressing the ESC on a control can remove the new row. Raising the event with the enumeration a second time on this row indicates that the item is now a row not in the "new" state. - When you remove an item or call the method on a new row (if that row implements ), you should raise a event with the enumeration carrying the appropriate index. + When you remove an item or call the method on a new row (if that row implements ), you should raise a event with the enumeration carrying the appropriate index. @@ -176,12 +176,12 @@ is `true`; otherwise, a is thrown. + This method is supported only if is `true`; otherwise, a is thrown. - Implementing this method means that the list must understand the type of objects to add to the list and must understand how to create a new instance of that type. For example, if you have a collection of `myCustomer` objects, the method should add a new `myCustomer` object to the list. + Implementing this method means that the list must understand the type of objects to add to the list and must understand how to create a new instance of that type. For example, if you have a collection of `myCustomer` objects, the method should add a new `myCustomer` object to the list. > [!NOTE] -> If the objects in this list implement the interface, calling the method should discard an object, not add it to the list, when the object was created using the method. The object should only be added to the list when the method is called. Therefore, you must synchronize the object and the list carefully. +> If the objects in this list implement the interface, calling the method should discard an object, not add it to the list, when the object was created using the method. The object should only be added to the list when the method is called. Therefore, you must synchronize the object and the list carefully. When this method is called, you should raise a event with the enumeration carrying the appropriate index. The added row is in a state where hitting Esc on a control can remove the new row. Raising the event with the enumeration a second time on this row indicates that the item is now a normal row (not in new state). @@ -278,7 +278,7 @@ or is `true`, this property returns `false`. + If or is `true`, this property returns `false`. ]]> @@ -328,10 +328,10 @@ or is `true`, this property returns `false`. + If or is `true`, this property returns `false`. > [!NOTE] -> If returns `false`, and throw a . +> If returns `false`, and throw a . ]]> @@ -387,7 +387,7 @@ ## Remarks If items are added or removed, these items are placed in the order of the sort. - This method is supported if is `true`; otherwise, this method throws a . + This method is supported if is `true`; otherwise, this method throws a . ]]> @@ -449,12 +449,12 @@ ## Remarks This method will select the first row where the value of the `property` parameter equals the value of the `key` parameter. - This method is supported if is `true`, otherwise this method throws a . + This method is supported if is `true`, otherwise this method throws a . ## Examples - The following code example demonstrates how to implement the method. + The following code example demonstrates how to implement the method. :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/BindingListT/FindCore/Form1.cs" id="Snippet3"::: :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/BindingListT/FindCore/Form1.vb" id="Snippet3"::: @@ -509,9 +509,9 @@ is `true`; otherwise, this property throws a . + This property is supported if is `true`; otherwise, this property throws a . - If returns `true`, items are added or removed in the order of the sort. + If returns `true`, items are added or removed in the order of the sort. ]]> @@ -662,7 +662,7 @@ is `true`; otherwise, this property throws a . + This property is supported if is `true`; otherwise, this property throws a . When you call this method, you should raise a event with the enumeration. @@ -715,7 +715,7 @@ is `true`; otherwise, this property throws a . + This property is supported if is `true`; otherwise, this property throws a . ]]> @@ -773,7 +773,7 @@ is `true`; otherwise, this property throws a . + This property is supported if is `true`; otherwise, this property throws a . ]]> @@ -928,7 +928,7 @@ , , , , and are supported. + If this property is `true`, then , , , , and are supported. ]]> diff --git a/xml/System.ComponentModel/IBindingListView.xml b/xml/System.ComponentModel/IBindingListView.xml index b5a7cda93bd..2c7dfe84e22 100644 --- a/xml/System.ComponentModel/IBindingListView.xml +++ b/xml/System.ComponentModel/IBindingListView.xml @@ -174,7 +174,7 @@ property should exhibit the following behavior when the property is set: The data source returns only the items that meet the filter criteria when the list is accessed by item index or when the list is enumerated. The definition of the filter string is dependent on the data-source implementation, but the behavior associated with setting the filter should be modeled on . + Your implementation of the property should exhibit the following behavior when the property is set: The data source returns only the items that meet the filter criteria when the list is accessed by item index or when the list is enumerated. The definition of the filter string is dependent on the data-source implementation, but the behavior associated with setting the filter should be modeled on . ]]> diff --git a/xml/System.ComponentModel/ICancelAddNew.xml b/xml/System.ComponentModel/ICancelAddNew.xml index 7837e23eb42..7ee5557fba8 100644 --- a/xml/System.ComponentModel/ICancelAddNew.xml +++ b/xml/System.ComponentModel/ICancelAddNew.xml @@ -46,22 +46,22 @@ interface enables a collection to add a new item in an extensible way. The new item subsequently can be committed or rolled back. The method of the collection is used to tentatively add the item, which is subsequently transacted through the following operations: + The interface enables a collection to add a new item in an extensible way. The new item subsequently can be committed or rolled back. The method of the collection is used to tentatively add the item, which is subsequently transacted through the following operations: -- The method will explicitly commit the pending addition. +- The method will explicitly commit the pending addition. - Performing another collection operation, such as an insertion, removal, or move will implicitly commit the pending addition. -- The method will roll back the pending addition if it has not already been committed. +- The method will roll back the pending addition if it has not already been committed. > [!NOTE] -> In some scenarios, such as Windows Forms complex data binding, the collection may receive or calls for items other than the newly added item. (Each item is typically a row in a data view.) Ignore these calls; cancel or commit the new item only when that item's index is specified. +> In some scenarios, such as Windows Forms complex data binding, the collection may receive or calls for items other than the newly added item. (Each item is typically a row in a data view.) Ignore these calls; cancel or commit the new item only when that item's index is specified. There are two models that allow transactional addition of an item to a data-bound collection: -- The older model relies directly on a collection that implements the interface and is data-bound directly using the class. The , , and methods of the class are responsible for transactional support for adding new items. However, this functionality depends upon the items supporting transactional behavior through the interface. If the items do not support this interface, the item will always be added to the list, regardless of subsequent calls to . +- The older model relies directly on a collection that implements the interface and is data-bound directly using the class. The , , and methods of the class are responsible for transactional support for adding new items. However, this functionality depends upon the items supporting transactional behavior through the interface. If the items do not support this interface, the item will always be added to the list, regardless of subsequent calls to . -- The newer model supports a more robust data-binding scenario through the generic class, which implements the and interfaces. In this case, the transactional support is managed by the collection directly. +- The newer model supports a more robust data-binding scenario through the generic class, which implements the and interfaces. In this case, the transactional support is managed by the collection directly. ]]> @@ -116,7 +116,7 @@ method rolls back a pending addition () of an item previously added to the collection at position `itemIndex`. The index parameter is necessary because several new items can be simultaneously pending. + The method rolls back a pending addition () of an item previously added to the collection at position `itemIndex`. The index parameter is necessary because several new items can be simultaneously pending. ]]> @@ -170,7 +170,7 @@ commits a pending addition () of an item previously added to the collection at position `itemIndex`. The index parameter is necessary because several new items can be simultaneously pending. + The commits a pending addition () of an item previously added to the collection at position `itemIndex`. The index parameter is necessary because several new items can be simultaneously pending. ]]> diff --git a/xml/System.ComponentModel/ICollectionViewLiveShaping.xml b/xml/System.ComponentModel/ICollectionViewLiveShaping.xml index c9b5537ea1c..24cfd2c3df2 100644 --- a/xml/System.ComponentModel/ICollectionViewLiveShaping.xml +++ b/xml/System.ComponentModel/ICollectionViewLiveShaping.xml @@ -181,7 +181,7 @@ ## Remarks ## Notes for Inheritors - Your can implement live filtering itself, or you can delegate live filtering to another object, such as the underlying collection. If you delegate live filtering, the might not have control over whether it is enabled. Your must accept the behavior of the object to which it delegates. If your knows whether the delegate object supports live filtering, set the property to the known value. Otherwise, set to `null`. + Your can implement live filtering itself, or you can delegate live filtering to another object, such as the underlying collection. If you delegate live filtering, the might not have control over whether it is enabled. Your must accept the behavior of the object to which it delegates. If your knows whether the delegate object supports live filtering, set the property to the known value. Otherwise, set to `null`. ]]> @@ -219,7 +219,7 @@ ## Remarks ## Notes for Inheritors - Your can implement live grouping itself, or you can delegate live grouping to another object, such as the underlying collection. If you delegate live grouping, the might not have control over whether it is enabled. Your must accept the behavior of the object to which it delegates. If your knows whether the delegate object supports live grouping, set the property to the known value. Otherwise, set to `null`. + Your can implement live grouping itself, or you can delegate live grouping to another object, such as the underlying collection. If you delegate live grouping, the might not have control over whether it is enabled. Your must accept the behavior of the object to which it delegates. If your knows whether the delegate object supports live grouping, set the property to the known value. Otherwise, set to `null`. ]]> @@ -257,7 +257,7 @@ ## Remarks ## Notes for Inheritors - Your can implement live sorting itself, or you can delegate live sorting to another object, such as the underlying collection. If you delegate live sorting, the might not have control over whether it is enabled. Your must accept the behavior of the object to which it delegates. If your knows whether the delegate object supports live sorting, set the property to the known value. Otherwise, set to `null`. + Your can implement live sorting itself, or you can delegate live sorting to another object, such as the underlying collection. If you delegate live sorting, the might not have control over whether it is enabled. Your must accept the behavior of the object to which it delegates. If your knows whether the delegate object supports live sorting, set the property to the known value. Otherwise, set to `null`. ]]> diff --git a/xml/System.ComponentModel/IComNativeDescriptorHandler.xml b/xml/System.ComponentModel/IComNativeDescriptorHandler.xml index e65419a43b5..6ffe8e550b2 100644 --- a/xml/System.ComponentModel/IComNativeDescriptorHandler.xml +++ b/xml/System.ComponentModel/IComNativeDescriptorHandler.xml @@ -62,13 +62,13 @@ Provides a top-level mapping layer between a COM object and a . - [!NOTE] -> This API is now obsolete. Add a to handle a instead. - +> This API is now obsolete. Add a to handle a instead. + ]]> @@ -117,13 +117,13 @@ Gets the attributes for the specified component. A collection of attributes for . - [!NOTE] -> This API is now obsolete. The non-obsolete alternative is . - +> This API is now obsolete. The non-obsolete alternative is . + ]]> @@ -172,13 +172,13 @@ Gets the class name for the specified component. The name of the class that corresponds with . - [!NOTE] -> This API is now obsolete. The non-obsolete alternative is . - +> This API is now obsolete. The non-obsolete alternative is . + ]]> @@ -227,13 +227,13 @@ Gets the type converter for the specified component. The for . - [!NOTE] -> This API is now obsolete. The non-obsolete alternative is . - +> This API is now obsolete. The non-obsolete alternative is . + ]]> @@ -282,13 +282,13 @@ Gets the default event for the specified component. An that represents 's default event. - [!NOTE] -> This API is now obsolete. The non-obsolete alternative is . - +> This API is now obsolete. The non-obsolete alternative is . + ]]> @@ -337,13 +337,13 @@ Gets the default property for the specified component. A that represents 's default property. - [!NOTE] -> This API is now obsolete. The non-obsolete alternative is . - +> This API is now obsolete. The non-obsolete alternative is . + ]]> @@ -394,13 +394,13 @@ Gets the editor for the specified component. The editor for . - [!NOTE] -> This API is now obsolete. The non-obsolete alternative is . - +> This API is now obsolete. The non-obsolete alternative is . + ]]> @@ -459,13 +459,13 @@ Gets the events for the specified component. A collection of event descriptors for . - [!NOTE] -> This API is now obsolete. The non-obsolete alternative is . - +> This API is now obsolete. The non-obsolete alternative is . + ]]> @@ -524,13 +524,13 @@ Gets the events with the specified attributes for the specified component. A collection of event descriptors for . - [!NOTE] -> This API is now obsolete. The non-obsolete alternative is . - +> This API is now obsolete. The non-obsolete alternative is . + ]]> @@ -579,13 +579,13 @@ Gets the name of the specified component. The name of . - [!NOTE] -> This API is now obsolete. The non-obsolete alternative is . - +> This API is now obsolete. The non-obsolete alternative is . + ]]> @@ -644,13 +644,13 @@ Gets the properties with the specified attributes for the specified component. A collection of property descriptors for . - [!NOTE] -> This API is now obsolete. The non-obsolete alternative is . - +> This API is now obsolete. The non-obsolete alternative is . + ]]> @@ -713,13 +713,13 @@ Gets the value of the property that has the specified dispatch identifier. The value of the property that has the specified dispatch identifier. - [!NOTE] -> This API is now obsolete. The non-obsolete alternative is . - +> This API is now obsolete. The non-obsolete alternative is . + ]]> @@ -772,13 +772,13 @@ Gets the value of the property that has the specified name. The value of the property that has the specified name. - [!NOTE] -> This API is now obsolete. The non-obsolete alternative is . - +> This API is now obsolete. The non-obsolete alternative is . + ]]> diff --git a/xml/System.ComponentModel/ICustomTypeDescriptor.xml b/xml/System.ComponentModel/ICustomTypeDescriptor.xml index cb68b706eb0..fac83062083 100644 --- a/xml/System.ComponentModel/ICustomTypeDescriptor.xml +++ b/xml/System.ComponentModel/ICustomTypeDescriptor.xml @@ -170,7 +170,7 @@ method. + If `null` is returned, use the type name from the method. ]]> @@ -829,7 +829,7 @@ If an is specified in the `attributes` array and the property does not have an instance of the class for that attribute, the returned collection will include the property if the is the default property. - For filtering rules, see . + For filtering rules, see . ]]> @@ -928,7 +928,7 @@ method retrieves the object that contains the property member that is described by parameter. Typically, this object is required for the and methods. + The method retrieves the object that contains the property member that is described by parameter. Typically, this object is required for the and methods. This method should return an object that you can use as follows: diff --git a/xml/System.ComponentModel/IEditableCollectionView.xml b/xml/System.ComponentModel/IEditableCollectionView.xml index fe602dce372..3421a2c0a64 100644 --- a/xml/System.ComponentModel/IEditableCollectionView.xml +++ b/xml/System.ComponentModel/IEditableCollectionView.xml @@ -72,12 +72,12 @@ begins an add transaction. You should call or to end the add transaction. A new item always appears in the collection view. Any filtering, sorting, or grouping that is applied to the view is applied to the new item when is called. + Calling begins an add transaction. You should call or to end the add transaction. A new item always appears in the collection view. Any filtering, sorting, or grouping that is applied to the view is applied to the new item when is called. ## Examples - The following example creates a that prompts the user to add a new item. Then it calls to create a new object and sets the of the to that object. For the entire sample, see [Changing a Collection by Using IEditableCollectionView Sample](https://github.com/Microsoft/WPF-Samples/tree/master/Data%20Binding/EditingCollections). + The following example creates a that prompts the user to add a new item. Then it calls to create a new object and sets the of the to that object. For the entire sample, see [Changing a Collection by Using IEditableCollectionView Sample](https://github.com/Microsoft/WPF-Samples/tree/master/Data%20Binding/EditingCollections). :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/IEditableCollectionView/Overview/Window1.xaml.cs" id="Snippetadditem"::: :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/IEditableCollectionView/Overview/window1.xaml.vb" id="Snippetadditem"::: @@ -119,14 +119,14 @@ ## Remarks An can add a new item if the following are true: -- An item can be added to the underlying collection. For example, if the collection is read-only, is `false`. +- An item can be added to the underlying collection. For example, if the collection is read-only, is `false`. -- The can create an object of the type that is in the collection. For example, if the collection is of type , the must be able to create an object of type `T`. +- The can create an object of the type that is in the collection. For example, if the collection is of type , the must be able to create an object of type `T`. ## Examples - The following example checks whether an item can be added to the collection. If is `false`, the example tells the user that an item cannot be added. Otherwise, it shows a form that prompts the user to add a new item. For the entire sample, see [Changing a Collection by Using IEditableCollectionView Sample](https://github.com/Microsoft/WPF-Samples/tree/master/Data%20Binding/EditingCollections) . + The following example checks whether an item can be added to the collection. If is `false`, the example tells the user that an item cannot be added. Otherwise, it shows a form that prompts the user to add a new item. For the entire sample, see [Changing a Collection by Using IEditableCollectionView Sample](https://github.com/Microsoft/WPF-Samples/tree/master/Data%20Binding/EditingCollections) . :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/IEditableCollectionView/Overview/Window1.xaml.cs" id="Snippetadditem"::: :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/IEditableCollectionView/Overview/window1.xaml.vb" id="Snippetadditem"::: @@ -166,12 +166,12 @@ is `true` if the view supports the notion of "pending changes" on the currently edited item. For example, a collection view might return `true` if the edited item implements , or if the view has information about the item's state that it can use to roll back changes. is `false` if the view cannot revert changes on an object. In that case, call to cause the view to exit the edit state and provide logic to revert the changes on the object that was edited. + is `true` if the view supports the notion of "pending changes" on the currently edited item. For example, a collection view might return `true` if the edited item implements , or if the view has information about the item's state that it can use to roll back changes. is `false` if the view cannot revert changes on an object. In that case, call to cause the view to exit the edit state and provide logic to revert the changes on the object that was edited. ## Examples - The following example gets to check whether the original values of the edited item can be restored before it calls . If the values cannot be restored, you must supply additional logic to do so. If they can be, the values are restored when the example calls . For the entire sample, see [Changing a Collection by Using IEditableCollectionView Sample](https://github.com/Microsoft/WPF-Samples/tree/master/Data%20Binding/EditingCollections). + The following example gets to check whether the original values of the edited item can be restored before it calls . If the values cannot be restored, you must supply additional logic to do so. If they can be, the values are restored when the example calls . For the entire sample, see [Changing a Collection by Using IEditableCollectionView Sample](https://github.com/Microsoft/WPF-Samples/tree/master/Data%20Binding/EditingCollections). :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/IEditableCollectionView/Overview/Window1.xaml.cs" id="Snippetcanceledit"::: :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/IEditableCollectionView/Overview/window1.xaml.vb" id="Snippetcanceledit"::: @@ -210,12 +210,12 @@ sets to `null` and causes the collection view to exit the edit state. If is `true`, also restores the original values of the edited object. + sets to `null` and causes the collection view to exit the edit state. If is `true`, also restores the original values of the edited object. ## Examples - The following example gets to check whether the original values of the edited item can be restored before it calls . If the values cannot be restored, you must supply additional logic to do so. If they can be, the values are restored when the example calls . For the entire sample, see [Changing a Collection by Using IEditableCollectionView Sample](https://github.com/Microsoft/WPF-Samples/tree/master/Data%20Binding/EditingCollections). + The following example gets to check whether the original values of the edited item can be restored before it calls . If the values cannot be restored, you must supply additional logic to do so. If they can be, the values are restored when the example calls . For the entire sample, see [Changing a Collection by Using IEditableCollectionView Sample](https://github.com/Microsoft/WPF-Samples/tree/master/Data%20Binding/EditingCollections). :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/IEditableCollectionView/Overview/Window1.xaml.cs" id="Snippetcanceledit"::: :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/IEditableCollectionView/Overview/window1.xaml.vb" id="Snippetcanceledit"::: @@ -254,7 +254,7 @@ to add the item to the collection. If the user cancels the form, the example calls to discard the item. For the entire sample, see [Changing a Collection by Using IEditableCollectionView Sample](https://github.com/Microsoft/WPF-Samples/tree/master/Data%20Binding/EditingCollections). + The following example displays a form that prompts the user to add a new item. If the user submits the form, the example calls to add the item to the collection. If the user cancels the form, the example calls to discard the item. For the entire sample, see [Changing a Collection by Using IEditableCollectionView Sample](https://github.com/Microsoft/WPF-Samples/tree/master/Data%20Binding/EditingCollections). :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/IEditableCollectionView/Overview/Window1.xaml.cs" id="Snippetadditem"::: :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/IEditableCollectionView/Overview/window1.xaml.vb" id="Snippetadditem"::: @@ -294,12 +294,12 @@ is `false` if the underlying collection is read-only. + is `false` if the underlying collection is read-only. ## Examples - The following example calls to check whether an item can be removed from the collection. If an item can be removed, the example prompts the user to confirm the action and calls if the user clicks **Yes**. For the entire sample, see [Changing a Collection by Using IEditableCollectionView Sample](https://github.com/Microsoft/WPF-Samples/tree/master/Data%20Binding/EditingCollections). + The following example calls to check whether an item can be removed from the collection. If an item can be removed, the example prompts the user to confirm the action and calls if the user clicks **Yes**. For the entire sample, see [Changing a Collection by Using IEditableCollectionView Sample](https://github.com/Microsoft/WPF-Samples/tree/master/Data%20Binding/EditingCollections). :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/IEditableCollectionView/Overview/Window1.xaml.cs" id="Snippetremoveitem"::: :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/IEditableCollectionView/Overview/window1.xaml.vb" id="Snippetremoveitem"::: @@ -338,7 +338,7 @@ to save the changes to the collection. If the user cancels the form, the example calls to discard the changes. For the entire sample, see [Changing a Collection by Using IEditableCollectionView Sample](https://github.com/Microsoft/WPF-Samples/tree/master/Data%20Binding/EditingCollections). + The following example creates a form that prompts the user to edit an existing item. If the user submits the form, the example calls to save the changes to the collection. If the user cancels the form, the example calls to discard the changes. For the entire sample, see [Changing a Collection by Using IEditableCollectionView Sample](https://github.com/Microsoft/WPF-Samples/tree/master/Data%20Binding/EditingCollections). :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/IEditableCollectionView/Overview/Window1.xaml.cs" id="Snippetedititem"::: :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/IEditableCollectionView/Overview/window1.xaml.vb" id="Snippetedititem"::: @@ -377,12 +377,12 @@ is applied to the new item when is called. + Any filtering, sorting, or grouping that is applied to the is applied to the new item when is called. ## Examples - The following example displays a form that prompts the user to add a new item. If the user submits the form, the example calls to add the item to the collection. If the user cancels the form, the example calls to discard the item. For the entire sample, see [Changing a Collection by Using IEditableCollectionView Sample](https://github.com/Microsoft/WPF-Samples/tree/master/Data%20Binding/EditingCollections). + The following example displays a form that prompts the user to add a new item. If the user submits the form, the example calls to add the item to the collection. If the user cancels the form, the example calls to discard the item. For the entire sample, see [Changing a Collection by Using IEditableCollectionView Sample](https://github.com/Microsoft/WPF-Samples/tree/master/Data%20Binding/EditingCollections). :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/IEditableCollectionView/Overview/Window1.xaml.cs" id="Snippetadditem"::: :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/IEditableCollectionView/Overview/window1.xaml.vb" id="Snippetadditem"::: @@ -522,7 +522,7 @@ and end the add transaction by calling or . + You begin an add transaction by calling and end the add transaction by calling or . ]]> @@ -559,7 +559,7 @@ and end the transaction by calling or . + You begin an edit transaction by calling and end the transaction by calling or . ]]> @@ -627,12 +627,12 @@ does nothing. + If `item` is not in the collection, does nothing. ## Examples - The following example calls to check whether an item can be removed from the collection. If an item can be removed, the example prompts the user to confirm the action and calls if the user clicks **Yes**. For the entire sample, see [Changing a Collection by Using IEditableCollectionView Sample](https://github.com/Microsoft/WPF-Samples/tree/master/Data%20Binding/EditingCollections). + The following example calls to check whether an item can be removed from the collection. If an item can be removed, the example prompts the user to confirm the action and calls if the user clicks **Yes**. For the entire sample, see [Changing a Collection by Using IEditableCollectionView Sample](https://github.com/Microsoft/WPF-Samples/tree/master/Data%20Binding/EditingCollections). :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/IEditableCollectionView/Overview/Window1.xaml.cs" id="Snippetremoveitem"::: :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/IEditableCollectionView/Overview/window1.xaml.vb" id="Snippetremoveitem"::: @@ -674,7 +674,7 @@ so that 7 items appear, the valid values of `index` are 0 through 6. + `index` is relative to the collection view, not the collection. For example, if the collection has 10 items and the view has a so that 7 items appear, the valid values of `index` are 0 through 6. ]]> diff --git a/xml/System.ComponentModel/IEditableCollectionViewAddNewItem.xml b/xml/System.ComponentModel/IEditableCollectionViewAddNewItem.xml index aad0904cee4..1a67f9de23e 100644 --- a/xml/System.ComponentModel/IEditableCollectionViewAddNewItem.xml +++ b/xml/System.ComponentModel/IEditableCollectionViewAddNewItem.xml @@ -28,7 +28,7 @@ interface enables application developers to specify what type of object to add to a collection. This interface extends , so you can add, edit, and remove items in a collection. adds the method, which takes an object that is added to the collection. This method is useful when the collection and objects that you want to add have one or more of the following characteristics: + The interface enables application developers to specify what type of object to add to a collection. This interface extends , so you can add, edit, and remove items in a collection. adds the method, which takes an object that is added to the collection. This method is useful when the collection and objects that you want to add have one or more of the following characteristics: - The objects in the are different types. @@ -41,7 +41,7 @@ ## Examples - The following example enables a user to add various types of items to a collection. The user can enter a new item and submit the entry or cancel the transaction. The example gets an from the property of a and creates an object, whose type is determined by the user. Then the example calls the method to add the object to the collection. + The following example enables a user to add various types of items to a collection. The user can enter a new item and submit the entry or cancel the transaction. The example gets an from the property of a and creates an object, whose type is determined by the user. Then the example calls the method to add the object to the collection. :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/IEditableCollectionViewAddNewItem/Overview/window1.xaml.cs" id="Snippetmainwindowlogic"::: :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/IEditableCollectionViewAddNewItem/Overview/window1.xaml.vb" id="Snippetmainwindowlogic"::: @@ -101,14 +101,14 @@ method, it begins an add transaction. You should call the or methods to end the add transaction. + When you calling the method, it begins an add transaction. You should call the or methods to end the add transaction. - A new item always appears in the collection view. Any filtering, sorting, or grouping that is applied to the view is applied to the new item when is called. + A new item always appears in the collection view. Any filtering, sorting, or grouping that is applied to the view is applied to the new item when is called. ## Examples - The following example calls the method to add an object to a collection. For the complete example, see the class. + The following example calls the method to add an object to a collection. For the complete example, see the class. :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/IEditableCollectionViewAddNewItem/Overview/window1.xaml.cs" id="Snippetmainwindowlogic"::: :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/IEditableCollectionViewAddNewItem/Overview/window1.xaml.vb" id="Snippetmainwindowlogic"::: @@ -147,7 +147,7 @@ property is `true`, you can specify an object to add to the collection by calling the method. is `false` if items cannot be added to the collection by using . If is `false`, you may still be able to add an object by using the method. For example, you can add objects to an ADO.NET source by using , but not by using . + If the property is `true`, you can specify an object to add to the collection by calling the method. is `false` if items cannot be added to the collection by using . If is `false`, you may still be able to add an object by using the method. For example, you can add objects to an ADO.NET source by using , but not by using . ]]> diff --git a/xml/System.ComponentModel/IEditableObject.xml b/xml/System.ComponentModel/IEditableObject.xml index 59e2dbf0e9f..033589bb330 100644 --- a/xml/System.ComponentModel/IEditableObject.xml +++ b/xml/System.ComponentModel/IEditableObject.xml @@ -45,20 +45,20 @@ Provides functionality to commit or rollback changes to an object that is used as a data source. - , , and semantics of a . - - - -## Examples - The following sample provides a simple implementation of the interface. The `Customer` class stores customer information and can be used as a collection for a customer database. This sample assumes that you have used the `CustomerList` class that can be found in sample in the class. - + , , and semantics of a . + + + +## Examples + The following sample provides a simple implementation of the interface. The `Customer` class stores customer information and can be used as a collection for a customer database. This sample assumes that you have used the `CustomerList` class that can be found in sample in the class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Binding_Editable/CPP/binding_editable.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/IBindingList/Overview/binding_editable.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/IBindingList/Overview/binding_editable.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/IBindingList/Overview/binding_editable.vb" id="Snippet1"::: + ]]> @@ -103,13 +103,13 @@ Begins an edit on an object. - semantics of a . - - If is called on an object that is already being edited, the second and subsequent calls are ignored. - + semantics of a . + + If is called on an object that is already being edited, the second and subsequent calls are ignored. + ]]> @@ -157,16 +157,16 @@ Discards changes since the last call. - semantics of a . - - This method will be ignored if called on an object that is not being edited. - + semantics of a . + + This method will be ignored if called on an object that is not being edited. + > [!NOTE] -> If the owning list implements , calling on an object created using discards the object. - +> If the owning list implements , calling on an object created using discards the object. + ]]> @@ -211,13 +211,13 @@ Pushes changes since the last or call into the underlying object. - semantics of a . - - This method will be ignored if called on an object that is not being edited. - + semantics of a . + + This method will be ignored if called on an object that is not being edited. + ]]> diff --git a/xml/System.ComponentModel/IExtenderProvider.xml b/xml/System.ComponentModel/IExtenderProvider.xml index 008c8345aa7..3a30bdc99b7 100644 --- a/xml/System.ComponentModel/IExtenderProvider.xml +++ b/xml/System.ComponentModel/IExtenderProvider.xml @@ -51,7 +51,7 @@ ## Remarks An extender provider is a component that provides properties to other components. For example, the control is an extender provider. When you add a control to a , all other controls on the form have a property added to their list of properties. - Any component that provides extender properties must implement . A visual designer can then call to determine which objects in a container should receive the extender properties. + Any component that provides extender properties must implement . A visual designer can then call to determine which objects in a container should receive the extender properties. For more information about extender providers, see [How to: Implement an Extender Provider](/previous-versions/visualstudio/visual-studio-2013/d6c1xa43(v=vs.120)). diff --git a/xml/System.ComponentModel/IListSource.xml b/xml/System.ComponentModel/IListSource.xml index 4b1d77921e9..db9b472461f 100644 --- a/xml/System.ComponentModel/IListSource.xml +++ b/xml/System.ComponentModel/IListSource.xml @@ -77,7 +77,7 @@ - -- Implementer of , provided the implementer has a strongly typed property (that is, the is anything but ). You can accomplish this by making the default implementation of private. If you want to create an that follows the rules of a strongly typed collection, you should derive from . +- Implementer of , provided the implementer has a strongly typed property (that is, the is anything but ). You can accomplish this by making the default implementation of private. If you want to create an that follows the rules of a strongly typed collection, you should derive from . - Implementer of . @@ -89,7 +89,7 @@ ## Examples - The following code example demonstrates how to implement the interface. A component named `EmployeeListSource` exposes an for data binding by implementing the method. For a full code listing, see [How to: Implement the IListSource Interface](/dotnet/framework/winforms/how-to-implement-the-ilistsource-interface). + The following code example demonstrates how to implement the interface. A component named `EmployeeListSource` exposes an for data binding by implementing the method. For a full code listing, see [How to: Implement the IListSource Interface](/dotnet/framework/winforms/how-to-implement-the-ilistsource-interface). :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/IListSource/Overview/EmployeeListSource.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/IListSource/Overview/EmployeeListSource.vb" id="Snippet1"::: @@ -154,7 +154,7 @@ ## Examples - The following code example demonstrates how to implement the interface. A component named `EmployeeListSource` indicates that it does not contain an for data binding by returning `false` from the method. For a full code listing, see [How to: Implement the IListSource Interface](/dotnet/framework/winforms/how-to-implement-the-ilistsource-interface). + The following code example demonstrates how to implement the interface. A component named `EmployeeListSource` indicates that it does not contain an for data binding by returning `false` from the method. For a full code listing, see [How to: Implement the IListSource Interface](/dotnet/framework/winforms/how-to-implement-the-ilistsource-interface). :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/IListSource/Overview/EmployeeListSource.cs" id="Snippet3"::: :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/IListSource/Overview/EmployeeListSource.vb" id="Snippet3"::: @@ -213,7 +213,7 @@ interface. A component named `EmployeeListSource` exposes an for data binding by implementing the method. For a full code listing, see [How to: Implement the IListSource Interface](/dotnet/framework/winforms/how-to-implement-the-ilistsource-interface). + The following code example demonstrates how to implement the interface. A component named `EmployeeListSource` exposes an for data binding by implementing the method. For a full code listing, see [How to: Implement the IListSource Interface](/dotnet/framework/winforms/how-to-implement-the-ilistsource-interface). :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/IListSource/Overview/EmployeeListSource.cs" id="Snippet4"::: :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/IListSource/Overview/EmployeeListSource.vb" id="Snippet4"::: diff --git a/xml/System.ComponentModel/INotifyDataErrorInfo.xml b/xml/System.ComponentModel/INotifyDataErrorInfo.xml index 491ba85ef33..d93f8dc7f52 100644 --- a/xml/System.ComponentModel/INotifyDataErrorInfo.xml +++ b/xml/System.ComponentModel/INotifyDataErrorInfo.xml @@ -50,11 +50,11 @@ Defines members that data entity classes can implement to provide custom synchronous and asynchronous validation support. - @@ -108,11 +108,11 @@ Occurs when the validation errors have changed for a property or for the entire entity. - return value changes, even if the return value implements . - + return value changes, even if the return value implements . + ]]> @@ -172,13 +172,13 @@ Gets the validation errors for a specified property or for the entire entity. The validation errors for the property or entity. - that can change as asynchronous validation rules finish processing. This enables the binding engine to automatically update the user interface validation feedback when errors are added, removed, or modified. - - The return value can change to a different , or it can reuse a previously returned and change its contents. Any changes to the return value should raise the event, even if the return value implements . - + that can change as asynchronous validation rules finish processing. This enables the binding engine to automatically update the user interface validation feedback when errors are added, removed, or modified. + + The return value can change to a different , or it can reuse a previously returned and change its contents. Any changes to the return value should raise the event, even if the return value implements . + ]]> @@ -227,11 +227,11 @@ if the entity currently has validation errors; otherwise, . - method. - + method. + ]]> diff --git a/xml/System.ComponentModel/ISupportInitialize.xml b/xml/System.ComponentModel/ISupportInitialize.xml index 2f18ad40521..18f650a04a6 100644 --- a/xml/System.ComponentModel/ISupportInitialize.xml +++ b/xml/System.ComponentModel/ISupportInitialize.xml @@ -57,22 +57,22 @@ Specifies that this object supports a simple, transacted notification for batch initialization. - allows controls to optimize multiple property assignments. As a result, you can initialize co-dependent properties or batch set multiple properties at design time. - - Call the method to signal the object that initialization is starting. Call the method to signal that initialization is complete. - - - -## Examples - The following code example demonstrates how to use the interface to initialize three controls. - + allows controls to optimize multiple property assignments. As a result, you can initialize co-dependent properties or batch set multiple properties at design time. + + Call the method to signal the object that initialization is starting. Call the method to signal that initialization is complete. + + + +## Examples + The following code example demonstrates how to use the interface to initialize three controls. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Trackbar/CPP/form1.cpp" id="Snippet4"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/ISupportInitialize/Overview/form1.cs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/ISupportInitialize/Overview/form1.vb" id="Snippet4"::: - + :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/ISupportInitialize/Overview/form1.vb" id="Snippet4"::: + ]]> @@ -121,15 +121,15 @@ Signals the object that initialization is starting. - interface to initialize three controls. - + interface to initialize three controls. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Trackbar/CPP/form1.cpp" id="Snippet4"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/ISupportInitialize/Overview/form1.cs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/ISupportInitialize/Overview/form1.vb" id="Snippet4"::: - + :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/ISupportInitialize/Overview/form1.vb" id="Snippet4"::: + ]]> @@ -178,15 +178,15 @@ Signals the object that initialization is complete. - interface to initialize three controls. - + interface to initialize three controls. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Trackbar/CPP/form1.cpp" id="Snippet4"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/ISupportInitialize/Overview/form1.cs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/ISupportInitialize/Overview/form1.vb" id="Snippet4"::: - + :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/ISupportInitialize/Overview/form1.vb" id="Snippet4"::: + ]]> diff --git a/xml/System.ComponentModel/ISupportInitializeNotification.xml b/xml/System.ComponentModel/ISupportInitializeNotification.xml index 336e00281cb..fa9266dfddb 100644 --- a/xml/System.ComponentModel/ISupportInitializeNotification.xml +++ b/xml/System.ComponentModel/ISupportInitializeNotification.xml @@ -99,7 +99,7 @@ method for the component, but it may occur later if the component has dependent controls that implement the interface and the dependent controls have not completed initialization. + This event typically occurs during the call to the method for the component, but it may occur later if the component has dependent controls that implement the interface and the dependent controls have not completed initialization. For more information about how to handle events, see [Handling and Raising Events](/dotnet/standard/events/). @@ -150,7 +150,7 @@ property is automatically set to `false` when the method is called, and `true` when the method is called. + The property is automatically set to `false` when the method is called, and `true` when the method is called. ]]> diff --git a/xml/System.ComponentModel/ISynchronizeInvoke.xml b/xml/System.ComponentModel/ISynchronizeInvoke.xml index 5bc12a06f51..b228131a1c7 100644 --- a/xml/System.ComponentModel/ISynchronizeInvoke.xml +++ b/xml/System.ComponentModel/ISynchronizeInvoke.xml @@ -51,9 +51,9 @@ The class provides two ways to invoke a process: -1. Asynchronously, by using the method. starts a process and then returns immediately. Use to wait until the process started by completes. +1. Asynchronously, by using the method. starts a process and then returns immediately. Use to wait until the process started by completes. -2. Synchronously, by using the method. starts a process, waits until it completes, and then returns. Use when the control's main thread is different from the calling thread to marshal the call to the proper thread. +2. Synchronously, by using the method. starts a process, waits until it completes, and then returns. Use when the control's main thread is different from the calling thread to marshal the call to the proper thread. > [!NOTE] > The attribute applied to this class has the following property value: | . The does not affect desktop applications (which are typically started by double-clicking an icon, typing a command, or entering a URL in a browser). For more information, see the class or [SQL Server Programming and Host Protection Attributes](/dotnet/framework/performance/sql-server-programming-and-host-protection-attributes). @@ -122,11 +122,11 @@ was called. + The `method` delegate is executed on the thread that created the object, instead of the thread on which was called. - The delegate is called asynchronously, and this method returns immediately. You can call this method from any thread. If you need the return value from a process started with this method, call to get the value. + The delegate is called asynchronously, and this method returns immediately. You can call this method from any thread. If you need the return value from a process started with this method, call to get the value. - If you need to call the delegate synchronously, use the method instead. + If you need to call the delegate synchronously, use the method instead. ]]> @@ -251,7 +251,7 @@ , this method operates synchronously, that is, it waits until the process completes before returning. Exceptions raised during the call are propagated back to the caller. + Unlike , this method operates synchronously, that is, it waits until the process completes before returning. Exceptions raised during the call are propagated back to the caller. Use this method when calling a method from a different thread to marshal the call to the proper thread. @@ -303,7 +303,7 @@ when making method calls to an object that implements this interface. Such objects are bound to a specific thread and are not thread-safe. If you are calling a method from a different thread, you must use the method to marshal the call to the proper thread. + This property determines whether the caller must call when making method calls to an object that implements this interface. Such objects are bound to a specific thread and are not thread-safe. If you are calling a method from a different thread, you must use the method to marshal the call to the proper thread. ]]> diff --git a/xml/System.ComponentModel/ITypeDescriptorContext.xml b/xml/System.ComponentModel/ITypeDescriptorContext.xml index 8fc4986ebb0..bd99169a405 100644 --- a/xml/System.ComponentModel/ITypeDescriptorContext.xml +++ b/xml/System.ComponentModel/ITypeDescriptorContext.xml @@ -176,7 +176,7 @@ property gets the object that is invoking the interface. For example, if a type converter is given a to convert, returns the actual instance of the control that is using the . You can subsequently query the control for further information about its services and its . + The property gets the object that is invoking the interface. For example, if a type converter is given a to convert, returns the actual instance of the control that is using the . You can subsequently query the control for further information about its services and its . ]]> @@ -227,11 +227,11 @@ method to send notification that an instance of an object has changed. + Use the method to send notification that an instance of an object has changed. Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). - The method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + The method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. ]]> @@ -288,11 +288,11 @@ method to send notification that an instance of an object is about to be changed. This method also returns a value indicating whether this object can be changed. When `false` is returned, do not change the object. + Use the method to send notification that an instance of an object is about to be changed. This method also returns a value indicating whether this object can be changed. When `false` is returned, do not change the object. Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). - The method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + The method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. ]]> diff --git a/xml/System.ComponentModel/ITypedList.xml b/xml/System.ComponentModel/ITypedList.xml index 87f93d04f52..497fb665344 100644 --- a/xml/System.ComponentModel/ITypedList.xml +++ b/xml/System.ComponentModel/ITypedList.xml @@ -57,7 +57,7 @@ - -- Implementer of , provided the implementer has a strongly typed property (that is, the is anything but ). You can accomplish this by making the default implementation of private. If you want to create an that follows the rules of a strongly typed collection, you should derive from . +- Implementer of , provided the implementer has a strongly typed property (that is, the is anything but ). You can accomplish this by making the default implementation of private. If you want to create an that follows the rules of a strongly typed collection, you should derive from . - Implementer of . @@ -68,7 +68,7 @@ ## Examples - The following code example demonstrates how to implement the interface. A generic type named `SortableBindingList` derives from the class and implements the interface. For a full code listing, see [How to: Implement the ITypedList Interface](/dotnet/framework/winforms/how-to-implement-the-itypedlist-interface). + The following code example demonstrates how to implement the interface. A generic type named `SortableBindingList` derives from the class and implements the interface. For a full code listing, see [How to: Implement the ITypedList Interface](/dotnet/framework/winforms/how-to-implement-the-itypedlist-interface). :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/ITypedList/Overview/SortableBindingList.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/ITypedList/Overview/SortableBindingList.vb" id="Snippet1"::: @@ -136,12 +136,12 @@ . For example, a containing two tables, `myCustomers` and `myOrders`, with a relationship between them called `myCustOrders`. If you create a object to view `myCustomers`, then calling the method with `null` returns the property descriptors for the columns in `myCustomers`. As a result, one of the returned property descriptors is a property descriptor for `myCustOrders`, just as calling the method with a list accessor array containing the property descriptors for `myCustOrders` will return the property descriptors for `myOrders`. + If the `listAccessors` parameter is not `null`, it typically contains a property descriptor that identifies a list of containers to retrieve for the object that implements . For example, a containing two tables, `myCustomers` and `myOrders`, with a relationship between them called `myCustOrders`. If you create a object to view `myCustomers`, then calling the method with `null` returns the property descriptors for the columns in `myCustomers`. As a result, one of the returned property descriptors is a property descriptor for `myCustOrders`, just as calling the method with a list accessor array containing the property descriptors for `myCustOrders` will return the property descriptors for `myOrders`. ## Examples - The following code example demonstrates how to implement the method. For a full code listing, see [How to: Implement the ITypedList Interface](/dotnet/framework/winforms/how-to-implement-the-itypedlist-interface). + The following code example demonstrates how to implement the method. For a full code listing, see [How to: Implement the ITypedList Interface](/dotnet/framework/winforms/how-to-implement-the-itypedlist-interface). :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/ITypedList/Overview/SortableBindingList.cs" id="Snippet3"::: :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/ITypedList/Overview/SortableBindingList.vb" id="Snippet3"::: @@ -214,7 +214,7 @@ ## Examples - The following code example demonstrates how to implement the method. For a full code listing, see [How to: Implement the ITypedList Interface](/dotnet/framework/winforms/how-to-implement-the-itypedlist-interface). + The following code example demonstrates how to implement the method. For a full code listing, see [How to: Implement the ITypedList Interface](/dotnet/framework/winforms/how-to-implement-the-itypedlist-interface). :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/ITypedList/Overview/SortableBindingList.cs" id="Snippet4"::: :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/ITypedList/Overview/SortableBindingList.vb" id="Snippet4"::: diff --git a/xml/System.ComponentModel/InheritanceAttribute.xml b/xml/System.ComponentModel/InheritanceAttribute.xml index b4f013db571..88b1401e737 100644 --- a/xml/System.ComponentModel/InheritanceAttribute.xml +++ b/xml/System.ComponentModel/InheritanceAttribute.xml @@ -56,13 +56,13 @@ Indicates whether the component associated with this attribute has been inherited from a base class. This class cannot be inherited. - represents the type and level of inheritance of a member. - - When the method of the searches the component fields of a component to identify fields that are inherited from a base class, the method represents the inheritance level of each component using an . - + represents the type and level of inheritance of a member. + + When the method of the searches the component fields of a component to identify fields that are inherited from a base class, the method represents the inheritance level of each component using an . + ]]> @@ -206,11 +206,11 @@ Specifies that the default value for is . This field is read-only. - that indicates that the associated component is not inherited. - + that indicates that the associated component is not inherited. + ]]> @@ -401,11 +401,11 @@ Specifies that the component is inherited. This field is read-only. - that indicates that the associated component is inherited. - + that indicates that the associated component is inherited. + ]]> @@ -449,11 +449,11 @@ Specifies that the component is inherited and is read-only. This field is read-only. - that indicates that the associated component is inherited and read-only. - + that indicates that the associated component is inherited and read-only. + ]]> @@ -542,11 +542,11 @@ Specifies that the component is not inherited. This field is read-only. - that indicates that the associated component is not inherited. - + that indicates that the associated component is not inherited. + ]]> diff --git a/xml/System.ComponentModel/InstanceCreationEditor.xml b/xml/System.ComponentModel/InstanceCreationEditor.xml index a6d46ba2682..5e679c83bbb 100644 --- a/xml/System.ComponentModel/InstanceCreationEditor.xml +++ b/xml/System.ComponentModel/InstanceCreationEditor.xml @@ -51,11 +51,11 @@ Creates an instance of a particular type of property from a drop-down box within the . - is displayed on the drop-down box from the as a link or button. When clicked, the method is called with the of the object to create. - + is displayed on the drop-down box from the as a link or button. When clicked, the method is called with the of the object to create. + ]]> diff --git a/xml/System.ComponentModel/Int16Converter.xml b/xml/System.ComponentModel/Int16Converter.xml index 8e3624967ca..5eca80b9cf1 100644 --- a/xml/System.ComponentModel/Int16Converter.xml +++ b/xml/System.ComponentModel/Int16Converter.xml @@ -48,29 +48,29 @@ Provides a type converter to convert 16-bit signed integer objects to and from other representations. - value type represents signed integers with values ranging from negative 32768 through positive 32767. - - The method uses the method of with the integer value of . - - The method uses the general ("G") format for the string returned. - - For more information about type converters, see the base class and [How to: Implement a Type Converter](https://learn.microsoft.com/previous-versions/visualstudio/visual-studio-2013/ayybcxe5(v=vs.120)). - + value type represents signed integers with values ranging from negative 32768 through positive 32767. + + The method uses the method of with the integer value of . + + The method uses the general ("G") format for the string returned. + + For more information about type converters, see the base class and [How to: Implement a Type Converter](https://learn.microsoft.com/previous-versions/visualstudio/visual-studio-2013/ayybcxe5(v=vs.120)). + > [!NOTE] -> You should never create an instance of an . Instead, call the method of . For more information, see the examples in the base class. - - - -## Examples - The following code example converts a variable of type to a string, and vice versa. - +> You should never create an instance of an . Instead, call the method of . For more information, see the examples in the base class. + + + +## Examples + The following code example converts a variable of type to a string, and vice versa. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Converters/CPP/converters.cpp" id="Snippet14"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/BooleanConverter/Overview/converters.cs" id="Snippet14"::: - :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/BooleanConverter/Overview/converters.vb" id="Snippet14"::: - + :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/BooleanConverter/Overview/converters.vb" id="Snippet14"::: + ]]> diff --git a/xml/System.ComponentModel/Int32Converter.xml b/xml/System.ComponentModel/Int32Converter.xml index bbdc325bd7a..64d43306039 100644 --- a/xml/System.ComponentModel/Int32Converter.xml +++ b/xml/System.ComponentModel/Int32Converter.xml @@ -48,29 +48,29 @@ Provides a type converter to convert 32-bit signed integer objects to and from other representations. - value type represents signed integers with values ranging from negative 2,147,483,648 through positive 2,147,483,647. - - The method uses the method of with the integer value of . - - The method uses the general ("G") format for the string returned. - - For more information about type converters, see the base class and [How to: Implement a Type Converter](https://learn.microsoft.com/previous-versions/visualstudio/visual-studio-2013/ayybcxe5(v=vs.120)). - + value type represents signed integers with values ranging from negative 2,147,483,648 through positive 2,147,483,647. + + The method uses the method of with the integer value of . + + The method uses the general ("G") format for the string returned. + + For more information about type converters, see the base class and [How to: Implement a Type Converter](https://learn.microsoft.com/previous-versions/visualstudio/visual-studio-2013/ayybcxe5(v=vs.120)). + > [!NOTE] -> You should never create an instance of an . Instead, call the method of . For more information, see the examples in the base class. - - - -## Examples - The following code example converts a variable of type to a string and vice versa. - +> You should never create an instance of an . Instead, call the method of . For more information, see the examples in the base class. + + + +## Examples + The following code example converts a variable of type to a string and vice versa. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Converters/CPP/converters.cpp" id="Snippet15"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/BooleanConverter/Overview/converters.cs" id="Snippet15"::: - :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/BooleanConverter/Overview/converters.vb" id="Snippet15"::: - + :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/BooleanConverter/Overview/converters.vb" id="Snippet15"::: + ]]> diff --git a/xml/System.ComponentModel/Int64Converter.xml b/xml/System.ComponentModel/Int64Converter.xml index bb86973c9f3..30e0eacfaaa 100644 --- a/xml/System.ComponentModel/Int64Converter.xml +++ b/xml/System.ComponentModel/Int64Converter.xml @@ -48,29 +48,29 @@ Provides a type converter to convert 64-bit signed integer objects to and from various other representations. - value type represents integers with values ranging from negative 9,223,372,036,854,775,808 through positive 9,223,372,036,854,775,807. - - The method uses the method of with the integer value of . - - The method uses the general ("G") format for the string returned. - - For more information about type converters, see the base class and [How to: Implement a Type Converter](https://learn.microsoft.com/previous-versions/visualstudio/visual-studio-2013/ayybcxe5(v=vs.120)). - + value type represents integers with values ranging from negative 9,223,372,036,854,775,808 through positive 9,223,372,036,854,775,807. + + The method uses the method of with the integer value of . + + The method uses the general ("G") format for the string returned. + + For more information about type converters, see the base class and [How to: Implement a Type Converter](https://learn.microsoft.com/previous-versions/visualstudio/visual-studio-2013/ayybcxe5(v=vs.120)). + > [!NOTE] -> You should never create an instance of an . Instead, call the method of . For more information, see the examples in the base class. - - - -## Examples - The following sample converts a variable of type to a string, and vice versa. - +> You should never create an instance of an . Instead, call the method of . For more information, see the examples in the base class. + + + +## Examples + The following sample converts a variable of type to a string, and vice versa. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Converters/CPP/converters.cpp" id="Snippet16"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/BooleanConverter/Overview/converters.cs" id="Snippet16"::: - :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/BooleanConverter/Overview/converters.vb" id="Snippet16"::: - + :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/BooleanConverter/Overview/converters.vb" id="Snippet16"::: + ]]> diff --git a/xml/System.ComponentModel/InvalidEnumArgumentException.xml b/xml/System.ComponentModel/InvalidEnumArgumentException.xml index 5a58c22ec90..3428b3ebd22 100644 --- a/xml/System.ComponentModel/InvalidEnumArgumentException.xml +++ b/xml/System.ComponentModel/InvalidEnumArgumentException.xml @@ -69,19 +69,19 @@ The exception that is thrown when an invalid enumeration value is used. - exception and interpret its content. The example attempts to pass an invalid enumeration value (`MessageBoxButtons`) through casting, as the method's third argument. Upon catching the exception, the example fetches the respective error message, the invalid parameter, stack trace, and origin of the exception. - + +## Examples + The following code example shows how to catch an exception and interpret its content. The example attempts to pass an invalid enumeration value (`MessageBoxButtons`) through casting, as the method's third argument. Upon catching the exception, the example fetches the respective error message, the invalid parameter, stack trace, and origin of the exception. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/enumException/CPP/enumexception.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/InvalidEnumArgumentException/Overview/enumexception.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/InvalidEnumArgumentException/Overview/enumexception.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/InvalidEnumArgumentException/Overview/enumexception.vb" id="Snippet1"::: + ]]> @@ -363,11 +363,11 @@ This exception is thrown if you pass an invalid enumeration value to a method or A that represents the enumeration class with the valid values. Initializes a new instance of the class with a message generated from the argument, the invalid value, and an enumeration class. - diff --git a/xml/System.ComponentModel/ItemPropertyInfo.xml b/xml/System.ComponentModel/ItemPropertyInfo.xml index 064b48758d0..69b193e4252 100644 --- a/xml/System.ComponentModel/ItemPropertyInfo.xml +++ b/xml/System.ComponentModel/ItemPropertyInfo.xml @@ -63,11 +63,11 @@ An object that contains additional information about the property. Initializes a new instance of the class. - or object. - + or object. + ]]> @@ -105,11 +105,11 @@ Gets an object that contains additional information about the property. An object that contains additional information about the property. - can be any object that contains information about the property, such as a or object. - + can be any object that contains information about the property, such as a or object. + ]]> diff --git a/xml/System.ComponentModel/LicFileLicenseProvider.xml b/xml/System.ComponentModel/LicFileLicenseProvider.xml index 3c77e4fad3f..ac28d8042d7 100644 --- a/xml/System.ComponentModel/LicFileLicenseProvider.xml +++ b/xml/System.ComponentModel/LicFileLicenseProvider.xml @@ -55,7 +55,7 @@ offers and methods. The method determines whether the retrieved by the method is valid. When you inherit from this class, you can override the method to provide your own validation logic. + The offers and methods. The method determines whether the retrieved by the method is valid. When you inherit from this class, you can override the method to provide your own validation logic. This class exists to provide similar licensing functionality to COM licensing and uses text license files. @@ -64,7 +64,7 @@ ## Examples - The following example creates a licensed control using the method. It uses for the license manager. + The following example creates a licensed control using the method. It uses for the license manager. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic LicenseManager Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/LicenseManager/Overview/source.cs" id="Snippet1"::: @@ -259,9 +259,9 @@ method looks for a license file named `myClassName.LIC`, where `myClassName` is the of the component to create. This file must be in the same directory as the .dll file that contains the component. + At design time, the method looks for a license file named `myClassName.LIC`, where `myClassName` is the of the component to create. This file must be in the same directory as the .dll file that contains the component. - Next, this method checks the first line of the license file against a key specified in the method. If the key is valid, this line is used as the . + Next, this method checks the first line of the license file against a key specified in the method. If the key is valid, this line is used as the . ]]> @@ -334,7 +334,7 @@ of the component you want to create. + This method checks the key against the phrase: " `myClassName is a licensed component.` ", where `myClassName` is the of the component you want to create. ]]> diff --git a/xml/System.ComponentModel/License.xml b/xml/System.ComponentModel/License.xml index 2454561c8c0..4ba3da0a871 100644 --- a/xml/System.ComponentModel/License.xml +++ b/xml/System.ComponentModel/License.xml @@ -53,7 +53,7 @@ for the licenses they grant when the component is disposed or finalized. + All components must call for the licenses they grant when the component is disposed or finalized. ]]> @@ -161,14 +161,14 @@ for the licenses that they grant when the component is disposed of or finalized. + All components must call for the licenses that they grant when the component is disposed of or finalized. A can use the licenses it grants to track its usage. - Call when you are finished using the . The method leaves the in an unusable state. After calling , you must release all references to the so the memory it was occupying can be reclaimed by garbage collection. + Call when you are finished using the . The method leaves the in an unusable state. After calling , you must release all references to the so the memory it was occupying can be reclaimed by garbage collection. > [!NOTE] -> Always call before you release your last reference to the . Otherwise, the resources the is using will not be freed until garbage collection calls the object's destructor. +> Always call before you release your last reference to the . Otherwise, the resources the is using will not be freed until garbage collection calls the object's destructor. ]]> @@ -231,7 +231,7 @@ can use any Unicode character string as a license key. The should be treated as an opaque cookie, that is, a cookie with a deliberately hidden internal structure. + A can use any Unicode character string as a license key. The should be treated as an opaque cookie, that is, a cookie with a deliberately hidden internal structure. ]]> diff --git a/xml/System.ComponentModel/LicenseException.xml b/xml/System.ComponentModel/LicenseException.xml index 04748960c73..5d99b69175a 100644 --- a/xml/System.ComponentModel/LicenseException.xml +++ b/xml/System.ComponentModel/LicenseException.xml @@ -57,24 +57,24 @@ Represents the exception thrown when a component cannot be granted a license. - method throws when a component cannot obtain a valid license. This occurs when a component is either not licensed, or is licensed but cannot be granted a valid license. - - For more information on licensing, see [How to: License Components and Controls](https://learn.microsoft.com/previous-versions/visualstudio/visual-studio-2013/fe8b1eh9(v=vs.120)). - - - -## Examples - The following code example shows how to catch a and interpret its content. In the sample, the application calls the method for a that is not licensed. Upon catching the exception, the sample fetches the respective error message, the type of component that was not granted a license, the stack trace, and the origin of the exception. - - This example requires that you have specified the by marking the with a attribute. For more information on how to do this, see the class. - + method throws when a component cannot obtain a valid license. This occurs when a component is either not licensed, or is licensed but cannot be granted a valid license. + + For more information on licensing, see [How to: License Components and Controls](https://learn.microsoft.com/previous-versions/visualstudio/visual-studio-2013/fe8b1eh9(v=vs.120)). + + + +## Examples + The following code example shows how to catch a and interpret its content. In the sample, the application calls the method for a that is not licensed. Upon catching the exception, the sample fetches the respective error message, the type of component that was not granted a license, the stack trace, and the origin of the exception. + + This example requires that you have specified the by marking the with a attribute. For more information on how to do this, see the class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/LicenseException/CPP/licenseex.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/LicenseException/Overview/licenseex.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/LicenseException/Overview/licenseex.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/LicenseException/Overview/licenseex.vb" id="Snippet1"::: + ]]> diff --git a/xml/System.ComponentModel/LicenseManager.xml b/xml/System.ComponentModel/LicenseManager.xml index 3d217f23fc4..d915104bb3a 100644 --- a/xml/System.ComponentModel/LicenseManager.xml +++ b/xml/System.ComponentModel/LicenseManager.xml @@ -55,22 +55,22 @@ class provides the following `static` properties: and . The class also provides the following `static` methods: , , and . + The class provides the following `static` properties: and . The class also provides the following `static` methods: , , and . When you create a component that you want to license, you must do the following: 1. Specify the by marking the component with a . -2. Call or in the constructor of the component. throws a when it tries to create an instance without a valid license. does not throw an exception. +2. Call or in the constructor of the component. throws a when it tries to create an instance without a valid license. does not throw an exception. -3. Call on any license that is granted when the component is disposed or finalized. +3. Call on any license that is granted when the component is disposed or finalized. For more information on licensing, see [How to: License Components and Controls](https://learn.microsoft.com/previous-versions/visualstudio/visual-studio-2013/fe8b1eh9(v=vs.120)). ## Examples - The following code example creates a licensed control using the method. It uses a that is implemented by the class. + The following code example creates a licensed control using the method. It uses a that is implemented by the class. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic LicenseManager Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/LicenseManager/Overview/source.cs" id="Snippet1"::: @@ -166,7 +166,7 @@ you specify as the `creationContext` parameter is used as the for the life of this . The method blocks all other threads in the from modifying the , allowing to behave as an atomic operation. + The you specify as the `creationContext` parameter is used as the for the life of this . The method blocks all other threads in the from modifying the , allowing to behave as an atomic operation. ]]> @@ -250,7 +250,7 @@ you specify as the `creationContext` parameter is used as the for the life of this . This method blocks all other threads in the from modifying the , allowing to behave as an atomic operation. + The you specify as the `creationContext` parameter is used as the for the life of this . This method blocks all other threads in the from modifying the , allowing to behave as an atomic operation. ]]> @@ -306,7 +306,7 @@ , the user must give the context in which the is valid to the method. The returned by this property should be passed to all classes. + When the user requests a valid , the user must give the context in which the is valid to the method. The returned by this property should be passed to all classes. ]]> @@ -425,9 +425,9 @@ method returns `true` when the type is either not licensed, or is licensed and the license is valid. + The method returns `true` when the type is either not licensed, or is licensed and the license is valid. - This method does not throw a when it cannot grant a valid . The method throws exceptions. + This method does not throw a when it cannot grant a valid . The method throws exceptions. ]]> @@ -506,11 +506,11 @@ method returns `true` when the `type` parameter is not licensed, or when it is licensed and the `license` parameter is valid. + The method returns `true` when the `type` parameter is not licensed, or when it is licensed and the `license` parameter is valid. - This method does not throw a when it cannot grant a valid . The method throws exceptions. + This method does not throw a when it cannot grant a valid . The method throws exceptions. - If the `license` parameter is not `null` after this call, the object asking for a must dispose of the license by calling the method when the object is disposed of or finalized. + If the `license` parameter is not `null` after this call, the object asking for a must dispose of the license by calling the method when the object is disposed of or finalized. ]]> @@ -673,7 +673,7 @@ value, it returns . + If this property cannot find a value, it returns . ]]> @@ -743,7 +743,7 @@ when a valid cannot be granted. The method does not throw an exception. + This method throws a when a valid cannot be granted. The method does not throw an exception. ]]> @@ -814,9 +814,9 @@ when a valid cannot be granted. The method does not throw an exception. + This method throws a when a valid cannot be granted. The method does not throw an exception. - All objects asking for a must dispose of the license by calling the method when the object is disposed of or finalized. + All objects asking for a must dispose of the license by calling the method when the object is disposed of or finalized. ]]> diff --git a/xml/System.ComponentModel/LicenseProvider.xml b/xml/System.ComponentModel/LicenseProvider.xml index 8af94e3f966..f09ece34fe3 100644 --- a/xml/System.ComponentModel/LicenseProvider.xml +++ b/xml/System.ComponentModel/LicenseProvider.xml @@ -49,7 +49,7 @@ method. It uses a that is implemented by the class. + The following code example creates a licensed control using the method. It uses a that is implemented by the class. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic LicenseManager Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/LicenseManager/Overview/source.cs" id="Snippet1"::: diff --git a/xml/System.ComponentModel/LicenseUsageMode.xml b/xml/System.ComponentModel/LicenseUsageMode.xml index b9832316b0d..a4a5b6ab720 100644 --- a/xml/System.ComponentModel/LicenseUsageMode.xml +++ b/xml/System.ComponentModel/LicenseUsageMode.xml @@ -45,13 +45,13 @@ Specifies when the can be used. - and the classes use this enumeration. It is used to set a component's . See the class for details. - - For more information on licensing, see [How to: License Components and Controls](https://learn.microsoft.com/previous-versions/visualstudio/visual-studio-2013/fe8b1eh9(v=vs.120)). - + and the classes use this enumeration. It is used to set a component's . See the class for details. + + For more information on licensing, see [How to: License Components and Controls](https://learn.microsoft.com/previous-versions/visualstudio/visual-studio-2013/fe8b1eh9(v=vs.120)). + ]]> diff --git a/xml/System.ComponentModel/ListChangedEventArgs.xml b/xml/System.ComponentModel/ListChangedEventArgs.xml index 601d3c58b94..83cbcf46009 100644 --- a/xml/System.ComponentModel/ListChangedEventArgs.xml +++ b/xml/System.ComponentModel/ListChangedEventArgs.xml @@ -64,7 +64,7 @@ ## Examples - The following code example demonstrates the use of this type. In the example, an event handler reports on the occurrence of the event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing with or appending the message to a multiline . + The following code example demonstrates the use of this type. In the example, an event handler reports on the occurrence of the event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing with or appending the message to a multiline . To run the example code, paste it into a project that contains an instance of type named `BindingSource1`. Then ensure that the event handler is associated with the event. @@ -363,7 +363,7 @@ event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing with or appending the message to a multiline . + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing with or appending the message to a multiline . To run the example code, paste it into a project that contains an instance of type named `BindingSource1`. Then ensure that the event handler is associated with the event. @@ -430,7 +430,7 @@ ## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing with or appending the message to a multiline . + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing with or appending the message to a multiline . To run the example code, paste it into a project that contains an instance of type named `BindingSource1`. Then ensure that the event handler is associated with the event. @@ -492,7 +492,7 @@ event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing with or appending the message to a multiline . + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing with or appending the message to a multiline . To run the example code, paste it into a project that contains an instance of type named `BindingSource1`. Then ensure that the event handler is associated with the event. @@ -554,7 +554,7 @@ event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing with or appending the message to a multiline . + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing with or appending the message to a multiline . To run the example code, paste it into a project that contains an instance of type named `BindingSource1`. Then ensure that the event handler is associated with the event. diff --git a/xml/System.ComponentModel/ListSortDescriptionCollection.xml b/xml/System.ComponentModel/ListSortDescriptionCollection.xml index f2d04aa4056..f4bbfe50f77 100644 --- a/xml/System.ComponentModel/ListSortDescriptionCollection.xml +++ b/xml/System.ComponentModel/ListSortDescriptionCollection.xml @@ -529,7 +529,7 @@ ## Remarks This implementation returns the current instance of the , because this collection, once constructed, does not allow public access to the underlying list. - For more information on the method, see the property. + For more information on the method, see the property. ]]> @@ -639,7 +639,7 @@ This member is an explicit interface member implementation. It can be used only class implements the interface, it must have an method. However, because the class represents a read-only collection, adding items to the collection is an invalid operation. + Because the class implements the interface, it must have an method. However, because the class represents a read-only collection, adding items to the collection is an invalid operation. ]]> @@ -691,7 +691,7 @@ This member is an explicit interface member implementation. It can be used only class implements the interface, it must have a method. However, because the class represents a read-only collection, clearing items from the collection is an invalid operation. + Because the class implements the interface, it must have a method. However, because the class represents a read-only collection, clearing items from the collection is an invalid operation. ]]> @@ -749,7 +749,7 @@ This member is an explicit interface member implementation. It can be used only class implements the interface, it must have a method. However, because the class represents a read-only collection, inserting items into the collection is an invalid operation. + Because the class implements the interface, it must have a method. However, because the class represents a read-only collection, inserting items into the collection is an invalid operation. ]]> @@ -964,7 +964,7 @@ This member is an explicit interface member implementation. It can be used only class implements the interface, it must have a method. However, because the class represents a read-only collection, removing items from the collection is an invalid operation. + Because the class implements the interface, it must have a method. However, because the class represents a read-only collection, removing items from the collection is an invalid operation. ]]> @@ -1019,7 +1019,7 @@ This member is an explicit interface member implementation. It can be used only class implements the interface, it must have a method. However, because the class represents a read-only collection, removing items from the collection is an invalid operation. + Because the class implements the interface, it must have a method. However, because the class represents a read-only collection, removing items from the collection is an invalid operation. ]]> diff --git a/xml/System.ComponentModel/ListSortDirection.xml b/xml/System.ComponentModel/ListSortDirection.xml index 6b36a86ad21..20813b79d35 100644 --- a/xml/System.ComponentModel/ListSortDirection.xml +++ b/xml/System.ComponentModel/ListSortDirection.xml @@ -45,11 +45,11 @@ Specifies the direction of a sort operation. - and use this enumeration. - + and use this enumeration. + ]]> diff --git a/xml/System.ComponentModel/LookupBindingPropertiesAttribute.xml b/xml/System.ComponentModel/LookupBindingPropertiesAttribute.xml index 9f23a4fe7d7..7624134e3ed 100644 --- a/xml/System.ComponentModel/LookupBindingPropertiesAttribute.xml +++ b/xml/System.ComponentModel/LookupBindingPropertiesAttribute.xml @@ -143,7 +143,7 @@ , , , and properties to `null`. + The parameterless constructor sets the , , , and properties to `null`. ]]> @@ -437,7 +437,7 @@ method returns `true` if the `obj` parameter is of type and all the public properties - , , , and - are equal to each other. + The method returns `true` if the `obj` parameter is of type and all the public properties - , , , and - are equal to each other. ]]> diff --git a/xml/System.ComponentModel/MarshalByValueComponent.xml b/xml/System.ComponentModel/MarshalByValueComponent.xml index c30709917fb..682fff740e1 100644 --- a/xml/System.ComponentModel/MarshalByValueComponent.xml +++ b/xml/System.ComponentModel/MarshalByValueComponent.xml @@ -330,10 +330,10 @@ when you are finished using the . The method leaves the in an unusable state. After calling , you must release all references to the so the garbage collector can reclaim the memory that the was occupying. For more information, see [Cleaning Up Unmanaged Resources](/dotnet/standard/garbage-collection/unmanaged) and [Implementing a Dispose Method](/dotnet/standard/garbage-collection/implementing-dispose). + Call when you are finished using the . The method leaves the in an unusable state. After calling , you must release all references to the so the garbage collector can reclaim the memory that the was occupying. For more information, see [Cleaning Up Unmanaged Resources](/dotnet/standard/garbage-collection/unmanaged) and [Implementing a Dispose Method](/dotnet/standard/garbage-collection/implementing-dispose). > [!NOTE] -> Always call before you release your last reference to the . Otherwise, the resources it is using will not be freed until the garbage collector calls the object's `Finalize` method. +> Always call before you release your last reference to the . Otherwise, the resources it is using will not be freed until the garbage collector calls the object's `Finalize` method. ]]> diff --git a/xml/System.ComponentModel/MaskedTextProvider.xml b/xml/System.ComponentModel/MaskedTextProvider.xml index 84d05b6a0d3..0c707a868ab 100644 --- a/xml/System.ComponentModel/MaskedTextProvider.xml +++ b/xml/System.ComponentModel/MaskedTextProvider.xml @@ -64,7 +64,7 @@ ## Remarks The control contains a mask, composed of literal characters and formatting elements, that it tests all user input against. Instead of permanently associating a specific mask-parsing engine with , Windows Forms provides it as a separate service, represented by the class, which defines the syntax of the masking language discussed in the documentation for the property. - Many of the members of the class refer their implementation to similarly named members of the associated . For example, the property of the class refers all access to the of the class. + Many of the members of the class refer their implementation to similarly named members of the associated . For example, the property of the class refers all access to the of the class. The mask-parsing engine used by is modeled after the Masked Edit control included in Microsoft Visual Basic version 6. Its masking language is described in the documentation for the property. @@ -72,9 +72,9 @@ |String name|Description| |-----------------|-----------------| -|Input character or string|Represents the characters used as input that the mask is applied against. In actuality, the input string may be composed of multiple input operations, including , , , and . Therefore, the input string cannot be accessed directly. However, aspects of the input string handling are available though the and , , and properties.| -|Mask|Represents the input formatting mask used to transform the input string into the formatted string. This string is set in the and accessed primarily though the property. Characteristics of the mask are also available through other members, such as the , , and properties.| -|Formatted string|Represents the string that results when the full mask is applied to the input string. The formatted string can be queried with many members of the class, including , , , , , , and so on. The full value of the formatted string is available from the and methods.| +|Input character or string|Represents the characters used as input that the mask is applied against. In actuality, the input string may be composed of multiple input operations, including , , , and . Therefore, the input string cannot be accessed directly. However, aspects of the input string handling are available though the and , , and properties.| +|Mask|Represents the input formatting mask used to transform the input string into the formatted string. This string is set in the and accessed primarily though the property. Characteristics of the mask are also available through other members, such as the , , and properties.| +|Formatted string|Represents the string that results when the full mask is applied to the input string. The formatted string can be queried with many members of the class, including , , , , , , and so on. The full value of the formatted string is available from the and methods.| > [!NOTE] > The input string may represent direct user input, as in the case of the , or may be generated by other processes not directly associated with user input/output operations. @@ -144,7 +144,7 @@ constructor: + Use of this constructor is exactly equivalent to the following call to the constructor: `MaskedTextProvider(mask , null, true, '_', '\0', false)` @@ -204,7 +204,7 @@ constructor: + Use of this constructor is exactly equivalent to the following call to the constructor: `MaskedTextProvider(mask , null, true, '_', '\0', restrictToASCII)` @@ -272,7 +272,7 @@ constructor: + Use of this constructor is exactly equivalent to the following call to the constructor: `MaskedTextProvider(mask , culture, true, '_', '\0', false)` @@ -335,7 +335,7 @@ constructor: + Use of this constructor is exactly equivalent to the following call to the constructor: `MaskedTextProvider(mask , null, allowPromptAsInput, '_', passwordChar, false)` @@ -407,7 +407,7 @@ constructor: + Use of this constructor is exactly equivalent to the following call to the constructor: `MaskedTextProvider(mask , culture, true, '_', '\0', restrictToAscii)` @@ -481,7 +481,7 @@ constructor: + Use of this constructor is exactly equivalent to the following call to the constructor: `MaskedTextProvider(mask , culture, allowPromptAsInput, '_', passwordChar, false)` @@ -556,7 +556,7 @@ ## Remarks This constructor represents the most general overloaded form. The `mask` parameter must conform to the masking language defined by the class, which is detailed in the property of the class. - Because neutral cultures cannot be queried for culture-specific information, the constructor will use the method to search for the first non-neutral culture to use to determine the proper separator characters. + Because neutral cultures cannot be queried for culture-specific information, the constructor will use the method to search for the first non-neutral culture to use to determine the proper separator characters. ]]> @@ -632,7 +632,7 @@ method adds the `input` character value to the first available position in the formatted string after the position that was last assigned, which is represented by the property. This method will fail for any of the following reasons: + The method adds the `input` character value to the first available position in the formatted string after the position that was last assigned, which is represented by the property. This method will fail for any of the following reasons: - The input value, `input`, is not printable, or it does not match its corresponding mask element. @@ -698,7 +698,7 @@ method adds the characters from the `input` string to the formatted string, starting with the first available position after . This method will fail for any of the following reasons: + The method adds the characters from the `input` string to the formatted string, starting with the first available position after . This method will fail for any of the following reasons: - Any of the characters in the input value, `input`, are not printable, or the input value does not match its corresponding mask element. @@ -771,13 +771,13 @@ method attempts to add the `input` character value to the first available position in the formatted string after the position that was last assigned, which is represented by the property. This method will fail if all available positions are before the last assigned position. This method will fail for any of the following reasons: + The method attempts to add the `input` character value to the first available position in the formatted string after the position that was last assigned, which is represented by the property. This method will fail if all available positions are before the last assigned position. This method will fail for any of the following reasons: - The input value, `input`, is not printable, or it does not match its corresponding mask element. - There are zero available edit positions in the formatted string, or there are no available edit positions after the last assigned position. - This method functions the same as the overridden version taking a single parameter, , except that it outputs additional information. + This method functions the same as the overridden version taking a single parameter, , except that it outputs additional information. ]]> @@ -843,7 +843,7 @@ method adds the characters from the `input` string to the formatted string, starting with the first available position after . This method will fail for any of the following reasons: + The method adds the characters from the `input` string to the formatted string, starting with the first available position after . This method will fail for any of the following reasons: - Any of the characters in the input value, `input`, are not printable, or the input value does not match its corresponding mask element. @@ -851,7 +851,7 @@ If this method fails, no additions are made and the method returns `false`. - This method functions the same as the overridden version taking a single parameter, , except that it outputs additional information. + This method functions the same as the overridden version taking a single parameter, , except that it outputs additional information. ]]> @@ -909,9 +909,9 @@ property's value is set in the constructor. + The property's value is set in the constructor. - Even when is `true`, the prompt character must be valid for the current location in the mask in order to be accepted. + Even when is `true`, the prompt character must be valid for the current location in the mask in order to be accepted. ]]> @@ -963,9 +963,9 @@ property's value is set in the constructor. + The property's value is set in the constructor. - If `true`, restricts user input to the ASCII character set. + If `true`, restricts user input to the ASCII character set. ]]> @@ -1021,7 +1021,7 @@ property, should equal the sum of the and the properties. + The total number of editable character positions, represented by the property, should equal the sum of the and the properties. ]]> @@ -1076,7 +1076,7 @@ property, should equal the sum of the and the properties. + The total number of editable character positions, represented by the property, should equal the sum of the and the properties. ]]> @@ -1197,7 +1197,7 @@ method reinitializes the formatted string, inserting the prompt character into all editable positions. It functions equivalently to the overridden version that takes no parameters, , except it outputs additional information. + The method reinitializes the formatted string, inserting the prompt character into all editable positions. It functions equivalently to the overridden version that takes no parameters, , except it outputs additional information. ]]> @@ -1261,7 +1261,7 @@ method returns a new copy of the current . + The method returns a new copy of the current . ]]> @@ -1318,7 +1318,7 @@ property is set in the constructor. + The property is set in the constructor. ]]> @@ -1419,7 +1419,7 @@ property, must equal the sum of the and the properties. This value includes both the required and the optional editable characters. + The total number of editable character positions, represented by the property, must equal the sum of the and the properties. This value includes both the required and the optional editable characters. ]]> @@ -1540,9 +1540,9 @@ ## Remarks The formatted string is composed of editable characters and literals copied from the mask. The editable character positions will either be occupied by the prompt character copied from the mask if they are unassigned, or with a valid input character if they have been assigned an input. - The method is used to search for the first assigned character after a specified position and search direction. The result can subsequently be passed as a parameter to the indexer to obtain the assigned value at this position. + The method is used to search for the first assigned character after a specified position and search direction. The result can subsequently be passed as a parameter to the indexer to obtain the assigned value at this position. - The and methods are complements of this method. + The and methods are complements of this method. ]]> @@ -1608,9 +1608,9 @@ ## Remarks The formatted string is composed of editable characters and literals copied from the mask. The editable character positions will either be occupied by the prompt character copied from the mask if they are unassigned, or with a valid input character if they have been assigned an input. - The method is used to search for the first assigned character between two specified positions, inclusive, using the specified search direction. The result can subsequently be passed as a parameter to the indexer to obtain the assigned value at this position. + The method is used to search for the first assigned character between two specified positions, inclusive, using the specified search direction. The result can subsequently be passed as a parameter to the indexer to obtain the assigned value at this position. - The and methods are complements of this method. + The and methods are complements of this method. ]]> @@ -1672,9 +1672,9 @@ method is used to search for the next assigned or unassigned editable position in the formatted string after the specified position. + The method is used to search for the next assigned or unassigned editable position in the formatted string after the specified position. - The method is the complement of this method. + The method is the complement of this method. ]]> @@ -1738,9 +1738,9 @@ method is used to search for the first editable character between two specified positions, inclusive, using the specified search direction. The result can subsequently be passed as a parameter to the indexer to obtain the assigned value at this position. + The method is used to search for the first editable character between two specified positions, inclusive, using the specified search direction. The result can subsequently be passed as a parameter to the indexer to obtain the assigned value at this position. - The method is the complement of this method. + The method is the complement of this method. ]]> @@ -1802,9 +1802,9 @@ method is used to search for the next literal character in the formatted string after the specified position. The result can subsequently be passed as a parameter to the indexer to obtain the literal value at this position. + The method is used to search for the next literal character in the formatted string after the specified position. The result can subsequently be passed as a parameter to the indexer to obtain the literal value at this position. - The method is the complement of this method. + The method is the complement of this method. ]]> @@ -1868,9 +1868,9 @@ method is used to search for the first literal character between two specified positions, inclusive, using the specified search direction. The result can subsequently be passed as a parameter to the indexer to obtain the literal value at this position. + The method is used to search for the first literal character between two specified positions, inclusive, using the specified search direction. The result can subsequently be passed as a parameter to the indexer to obtain the literal value at this position. - The method is the complement of this method. + The method is the complement of this method. ]]> @@ -1934,9 +1934,9 @@ ## Remarks The formatted string is composed of editable characters and literals copied from the mask. The editable character positions will either be occupied by the prompt character copied from the mask if they are unassigned, or with a valid input character if they have been assigned an input. - The method is used to search for the first unassigned character after a specified position and search direction. The prompt character should occupy this position. + The method is used to search for the first unassigned character after a specified position and search direction. The prompt character should occupy this position. - The and methods are complements of this method. + The and methods are complements of this method. ]]> @@ -2002,9 +2002,9 @@ ## Remarks The formatted string is composed of editable characters and literals copied from the mask. The editable character positions will either be occupied by the prompt character copied from the mask if they are unassigned, or with a valid input character if they have been assigned an input. - The method is used to search for the first unassigned character between two specified positions, inclusive, using the specified search direction. The prompt character should occupy this position. + The method is used to search for the first unassigned character between two specified positions, inclusive, using the specified search direction. The prompt character should occupy this position. - The and methods are complements of this method. + The and methods are complements of this method. ]]> @@ -2065,7 +2065,7 @@ class contain a parameter of type that is used to output information about the operation of the method: , , , , , , , , and . The method interprets this value and returns a Boolean value that indicates whether the has signaled that the operation was a success or failure. + The following methods of the class contain a parameter of type that is used to output information about the operation of the method: , , , , , , , , and . The method interprets this value and returns a Boolean value that indicates whether the has signaled that the operation was a success or failure. ]]> @@ -2115,7 +2115,7 @@ and properties will determine whether prompt and literal characters appear when calling the method. By setting both of these properties to `false`, the parsed string will represent only the characters entered by the user. + The and properties will determine whether prompt and literal characters appear when calling the method. By setting both of these properties to `false`, the parsed string will represent only the characters entered by the user. ]]> @@ -2169,7 +2169,7 @@ and properties will determine whether prompt and literal characters appear when calling the method. By setting both of these properties to `false`, the parsed string will represent only the characters entered by the user. + The and properties will determine whether prompt and literal characters appear when calling the method. By setting both of these properties to `false`, the parsed string will represent only the characters entered by the user. ]]> @@ -2236,9 +2236,9 @@ method inserts a character into the first edit position at or beyond that specified by the `pos` parameter. This method will shift all existing characters after the insertion point over by one position to make room for the inserted `input` character. If one of the following errors occurs, the insertion is not performed, and the method returns `false`. + The method inserts a character into the first edit position at or beyond that specified by the `pos` parameter. This method will shift all existing characters after the insertion point over by one position to make room for the inserted `input` character. If one of the following errors occurs, the insertion is not performed, and the method returns `false`. -- The `pos` parameter is less than zero or greater than the of the formatted string. +- The `pos` parameter is less than zero or greater than the of the formatted string. - An editable character was not found in the formatted string at or beyond the specified position, `pos`. @@ -2311,9 +2311,9 @@ method inserts each character from the `input` string into the edit positions located at position `pos` and beyond. This method will shift all existing characters after the insertion point over by one position for each inserted character. If one of the following errors occurs, no insertion is performed, and the method returns `false`. + The method inserts each character from the `input` string into the edit positions located at position `pos` and beyond. This method will shift all existing characters after the insertion point over by one position for each inserted character. If one of the following errors occurs, no insertion is performed, and the method returns `false`. -- The `pos` parameter is less than zero or greater than the of the formatted string. +- The `pos` parameter is less than zero or greater than the of the formatted string. - Not enough editable characters exist in the formatted string at or beyond the specified position, `pos`, to insert all of the characters from the `input` string. @@ -2391,9 +2391,9 @@ method inserts a character into the first edit position at or beyond that specified by the `pos` parameter. This method will shift all existing characters after the insertion point over by one position to make room for the inserted `input` character. If one of the following errors occurs, the insertion is not performed, and the method returns `false`. + The method inserts a character into the first edit position at or beyond that specified by the `pos` parameter. This method will shift all existing characters after the insertion point over by one position to make room for the inserted `input` character. If one of the following errors occurs, the insertion is not performed, and the method returns `false`. -- The `pos` parameter is less than zero or greater than the of the formatted string. +- The `pos` parameter is less than zero or greater than the of the formatted string. - An editable character was not found in the formatted string at or beyond the specified position, `pos`. @@ -2470,9 +2470,9 @@ method inserts each character from the `input` string into the edit positions located at position `pos` and beyond. This method will shift all existing characters after the insertion point over by one position for each inserted character. If one of the following errors occurs, no insertion is performed, and the method returns `false`. + The method inserts each character from the `input` string into the edit positions located at position `pos` and beyond. This method will shift all existing characters after the insertion point over by one position for each inserted character. If one of the following errors occurs, no insertion is performed, and the method returns `false`. -- The `pos` parameter is less than zero or greater than the of the formatted string. +- The `pos` parameter is less than zero or greater than the of the formatted string. - Not enough editable characters exist in the formatted string at or beyond the specified position, `pos`, to insert all of the characters from the `input` string. @@ -2539,7 +2539,7 @@ property is used to represent a result that is not valid for indexing operations, such as the method. + The property is used to represent a result that is not valid for indexing operations, such as the method. When you use the provider or implement your own, you should use this property to decide if an index is invalid, rather than hard-coding knowledge of invalid values. @@ -2599,9 +2599,9 @@ method returns `true` only if all of the following conditions are true: + The method returns `true` only if all of the following conditions are true: -- The `pos` parameter is within the bounds of the formatted string; that is, its value is greater than or equal to zero and less than the of the formatted string. +- The `pos` parameter is within the bounds of the formatted string; that is, its value is greater than or equal to zero and less than the of the formatted string. - The specified position is an editable character. @@ -2662,9 +2662,9 @@ method returns `true` only if both of the following conditions are true: + The method returns `true` only if both of the following conditions are true: -- The `pos` parameter is within the bounds of the formatted string; that is, its value is greater than or equal to zero and less than the of the formatted string. +- The `pos` parameter is within the bounds of the formatted string; that is, its value is greater than or equal to zero and less than the of the formatted string. - The specified position is an editable character. @@ -2724,9 +2724,9 @@ - Setting the property to a non-`null` value. -- Setting the property to `true`, which also sets the property to the value. +- Setting the property to `true`, which also sets the property to the value. - is used by the and methods to determine whether to reveal the actual input characters or obscure them with . + is used by the and methods to determine whether to reveal the actual input characters or obscure them with . ]]> @@ -3072,9 +3072,9 @@ property represents the total number of characters in the mask, including both the literal and editable characters. The number of literal characters can be determined by subtracting the value of the from the . + The property represents the total number of characters in the mask, including both the literal and editable characters. The number of literal characters can be determined by subtracting the value of the from the . - also describes the length of the formatted string, including input characters, literals, and prompt characters. + also describes the length of the formatted string, including input characters, literals, and prompt characters. ]]> @@ -3131,7 +3131,7 @@ property is set in the constructor. This mask must contain only valid characters as defined by the masking language. + The property is set in the constructor. This mask must contain only valid characters as defined by the masking language. ]]> @@ -3302,7 +3302,7 @@ property is set to a non-`null` character, output methods such as and will obscure the input characters with the specified password character. Setting this property to `null` will disable password protection functionality. + For sensitive user input, it is common practice to conceal the actual information entered by the user during output operations. If the property is set to a non-`null` character, output methods such as and will obscure the input characters with the specified password character. Setting this property to `null` will disable password protection functionality. ]]> @@ -3364,7 +3364,7 @@ property represents the prompt character that is used by the and methods to represent the current state of the formatted input string. A prompt character is placed in editable positions that have not yet been assigned an input value. Some versions of the method also depend on the value of the property. + The property represents the prompt character that is used by the and methods to represent the current state of the formatted input string. A prompt character is placed in editable positions that have not yet been assigned an input value. Some versions of the method also depend on the value of the property. ]]> @@ -3433,7 +3433,7 @@ method has no effect if there are no characters assigned to the mask yet. + The method has no effect if there are no characters assigned to the mask yet. When the last assigned character is removed from the formatted string, the editable mask character is reset for that position, allowing subsequent input. @@ -3497,7 +3497,7 @@ method has no effect if there are no characters assigned to the mask yet. + The method has no effect if there are no characters assigned to the mask yet. When the last assigned character is removed from the formatted string, the editable mask character is reset for that position, allowing subsequent input. @@ -3575,11 +3575,11 @@ method has no effect if there are no assigned characters at the removal position specified. Literal characters are not affected by this method. + The method has no effect if there are no assigned characters at the removal position specified. Literal characters are not affected by this method. - When a character is removed, the remaining higher-positioned characters in the mask will shift to the left to fill in the gap created by the removal. Vacated positions are reset for input. If movement of the characters is prevented by the mask definition, no removal occurs, and returns `false`. + When a character is removed, the remaining higher-positioned characters in the mask will shift to the left to fill in the gap created by the removal. Vacated positions are reset for input. If movement of the characters is prevented by the mask definition, no removal occurs, and returns `false`. - This method call is exactly equivalent to the following call to the overloaded version: + This method call is exactly equivalent to the following call to the overloaded version: `RemoveAt(pos, pos);` @@ -3642,9 +3642,9 @@ method has no effect if there are no assigned characters at the removal positions specified. + The method has no effect if there are no assigned characters at the removal positions specified. - When a character is removed, the remaining higher-positioned characters in the mask will shift to the left to fill in the gap created by the removal. Vacated positions are reset for input. If movement of the characters is prevented by the mask definition, no removal occurs, and returns `false`. + When a character is removed, the remaining higher-positioned characters in the mask will shift to the left to fill in the gap created by the removal. Vacated positions are reset for input. If movement of the characters is prevented by the mask definition, no removal occurs, and returns `false`. ]]> @@ -3709,11 +3709,11 @@ method has no effect if there are no assigned characters at the removal positions specified. + The method has no effect if there are no assigned characters at the removal positions specified. - When a character is removed, the remaining higher-positioned characters in the mask will shift to the left to fill in the gap created by the removal. Vacated positions are reset for input. If movement of the characters is prevented by the mask definition, no removal occurs, and returns `false`. + When a character is removed, the remaining higher-positioned characters in the mask will shift to the left to fill in the gap created by the removal. Vacated positions are reset for input. If movement of the characters is prevented by the mask definition, no removal occurs, and returns `false`. - This version of provides two additional output parameters to convey more information about the operation of the method. + This version of provides two additional output parameters to convey more information about the operation of the method. ]]> @@ -3784,9 +3784,9 @@ method searches for the first editable position in the formatted string at or beyond the specified position, `pos`. If one is found, the value of the editable position is changed to the specified character, `input`. Any of the following conditions will result in an error that causes no replacement to be performed and a value of `false` to be returned: + The method searches for the first editable position in the formatted string at or beyond the specified position, `pos`. If one is found, the value of the editable position is changed to the specified character, `input`. Any of the following conditions will result in an error that causes no replacement to be performed and a value of `false` to be returned: -- The `pos` parameter is less than zero or greater than the of the formatted string. +- The `pos` parameter is less than zero or greater than the of the formatted string. - An editable character was not found in the formatted string at or beyond the specified position, `pos`. @@ -3853,11 +3853,11 @@ method searches for the first editable position at or beyond the specified position, `pos`. Operating under the assumption that there are enough editable positions after this point, the existing character values are replaced one-by-one with the contents of the replacement string parameter, `input`. + The method searches for the first editable position at or beyond the specified position, `pos`. Operating under the assumption that there are enough editable positions after this point, the existing character values are replaced one-by-one with the contents of the replacement string parameter, `input`. - The following conditions are considered errors. When an error occurs, no replacement occurs and returns `false`. + The following conditions are considered errors. When an error occurs, no replacement occurs and returns `false`. -- The `pos` parameter is less than zero or greater than the of the formatted string. +- The `pos` parameter is less than zero or greater than the of the formatted string. - There are not enough editable positions in the formatted string to hold the contents of the replacement string. @@ -3928,9 +3928,9 @@ method searches for the first editable position in the formatted string at or beyond the specified position, `pos`. If one is found, the value of the editable position is changed to the specified character, `input`. Any of the following conditions will result in an error condition that causes no replacement to be performed and a value of `false` to be returned: + The method searches for the first editable position in the formatted string at or beyond the specified position, `pos`. If one is found, the value of the editable position is changed to the specified character, `input`. Any of the following conditions will result in an error condition that causes no replacement to be performed and a value of `false` to be returned: -- The `pos` parameter is less than zero or greater than the of the formatted string. +- The `pos` parameter is less than zero or greater than the of the formatted string. - An editable character was not found in the formatted string at or beyond the specified position, `pos`. @@ -4002,11 +4002,11 @@ method searches for the first editable position at or beyond the specified position, `pos`. Operating on the assumption that there are enough editable positions after this point, the existing character values are replaced one-by-one with the contents of the replacement string parameter, `input`. + The method searches for the first editable position at or beyond the specified position, `pos`. Operating on the assumption that there are enough editable positions after this point, the existing character values are replaced one-by-one with the contents of the replacement string parameter, `input`. - The following conditions are considered errors. When an error occurs, no replacement occurs and returns `false`. + The following conditions are considered errors. When an error occurs, no replacement occurs and returns `false`. -- The `pos` parameter is less than zero or greater than the of the formatted string. +- The `pos` parameter is less than zero or greater than the of the formatted string. - There are not enough editable positions in the formatted string to hold the contents of the replacement string. @@ -4080,7 +4080,7 @@ method searches for the first editable position in the formatted string between the specified starting and ending positions. If one is found, the value of the editable position is changed to the specified character, `input`. Any of the following conditions will result in an error condition that causes no replacement to be performed and a value of `false` to be returned: + The method searches for the first editable position in the formatted string between the specified starting and ending positions. If one is found, the value of the editable position is changed to the specified character, `input`. Any of the following conditions will result in an error condition that causes no replacement to be performed and a value of `false` to be returned: - The `startPos` or `endPos` parameters point before the start of the formatted string or beyond its end. @@ -4156,9 +4156,9 @@ method searches for the first editable position in the formatted string between the specified starting and ending positions. Operating on the assumption that there are enough editable positions after this point, the existing character values are replaced one-by-one with the contents of the replacement string parameter, `input`. + The method searches for the first editable position in the formatted string between the specified starting and ending positions. Operating on the assumption that there are enough editable positions after this point, the existing character values are replaced one-by-one with the contents of the replacement string parameter, `input`. - The following conditions are considered errors. When an error occurs, no replacement occurs and returns `false`. + The following conditions are considered errors. When an error occurs, no replacement occurs and returns `false`. - The `startPos` or `endPos` parameters point before the start of the formatted string or beyond its end. @@ -4224,9 +4224,9 @@ ## Remarks can treat two categories of characters, paces and prompt characters, in a special manner. Normally, each input character will be tested against the mask and either accepted or rejected. Operating on the assumption that the property is set to a value other than `null`, then setting the property to `true` will result in special processing for the prompt character. When a prompt character is added, it causes the current mask character position to be cleared and the current position to be advanced to the next editable character. - takes precedence over the property as described in the following table. + takes precedence over the property as described in the following table. -|||Resulting behavior| +|||Resulting behavior| |---------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------| |`true`|`true`|The prompt character can be added and it causes the current mask position to be reset. The default.| |`true`|`false`|The prompt character can be added and it causes the current mask position to be reset.| @@ -4290,7 +4290,7 @@ ## Remarks can treat two categories of characters, spaces and prompt characters, in a special manner. Normally, each input character will be tested against the mask and either accepted or rejected. Setting the property to `true` will result in the current mask character position being cleared and the current position being advanced to the next editable character. - is useful when assigning text that was saved excluding the prompt, where the prompt is replaced with a space. Before restoring such a string, setting to `true` will reset the prompt characters at the positions occupied by spaces in the input string. + is useful when assigning text that was saved excluding the prompt, where the prompt is replaced with a space. Before restoring such a string, setting to `true` will reset the prompt characters at the positions occupied by spaces in the input string. ]]> @@ -4357,9 +4357,9 @@ method clears the existing contents of the formatted string and then applies the mask against the `input` string to update the contents of the formatted string. + The method clears the existing contents of the formatted string and then applies the mask against the `input` string to update the contents of the formatted string. - The following conditions are considered errors. When an error occurs, the formatted string remains unaltered and returns `false`. + The following conditions are considered errors. When an error occurs, the formatted string remains unaltered and returns `false`. - There are not enough editable positions in the formatted string to hold the contents of the replacement string. @@ -4428,15 +4428,15 @@ method clears the existing contents of the formatted string and then applies the mask against the `input` string to update the contents of the formatted string. + The method clears the existing contents of the formatted string and then applies the mask against the `input` string to update the contents of the formatted string. - The following conditions are considered errors. When an error occurs, the formatted string remains unaltered and returns `false`. + The following conditions are considered errors. When an error occurs, the formatted string remains unaltered and returns `false`. - There are not enough editable positions in the formatted string to hold the contents of the replacement string. - One of the replacement character values is not valid because it is not printable or does not match its corresponding mask element. - This version of provides two additional output parameters to convey more information about the operation of the method. + This version of provides two additional output parameters to convey more information about the operation of the method. ]]> @@ -4551,9 +4551,9 @@ method will always include prompt and literal characters in the return value, regardless of the value of the or properties. This method will always display password characters if the property is set to a character value other than `null`. + The method will always include prompt and literal characters in the return value, regardless of the value of the or properties. This method will always display password characters if the property is set to a character value other than `null`. - is commonly used to obtain the string to display in associated user interface elements, such as . + is commonly used to obtain the string to display in associated user interface elements, such as . ]]> @@ -4617,7 +4617,7 @@ method includes prompts and literals according to the current values of the and properties, respectively. It will always return the original input characters, ignoring the value of the property. + This version of the overloaded method includes prompts and literals according to the current values of the and properties, respectively. It will always return the original input characters, ignoring the value of the property. > [!IMPORTANT] > Because this method reveals information that is usually protected in the user interface by password characters, it should be used with extreme caution to avoid accidentally revealing sensitive user data. @@ -4678,7 +4678,7 @@ method includes prompts and literals according to the current values of the and properties, respectively. If the `ignorePasswordChar` parameter is `true`, it will return the original input characters, ignoring the value of the property. If this parameter is `false`, it will use the password character to obscure editable user input if the property is set to a value other than `null`. + This version of the overloaded method includes prompts and literals according to the current values of the and properties, respectively. If the `ignorePasswordChar` parameter is `true`, it will return the original input characters, ignoring the value of the property. If this parameter is `false`, it will use the password character to obscure editable user input if the property is set to a value other than `null`. > [!IMPORTANT] > Because this method potentially reveals information that is usually protected in the user interface by password characters, it should be used with extreme caution to avoid accidentally revealing sensitive user data. @@ -4742,7 +4742,7 @@ method includes prompts and literals according to the values of the `IncludePrompt` and `IncludeLiterals` parameters, respectively. Notice that these parameters override the values of the properties. This method will always return the original input characters, ignoring the value of the property. + This version of the overloaded method includes prompts and literals according to the values of the `IncludePrompt` and `IncludeLiterals` parameters, respectively. Notice that these parameters override the values of the properties. This method will always return the original input characters, ignoring the value of the property. > [!IMPORTANT] > Because this method reveals information that is usually protected in the user interface by password characters, it should be used with extreme caution to avoid accidentally revealing sensitive user data. @@ -4805,16 +4805,16 @@ method returns a substring of the formatted string, starting at the position `startPos` and including the subsequent number of characters specified by the `length` parameter. The returned string includes prompts and literals according to the current values of the and properties, respectively. The return string will contain the original input characters; the property is always ignored. + This version of the overloaded method returns a substring of the formatted string, starting at the position `startPos` and including the subsequent number of characters specified by the `length` parameter. The returned string includes prompts and literals according to the current values of the and properties, respectively. The return string will contain the original input characters; the property is always ignored. > [!IMPORTANT] > Because this method reveals information that is usually protected in the user interface by password characters, it should be used with extreme caution to avoid accidentally revealing sensitive user data. - performs the following actions when there are discrepancies in the input parameters: + performs the following actions when there are discrepancies in the input parameters: - If `startPos` is less than zero, the starting position is set to zero. -- If `startPos` is greater than or equal to the actual of the formatted string, the string is returned. +- If `startPos` is greater than or equal to the actual of the formatted string, the string is returned. - If `length` is greater than the remaining number of characters past the starting position, only the remaining characters are returned. @@ -4880,16 +4880,16 @@ method returns a substring of the formatted string, starting at the position `startPos` and including the subsequent number of characters specified by the `length` parameter. The returned string includes prompts and literals according to the current values of the and properties, respectively. If the `ignorePasswordChar` parameter is `true`, it will return the original input characters, ignoring the value of the property. If this parameter is `false`, it will use the password character to obscure editable user input if the property is set to a value other than `null`. + This version of the overloaded method returns a substring of the formatted string, starting at the position `startPos` and including the subsequent number of characters specified by the `length` parameter. The returned string includes prompts and literals according to the current values of the and properties, respectively. If the `ignorePasswordChar` parameter is `true`, it will return the original input characters, ignoring the value of the property. If this parameter is `false`, it will use the password character to obscure editable user input if the property is set to a value other than `null`. > [!IMPORTANT] > Because this method potentially reveals information that is usually protected in the user interface by password characters, it should be used with extreme caution to avoid accidentally revealing sensitive user data. - performs the following actions when there are discrepancies in the input parameters: + performs the following actions when there are discrepancies in the input parameters: - If `startPos` is less than zero, the starting position is set to zero. -- If `startPos` is greater than or equal to the actual of the formatted string, the string is returned. +- If `startPos` is greater than or equal to the actual of the formatted string, the string is returned. - If `length` is greater than the remaining number of characters past the starting position, only the remaining characters are returned. @@ -4964,16 +4964,16 @@ method returns a substring of the formatted string, starting at the position `startPos` and including the subsequent number of characters specified by the `length` parameter. The return string includes prompts and literals according to the values of the `IncludePrompt` and `IncludeLiterals` parameters, respectively. Notice that these parameters override the values of the properties. This method will always return the original input characters, ignoring the value of the property. + This version of the overloaded method returns a substring of the formatted string, starting at the position `startPos` and including the subsequent number of characters specified by the `length` parameter. The return string includes prompts and literals according to the values of the `IncludePrompt` and `IncludeLiterals` parameters, respectively. Notice that these parameters override the values of the properties. This method will always return the original input characters, ignoring the value of the property. > [!IMPORTANT] > Because this method reveals information that is usually protected in the user interface by password characters, it should be used with extreme caution to avoid accidentally revealing sensitive user data. - performs the following actions when there are discrepancies in the input parameters: + performs the following actions when there are discrepancies in the input parameters: - If `startPos` is less than zero, the starting position is set to zero. -- If `startPos` is greater than or equal to the actual of the formatted string, the string is returned. +- If `startPos` is greater than or equal to the actual of the formatted string, the string is returned. - If `length` is greater than the remaining number of characters past the starting position, only the remaining characters are returned. @@ -5045,16 +5045,16 @@ method returns a substring of the formatted string, starting at the position `startPos` and including the subsequent number of characters specified by the `length` parameter. The return string includes prompts and literals according to the values of the `IncludePrompt` and `IncludeLiterals` parameters, respectively. Notice that these parameters override the values of the and properties. If the `ignorePasswordChar` parameter is `true`, it will return the original input characters, ignoring the value of the property. If this parameter is `false`, it will use the password character to obscure editable user input if the property is set to a value other than `null`. + This version of the overloaded method returns a substring of the formatted string, starting at the position `startPos` and including the subsequent number of characters specified by the `length` parameter. The return string includes prompts and literals according to the values of the `IncludePrompt` and `IncludeLiterals` parameters, respectively. Notice that these parameters override the values of the and properties. If the `ignorePasswordChar` parameter is `true`, it will return the original input characters, ignoring the value of the property. If this parameter is `false`, it will use the password character to obscure editable user input if the property is set to a value other than `null`. > [!IMPORTANT] > Because this method potentially reveals information that is usually protected in the user interface by password characters, it should be used with extreme caution to avoid accidentally revealing sensitive user data. - performs the following actions when there are discrepancies in the input parameters: + performs the following actions when there are discrepancies in the input parameters: - If `startPos` is less than zero, the starting position is set to zero. -- If `startPos` is greater than or equal to the actual of the formatted string, the string is returned. +- If `startPos` is greater than or equal to the actual of the formatted string, the string is returned. - If `length` is greater than the remaining number of characters past the starting position, only the remaining characters are returned. @@ -5120,17 +5120,17 @@ method tests whether a single character value represents valid input at the specified position in the formatted string. This method will return `false` for the following reasons: + The method tests whether a single character value represents valid input at the specified position in the formatted string. This method will return `false` for the following reasons: -- The `pos` parameter is less than zero or greater than the of the . +- The `pos` parameter is less than zero or greater than the of the . -- The character `input` is not a valid input character, as determined by the method. +- The character `input` is not a valid input character, as determined by the method. - The `input` is not compatible with the mask element at the specified position, `pos`. - The last condition may depend on the current value of the , , , and properties. + The last condition may depend on the current value of the , , , and properties. - To test an entire input string against the mask, use one of the methods instead. + To test an entire input string against the mask, use one of the methods instead. ]]> @@ -5198,7 +5198,7 @@ - Space characters are escaped if the property is `true`. - The method will also return `false` if the `pos` parameter is less than zero or greater than the of the . + The method will also return `false` if the `pos` parameter is less than zero or greater than the of the . ]]> @@ -5267,7 +5267,7 @@ applies the `input` string against the mask, without actually changing the formatted string, to test whether `input` would be valid in a corresponding operation. This method also returns `true` if input is `null` or has zero length. + The applies the `input` string against the mask, without actually changing the formatted string, to test whether `input` would be valid in a corresponding operation. This method also returns `true` if input is `null` or has zero length. ]]> @@ -5328,9 +5328,9 @@ applies the `input` string against the mask, without actually changing the formatted string, to test whether `input` would be valid in a corresponding operation. This method also returns `true` if input is `null` or has zero length. + The applies the `input` string against the mask, without actually changing the formatted string, to test whether `input` would be valid in a corresponding operation. This method also returns `true` if input is `null` or has zero length. - This version of provides two additional output parameters to convey more information about the operation of the method. + This version of provides two additional output parameters to convey more information about the operation of the method. ]]> diff --git a/xml/System.ComponentModel/MaskedTextResultHint.xml b/xml/System.ComponentModel/MaskedTextResultHint.xml index d3a1fc6b54c..6f0909882fe 100644 --- a/xml/System.ComponentModel/MaskedTextResultHint.xml +++ b/xml/System.ComponentModel/MaskedTextResultHint.xml @@ -44,14 +44,14 @@ Specifies values that succinctly describe the results of a masked text parsing operation. - control delegates the actual responsibility for parsing the input characters to the class. Many of the methods of , in addition to returning a success result, also provide an additional output parameter of type . This enumeration provides additional information about the operation of the method. - + control delegates the actual responsibility for parsing the input characters to the class. Many of the methods of , in addition to returning a success result, also provide an additional output parameter of type . This enumeration provides additional information about the operation of the method. + > [!NOTE] -> The method can be used to convert a value into a success value. - +> The method can be used to convert a value into a success value. + ]]> diff --git a/xml/System.ComponentModel/MemberDescriptor.xml b/xml/System.ComponentModel/MemberDescriptor.xml index 20dfada62c9..6bca60b1169 100644 --- a/xml/System.ComponentModel/MemberDescriptor.xml +++ b/xml/System.ComponentModel/MemberDescriptor.xml @@ -63,9 +63,9 @@ ## Remarks is the base class for the and the classes. The class provides a description of an event, and the class provides a description of a property. - This class defines properties and methods to access its stored attributes. The property gets the collection of attributes. The , , , and properties retrieve the values of those specific attributes. The and properties provide the name of the member. + This class defines properties and methods to access its stored attributes. The property gets the collection of attributes. The , , , and properties retrieve the values of those specific attributes. The and properties provide the name of the member. - The also defines an method to compare this to another. + The also defines an method to compare this to another. > [!NOTE] > Typically, you inherit from the and classes, and not from this class. @@ -349,7 +349,7 @@ method. + Accessing this member allows derived classes to modify the default set of attributes that are used in the method. ]]> @@ -400,7 +400,7 @@ for this member, this property calls the method to create a new using the array of objects passed to the constructor. + If there is no for this member, this property calls the method to create a new using the array of objects passed to the constructor. ]]> @@ -505,7 +505,7 @@ property when there is no for this member. If there are no attributes in the , this will return an empty . + This method is called from the property when there is no for this member. If there are no attributes in the , this will return an empty . ]]> @@ -1023,7 +1023,7 @@ method may return a different value. + Normally, the return value will be the same as the `instance` parameter. If another object has been associated with this instance, or if the instance is a custom type descriptor, the method may return a different value. ]]> diff --git a/xml/System.ComponentModel/MergablePropertyAttribute.xml b/xml/System.ComponentModel/MergablePropertyAttribute.xml index 0c40cf4de60..9869b822cde 100644 --- a/xml/System.ComponentModel/MergablePropertyAttribute.xml +++ b/xml/System.ComponentModel/MergablePropertyAttribute.xml @@ -78,7 +78,7 @@ The next example shows how to check the value of the for `MyProperty`. First the code gets a with all the properties for the object. Next it indexes into the to get `MyProperty`. Then it returns the attributes for this property and saves them in the attributes variable. - The example presents two different ways of checking the value of the . In the second code fragment, the example calls the method with a `static` value. In the last code fragment, the example uses the property to check the value. + The example presents two different ways of checking the value of the . In the second code fragment, the example calls the method with a `static` value. In the last code fragment, the example uses the property to check the value. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic MergablePropertyAttribute Example/CPP/source.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/MergablePropertyAttribute/Overview/source.cs" id="Snippet2"::: diff --git a/xml/System.ComponentModel/NestedContainer.xml b/xml/System.ComponentModel/NestedContainer.xml index 1fe22972918..53d26f7e9e0 100644 --- a/xml/System.ComponentModel/NestedContainer.xml +++ b/xml/System.ComponentModel/NestedContainer.xml @@ -73,11 +73,11 @@ ## Remarks The class is a simple implementation of the interface, which defines a component that logically contains zero or more other components and is owned by a parent component. The behavior of nested containers differs from a standard in a number of ways, including the following: -- Site characteristics such as and are routed through the owning component's site. +- Site characteristics such as and are routed through the owning component's site. - The site's property is a qualified name that includes the owning component's name followed by a period (.) and the child component's name. -- provides support for the as a service. +- provides support for the as a service. - When the owning component is disposed, the container is disposed as well. @@ -135,7 +135,7 @@ event so that the nested container's method will automatically be called. + This constructor enlists in its owner's event so that the nested container's method will automatically be called. ]]> @@ -323,7 +323,7 @@ method. This implementation only resolves requests for the and services. + This method overrides the method. This implementation only resolves requests for the and services. ]]> @@ -440,7 +440,7 @@ and calls , or if there is no nested site. If neither is available, this property returns `null`. + This property may be overridden to provide a custom owner name. The default implementation searches the owner's site for and calls , or if there is no nested site. If neither is available, this property returns `null`. ]]> diff --git a/xml/System.ComponentModel/NotifyParentPropertyAttribute.xml b/xml/System.ComponentModel/NotifyParentPropertyAttribute.xml index 9d3c218d684..7ef694a133f 100644 --- a/xml/System.ComponentModel/NotifyParentPropertyAttribute.xml +++ b/xml/System.ComponentModel/NotifyParentPropertyAttribute.xml @@ -60,7 +60,7 @@ to a property if its parent property should receive notification of changes to the property's values. For example, in the Properties window, the property has nested properties such as and . These nested properties are marked with `NotifyParentPropertyAttribute(true)` so they notify the parent property to update its value and display when the property values change. + Apply to a property if its parent property should receive notification of changes to the property's values. For example, in the Properties window, the property has nested properties such as and . These nested properties are marked with `NotifyParentPropertyAttribute(true)` so they notify the parent property to update its value and display when the property values change. For more information about using attributes, see [Attributes](/dotnet/standard/attributes/). diff --git a/xml/System.ComponentModel/ParenthesizePropertyNameAttribute.xml b/xml/System.ComponentModel/ParenthesizePropertyNameAttribute.xml index 8f7f446d9be..e6d1b322cc6 100644 --- a/xml/System.ComponentModel/ParenthesizePropertyNameAttribute.xml +++ b/xml/System.ComponentModel/ParenthesizePropertyNameAttribute.xml @@ -53,11 +53,11 @@ Indicates whether the name of the associated property is displayed with parentheses in the Properties window. This class cannot be inherited. - with a value of `true` indicates to the Properties window that the associated property should be displayed with parentheses around its name. The Properties window displays a property with parentheses around its name near the top of the list in alphabetical mode, or near the top of its category if the Properties window is in categorize mode. - + with a value of `true` indicates to the Properties window that the associated property should be displayed with parentheses around its name. The Properties window displays a property with parentheses around its name near the top of the list in alphabetical mode, or near the top of its category if the Properties window is in categorize mode. + ]]> diff --git a/xml/System.ComponentModel/ProgressChangedEventArgs.xml b/xml/System.ComponentModel/ProgressChangedEventArgs.xml index f43c1b7f6cc..138217b0e35 100644 --- a/xml/System.ComponentModel/ProgressChangedEventArgs.xml +++ b/xml/System.ComponentModel/ProgressChangedEventArgs.xml @@ -181,7 +181,7 @@ ## Examples - The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing with or appending the message to a multiline . + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing with or appending the message to a multiline . To run the example code, paste it into a project that contains an instance of type named `PictureBox1`. Then ensure that the event handler is associated with the event. @@ -247,7 +247,7 @@ event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing with or appending the message to a multiline . + The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing with or appending the message to a multiline . To run the example code, paste it into a project that contains an instance of type named `PictureBox1`. Then ensure that the event handler is associated with the event. diff --git a/xml/System.ComponentModel/PropertyDescriptor.xml b/xml/System.ComponentModel/PropertyDescriptor.xml index d1ec22b9659..89dc0af0bca 100644 --- a/xml/System.ComponentModel/PropertyDescriptor.xml +++ b/xml/System.ComponentModel/PropertyDescriptor.xml @@ -65,29 +65,29 @@ provides the following properties and methods: -- contains the for this property. +- contains the for this property. -- indicates whether this property should be localized. +- indicates whether this property should be localized. -- returns an editor of the specified type. +- returns an editor of the specified type. also provides the following `abstract` properties and methods: -- contains the type of component this property is bound to. +- contains the type of component this property is bound to. -- indicates whether this property is read-only. +- indicates whether this property is read-only. -- gets the type of the property. +- gets the type of the property. -- indicates whether resetting the component changes the value of the component. +- indicates whether resetting the component changes the value of the component. -- returns the current value of the property on a component. +- returns the current value of the property on a component. -- resets the value for this property of the component. +- resets the value for this property of the component. -- sets the value of the component to a different value. +- sets the value of the component to a different value. -- indicates whether the value of this property needs to be persisted. +- indicates whether the value of this property needs to be persisted. Typically, the `abstract` members are implemented through reflection. For more information about reflection, see the topics in [Reflection](/dotnet/framework/reflection-and-codedom/reflection). @@ -604,7 +604,7 @@ looks for a constructor that takes the specified type. If it finds a constructor, the type of the property is passed in. + looks for a constructor that takes the specified type. If it finds a constructor, the type of the property is passed in. Converters and editors use this method to create versions of a component. This method enables a single component to be reused for more than one type. @@ -1055,7 +1055,7 @@ - If you specify an instance and it is the default property, it will be included in the returned array even if there is no instance of the in the property. - Generally, child properties should be returned by implementing the member of the returned from this property. + Generally, child properties should be returned by implementing the member of the returned from this property. ]]> @@ -1230,7 +1230,7 @@ method may return a different value. + Typically, the return value will be the same as the `instance` passed in. If someone associated another object with this instance, or if the instance is a custom type descriptor, the method may return a different value. ]]> @@ -1304,7 +1304,7 @@ references. If it does not find the type in the assembly, it calls . + To find the appropriate type, this method first checks the assembly of the type that this references. If it does not find the type in the assembly, it calls . ]]> @@ -1361,7 +1361,7 @@ ## Remarks Typically, this method is implemented through reflection. - This method automatically calls the pre-change method, , and post-change method, , of the . + This method automatically calls the pre-change method, , and post-change method, , of the . ]]> @@ -1742,15 +1742,15 @@ This method creates a automatically in the following order: -1. The method calls the method to create a new to represent the changes. +1. The method calls the method to create a new to represent the changes. -2. The method calls the method to indicate that the transaction has begun and the changes are about to occur. +2. The method calls the method to indicate that the transaction has begun and the changes are about to occur. 3. The method resets the property to the value determined by this method's checking order. -4. The method calls the method to indicate that the changes have occurred. +4. The method calls the method to indicate that the changes have occurred. -5. The method calls to indicate that the transaction is completed. +5. The method calls to indicate that the transaction is completed. The purpose of the transaction is to support `Undo` and `Redo` functionality. @@ -1861,15 +1861,15 @@ This method creates a automatically in the following order: -1. The method calls the method to create a new to represent the changes. +1. The method calls the method to create a new to represent the changes. -2. The method calls the method to indicate that the transaction has begun and the changes are about to occur. +2. The method calls the method to indicate that the transaction has begun and the changes are about to occur. 3. The method resets the property to the value determined by this method's checking order. -4. The method calls the method to indicate that the changes have occurred. +4. The method calls the method to indicate that the changes have occurred. -5. The method calls to indicate that the transaction is complete. +5. The method calls to indicate that the transaction is complete. The purpose of the transaction is to support `Undo` and `Redo` functionality. @@ -1986,7 +1986,7 @@ Note: The class property indicates whether value change notifications for this property may originate from outside the property descriptor, such as from the component itself, or whether notifications will only originate from direct calls made to the method. For example, the component may implement the interface, or may have an explicit `name.Changed` event for this property. + The property indicates whether value change notifications for this property may originate from outside the property descriptor, such as from the component itself, or whether notifications will only originate from direct calls made to the method. For example, the component may implement the interface, or may have an explicit `name.Changed` event for this property. ]]> diff --git a/xml/System.ComponentModel/PropertyDescriptorCollection.xml b/xml/System.ComponentModel/PropertyDescriptorCollection.xml index 0af1afe8e40..dd264835a80 100644 --- a/xml/System.ComponentModel/PropertyDescriptorCollection.xml +++ b/xml/System.ComponentModel/PropertyDescriptorCollection.xml @@ -76,7 +76,7 @@ Using the properties available in the class, you can query the collection about its contents. Use the property to determine the number of elements in the collection. Use the property to get a specific property by index number or by name. - In addition to properties, you can use the method to get a description of the property with the specified name from the collection. + In addition to properties, you can use the method to get a description of the property with the specified name from the collection. @@ -875,7 +875,7 @@ method. If the contains four objects with the names `A`, `B`, `C`, and `D`, the properties of `myNewColl` would be sorted in the order `D`, `B`, `A`, and `C`. + The following code example defines the sort order for the method. If the contains four objects with the names `A`, `B`, `C`, and `D`, the properties of `myNewColl` would be sorted in the order `D`, `B`, `A`, and `C`. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic EventDescriptorCollection.InternalSort Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/EventDescriptorCollection/InternalSort/source.cs" id="Snippet1"::: @@ -1305,7 +1305,7 @@ method. If the contains four objects with the names `A`, `B`, `C`, and `D`, the properties of `myNewColl` would be sorted in the order `D`, `B`, `A`, and `C`. + The following code example defines the sort order for the method. If the contains four objects with the names `A`, `B`, `C`, and `D`, the properties of `myNewColl` would be sorted in the order `D`, `B`, `A`, and `C`. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic EventDescriptorCollection.Sort Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/EventDescriptorCollection/Sort/source.cs" id="Snippet1"::: @@ -1381,7 +1381,7 @@ method. If the contains four objects with the names `A`, `B`, `C`, and `D`, the properties of `myNewColl` would be sorted in the order `D`, `B`, `A`, and `C`. + The following code example defines the sort order for the method. If the contains four objects with the names `A`, `B`, `C`, and `D`, the properties of `myNewColl` would be sorted in the order `D`, `B`, `A`, and `C`. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic EventDescriptorCollection.Sort Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/EventDescriptorCollection/Sort/source.cs" id="Snippet1"::: diff --git a/xml/System.ComponentModel/PropertyFilterAttribute.xml b/xml/System.ComponentModel/PropertyFilterAttribute.xml index 0f8559c2288..026cb9137ab 100644 --- a/xml/System.ComponentModel/PropertyFilterAttribute.xml +++ b/xml/System.ComponentModel/PropertyFilterAttribute.xml @@ -30,11 +30,11 @@ Specifies which properties should be reported by type descriptors, specifically the method. - supports an internal mechanism that limits the number of properties on a type that are returned by the custom type descriptor. If the attribute is found, the type descriptor narrows the scope of returned properties. differs from typical attributes because you cannot apply it to a class as metadata. The filter mechanism works through code instead of through static metadata. - + supports an internal mechanism that limits the number of properties on a type that are returned by the custom type descriptor. If the attribute is found, the type descriptor narrows the scope of returned properties. differs from typical attributes because you cannot apply it to a class as metadata. The filter mechanism works through code instead of through static metadata. + ]]> @@ -135,11 +135,11 @@ if the specified is equal to the current ; otherwise, . - values on each for value equality. If the are the same, then the two instances are equal. - + values on each for value equality. If the are the same, then the two instances are equal. + ]]> @@ -177,11 +177,11 @@ Gets the filter options for this .NET Framework attribute. The property filter options. - is the same value as was provided for the `filter` constructor argument when this was constructed. There is no other means of setting the value. - + is the same value as was provided for the `filter` constructor argument when this was constructed. There is no other means of setting the value. + ]]> @@ -248,11 +248,11 @@ if a match exists; otherwise, . - , a result may be different from an result. For example, a filter of matches a filter of , because is a merge of all filter values. - + , a result may be different from an result. For example, a filter of matches a filter of , because is a merge of all filter values. + ]]> diff --git a/xml/System.ComponentModel/PropertyTabAttribute.xml b/xml/System.ComponentModel/PropertyTabAttribute.xml index 8a6f2931a1e..22dbd6e734c 100644 --- a/xml/System.ComponentModel/PropertyTabAttribute.xml +++ b/xml/System.ComponentModel/PropertyTabAttribute.xml @@ -122,7 +122,7 @@ . This constructor can be used to derive from this attribute and specify multiple tab types by calling . + This is a parameterless constructor that creates an uninitialized . This constructor can be used to derive from this attribute and specify multiple tab types by calling . ]]> @@ -582,7 +582,7 @@ provides a utility function that can be used to set the types of tab classes that this specifies. + provides a utility function that can be used to set the types of tab classes that this specifies. ]]> @@ -659,7 +659,7 @@ provides a utility function that can be used to set the types of tab classes that this specifies. + provides a utility function that can be used to set the types of tab classes that this specifies. ]]> diff --git a/xml/System.ComponentModel/ReadOnlyAttribute.xml b/xml/System.ComponentModel/ReadOnlyAttribute.xml index 70b4b69eb47..660e1d64e56 100644 --- a/xml/System.ComponentModel/ReadOnlyAttribute.xml +++ b/xml/System.ComponentModel/ReadOnlyAttribute.xml @@ -78,7 +78,7 @@ The next code example shows how to check the value of the for `MyProperty`. First, the code gets a with all the properties for the object. Next, it indexes into the to get `MyProperty`. Then it returns the attributes for this property and saves them in the attributes variable. - The example presents two different ways of checking the value of the . In the second code fragment, the example calls the method. In the last code fragment, the example uses the property to check the value. + The example presents two different ways of checking the value of the . In the second code fragment, the example calls the method. In the last code fragment, the example uses the property to check the value. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic ReadOnlyAttribute Example/CPP/source.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/ReadOnlyAttribute/Overview/source.cs" id="Snippet2"::: diff --git a/xml/System.ComponentModel/ReferenceConverter.xml b/xml/System.ComponentModel/ReferenceConverter.xml index dff658e26f6..74182bfee6c 100644 --- a/xml/System.ComponentModel/ReferenceConverter.xml +++ b/xml/System.ComponentModel/ReferenceConverter.xml @@ -52,20 +52,20 @@ Provides a type converter to convert object references to and from other representations. - is typically used within the context of sited components or a design environment. Without a component site or a usable , this converter is of little use. - - This converter converts a reference of an object that implements the interface and displays its properties in the **Properties** window. - - For more information about type converters, see the base class and [How to: Implement a Type Converter](https://learn.microsoft.com/previous-versions/visualstudio/visual-studio-2013/ayybcxe5(v=vs.120)). - + is typically used within the context of sited components or a design environment. Without a component site or a usable , this converter is of little use. + + This converter converts a reference of an object that implements the interface and displays its properties in the **Properties** window. + + For more information about type converters, see the base class and [How to: Implement a Type Converter](https://learn.microsoft.com/previous-versions/visualstudio/visual-studio-2013/ayybcxe5(v=vs.120)). + > [!NOTE] -> You should never create an instance of the class. Instead, call the method of the class. For more information, see the examples in the base class. - - This class provides the method to check whether a particular value can be added to the standard values collection. If you do not want to add the value to the collection, override this method. - +> You should never create an instance of the class. Instead, call the method of the class. For more information, see the examples in the base class. + + This class provides the method to check whether a particular value can be added to the standard values collection. If you do not want to add the value to the collection, override this method. + ]]> @@ -176,11 +176,11 @@ if this object can perform the conversion; otherwise, . - @@ -242,11 +242,11 @@ Converts the given object to the reference type. An that represents the converted . - The conversion cannot be performed. @@ -311,13 +311,13 @@ Converts the given value object to the reference type using the specified context and arguments. The converted object. - @@ -377,11 +377,11 @@ Gets a collection of standard values for the reference data type. A that holds a standard set of valid values, or if the data type does not support a standard set of values. - @@ -432,11 +432,11 @@ because the returned from is an exhaustive list of possible values. This method never returns . - @@ -487,11 +487,11 @@ because can be called to find a common set of values the object supports. This method never returns . - @@ -543,11 +543,11 @@ if the value is allowed and can be added to the standard values collection; if the value cannot be added to the standard values collection. - and for each component found that is of the associated type. By default, this method returns `true`, that is, it allows adding the value into the standard values collection. - + and for each component found that is of the associated type. By default, this method returns `true`, that is, it allows adding the value into the standard values collection. + ]]> diff --git a/xml/System.ComponentModel/RefreshEventArgs.xml b/xml/System.ComponentModel/RefreshEventArgs.xml index be91f035c10..c77396ae6bd 100644 --- a/xml/System.ComponentModel/RefreshEventArgs.xml +++ b/xml/System.ComponentModel/RefreshEventArgs.xml @@ -54,20 +54,20 @@ Provides data for the event. - becomes out-of-date, and a event is raised. A event is also raised when a is changed during design time. - - A object specifies the data associated with the event; that is, the component and the type of component that changed. - - The class provides and properties to get the component or type that raised the event. - - - -## Examples - For an example of the class, see the sample code in the delegate. - + becomes out-of-date, and a event is raised. A event is also raised when a is changed during design time. + + A object specifies the data associated with the event; that is, the component and the type of component that changed. + + The class provides and properties to get the component or type that raised the event. + + + +## Examples + For an example of the class, see the sample code in the delegate. + ]]> diff --git a/xml/System.ComponentModel/RunWorkerCompletedEventArgs.xml b/xml/System.ComponentModel/RunWorkerCompletedEventArgs.xml index 94fe9cf51b0..9e032241c02 100644 --- a/xml/System.ComponentModel/RunWorkerCompletedEventArgs.xml +++ b/xml/System.ComponentModel/RunWorkerCompletedEventArgs.xml @@ -56,7 +56,7 @@ ## Remarks -When using the [event-based asynchronous pattern](/dotnet/standard/asynchronous-programming-patterns/event-based-asynchronous-pattern-eap) for asynchronous operations, a Windows Forms form or control initiates an asynchronous operation by calling the method. The method in turn raises the event asynchronously and passes it a instance. If the asynchronous operation returns a value, the event handler typically assigns it to the property. When the asynchronous operation completes, the event is raised and is passed a instance that contains information about the status of the operation (whether it was cancelled, faulted, or completed successfully). If it completed successfully, its property contains the value returned by the asynchronous operation and previously assigned to the property. +When using the [event-based asynchronous pattern](/dotnet/standard/asynchronous-programming-patterns/event-based-asynchronous-pattern-eap) for asynchronous operations, a Windows Forms form or control initiates an asynchronous operation by calling the method. The method in turn raises the event asynchronously and passes it a instance. If the asynchronous operation returns a value, the event handler typically assigns it to the property. When the asynchronous operation completes, the event is raised and is passed a instance that contains information about the status of the operation (whether it was cancelled, faulted, or completed successfully). If it completed successfully, its property contains the value returned by the asynchronous operation and previously assigned to the property. > [!NOTE] > The attribute applied to this class has the following property value: . The does not affect desktop applications (which are typically started by double-clicking an icon, typing a command, or entering a URL in a browser). For more information, see the class or [SQL Server Programming and Host Protection Attributes](/dotnet/framework/performance/sql-server-programming-and-host-protection-attributes). @@ -169,7 +169,7 @@ When using the [event-based asynchronous pattern](/dotnet/standard/asynchronous- event handler should always check the and properties before accessing the property. If an exception was raised or if the operation was canceled, accessing the property raises an exception. + Your event handler should always check the and properties before accessing the property. If an exception was raised or if the operation was canceled, accessing the property raises an exception. diff --git a/xml/System.ComponentModel/SByteConverter.xml b/xml/System.ComponentModel/SByteConverter.xml index 42669b3c2e8..58dd9e88218 100644 --- a/xml/System.ComponentModel/SByteConverter.xml +++ b/xml/System.ComponentModel/SByteConverter.xml @@ -48,25 +48,25 @@ Provides a type converter to convert 8-bit unsigned integer objects to and from a string. - value type represents integers with values ranging from negative 128 to positive 127. This data type is not supported in Visual Basic. - + value type represents integers with values ranging from negative 128 to positive 127. This data type is not supported in Visual Basic. + > [!NOTE] -> You should never create an instance of . Instead, call the method of . For more information, see the examples in the base class and [How to: Implement a Type Converter](https://learn.microsoft.com/previous-versions/visualstudio/visual-studio-2013/ayybcxe5(v=vs.120)). - - - -## Examples - The following sample converts a variable of type to a string, and vice versa. - +> You should never create an instance of . Instead, call the method of . For more information, see the examples in the base class and [How to: Implement a Type Converter](https://learn.microsoft.com/previous-versions/visualstudio/visual-studio-2013/ayybcxe5(v=vs.120)). + + + +## Examples + The following sample converts a variable of type to a string, and vice versa. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Converters/CPP/converters.cpp" id="Snippet18"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/BooleanConverter/Overview/converters.cs" id="Snippet18"::: - :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/BooleanConverter/Overview/converters.vb" id="Snippet18"::: - + :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/BooleanConverter/Overview/converters.vb" id="Snippet18"::: + ]]> diff --git a/xml/System.ComponentModel/SingleConverter.xml b/xml/System.ComponentModel/SingleConverter.xml index 13ecfca5f9a..47d40fc3621 100644 --- a/xml/System.ComponentModel/SingleConverter.xml +++ b/xml/System.ComponentModel/SingleConverter.xml @@ -48,23 +48,23 @@ Provides a type converter to convert single-precision, floating point number objects to and from various other representations. - value type represents a single-precision 32-bit number with values ranging from negative 3.402823e38 to positive 3.402823e38. - + value type represents a single-precision 32-bit number with values ranging from negative 3.402823e38 to positive 3.402823e38. + > [!NOTE] -> You should never create an instance of . Instead, call the method of . For more information, see the examples in the base class and [How to: Implement a Type Converter](https://learn.microsoft.com/previous-versions/visualstudio/visual-studio-2013/ayybcxe5(v=vs.120)). - - - -## Examples - The following sample converts a variable of type to a string, and vice versa. - +> You should never create an instance of . Instead, call the method of . For more information, see the examples in the base class and [How to: Implement a Type Converter](https://learn.microsoft.com/previous-versions/visualstudio/visual-studio-2013/ayybcxe5(v=vs.120)). + + + +## Examples + The following sample converts a variable of type to a string, and vice versa. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Converters/CPP/converters.cpp" id="Snippet19"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/BooleanConverter/Overview/converters.cs" id="Snippet19"::: - :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/BooleanConverter/Overview/converters.vb" id="Snippet19"::: - + :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/BooleanConverter/Overview/converters.vb" id="Snippet19"::: + ]]> diff --git a/xml/System.ComponentModel/SortDescription.xml b/xml/System.ComponentModel/SortDescription.xml index 8d8e23e3e3f..9865e0aff20 100644 --- a/xml/System.ComponentModel/SortDescription.xml +++ b/xml/System.ComponentModel/SortDescription.xml @@ -227,7 +227,7 @@ if the two objects are equal; otherwise, . - .]]> + .]]> @@ -265,7 +265,7 @@ if the values are not equal; otherwise, . - .]]> + .]]> @@ -302,13 +302,13 @@ Gets or sets the property name being used as the sorting criteria. The default value is null. - object involved in the sorting. only supports simple column names. supports general property paths and `XPath` for XML data. Therefore, when the view is a object, you can sort XML nodes in an based on an attribute of those nodes. For example, if the attribute name is `Cost`, you would specify "@Cost" for the in the . - + object involved in the sorting. only supports simple column names. supports general property paths and `XPath` for XML data. Therefore, when the view is a object, you can sort XML nodes in an based on an attribute of those nodes. For example, if the attribute name is `Cost`, you would specify "@Cost" for the in the . + ]]> diff --git a/xml/System.ComponentModel/SortDescriptionCollection.xml b/xml/System.ComponentModel/SortDescriptionCollection.xml index a819253645a..0121e907866 100644 --- a/xml/System.ComponentModel/SortDescriptionCollection.xml +++ b/xml/System.ComponentModel/SortDescriptionCollection.xml @@ -92,13 +92,13 @@ Removes all items from the collection. - event. - - For more information, see the method of the base class. - + event. + + For more information, see the method of the base class. + ]]> @@ -196,13 +196,13 @@ The object to insert. Inserts an item into the collection at the specified index. - event. - - For more information, see the method of the base class. - + event. + + For more information, see the method of the base class. + ]]> @@ -237,13 +237,13 @@ The zero-based index of the element to remove. Removes the item at the specified index in the collection. - event. - - For more information, see the method of the base class. - + event. + + For more information, see the method of the base class. + ]]> @@ -280,13 +280,13 @@ The new value for the element at the specified index. Replaces the element at the specified index. - event. - - For more information, see the method of the base class. - + event. + + For more information, see the method of the base class. + ]]> diff --git a/xml/System.ComponentModel/StringConverter.xml b/xml/System.ComponentModel/StringConverter.xml index 472ee8bda1e..757b3c3cd68 100644 --- a/xml/System.ComponentModel/StringConverter.xml +++ b/xml/System.ComponentModel/StringConverter.xml @@ -48,16 +48,16 @@ Provides a type converter to convert string objects to and from other representations. - base class and [How to: Implement a Type Converter](https://learn.microsoft.com/previous-versions/visualstudio/visual-studio-2013/ayybcxe5(v=vs.120)). - + base class and [How to: Implement a Type Converter](https://learn.microsoft.com/previous-versions/visualstudio/visual-studio-2013/ayybcxe5(v=vs.120)). + > [!NOTE] -> You should never create an instance of . Instead, call the method of . For more information, see the examples in the base class. - +> You should never create an instance of . Instead, call the method of . For more information, see the examples in the base class. + ]]> @@ -163,11 +163,11 @@ if this converter can perform the conversion; otherwise, . - @@ -230,11 +230,11 @@ Converts the specified value object to a object. An that represents the converted value. - The conversion could not be performed. diff --git a/xml/System.ComponentModel/TimeSpanConverter.xml b/xml/System.ComponentModel/TimeSpanConverter.xml index 9ce326bd925..dcee3b1376b 100644 --- a/xml/System.ComponentModel/TimeSpanConverter.xml +++ b/xml/System.ComponentModel/TimeSpanConverter.xml @@ -62,12 +62,12 @@ For more information about type converters, see the base class and [How to: Implement a Type Converter](https://learn.microsoft.com/previous-versions/visualstudio/visual-studio-2013/ayybcxe5(v=vs.120)). > [!NOTE] -> You should never create an instance of a . Instead, call the method of the class. For more information, see the examples in the base class. +> You should never create an instance of a . Instead, call the method of the class. For more information, see the examples in the base class. ## Examples - The following code example converts a variable of type to a string, and vice versa. Both variables are represented in format. + The following code example converts a variable of type to a string, and vice versa. Both variables are represented in format. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Converters/CPP/converters.cpp" id="Snippet21"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/BooleanConverter/Overview/converters.cs" id="Snippet21"::: @@ -399,7 +399,7 @@ ## Remarks This method most commonly converts types to and from string objects. - The default implementation will make a call to on the object if the object is valid and if the destination type is string. If this method cannot convert to the destination type, it will throw a . + The default implementation will make a call to on the object if the object is valid and if the destination type is string. If this method cannot convert to the destination type, it will throw a . The `context` parameter can be used to extract additional information about the environment this converter is being invoked from. This can be `null`, so always check. Also, properties on the context object can return `null`. diff --git a/xml/System.ComponentModel/TypeConverter+StandardValuesCollection.xml b/xml/System.ComponentModel/TypeConverter+StandardValuesCollection.xml index 29dac893969..50754e143ca 100644 --- a/xml/System.ComponentModel/TypeConverter+StandardValuesCollection.xml +++ b/xml/System.ComponentModel/TypeConverter+StandardValuesCollection.xml @@ -58,7 +58,7 @@ . + This is a simple collection class that takes an array of values and converts it to a collection. It is lightweight and is well suited for use in . ]]> diff --git a/xml/System.ComponentModel/TypeConverter.xml b/xml/System.ComponentModel/TypeConverter.xml index 11ecf551581..9a0d83fd481 100644 --- a/xml/System.ComponentModel/TypeConverter.xml +++ b/xml/System.ComponentModel/TypeConverter.xml @@ -390,7 +390,7 @@ Note: Your derived type might be marked as or always returns `true`. + If `destinationType` is a string, the default implementation of always returns `true`. ]]> @@ -457,7 +457,7 @@ Note: Your derived type might be marked as or always returns `true`. + If `destinationType` is a string, the default implementation of always returns `true`. ]]> @@ -592,7 +592,7 @@ Note: Your derived type might be marked as or class that supports behavior from a string. This behavior enables type conversion from the string provided as a XAML attribute value and provides a XAML processor with the support needed to create an object from the string, so that the object can be produced in a parsed object graph. Custom types or members of custom types are indicated by applying to the definitions, with the attribute referencing the custom implementation. + Custom type authors that intend to support a type conversion behavior for XAML typically implement a class that supports behavior from a string. This behavior enables type conversion from the string provided as a XAML attribute value and provides a XAML processor with the support needed to create an object from the string, so that the object can be produced in a parsed object graph. Custom types or members of custom types are indicated by applying to the definitions, with the attribute referencing the custom implementation. For XAML purposes, you do not typically provide branching implementations based on `culture`. This is because XAML is precompiled in a development environment context, and culture-specific information for runtime XAML is not relevant for XAML type conversion. For more information, see [Type Converters for XAML Overview](/dotnet/framework/xaml-services/type-converters-for-xaml-overview). @@ -1052,7 +1052,7 @@ Note: Your derived type might be marked as or on the object, if the object is valid and if the destination type is a string. + The most common type to convert to and from is a string object. This implementation calls on the object, if the object is valid and if the destination type is a string. ]]> @@ -1122,13 +1122,13 @@ Note: Your derived type might be marked as or on the object if the object is valid and if the destination type is a string. + The most common types to convert are to and from a string object. This implementation calls on the object if the object is valid and if the destination type is a string. Use the `context` parameter to extract additional information about the environment from which this converter is invoked. This parameter can be `null`, so always check it. Also, properties on the context object can return `null`. - Custom type authors that intend to support a type conversion behavior for XAML typically implement a class that supports behavior from a string. These type converters might also implement to support serialization back to XAML. + Custom type authors that intend to support a type conversion behavior for XAML typically implement a class that supports behavior from a string. These type converters might also implement to support serialization back to XAML. - Some XAML serialization scenarios cannot be adequately addressed with alone. In these cases, it may be necessary to also define a that handles the serialization cases that would otherwise be handled by . For more information, see . + Some XAML serialization scenarios cannot be adequately addressed with alone. In these cases, it may be necessary to also define a that handles the serialization cases that would otherwise be handled by . For more information, see . ]]> @@ -1541,7 +1541,7 @@ Note: Your derived type might be marked as or . + The dictionary provided by the `propertyValues` parameter has a series of name/value pairs, one for each property returned from . ]]> @@ -1935,7 +1935,7 @@ Note: Your derived type might be marked as or for the correct data type. + By default, a type does not return properties. An easy implementation of this method can call for the correct data type. ]]> @@ -2009,7 +2009,7 @@ Note: Your derived type might be marked as or for the correct data type. + By default, a type does not return properties. An easy implementation of this method can call for the correct data type. ]]> @@ -2438,7 +2438,7 @@ Note: Your derived type might be marked as or method provides. If the values are exclusive, the list returned by should not allow these values to be edited. + If the list is exclusive, such as in an enumeration data type, then no other values are valid. If the list is not exclusive, then other valid values might exist in addition to the list of standard values that the method provides. If the values are exclusive, the list returned by should not allow these values to be edited. ]]> @@ -2496,7 +2496,7 @@ Note: Your derived type might be marked as or method provides. If the values are exclusive, the list returned by should not allow these values to be edited. + If the list is exclusive, such as in an enumeration data type, then no other values are valid. If the list is not exclusive, then other valid values might exist in addition to the list of standard values that the method provides. If the values are exclusive, the list returned by should not allow these values to be edited. ]]> @@ -2696,7 +2696,7 @@ Note: Your derived type might be marked as or method catches exceptions from the and methods. If the input value type causes to return `false`, or if the input value causes to raise an exception, the method returns `false`. + Starting in .NET Framework 4, the method catches exceptions from the and methods. If the input value type causes to return `false`, or if the input value causes to raise an exception, the method returns `false`. To enable the legacy behavior, insert the following lines into the configuration file of your .NET Framework application. @@ -2774,7 +2774,7 @@ Note: Your derived type might be marked as or method catches exceptions from the and methods. If the input value type causes to return `false`, or if the input value causes to raise an exception, the method returns `false`. + Starting in .NET Framework 4, the method catches exceptions from the and methods. If the input value type causes to return `false`, or if the input value causes to raise an exception, the method returns `false`. To enable the legacy behavior, insert the following lines into the configuration file of your .NET Framework application. diff --git a/xml/System.ComponentModel/TypeDescriptionProvider.xml b/xml/System.ComponentModel/TypeDescriptionProvider.xml index 12b1fefb255..e815721b487 100644 --- a/xml/System.ComponentModel/TypeDescriptionProvider.xml +++ b/xml/System.ComponentModel/TypeDescriptionProvider.xml @@ -62,7 +62,7 @@ - At design time, when the target class can be assigned the appropriate tag. -- At run time, when one of the methods of the class can be called. These overloaded methods require either the target object or its class type. +- At run time, when one of the methods of the class can be called. These overloaded methods require either the target object or its class type. The class relies on a parent object of the same type, supplied during construction. This allows classes that derive from to selectively override methods. @@ -133,7 +133,7 @@ constructor with a parameter value that is `null`. + This constructor is equivalent to calling the other constructor with a parameter value that is `null`. ]]> @@ -195,11 +195,11 @@ |Method|Default return value| |------------|--------------------------| -||`null`| -||A newly created object through a call to the method.| -||A default instance of a class.| -||A default instance of a class.| -||The `objectType` first parameter.| +||`null`| +||A newly created object through a call to the method.| +||A default instance of a class.| +||A default instance of a class.| +||The `objectType` first parameter.| ]]> @@ -285,9 +285,9 @@ specified by the `provider` parameter is passed in by the method of the class. If `provider` is not `null`, the service provider can be used by the type description provider to obtain additional context about the creation call. + The specified by the `provider` parameter is passed in by the method of the class. If `provider` is not `null`, the service provider can be used by the type description provider to obtain additional context about the creation call. - The method is `virtual` and, by default, returns the result of the method if `parent` is `null`. If `parent` is not `null`, this method will invoke the method of the parent provider. + The method is `virtual` and, by default, returns the result of the method if `parent` is `null`. If `parent` is not `null`, this method will invoke the method of the parent provider. ]]> @@ -351,7 +351,7 @@ may need to perform complex operations on collections of metadata. Because types are not unloaded for the life of a domain, the class will automatically cache the results of these operations based on type. However, some operations use live object instances. These operations cannot be cached within the class because caching them would prevent the object from being garbage collected. Instead, the class allows for a per-object cache, accessed as an of key/value pairs, to exist on an object. The method returns an instance of this cache. The method will return `null` if there is no supported cache for an object. + A may need to perform complex operations on collections of metadata. Because types are not unloaded for the life of a domain, the class will automatically cache the results of these operations based on type. However, some operations use live object instances. These operations cannot be cached within the class because caching them would prevent the object from being garbage collected. Instead, the class allows for a per-object cache, accessed as an of key/value pairs, to exist on an object. The method returns an instance of this cache. The method will return `null` if there is no supported cache for an object. The default used by examines the object to see if it is a sited component that implements the interface. If the object is, it uses the dictionary service to store the object's cache. Otherwise, the object it returns `null`. Other type description providers may provide their own implementation here. For example, dependency objects can just attach a property of type . @@ -414,9 +414,9 @@ interface can attach properties to other objects that reside in the same logical container. The overloaded methods do not return a type descriptor that provides these extra extended properties. The method returns the set of these extended properties. The will automatically merge the results of these two property collections. While the .NET Framework component model supports only extended properties, can be used for extended attributes as well as events, if the type description provider supports it. + An extended type descriptor is a custom type descriptor that offers properties that other objects have added to this object, but that are not actually defined on the object. For example, in the .NET Framework component model, objects that implement the interface can attach properties to other objects that reside in the same logical container. The overloaded methods do not return a type descriptor that provides these extra extended properties. The method returns the set of these extended properties. The will automatically merge the results of these two property collections. While the .NET Framework component model supports only extended properties, can be used for extended attributes as well as events, if the type description provider supports it. - is `virtual` and, by default, returns a custom type descriptor that returns empty results if no parent provider was passed. If a parent provider was passed, this method will invoke the parent provider's method. + is `virtual` and, by default, returns a custom type descriptor that returns empty results if no parent provider was passed. If a parent provider was passed, this method will invoke the parent provider's method. ]]> @@ -625,7 +625,7 @@ method is a lower-level version of the method. If no custom type descriptor can be located for an object, is called to perform normal reflection against the object. + The method is a lower-level version of the method. If no custom type descriptor can be located for an object, is called to perform normal reflection against the object. Use this method overload if you have called a type descriptor member that uses an instance instead of a type. @@ -702,7 +702,7 @@ method is a lower-level version of the method. If no custom type descriptor can be located for an object, is called to perform normal reflection against the object. + The method is a lower-level version of the method. If no custom type descriptor can be located for an object, is called to perform normal reflection against the object. Use this method overload if you have called a type descriptor member that uses a type instead of an instance. @@ -783,7 +783,7 @@ method is a lower-level version of the method. If no custom type descriptor can be located for an object, is called to perform normal reflection against the object. + The method is a lower-level version of the method. If no custom type descriptor can be located for an object, is called to perform normal reflection against the object. ]]> @@ -839,7 +839,7 @@ method reverses the method to convert a reflection type back into a runtime type. Using the method is preferred over using the property, which was used in earlier versions to return the runtime type. + The method reverses the method to convert a reflection type back into a runtime type. Using the method is preferred over using the property, which was used in earlier versions to return the runtime type. ]]> @@ -1055,7 +1055,7 @@ method. + This method is prototyped as `virtual` and, by default, returns an empty descriptor if no parent provider was passed. If a parent provider was passed, this method will invoke the parent provider's method. ]]> diff --git a/xml/System.ComponentModel/TypeDescriptionProviderAttribute.xml b/xml/System.ComponentModel/TypeDescriptionProviderAttribute.xml index 4a041f378d6..9e6f9f3841a 100644 --- a/xml/System.ComponentModel/TypeDescriptionProviderAttribute.xml +++ b/xml/System.ComponentModel/TypeDescriptionProviderAttribute.xml @@ -70,22 +70,22 @@ Specifies the custom type description provider for a class. This class cannot be inherited. - class, which by default only obtains type information directly from metadata of the compiled classes. - + class, which by default only obtains type information directly from metadata of the compiled classes. + > [!NOTE] -> For a more dynamic way to provide custom metadata for your authored classes, see the method. - - Tagging a class with a will associate a with that class. A provides supplemental metadata information about the tagged class. For example, the method returns an that defines additional type information, such as attributes, events, and properties. Subsequently, if a member is used to investigate the tagged class, it will discover both the default and custom type information. - - This attribute can only be applied to classes and is inherited by derived classes. - - This attribute cannot be derived from. - - For more information about using attributes, see [Attributes](/dotnet/standard/attributes/). - +> For a more dynamic way to provide custom metadata for your authored classes, see the method. + + Tagging a class with a will associate a with that class. A provides supplemental metadata information about the tagged class. For example, the method returns an that defines additional type information, such as attributes, events, and properties. Subsequently, if a member is used to investigate the tagged class, it will discover both the default and custom type information. + + This attribute can only be applied to classes and is inherited by derived classes. + + This attribute cannot be derived from. + + For more information about using attributes, see [Attributes](/dotnet/standard/attributes/). + ]]> @@ -155,11 +155,11 @@ The qualified name of the type. Initializes a new instance of the class using the specified type name. - constructor associates the specified with the tagged class. - + constructor associates the specified with the tagged class. + ]]> @@ -220,11 +220,11 @@ The type to store in the attribute. Initializes a new instance of the class using the specified type. - constructor associates the specified with the tagged class. - + constructor associates the specified with the tagged class. + ]]> @@ -288,11 +288,11 @@ Gets the type name for the type description provider. A containing the qualified type name for the . - diff --git a/xml/System.ComponentModel/TypeDescriptor.xml b/xml/System.ComponentModel/TypeDescriptor.xml index 2f7a1eb69bc..9f2161ea2d8 100644 --- a/xml/System.ComponentModel/TypeDescriptor.xml +++ b/xml/System.ComponentModel/TypeDescriptor.xml @@ -57,9 +57,9 @@ namespace, and the class. Reflection is a general mechanism available to all types because its foundation is established in the method of the root class. The information it returns for a type is not extensible, in that it cannot be modified after compilation of the target type. For more information, see the topics in [Reflection](/dotnet/framework/reflection-and-codedom/reflection). + The .NET Framework provides two ways to access metadata on a type: the reflection API provided in the namespace, and the class. Reflection is a general mechanism available to all types because its foundation is established in the method of the root class. The information it returns for a type is not extensible, in that it cannot be modified after compilation of the target type. For more information, see the topics in [Reflection](/dotnet/framework/reflection-and-codedom/reflection). - In contrast, is an extensible inspection mechanism for components: those classes that implement the interface. Unlike reflection, it does not inspect for methods. can be dynamically extended by several services available through the target component's . The following table shows these services. + In contrast, is an extensible inspection mechanism for components: those classes that implement the interface. Unlike reflection, it does not inspect for methods. can be dynamically extended by several services available through the target component's . The following table shows these services. |Service name|Description| |------------------|-----------------| @@ -75,7 +75,7 @@ When you want to access information and you have an instance of the object, use the method that calls for a component. Use the method that calls for the class type only when you do not have an instance of the object. - Properties and events are cached by for speed. Typically, they are constant for the lifetime of an object. However, extender providers and designers can change the set of properties on an object. If this is the case, then the method must be called to update the cache. + Properties and events are cached by for speed. Typically, they are constant for the lifetime of an object. However, extender providers and designers can change the set of properties on an object. If this is the case, then the method must be called to update the cache. ]]> @@ -160,7 +160,7 @@ method adds class-level attributes to the specified instance of a component. Because this is a common requirement of applications using the Visual Studio Windows Forms Designer and Properties window, this method provides a shortcut by creating a type description provider that merges the provided attributes with the attributes that already exist on the class. The return value is the type description provider that was used to add the attributes. This provider can later be passed to the method when the added attributes are no longer needed. + The method adds class-level attributes to the specified instance of a component. Because this is a common requirement of applications using the Visual Studio Windows Forms Designer and Properties window, this method provides a shortcut by creating a type description provider that merges the provided attributes with the attributes that already exist on the class. The return value is the type description provider that was used to add the attributes. This provider can later be passed to the method when the added attributes are no longer needed. ]]> @@ -230,7 +230,7 @@ method adds class-level attributes to the specified type of a component. Because this is a common requirement of applications using the Visual Studio Windows Forms Designer and Properties window, this method provides a shortcut by creating a type description provider that merges the provided attributes with the attributes that already exist on the class. The return value is the type description provider that was used to add the attributes. This provider can later be passed to the method when the added attributes are no longer needed. + The method adds class-level attributes to the specified type of a component. Because this is a common requirement of applications using the Visual Studio Windows Forms Designer and Properties window, this method provides a shortcut by creating a type description provider that merges the provided attributes with the attributes that already exist on the class. The return value is the type description provider that was used to add the attributes. This provider can later be passed to the method when the added attributes are no longer needed. ]]> @@ -301,7 +301,7 @@ method adds an editor table for the given editor base type. Typically, editors are specified as metadata on a component. However, if no metadata for a requested editor base type can be found on the component, the associated will search an editor table for the editor type, if one can be found. Once an editor table has been added to a type descriptor, it cannot be removed and is owned by the type descriptor. The type descriptor may freely make modifications to this table. + The method adds an editor table for the given editor base type. Typically, editors are specified as metadata on a component. However, if no metadata for a requested editor base type can be found on the component, the associated will search an editor table for the editor type, if one can be found. Once an editor table has been added to a type descriptor, it cannot be removed and is owned by the type descriptor. The type descriptor may freely make modifications to this table. The format for an editor table uses data types as keys and editors as values. The value portion of an entry in the table represents an editor instance. It can have one of three values. If it contains a string, the type descriptor will assume this is a fully qualified name of a type, and then load the type for the object. If it contains a type, an instance of this type will be created to obtain an editor. Finally, the value portion may contain an actual editor instance. If the type descriptor resolves an editor to an instance, it will store the instance back into the table for future use. @@ -375,18 +375,18 @@ method adds a type description provider that supplies type information for a single instance of a component. If a provider is added by this method, the provider's method will not be called because the instance already exists. + The method adds a type description provider that supplies type information for a single instance of a component. If a provider is added by this method, the provider's method will not be called because the instance already exists. This method does not maintain a hard reference to the component, so it does not prevent the component from finalizing. - It is possible to add multiple type description providers for the same type or object. If this occurs, the first type description provider encountered that provides type information will be used exclusively. Since type information providers are stored in a stack, the last provider added will be the first one queried. This behavior enables the and methods to be used to push and pop type description providers as required for particular scenarios. + It is possible to add multiple type description providers for the same type or object. If this occurs, the first type description provider encountered that provides type information will be used exclusively. Since type information providers are stored in a stack, the last provider added will be the first one queried. This behavior enables the and methods to be used to push and pop type description providers as required for particular scenarios. - If successful, this method calls the method on the `instance` parameter. + If successful, this method calls the method on the `instance` parameter. > [!NOTE] -> The two versions of this method produce results with different scopes. The method that takes an parameter affects only that single instance of the component specified. In contrast, the other overload, which takes a parameter, affects all instances of the component described by that type. +> The two versions of this method produce results with different scopes. The method that takes an parameter affects only that single instance of the component specified. In contrast, the other overload, which takes a parameter, affects all instances of the component described by that type. - Use the method if you need to call from partially trusted code. + Use the method if you need to call from partially trusted code. ]]> @@ -450,21 +450,21 @@ method adds a type description provider that supplies type information for the specified class, derived classes, and all instances of these types. + The method adds a type description provider that supplies type information for the specified class, derived classes, and all instances of these types. > [!NOTE] > The `type` parameter can be any type, including an interface. For example, to provide custom type and instance information for all components, you would specify `typeof(IComponent)`. Passing `typeof(object)` will call the provider to supply type information for all types. This method does not maintain a hard reference to any object, so it does not prevent objects from finalizing. - It is possible to add multiple type description providers for the same type or object. If this occurs, the first type description provider encountered that provides type information will be used exclusively. Because type information providers are stored in a stack, the last provider added will be the first one queried. This behavior enables the and methods to be used to push and pop type description providers as required for particular scenarios. + It is possible to add multiple type description providers for the same type or object. If this occurs, the first type description provider encountered that provides type information will be used exclusively. Because type information providers are stored in a stack, the last provider added will be the first one queried. This behavior enables the and methods to be used to push and pop type description providers as required for particular scenarios. - If successful, this method calls the method on the `type` parameter. + If successful, this method calls the method on the `type` parameter. > [!NOTE] -> The two versions of this method produce results with different scopes. The method that takes an parameter affects only that single instance of the component specified. In contrast, the other overload, which takes a parameter, affects all instances of the component described by that type. +> The two versions of this method produce results with different scopes. The method that takes an parameter affects only that single instance of the component specified. In contrast, the other overload, which takes a parameter, affects all instances of the component described by that type. - Use the method if you need to call from partially trusted code. + Use the method if you need to call from partially trusted code. ]]> @@ -538,7 +538,7 @@ ## Remarks This method can be called from partially trusted code. If is defined, the caller can register a provider for the specified instance if its type is also partially trusted. - Use the method if you do not need to call from partially trusted code. + Use the method if you do not need to call from partially trusted code. ]]> @@ -600,7 +600,7 @@ ## Remarks This method can be called from partially trusted code. If is defined, the caller can register a provider for the specified type if it is also partially trusted. - Use the method if you do not need to call from partially trusted code. + Use the method if you do not need to call from partially trusted code. ]]> @@ -740,9 +740,9 @@ property returns a type that can be passed to the method to define a type description provider for COM types. + The property returns a type that can be passed to the method to define a type description provider for COM types. - The property and other members in this class replace the functionality in the obsolete interface. To implement a mapping layer between a COM object and , add a to handle type . + The property and other members in this class replace the functionality in the obsolete interface. To implement a mapping layer between a COM object and , add a to handle type . ]]> @@ -803,7 +803,7 @@ method creates an association between a primary and a secondary object. Once an association is created, a designer or other filtering mechanism can add properties that route to either object into the primary object's property set. When a property invocation is made against the primary object, the method will be called to resolve the actual object instance that is related to its type parameter. + The method creates an association between a primary and a secondary object. Once an association is created, a designer or other filtering mechanism can add properties that route to either object into the primary object's property set. When a property invocation is made against the primary object, the method will be called to resolve the actual object instance that is related to its type parameter. A is used to maintain the association between the primary and secondary object; therefore, this method does not prevent either object from being finalized and reclaimed by garbage collection. @@ -1128,7 +1128,7 @@ method will search for a that is associated with the specified `objectType` data type. This method first tries to obtain a type description provider from the `provider` parameter. If this fails, it searches its own internal tables for a provider (these entries were created through previous calls to ). If it finds a provider, this method will delegate the creation call to that object. + The method will search for a that is associated with the specified `objectType` data type. This method first tries to obtain a type description provider from the `provider` parameter. If this fails, it searches its own internal tables for a provider (these entries were created through previous calls to ). If it finds a provider, this method will delegate the creation call to that object. ]]> @@ -1371,7 +1371,7 @@ method, then the method returns the correct secondary object to invoke for the requested type. Otherwise, searches for a compatible designer for `type` and returns the designer if one is found. This method never returns `null`. + If a previous association has been made for the `type` parameter using the method, then the method returns the correct secondary object to invoke for the requested type. Otherwise, searches for a compatible designer for `type` and returns the designer if one is found. This method never returns `null`. A is used to maintain the association between the primary and secondary object; therefore, this method does not prevent either the primary or secondary object from being finalized and reclaimed by garbage collection. @@ -1451,17 +1451,17 @@ method may be dynamically modified from the original component's source listing by extender providers (), filter services (), and attribute filters. + The attributes returned by the method may be dynamically modified from the original component's source listing by extender providers (), filter services (), and attribute filters. - When you define a custom attribute with set to `true`, you must override the property to make it unique. If all instances of your attribute are unique, override to return the object identity of your attribute. If only some instances of your attribute are unique, return a value from that would return equality in those cases. For example, some attributes have a constructor parameter that acts as a unique key. For these attributes, return the value of the constructor parameter from the property. + When you define a custom attribute with set to `true`, you must override the property to make it unique. If all instances of your attribute are unique, override to return the object identity of your attribute. If only some instances of your attribute are unique, return a value from that would return equality in those cases. For example, some attributes have a constructor parameter that acts as a unique key. For these attributes, return the value of the constructor parameter from the property. > [!NOTE] -> The default implementation of returns the type identity regardless of the value of the property. In order to return multiple instances of an attribute from the , your attribute must override the property. +> The default implementation of returns the type identity regardless of the value of the property. In order to return multiple instances of an attribute from the , your attribute must override the property. ## Examples - For an example of this method, see the method. + For an example of this method, see the method. ]]> @@ -1534,12 +1534,12 @@ ## Remarks Call this version of this method only when you do not have an instance of the object. - For attributes with set to `true`, the attribute collection removes duplicate instances. These are instances in which the property returns equal values. + For attributes with set to `true`, the attribute collection removes duplicate instances. These are instances in which the property returns equal values. - When you define a custom attribute with set to `true`, you must override the property to make it unique. If all instances of your attribute are unique, override to return the object identity of your attribute. If only some instances of your attribute are unique, return a value from that would return equality in those cases. For example, some attributes have a constructor parameter that acts as a unique key. For these attributes, return the value of the constructor parameter from the property. + When you define a custom attribute with set to `true`, you must override the property to make it unique. If all instances of your attribute are unique, override to return the object identity of your attribute. If only some instances of your attribute are unique, return a value from that would return equality in those cases. For example, some attributes have a constructor parameter that acts as a unique key. For these attributes, return the value of the constructor parameter from the property. > [!NOTE] -> The default implementation of returns the type identity regardless of the value of the property. In order to return multiple instances of an attribute from the , your attribute must override the property. +> The default implementation of returns the type identity regardless of the value of the property. In order to return multiple instances of an attribute from the , your attribute must override the property. ]]> @@ -1612,12 +1612,12 @@ method may be dynamically modified from the original components source listing by extender providers (), filter services (), and attribute filters. + The attributes returned by the method may be dynamically modified from the original components source listing by extender providers (), filter services (), and attribute filters. - When you define a custom attribute with set to `true`, you must override the property to make it unique. If all instances of your attribute are unique, override to return the object identity of your attribute. If only some instances of your attribute are unique, return a value from that would return equality in those cases. For example, some attributes have a constructor parameter that acts as a unique key. For these attributes, return the value of the constructor parameter from the property. + When you define a custom attribute with set to `true`, you must override the property to make it unique. If all instances of your attribute are unique, override to return the object identity of your attribute. If only some instances of your attribute are unique, return a value from that would return equality in those cases. For example, some attributes have a constructor parameter that acts as a unique key. For these attributes, return the value of the constructor parameter from the property. > [!NOTE] -> The default implementation of returns the type identity regardless of the value of the property. In order to return multiple instances of an attribute from the , your attribute must override the property. +> The default implementation of returns the type identity regardless of the value of the property. In order to return multiple instances of an attribute from the , your attribute must override the property. ]]> @@ -1707,7 +1707,7 @@ ## Remarks Typically, this method returns the full name for the `component` parameter type. For example, the class name for a button is "System.Windows.Forms.Button". If `component` implements , it can return an alternate name. - This method is equivalent to the overloaded method with a second parameter of `false`. + This method is equivalent to the overloaded method with a second parameter of `false`. ]]> @@ -1959,7 +1959,7 @@ ## Remarks Typically, this method returns the name for the site of the component, if one exists. For example, the class name for a button is "System.Windows.Forms.Button". - This method is equivalent to the overloaded method with a second parameter of `false`. + This method is equivalent to the overloaded method with a second parameter of `false`. This method is used at design time to retrieve the name of an instance of a component. @@ -2130,7 +2130,7 @@ ## Remarks This method locates an appropriate type converter by looking for a . If it cannot find a , it traverses the base class hierarchy of the class until it finds a primitive type. - This method is equivalent to the overloaded method with a second parameter of `false`. + This method is equivalent to the overloaded method with a second parameter of `false`. @@ -2439,7 +2439,7 @@ method with a second parameter of `false`. + This method is equivalent to the overloaded method with a second parameter of `false`. ]]> @@ -3785,7 +3785,7 @@ method will return the same value as the method. However, if the component resides in a nested container or has other nested semantics, it may return a different fully qualified name. + In many cases, the method will return the same value as the method. However, if the component resides in a nested container or has other nested semantics, it may return a different fully qualified name. ]]> @@ -3873,7 +3873,7 @@ ## Examples - The following code example demonstrates the use of the method to access the properties of a control. This code example is part of a larger example provided for the class. + The following code example demonstrates the use of the method to access the properties of a control. This code example is part of a larger example provided for the class. :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/TypeDescriptor/GetProperties/Form1.cs" id="Snippet8"::: :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/TypeDescriptor/GetProperties/Form1.vb" id="Snippet8"::: @@ -4052,7 +4052,7 @@ - If an instance is specified and it is the default property, it is included in the returned array even if there is no instance of the in the property. -- If `attributes` has a default attribute, the method matches the case when the property does not have the attribute applied. +- If `attributes` has a default attribute, the method matches the case when the property does not have the attribute applied. If `component` is `null`, an empty collection is returned. @@ -4061,7 +4061,7 @@ ## Examples - The following code example demonstrates how to implement the method. This code example is part of a larger example provided for the class. + The following code example demonstrates how to implement the method. This code example is part of a larger example provided for the class. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/PropertyTabExample/CPP/class1.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/PropertyTabAttribute/Overview/class1.cs" id="Snippet2"::: @@ -4249,7 +4249,7 @@ - If an instance is specified and it is the default property, it is included in the returned array even if there is no instance of the in the property. -- If `attributes` has a default attribute, the method matches the case when the property does not have the attribute applied. +- If `attributes` has a default attribute, the method matches the case when the property does not have the attribute applied. If the `componentType` parameter is `null`, an empty collection is returned. @@ -4258,7 +4258,7 @@ ## Examples - The following code example demonstrates how to implement the method. This code example is part of a larger example provided for the class. + The following code example demonstrates how to implement the method. This code example is part of a larger example provided for the class. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/PropertyTabExample/CPP/class1.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/PropertyTabAttribute/Overview/class1.cs" id="Snippet2"::: @@ -4355,7 +4355,7 @@ - If an instance is specified and it is the default property, it is included in the returned array even if there is no instance of the in the property. -- If `attributes` has a default attribute, the method matches the case when the property does not have the attribute applied. +- If `attributes` has a default attribute, the method matches the case when the property does not have the attribute applied. If the `component` parameter is `null`, an empty collection is returned. @@ -4498,7 +4498,7 @@ method will always return a type description provider. Even the default implementation is built on a . + The method will always return a type description provider. Even the default implementation is built on a . ]]> @@ -4565,7 +4565,7 @@ method will always return a type description provider. Even the default implementation is built on a . + The method will always return a type description provider. Even the default implementation is built on a . ]]> @@ -4646,7 +4646,7 @@ method is a low-level version of the method. is typically used to perform standard reflection against an object when no custom type descriptor can be located for it. + The method is a low-level version of the method. is typically used to perform standard reflection against an object when no custom type descriptor can be located for it. ]]> @@ -4724,7 +4724,7 @@ method is a low-level version of the method. is typically used to perform standard reflection against a class when no custom type descriptor can be located for it. + The method is a low-level version of the method. is typically used to perform standard reflection against a class when no custom type descriptor can be located for it. ]]> @@ -4784,7 +4784,7 @@ property gets a object that you can pass to the methods to define a type description provider for interface types. + The property gets a object that you can pass to the methods to define a type description provider for interface types. ]]> @@ -4855,7 +4855,7 @@ ## Remarks Properties and events are cached by for speed. Typically, they are constant for the lifetime of an object. However, extender providers and designers can change the set of properties on an object. If they do, they should call this method to clear the property and event descriptors of the object. This method is used only at design time. It is not used during run time. - This method also raises a event when the properties or events of a component change. This event is only raised if there was a prior call to the or method that cached the information. + This method also raises a event when the properties or events of a component change. This event is only raised if there was a prior call to the or method that cached the information. @@ -4918,7 +4918,7 @@ ## Remarks Properties and events are cached by for speed. Typically, they are constant for the lifetime of an object. However, extender providers and designers can change the set of properties on an object. If they do, they can call this method to clear the property and event descriptors of the object. This method is used only at design time. It is not used during run time. - Before you make a call to the method to clear the cache, you need to call the method for the specific assembly to cache the information first. + Before you make a call to the method to clear the cache, you need to call the method for the specific assembly to cache the information first. This method also raises a event to notify all classes that want to be notified when the property set of a component changes. @@ -4981,7 +4981,7 @@ ## Remarks Properties and events are cached by for speed. Typically, they are constant for the lifetime of an object. However, extender providers and designers can change the set of properties on an object. If they do, they can call this method to clear the property and event descriptors of the object. This method is used only at design time. It is not used during run time. - Before you make a call to the method to clear the cache, you need to call the method for the specific module to cache the information first. + Before you make a call to the method to clear the cache, you need to call the method for the specific module to cache the information first. This method also raises a event to notify all classes that want to be notified when the property set of a component changes. @@ -5046,7 +5046,7 @@ Properties and events are cached by for speed. Typically, they are constant for the lifetime of an object. However, extender providers and designers can change the set of properties on an object. If they do, they can call this method to clear the property and event descriptors of the object. This method is used only at design time. It is not used during run time. - This method also raises a event when the properties or events of a component change. This event is only raised if there was a prior call to the or method that cached the information. + This method also raises a event when the properties or events of a component change. This event is only raised if there was a prior call to the or method that cached the information. ]]> @@ -5211,7 +5211,7 @@ method removes an association between two objects formed by the method. + The method removes an association between two objects formed by the method. A is used to maintain the association between the primary and secondary object; therefore, this method does not influence when either object is finalized or reclaimed by garbage collection. @@ -5274,7 +5274,7 @@ method removes all associations between a primary object and all of its secondary objects, created by calls to the method. + The method removes all associations between a primary object and all of its secondary objects, created by calls to the method. A is used to maintain the association between the primary and secondary object; therefore, this method does not influence when either the primary of secondary objects are finalized or reclaimed by garbage collection. @@ -5350,9 +5350,9 @@ method. Removing a provider causes a event to be raised for the associated object. + This method removes a type description provider previously added with the method. Removing a provider causes a event to be raised for the associated object. - Use the method if you need to call from partially trusted code. + Use the method if you need to call from partially trusted code. ]]> @@ -5416,9 +5416,9 @@ method. Removing a provider causes a event to be raised for the associated type. + This method removes a type description provider previously added with the method. Removing a provider causes a event to be raised for the associated type. - Use the method if you need to call from partially trusted code. + Use the method if you need to call from partially trusted code. ]]> @@ -5491,11 +5491,11 @@ method. Removing a provider causes a event to be raised for the associated object. + This method removes a type description provider previously added with the method. Removing a provider causes a event to be raised for the associated object. This method can be called from partially trusted code. If is defined, the caller can register a provider for the specified instance if its type is also partially trusted. - Use the method if you do not need to call from partially trusted code. + Use the method if you do not need to call from partially trusted code. ]]> @@ -5555,11 +5555,11 @@ method. Removing a provider causes a event to be raised for the associated type. + This method removes a type description provider previously added with the method. Removing a provider causes a event to be raised for the associated type. This method can be called from partially trusted code. If is defined, the caller can unregister a provider for the specified type if it is also partially trusted. - Use the method if you do not need to call from partially trusted code. + Use the method if you do not need to call from partially trusted code. ]]> diff --git a/xml/System.ComponentModel/TypeListConverter.xml b/xml/System.ComponentModel/TypeListConverter.xml index a040039aa12..1fdaa340c7b 100644 --- a/xml/System.ComponentModel/TypeListConverter.xml +++ b/xml/System.ComponentModel/TypeListConverter.xml @@ -62,7 +62,7 @@ For more information about type converters, see the base class and [How to: Implement a Type Converter](https://learn.microsoft.com/previous-versions/visualstudio/visual-studio-2013/ayybcxe5(v=vs.120)). > [!NOTE] -> You should never create an instance of a . Instead, call the method of . For more information, see the examples in the base class. +> You should never create an instance of a . Instead, call the method of . For more information, see the examples in the base class. ]]> @@ -508,7 +508,7 @@ ## Remarks The `context` parameter can be used to extract additional information about the environment this converter is being invoked from. This can be `null`, so always check. Also, properties on the context object can return `null`. - When the list is exclusive, no other values are valid besides the list of standard values the method provides. + When the list is exclusive, no other values are valid besides the list of standard values the method provides. ]]> diff --git a/xml/System.ComponentModel/UInt16Converter.xml b/xml/System.ComponentModel/UInt16Converter.xml index d7f9ab7c203..75d4eb1ab5c 100644 --- a/xml/System.ComponentModel/UInt16Converter.xml +++ b/xml/System.ComponentModel/UInt16Converter.xml @@ -48,25 +48,25 @@ Provides a type converter to convert 16-bit unsigned integer objects to and from other representations. - value type represents unsigned integers with values ranging from 0 to 65535. This data type is not supported in Visual Basic. - + value type represents unsigned integers with values ranging from 0 to 65535. This data type is not supported in Visual Basic. + > [!NOTE] -> You should never create an instance of a . Instead, call the method of . For more information, see the examples in the base class and [How to: Implement a Type Converter](https://learn.microsoft.com/previous-versions/visualstudio/visual-studio-2013/ayybcxe5(v=vs.120)). - - - -## Examples - The following example converts a variable of type to a string and vice versa. - +> You should never create an instance of a . Instead, call the method of . For more information, see the examples in the base class and [How to: Implement a Type Converter](https://learn.microsoft.com/previous-versions/visualstudio/visual-studio-2013/ayybcxe5(v=vs.120)). + + + +## Examples + The following example converts a variable of type to a string and vice versa. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Converters/CPP/converters.cpp" id="Snippet23"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/BooleanConverter/Overview/converters.cs" id="Snippet23"::: - :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/BooleanConverter/Overview/converters.vb" id="Snippet23"::: - + :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/BooleanConverter/Overview/converters.vb" id="Snippet23"::: + ]]> diff --git a/xml/System.ComponentModel/UInt32Converter.xml b/xml/System.ComponentModel/UInt32Converter.xml index c71b1340816..ad878626842 100644 --- a/xml/System.ComponentModel/UInt32Converter.xml +++ b/xml/System.ComponentModel/UInt32Converter.xml @@ -48,25 +48,25 @@ Provides a type converter to convert 32-bit unsigned integer objects to and from various other representations. - value type represents unsigned integers with values ranging from 0 to 4,294,967,295. This data type is not supported in Visual Basic. - + value type represents unsigned integers with values ranging from 0 to 4,294,967,295. This data type is not supported in Visual Basic. + > [!NOTE] -> You should never create an instance of a . Instead, call the method of . For more information, see the examples in the base class and [How to: Implement a Type Converter](https://learn.microsoft.com/previous-versions/visualstudio/visual-studio-2013/ayybcxe5(v=vs.120)). - - - -## Examples - The following example converts a variable of type to a string, and vice versa. - +> You should never create an instance of a . Instead, call the method of . For more information, see the examples in the base class and [How to: Implement a Type Converter](https://learn.microsoft.com/previous-versions/visualstudio/visual-studio-2013/ayybcxe5(v=vs.120)). + + + +## Examples + The following example converts a variable of type to a string, and vice versa. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Converters/CPP/converters.cpp" id="Snippet24"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/BooleanConverter/Overview/converters.cs" id="Snippet24"::: - :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/BooleanConverter/Overview/converters.vb" id="Snippet24"::: - + :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/BooleanConverter/Overview/converters.vb" id="Snippet24"::: + ]]> diff --git a/xml/System.ComponentModel/UInt64Converter.xml b/xml/System.ComponentModel/UInt64Converter.xml index 1e074b5b201..eda26760a29 100644 --- a/xml/System.ComponentModel/UInt64Converter.xml +++ b/xml/System.ComponentModel/UInt64Converter.xml @@ -48,25 +48,25 @@ Provides a type converter to convert 64-bit unsigned integer objects to and from other representations. - value type represents unsigned integers with values ranging from 0 to 184,467,440,737,095,551,615. This data type is not supported in Visual Basic. - + value type represents unsigned integers with values ranging from 0 to 184,467,440,737,095,551,615. This data type is not supported in Visual Basic. + > [!NOTE] -> You should never create an instance of a . Instead, call the method of . For more information, see the examples in the base class and [How to: Implement a Type Converter](https://learn.microsoft.com/previous-versions/visualstudio/visual-studio-2013/ayybcxe5(v=vs.120)). - - - -## Examples - The following code example converts a variable of type to a string, and vice versa. - +> You should never create an instance of a . Instead, call the method of . For more information, see the examples in the base class and [How to: Implement a Type Converter](https://learn.microsoft.com/previous-versions/visualstudio/visual-studio-2013/ayybcxe5(v=vs.120)). + + + +## Examples + The following code example converts a variable of type to a string, and vice versa. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Converters/CPP/converters.cpp" id="Snippet25"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/BooleanConverter/Overview/converters.cs" id="Snippet25"::: - :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/BooleanConverter/Overview/converters.vb" id="Snippet25"::: - + :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/BooleanConverter/Overview/converters.vb" id="Snippet25"::: + ]]> diff --git a/xml/System.ComponentModel/Win32Exception.xml b/xml/System.ComponentModel/Win32Exception.xml index e03a68a74f7..9e02032ec88 100644 --- a/xml/System.ComponentModel/Win32Exception.xml +++ b/xml/System.ComponentModel/Win32Exception.xml @@ -78,7 +78,7 @@ to access the numeric representation of the error code associated with this exception. For more information about the error codes, see [Win32 Error Codes](https://learn.microsoft.com/openspecs/windows_protocols/ms-erref/18d8fbe8-a967-4f1c-ae50-99ca8e491d2d). + Win32 error codes are translated from their numeric representations into a system message when they are displayed. Use to access the numeric representation of the error code associated with this exception. For more information about the error codes, see [Win32 Error Codes](https://learn.microsoft.com/openspecs/windows_protocols/ms-erref/18d8fbe8-a967-4f1c-ae50-99ca8e491d2d). @@ -146,7 +146,7 @@ ## Remarks The detailed description of the error will be determined by the Win32 error message associated with the error. - This constructor uses the method of to get its error code. + This constructor uses the method of to get its error code. ]]> diff --git a/xml/System.Composition.Hosting.Core/ExportDescriptorProvider.xml b/xml/System.Composition.Hosting.Core/ExportDescriptorProvider.xml index 974bbf92269..b20757f8883 100644 --- a/xml/System.Composition.Hosting.Core/ExportDescriptorProvider.xml +++ b/xml/System.Composition.Hosting.Core/ExportDescriptorProvider.xml @@ -95,7 +95,7 @@ Instances of this class are not required to be safe for concurrent access by mul ## Remarks -A provider is only queried once for each unique export key. The descriptor accessor can only be queried immediately if the descriptor being promised is an adapter, such as . Otherwise, dependencies should only be queried within execution of the function provided to the . The actual descriptors provided by this method must not close over or reference any aspect of the dependency/promise structure, as this would prevent the structure from being garbage collected. +A provider is only queried once for each unique export key. The descriptor accessor can only be queried immediately if the descriptor being promised is an adapter, such as . Otherwise, dependencies should only be queried within execution of the function provided to the . The actual descriptors provided by this method must not close over or reference any aspect of the dependency/promise structure, as this would prevent the structure from being garbage collected. ]]> diff --git a/xml/System.Configuration.Install/AssemblyInstaller.xml b/xml/System.Configuration.Install/AssemblyInstaller.xml index 2e74ba5335b..abc639af19a 100644 --- a/xml/System.Configuration.Install/AssemblyInstaller.xml +++ b/xml/System.Configuration.Install/AssemblyInstaller.xml @@ -21,7 +21,7 @@ is created by invoking the constructor. The properties of this object are set and the and methods are called to install the `MyAssembly.exe` assembly. + In the following example, an is created by invoking the constructor. The properties of this object are set and the and methods are called to install the `MyAssembly.exe` assembly. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/AssemblyInstaller/CPP/assemblyinstaller.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Configuration.Install/AssemblyInstaller/Overview/assemblyinstaller.cs" id="Snippet1"::: @@ -60,9 +60,9 @@ constructor and the and methods of the class. + The following example demonstrates the constructor and the and methods of the class. - An is created by invoking the constructor. The properties of this object are set and the and methods are called to install the `MyAssembly_Install.exe` assembly. + An is created by invoking the constructor. The properties of this object are set and the and methods are called to install the `MyAssembly_Install.exe` assembly. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/AssemblyInstaller_Install/CPP/assemblyinstaller_install.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Configuration.Install/AssemblyInstaller/.ctor/assemblyinstaller_install.cs" id="Snippet2"::: @@ -132,7 +132,7 @@ is created by invoking the constructor with the assembly to install and the command line argument array as parameters. + In the following example, an is created by invoking the constructor with the assembly to install and the command line argument array as parameters. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/AssemblyInstaller_Uninstall/CPP/assemblyinstaller_uninstall.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Configuration.Install/AssemblyInstaller/.ctor/assemblyinstaller_uninstall.cs" id="Snippet1"::: @@ -195,7 +195,7 @@ method determines whether the specified assembly can be installed. To avoid an exception being thrown, the file must meet the following criteria: + The method determines whether the specified assembly can be installed. To avoid an exception being thrown, the file must meet the following criteria: - The file exists. @@ -213,7 +213,7 @@ ## Examples - In the following example, the method is applied to both an existent and nonexistent assembly and the results of the call are displayed to the console. + In the following example, the method is applied to both an existent and nonexistent assembly and the results of the call are displayed to the console. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/AssemblyInstaller_CheckIfInstallable/CPP/assemblyinstaller_checkifinstallable.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Configuration.Install/AssemblyInstaller/CheckIfInstallable/assemblyinstaller_checkifinstallable.cs" id="Snippet1"::: @@ -286,16 +286,16 @@ methods of all the installers in this instance's succeed. This method then calls the method of each installer in the collection. + This method is called only if the methods of all the installers in this instance's succeed. This method then calls the method of each installer in the collection. - Store any information that you might need to do a correct uninstall operation in the saved-state , which is passed to the method. + Store any information that you might need to do a correct uninstall operation in the saved-state , which is passed to the method. ## Examples - The following example demonstrates the constructor and the and methods of the class. + The following example demonstrates the constructor and the and methods of the class. - An class is created by invoking the constructor. The properties of this object are set and the and methods are called to install the `MyAssembly_Install.exe` assembly. + An class is created by invoking the constructor. The properties of this object are set and the and methods are called to install the `MyAssembly_Install.exe` assembly. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/AssemblyInstaller_Install/CPP/assemblyinstaller_install.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Configuration.Install/AssemblyInstaller/.ctor/assemblyinstaller_install.cs" id="Snippet2"::: @@ -399,14 +399,14 @@ method of each installer contained in the property of this instance. The object specified by the `savedState` parameter is updated to reflect the status of the installation after the contained installers have run. If all the methods succeed, the method is called. Otherwise, the method is called. + This method calls the method of each installer contained in the property of this instance. The object specified by the `savedState` parameter is updated to reflect the status of the installation after the contained installers have run. If all the methods succeed, the method is called. Otherwise, the method is called. ## Examples - The following example demonstrates the constructor and the and methods of the class. + The following example demonstrates the constructor and the and methods of the class. - An object of the class is created by invoking the constructor. The properties of this object are set and the and methods are called to install the 'MyAssembly_Install.exe' assembly. + An object of the class is created by invoking the constructor. The properties of this object are set and the and methods are called to install the 'MyAssembly_Install.exe' assembly. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/AssemblyInstaller_Install/CPP/assemblyinstaller_install.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Configuration.Install/AssemblyInstaller/.ctor/assemblyinstaller_install.cs" id="Snippet2"::: @@ -461,7 +461,7 @@ is created by invoking the constructor. The properties of this object are set. + In the following example, an is created by invoking the constructor. The properties of this object are set. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/AssemblyInstaller_Rollback/CPP/assemblyinstaller_rollback.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Configuration.Install/AssemblyInstaller/CommandLine/assemblyinstaller_rollback.cs" id="Snippet2"::: @@ -498,12 +498,12 @@ method is called if the method of this instance or of any installer in the installer collection fails to run correctly. Any exceptions generated by calling the method of an installer in the collection are ignored, and the rollback of the other installers continues. + A rollback restores the computer to the state it was in before the installation occurred. The method is called if the method of this instance or of any installer in the installer collection fails to run correctly. Any exceptions generated by calling the method of an installer in the collection are ignored, and the rollback of the other installers continues. ## Examples - In the following sample, the method is called to undo the install process on the specified assembly. + In the following sample, the method is called to undo the install process on the specified assembly. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/AssemblyInstaller_Rollback/CPP/assemblyinstaller_rollback.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Configuration.Install/AssemblyInstaller/CommandLine/assemblyinstaller_rollback.cs" id="Snippet1"::: @@ -567,15 +567,15 @@ method fails for one of the installers in the collection, it is still called for the remaining installers. A failed uninstallation does not roll back the computer to its pre-uninstallation state. + Call this method to remove a previously completed installation. If the method fails for one of the installers in the collection, it is still called for the remaining installers. A failed uninstallation does not roll back the computer to its pre-uninstallation state. > [!NOTE] -> Although the and methods save the state of the computer after the installations, the file containing the from the `savedState` parameter might have been deleted at some point after the installation was complete. If the file is deleted, the `savedState` parameter is `null`. +> Although the and methods save the state of the computer after the installations, the file containing the from the `savedState` parameter might have been deleted at some point after the installation was complete. If the file is deleted, the `savedState` parameter is `null`. ## Examples - In the following sample, the method is called after installing and committing the assembly passed as the parameter to the constructor. + In the following sample, the method is called after installing and committing the assembly passed as the parameter to the constructor. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/AssemblyInstaller_Uninstall/CPP/assemblyinstaller_uninstall.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Configuration.Install/AssemblyInstaller/.ctor/assemblyinstaller_uninstall.cs" id="Snippet2"::: @@ -637,12 +637,12 @@ to `false` prevents the new file from being created. + Setting this property to `true` creates a new file named "{Assembly name}.InstallLog" to log messages for this assembly. Setting to `false` prevents the new file from being created. ## Examples - In the following example, an is created by invoking the constructor. The property of this object is set to `true` and the method is invoked on the `MyAssembly_HelpText.exe` assembly. Due to this, the log messages are displayed on the console. + In the following example, an is created by invoking the constructor. The property of this object is set to `true` and the method is invoked on the `MyAssembly_HelpText.exe` assembly. Due to this, the log messages are displayed on the console. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/AssemblyInstaller_HelpText/CPP/assemblyinstaller_helptext.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Configuration.Install/AssemblyInstaller/HelpText/assemblyinstaller_helptext.cs" id="Snippet1"::: diff --git a/xml/System.Configuration.Install/ComponentInstaller.xml b/xml/System.Configuration.Install/ComponentInstaller.xml index a2504021311..39a5759dd3c 100644 --- a/xml/System.Configuration.Install/ComponentInstaller.xml +++ b/xml/System.Configuration.Install/ComponentInstaller.xml @@ -66,20 +66,20 @@ The component to copy from. When overridden in a derived class, copies all the properties that are required at install time from the specified component. - . It also checks whether the can perform the same kind of installation as the . - + . It also checks whether the can perform the same kind of installation as the . + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/ComponentInstaller_CopyFromComponent/CPP/componentinstaller_copyfromcomponent.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Configuration.Install/ComponentInstaller/CopyFromComponent/componentinstaller_copyfromcomponent.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Configuration.Install/ComponentInstaller/CopyFromComponent/componentinstaller_copyfromcomponent.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.Configuration.Install/ComponentInstaller/CopyFromComponent/componentinstaller_copyfromcomponent.vb" id="Snippet1"::: + ]]> @@ -110,20 +110,20 @@ if this installer and the installer specified by the parameter install the same object; otherwise, . - returns `true` only if this installer and the installer specified by the `otherInstaller` parameter install the same object. In such a case, calling the or method on either installer results in the same system state. - - - -## Examples - The following example defines a class `MyInstallClass`, which creates the event log and copies the properties of the event log component to the object. It also checks whether object can handle the same kind of installation as . - + returns `true` only if this installer and the installer specified by the `otherInstaller` parameter install the same object. In such a case, calling the or method on either installer results in the same system state. + + + +## Examples + The following example defines a class `MyInstallClass`, which creates the event log and copies the properties of the event log component to the object. It also checks whether object can handle the same kind of installation as . + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/ComponentInstaller_CopyFromComponent/CPP/componentinstaller_copyfromcomponent.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Configuration.Install/ComponentInstaller/CopyFromComponent/componentinstaller_copyfromcomponent.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/System.Configuration.Install/ComponentInstaller/CopyFromComponent/componentinstaller_copyfromcomponent.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/System.Configuration.Install/ComponentInstaller/CopyFromComponent/componentinstaller_copyfromcomponent.vb" id="Snippet2"::: + ]]> diff --git a/xml/System.Configuration.Install/InstallContext.xml b/xml/System.Configuration.Install/InstallContext.xml index 5a2d922a0d7..77d52c292ac 100644 --- a/xml/System.Configuration.Install/InstallContext.xml +++ b/xml/System.Configuration.Install/InstallContext.xml @@ -23,20 +23,20 @@ ## Remarks Typically, an is created by an installation executable, such as InstallUtil.exe, that installs assemblies. The installation program invokes the constructor, passing it the default log-file path and command-line parameters. - Prior to calling its , , , or methods, the installation program sets the property of an to the instance of . Before calling these methods, an that contains an installer collection in the property sets the property of each contained installer. + Prior to calling its , , , or methods, the installation program sets the property of an to the instance of . Before calling these methods, an that contains an installer collection in the property sets the property of each contained installer. - The property contains a parsed version of the command line that is entered to run the installation executable. The property contains information such as the path to a log file, whether to display log information on the console, and whether to show a user interface during the installation. Call the method to find out whether a command-line parameter is `true`. + The property contains a parsed version of the command line that is entered to run the installation executable. The property contains information such as the path to a log file, whether to display log information on the console, and whether to show a user interface during the installation. Call the method to find out whether a command-line parameter is `true`. - Use the method to write status messages to the installation log file and the console. + Use the method to write status messages to the installation log file and the console. ## Examples - The following example demonstrates the constructors, the property and the and methods of the class. + The following example demonstrates the constructors, the property and the and methods of the class. - When the method of the installer is called, it checks for parameters from the command line. Depending on that, it displays the progress messages onto the console and also saves it to the specified log file. + When the method of the installer is called, it checks for parameters from the command line. Depending on that, it displays the progress messages onto the console and also saves it to the specified log file. - When the program is invoked without any arguments, an empty is created. When "/LogFile" and "/LogtoConsole" are specified, the is created by passing the respective arguments to . + When the program is invoked without any arguments, an empty is created. When "/LogFile" and "/LogtoConsole" are specified, the is created by passing the respective arguments to . :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/InstallContext_InstallContext/CPP/installcontext_installcontext.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Configuration.Install/InstallContext/Overview/installcontext_installcontext.cs" id="Snippet1"::: @@ -130,7 +130,7 @@ ## Examples This example is an excerpt of the example in the class overview of class. - When "/LogFile" and "/LogtoConsole" are specified, the is created by passing the respective arguments to . + When "/LogFile" and "/LogtoConsole" are specified, the is created by passing the respective arguments to . :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/InstallContext_InstallContext/CPP/installcontext_installcontext.cpp" id="Snippet3"::: :::code language="csharp" source="~/snippets/csharp/System.Configuration.Install/InstallContext/Overview/installcontext_installcontext.cs" id="Snippet3"::: @@ -181,7 +181,7 @@ ## Examples This example is an excerpt of the sample in the class overview of the class. - It uses the method to find out if the `LogtoConsole` parameter has been set. If `yes`, it will then use the method to write status messages to the installation log file and the console. + It uses the method to find out if the `LogtoConsole` parameter has been set. If `yes`, it will then use the method to write status messages to the installation log file and the console. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/InstallContext_InstallContext/CPP/installcontext_installcontext.cpp" id="Snippet4"::: :::code language="csharp" source="~/snippets/csharp/System.Configuration.Install/InstallContext/Overview/installcontext_installcontext.cs" id="Snippet4"::: @@ -219,14 +219,14 @@ method. Text written to the log file will not be seen by the user unless InstallUtil.exe is used to run the installation and "/LogToConsole= true" is specified in the command line. + An installer can call this method to write progress or other status information to the log file. If the command-line parameters specify that a user interface should be displayed, the installer should show message boxes or make queries in addition to calling the method. Text written to the log file will not be seen by the user unless InstallUtil.exe is used to run the installation and "/LogToConsole= true" is specified in the command line. ## Examples This example is an excerpt of the example in the class overview of class. - It uses the method to find out if the `LogtoConsole` parameter has been set. If `yes`, it will then use the method to write status messages to the installation log file and the console. + It uses the method to find out if the `LogtoConsole` parameter has been set. If `yes`, it will then use the method to write status messages to the installation log file and the console. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/InstallContext_InstallContext/CPP/installcontext_installcontext.cpp" id="Snippet4"::: :::code language="csharp" source="~/snippets/csharp/System.Configuration.Install/InstallContext/Overview/installcontext_installcontext.cs" id="Snippet4"::: @@ -268,7 +268,7 @@ ## Examples This example is an excerpt of the example in the class overview of class. - The sample retrieves the property to see if any command line argument has been entered by the user. It also uses the method to find out if the `LogtoConsole` parameter has been set. If `yes`, it will then use the method to write status messages to the installation log file and the console. + The sample retrieves the property to see if any command line argument has been entered by the user. It also uses the method to find out if the `LogtoConsole` parameter has been set. If `yes`, it will then use the method to write status messages to the installation log file and the console. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/InstallContext_InstallContext/CPP/installcontext_installcontext.cpp" id="Snippet6"::: :::code language="csharp" source="~/snippets/csharp/System.Configuration.Install/InstallContext/Overview/installcontext_installcontext.cs" id="Snippet6"::: diff --git a/xml/System.Configuration.Install/InstallEventArgs.xml b/xml/System.Configuration.Install/InstallEventArgs.xml index 34f58a9ea92..ed5ce4da57e 100644 --- a/xml/System.Configuration.Install/InstallEventArgs.xml +++ b/xml/System.Configuration.Install/InstallEventArgs.xml @@ -26,9 +26,9 @@ ## Examples - The following example demonstrates the constructors and the property of the class. + The following example demonstrates the constructors and the property of the class. - There are two new events called `BeforeCommit` and `AfterCommit`. The handlers of these events are invoked from the protected methods named `OnBeforeCommit` and `OnAfterCommit` respectively. These events are raised when the method is called. + There are two new events called `BeforeCommit` and `AfterCommit`. The handlers of these events are invoked from the protected methods named `OnBeforeCommit` and `OnAfterCommit` respectively. These events are raised when the method is called. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/InstallEventArgs/CPP/installeventargs.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Configuration.Install/InstallEventArgs/Overview/installeventargs.cs" id="Snippet1"::: @@ -81,9 +81,9 @@ constructors and the property of the class. + The following example demonstrates the constructors and the property of the class. - There are two new events called `BeforeCommit` and `AfterCommit`. The handlers of these events are invoked from the protected methods named `OnBeforeCommit` and `OnAfterCommit` respectively. These events are raised when the method is called. + There are two new events called `BeforeCommit` and `AfterCommit`. The handlers of these events are invoked from the protected methods named `OnBeforeCommit` and `OnAfterCommit` respectively. These events are raised when the method is called. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/InstallEventArgs/CPP/installeventargs.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Configuration.Install/InstallEventArgs/Overview/installeventargs.cs" id="Snippet1"::: @@ -118,9 +118,9 @@ constructors and the property of the class. + The following example demonstrates the constructors and the property of the class. - There are two new events called `BeforeCommit` and `AfterCommit`. The handlers of these events are invoked from the protected methods named `OnBeforeCommit` and `OnAfterCommit` respectively. These events are raised when the method is called. + There are two new events called `BeforeCommit` and `AfterCommit`. The handlers of these events are invoked from the protected methods named `OnBeforeCommit` and `OnAfterCommit` respectively. These events are raised when the method is called. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/InstallEventArgs/CPP/installeventargs.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Configuration.Install/InstallEventArgs/Overview/installeventargs.cs" id="Snippet1"::: @@ -156,9 +156,9 @@ constructors and the property of the class. + The following example demonstrates the constructors and the property of the class. - There are two new events called `BeforeCommit` and `AfterCommit`. The handlers of these events are invoked from the protected methods named `OnBeforeCommit` and `OnAfterCommit` respectively. These events are raised when the method is called. + There are two new events called `BeforeCommit` and `AfterCommit`. The handlers of these events are invoked from the protected methods named `OnBeforeCommit` and `OnAfterCommit` respectively. These events are raised when the method is called. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/InstallEventArgs/CPP/installeventargs.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Configuration.Install/InstallEventArgs/Overview/installeventargs.cs" id="Snippet1"::: diff --git a/xml/System.Configuration.Install/InstallException.xml b/xml/System.Configuration.Install/InstallException.xml index 13b74a9e1aa..f49c4dcf6d1 100644 --- a/xml/System.Configuration.Install/InstallException.xml +++ b/xml/System.Configuration.Install/InstallException.xml @@ -24,24 +24,24 @@ The exception that is thrown when an error occurs during the commit, rollback, or uninstall phase of an installation. - constructors, together make up an example showing an assembly having its own installer. The installer is named `MyInstaller`, which has an attribute `RunInstallerAttribute`, indicating that this installer will be invoked by [Installutil.exe (Installer Tool)](/dotnet/framework/tools/installutil-exe-installer-tool). [Installutil.exe (Installer Tool)](/dotnet/framework/tools/installutil-exe-installer-tool) calls the methods , , and . The code in presumes that a file named `FileDoesNotExist.txt` exists before the installation of the assembly can be committed. If the file `FileDoesNotExist.txt` does not exist, raises an . The same is the case with in which an uninstallation will only happen if a file named `FileDoesNotExist.txt` exists. Otherwise it raises an . In , a code fragment is executed, which might raise an exception. If the exception is raised, it is caught and an is raised with that exception being passed to it. - + constructors, together make up an example showing an assembly having its own installer. The installer is named `MyInstaller`, which has an attribute `RunInstallerAttribute`, indicating that this installer will be invoked by [Installutil.exe (Installer Tool)](/dotnet/framework/tools/installutil-exe-installer-tool). [Installutil.exe (Installer Tool)](/dotnet/framework/tools/installutil-exe-installer-tool) calls the methods , , and . The code in presumes that a file named `FileDoesNotExist.txt` exists before the installation of the assembly can be committed. If the file `FileDoesNotExist.txt` does not exist, raises an . The same is the case with in which an uninstallation will only happen if a file named `FileDoesNotExist.txt` exists. Otherwise it raises an . In , a code fragment is executed, which might raise an exception. If the exception is raised, it is caught and an is raised with that exception being passed to it. + > [!NOTE] -> Run this example with the help of Installutil.exe. Type this in the command prompt: - - `Installutil InstallException.exe` - - -or- - - `Installutil /u InstallException.exe` - +> Run this example with the help of Installutil.exe. Type this in the command prompt: + + `Installutil InstallException.exe` + + -or- + + `Installutil /u InstallException.exe` + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/InstallException/CPP/installexception.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Configuration.Install/InstallException/Overview/installexception.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Configuration.Install/InstallException/Overview/installexception.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.Configuration.Install/InstallException/Overview/installexception.vb" id="Snippet1"::: + ]]> @@ -76,20 +76,20 @@ Initializes a new instance of the class. - constructor. It is a part of the example of the class. - - In this example, Installutil.exe calls the method. The code in presumes that a file named `FileDoesNotExist.txt` exists before the installation of the assembly can be committed. If the file `FileDoesNotExist.txt` does not exist, raises an . - + constructor. It is a part of the example of the class. + + In this example, Installutil.exe calls the method. The code in presumes that a file named `FileDoesNotExist.txt` exists before the installation of the assembly can be committed. If the file `FileDoesNotExist.txt` does not exist, raises an . + > [!NOTE] -> This example shows how to use one of the overloaded versions of the constructor. For other examples that might be available, see the individual overload topics. - +> This example shows how to use one of the overloaded versions of the constructor. For other examples that might be available, see the individual overload topics. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/InstallException/CPP/installexception.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Configuration.Install/InstallException/Overview/installexception.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/System.Configuration.Install/InstallException/Overview/installexception.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/System.Configuration.Install/InstallException/Overview/installexception.vb" id="Snippet2"::: + ]]> @@ -115,20 +115,20 @@ The message to display to the user. Initializes a new instance of the class, and specifies the message to display to the user. - constructor. It is a part of the example of the class. - - In this example, Installutil.exe calls the method. Uninstallation will only happen if a file named `FileDoesNotExist.txt` exists. Otherwise it raises an . - + constructor. It is a part of the example of the class. + + In this example, Installutil.exe calls the method. Uninstallation will only happen if a file named `FileDoesNotExist.txt` exists. Otherwise it raises an . + > [!NOTE] -> This example shows how to use one of the overloaded versions of the constructor. For other examples that might be available, see the individual overload topics. - +> This example shows how to use one of the overloaded versions of the constructor. For other examples that might be available, see the individual overload topics. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/InstallException/CPP/installexception.cpp" id="Snippet4"::: :::code language="csharp" source="~/snippets/csharp/System.Configuration.Install/InstallException/Overview/installexception.cs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/System.Configuration.Install/InstallException/Overview/installexception.vb" id="Snippet4"::: - + :::code language="vb" source="~/snippets/visualbasic/System.Configuration.Install/InstallException/Overview/installexception.vb" id="Snippet4"::: + ]]> diff --git a/xml/System.Configuration.Install/Installer.xml b/xml/System.Configuration.Install/Installer.xml index f964fe663fd..83defaab5a1 100644 --- a/xml/System.Configuration.Install/Installer.xml +++ b/xml/System.Configuration.Install/Installer.xml @@ -37,7 +37,7 @@ - Inherit the class. -- Override the , , , and methods. +- Override the , , , and methods. - Add the to your derived class and set it to `true`. @@ -45,20 +45,20 @@ - Invoke the installers. For example, use the InstallUtil.exe to invoke the installers. - The property contains a collection of installers. If this instance of is part of an installer collection, the property is set to the instance that contains the collection. For an example of the use of the collection, see the class. + The property contains a collection of installers. If this instance of is part of an installer collection, the property is set to the instance that contains the collection. For an example of the use of the collection, see the class. - The , , , and methods of the class go through the collection of installers stored in the property, and invokes the corresponding method of each installer. + The , , , and methods of the class go through the collection of installers stored in the property, and invokes the corresponding method of each installer. - The , , , and methods are not always called on the same instance. For example, one instance might be used while installing and committing an application, and then the reference to that instance is released. Later, uninstalling the application creates a reference to a new instance, meaning that the method is called by a different instance of . For this reason, in your derived class, do not save the state of a computer in an installer. Instead, use an that is preserved across calls and passed into your , , , and methods. + The , , , and methods are not always called on the same instance. For example, one instance might be used while installing and committing an application, and then the reference to that instance is released. Later, uninstalling the application creates a reference to a new instance, meaning that the method is called by a different instance of . For this reason, in your derived class, do not save the state of a computer in an installer. Instead, use an that is preserved across calls and passed into your , , , and methods. Two situations illustrate the need to save information in the state-saver . First, suppose that your installer sets a registry key. It should save the key's original value in the . If the installation is rolled back, the original value can be restored. Second, suppose the installer replaces an existing file. Save the existing file in a temporary directory and the location of the new location of the file in the . If the installation is rolled back, the newer file is deleted and replaced by the original from the temporary location. - The property contains information about the installation. For example, information about the location of the log file for the installation, the location of the file to save information required by the method, and the command line that was entered when the installation executable was run. + The property contains information about the installation. For example, information about the location of the log file for the installation, the location of the file to save information required by the method, and the command line that was entered when the installation executable was run. ## Examples - The following example demonstrates the use of the class. It creates a class which inherits from . When is about to complete, event occurs and a message is displayed. To use the class, you must reference the **System.Configuration.Install** assembly in your project. + The following example demonstrates the use of the class. It creates a class which inherits from . When is about to complete, event occurs and a message is displayed. To use the class, you must reference the **System.Configuration.Install** assembly in your project. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/Installer/CPP/installer.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Configuration.Install/Installer/Overview/installer.cs" id="Snippet1"::: @@ -115,7 +115,7 @@ event. It is raised by the method. + The following example demonstrates the event. It is raised by the method. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/Installer_AfterInstall/CPP/installer_afterinstall.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Configuration.Install/Installer/AfterInstall/installer_afterinstall.cs" id="Snippet1"::: @@ -151,7 +151,7 @@ event. It overrides the method and explicitly throws an so that the method is called. When the is completed, the event occurs and a message is displayed. + The following example demonstrates the event. It overrides the method and explicitly throws an so that the method is called. When the is completed, the event occurs and a message is displayed. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/Installer_AfterRollback/CPP/installer_afterrollback.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Configuration.Install/Installer/AfterRollback/installer_afterrollback.cs" id="Snippet1"::: @@ -187,7 +187,7 @@ event. It is raised by the method. + The following example demonstrates the event. It is raised by the method. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/Installer_AfterUninstall/CPP/installer_afteruninstall.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Configuration.Install/Installer/AfterUninstall/installer_afteruninstall.cs" id="Snippet1"::: @@ -223,7 +223,7 @@ event. It is raised by the method. + The following example demonstrates the event. It is raised by the method. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/Installer_BeforeInstall/CPP/installer_beforeinstall.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Configuration.Install/Installer/BeforeInstall/installer_beforeinstall.cs" id="Snippet1"::: @@ -259,7 +259,7 @@ event. It overrides the method and explicitly throws an so that the method is called. When the is complete, the event occurs and a message is displayed. + The following example demonstrates the event. It overrides the method and explicitly throws an so that the method is called. When the is complete, the event occurs and a message is displayed. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/Installer_BeforeRollback/CPP/installer_beforerollback.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Configuration.Install/Installer/BeforeRollback/installer_beforerollback.cs" id="Snippet1"::: @@ -295,7 +295,7 @@ event. It is raised by the method. + The following example demonstrates the event. It is raised by the method. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/Installer_BeforeUninstall/CPP/installer_beforeuninstall.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Configuration.Install/Installer/BeforeUninstall/installer_beforeuninstall.cs" id="Snippet1"::: @@ -335,7 +335,7 @@ method of the class. A class is derived from the base class and the method are overridden. + The following example demonstrates the method of the class. A class is derived from the base class and the method are overridden. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/Installer_Install/CPP/installer_install.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Configuration.Install/Installer/Commit/installer_install.cs" id="Snippet2"::: @@ -382,7 +382,7 @@ event. It is raised by the method. + The following example demonstrates the event. It is raised by the method. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/Installer_Committed1/CPP/installer_committed.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Configuration.Install/Installer/Committed/installer_committed.cs" id="Snippet1"::: @@ -418,7 +418,7 @@ event. It is raised by the method. + The following example demonstrates the event. It is raised by the method. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/Installer_Committing/CPP/installer_committing.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Configuration.Install/Installer/Committing/installer_committing.cs" id="Snippet1"::: @@ -465,16 +465,16 @@ property contains installation information. For example, information about the location of the log file for the installation, the location of the file to save information required by the method, and the command line that was entered when the installation executable was run. + The property contains installation information. For example, information about the location of the log file for the installation, the location of the file to save information required by the method, and the command line that was entered when the installation executable was run. - The program that calls the , , , or methods sets the property with information that the methods need. + The program that calls the , , , or methods sets the property with information that the methods need. If an installer belongs to an installer collection, the parent installer sets the property before calling any of these methods. The parent installer can be accessed through the property. ## Examples - The following example demonstrates the property of the class. The contents of the property contain information about the location of the log file for the installation, the location of the file to save information required by the method, and the command line that was entered when the installation executable was run. These contents are then displayed on the console. + The following example demonstrates the property of the class. The contents of the property contain information about the location of the log file for the installation, the location of the file to save information required by the method, and the command line that was entered when the installation executable was run. These contents are then displayed on the console. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/Installer_Context/CPP/installer_context.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Configuration.Install/Installer/Context/installer_context.cs" id="Snippet1"::: @@ -553,7 +553,7 @@ method of the class. A class is derived from the base class and the method is overridden. + The following example demonstrates the method of the class. A class is derived from the base class and the method is overridden. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/Installer_Install/CPP/installer_install.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Configuration.Install/Installer/Commit/installer_install.cs" id="Snippet1"::: @@ -614,14 +614,14 @@ property contains a collection of installers that install objects needed by this instance to correctly install the component. The , , , and methods of the class go through the collection of installers and invokes the corresponding method of each installer. + The property contains a collection of installers that install objects needed by this instance to correctly install the component. The , , , and methods of the class go through the collection of installers and invokes the corresponding method of each installer. - If this instance of is contained in an installer collection, the property is the instance that contains the collection. For an example of the use of the collection, see the class. + If this instance of is contained in an installer collection, the property is the instance that contains the collection. For an example of the use of the collection, see the class. ## Examples - The following example demonstrates the and properties. The property shows the associated with an . + The following example demonstrates the and properties. The property shows the associated with an . :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/Installer_Installers/CPP/installer_installers.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Configuration.Install/Installer/Installers/installer_installers.cs" id="Snippet1"::: @@ -667,16 +667,16 @@ methods of all the installers in this instance's run. + This method is called after the methods of all the installers in this instance's run. Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). - The method allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + The method allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. ## Examples - The following example demonstrates the method. This method is overridden in the derived class. Space is provided to add steps to be done after the installation in the method. + The following example demonstrates the method. This method is overridden in the derived class. Space is provided to add steps to be done after the installation in the method. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/Installer_OnInstall/CPP/installer_oninstall.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Configuration.Install/Installer/OnAfterInstall/installer_oninstall.cs" id="Snippet2"::: @@ -723,11 +723,11 @@ methods of all the installers in this instance's have run. + This method is called after the methods of all the installers in this instance's have run. Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). - The method allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + The method allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. ]]> @@ -770,11 +770,11 @@ methods of all the installers in this instance's have run. + This method is called after the methods of all the installers in this instance's have run. Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). - The method allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + The method allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. ]]> @@ -816,16 +816,16 @@ methods of the installers in this instance's are called. + This method is called before the methods of the installers in this instance's are called. Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). - The method allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + The method allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. ## Examples - The following example demonstrates the method. This method is overridden in the derived class. Space is provided to add steps to be done before the installation in the method. + The following example demonstrates the method. This method is overridden in the derived class. Space is provided to add steps to be done before the installation in the method. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/Installer_OnInstall/CPP/installer_oninstall.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Configuration.Install/Installer/OnAfterInstall/installer_oninstall.cs" id="Snippet1"::: @@ -872,11 +872,11 @@ methods of the installers in this instance's are called. + This method is called before the methods of the installers in this instance's are called. Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). - The method allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + The method allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. ]]> @@ -919,11 +919,11 @@ methods of the installers in this instance's are uninstalled. + This method is called before the methods of the installers in this instance's are uninstalled. Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). - The method allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + The method allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. ]]> @@ -966,16 +966,16 @@ methods of all the installers contained in this instance's installer collection run. + This method is called after the methods of all the installers contained in this instance's installer collection run. Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). - The method allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + The method allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. ## Examples - The following example demonstrates the method of the class. The method is overridden in the derived class. Space is provided for the user to add the steps to be performed before committing and after committing. + The following example demonstrates the method of the class. The method is overridden in the derived class. Space is provided for the user to add the steps to be performed before committing and after committing. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/Installer_Committed/CPP/installer_committed.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Configuration.Install/Installer/OnCommitted/installer_committed.cs" id="Snippet2"::: @@ -1022,16 +1022,16 @@ methods of the installers in this instance's run. + This method is called before the methods of the installers in this instance's run. Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). - The method allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + The method allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. ## Examples - The following example demonstrates the method of the class. The method is overridden in the derived class. Space is provided for the user to add the steps to be performed before committing and after committing. + The following example demonstrates the method of the class. The method is overridden in the derived class. Space is provided for the user to add the steps to be performed before committing and after committing. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/Installer_Committed/CPP/installer_committed.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Configuration.Install/Installer/OnCommitted/installer_committed.cs" id="Snippet1"::: @@ -1093,9 +1093,9 @@ is part of an installer collection, the property is set to the instance that contains the collection. For an example of the use of the collection, see the class. + If this instance of is part of an installer collection, the property is set to the instance that contains the collection. For an example of the use of the collection, see the class. - The property contains a collection of installers. The , , , and methods of the class go through the collection of installers and invokes the corresponding method of each installer. + The property contains a collection of installers. The , , , and methods of the class go through the collection of installers and invokes the corresponding method of each installer. @@ -1143,7 +1143,7 @@ method of . The method is overridden in the derived class of . An exception is generated to force an installation rollback. + The following example demonstrates the method of . The method is overridden in the derived class of . An exception is generated to force an installation rollback. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/Installer_Rollback/CPP/installer_rollback.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Configuration.Install/Installer/Rollback/installer_rollback.cs" id="Snippet1"::: @@ -1194,7 +1194,7 @@ method of . The method is overridden in the derived class of . + The following example demonstrates the method of . The method is overridden in the derived class of . :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/Installer_Uninstall/CPP/installer_uninstall.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Configuration.Install/Installer/Uninstall/installer_uninstall.cs" id="Snippet1"::: diff --git a/xml/System.Configuration.Install/InstallerCollection.xml b/xml/System.Configuration.Install/InstallerCollection.xml index 81a20ec51d7..e298ce29305 100644 --- a/xml/System.Configuration.Install/InstallerCollection.xml +++ b/xml/System.Configuration.Install/InstallerCollection.xml @@ -25,22 +25,22 @@ Use any of the following three ways to add installers to the collection: -- The method adds a single installer to the collection. +- The method adds a single installer to the collection. -- The methods add multiple installers to the collection. +- The methods add multiple installers to the collection. -- The method and the property, which is the indexer, each add a single installer to the collection at the specified index. +- The method and the property, which is the indexer, each add a single installer to the collection at the specified index. - Remove installers through the method. Check whether an installer is in the collection by using the method. Find where an installer is located in the collection by using the method. + Remove installers through the method. Check whether an installer is in the collection by using the method. Find where an installer is located in the collection by using the method. - The installers in a collection are run when the installer containing the collection, as specified by the property, calls their , , , or methods. + The installers in a collection are run when the installer containing the collection, as specified by the property, calls their , , , or methods. For examples of the usage of an installer collection, see the and classes. ## Examples - The following example demonstrates the method of the class. This example provides an implementation similar to that of [Installutil.exe (Installer Tool)](/dotnet/framework/tools/installutil-exe-installer-tool). It installs assemblies with the options preceding that particular assembly. If an option is not specified for an assembly, the previous assembly's options are taken if there is a previous assembly in the list. If the "/u" or "/uninstall" option is specified, the assemblies are uninstalled. If the "/?" or "/help" option is provided, the help information is displayed to the console. + The following example demonstrates the method of the class. This example provides an implementation similar to that of [Installutil.exe (Installer Tool)](/dotnet/framework/tools/installutil-exe-installer-tool). It installs assemblies with the options preceding that particular assembly. If an option is not specified for an assembly, the previous assembly's options are taken if there is a previous assembly in the list. If the "/u" or "/uninstall" option is specified, the assemblies are uninstalled. If the "/?" or "/help" option is provided, the help information is displayed to the console. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/InstallerCollection_Add/CPP/installercollection_add.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Configuration.Install/InstallerCollection/Overview/installercollection_add.cs" id="Snippet1"::: @@ -144,7 +144,7 @@ ## Examples - The following example demonstrates the method of the class. It creates instances for `MyAssembly1.exe` and `MyAssembly2.exe`. These instances are added to a . The installation process installs both `MyAssembly1.exe` and `MyAssembly2.exe`. + The following example demonstrates the method of the class. It creates instances for `MyAssembly1.exe` and `MyAssembly2.exe`. These instances are added to a . The installation process installs both `MyAssembly1.exe` and `MyAssembly2.exe`. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/InstallerCollection_AddRange1/CPP/installercollection_addrange1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Configuration.Install/InstallerCollection/AddRange/installercollection_addrange1.cs" id="Snippet1"::: @@ -189,7 +189,7 @@ ## Examples - The following example demonstrates the method and the methods of the class. It creates instances for `MyAssembly1.exe` and `MyAssembly2.exe`. These instances of are added to a named `myTransactedInstaller1`. The installers in the `myTransactedInstaller1` are copied to another named `myTransactedInstaller2`. The installation process installs both `MyAssembly1.exe` and `MyAssembly2.exe`. + The following example demonstrates the method and the methods of the class. It creates instances for `MyAssembly1.exe` and `MyAssembly2.exe`. These instances of are added to a named `myTransactedInstaller1`. The installers in the `myTransactedInstaller1` are copied to another named `myTransactedInstaller2`. The installation process installs both `MyAssembly1.exe` and `MyAssembly2.exe`. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/InstallerCollection_Insert/CPP/installercollection_insert.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Configuration.Install/InstallerCollection/AddRange/installercollection_insert.cs" id="Snippet1"::: @@ -231,7 +231,7 @@ method, method, and method of the class. It creates instances for `MyAssembly1.exe` and `MyAssembly2.exe`. These instances are added to a . `MyAssembly2.exe` is then removed from the of the . The installation process starts and installs only `MyAssembly1.exe`. + The following example demonstrates the method, method, and method of the class. It creates instances for `MyAssembly1.exe` and `MyAssembly2.exe`. These instances are added to a . `MyAssembly2.exe` is then removed from the of the . The installation process starts and installs only `MyAssembly1.exe`. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/InstallerCollection_Remove/CPP/installercollection_remove.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Configuration.Install/InstallerCollection/Contains/installercollection_remove.cs" id="Snippet1"::: @@ -274,7 +274,7 @@ method of the class. It creates instances for `MyAssembly1.exe` and `MyAssembly2.exe`. These instances are added to a . The names of the assemblies to be installed are displayed on the console. The installation process installs both `MyAssembly1.exe` and `MyAssembly2.exe`. + The following example demonstrates the method of the class. It creates instances for `MyAssembly1.exe` and `MyAssembly2.exe`. These instances are added to a . The names of the assemblies to be installed are displayed on the console. The installation process installs both `MyAssembly1.exe` and `MyAssembly2.exe`. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/InstallerCollection_CopyTo/CPP/installercollection_copyto.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Configuration.Install/InstallerCollection/CopyTo/installercollection_copyto.cs" id="Snippet1"::: @@ -312,7 +312,7 @@ method. For more information on this example, please see the Example section of the method. + The following example is the same as the example in the method. For more information on this example, please see the Example section of the method. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/InstallerCollection_Remove/CPP/installercollection_remove.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Configuration.Install/InstallerCollection/Contains/installercollection_remove.cs" id="Snippet1"::: @@ -351,7 +351,7 @@ method. For more information on this example, please see the Example section of the method. + The following example is the same as the example in the method. For more information on this example, please see the Example section of the method. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/InstallerCollection_Insert/CPP/installercollection_insert.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Configuration.Install/InstallerCollection/AddRange/installercollection_insert.cs" id="Snippet1"::: @@ -523,7 +523,7 @@ ## Examples - The following example is the same as the example in the method. For more information on this example, please see the Example section of the method. + The following example is the same as the example in the method. For more information on this example, please see the Example section of the method. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/InstallerCollection_Remove/CPP/installercollection_remove.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Configuration.Install/InstallerCollection/Contains/installercollection_remove.cs" id="Snippet1"::: diff --git a/xml/System.Configuration.Install/TransactedInstaller.xml b/xml/System.Configuration.Install/TransactedInstaller.xml index 0709c681935..b071c77b8f7 100644 --- a/xml/System.Configuration.Install/TransactedInstaller.xml +++ b/xml/System.Configuration.Install/TransactedInstaller.xml @@ -26,7 +26,7 @@ ## Examples - The following example demonstrates the , and methods of the class. + The following example demonstrates the , and methods of the class. This example provides an implementation similar to that of [Installutil.exe (Installer Tool)](/dotnet/framework/tools/installutil-exe-installer-tool). It installs assemblies with the options preceding that particular assembly. If an option is not specified for an assembly, the previous assembly's options are used if there is a previous assembly in the list. If either the "/u" or "/uninstall" option is specified, the assemblies are uninstalled. If the "/?" or "/help" option is provided, the help information is displayed to the console. @@ -84,12 +84,12 @@ method of each installer contained in the property of this instance. The object referenced by the `savedState` parameter is updated to reflect the status of the installation after the contained installers have run. If all the methods succeed, the method is called. Otherwise, the method is called for each installer. + This method calls the method of each installer contained in the property of this instance. The object referenced by the `savedState` parameter is updated to reflect the status of the installation after the contained installers have run. If all the methods succeed, the method is called. Otherwise, the method is called for each installer. ## Examples - The following example demonstrates the , and methods of the class. + The following example demonstrates the , and methods of the class. This example provides an implementation similar to that of InstallUtil.exe. It installs assemblies with the options preceding that particular assembly. If an option is not specified for an assembly, the previous assemblies options are taken if there is a previous assembly in the list. If the '/u' or '/uninstall' option is specified then the assemblies are uninstalled. If the '/?' or '/help' option is provided then the help information is printed to the console. @@ -139,15 +139,15 @@ method calls the method of each installer in the property to uninstall any resources set during installation. Any exceptions during uninstallation are ignored. + Call this method to remove a previously completed installation. This method calls the method of each installer in the property to uninstall any resources set during installation. Any exceptions during uninstallation are ignored. > [!NOTE] -> Although the and methods save the state of the computer after the installations, the file containing the from the `savedState` parameter might have been deleted at some point after the installation was complete. If the file is deleted, the `savedState` parameter is `null`. +> Although the and methods save the state of the computer after the installations, the file containing the from the `savedState` parameter might have been deleted at some point after the installation was complete. If the file is deleted, the `savedState` parameter is `null`. ## Examples - The following example demonstrates the , and methods of the class. + The following example demonstrates the , and methods of the class. This example provides an implementation similar to that of [Installutil.exe (Installer Tool)](/dotnet/framework/tools/installutil-exe-installer-tool). It installs assemblies with the options preceding that particular assembly. If an option is not specified for an assembly, the previous assembly's options are used if there is a previous assembly in the list. If either the "/u" or "/uninstall" option is specified, the assemblies are uninstalled. If the "/?" or "/help" option is provided, the help information is displayed to the console. diff --git a/xml/System.Configuration.Install/UninstallAction.xml b/xml/System.Configuration.Install/UninstallAction.xml index 99f22482beb..da8fbb84806 100644 --- a/xml/System.Configuration.Install/UninstallAction.xml +++ b/xml/System.Configuration.Install/UninstallAction.xml @@ -17,15 +17,15 @@ Specifies what an installer should do during an uninstallation. - class. In the overridden function, the enumeration is set based on user input. If the input is "n", the custom uninstaller will not take any action on the resource in the event log entered by the user. Otherwise, it will remove the resource from the event log. - + class. In the overridden function, the enumeration is set based on user input. If the input is "n", the custom uninstaller will not take any action on the resource in the event log entered by the user. Otherwise, it will remove the resource from the event log. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/UninstallAction_NoAction_Remove_3/CPP/uninstallaction_noaction_remove_3.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Configuration.Install/UninstallAction/Overview/uninstallaction_noaction_remove_3.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Configuration.Install/UninstallAction/Overview/uninstallaction_noaction_remove_3.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.Configuration.Install/UninstallAction/Overview/uninstallaction_noaction_remove_3.vb" id="Snippet1"::: + ]]> diff --git a/xml/System.Configuration.Provider/ProviderBase.xml b/xml/System.Configuration.Provider/ProviderBase.xml index e93ed49237d..de1cf427e30 100644 --- a/xml/System.Configuration.Provider/ProviderBase.xml +++ b/xml/System.Configuration.Provider/ProviderBase.xml @@ -170,12 +170,12 @@ ## Remarks The base class implementation internally tracks the number of times the provider's `Initialize` method has been called. If a provider is initialized more than once, an `InvalidOperationException` is thrown stating that the provider is already initialized. - Because most feature providers call prior to performing provider-specific initialization, this method is a central location for preventing double initialization. + Because most feature providers call prior to performing provider-specific initialization, this method is a central location for preventing double initialization. ## Examples - For an example of how to use , see [Profile Provider Implementation Example](/previous-versions/aspnet/ta63b872(v=vs.100)). + For an example of how to use , see [Profile Provider Implementation Example](/previous-versions/aspnet/ta63b872(v=vs.100)). ]]> diff --git a/xml/System.Configuration.Provider/ProviderCollection.xml b/xml/System.Configuration.Provider/ProviderCollection.xml index a21413d821e..eb038c7e6b3 100644 --- a/xml/System.Configuration.Provider/ProviderCollection.xml +++ b/xml/System.Configuration.Provider/ProviderCollection.xml @@ -81,7 +81,7 @@ constructor initializes the underlying object used to store the items of the collection. + The constructor initializes the underlying object used to store the items of the collection. ]]> @@ -125,7 +125,7 @@ method first checks for any exceptions (as listed in the Exceptions section), and then calls the method. It passes in the object referenced by the `provider` parameter as well as the property of the provider to be used as the key in the object. + The method first checks for any exceptions (as listed in the Exceptions section), and then calls the method. It passes in the object referenced by the `provider` parameter as well as the property of the provider to be used as the key in the object. ]]> @@ -297,7 +297,7 @@ class stores its collection in a object. The method calls the method. + The class stores its collection in a object. The method calls the method. ]]> @@ -460,7 +460,7 @@ class is read/write by default. The method makes the collection read-only. After a collection is set to read-only, some method calls (such as and will result in an exception. + The class is read/write by default. The method makes the collection read-only. After a collection is set to read-only, some method calls (such as and will result in an exception. Note that most provider-based features will set their object to read-only after creating instances of all of the configured providers. @@ -556,7 +556,7 @@ instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> diff --git a/xml/System.Configuration/AppSettingsReader.xml b/xml/System.Configuration/AppSettingsReader.xml index fabdafae450..7382aa67174 100644 --- a/xml/System.Configuration/AppSettingsReader.xml +++ b/xml/System.Configuration/AppSettingsReader.xml @@ -34,54 +34,54 @@ Provides a method for reading values of a particular type from the configuration. - ` section, and then uses the to read the settings just generated. - -```csharp -using System; -using System.Configuration; - -class Program -{ - static void Main(string[] args) - { - var reader = new AppSettingsReader(); - - var stringSetting = reader.GetValue("String setting", typeof(string)); - Console.WriteLine("String setting: " + stringSetting); - - var dateTimeSetting = reader.GetValue("DateTime setting", typeof(DateTime)); - Console.WriteLine("DateTime setting: " + dateTimeSetting); - - try - { - var missingSetting = reader.GetValue("Int setting", typeof(Int32)); - } - catch (InvalidOperationException e) - { - Console.WriteLine("Missing key error: " + e.Message); - } - - Console.WriteLine("Press any key to continue"); - Console.ReadKey(); - } -} -``` - - The following example demonstrates a configuration file used by the previous example. - -```xml - - - - - - - -``` - + ` section, and then uses the to read the settings just generated. + +```csharp +using System; +using System.Configuration; + +class Program +{ + static void Main(string[] args) + { + var reader = new AppSettingsReader(); + + var stringSetting = reader.GetValue("String setting", typeof(string)); + Console.WriteLine("String setting: " + stringSetting); + + var dateTimeSetting = reader.GetValue("DateTime setting", typeof(DateTime)); + Console.WriteLine("DateTime setting: " + dateTimeSetting); + + try + { + var missingSetting = reader.GetValue("Int setting", typeof(Int32)); + } + catch (InvalidOperationException e) + { + Console.WriteLine("Missing key error: " + e.Message); + } + + Console.WriteLine("Press any key to continue"); + Console.ReadKey(); + } +} +``` + + The following example demonstrates a configuration file used by the previous example. + +```xml + + + + + + + +``` + ]]> @@ -116,54 +116,54 @@ class Program Initializes a new instance of the class. - ` section, and then uses the to read the settings just generated. - -```csharp -using System; -using System.Configuration; - -class Program -{ - static void Main(string[] args) - { - var reader = new AppSettingsReader(); - - var stringSetting = reader.GetValue("String setting", typeof(string)); - Console.WriteLine("String setting: " + stringSetting); - - var dateTimeSetting = reader.GetValue("DateTime setting", typeof(DateTime)); - Console.WriteLine("DateTime setting: " + dateTimeSetting); - - try - { - var missingSetting = reader.GetValue("Int setting", typeof(Int32)); - } - catch (InvalidOperationException e) - { - Console.WriteLine("Missing key error: " + e.Message); - } - - Console.WriteLine("Press any key to continue"); - Console.ReadKey(); - } -} -``` - - The following example demonstrates a configuration file used by the previous example. - -```xml - - - - - - - -``` - + ` section, and then uses the to read the settings just generated. + +```csharp +using System; +using System.Configuration; + +class Program +{ + static void Main(string[] args) + { + var reader = new AppSettingsReader(); + + var stringSetting = reader.GetValue("String setting", typeof(string)); + Console.WriteLine("String setting: " + stringSetting); + + var dateTimeSetting = reader.GetValue("DateTime setting", typeof(DateTime)); + Console.WriteLine("DateTime setting: " + dateTimeSetting); + + try + { + var missingSetting = reader.GetValue("Int setting", typeof(Int32)); + } + catch (InvalidOperationException e) + { + Console.WriteLine("Missing key error: " + e.Message); + } + + Console.WriteLine("Press any key to continue"); + Console.ReadKey(); + } +} +``` + + The following example demonstrates a configuration file used by the previous example. + +```xml + + + + + + + +``` + ]]> @@ -208,27 +208,27 @@ class Program Gets the value for a specified key from the property and returns an object of the specified type containing the value from the configuration. The value of the specified key. - method to retrieve the value for each key in the `` section of the configuration file. - + method to retrieve the value for each key in the `` section of the configuration file. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.AppSettingsReader/CS/AppSettingsReader.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.AppSettingsReader/VB/AppSettingsReader.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.AppSettingsReader/VB/AppSettingsReader.vb" id="Snippet2"::: + ]]> - is . - + is . + -or- - + is . - does not exist in the configuration section. - + does not exist in the configuration section. + -or- - + The value in the configuration section for is not of type . diff --git a/xml/System.Configuration/ApplicationSettingsBase.xml b/xml/System.Configuration/ApplicationSettingsBase.xml index 011e81d2f2d..c3d7ef15c00 100644 --- a/xml/System.Configuration/ApplicationSettingsBase.xml +++ b/xml/System.Configuration/ApplicationSettingsBase.xml @@ -44,7 +44,7 @@ - The ability to detect attributes on a derived, settings wrapper class. supports the declarative model used for wrapper class properties, as described later. -- Higher-level and methods. +- Higher-level and methods. - Additional validation events that you can handle to ensure the correctness of individual settings. @@ -75,9 +75,9 @@ - A button named `btnBackColor` used to display the **Color** common dialog box. -- A button named `btnReload` used to the application settings. +- A button named `btnReload` used to the application settings. -- A button named `btnReset` used to the application settings. +- A button named `btnReset` used to the application settings. - A textbox named `tbStatus` used to display status information about the program. @@ -151,7 +151,7 @@ 4. All other attributes are simply put into an attribute bag, the property of the class. -5. All objects are added to a represented by the property of the class. This collection is then passed to the method. +5. All objects are added to a represented by the property of the class. This collection is then passed to the method. As implied by step 3 mentioned previously, natively works with several property attributes, specifically the following: , , and . All other settings attributes are simply passed through to the appropriate underlying provider. @@ -197,7 +197,7 @@ constructor using the invocation: + This constructor is exactly equivalent to the constructor using the invocation: `ApplicationSettingsBase(owner, String.Empty)` @@ -400,7 +400,7 @@ method is often used in conjunction with the method when migrating application settings during the installation of a new version of an application. + The method is often used in conjunction with the method when migrating application settings during the installation of a new version of an application. ]]> @@ -452,13 +452,13 @@ property, also known as the indexer, is routinely used in the settings wrapper class derived from . binds the public property of the wrapper class to the corresponding settings property. + The property, also known as the indexer, is routinely used in the settings wrapper class derived from . binds the public property of the wrapper class to the corresponding settings property. - raises several events depending on the operation being performed: + raises several events depending on the operation being performed: - The first time a property is retrieved, the event is raised. -- When a property is set, the event is raised. If the handler does not cancel the event, then the property value is set and the event is raised. +- When a property is set, the event is raised. If the handler does not cancel the event, then the property value is set and the event is raised. ]]> @@ -512,7 +512,7 @@ ## Remarks Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). - The method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + The method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. ]]> @@ -564,7 +564,7 @@ ## Remarks Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). - The method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + The method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. ]]> @@ -618,7 +618,7 @@ ## Remarks Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). - The method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + The method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. ]]> @@ -672,7 +672,7 @@ ## Remarks Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). - The method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + The method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. ]]> @@ -776,7 +776,7 @@ event is raised when a settings property is changed through the `set` accessor of the method, or for every property that is restored when a call is made to the or methods. + The event is raised when a settings property is changed through the `set` accessor of the method, or for every property that is restored when a call is made to the or methods. There is no corresponding `PropertyChanging` event for this class; instead, see the event. @@ -915,18 +915,18 @@ method clears the currently cached property values, causing a reload of these values from persistent storage when they are subsequently accessed. This method performs the following actions: + The method clears the currently cached property values, causing a reload of these values from persistent storage when they are subsequently accessed. This method performs the following actions: - It clears the currently cached properties by clearing the collection represented by the property. -- It raises the event for every member of the collection. +- It raises the event for every member of the collection. - contrasts with in that the former will load the last set of saved application settings values, whereas the latter will load the saved default values. + contrasts with in that the former will load the last set of saved application settings values, whereas the latter will load the saved default values. ## Examples - The following code example shows the method being invoked in the body of the event handler for a button named `btnReload`. As a result of this call, the currently stored values for the application settings are reloaded into their corresponding properties. The full code example is listed in the class overview. + The following code example shows the method being invoked in the body of the event handler for a button named `btnReload`. As a result of this call, the currently stored values for the application settings are reloaded into their corresponding properties. The full code example is listed in the class overview. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/AppSettingsSample/cpp/AppSettingsSample.cpp" id="Snippet6"::: :::code language="csharp" source="~/snippets/csharp/System.Configuration/ApplicationSettingsBase/Overview/AppSettingsSample.cs" id="Snippet6"::: @@ -978,18 +978,18 @@ method overwrites the user-scoped settings properties by restoring the currently persisted value of each application settings. This method performs the following actions: + The method overwrites the user-scoped settings properties by restoring the currently persisted value of each application settings. This method performs the following actions: -- It calls the method on every settings provider that supports this optional method. +- It calls the method on every settings provider that supports this optional method. -- It calls the method to force a refresh of the settings property values. +- It calls the method to force a refresh of the settings property values. - contrasts with in that the former will load the last set of saved application settings values, whereas the latter will load the saved default values. + contrasts with in that the former will load the last set of saved application settings values, whereas the latter will load the saved default values. ## Examples - The following code example shows the method being invoked in the body of the event handler for a button named `btnReset`. As a result of this call, the stored default values for the application settings are reloaded into their corresponding properties. The full code example is listed in the class overview. + The following code example shows the method being invoked in the body of the event handler for a button named `btnReset`. As a result of this call, the stored default values for the application settings are reloaded into their corresponding properties. The full code example is listed in the class overview. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/AppSettingsSample/cpp/AppSettingsSample.cpp" id="Snippet5"::: :::code language="csharp" source="~/snippets/csharp/System.Configuration/ApplicationSettingsBase/Overview/AppSettingsSample.cs" id="Snippet5"::: @@ -1038,19 +1038,19 @@ method writes the current value of each settings property to its associated data store. For each property, this method calls the method on the associated settings provider. + The method writes the current value of each settings property to its associated data store. For each property, this method calls the method on the associated settings provider. This method differs from the base class implementation in that it raises the event before the values are written. - If the only settings defined are application-scoped settings, will have no effect and return no error if called with the default . only saves user-scoped settings. + If the only settings defined are application-scoped settings, will have no effect and return no error if called with the default . only saves user-scoped settings. > [!IMPORTANT] -> There is no corresponding Load method because the values of application settings are automatically loaded during wrapper class initialization. In contrast, these values are not automatically saved when an application ends. Therefore, you must explicitly call the method to persist the current values of the application settings. This is typically performed in the event handler of the primary or containing . +> There is no corresponding Load method because the values of application settings are automatically loaded during wrapper class initialization. In contrast, these values are not automatically saved when an application ends. Therefore, you must explicitly call the method to persist the current values of the application settings. This is typically performed in the event handler of the primary or containing . ## Examples - The following code example shows the method being called from the event handler for the primary form. This method also appends an extra period to the settings property that is associated with the form's property. + The following code example shows the method being called from the event handler for the primary form. This method also appends an extra period to the settings property that is associated with the form's property. The full code example is listed in the class overview. @@ -1101,7 +1101,7 @@ event occurs before an application setting value property is changed through the method. This event is not raised when the or methods are called. can be canceled through the event data class. + The event occurs before an application setting value property is changed through the method. This event is not raised when the or methods are called. can be canceled through the event data class. You typically use the event to handle immediate validation of an individual settings property. For more information about validation, see [How to: Validate Application Settings](/dotnet/desktop/winforms/advanced/how-to-validate-application-settings). @@ -1172,11 +1172,11 @@ ## Remarks The property is provided to enable client code, and in particular the settings provider, to disambiguate between multiple instances of the same application settings class. - Unless the settings wrapper class is designed using the singleton pattern, there can be multiple instances of the same application settings class in a single application. The value of should be set according to how the property values are intended to be shared. + Unless the settings wrapper class is designed using the singleton pattern, there can be multiple instances of the same application settings class in a single application. The value of should be set according to how the property values are intended to be shared. -- If the settings properties of the wrapper are intended to be shared across all instances of the wrapper in the same application, then should have the same value in all of the instances. This is the default behavior of the class. +- If the settings properties of the wrapper are intended to be shared across all instances of the wrapper in the same application, then should have the same value in all of the instances. This is the default behavior of the class. -- If the settings properties of the wrapper are intended to be per instance, then should have a unique value for every instance. The version of the constructor enables you to initialize to a unique string. +- If the settings properties of the wrapper are intended to be per instance, then should have a unique value for every instance. The version of the constructor enables you to initialize to a unique string. In contrast, the property provides hints to the settings provider to enable it to persist values in an efficient and orderly manner. @@ -1222,7 +1222,7 @@ event occurs only after the initial `get` access of the first configuration property used, typically through the method. Subsequent accesses use values for the settings property that are cached locally. The and methods will clear all cached values so this event will be raised again upon subsequent property access. + The event occurs only after the initial `get` access of the first configuration property used, typically through the method. Subsequent accesses use values for the settings property that are cached locally. The and methods will clear all cached values so this event will be raised again upon subsequent property access. ]]> @@ -1267,7 +1267,7 @@ event is raised by the method before it stores the application settings properties to their associated data store. The associated event handler can cancel this event. + The event is raised by the method before it stores the application settings properties to their associated data store. The associated event handler can cancel this event. @@ -1319,13 +1319,13 @@ method performs two actions to assure smooth transition to a new version of an application: + The method performs two actions to assure smooth transition to a new version of an application: -- It notifies all of the corresponding settings providers of the existence of the upgraded application through a call to their method, assuming they have implemented the interface. This action is not performed if the settings wrapper class is marked with . +- It notifies all of the corresponding settings providers of the existence of the upgraded application through a call to their method, assuming they have implemented the interface. This action is not performed if the settings wrapper class is marked with . - It reloads the values for all of the application settings. - You can override the default behavior of to implement custom upgrading or merging behavior. Use the method to retrieve individual values for a setting for the previous version of the application. Examples of custom upgrade behavior include: + You can override the default behavior of to implement custom upgrading or merging behavior. Use the method to retrieve individual values for a setting for the previous version of the application. Examples of custom upgrade behavior include: - Using new policy defaults that override one or more of the previous user-specified values or previous defaults. diff --git a/xml/System.Configuration/CallbackValidator.xml b/xml/System.Configuration/CallbackValidator.xml index 88be8416610..baf6ff30163 100644 --- a/xml/System.Configuration/CallbackValidator.xml +++ b/xml/System.Configuration/CallbackValidator.xml @@ -33,11 +33,11 @@ Provides dynamic validation of an object. - delegate for the type of object you want to validate. When you instantiate this class, you pass in the object type and a reference to the delegate. You can then call to determine if an object is the correct type or to execute the delegate on the object. - + delegate for the type of object you want to validate. When you instantiate this class, you pass in the object type and a reference to the delegate. You can then call to determine if an object is the correct type or to execute the delegate on the object. + ]]> @@ -154,11 +154,11 @@ The value of an object. Determines whether the value of an object is valid. - class contains the type and delegate necessary to validate an object. The type and delegate are established when an instance of the class is created. The object to validate is passed as a parameter of the method. - + class contains the type and delegate necessary to validate an object. The type and delegate are established when an instance of the class is created. The object to validate is passed as a parameter of the method. + ]]> diff --git a/xml/System.Configuration/ClientSettingsSection.xml b/xml/System.Configuration/ClientSettingsSection.xml index c6e2930e29d..869697e621a 100644 --- a/xml/System.Configuration/ClientSettingsSection.xml +++ b/xml/System.Configuration/ClientSettingsSection.xml @@ -88,7 +88,7 @@ constructor initializes the property. + The default constructor initializes the property. ]]> diff --git a/xml/System.Configuration/CommaDelimitedStringCollection.xml b/xml/System.Configuration/CommaDelimitedStringCollection.xml index dc10e8f76fc..a76d6236efb 100644 --- a/xml/System.Configuration/CommaDelimitedStringCollection.xml +++ b/xml/System.Configuration/CommaDelimitedStringCollection.xml @@ -82,7 +82,7 @@ constructor. This code example is part of a larger example provided for the class overview. + The following code example demonstrates how to use the constructor. This code example is part of a larger example provided for the class overview. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.CommaDelimitedStringCollection/CS/CommaDelimitedStringCollection.cs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.CommaDelimitedStringCollection/VB/CommaDelimitedStringCollection.vb" id="Snippet2"::: @@ -178,7 +178,7 @@ ## Examples - The following code example demonstrates how to use the method. This code example is part of a larger example provided for the class overview. + The following code example demonstrates how to use the method. This code example is part of a larger example provided for the class overview. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.CommaDelimitedStringCollection/CS/CommaDelimitedStringCollection.cs" id="Snippet3"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.CommaDelimitedStringCollection/VB/CommaDelimitedStringCollection.vb" id="Snippet3"::: @@ -308,7 +308,7 @@ ## Examples - The following code example demonstrates how to use the method. This code example is part of a larger example provided for the class overview. + The following code example demonstrates how to use the method. This code example is part of a larger example provided for the class overview. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.CommaDelimitedStringCollection/CS/CommaDelimitedStringCollection.cs" id="Snippet9"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.CommaDelimitedStringCollection/VB/CommaDelimitedStringCollection.vb" id="Snippet9"::: @@ -353,7 +353,7 @@ property is `true` after the , , , or method has been called. Also, the property is `true` after the property is used to modify an element of the string collection. + The property is `true` after the , , , or method has been called. Also, the property is `true` after the property is used to modify an element of the string collection. @@ -403,7 +403,7 @@ method on the class. + This property returns `true` if the collection is marked as read-only. This is useful for protecting the element at run time, as opposed to design time. For more information, see the method on the class. @@ -505,7 +505,7 @@ ## Examples - The following code example demonstrates how to use the method. This code example is part of a larger example provided for the class overview. + The following code example demonstrates how to use the method. This code example is part of a larger example provided for the class overview. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.CommaDelimitedStringCollection/CS/CommaDelimitedStringCollection.cs" id="Snippet10"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.CommaDelimitedStringCollection/VB/CommaDelimitedStringCollection.vb" id="Snippet10"::: @@ -549,7 +549,7 @@ collection can be modified, call the method. + To determine whether the collection can be modified, call the method. ]]> diff --git a/xml/System.Configuration/Configuration.xml b/xml/System.Configuration/Configuration.xml index e6e8937b93e..880055b7cf2 100644 --- a/xml/System.Configuration/Configuration.xml +++ b/xml/System.Configuration/Configuration.xml @@ -50,9 +50,9 @@ You can also generate a configuration file that represents the configuration settings in a object. To do this, use one of the following methods: -- Call the method to create a new configuration file. +- Call the method to create a new configuration file. -- Call the method to generate a new configuration file at another location. +- Call the method to generate a new configuration file at another location. The names of the methods that create configuration files begin with "Save". @@ -375,12 +375,12 @@ Note: If you use a static method that takes a path method retrieves a configuration section by its name. + Configuration settings are contained within sections that group similar settings together for convenience. The method retrieves a configuration section by its name. ## Examples - The following example shows how to use the method to access a custom section. For the complete example code that defines a class that stores information for the `CustomSection` section, see the class overview. + The following example shows how to use the method to access a custom section. For the complete example code that defines a class that stores information for the `CustomSection` section, see the class overview. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.Configuration/CS/Configuration.cs" id="Snippet3"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.Configuration/VB/Configuration.vb" id="Snippet3"::: @@ -428,7 +428,7 @@ Note: If you use a static method that takes a path method to obtain a specific from a object. + Use the method to obtain a specific from a object. ]]> @@ -647,12 +647,12 @@ Note: If you use a static method that takes a path method persists any configuration settings that have been modified since this object was created. If a configuration file does not exist at the physical location represented by the property, a new configuration file will be created to contain any settings that are different from the inherited configuration. + The method persists any configuration settings that have been modified since this object was created. If a configuration file does not exist at the physical location represented by the property, a new configuration file will be created to contain any settings that are different from the inherited configuration. If the configuration file has changed since this object was created, a run-time error occurs. > [!NOTE] -> When 'Creator Owner' is listed in the ACL (Access Control List) of the directory containing the configuration file, the current user of becomes the new owner of the file and inherits the permissions granted to 'Creator Owner'. This results in an elevation of privileges for the current user and a removal of privileges for the previous owner. +> When 'Creator Owner' is listed in the ACL (Access Control List) of the directory containing the configuration file, the current user of becomes the new owner of the file and inherits the permissions granted to 'Creator Owner'. This results in an elevation of privileges for the current user and a removal of privileges for the previous owner. ]]> @@ -701,19 +701,19 @@ Note: If you use a static method that takes a path method persists configuration settings in the object based on the `saveMode` parameter. + The method persists configuration settings in the object based on the `saveMode` parameter. If a configuration file does not exist at the physical location represented by the property, a new configuration file will be created to contain any settings that are different from the inherited configuration. If the configuration file has changed since this object was created, a run-time error occurs. > [!NOTE] -> When 'Creator Owner' is listed in the ACL (Access Control List) of the directory containing the configuration file, the current user of becomes the new owner of the file and inherits the permissions granted to 'Creator Owner'. This results in an elevation of privileges for the current user and a removal of privileges for the previous owner. +> When 'Creator Owner' is listed in the ACL (Access Control List) of the directory containing the configuration file, the current user of becomes the new owner of the file and inherits the permissions granted to 'Creator Owner'. This results in an elevation of privileges for the current user and a removal of privileges for the previous owner. ## Examples - The following code example demonstrates how to use the method to save a custom section. + The following code example demonstrates how to use the method to save a custom section. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.Configuration/CS/Configuration.cs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.Configuration/VB/Configuration.vb" id="Snippet2"::: @@ -768,14 +768,14 @@ Note: If you use a static method that takes a path method persists configuration settings in the object based on the `saveMode` and `forceSaveAll` parameters. + The method persists configuration settings in the object based on the `saveMode` and `forceSaveAll` parameters. If a configuration file does not exist at the physical location represented by the property, a new configuration file will be created to contain any settings that are different from the inherited configuration. If the configuration file has changed since this object was created, a run-time error occurs. > [!NOTE] -> When 'Creator Owner' is listed in the ACL (Access Control List) of the directory containing the configuration file, the current user of becomes the new owner of the file and inherits the permissions granted to 'Creator Owner'. This results in an elevation of privileges for the current user and a removal of privileges for the previous owner. +> When 'Creator Owner' is listed in the ACL (Access Control List) of the directory containing the configuration file, the current user of becomes the new owner of the file and inherits the permissions granted to 'Creator Owner'. This results in an elevation of privileges for the current user and a removal of privileges for the previous owner. ]]> @@ -833,7 +833,7 @@ Note: If you use a static method that takes a path method persists any configuration settings that have been modified since this object was created to a new file. + The method persists any configuration settings that have been modified since this object was created to a new file. If a configuration file does not exist at the physical location represented by the @@ -890,7 +890,7 @@ Note: If you use a static method that takes a path method persists configuration settings in the object to a new file based on the `saveMode` parameter. + The method persists configuration settings in the object to a new file based on the `saveMode` parameter. If a configuration file does not exist at the physical location represented by the property, a new configuration file will be created to contain any settings that are different from the inherited configuration. @@ -948,7 +948,7 @@ Note: If you use a static method that takes a path method persists configuration settings in the object to a new file based on the `saveMode` and `forceSaveAll` parameters. + The method persists configuration settings in the object to a new file based on the `saveMode` and `forceSaveAll` parameters. If a configuration file does not exist at the physical location represented by the property, a new configuration file will be created to contain any settings that are different from the inherited configuration. @@ -957,7 +957,7 @@ Note: If you use a static method that takes a path ## Examples - The following code example demonstrates how to use the method. + The following code example demonstrates how to use the method. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.Configuration/CS/Configuration.cs" id="Snippet4"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.Configuration/VB/Configuration.vb" id="Snippet4"::: diff --git a/xml/System.Configuration/ConfigurationCollectionAttribute.xml b/xml/System.Configuration/ConfigurationCollectionAttribute.xml index 7d0694c6a81..ed516ef1090 100644 --- a/xml/System.Configuration/ConfigurationCollectionAttribute.xml +++ b/xml/System.Configuration/ConfigurationCollectionAttribute.xml @@ -143,7 +143,7 @@ ## Examples - The following example shows how to use the . + The following example shows how to use the . :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationCollectionAttribute/CS/customcollectionsection.cs" id="Snippet20"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationCollectionAttribute/VB/customcollectionsection.vb" id="Snippet20"::: @@ -243,7 +243,7 @@ ## Examples - The following example shows how to use the . + The following example shows how to use the . :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationCollectionAttribute/CS/customcollectionsection.cs" id="Snippet20"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationCollectionAttribute/VB/customcollectionsection.vb" id="Snippet20"::: diff --git a/xml/System.Configuration/ConfigurationConverterBase.xml b/xml/System.Configuration/ConfigurationConverterBase.xml index 21d826121ec..8807e484775 100644 --- a/xml/System.Configuration/ConfigurationConverterBase.xml +++ b/xml/System.Configuration/ConfigurationConverterBase.xml @@ -33,50 +33,50 @@ The base class for the configuration converter types. - is the base class for the converter configuration types. These are types that convert strings, found in the configuration file, to and from the related strongly typed properties. - - - -## Examples - The following code examples show how to derive from the class to create a custom converter type. Also, the examples show how to use this type in a custom section. - - The following code example shows how to create a custom converter type from the class. - + is the base class for the converter configuration types. These are types that convert strings, found in the configuration file, to and from the related strongly typed properties. + + + +## Examples + The following code examples show how to derive from the class to create a custom converter type. Also, the examples show how to use this type in a custom section. + + The following code example shows how to create a custom converter type from the class. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.TimeSpanMinutesConverter/CS/TimeSpanMinutesConverter.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.TimeSpanMinutesConverter/VB/TimeSpanMinutesConverter.vb" id="Snippet1"::: - - The following code example shows how to define a custom section that uses the previous custom converter. - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.TimeSpanMinutesConverter/VB/TimeSpanMinutesConverter.vb" id="Snippet1"::: + + The following code example shows how to define a custom section that uses the previous custom converter. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationConvertersCustomSection/CS/ConfigurationConvertersCustomSection.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationConvertersCustomSection/VB/ConfigurationConvertersCustomSection.vb" id="Snippet1"::: - - The following code example shows how to create and modify a configuration file using the previous custom section. - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationConvertersCustomSection/VB/ConfigurationConvertersCustomSection.vb" id="Snippet1"::: + + The following code example shows how to create and modify a configuration file using the previous custom section. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationConverterBase/CS/ConfigurationConverterBase.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationConverterBase/VB/ConfigurationConverterBase.vb" id="Snippet1"::: - - The following is a configuration excerpt as used by the previous example. - -```xml - - - -
- - - -``` - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationConverterBase/VB/ConfigurationConverterBase.vb" id="Snippet1"::: + + The following is a configuration excerpt as used by the previous example. + +```xml + + + +
+ + + +``` + ]]> @@ -119,11 +119,11 @@ Initializes a new instance of the class. - constructor is when you must create your own conversion type. - + constructor is when you must create your own conversion type. + ]]> @@ -167,19 +167,19 @@ if the conversion is allowed; otherwise, . - method determines whether a conversion can be performed on strongly typed properties to obtain value strings used in the configuration file. - - - -## Examples - The following example code shows how to override the method to create a custom converter type. Also, the example shows how to use this type in a custom section. - + method determines whether a conversion can be performed on strongly typed properties to obtain value strings used in the configuration file. + + + +## Examples + The following example code shows how to override the method to create a custom converter type. Also, the example shows how to use this type in a custom section. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.TimeSpanMinutesConverter/CS/TimeSpanMinutesConverter.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.TimeSpanMinutesConverter/VB/TimeSpanMinutesConverter.vb" id="Snippet3"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.TimeSpanMinutesConverter/VB/TimeSpanMinutesConverter.vb" id="Snippet3"::: + ]]> @@ -223,19 +223,19 @@ if the conversion is allowed; otherwise, . - method determines whether the strings contained in the configuration file can be converted to the related strongly typed properties. - - - -## Examples - The following example code shows how to override the method to create a custom converter type. Also, the example shows how to use this type in a custom section. - + method determines whether the strings contained in the configuration file can be converted to the related strongly typed properties. + + + +## Examples + The following example code shows how to override the method to create a custom converter type. Also, the example shows how to use this type in a custom section. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.TimeSpanMinutesConverter/CS/TimeSpanMinutesConverter.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.TimeSpanMinutesConverter/VB/TimeSpanMinutesConverter.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.TimeSpanMinutesConverter/VB/TimeSpanMinutesConverter.vb" id="Snippet2"::: + ]]> diff --git a/xml/System.Configuration/ConfigurationElement.xml b/xml/System.Configuration/ConfigurationElement.xml index fe2806f15ac..5440f5518d2 100644 --- a/xml/System.Configuration/ConfigurationElement.xml +++ b/xml/System.Configuration/ConfigurationElement.xml @@ -237,7 +237,7 @@ method. + The following example demonstrates how to extend the method. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationElement/CS/CustomElement.cs" id="Snippet33"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationElement/VB/CustomElement.vb" id="Snippet33"::: @@ -494,7 +494,7 @@ method and the method call this method in order to transform an assembly name when an earlier version of the .NET Framework is targeted. + The method and the method call this method in order to transform an assembly name when an earlier version of the .NET Framework is targeted. ]]> @@ -539,7 +539,7 @@ method and the method call this method in order to transform a type name when an earlier version of the .NET Framework is targeted. + The method and the method call this method in order to transform a type name when an earlier version of the .NET Framework is targeted. ]]> @@ -703,16 +703,16 @@ method determines whether this object will be written to the configuration file when the method is called. If the return value is `false`, it is assumed that the configuration file represents the current state of the element. + The method determines whether this object will be written to the configuration file when the method is called. If the return value is `false`, it is assumed that the configuration file represents the current state of the element. - By default, returns `true` after a property is set through the indexer to this object. + By default, returns `true` after a property is set through the indexer to this object. - Override the method to provide custom indication of the state of this element. + Override the method to provide custom indication of the state of this element. ## Examples - The following example shows how to extend . + The following example shows how to extend . :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationElement/CS/CustomElement.cs" id="Snippet35"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationElement/VB/CustomElement.vb" id="Snippet35"::: @@ -765,12 +765,12 @@ ## Remarks The system defines configuration elements that cannot be modified. - To determine which elements can be modified, use the method. + To determine which elements can be modified, use the method. ## Examples - The following example shows how to use the method. It is used on a custom section and returns `false`. + The following example shows how to use the method. It is used on a custom section and returns `false`. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationElement/CS/ConfigurationElement.cs" id="Snippet7"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationElement/VB/ConfigurationElement.vb" id="Snippet7"::: @@ -974,7 +974,7 @@ property allows you to lock all the attributes at once, with the exception of the one you specify. To do that, you use the method, as explained in the Example section. + The property allows you to lock all the attributes at once, with the exception of the one you specify. To do that, you use the method, as explained in the Example section. > [!NOTE] > The property allows you to prevent the child configuration elements of the element to which you apply the rule from being modified. Use the property if you want to put a general lock on the parent element itself and its child elements. @@ -982,7 +982,7 @@ ## Examples - The following example shows how to use the . + The following example shows how to use the . :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationElement/CS/ConfigurationElement.cs" id="Snippet9"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationElement/VB/ConfigurationElement.vb" id="Snippet9"::: @@ -1085,10 +1085,10 @@ ## Remarks The property allows you to lock all the attributes you specify. - To do that you use the method, as explained in the Example section. + To do that you use the method, as explained in the Example section. > [!NOTE] -> The property allows you to prevent the child configuration elements of the element to which you apply the rule from being modified. Use if you want to put a general lock on the element itself and its child elements. +> The property allows you to prevent the child configuration elements of the element to which you apply the rule from being modified. Use if you want to put a general lock on the element itself and its child elements. @@ -1143,10 +1143,10 @@ ## Remarks The property allows you to lock all the elements you specify. - To do that, you use the method, as explained in the next example. + To do that, you use the method, as explained in the next example. > [!NOTE] -> The property allows you to prevent the child configuration elements of the element to which you apply the rule from being modified. Use if you want to put a general lock on the element itself and its child elements. +> The property allows you to prevent the child configuration elements of the element to which you apply the rule from being modified. Use if you want to put a general lock on the element itself and its child elements. @@ -1202,7 +1202,7 @@ ## Examples - The following example shows how to use the . + The following example shows how to use the . :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationElement/CS/ConfigurationElement.cs" id="Snippet3"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationElement/VB/ConfigurationElement.vb" id="Snippet3"::: @@ -1254,7 +1254,7 @@ is invoked when an unknown attribute is encountered while deserializing the object. + The is invoked when an unknown attribute is encountered while deserializing the object. ]]> @@ -1302,7 +1302,7 @@ is invoked when an unknown attribute is encountered while deserializing the object. + The is invoked when an unknown attribute is encountered while deserializing the object. ]]> @@ -1372,7 +1372,7 @@ is invoked when an unknown attribute is encountered while deserializing the object. + The is invoked when an unknown attribute is encountered while deserializing the object. ]]> @@ -1580,7 +1580,7 @@ method is automatically called after changes to this object have been written to the configuration file. + The method is automatically called after changes to this object have been written to the configuration file. ]]> @@ -1633,7 +1633,7 @@ method. + The following example shows how to extend the method. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationElement/CS/CustomElement.cs" id="Snippet34"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationElement/VB/CustomElement.vb" id="Snippet34"::: @@ -1689,7 +1689,7 @@ method is called after the call to the method during serialization. The method writes out the contents of the configuration element between the beginning and ending tags of the element. Override to provide a custom serialization method. + The method is called after the call to the method during serialization. The method writes out the contents of the configuration element between the beginning and ending tags of the element. Override to provide a custom serialization method. ]]> @@ -1780,7 +1780,7 @@ ## Remarks This method is used internally to set aside those system-configuration elements that cannot be modified. - To determine which elements can be modified, use the method. + To determine which elements can be modified, use the method. ]]> diff --git a/xml/System.Configuration/ConfigurationElementCollection.xml b/xml/System.Configuration/ConfigurationElementCollection.xml index f742d2c9acf..16428a158dd 100644 --- a/xml/System.Configuration/ConfigurationElementCollection.xml +++ b/xml/System.Configuration/ConfigurationElementCollection.xml @@ -242,7 +242,7 @@ method to add a new to the collection. Override in a derived class if custom behavior is required when the element is added. + Use the method to add a new to the collection. Override in a derived class if custom behavior is required when the element is added. When adding, an element is considered a duplicate only if the keys are identical but the values are different. Elements with identical keys and values are accepted silently because the elements do not compete. However, an element with an identical key but a different value cannot be added because there is no logic to determine which of the competing values should be honored. @@ -288,14 +288,14 @@ method to add a new to the collection. Override it in a derived class if custom behavior is required when the element is added. + Use the method to add a new to the collection. Override it in a derived class if custom behavior is required when the element is added. When adding, an element is considered a duplicate only if the keys are identical but the values are different. Elements with identical keys and values are accepted silently because the elements do not compete. However, an element with an identical key but a different value cannot be added because there is no logic to determine which of the competing values should be honored. ## Examples - The following code example shows how to override the method and how to call it from an `Add` method. + The following code example shows how to override the method and how to call it from an `Add` method. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/system.configuration.configurationelementcollection/cs/customcollectionsection.cs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/system.configuration.configurationelementcollection/vb/customcollectionsection.vb" id="Snippet2"::: @@ -443,12 +443,12 @@ method is called, it removes all objects from the collection. It also inserts a `clear` directive into the configuration file. + When the method is called, it removes all objects from the collection. It also inserts a `clear` directive into the configuration file. ## Examples - The following code example shows how to call the method. + The following code example shows how to call the method. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/system.configuration.configurationelementcollection/cs/customcollectionsection.cs" id="Snippet3"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/system.configuration.configurationelementcollection/vb/customcollectionsection.vb" id="Snippet3"::: @@ -514,7 +514,7 @@ method. + The following code example shows how to call the method. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/system.configuration.configurationelementcollection/cs/customcollectionsection.cs" id="Snippet8"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/system.configuration.configurationelementcollection/vb/customcollectionsection.vb" id="Snippet8"::: @@ -572,12 +572,12 @@ method returns `null` if there is no object with the specified key in the collection. + The method returns `null` if there is no object with the specified key in the collection. ## Examples - The following code example shows how to call the method. + The following code example shows how to call the method. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/system.configuration.configurationelementcollection/cs/customcollectionsection.cs" id="Snippet9"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/system.configuration.configurationelementcollection/vb/customcollectionsection.vb" id="Snippet9"::: @@ -712,7 +712,7 @@ method. + The following code example shows how to call the method. :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/system.configuration.configurationelementcollection/vb/customcollectionsection.vb" id="Snippet10"::: @@ -805,12 +805,12 @@ method inserts a `` directive into the configuration file for the with the specified key. + The method inserts a `` directive into the configuration file for the with the specified key. ## Examples - The following code example shows how to call the method. + The following code example shows how to call the method. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/system.configuration.configurationelementcollection/cs/customcollectionsection.cs" id="Snippet3"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/system.configuration.configurationelementcollection/vb/customcollectionsection.vb" id="Snippet3"::: @@ -862,7 +862,7 @@ method inserts a `` directive into the configuration file for the element at the specified index location. + The method inserts a `` directive into the configuration file for the element at the specified index location. ]]> @@ -1063,7 +1063,7 @@ method to create custom objects of a specific type. When a collection is loaded from the configuration file, is called to create individual elements. must be overridden in classes that derive from the class. + Override the method to create custom objects of a specific type. When a collection is loaded from the configuration file, is called to create individual elements. must be overridden in classes that derive from the class. ]]> @@ -1105,12 +1105,12 @@ method to create custom objects of a specific type. When a collection is loaded from the configuration file, is called to create individual elements. must be overridden in classes that derive from the class. + Override the method to create custom objects of a specific type. When a collection is loaded from the configuration file, is called to create individual elements. must be overridden in classes that derive from the class. ## Examples - The following code example shows how to override the method. + The following code example shows how to override the method. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/system.configuration.configurationelementcollection/cs/customcollectionsection.cs" id="Snippet6"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/system.configuration.configurationelementcollection/vb/customcollectionsection.vb" id="Snippet6"::: @@ -1158,7 +1158,7 @@ method to create custom objects of a specific type. When a collection is loaded from the configuration file, is called to create individual elements. must be overridden in classes that derive from the class. + Override the method to create custom objects of a specific type. When a collection is loaded from the configuration file, is called to create individual elements. must be overridden in classes that derive from the class. ]]> @@ -1333,7 +1333,7 @@ method. + The following code example shows how to override method. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/system.configuration.configurationelementcollection/cs/customcollectionsection.cs" id="Snippet7"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/system.configuration.configurationelementcollection/vb/customcollectionsection.vb" id="Snippet7"::: @@ -1455,7 +1455,7 @@ method to provide custom behavior. + Override the method to provide custom behavior. ]]> @@ -1501,7 +1501,7 @@ before removing a collection element. + Query before removing a collection element. ]]> @@ -1548,7 +1548,7 @@ method of any contained within a returns `true`, the method of the entire collection returns `true` as well. + If the method of any contained within a returns `true`, the method of the entire collection returns `true` as well. ]]> @@ -1677,7 +1677,7 @@ is called when an unrecognized configuration element is read from a configuration file. + The is called when an unrecognized configuration element is read from a configuration file. Override this method to provide custom handling of unrecognized configuration elements from a configuration file. The default return value, `false`, causes the configuration system to throw an exception. @@ -1768,7 +1768,7 @@ method is to clear any modified elements a object contains and to set the modified elements to the values specified by their parent configuration file. If any element in the has child elements, is also called on those child elements. + The default behavior for the method is to clear any modified elements a object contains and to set the modified elements to the values specified by their parent configuration file. If any element in the has child elements, is also called on those child elements. ]]> @@ -1813,7 +1813,7 @@ method determines whether the elements of this collection will be written to the configuration file when the configuration is updated. + The method determines whether the elements of this collection will be written to the configuration file when the configuration is updated. ]]> @@ -1866,7 +1866,7 @@ method writes the contents of the configuration elements contained in the collection and any nested elements they contain to the configuration file. Override to provide a custom write procedure out of the collection contents and nested elements. + The method writes the contents of the configuration elements contained in the collection and any nested elements they contain to the configuration file. Override to provide a custom write procedure out of the collection contents and nested elements. ]]> @@ -1912,7 +1912,7 @@ method. + This method is used internally to set aside those system configuration elements that cannot be modified. To determine which elements are modifiable, call the method. ]]> @@ -2033,9 +2033,9 @@ value of the element is either or . + When you add a duplicate element, an exception is thrown if the value of the element is either or . - Note that elements with identical keys and values are not considered duplicates, and are accepted silently. Only elements with identical keys but different values are considered duplicates. For more information, see the Remarks section for the method. + Note that elements with identical keys and values are not considered duplicates, and are accepted silently. Only elements with identical keys but different values are considered duplicates. For more information, see the Remarks section for the method. ]]> diff --git a/xml/System.Configuration/ConfigurationErrorsException.xml b/xml/System.Configuration/ConfigurationErrorsException.xml index 5a2025e5306..866394815e8 100644 --- a/xml/System.Configuration/ConfigurationErrorsException.xml +++ b/xml/System.Configuration/ConfigurationErrorsException.xml @@ -544,7 +544,7 @@ property collects as many errors as possible that might occur during an operation, such as reading a configuration file. The exception thrown shows only the first error. You can access to see all the errors issued. + The property collects as many errors as possible that might occur during an operation, such as reading a configuration file. The exception thrown shows only the first error. You can access to see all the errors issued. ]]> @@ -642,7 +642,7 @@ method returns the name of the configuration file that contains the object being parsed when the exception occurred. + The method returns the name of the configuration file that contains the object being parsed when the exception occurred. ]]> @@ -687,7 +687,7 @@ method returns the name of the configuration file that the object was accessing when the exception occurred. + The method returns the name of the configuration file that the object was accessing when the exception occurred. ]]> @@ -741,7 +741,7 @@ method returns the name of the configuration file that contains the object being parsed when the exception occurred. + The method returns the name of the configuration file that contains the object being parsed when the exception occurred. ]]> @@ -786,7 +786,7 @@ method returns the name of the configuration file that the object was accessing when the exception occurred. + The method returns the name of the configuration file that the object was accessing when the exception occurred. ]]> @@ -842,7 +842,7 @@ method sets a object with the file name and line number at which this exception occurred. During deserialization, the exception is reconstituted from the object that is transmitted over the stream. + The method sets a object with the file name and line number at which this exception occurred. During deserialization, the exception is reconstituted from the object that is transmitted over the stream. ]]> diff --git a/xml/System.Configuration/ConfigurationException.xml b/xml/System.Configuration/ConfigurationException.xml index 31aaa7c156b..53f450e7e58 100644 --- a/xml/System.Configuration/ConfigurationException.xml +++ b/xml/System.Configuration/ConfigurationException.xml @@ -593,7 +593,7 @@ method sets a object with the file name and line number at which this exception occurred. During deserialization, the exception is reconstituted from the object that is transmitted over the stream. + The method sets a object with the file name and line number at which this exception occurred. During deserialization, the exception is reconstituted from the object that is transmitted over the stream. ]]> @@ -777,7 +777,7 @@ property contains a concatenation of the , , and properties. + The property contains a concatenation of the , , and properties. ]]> diff --git a/xml/System.Configuration/ConfigurationLocationCollection.xml b/xml/System.Configuration/ConfigurationLocationCollection.xml index 4ae7bf145d5..708ea5813cf 100644 --- a/xml/System.Configuration/ConfigurationLocationCollection.xml +++ b/xml/System.Configuration/ConfigurationLocationCollection.xml @@ -92,7 +92,7 @@ accessor to the class to get a specific object from the collection by specifying its index within the collection. + Use the accessor to the class to get a specific object from the collection by specifying its index within the collection. ]]> diff --git a/xml/System.Configuration/ConfigurationLockCollection.xml b/xml/System.Configuration/ConfigurationLockCollection.xml index 18007bb7697..9fa7f78d4ab 100644 --- a/xml/System.Configuration/ConfigurationLockCollection.xml +++ b/xml/System.Configuration/ConfigurationLockCollection.xml @@ -104,7 +104,7 @@ ## Examples - The following code example demonstrates how to use the method. This code example is part of a larger example provided for the class. + The following code example demonstrates how to use the method. This code example is part of a larger example provided for the class. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationLockCollection/CS/ConfigurationLockCollection.cs" id="Snippet3"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationLockCollection/VB/ConfigurationLockCollection.vb" id="Snippet3"::: @@ -193,7 +193,7 @@ method. This code example is part of a larger example provided for the class. + The following code example demonstrates how to use the method. This code example is part of a larger example provided for the class. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationLockCollection/CS/ConfigurationLockCollection.cs" id="Snippet11"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationLockCollection/VB/ConfigurationLockCollection.vb" id="Snippet11"::: @@ -495,7 +495,7 @@ method. This code example is part of a larger example provided for the class. + The following code example demonstrates how to use the method. This code example is part of a larger example provided for the class. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationLockCollection/CS/ConfigurationLockCollection.cs" id="Snippet9"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationLockCollection/VB/ConfigurationLockCollection.vb" id="Snippet9"::: @@ -581,7 +581,7 @@ method. This code example is part of a larger example provided for the class. + The following code example demonstrates how to use the method. This code example is part of a larger example provided for the class. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationLockCollection/CS/ConfigurationLockCollection.cs" id="Snippet10"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationLockCollection/VB/ConfigurationLockCollection.vb" id="Snippet10"::: @@ -629,7 +629,7 @@ method. This code example is part of a larger example provided for the class. + The following code example demonstrates how to use the method. This code example is part of a larger example provided for the class. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationLockCollection/CS/ConfigurationLockCollection.cs" id="Snippet12"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationLockCollection/VB/ConfigurationLockCollection.vb" id="Snippet12"::: diff --git a/xml/System.Configuration/ConfigurationManager.xml b/xml/System.Configuration/ConfigurationManager.xml index 3ef432408d3..6e5180887f1 100644 --- a/xml/System.Configuration/ConfigurationManager.xml +++ b/xml/System.Configuration/ConfigurationManager.xml @@ -48,7 +48,7 @@ The class includes members that enable you to perform the following tasks: -- Read a section from a configuration file. To access configuration information, call the method. For some sections such as `appSettings` and `connectionStrings`, use the and classes. These members perform read-only operations, use a single cached instance of the configuration, and are multithread aware. +- Read a section from a configuration file. To access configuration information, call the method. For some sections such as `appSettings` and `connectionStrings`, use the and classes. These members perform read-only operations, use a single cached instance of the configuration, and are multithread aware. - Read and write configuration files as a whole. Your application can read and write configuration settings at any level, for itself or for other applications or computers, locally or remotely. Use one of the methods provided by the class to open a configuration file such as SampleApp.exe.config. These methods return a object that in turn exposes methods and properties you can use to work with the associated configuration files. The methods perform read or write operations and create the configuration data every time that a file is written. @@ -644,16 +644,16 @@ End Module ## Remarks For client applications, this method retrieves a configuration file obtained by merging the application configuration file, the local user configuration file, and the roaming configuration file. - The method accesses run-time configuration information that it cannot change. To change the configuration, you use the method on the configuration file that you obtain by using one of the following methods: + The method accesses run-time configuration information that it cannot change. To change the configuration, you use the method on the configuration file that you obtain by using one of the following methods: -- +- -- +- -- +- ## Examples - The following example shows how to use the method. The example is part of a larger example that is provided for the class. + The following example shows how to use the method. The example is part of a larger example that is provided for the class. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationManager/CS/configurationmanager.cs" id="Snippet7"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationManager/VB/configurationmanager.vb" id="Snippet7"::: @@ -729,7 +729,7 @@ End Module > To get the object for a resource, your code must have read permissions on all the configuration files from which it inherits settings. To update a configuration file, your code must additionally have write permissions for both the configuration file and the directory in which it exists. ## Examples - The following code example shows how to use the method. + The following code example shows how to use the method. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationManager/CS/configurationmanager.cs" id="Snippet5"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationManager/VB/configurationmanager.vb" id="Snippet5"::: @@ -781,10 +781,10 @@ End Module ## Remarks -Calling this method overload is equivalent to calling the overload with the `preLoad` parameter set to `false`. +Calling this method overload is equivalent to calling the overload with the `preLoad` parameter set to `false`. ## Examples - The following code example shows how to use the method. + The following code example shows how to use the method. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationManager/CS/configurationmanager.cs" id="Snippet6"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationManager/VB/configurationmanager.vb" id="Snippet6"::: @@ -840,7 +840,7 @@ Calling this method overload is equivalent to calling the To obtain the object for a resource, your code must have read permissions on all the configuration files from which it inherits settings. To update a configuration file, your code must additionally have write permissions for both the configuration file and the directory in which it exists. It is not possible to access the Machine.config file for other versions of the .NET Framework that might be installed on the computer. ## Examples - The following code example shows how to use the method to obtain all sections that are contained in the configuration file. + The following code example shows how to use the method to obtain all sections that are contained in the configuration file. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationManager/CS/configurationmanager.cs" id="Snippet4"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationManager/VB/configurationmanager.vb" id="Snippet4"::: @@ -907,7 +907,7 @@ Calling this method overload is equivalent to calling the To obtain the object for a resource, your code must have read permissions on all the configuration files from which it inherits settings. To update a configuration file, your code must additionally have write permissions for both the configuration file and the directory in which it exists. ## Examples - The following code example shows how to use the method to obtain all sections that are contained by the configuration file. + The following code example shows how to use the method to obtain all sections that are contained by the configuration file. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationManager/CS/configurationmanager.cs" id="Snippet9"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationManager/VB/configurationmanager.vb" id="Snippet9"::: @@ -967,7 +967,7 @@ Calling this method overload is equivalent to calling the [!NOTE] > To obtain the object for a resource, your code must have read permissions on all the configuration files from which it inherits settings. To update a configuration file, your code must additionally have write permissions for both the configuration file and the directory in which it exists. - For a code example, see the overload. + For a code example, see the overload. ]]> @@ -1021,7 +1021,7 @@ Calling this method overload is equivalent to calling the To obtain the object for a resource, your code must have read permissions on all the configuration files from which it inherits settings. To update a configuration file, your code must additionally have write permissions for both the configuration file and the directory in which it exists. It is not possible to access the Machine.config file for other versions of the .NET Framework that might be installed on the computer. ## Examples - The following code example shows how to use the method to obtain all sections in the configuration file. + The following code example shows how to use the method to obtain all sections in the configuration file. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationManager/CS/configurationmanager.cs" id="Snippet4"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationManager/VB/configurationmanager.vb" id="Snippet4"::: @@ -1074,7 +1074,7 @@ Calling this method overload is equivalent to calling the method to refresh the application settings configuration section. + The following code example shows how to use the method to refresh the application settings configuration section. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationManager/CS/configurationmanager.cs" id="Snippet7"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationManager/VB/configurationmanager.vb" id="Snippet7"::: diff --git a/xml/System.Configuration/ConfigurationPermission.xml b/xml/System.Configuration/ConfigurationPermission.xml index e9a4aed050e..c87d84ea21d 100644 --- a/xml/System.Configuration/ConfigurationPermission.xml +++ b/xml/System.Configuration/ConfigurationPermission.xml @@ -53,7 +53,7 @@ [!INCLUDE[cas-deprecated](~/includes/cas-deprecated.md)] - The class provides a permission structure that allows methods or classes to access configuration files. Also, provides ways to resolve multiple permissions values through such methods as and . + The class provides a permission structure that allows methods or classes to access configuration files. Also, provides ways to resolve multiple permissions values through such methods as and . ]]> @@ -223,7 +223,7 @@ The attribute for the given interface, an exception will be thrown if calling the method on the object referenced by the `target` parameter does not return . + Although the method signature accepts any object that implements the interface, an exception will be thrown if calling the method on the object referenced by the `target` parameter does not return . ]]> @@ -271,7 +271,7 @@ The attribute for the given interface, an exception will be thrown if calling the method on the object referenced by the `target` parameter does not return . + Although the method signature accepts any object that implements the interface, an exception will be thrown if calling the method on the object referenced by the `target` parameter does not return . If the object referenced by the `target` parameter is `null`, the comparison is done between the permission state of the object and the value of the enumeration. diff --git a/xml/System.Configuration/ConfigurationProperty.xml b/xml/System.Configuration/ConfigurationProperty.xml index c22a93ce979..3f3b029a8ba 100644 --- a/xml/System.Configuration/ConfigurationProperty.xml +++ b/xml/System.Configuration/ConfigurationProperty.xml @@ -179,12 +179,12 @@ object using this constructor, the and properties are set to `false`. Additionally, an instance made with this constructor will not function as a default collection-key property. + When you instantiate a object using this constructor, the and properties are set to `false`. Additionally, an instance made with this constructor will not function as a default collection-key property. ## Examples - The following code example shows how to use the constructor to instantiate a configuration-property object. + The following code example shows how to use the constructor to instantiate a configuration-property object. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationProperty/CS/ConfigurationProperty.cs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationProperty/VB/ConfigurationProperty.vb" id="Snippet2"::: @@ -241,7 +241,7 @@ constructor to instantiate a configuration-property object. + The following code example shows how to use constructor to instantiate a configuration-property object. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationProperty/CS/ConfigurationProperty.cs" id="Snippet3"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationProperty/VB/ConfigurationProperty.vb" id="Snippet3"::: @@ -302,7 +302,7 @@ constructor. + The following code example shows the kind of parameters to use when calling the constructor. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationProperty/CS/ConfigurationProperty.cs" id="Snippet4"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationProperty/VB/ConfigurationProperty.vb" id="Snippet4"::: @@ -365,7 +365,7 @@ constructor to instantiate a configuration-property object. + The following code example shows how to use the constructor to instantiate a configuration-property object. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationProperty/CS/ConfigurationProperty.cs" id="Snippet4"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationProperty/VB/ConfigurationProperty.vb" id="Snippet4"::: @@ -473,7 +473,7 @@ ## Examples - The following code example shows how to get the for a specified property. + The following code example shows how to get the for a specified property. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationProperty/CS/ConfigurationProperty.cs" id="Snippet6"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationProperty/VB/ConfigurationProperty.vb" id="Snippet6"::: @@ -524,7 +524,7 @@ for a specified property. + The following code example shows how to get the for a specified property. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationProperty/CS/ConfigurationProperty.cs" id="Snippet11"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationProperty/VB/ConfigurationProperty.vb" id="Snippet11"::: @@ -863,7 +863,7 @@ ## Examples - The following code example shows how to get the for a specified property. + The following code example shows how to get the for a specified property. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationProperty/CS/ConfigurationProperty.cs" id="Snippet9"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationProperty/VB/ConfigurationProperty.vb" id="Snippet9"::: @@ -970,7 +970,7 @@ for a specified property. + The following code example shows how to get the for a specified property. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationProperty/CS/ConfigurationProperty.cs" id="Snippet12"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationProperty/VB/ConfigurationProperty.vb" id="Snippet12"::: diff --git a/xml/System.Configuration/ConfigurationPropertyAttribute.xml b/xml/System.Configuration/ConfigurationPropertyAttribute.xml index f95c3c5e406..1ae43cd7715 100644 --- a/xml/System.Configuration/ConfigurationPropertyAttribute.xml +++ b/xml/System.Configuration/ConfigurationPropertyAttribute.xml @@ -259,7 +259,7 @@ property applies only if the property you decorate is a collection. It does not have any effect if the property is not a collection. Multiple elements can be marked as . + The property applies only if the property you decorate is a collection. It does not have any effect if the property is not a collection. Multiple elements can be marked as . diff --git a/xml/System.Configuration/ConfigurationPropertyCollection.xml b/xml/System.Configuration/ConfigurationPropertyCollection.xml index fbdd2cc0f16..d0dc56f2033 100644 --- a/xml/System.Configuration/ConfigurationPropertyCollection.xml +++ b/xml/System.Configuration/ConfigurationPropertyCollection.xml @@ -108,12 +108,12 @@ to create a new collection that will contain the objects as they apply to your configuration element. + You use the to create a new collection that will contain the objects as they apply to your configuration element. ## Examples - The following example shows how to use the constructor. + The following example shows how to use the constructor. @@ -165,12 +165,12 @@ method will add the specified object, if it is not already contained within the collection. + By default, the method will add the specified object, if it is not already contained within the collection. ## Examples - The following example shows how to use the method. + The following example shows how to use the method. @@ -219,7 +219,7 @@ method. + The following example shows how to use the method. @@ -277,7 +277,7 @@ method. + The following example shows how to use the method. @@ -331,7 +331,7 @@ method. + The following example shows how to use the method. @@ -421,7 +421,7 @@ method. + The following example shows how to use the method. @@ -590,7 +590,7 @@ ## Examples - The following example shows how to use the method. + The following example shows how to use the method. diff --git a/xml/System.Configuration/ConfigurationSaveMode.xml b/xml/System.Configuration/ConfigurationSaveMode.xml index e36e0b48dfb..af0f3c1f3f2 100644 --- a/xml/System.Configuration/ConfigurationSaveMode.xml +++ b/xml/System.Configuration/ConfigurationSaveMode.xml @@ -32,11 +32,11 @@ Determines which properties are written out to a configuration file. - enumeration values identify which properties are written out to a configuration file when calling the and methods. - + enumeration values identify which properties are written out to a configuration file when calling the and methods. + ]]> diff --git a/xml/System.Configuration/ConfigurationSection.xml b/xml/System.Configuration/ConfigurationSection.xml index 61782cc88c8..9262aefa686 100644 --- a/xml/System.Configuration/ConfigurationSection.xml +++ b/xml/System.Configuration/ConfigurationSection.xml @@ -131,12 +131,12 @@ Note: If you use a static method that takes a constructor, you need to define a custom section type first. For an example see the class overview. + To use the constructor, you need to define a custom section type first. For an example see the class overview. ## Examples - The following example shows how to use the constructor. This example assumes that you have created a custom section class named `CustomSection`. For an example of such a class, see the class overview. + The following example shows how to use the constructor. This example assumes that you have created a custom section class named `CustomSection`. For an example of such a class, see the class overview. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationSection/CS/CustomConfigurationSection.cs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationSection/VB/CustomConfigurationSection.vb" id="Snippet2"::: @@ -235,14 +235,14 @@ Note: If you use a static method that takes a method is called at run time, the configuration system first creates an appropriate instance of the class, and then returns the object it obtains from the method. + When the method is called at run time, the configuration system first creates an appropriate instance of the class, and then returns the object it obtains from the method. - By default, simply returns the object that represents the from which it is called. + By default, simply returns the object that represents the from which it is called. ## Examples - The following example shows how to use the method. + The following example shows how to use the method. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationSection/CS/CustomConfigurationSection.cs" id="Snippet4"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationSection/VB/CustomConfigurationSection.vb" id="Snippet4"::: diff --git a/xml/System.Configuration/ConfigurationSectionCollection.xml b/xml/System.Configuration/ConfigurationSectionCollection.xml index c739995099a..20e03c810ae 100644 --- a/xml/System.Configuration/ConfigurationSectionCollection.xml +++ b/xml/System.Configuration/ConfigurationSectionCollection.xml @@ -125,7 +125,7 @@ ## Examples - The following example shows how to use the method. + The following example shows how to use the method. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationSectionCollection/CS/ConfigurationSectionCollection.cs" id="Snippet10"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationSectionCollection/VB/ConfigurationSectionCollection.vb" id="Snippet10"::: @@ -172,7 +172,7 @@ method. + The following code example shows how to use the method. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationSectionCollection/CS/ConfigurationSectionCollection.cs" id="Snippet3"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationSectionCollection/VB/ConfigurationSectionCollection.vb" id="Snippet3"::: @@ -347,7 +347,7 @@ . + The following code example shows how to use . :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationSectionCollection/CS/ConfigurationSectionCollection.cs" id="Snippet4"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationSectionCollection/VB/ConfigurationSectionCollection.vb" id="Snippet4"::: @@ -412,7 +412,7 @@ . + The following code example shows how to use . :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationSectionCollection/CS/ConfigurationSectionCollection.cs" id="Snippet5"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationSectionCollection/VB/ConfigurationSectionCollection.vb" id="Snippet5"::: @@ -463,7 +463,7 @@ . + The following code example shows how to use . :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationSectionCollection/CS/ConfigurationSectionCollection.cs" id="Snippet6"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationSectionCollection/VB/ConfigurationSectionCollection.vb" id="Snippet6"::: @@ -526,7 +526,7 @@ method is used during serialization; that is, when persisting configuration data to a configuration file. + The method is used during serialization; that is, when persisting configuration data to a configuration file. ]]> @@ -587,7 +587,7 @@ ## Examples - The following code example shows how to use . + The following code example shows how to use . :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationSectionCollection/CS/ConfigurationSectionCollection.cs" id="Snippet8"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationSectionCollection/VB/ConfigurationSectionCollection.vb" id="Snippet8"::: @@ -645,7 +645,7 @@ ## Examples - The following code example shows how to use . + The following code example shows how to use . :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationSectionCollection/CS/ConfigurationSectionCollection.cs" id="Snippet8"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationSectionCollection/VB/ConfigurationSectionCollection.vb" id="Snippet8"::: @@ -743,7 +743,7 @@ method. + The following example shows how to use the method. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationSectionCollection/CS/ConfigurationSectionCollection.cs" id="Snippet9"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationSectionCollection/VB/ConfigurationSectionCollection.vb" id="Snippet9"::: diff --git a/xml/System.Configuration/ConfigurationSectionGroup.xml b/xml/System.Configuration/ConfigurationSectionGroup.xml index ff8a2a5fe03..c1d85782eff 100644 --- a/xml/System.Configuration/ConfigurationSectionGroup.xml +++ b/xml/System.Configuration/ConfigurationSectionGroup.xml @@ -53,7 +53,7 @@ ``` - The configuration system loads settings from configuration files into objects. You can use the and properties to access the sections and section groups that are contained in a object. + The configuration system loads settings from configuration files into objects. You can use the and properties to access the sections and section groups that are contained in a object. For more information about how to access information from configuration files, see the class. @@ -62,7 +62,7 @@ ## Examples The following example shows how to use the class to retrieve configuration settings. The example is a console application that reads configuration settings and writes information about each configuration section group and the sections in it to the console. - The `Main` method loads the configuration settings into a object, retrieves the collection from the object, and then calls the `ShowSectionGroupCollectionInfo` method to display the section property values. + The `Main` method loads the configuration settings into a object, retrieves the collection from the object, and then calls the `ShowSectionGroupCollectionInfo` method to display the section property values. The `ShowSectionGroupCollectionInfo` method iterates through the section groups and calls the `ShowSectionGroupInfo` method for each one. @@ -154,12 +154,12 @@ method can force a object to be written to a configuration file, even if it is not required because it is already declared in a parent file. + The method can force a object to be written to a configuration file, even if it is not required because it is already declared in a parent file. ## Examples - The following code example shows how to use the method. + The following code example shows how to use the method. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationSectionGroup/CS/ConfigurationSectionGroup.cs" id="Snippet12"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationSectionGroup/VB/ConfigurationSectionGroup.vb" id="Snippet12"::: @@ -210,16 +210,16 @@ method forces this declaration to be written to the file if `force` is `true`. If `force` is `false`, this action might be ignored if the object is required by the system. + The method forces this declaration to be written to the file if `force` is `true`. If `force` is `false`, this action might be ignored if the object is required by the system. - The method can force a object to be written to a configuration file, even if it is not required because it is already declared in a parent file. Also, it can remove a group from a configuration file if the group is not required. + The method can force a object to be written to a configuration file, even if it is not required because it is already declared in a parent file. Also, it can remove a group from a configuration file if the group is not required. - You might want to use the method to make a configuration file more portable from one computer to another, without worrying about whether the group declaration already exists. + You might want to use the method to make a configuration file more portable from one computer to another, without worrying about whether the group declaration already exists. ## Examples - The following code example shows how to use the method. + The following code example shows how to use the method. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationSectionGroup/CS/ConfigurationSectionGroup.cs" id="Snippet13"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationSectionGroup/VB/ConfigurationSectionGroup.vb" id="Snippet13"::: diff --git a/xml/System.Configuration/ConfigurationSectionGroupCollection.xml b/xml/System.Configuration/ConfigurationSectionGroupCollection.xml index f1c83af1d44..1342acca1ae 100644 --- a/xml/System.Configuration/ConfigurationSectionGroupCollection.xml +++ b/xml/System.Configuration/ConfigurationSectionGroupCollection.xml @@ -159,12 +159,12 @@ method. + This method is a wrapper around the method. ## Examples - The following code example shows how to use the method. + The following code example shows how to use the method. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationSectionGroupCollection/CS/ConfigurationSectionGroupCollection.cs" id="Snippet3"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationSectionGroupCollection/VB/ConfigurationSectionGroupCollection.vb" id="Snippet3"::: @@ -264,7 +264,7 @@ method. + This method is a wrapper around the method. ]]> @@ -309,7 +309,7 @@ method. + This method is a wrapper around the method. ]]> @@ -354,12 +354,12 @@ method. + This method is a wrapper around the method. ## Examples - The following code example shows how to use the method. + The following code example shows how to use the method. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationSectionGroupCollection/CS/ConfigurationSectionGroupCollection.cs" id="Snippet4"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationSectionGroupCollection/VB/ConfigurationSectionGroupCollection.vb" id="Snippet4"::: @@ -424,7 +424,7 @@ method. + The following code example shows how to use the method. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationSectionGroupCollection/CS/ConfigurationSectionGroupCollection.cs" id="Snippet5"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationSectionGroupCollection/VB/ConfigurationSectionGroupCollection.vb" id="Snippet5"::: @@ -475,7 +475,7 @@ method. + The following code example shows how to use the method. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationSectionGroupCollection/CS/ConfigurationSectionGroupCollection.cs" id="Snippet6"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationSectionGroupCollection/VB/ConfigurationSectionGroupCollection.vb" id="Snippet6"::: @@ -538,7 +538,7 @@ method is used during serialization; that is, when persisting configuration data to a configuration file. + The method is used during serialization; that is, when persisting configuration data to a configuration file. ]]> @@ -743,7 +743,7 @@ method. + The following code example shows how to use the method. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationSectionGroupCollection/CS/ConfigurationSectionGroupCollection.cs" id="Snippet9"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationSectionGroupCollection/VB/ConfigurationSectionGroupCollection.vb" id="Snippet9"::: diff --git a/xml/System.Configuration/ConfigurationUserLevel.xml b/xml/System.Configuration/ConfigurationUserLevel.xml index 10a64787f60..ee3b438eb9c 100644 --- a/xml/System.Configuration/ConfigurationUserLevel.xml +++ b/xml/System.Configuration/ConfigurationUserLevel.xml @@ -32,23 +32,23 @@ Used to specify which configuration file is to be represented by the Configuration object. - to specify which configuration file is to be represented by the Configuration object returned by and . - - Application configuration files are in the same directory as the application and have the same name, but with a .config extension. For example, the configuration file for C:\System\Public.exe is C:\System\Public.exe.config. - - Applications use a global configuration that applies to all users, separate configurations that apply to individual users, and configurations that apply to roaming users. - - - -## Examples - The following example shows how to use the enumeration. - + to specify which configuration file is to be represented by the Configuration object returned by and . + + Application configuration files are in the same directory as the application and have the same name, but with a .config extension. For example, the configuration file for C:\System\Public.exe is C:\System\Public.exe.config. + + Applications use a global configuration that applies to all users, separate configurations that apply to individual users, and configurations that apply to roaming users. + + + +## Examples + The following example shows how to use the enumeration. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/system.configuration.configurationuserlevel/cs/configurationuserlevel.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/system.configuration.configurationuserlevel/vb/configurationuserlevel.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/system.configuration.configurationuserlevel/vb/configurationuserlevel.vb" id="Snippet1"::: + ]]> diff --git a/xml/System.Configuration/ConfigurationValidatorBase.xml b/xml/System.Configuration/ConfigurationValidatorBase.xml index 8bd048069e4..b46086f2212 100644 --- a/xml/System.Configuration/ConfigurationValidatorBase.xml +++ b/xml/System.Configuration/ConfigurationValidatorBase.xml @@ -33,11 +33,11 @@ Acts as a base class for deriving a validation class so that a value of an object can be verified. - class is used to create a custom validator. A custom validator can be used to verify object values. - + class is used to create a custom validator. A custom validator can be used to verify object values. + ]]> @@ -147,11 +147,11 @@ The object value. Determines whether the value of an object is valid. - class contains the criteria necessary to validate an object. The criteria are established when the derived class is instantiated. The object to validate is passed as a parameter of the method. - + class contains the criteria necessary to validate an object. The criteria are established when the derived class is instantiated. The object to validate is passed as a parameter of the method. + ]]> diff --git a/xml/System.Configuration/ConnectionStringSettingsCollection.xml b/xml/System.Configuration/ConnectionStringSettingsCollection.xml index dd121f6570a..f2f14253474 100644 --- a/xml/System.Configuration/ConnectionStringSettingsCollection.xml +++ b/xml/System.Configuration/ConnectionStringSettingsCollection.xml @@ -209,7 +209,7 @@ method removes all the connection strings from the configuration file at the current configuration hierarchy level and writes a `` tag in the file. The `` tag signifies that all the connection strings defined in the parent configuration files are disregarded by the system. + The method removes all the connection strings from the configuration file at the current configuration hierarchy level and writes a `` tag in the file. The `` tag signifies that all the connection strings defined in the parent configuration files are disregarded by the system. diff --git a/xml/System.Configuration/ContextInformation.xml b/xml/System.Configuration/ContextInformation.xml index 2f67816e99c..46a1a12082c 100644 --- a/xml/System.Configuration/ContextInformation.xml +++ b/xml/System.Configuration/ContextInformation.xml @@ -131,7 +131,7 @@ value is , , or `null`. + The possible value is , , or `null`. @@ -183,7 +183,7 @@ is `false`, use the property to determine the level within the configuration hierarchy. + When the returned value of is `false`, use the property to determine the level within the configuration hierarchy. diff --git a/xml/System.Configuration/DefaultSettingValueAttribute.xml b/xml/System.Configuration/DefaultSettingValueAttribute.xml index d3ef490efd8..664fb977669 100644 --- a/xml/System.Configuration/DefaultSettingValueAttribute.xml +++ b/xml/System.Configuration/DefaultSettingValueAttribute.xml @@ -165,7 +165,7 @@ property is set in the constructor. + The property is set in the constructor. Setting providers may support multiple serialization schemes that can be specified with the . diff --git a/xml/System.Configuration/DefaultValidator.xml b/xml/System.Configuration/DefaultValidator.xml index 19e940a7b5e..661d02cb52f 100644 --- a/xml/System.Configuration/DefaultValidator.xml +++ b/xml/System.Configuration/DefaultValidator.xml @@ -144,11 +144,11 @@ The object value. Determines whether the value of an object is valid. - method validates any object with a value. - + method validates any object with a value. + ]]> diff --git a/xml/System.Configuration/DpapiProtectedConfigurationProvider.xml b/xml/System.Configuration/DpapiProtectedConfigurationProvider.xml index 34c588bfcb8..b9719c7439d 100644 --- a/xml/System.Configuration/DpapiProtectedConfigurationProvider.xml +++ b/xml/System.Configuration/DpapiProtectedConfigurationProvider.xml @@ -128,7 +128,7 @@ The following configuration excerpts show the configuration section before and a constructor is not intended to be used directly from your code. It is called by the ASP.NET configuration system. + The constructor is not intended to be used directly from your code. It is called by the ASP.NET configuration system. ]]> diff --git a/xml/System.Configuration/ElementInformation.xml b/xml/System.Configuration/ElementInformation.xml index f0d3171a553..1f4b8dbeed2 100644 --- a/xml/System.Configuration/ElementInformation.xml +++ b/xml/System.Configuration/ElementInformation.xml @@ -108,7 +108,7 @@ collection. + The following example shows how to use the collection. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationElement/CS/ElementInformation.cs" id="Snippet89"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationElement/VB/ElementInformation.vb" id="Snippet89"::: @@ -198,7 +198,7 @@ property returns `true` when the related element is locked by the , , or property. + The property returns `true` when the related element is locked by the , , or property. @@ -341,7 +341,7 @@ ## Examples - The following example shows how to get the collection. + The following example shows how to get the collection. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationElement/CS/ElementInformation.cs" id="Snippet85"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationElement/VB/ElementInformation.vb" id="Snippet85"::: diff --git a/xml/System.Configuration/ExeConfigurationFileMap.xml b/xml/System.Configuration/ExeConfigurationFileMap.xml index 6e200d62fad..c1badccf207 100644 --- a/xml/System.Configuration/ExeConfigurationFileMap.xml +++ b/xml/System.Configuration/ExeConfigurationFileMap.xml @@ -41,7 +41,7 @@ ## Examples - For an example that shows how to use this class, see the method. + For an example that shows how to use this class, see the method. ]]> diff --git a/xml/System.Configuration/GenericEnumConverter.xml b/xml/System.Configuration/GenericEnumConverter.xml index 478d8c7a1f3..2637263e666 100644 --- a/xml/System.Configuration/GenericEnumConverter.xml +++ b/xml/System.Configuration/GenericEnumConverter.xml @@ -33,48 +33,48 @@ Converts between a string and an enumeration type. - object converts a value, assigned to a configuration property, to an value and vice versa. - - - -## Examples - The following code example shows how to access a custom section property that uses the type. - + object converts a value, assigned to a configuration property, to an value and vice versa. + + + +## Examples + The following code example shows how to access a custom section property that uses the type. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.GenericEnumConverter/CS/GenericEnumConverter.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.GenericEnumConverter/VB/GenericEnumConverter.vb" id="Snippet1"::: - - The following code example shows how to define a custom enumerator property accessed in the previous example. Notice that there is no need to specify the type; it is implicitly invoked by the system. - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.GenericEnumConverter/VB/GenericEnumConverter.vb" id="Snippet1"::: + + The following code example shows how to define a custom enumerator property accessed in the previous example. Notice that there is no need to specify the type; it is implicitly invoked by the system. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationConvertersCustomSection/CS/ConfigurationConvertersCustomSection.cs" id="Snippet5"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationConvertersCustomSection/VB/ConfigurationConvertersCustomSection.vb" id="Snippet5"::: - - The following example is a configuration excerpt used by the previous example. - -```xml - - - - -
- - - - - -``` - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationConvertersCustomSection/VB/ConfigurationConvertersCustomSection.vb" id="Snippet5"::: + + The following example is a configuration excerpt used by the previous example. + +```xml + + + + +
+ + + + + +``` + ]]> @@ -118,11 +118,11 @@ The enumeration type to convert. Initializes a new instance of the class. - constructor is when you create your own conversion type. - + constructor is when you create your own conversion type. + ]]> @@ -169,22 +169,22 @@ Converts a to an type. The type that represents the parameter. - method when it reads from a configuration file to convert a value to an type. - + method when it reads from a configuration file to convert a value to an type. + ]]> - is null or an empty string (""). - + is null or an empty string (""). + -or- - - starts with a numeric character. - + + starts with a numeric character. + -or- - + includes white space. @@ -230,11 +230,11 @@ Converts an type to a value. The that represents the parameter. - method when it writes to a configuration file to convert a type to a value. - + method when it writes to a configuration file to convert a type to a value. + ]]> diff --git a/xml/System.Configuration/IApplicationSettingsProvider.xml b/xml/System.Configuration/IApplicationSettingsProvider.xml index c33dbba461c..fbe5e2773a5 100644 --- a/xml/System.Configuration/IApplicationSettingsProvider.xml +++ b/xml/System.Configuration/IApplicationSettingsProvider.xml @@ -95,7 +95,7 @@ method in conjunction with the method to migrate application settings during or after the installation of a new version of an application. + You can use the method in conjunction with the method to migrate application settings during or after the installation of a new version of an application. ]]> @@ -142,7 +142,7 @@ method reinitializes the stored values of the specified application settings group. In contrast, supplies a default value for a single settings property during property initialization, if it has no stored value. + The method reinitializes the stored values of the specified application settings group. In contrast, supplies a default value for a single settings property during property initialization, if it has no stored value. The settings provider determines what reasonable defaults are for the specified group of application settings. For example, the implementation in resets user-scoped settings to their shared values in the `application.exe.config` file; in contrast, it leaves the application-scoped settings unchanged. @@ -192,9 +192,9 @@ method, implemented in a class derived from . + The .NET Framework enables side-by-side installation and execution of different versions of the same application. The application settings provider stores the application settings for each version of an application separately to ensure isolation. However, you may want to migrate settings from the previous version of an application to the current one. To provide this migration functionality, use the method, implemented in a class derived from . - You can use the method in conjunction with the method to migrate application settings during or after the installation of a new version of an application. + You can use the method in conjunction with the method to migrate application settings during or after the installation of a new version of an application. This method should be suppressed for every application setting that has the is applied to it, or to the entire settings wrapper class, derived from . diff --git a/xml/System.Configuration/IConfigurationSectionHandler.xml b/xml/System.Configuration/IConfigurationSectionHandler.xml index 12c7c000114..ce48aa7a0b4 100644 --- a/xml/System.Configuration/IConfigurationSectionHandler.xml +++ b/xml/System.Configuration/IConfigurationSectionHandler.xml @@ -39,9 +39,9 @@ > [!IMPORTANT] > is deprecated starting in .NET Framework 2.0. In .NET Framework version 2.0 and later, you must instead derive from the class to implement the related configuration section handler. You can find an example at [How to: Create Custom Configuration Sections Using ConfigurationSection](https://learn.microsoft.com/previous-versions/aspnet/2tw134k3(v=vs.100)). - Instances of the class must be thread safe and stateless. The method must be callable from multiple threads simultaneously. + Instances of the class must be thread safe and stateless. The method must be callable from multiple threads simultaneously. - Furthermore, the configuration object generated by the method must be thread safe and immutable. Because the configuration objects are cached by the configuration system, it is important not to modify the parent argument to the method. For example, if the return value of is only a small modification of the parent, actual modifications must be made on a clone of the parent, not the original. + Furthermore, the configuration object generated by the method must be thread safe and immutable. Because the configuration objects are cached by the configuration system, it is important not to modify the parent argument to the method. For example, if the return value of is only a small modification of the parent, actual modifications must be made on a clone of the parent, not the original. ]]> @@ -91,9 +91,9 @@ class must be thread safe and stateless. The method must be callable from multiple threads simultaneously. + Instances of the class must be thread safe and stateless. The method must be callable from multiple threads simultaneously. - Furthermore, the configuration object generated by the method must be thread safe and immutable. Because the configuration objects are cached by the configuration system, it is important not to modify the parent argument to . For example, if the return value of is only a small modification of the parent, actual modifications must be made on a clone of the parent, not the original. + Furthermore, the configuration object generated by the method must be thread safe and immutable. Because the configuration objects are cached by the configuration system, it is important not to modify the parent argument to . For example, if the return value of is only a small modification of the parent, actual modifications must be made on a clone of the parent, not the original. ]]> diff --git a/xml/System.Configuration/IPersistComponentSettings.xml b/xml/System.Configuration/IPersistComponentSettings.xml index a8397ef37c0..454d8499c01 100644 --- a/xml/System.Configuration/IPersistComponentSettings.xml +++ b/xml/System.Configuration/IPersistComponentSettings.xml @@ -77,11 +77,11 @@ method performs two essential operations: + In general, the method performs two essential operations: -- It causes each application settings instance contained by the control to refresh the values of its application settings properties, typically by calling their methods. +- It causes each application settings instance contained by the control to refresh the values of its application settings properties, typically by calling their methods. -- As required, it updates those general properties that depend on these reloaded settings properties. For example, if the settings class contained a `location` settings property, should ensure that the control's property is updated to reflect this reloaded setting. +- As required, it updates those general properties that depend on these reloaded settings properties. For example, if the settings class contained a `location` settings property, should ensure that the control's property is updated to reflect this reloaded setting. ]]> @@ -125,7 +125,7 @@ method typically calls the method on each instance of an application settings class it contains. + The implementation of the method typically calls the method on each instance of an application settings class it contains. ]]> @@ -168,10 +168,10 @@ method writes the values of the control's application settings properties to the associated data store. The data store and serialization technique the method uses is determined by the settings provider associated with each settings class through the . You can override the choice of the settings provider by using the interface. + The method writes the values of the control's application settings properties to the associated data store. The data store and serialization technique the method uses is determined by the settings provider associated with each settings class through the . You can override the choice of the settings provider by using the interface. > [!NOTE] -> If the property is `true`, the control should call in its own method so that the control's configuration data is stored automatically before the application ends. +> If the property is `true`, the control should call in its own method so that the control's configuration data is stored automatically before the application ends. ]]> @@ -220,9 +220,9 @@ method or sometimes implicitly when the control's method is invoked. The property determines whether a control automatically persists its configuration data when it is disposed. + If a control contains configuration data, it will typically persist this data in response to an explicit call to the method or sometimes implicitly when the control's method is invoked. The property determines whether a control automatically persists its configuration data when it is disposed. - The default value of depends on the implementation of the control. The documentation for the control should indicate whether it uses application settings, what data is persisted, and what the default value of the property is. + The default value of depends on the implementation of the control. The documentation for the control should indicate whether it uses application settings, what data is persisted, and what the default value of the property is. @@ -294,13 +294,13 @@ ## Remarks Use the property to disambiguate groups of application settings properties when there are multiple instances of the same wrapper class. For example, if a control contains an associated wrapper class, then placing multiple instances of the same control in the same application will typically result in multiple instances of the wrapper class. A settings key is required only when the configuration data differs on a per-instance basis; for example, the location of dynamically positioned controls. - The following general rules apply to the use of : + The following general rules apply to the use of : - A control, like any class, may contain zero or more application settings classes, derived from . Each settings class contains its own property, which helps disambiguate multiple instances of that class. - A control should separate its per-instance data and its shared data into different settings classes. -- For a control with any per-instance configuration data, the `get` accessor of the property should default to the of the control. In most cases the name of the control will be unique within an application. If the control contains only shared configuration data, `get` should default to `null`. +- For a control with any per-instance configuration data, the `get` accessor of the property should default to the of the control. In most cases the name of the control will be unique within an application. If the control contains only shared configuration data, `get` should default to `null`. - The `set` accessor for this property should be implemented to distinguish between settings classes containing per-instance and shared configuration data. For each settings class containing per-instance data, `set` should just pass-through to the property of the settings class. For settings classes containing shared data, `set` should perform no action for that settings class. diff --git a/xml/System.Configuration/ISettingsProviderService.xml b/xml/System.Configuration/ISettingsProviderService.xml index b379d01a891..675125348e3 100644 --- a/xml/System.Configuration/ISettingsProviderService.xml +++ b/xml/System.Configuration/ISettingsProviderService.xml @@ -87,7 +87,7 @@ method enables an to offer its serialization services to any sited component. This method determines if the associated settings provider can persist the specified application settings property type. If it can, this method returns a reference to that settings provider; otherwise it returns `null`. + The method enables an to offer its serialization services to any sited component. This method determines if the associated settings provider can persist the specified application settings property type. If it can, this method returns a reference to that settings provider; otherwise it returns `null`. ]]> diff --git a/xml/System.Configuration/InfiniteIntConverter.xml b/xml/System.Configuration/InfiniteIntConverter.xml index 2f7ccf75f6b..1a7453f1b06 100644 --- a/xml/System.Configuration/InfiniteIntConverter.xml +++ b/xml/System.Configuration/InfiniteIntConverter.xml @@ -33,23 +33,23 @@ Converts between a string and the standard infinite or integer value. - class converts string values, assigned to a configuration property, to integer values and vice versa. If the configuration property has a string value of "infinite", it converts this value to and vice versa. - - This converter is used with integer types. The infinite value is persisted as . - - - -## Examples - The following code example shows how to use the when applied to a custom section property. - + class converts string values, assigned to a configuration property, to integer values and vice versa. If the configuration property has a string value of "infinite", it converts this value to and vice versa. + + This converter is used with integer types. The infinite value is persisted as . + + + +## Examples + The following code example shows how to use the when applied to a custom section property. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationConvertersCustomSection/CS/ConfigurationConvertersCustomSection.cs" id="Snippet5"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationConvertersCustomSection/VB/ConfigurationConvertersCustomSection.vb" id="Snippet5"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationConvertersCustomSection/VB/ConfigurationConvertersCustomSection.vb" id="Snippet5"::: + ]]> @@ -90,11 +90,11 @@ Initializes a new instance of the class. - constructor is when you create your own conversion type. - + constructor is when you create your own conversion type. + ]]> @@ -139,11 +139,11 @@ Converts a to an . The Int32.MaxValue, if the parameter is the "infinite"; otherwise, the representing the parameter integer value. - method when reading from a configuration file to convert a value to . - + method when reading from a configuration file to convert a value to . + ]]> @@ -190,11 +190,11 @@ Converts an .to a . The "infinite" if the is Int32.MaxValue; otherwise, the representing the parameter. - method when writing to a configuration file to convert an to a . - + method when writing to a configuration file to convert an to a . + ]]> diff --git a/xml/System.Configuration/InfiniteTimeSpanConverter.xml b/xml/System.Configuration/InfiniteTimeSpanConverter.xml index 240712de82a..43a00400b9f 100644 --- a/xml/System.Configuration/InfiniteTimeSpanConverter.xml +++ b/xml/System.Configuration/InfiniteTimeSpanConverter.xml @@ -33,49 +33,49 @@ Converts between a string and the standard infinite value. - converts the value "infinite" assigned to a configuration property to the standard infinite and vice versa. The infinite value is represented by the enumeration value. - - This converter is used with properties. An infinite value is persisted as the "infinite" string. - - - -## Examples - The following code example shows how to define a custom section property that uses the class. - - For the complete example code that implements the custom section, refer to the class. - + converts the value "infinite" assigned to a configuration property to the standard infinite and vice versa. The infinite value is represented by the enumeration value. + + This converter is used with properties. An infinite value is persisted as the "infinite" string. + + + +## Examples + The following code example shows how to define a custom section property that uses the class. + + For the complete example code that implements the custom section, refer to the class. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationConvertersCustomSection/CS/ConfigurationConvertersCustomSection.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationConvertersCustomSection/VB/ConfigurationConvertersCustomSection.vb" id="Snippet3"::: - - The following example code shows how to access the previous custom section property. - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationConvertersCustomSection/VB/ConfigurationConvertersCustomSection.vb" id="Snippet3"::: + + The following example code shows how to access the previous custom section property. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.InfiniteTimeSpanConverter/CS/InfiniteTimeSpanConverter.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.InfiniteTimeSpanConverter/VB/InfiniteTimeSpanConverter.vb" id="Snippet1"::: - - The following is a configuration excerpt as used by the previous example. - -```xml - - - -
- - - -``` - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.InfiniteTimeSpanConverter/VB/InfiniteTimeSpanConverter.vb" id="Snippet1"::: + + The following is a configuration excerpt as used by the previous example. + +```xml + + + +
+ + + +``` + ]]> @@ -116,11 +116,11 @@ Initializes a new instance of the class. - constructor is when you create your own conversion type. - + constructor is when you create your own conversion type. + ]]> @@ -165,11 +165,11 @@ Converts a to a . The TimeSpan.MaxValue, if the parameter is the infinite; otherwise, the representing the parameter in minutes. - method when reading from a configuration file to convert a value to or the "infinite" to . - + method when reading from a configuration file to convert a value to or the "infinite" to . + ]]> @@ -216,13 +216,13 @@ Converts a to a . The "infinite", if the parameter is TimeSpan.MaxValue; otherwise, the representing the parameter in minutes. - method when writing an attribute to a configuration file to convert a object to a object. - - The system uses the method when writing to a configuration file to convert a value or to a . - + method when writing an attribute to a configuration file to convert a object to a object. + + The system uses the method when writing to a configuration file to convert a value or to a . + ]]> diff --git a/xml/System.Configuration/IntegerValidator.xml b/xml/System.Configuration/IntegerValidator.xml index 980354f02c8..c953fe5e4e9 100644 --- a/xml/System.Configuration/IntegerValidator.xml +++ b/xml/System.Configuration/IntegerValidator.xml @@ -33,21 +33,21 @@ Provides validation of an value. - class is used to ensure that an integer meets specific criteria. The criteria for validation are established when an instance of the class is created. The constructor with two parameters ensures that the integer being verified adheres to both a minimum and a maximum value. The constructor with three parameters checks both the minimum and maximum values, as well as whether the value to be validated is within the specified range. The constructor with four parameters checks the previous three parameters and also checks whether the value is equal to a specific resolution. - - The method determines whether the object type being validated matches the expected type. The object being validated is passed as a parameter of the method. - - - -## Examples - The following code example demonstrates how to use the type. - + class is used to ensure that an integer meets specific criteria. The criteria for validation are established when an instance of the class is created. The constructor with two parameters ensures that the integer being verified adheres to both a minimum and a maximum value. The constructor with three parameters checks both the minimum and maximum values, as well as whether the value to be validated is within the specified range. The constructor with four parameters checks the previous three parameters and also checks whether the value is equal to a specific resolution. + + The method determines whether the object type being validated matches the expected type. The object being validated is passed as a parameter of the method. + + + +## Examples + The following code example demonstrates how to use the type. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.IntegerValidator/CS/IntegerValidator.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.IntegerValidator/VB/IntegerValidator.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.IntegerValidator/VB/IntegerValidator.vb" id="Snippet1"::: + ]]> @@ -96,11 +96,11 @@ An object that specifies the maximum value. Initializes a new instance of the class. - constructor ensures that the integer being verified adheres to both a minimum and a maximum length. - + constructor ensures that the integer being verified adheres to both a minimum and a maximum length. + ]]> @@ -142,19 +142,19 @@ to specify that the validation range is exclusive. Inclusive means the value to be validated must be within the specified range; exclusive means that it must be below the minimum or above the maximum. Initializes a new instance of the class. - class, this constructor checks both the minimum and maximum values, as well as whether the validation range is exclusive. When the `rangeIsExclusive` parameter is set to `true`, the value must not be between the `minValue` and `maxValue` parameter values. - - - -## Examples - The following code example demonstrates how to use the constructor. This code example is part of a larger example provided for the class. - + class, this constructor checks both the minimum and maximum values, as well as whether the validation range is exclusive. When the `rangeIsExclusive` parameter is set to `true`, the value must not be between the `minValue` and `maxValue` parameter values. + + + +## Examples + The following code example demonstrates how to use the constructor. This code example is part of a larger example provided for the class. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.IntegerValidator/CS/IntegerValidator.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.IntegerValidator/VB/IntegerValidator.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.IntegerValidator/VB/IntegerValidator.vb" id="Snippet2"::: + ]]> @@ -197,18 +197,18 @@ An object that specifies a value that must be matched. Initializes a new instance of the class. - value being validated must be equal to the `resolution` value in order to pass validation. - + value being validated must be equal to the `resolution` value in order to pass validation. + ]]> - is less than . - + is less than . + -or- - + is greater than . @@ -249,14 +249,14 @@ if the parameter matches an value; otherwise, . - method. This code example is part of a larger example provided for the class. - + method. This code example is part of a larger example provided for the class. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.IntegerValidator/CS/IntegerValidator.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.IntegerValidator/VB/IntegerValidator.vb" id="Snippet3"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.IntegerValidator/VB/IntegerValidator.vb" id="Snippet3"::: + ]]> @@ -296,19 +296,19 @@ The value to be validated. Determines whether the value of an object is valid. - object contains the rules necessary to validate an integer object. The rules are established when an instance of the class is created. The integer object to validate is passed as a parameter of the method. - - - -## Examples - The following code example demonstrates how to use the method. This code example is part of a larger example provided for the class. - + object contains the rules necessary to validate an integer object. The rules are established when an instance of the class is created. The integer object to validate is passed as a parameter of the method. + + + +## Examples + The following code example demonstrates how to use the method. This code example is part of a larger example provided for the class. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.IntegerValidator/CS/IntegerValidator.cs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.IntegerValidator/VB/IntegerValidator.vb" id="Snippet4"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.IntegerValidator/VB/IntegerValidator.vb" id="Snippet4"::: + ]]> diff --git a/xml/System.Configuration/IntegerValidatorAttribute.xml b/xml/System.Configuration/IntegerValidatorAttribute.xml index 7129e4c63a8..81371be4329 100644 --- a/xml/System.Configuration/IntegerValidatorAttribute.xml +++ b/xml/System.Configuration/IntegerValidatorAttribute.xml @@ -96,7 +96,7 @@ ## Examples - The following example shows how to use the constructor. + The following example shows how to use the constructor. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationValidatorAttributes/CS/ConfigurationValidatorAttributes.cs" id="Snippet5"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationValidatorAttributes/VB/ConfigurationValidatorAttributes.vb" id="Snippet5"::: @@ -141,7 +141,7 @@ and property values. When the property value is `true`, the allowed values are outside the range. + The range is inclusive of the and property values. When the property value is `true`, the allowed values are outside the range. @@ -290,7 +290,7 @@ property to perform string validation by calling its method. + You use the property to perform string validation by calling its method. diff --git a/xml/System.Configuration/KeyValueConfigurationCollection.xml b/xml/System.Configuration/KeyValueConfigurationCollection.xml index 3a39b83ed48..6701607419a 100644 --- a/xml/System.Configuration/KeyValueConfigurationCollection.xml +++ b/xml/System.Configuration/KeyValueConfigurationCollection.xml @@ -88,7 +88,7 @@ constructor. This code example is part of a larger example provided for the class overview. + The following code example demonstrates how to use the constructor. This code example is part of a larger example provided for the class overview. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.KeyValueConfigurationCollection/CS/KeyValueConfigurationCollection.cs" id="Snippet4"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.KeyValueConfigurationCollection/VB/KeyValueConfigurationCollection.vb" id="Snippet4"::: @@ -144,12 +144,12 @@ method to add a new object to the collection. + Use the method to add a new object to the collection. ## Examples - The following code example demonstrates how to use the method. This code example is part of a larger example provided for the class overview. + The following code example demonstrates how to use the method. This code example is part of a larger example provided for the class overview. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.KeyValueConfigurationCollection/CS/KeyValueConfigurationCollection.cs" id="Snippet6"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.KeyValueConfigurationCollection/VB/KeyValueConfigurationCollection.vb" id="Snippet6"::: @@ -266,7 +266,7 @@ method is called, it removes all objects from the collection. + When the method is called, it removes all objects from the collection. ]]> @@ -308,7 +308,7 @@ method to create custom objects. When a collection is loaded from the configuration file, the method is called to create individual elements. The method must be overridden in classes that derive from the class. + Override the method to create custom objects. When a collection is loaded from the configuration file, the method is called to create individual elements. The method must be overridden in classes that derive from the class. ]]> diff --git a/xml/System.Configuration/KeyValueConfigurationElement.xml b/xml/System.Configuration/KeyValueConfigurationElement.xml index 7c1d80d4fc8..697a0bcbc6d 100644 --- a/xml/System.Configuration/KeyValueConfigurationElement.xml +++ b/xml/System.Configuration/KeyValueConfigurationElement.xml @@ -89,7 +89,7 @@ constructor. This code example is part of a larger example provided for the class overview. + The following code example demonstrates how to use the constructor. This code example is part of a larger example provided for the class overview. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.KeyValueConfigurationCollection/CS/KeyValueConfigurationCollection.cs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.KeyValueConfigurationCollection/VB/KeyValueConfigurationCollection.vb" id="Snippet2"::: diff --git a/xml/System.Configuration/LocalFileSettingsProvider.xml b/xml/System.Configuration/LocalFileSettingsProvider.xml index 722e9e99ba4..889f8445e92 100644 --- a/xml/System.Configuration/LocalFileSettingsProvider.xml +++ b/xml/System.Configuration/LocalFileSettingsProvider.xml @@ -144,7 +144,7 @@ and properties help to disambiguate similarly named setting properties in different applications. + The and properties help to disambiguate similarly named setting properties in different applications. ]]> @@ -195,7 +195,7 @@ method is often used in conjunction with the method when migrating application settings during the installation of a new version of an application. For more information, see the method. + The method is often used in conjunction with the method when migrating application settings during the installation of a new version of an application. For more information, see the method. ]]> @@ -246,7 +246,7 @@ method also manages the special application settings type . Connection strings are stored in a special section of the configuration file delimited by the element ``. + The method also manages the special application settings type . Connection strings are stored in a special section of the configuration file delimited by the element ``. > [!CAUTION] > does not use encryption to persist any settings. Therefore, do not store plain text passwords or other sensitive information using this provider without taking additional precautions, such as separately encrypting the information within the configuration file. For more information, see [Encrypting Configuration Information Using Protected Configuration](https://learn.microsoft.com/previous-versions/aspnet/53tyfkaw(v=vs.100)). @@ -340,7 +340,7 @@ method restores the stored values of the specified application settings group. The action of depends on the scope of the application settings property: + The method restores the stored values of the specified application settings group. The action of depends on the scope of the application settings property: - Application-scoped settings are not affected. @@ -398,13 +398,13 @@ , contains the method, which is called to persist the values of all of its settings properties. This method enumerates through all the settings providers associated with its settings properties, and calls the method for each to perform the actual serialization operation. + A settings wrapper class, derived from , contains the method, which is called to persist the values of all of its settings properties. This method enumerates through all the settings providers associated with its settings properties, and calls the method for each to perform the actual serialization operation. - individually serializes each user-scoped application settings property to its corresponding application setting in the appropriate `user.config` configuration file. + individually serializes each user-scoped application settings property to its corresponding application setting in the appropriate `user.config` configuration file. - By default, the method uses the following logical sequence to determine the serialization scheme, depending on type of the settings property: + By default, the method uses the following logical sequence to determine the serialization scheme, depending on type of the settings property: -1. If the type has an associated with a method implementation, this conversion is used. +1. If the type has an associated with a method implementation, this conversion is used. 2. XML serialization is used. @@ -473,13 +473,13 @@ ## Remarks migrates the local and roaming settings in separate operations. - The method is suppressed for every application setting that has the applied to it, or to the entire settings wrapper class, derived from . + The method is suppressed for every application setting that has the applied to it, or to the entire settings wrapper class, derived from . This way this method is called depends on the type of application that is being upgraded: -- Each version of a ClickOnce application is stored in its own isolated installation directory. After a new version of a ClickOnce application is installed, and when the new version is first run, internal logic will automatically call to migrate all common application settings to the new version. For more information, see [ClickOnce and Application Settings](/visualstudio/deployment/clickonce-and-application-settings). +- Each version of a ClickOnce application is stored in its own isolated installation directory. After a new version of a ClickOnce application is installed, and when the new version is first run, internal logic will automatically call to migrate all common application settings to the new version. For more information, see [ClickOnce and Application Settings](/visualstudio/deployment/clickonce-and-application-settings). -- Standard Windows Forms and console applications must manually call , because there is not a general, automatic way to determine when such an application is first run. The two common ways to do this are either from the installation program or using from the application itself, using a persisted property, often named something like `IsFirstRun`. +- Standard Windows Forms and console applications must manually call , because there is not a general, automatic way to determine when such an application is first run. The two common ways to do this are either from the installation program or using from the application itself, using a persisted property, often named something like `IsFirstRun`. Note that for the newer version to migrate application settings, it must be able to also load and read the older version of the application settings. Therefore, it must contain wrapper classes compatible with both the new and previous versions of the application. diff --git a/xml/System.Configuration/LongValidator.xml b/xml/System.Configuration/LongValidator.xml index f542859dcce..591b3361efb 100644 --- a/xml/System.Configuration/LongValidator.xml +++ b/xml/System.Configuration/LongValidator.xml @@ -33,21 +33,21 @@ Provides validation of an value. - is used to ensure a `long` (a 64-bit signed integer) meets specific criteria. The criteria for validation is established when an instance of the class is created. The constructor ensures that the `long` value that is being validated adheres to both a minimum and a maximum length. The constructor checks both the minimum and maximum values, as well as whether the validation range is exclusive. The constructor checks the previous three parameters and also checks whether the value is equal to a specific resolution value. - - The method determines whether the object type being validated matches the expected type. The object being validated is passed as a parameter of the method. - - - -## Examples - The following code example demonstrates how to use the type. - + is used to ensure a `long` (a 64-bit signed integer) meets specific criteria. The criteria for validation is established when an instance of the class is created. The constructor ensures that the `long` value that is being validated adheres to both a minimum and a maximum length. The constructor checks both the minimum and maximum values, as well as whether the validation range is exclusive. The constructor checks the previous three parameters and also checks whether the value is equal to a specific resolution value. + + The method determines whether the object type being validated matches the expected type. The object being validated is passed as a parameter of the method. + + + +## Examples + The following code example demonstrates how to use the type. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.LongValidator/CS/LongValidator.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.LongValidator/VB/LongValidator.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.LongValidator/VB/LongValidator.vb" id="Snippet1"::: + ]]> @@ -96,11 +96,11 @@ An value that specifies the maximum length of the value. Initializes a new instance of the class. - constructor ensures that the long value being verified adheres to both a minimum and a maximum length. - + constructor ensures that the long value being verified adheres to both a minimum and a maximum length. + ]]> @@ -141,19 +141,19 @@ A value that specifies whether the validation range is exclusive. Initializes a new instance of the class. - constructor is used, it checks both the minimum and maximum values, as well as whether the validation range is exclusive. When the `rangeIsExclusive` parameter is set to `true`, the value must not be between `minValue` and `maxValue`. - - - -## Examples - The following code example demonstrates how to use the constructor. This code example is part of a larger example provided for the class. - + constructor is used, it checks both the minimum and maximum values, as well as whether the validation range is exclusive. When the `rangeIsExclusive` parameter is set to `true`, the value must not be between `minValue` and `maxValue`. + + + +## Examples + The following code example demonstrates how to use the constructor. This code example is part of a larger example provided for the class. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.LongValidator/CS/LongValidator.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.LongValidator/VB/LongValidator.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.LongValidator/VB/LongValidator.vb" id="Snippet2"::: + ]]> @@ -196,18 +196,18 @@ An value that specifies a specific value that must be matched. Initializes a new instance of the class. - value being validated must be equal to that value in order to pass validation. - + value being validated must be equal to that value in order to pass validation. + ]]> - is equal to or less than . - + is equal to or less than . + -or- - + is less than . @@ -248,14 +248,14 @@ if the parameter matches an value; otherwise, . - method. This code example is part of a larger example provided for the class. - + method. This code example is part of a larger example provided for the class. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.LongValidator/CS/LongValidator.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.LongValidator/VB/LongValidator.vb" id="Snippet3"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.LongValidator/VB/LongValidator.vb" id="Snippet3"::: + ]]> @@ -295,19 +295,19 @@ The value of an object. Determines whether the value of an object is valid. - class contains the rules necessary to validate an object. The rules are established when an instance of the class is created. The object to validate is passed as a parameter of the method. - - - -## Examples - The following code example demonstrates how to use the method. This code example is part of a larger example provided for the class. - + class contains the rules necessary to validate an object. The rules are established when an instance of the class is created. The object to validate is passed as a parameter of the method. + + + +## Examples + The following code example demonstrates how to use the method. This code example is part of a larger example provided for the class. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.LongValidator/CS/LongValidator.cs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.LongValidator/VB/LongValidator.vb" id="Snippet4"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.LongValidator/VB/LongValidator.vb" id="Snippet4"::: + ]]> diff --git a/xml/System.Configuration/LongValidatorAttribute.xml b/xml/System.Configuration/LongValidatorAttribute.xml index d2ff50c9d27..fdeb0488225 100644 --- a/xml/System.Configuration/LongValidatorAttribute.xml +++ b/xml/System.Configuration/LongValidatorAttribute.xml @@ -133,7 +133,7 @@ and property values. When the property value is `false`, the allowed values are outside the range. + The range is inclusive of the and property values. When the property value is `false`, the allowed values are outside the range. @@ -282,7 +282,7 @@ property value to perform string validation by calling its method. + You use the property value to perform string validation by calling its method. ]]> diff --git a/xml/System.Configuration/NameValueConfigurationCollection.xml b/xml/System.Configuration/NameValueConfigurationCollection.xml index 10a11ba9f08..ea527a8e7d7 100644 --- a/xml/System.Configuration/NameValueConfigurationCollection.xml +++ b/xml/System.Configuration/NameValueConfigurationCollection.xml @@ -89,7 +89,7 @@ constructor. This code example is part of a larger example provided for the class. + The following code example demonstrates how to use the constructor. This code example is part of a larger example provided for the class. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.NameValueConfigurationCollection/CS/NameValueConfigurationCollection.cs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.NameValueConfigurationCollection/VB/NameValueConfigurationCollection.vb" id="Snippet2"::: @@ -136,12 +136,12 @@ method to add a new object to the collection. + Use the method to add a new object to the collection. ## Examples - The following code example demonstrates how to use the method. This code example is part of a larger example provided for the class. + The following code example demonstrates how to use the method. This code example is part of a larger example provided for the class. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.NameValueConfigurationCollection/CS/NameValueConfigurationCollection.cs" id="Snippet3"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.NameValueConfigurationCollection/VB/NameValueConfigurationCollection.vb" id="Snippet3"::: @@ -219,12 +219,12 @@ method is called, it removes all objects from the collection. + When the method is called, it removes all objects from the collection. ## Examples - The following code example demonstrates how to use the method. This code example is part of a larger example provided for the class. + The following code example demonstrates how to use the method. This code example is part of a larger example provided for the class. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.NameValueConfigurationCollection/CS/NameValueConfigurationCollection.cs" id="Snippet7"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.NameValueConfigurationCollection/VB/NameValueConfigurationCollection.vb" id="Snippet7"::: @@ -443,12 +443,12 @@ method to remove a from the collection. Override in a derived class if custom behavior is required when the element is removed. + Use the method to remove a from the collection. Override in a derived class if custom behavior is required when the element is removed. ## Examples - The following code example demonstrates how to use the method. This code example is part of a larger example provided for the class. + The following code example demonstrates how to use the method. This code example is part of a larger example provided for the class. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.NameValueConfigurationCollection/CS/NameValueConfigurationCollection.cs" id="Snippet6"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.NameValueConfigurationCollection/VB/NameValueConfigurationCollection.vb" id="Snippet6"::: @@ -495,7 +495,7 @@ method to remove a from the collection. Override in a derived class if custom behavior is required when the element is removed. + Use the method to remove a from the collection. Override in a derived class if custom behavior is required when the element is removed. ]]> diff --git a/xml/System.Configuration/NoSettingsVersionUpgradeAttribute.xml b/xml/System.Configuration/NoSettingsVersionUpgradeAttribute.xml index c7c478bbceb..3e5f1b69adb 100644 --- a/xml/System.Configuration/NoSettingsVersionUpgradeAttribute.xml +++ b/xml/System.Configuration/NoSettingsVersionUpgradeAttribute.xml @@ -39,16 +39,16 @@ Specifies that a settings provider should disable any logic that gets invoked when an application upgrade is detected. This class cannot be inherited. - interface. One of the members in this interface, the method, is called to notify the provider that a new version of the application has been installed. In response, the provider is expected to perform an appropriate action, typically migrating past application settings. - - The informs the provider to suppress the upgrade logic associated with the current settings class. Therefore, the value of the previous version of this property group should not be migrated to the new installation. - + interface. One of the members in this interface, the method, is called to notify the provider that a new version of the application has been installed. In response, the provider is expected to perform an appropriate action, typically migrating past application settings. + + The informs the provider to suppress the upgrade logic associated with the current settings class. Therefore, the value of the previous version of this property group should not be migrated to the new installation. + > [!NOTE] -> This attribute can only be applied to individual application settings properties. - +> This attribute can only be applied to individual application settings properties. + ]]> @@ -89,11 +89,11 @@ Initializes a new instance of the class. - class. - + class. + ]]> diff --git a/xml/System.Configuration/PositiveTimeSpanValidator.xml b/xml/System.Configuration/PositiveTimeSpanValidator.xml index f910dcf1959..dbc7dfb1ed1 100644 --- a/xml/System.Configuration/PositiveTimeSpanValidator.xml +++ b/xml/System.Configuration/PositiveTimeSpanValidator.xml @@ -33,19 +33,19 @@ Provides validation of a object. This class cannot be inherited. - is used to ensure a object meets specific criteria. The method determines whether the object type being validated matches the expected type. The object being validated is passed as a parameter of the method. To pass validation, the object being validated must be a positive value. - - - -## Examples - The following code example demonstrates how to use the type. - + is used to ensure a object meets specific criteria. The method determines whether the object type being validated matches the expected type. The object being validated is passed as a parameter of the method. To pass validation, the object being validated must be a positive value. + + + +## Examples + The following code example demonstrates how to use the type. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.PositiveTimeSpanValidator/CS/PositiveTimeSpanValidator.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.PositiveTimeSpanValidator/VB/PositiveTimeSpanValidator.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.PositiveTimeSpanValidator/VB/PositiveTimeSpanValidator.vb" id="Snippet1"::: + ]]> @@ -80,14 +80,14 @@ Initializes a new instance of the class. - constructor. This code example is part of a larger example provided for the class. - + constructor. This code example is part of a larger example provided for the class. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.PositiveTimeSpanValidator/CS/PositiveTimeSpanValidator.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.PositiveTimeSpanValidator/VB/PositiveTimeSpanValidator.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.PositiveTimeSpanValidator/VB/PositiveTimeSpanValidator.vb" id="Snippet2"::: + ]]> @@ -129,14 +129,14 @@ if the parameter matches a object; otherwise, . - method. This code example is part of a larger example provided for the class. - + method. This code example is part of a larger example provided for the class. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.PositiveTimeSpanValidator/CS/PositiveTimeSpanValidator.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.PositiveTimeSpanValidator/VB/PositiveTimeSpanValidator.vb" id="Snippet3"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.PositiveTimeSpanValidator/VB/PositiveTimeSpanValidator.vb" id="Snippet3"::: + ]]> @@ -176,19 +176,19 @@ The value of an object. Determines whether the value of an object is valid. - method. To pass validation, the object being validated must be a positive value. - - - -## Examples - The following code example demonstrates how to use the method. This code example is part of a larger example provided for the class. - + method. To pass validation, the object being validated must be a positive value. + + + +## Examples + The following code example demonstrates how to use the method. This code example is part of a larger example provided for the class. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.PositiveTimeSpanValidator/CS/PositiveTimeSpanValidator.cs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.PositiveTimeSpanValidator/VB/PositiveTimeSpanValidator.vb" id="Snippet4"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.PositiveTimeSpanValidator/VB/PositiveTimeSpanValidator.vb" id="Snippet4"::: + ]]> diff --git a/xml/System.Configuration/PositiveTimeSpanValidatorAttribute.xml b/xml/System.Configuration/PositiveTimeSpanValidatorAttribute.xml index e6c12a30c77..2420f59500b 100644 --- a/xml/System.Configuration/PositiveTimeSpanValidatorAttribute.xml +++ b/xml/System.Configuration/PositiveTimeSpanValidatorAttribute.xml @@ -126,7 +126,7 @@ property to perform positive object validation by calling the method. + You use the property to perform positive object validation by calling the method. ]]> diff --git a/xml/System.Configuration/PropertyInformation.xml b/xml/System.Configuration/PropertyInformation.xml index b98594c27bb..3676ab296f3 100644 --- a/xml/System.Configuration/PropertyInformation.xml +++ b/xml/System.Configuration/PropertyInformation.xml @@ -255,7 +255,7 @@ property returns `true` when the related element is locked by the or property. + The property returns `true` when the related element is locked by the or property. diff --git a/xml/System.Configuration/ProtectedConfigurationProvider.xml b/xml/System.Configuration/ProtectedConfigurationProvider.xml index 5b254dc9a20..3ff163a578c 100644 --- a/xml/System.Configuration/ProtectedConfigurationProvider.xml +++ b/xml/System.Configuration/ProtectedConfigurationProvider.xml @@ -145,7 +145,7 @@ You can encrypt sections of a configuration file to protect sensitive informatio method to perform custom decryption. + The following example shows how to use method to perform custom decryption. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ProtectedConfigurationProvider/CS/ProtectedConfigurationProviderLib.cs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ProtectedConfigurationProvider/VB/ProtectedConfigurationProviderLib.vb" id="Snippet2"::: @@ -197,7 +197,7 @@ You can encrypt sections of a configuration file to protect sensitive informatio to perform custom encryption. + The following example shows how to use to perform custom encryption. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ProtectedConfigurationProvider/CS/ProtectedConfigurationProviderLib.cs" id="Snippet3"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ProtectedConfigurationProvider/VB/ProtectedConfigurationProviderLib.vb" id="Snippet3"::: diff --git a/xml/System.Configuration/ProtectedConfigurationProviderCollection.xml b/xml/System.Configuration/ProtectedConfigurationProviderCollection.xml index 2f7dd6c49f1..ef32174cea3 100644 --- a/xml/System.Configuration/ProtectedConfigurationProviderCollection.xml +++ b/xml/System.Configuration/ProtectedConfigurationProviderCollection.xml @@ -84,7 +84,7 @@ constructor is not intended to be used directly from your code. It is called by the ASP.NET configuration system. You obtain an instance of the class by using the property of the class. + The constructor is not intended to be used directly from your code. It is called by the ASP.NET configuration system. You obtain an instance of the class by using the property of the class. ]]> diff --git a/xml/System.Configuration/ProtectedConfigurationSection.xml b/xml/System.Configuration/ProtectedConfigurationSection.xml index 8adc6a39dbc..df04a61d222 100644 --- a/xml/System.Configuration/ProtectedConfigurationSection.xml +++ b/xml/System.Configuration/ProtectedConfigurationSection.xml @@ -106,7 +106,7 @@ constructor is not intended to be used directly from your code. It is called by the ASP.NET configuration system. + The constructor is not intended to be used directly from your code. It is called by the ASP.NET configuration system. ]]> diff --git a/xml/System.Configuration/ProviderSettingsCollection.xml b/xml/System.Configuration/ProviderSettingsCollection.xml index d73daddd868..57533999833 100644 --- a/xml/System.Configuration/ProviderSettingsCollection.xml +++ b/xml/System.Configuration/ProviderSettingsCollection.xml @@ -126,7 +126,7 @@ method to add a object to the collection. + Use the method to add a object to the collection. ]]> @@ -167,7 +167,7 @@ method to remove all objects from the collection. + Use the method to remove all objects from the collection. ]]> @@ -421,7 +421,7 @@ method to remove a specified object from the collection. + Use the method to remove a specified object from the collection. ]]> diff --git a/xml/System.Configuration/RegexStringValidator.xml b/xml/System.Configuration/RegexStringValidator.xml index e489b2a9656..900d1abcc50 100644 --- a/xml/System.Configuration/RegexStringValidator.xml +++ b/xml/System.Configuration/RegexStringValidator.xml @@ -39,7 +39,7 @@ The object contains the rules necessary to validate a string object based on a regular expression. The rules are established when an instance of this class is created. -The method determines whether the object type being validated matches the expected type. The object to validate is passed as an argument to the method. +The method determines whether the object type being validated matches the expected type. The object to validate is passed as an argument to the method. ## Examples diff --git a/xml/System.Configuration/RegexStringValidatorAttribute.xml b/xml/System.Configuration/RegexStringValidatorAttribute.xml index a2a74be1b71..ae52bc50c68 100644 --- a/xml/System.Configuration/RegexStringValidatorAttribute.xml +++ b/xml/System.Configuration/RegexStringValidatorAttribute.xml @@ -103,7 +103,7 @@ You use this constructor in the attributed model to ensure that the string value ## Examples -The following example shows how to use the constructor. +The following example shows how to use the constructor. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationValidatorAttributes/CS/ConfigurationValidatorAttributes.cs" id="Snippet4"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationValidatorAttributes/VB/ConfigurationValidatorAttributes.vb" id="Snippet4"::: @@ -194,11 +194,11 @@ The following example shows how to use the property to perform string validation by calling its method. +You use the property to perform string validation by calling its method. ## Examples -The following example shows how to use the method. +The following example shows how to use the method. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationValidatorAttributes/CS/ConfigurationValidatorAttributes.cs" id="Snippet15"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationValidatorAttributes/VB/ConfigurationValidatorAttributes.vb" id="Snippet15"::: diff --git a/xml/System.Configuration/RsaProtectedConfigurationProvider.xml b/xml/System.Configuration/RsaProtectedConfigurationProvider.xml index 26cf2b4f091..46ab2729f3b 100644 --- a/xml/System.Configuration/RsaProtectedConfigurationProvider.xml +++ b/xml/System.Configuration/RsaProtectedConfigurationProvider.xml @@ -123,7 +123,7 @@ The following example shows how to use the standard constructor is not intended to be used directly from your code. It is called by the ASP.NET configuration system. + The constructor is not intended to be used directly from your code. It is called by the ASP.NET configuration system. ]]> diff --git a/xml/System.Configuration/SchemeSettingElement.xml b/xml/System.Configuration/SchemeSettingElement.xml index 67ceda446df..f9d6c0aa99c 100644 --- a/xml/System.Configuration/SchemeSettingElement.xml +++ b/xml/System.Configuration/SchemeSettingElement.xml @@ -184,7 +184,7 @@ ## Remarks The property returns a enumeration value for the instance. - The element is currently restricted to HTTP and HTTPS. + The element is currently restricted to HTTP and HTTPS. ]]> diff --git a/xml/System.Configuration/SectionInformation.xml b/xml/System.Configuration/SectionInformation.xml index e5d11868b24..8b7d16c1a95 100644 --- a/xml/System.Configuration/SectionInformation.xml +++ b/xml/System.Configuration/SectionInformation.xml @@ -106,7 +106,7 @@ applies only to configuration files of Web applications. For client applications, you must use . + applies only to configuration files of Web applications. For client applications, you must use . @@ -118,7 +118,7 @@ :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationElement/CS/SectionInforrmation.cs" id="Snippet95"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationElement/VB/SectionInforrmation.vb" id="Snippet95"::: - The following example gets the value. + The following example gets the value. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationElement/CS/SectionInforrmation.cs" id="Snippet96"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationElement/VB/SectionInforrmation.vb" id="Snippet96"::: @@ -164,7 +164,7 @@ applies only to configuration files of client applications. For Web applications, you must use . + applies only to configuration files of client applications. For Web applications, you must use . @@ -176,7 +176,7 @@ :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationElement/CS/SectionInforrmation.cs" id="Snippet95"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationElement/VB/SectionInforrmation.vb" id="Snippet95"::: - The following example gets the value. + The following example gets the value. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationElement/CS/SectionInforrmation.cs" id="Snippet97"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationElement/VB/SectionInforrmation.vb" id="Snippet97"::: @@ -235,7 +235,7 @@ :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationElement/CS/SectionInforrmation.cs" id="Snippet95"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationElement/VB/SectionInforrmation.vb" id="Snippet95"::: - The following example gets the value. + The following example gets the value. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationElement/CS/SectionInforrmation.cs" id="Snippet98"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationElement/VB/SectionInforrmation.vb" id="Snippet98"::: @@ -288,7 +288,7 @@ :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationElement/CS/SectionInforrmation.cs" id="Snippet95"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationElement/VB/SectionInforrmation.vb" id="Snippet95"::: - The following example gets the value. + The following example gets the value. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationElement/CS/SectionInforrmation.cs" id="Snippet99"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationElement/VB/SectionInforrmation.vb" id="Snippet99"::: @@ -390,7 +390,7 @@ to `true`. This makes a configuration file more portable from one computer to another. This also lets you make sure that the section exists even if you do not have control over parent configuration files. + A configuration section is not written in a configuration file when it is inherited from a parent file. If you want the parent section to show in the child configuration file, you must set the to `true`. This makes a configuration file more portable from one computer to another. This also lets you make sure that the section exists even if you do not have control over parent configuration files. ]]> @@ -431,10 +431,10 @@ method forces this declaration to be written to the configuration file. + The method forces this declaration to be written to the configuration file. > [!NOTE] -> The method can force a declaration to be written to a configuration file, even if the section is not required because it is already declared in a parent file. Using the method can make a configuration file more portable from one computer to another. It enables you to make sure that the section exists even when you do not have control over parent configuration files. +> The method can force a declaration to be written to a configuration file, even if the section is not required because it is already declared in a parent file. Using the method can make a configuration file more portable from one computer to another. It enables you to make sure that the section exists even when you do not have control over parent configuration files. ]]> @@ -479,15 +479,15 @@ method forces this declaration to be written to the configuration file if `force` is `true`. If `force` is `false`, this action might be ignored if the declaration is required by the system. + The method forces this declaration to be written to the configuration file if `force` is `true`. If `force` is `false`, this action might be ignored if the declaration is required by the system. > [!NOTE] -> The method can force a declaration to be written to a configuration file, even if this section is not required because it is already declared in a parent file. Using the method can make a configuration file more portable from one computer to another. This also lets you make sure that the section exists even if you do not have control over parent configuration files. +> The method can force a declaration to be written to a configuration file, even if this section is not required because it is already declared in a parent file. Using the method can make a configuration file more portable from one computer to another. This also lets you make sure that the section exists even if you do not have control over parent configuration files. ## Examples - The following example shows how to use the method. + The following example shows how to use the method. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationElement/CS/SectionInforrmation.cs" id="Snippet113"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationElement/VB/SectionInforrmation.vb" id="Snippet113"::: @@ -583,12 +583,12 @@ Note: If the configuration file is saved (even if there are no modifications), A object has no parent sections, the method returns the same value as the property. + If this object has no parent sections, the method returns the same value as the property. ## Examples - The following example shows how to use the method. + The following example shows how to use the method. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationElement/CS/SectionInforrmation.cs" id="Snippet92"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationElement/VB/SectionInforrmation.vb" id="Snippet92"::: @@ -634,7 +634,7 @@ Note: If the configuration file is saved (even if there are no modifications), A method. + The following example shows how to use the method. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationElement/CS/SectionInforrmation.cs" id="Snippet93"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationElement/VB/SectionInforrmation.vb" id="Snippet93"::: @@ -694,7 +694,7 @@ The pr ## Examples -The following example shows how to get the value of a object. +The following example shows how to get the value of a object. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationElement/CS/SectionInforrmation.cs" id="Snippet100"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationElement/VB/SectionInforrmation.vb" id="Snippet100"::: @@ -746,7 +746,7 @@ The following example shows how to get the value. + The following example gets the value. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationElement/CS/SectionInforrmation.cs" id="Snippet103"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationElement/VB/SectionInforrmation.vb" id="Snippet103"::: @@ -799,7 +799,7 @@ The following example shows how to get the value. + The following example gets the value. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationElement/CS/SectionInforrmation.cs" id="Snippet104"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationElement/VB/SectionInforrmation.vb" id="Snippet104"::: @@ -844,7 +844,7 @@ The following example shows how to get the property returns `true` when the related section is locked by the or the property. A section is locked if it cannot be overridden or defined in the current configuration file. + The property returns `true` when the related section is locked by the or the property. A section is locked if it cannot be overridden or defined in the current configuration file. @@ -856,7 +856,7 @@ The following example shows how to get the value. + The following example gets the value. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationElement/CS/SectionInforrmation.cs" id="Snippet105"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationElement/VB/SectionInforrmation.vb" id="Snippet105"::: @@ -915,7 +915,7 @@ The following example shows how to get the value. + The following example gets the value. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationElement/CS/SectionInforrmation.cs" id="Snippet106"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationElement/VB/SectionInforrmation.vb" id="Snippet106"::: @@ -960,12 +960,12 @@ The following example shows how to get the is the name of the section without the path. + The is the name of the section without the path. ## Examples - The following example shows how to get the value of a object. + The following example shows how to get the value of a object. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationElement/CS/SectionInforrmation.cs" id="Snippet107"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationElement/VB/SectionInforrmation.vb" id="Snippet107"::: @@ -1011,7 +1011,7 @@ The following example shows how to get the property gets or sets a value that indicates whether resources declared inside a `location` element can be overridden by child configuration files. The property gets or sets a value that specifies similar behavior, but does so for a specific configuration element or group, and uses one of the enumeration values. The property enables behavior to be inherited from a parent element. - You cannot programmatically set both the and property. Setting the property to `true` sets the property to . Setting the property to `false` sets the property to `false`. + You cannot programmatically set both the and property. Setting the property to `true` sets the property to . Setting the property to `false` sets the property to `false`. ]]> @@ -1145,7 +1145,7 @@ The following example shows how to get the value of a object. + The following example shows how to get the value of a object. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationElement/CS/SectionInforrmation.cs" id="Snippet108"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationElement/VB/SectionInforrmation.vb" id="Snippet108"::: @@ -1193,7 +1193,7 @@ The following example shows how to get the method marks the section for encryption so it will be written in encrypted form on disk. + The method marks the section for encryption so it will be written in encrypted form on disk. The following protection providers are included by default: @@ -1202,14 +1202,14 @@ The following example shows how to get the > [!NOTE] -> If you call the method with a `null` parameter or an empty string, the class is used as the protection provider. +> If you call the method with a `null` parameter or an empty string, the class is used as the protection provider. For more information about protected configuration sections, see [Encrypting Configuration Information Using Protected Configuration](https://learn.microsoft.com/previous-versions/aspnet/53tyfkaw(v=vs.100)). ## Examples - The following example shows how to use the method. + The following example shows how to use the method. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationElement/CS/SectionInforrmation.cs" id="Snippet94"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationElement/VB/SectionInforrmation.vb" id="Snippet94"::: @@ -1262,15 +1262,15 @@ The following example shows how to get the is set to `true`, the `GetSection` methods are restricted by the trust level setting of the application. This means that methods or properties that allow access to configuration section handlers are restricted by the trust level set for the Web application. + When is set to `true`, the `GetSection` methods are restricted by the trust level setting of the application. This means that methods or properties that allow access to configuration section handlers are restricted by the trust level set for the Web application. > [!NOTE] > Because high and full trust are the only levels that allow access to files outside the current application domain, an application can use configuration section handlers only at these trust levels. - When is set to `false`, the access to the configuration data is not restricted by the application's trust level settings. + When is set to `false`, the access to the configuration data is not restricted by the application's trust level settings. > [!NOTE] -> The appropriate file ACL (Access Control List) permissions are still required, regardless of the setting. ACL permissions determine who can access the configuration file. +> The appropriate file ACL (Access Control List) permissions are still required, regardless of the setting. ACL permissions determine who can access the configuration file. @@ -1441,7 +1441,7 @@ Dim apSection As AppSettingsSection = _ ## Examples - The following example shows how to get the value of a object. + The following example shows how to get the value of a object. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationElement/CS/SectionInforrmation.cs" id="Snippet110"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationElement/VB/SectionInforrmation.vb" id="Snippet110"::: @@ -1529,7 +1529,7 @@ Dim apSection As AppSettingsSection = _ ## Examples - The following example shows how to get the value of a object. + The following example shows how to get the value of a object. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationElement/CS/SectionInforrmation.cs" id="Snippet111"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationElement/VB/SectionInforrmation.vb" id="Snippet111"::: diff --git a/xml/System.Configuration/SettingChangingEventArgs.xml b/xml/System.Configuration/SettingChangingEventArgs.xml index a80b6481867..b45ad787bc5 100644 --- a/xml/System.Configuration/SettingChangingEventArgs.xml +++ b/xml/System.Configuration/SettingChangingEventArgs.xml @@ -36,7 +36,7 @@ class provides data for the event, which signals that the value of an application settings property is about to change. The most common source for this event is the `get` accessor of the method in the class. + The class provides data for the event, which signals that the value of an application settings property is about to change. The most common source for this event is the `get` accessor of the method in the class. Because is derived from , the handler has the option of canceling the write operation. @@ -96,7 +96,7 @@ constructor just assigns the values of the parameters to the corresponding properties in the class. + The constructor just assigns the values of the parameters to the corresponding properties in the class. ]]> diff --git a/xml/System.Configuration/SettingChangingEventHandler.xml b/xml/System.Configuration/SettingChangingEventHandler.xml index 9b22ce7640e..3acf142f112 100644 --- a/xml/System.Configuration/SettingChangingEventHandler.xml +++ b/xml/System.Configuration/SettingChangingEventHandler.xml @@ -41,11 +41,11 @@ A containing the data for the event. Represents the method that will handle the event. - event occurs before the value of an application settings property is changed, typically through a call to the method. can be canceled through the event data class. - + event occurs before the value of an application settings property is changed, typically through a call to the method. can be canceled through the event data class. + ]]> diff --git a/xml/System.Configuration/SettingsBase.xml b/xml/System.Configuration/SettingsBase.xml index 20a87d49944..2613dbabb13 100644 --- a/xml/System.Configuration/SettingsBase.xml +++ b/xml/System.Configuration/SettingsBase.xml @@ -259,7 +259,7 @@ The first time a property is accessed, the instance will find all other properties that share the same provider as the requested property. The instance will then call the provider, passing it the set of objects that represent the data the provider should retrieve. - Note that the indexer will get and set property data in a thread-safe manner if is `true`. A instance by default is not thread safe. However, you can call , passing in a instance to make the indexer operate in a thread-safe manner. + Note that the indexer will get and set property data in a thread-safe manner if is `true`. A instance by default is not thread safe. However, you can call , passing in a instance to make the indexer operate in a thread-safe manner. ]]> @@ -480,7 +480,7 @@ property is set to `true`. A instance by default is not thread-safe. However, you can call passing in a instance to make the indexer operate in a thread-safe manner. + The indexer will get and set property data in a thread-safe manner if the property is set to `true`. A instance by default is not thread-safe. However, you can call passing in a instance to make the indexer operate in a thread-safe manner. ]]> diff --git a/xml/System.Configuration/SettingsDescriptionAttribute.xml b/xml/System.Configuration/SettingsDescriptionAttribute.xml index eea8f87a3fa..2b66b4640e5 100644 --- a/xml/System.Configuration/SettingsDescriptionAttribute.xml +++ b/xml/System.Configuration/SettingsDescriptionAttribute.xml @@ -144,7 +144,7 @@ property is set by the constructor. + The property is set by the constructor. ]]> diff --git a/xml/System.Configuration/SettingsGroupDescriptionAttribute.xml b/xml/System.Configuration/SettingsGroupDescriptionAttribute.xml index 7c867de9aa1..0b191be4404 100644 --- a/xml/System.Configuration/SettingsGroupDescriptionAttribute.xml +++ b/xml/System.Configuration/SettingsGroupDescriptionAttribute.xml @@ -142,7 +142,7 @@ property value is set in the constructor. + The property value is set in the constructor. ]]> diff --git a/xml/System.Configuration/SettingsGroupNameAttribute.xml b/xml/System.Configuration/SettingsGroupNameAttribute.xml index 6d7a1224491..be635c8495a 100644 --- a/xml/System.Configuration/SettingsGroupNameAttribute.xml +++ b/xml/System.Configuration/SettingsGroupNameAttribute.xml @@ -145,7 +145,7 @@ property value is set by the constructor. + The property value is set by the constructor. ]]> diff --git a/xml/System.Configuration/SettingsManageabilityAttribute.xml b/xml/System.Configuration/SettingsManageabilityAttribute.xml index cd48eca6e7b..6ead2c7f950 100644 --- a/xml/System.Configuration/SettingsManageabilityAttribute.xml +++ b/xml/System.Configuration/SettingsManageabilityAttribute.xml @@ -142,7 +142,7 @@ constructor. + This property is set in the constructor. ]]> diff --git a/xml/System.Configuration/SettingsProperty.xml b/xml/System.Configuration/SettingsProperty.xml index df2ff67d82d..dcfeb15d30c 100644 --- a/xml/System.Configuration/SettingsProperty.xml +++ b/xml/System.Configuration/SettingsProperty.xml @@ -382,7 +382,7 @@ cannot be an empty string or `null`. If the does not exist in the data provider, nothing can be returned. + The cannot be an empty string or `null`. If the does not exist in the data provider, nothing can be returned. ]]> diff --git a/xml/System.Configuration/SettingsProvider.xml b/xml/System.Configuration/SettingsProvider.xml index 1272bcfc85a..4960f3b7107 100644 --- a/xml/System.Configuration/SettingsProvider.xml +++ b/xml/System.Configuration/SettingsProvider.xml @@ -38,7 +38,7 @@ ## Remarks A settings provider defines the mechanism for storing configuration data used in the application settings architecture. The .NET Framework contains a single default settings provider, , which stores configuration data to the local file system. However, you can create alternate storage mechanisms by deriving from the abstract class. The provider that a wrapper class uses is determined by decorating the wrapper class with the . If this attribute is not provided, the default, , is used. - When you create a custom settings provider, at minimum, you must provide implementations for the three methods of this class: , and . + When you create a custom settings provider, at minimum, you must provide implementations for the three methods of this class: , and . For client applications, you can add more standardized functionality to a custom provider by also implementing the interface. This interface mirrors methods found in the class, which mainly enables versioning support. @@ -100,13 +100,13 @@ method typically performs all initialization. + This is this default protected constructor for this abstract class. Derived custom settings providers are not required to provide an explicit constructor because the method typically performs all initialization. Client code typically does not directly instantiate a settings provider; instead, you use the following procedure to find a settings provider for a particular settings property: -1. Call the method on the current or to return a reference to the current . +1. Call the method on the current or to return a reference to the current . -2. Call the method of the retrieved in the first step to return the settings provider. +2. Call the method of the retrieved in the first step to return the settings provider. ]]> @@ -150,7 +150,7 @@ and properties help to disambiguate similarly named setting properties in different applications. + The and properties help to disambiguate similarly named setting properties in different applications. ]]> @@ -198,7 +198,7 @@ method must be implemented to handle special settings, those marked with , as well as reconcile application and user settings. + The method must be implemented to handle special settings, those marked with , as well as reconcile application and user settings. ]]> @@ -246,9 +246,9 @@ contains the method, which is called to persist the values of all of its settings properties. This method enumerates through all the settings providers associated with its settings properties, and calls the method for each to perform the actual serialization operation. + contains the method, which is called to persist the values of all of its settings properties. This method enumerates through all the settings providers associated with its settings properties, and calls the method for each to perform the actual serialization operation. - The method should be implemented with security in mind: + The method should be implemented with security in mind: - Only fully trusted code should be allowed to update application settings. Partially trusted code should be allowed to update only user application settings. Untrusted code is not typically allowed to update application settings. diff --git a/xml/System.Configuration/SettingsProviderAttribute.xml b/xml/System.Configuration/SettingsProviderAttribute.xml index ee57ebf7562..d462bb430b1 100644 --- a/xml/System.Configuration/SettingsProviderAttribute.xml +++ b/xml/System.Configuration/SettingsProviderAttribute.xml @@ -185,7 +185,7 @@ property is set in the for the class. + The property is set in the for the class. ]]> diff --git a/xml/System.Configuration/SettingsProviderCollection.xml b/xml/System.Configuration/SettingsProviderCollection.xml index 1848462313f..ec67dc4482f 100644 --- a/xml/System.Configuration/SettingsProviderCollection.xml +++ b/xml/System.Configuration/SettingsProviderCollection.xml @@ -134,7 +134,7 @@ The property of the is used as the storage key. > [!CAUTION] -> Although the method has a single parameter to match the signature of this same method in the base class , this method will throw an exception if the `provider` parameter is not of type . +> Although the method has a single parameter to match the signature of this same method in the base class , this method will throw an exception if the `provider` parameter is not of type . ]]> @@ -193,7 +193,7 @@ read-only by using the method. However, it is invalid to methods such as , , and on such a collection. + You can make a read-only by using the method. However, it is invalid to methods such as , , and on such a collection. ]]> diff --git a/xml/System.Configuration/SettingsSavingEventHandler.xml b/xml/System.Configuration/SettingsSavingEventHandler.xml index 6991c2a5f04..21668e5ca76 100644 --- a/xml/System.Configuration/SettingsSavingEventHandler.xml +++ b/xml/System.Configuration/SettingsSavingEventHandler.xml @@ -41,11 +41,11 @@ A that contains the event data. Represents the method that will handle the event. - event occurs just before a group of application settings are persisted, typically during the execution of the method of a wrapper class derived from . - + event occurs just before a group of application settings are persisted, typically during the execution of the method of a wrapper class derived from . + ]]> diff --git a/xml/System.Configuration/SettingsSerializeAsAttribute.xml b/xml/System.Configuration/SettingsSerializeAsAttribute.xml index ae5e5369647..6b3698c6c60 100644 --- a/xml/System.Configuration/SettingsSerializeAsAttribute.xml +++ b/xml/System.Configuration/SettingsSerializeAsAttribute.xml @@ -152,7 +152,7 @@ constructor. + This property is set in the constructor. ]]> diff --git a/xml/System.Configuration/SpecialSettingAttribute.xml b/xml/System.Configuration/SpecialSettingAttribute.xml index 2b3fe73e9bf..61c716b9e8a 100644 --- a/xml/System.Configuration/SpecialSettingAttribute.xml +++ b/xml/System.Configuration/SpecialSettingAttribute.xml @@ -46,7 +46,7 @@ can only be applied to the settings class or to the individual settings property. - For an example of how a settings provider deals with the , see the method of the class. + For an example of how a settings provider deals with the , see the method of the class. ]]> @@ -137,7 +137,7 @@ property is set in the constructor of this class. + The property is set in the constructor of this class. ]]> diff --git a/xml/System.Configuration/StringValidator.xml b/xml/System.Configuration/StringValidator.xml index 70b8c8085e8..e11a11c4929 100644 --- a/xml/System.Configuration/StringValidator.xml +++ b/xml/System.Configuration/StringValidator.xml @@ -33,21 +33,21 @@ Provides validation of a string. - class is used to ensure that a string meets specific criteria. The criteria for validation is established when an instance of the class is created. There are three constructor overloads for the class. The constructor with one parameter verifies the minimum acceptable length of the string being validated. The constructor with two parameters ensures that the string being verified adheres to both a minimum and a maximum length. The constructor with three parameters checks both the minimum and the maximum length values of the string being verified, as well as whether specific characters are present in the string being validated. - - The method determines whether the object type being validated matches the expected type. The object being validated is passed as a parameter of the method. - - - -## Examples - The following example demonstrates how to use the type. - + class is used to ensure that a string meets specific criteria. The criteria for validation is established when an instance of the class is created. There are three constructor overloads for the class. The constructor with one parameter verifies the minimum acceptable length of the string being validated. The constructor with two parameters ensures that the string being verified adheres to both a minimum and a maximum length. The constructor with three parameters checks both the minimum and the maximum length values of the string being verified, as well as whether specific characters are present in the string being validated. + + The method determines whether the object type being validated matches the expected type. The object being validated is passed as a parameter of the method. + + + +## Examples + The following example demonstrates how to use the type. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.StringValidator/CS/StringValidator.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.StringValidator/VB/StringValidator.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.StringValidator/VB/StringValidator.vb" id="Snippet1"::: + ]]> @@ -95,11 +95,11 @@ An integer that specifies the minimum length of the string value. Initializes a new instance of the class, based on a supplied parameter. - constructor verifies the minimum acceptable length of the string being validated. - + constructor verifies the minimum acceptable length of the string being validated. + ]]> @@ -138,11 +138,11 @@ An integer that specifies the maximum length of the string value. Initializes a new instance of the class, based on supplied parameters. - constructor ensures that the string being verified adheres to both a minimum and a maximum length. - + constructor ensures that the string being verified adheres to both a minimum and a maximum length. + ]]> @@ -183,19 +183,19 @@ A string that represents invalid characters. Initializes a new instance of the class, based on supplied parameters. - constructor ensures that the string being validated adheres to both a minimum and a maximum length, and also ensures that specific characters are excluded in the string. - - - -## Examples - The following example demonstrates how to use this constructor. This code example is part of a larger example provided for the class. - + constructor ensures that the string being validated adheres to both a minimum and a maximum length, and also ensures that specific characters are excluded in the string. + + + +## Examples + The following example demonstrates how to use this constructor. This code example is part of a larger example provided for the class. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.StringValidator/CS/StringValidator.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.StringValidator/VB/StringValidator.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.StringValidator/VB/StringValidator.vb" id="Snippet2"::: + ]]> @@ -237,14 +237,14 @@ if the parameter matches a string; otherwise, . - method. This code example is part of a larger example provided for the class. - + method. This code example is part of a larger example provided for the class. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.StringValidator/CS/StringValidator.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.StringValidator/VB/StringValidator.vb" id="Snippet3"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.StringValidator/VB/StringValidator.vb" id="Snippet3"::: + ]]> @@ -284,26 +284,26 @@ The object value. Determines whether the value of an object is valid. - class contains the criteria necessary to validate a string object. The criteria are established when an instance of the class is created. The object to validate is passed as a parameter of the method. - - - -## Examples - The following example demonstrates how to use the method. This code example is part of a larger example provided for the class. - + class contains the criteria necessary to validate a string object. The criteria are established when an instance of the class is created. The object to validate is passed as a parameter of the method. + + + +## Examples + The following example demonstrates how to use the method. This code example is part of a larger example provided for the class. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.StringValidator/CS/StringValidator.cs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.StringValidator/VB/StringValidator.vb" id="Snippet4"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.StringValidator/VB/StringValidator.vb" id="Snippet4"::: + ]]> - is less than or greater than as defined in the constructor. - + is less than or greater than as defined in the constructor. + -or- - + contains invalid characters. diff --git a/xml/System.Configuration/StringValidatorAttribute.xml b/xml/System.Configuration/StringValidatorAttribute.xml index 7962063d74c..b10fbf18b3d 100644 --- a/xml/System.Configuration/StringValidatorAttribute.xml +++ b/xml/System.Configuration/StringValidatorAttribute.xml @@ -95,7 +95,7 @@ ## Examples - The following example shows how to use the constructor. + The following example shows how to use the constructor. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationValidatorAttributes/CS/ConfigurationValidatorAttributes.cs" id="Snippet3"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationValidatorAttributes/VB/ConfigurationValidatorAttributes.vb" id="Snippet3"::: @@ -274,7 +274,7 @@ property to perform string validation by calling its method. + You use the property to perform string validation by calling its method. diff --git a/xml/System.Configuration/SubclassTypeValidator.xml b/xml/System.Configuration/SubclassTypeValidator.xml index e6133ab628f..de366ea3a59 100644 --- a/xml/System.Configuration/SubclassTypeValidator.xml +++ b/xml/System.Configuration/SubclassTypeValidator.xml @@ -33,13 +33,13 @@ Validates that an object is a derived class of a specified type. - class is used to ensure that an object meets specific criteria. The criteria for validation is established when an instance of the class is created. - - The method determines whether the type of the object being validated is in fact a . The object being validated is passed as a parameter of the method. This method first verifies that the object to validate is not `null`, and then verifies that the object is a derived class of the expected type. - + class is used to ensure that an object meets specific criteria. The criteria for validation is established when an instance of the class is created. + + The method determines whether the type of the object being validated is in fact a . The object being validated is passed as a parameter of the method. This method first verifies that the object to validate is not `null`, and then verifies that the object is a derived class of the expected type. + ]]> @@ -76,11 +76,11 @@ The base class to validate against. Initializes a new instance of the class. - @@ -124,11 +124,11 @@ if the parameter matches a type that can be validated; otherwise, . - method determines whether the type of the object being validated is in fact a . - + method determines whether the type of the object being validated is in fact a . + ]]> @@ -168,11 +168,11 @@ The object value. Determines whether the value of an object is valid. - class is created, the base class is provided and used as evaluation criteria. The object to validate is passed as a parameter of the method. This method performs the validation check between the base class and the parameter object. - + class is created, the base class is provided and used as evaluation criteria. The object to validate is passed as a parameter of the method. This method performs the validation check between the base class and the parameter object. + ]]> diff --git a/xml/System.Configuration/TimeSpanMinutesConverter.xml b/xml/System.Configuration/TimeSpanMinutesConverter.xml index 91883736b7c..561ccb6e121 100644 --- a/xml/System.Configuration/TimeSpanMinutesConverter.xml +++ b/xml/System.Configuration/TimeSpanMinutesConverter.xml @@ -33,46 +33,46 @@ Converts a time span expressed in minutes. - converts minutes, assigned to a configuration property, to minutes and vice versa. - - The persists values of type `long` representing a number of minutes. - - - -## Examples - The following code example shows how to define a custom type. - + converts minutes, assigned to a configuration property, to minutes and vice versa. + + The persists values of type `long` representing a number of minutes. + + + +## Examples + The following code example shows how to define a custom type. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.TimeSpanMinutesConverter/CS/TimeSpanMinutesConverter.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.TimeSpanMinutesConverter/VB/TimeSpanMinutesConverter.vb" id="Snippet1"::: - - The following is a configuration excerpt used by the previous example. - -```xml - - - -
- - - - - -``` - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.TimeSpanMinutesConverter/VB/TimeSpanMinutesConverter.vb" id="Snippet1"::: + + The following is a configuration excerpt used by the previous example. + +```xml + + + +
+ + + + + +``` + ]]> @@ -113,11 +113,11 @@ Initializes a new instance of the class. - constructor is when you create your own conversion type. - + constructor is when you create your own conversion type. + ]]> @@ -162,19 +162,19 @@ Converts a to a . The representing the parameter in minutes. - method when reading from a configuration file to convert a value to . - - - -## Examples - The following code example shows how to customize the method. - + method when reading from a configuration file to convert a value to . + + + +## Examples + The following code example shows how to customize the method. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.TimeSpanMinutesConverter/CS/TimeSpanMinutesConverter.cs" id="Snippet5"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.TimeSpanMinutesConverter/VB/TimeSpanMinutesConverter.vb" id="Snippet5"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.TimeSpanMinutesConverter/VB/TimeSpanMinutesConverter.vb" id="Snippet5"::: + ]]> @@ -221,19 +221,19 @@ Converts a to a . The representing the parameter in minutes. - method when writing to a configuration file to convert a to a . - - - -## Examples - The following code example shows how to customize the method. - + method when writing to a configuration file to convert a to a . + + + +## Examples + The following code example shows how to customize the method. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.TimeSpanMinutesConverter/CS/TimeSpanMinutesConverter.cs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.TimeSpanMinutesConverter/VB/TimeSpanMinutesConverter.vb" id="Snippet4"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.TimeSpanMinutesConverter/VB/TimeSpanMinutesConverter.vb" id="Snippet4"::: + ]]> diff --git a/xml/System.Configuration/TimeSpanMinutesOrInfiniteConverter.xml b/xml/System.Configuration/TimeSpanMinutesOrInfiniteConverter.xml index 91888144729..4231c095fbd 100644 --- a/xml/System.Configuration/TimeSpanMinutesOrInfiniteConverter.xml +++ b/xml/System.Configuration/TimeSpanMinutesOrInfiniteConverter.xml @@ -33,20 +33,20 @@ Converts a expressed in minutes or as a standard infinite time span. - class converts minutes, assigned to a configuration property, to minutes and vice versa. If the configuration property has a value of "infinite", it converts this value to and vice versa. - - The infinite value is represented by the enumeration value. - - - -## Examples - Refer to the code examples in the and classes. - + class converts minutes, assigned to a configuration property, to minutes and vice versa. If the configuration property has a value of "infinite", it converts this value to and vice versa. + + The infinite value is represented by the enumeration value. + + + +## Examples + Refer to the code examples in the and classes. + ]]> @@ -87,11 +87,11 @@ Initializes a new instance of the class. - constructor is when you create your own conversion type. - + constructor is when you create your own conversion type. + ]]> @@ -136,16 +136,16 @@ Converts a to a . The TimeSpan.MaxValue, if the parameter is the "infinite"; otherwise, the representing the parameter in minutes. - method when reading from a configuration file to convert a value to , or the "infinite" to . - - - -## Examples - Refer to the code examples in the and classes. - + method when reading from a configuration file to convert a value to , or the "infinite" to . + + + +## Examples + Refer to the code examples in the and classes. + ]]> @@ -192,16 +192,16 @@ Converts a to a . The "infinite", if the parameter is TimeSpan.MaxValue; otherwise, the representing the parameter in minutes. - method when writing to a configuration file to convert a value or to a . - - - -## Examples - Refer to the code examples in the and classes. - + method when writing to a configuration file to convert a value or to a . + + + +## Examples + Refer to the code examples in the and classes. + ]]> diff --git a/xml/System.Configuration/TimeSpanSecondsConverter.xml b/xml/System.Configuration/TimeSpanSecondsConverter.xml index faa8dff51bc..e722a9adf6e 100644 --- a/xml/System.Configuration/TimeSpanSecondsConverter.xml +++ b/xml/System.Configuration/TimeSpanSecondsConverter.xml @@ -33,20 +33,20 @@ Converts a time span expressed in seconds. - converts seconds, assigned to a configuration property, to seconds and vice versa. - - The persists values of type `long` that represent a number of seconds. - - - -## Examples - Refer to the code examples in and . - + converts seconds, assigned to a configuration property, to seconds and vice versa. + + The persists values of type `long` that represent a number of seconds. + + + +## Examples + Refer to the code examples in and . + ]]> @@ -86,11 +86,11 @@ Initializes a new instance of the class. - constructor is when you create your own conversion type. - + constructor is when you create your own conversion type. + ]]> @@ -135,11 +135,11 @@ Converts a to a . The representing the parameter in seconds. - method when it reads from a configuration file to convert a value to . - + method when it reads from a configuration file to convert a value to . + ]]> @@ -188,11 +188,11 @@ Converts a to a . The that represents the parameter in minutes. - method when it writes to a configuration file to convert a to a . - + method when it writes to a configuration file to convert a to a . + ]]> diff --git a/xml/System.Configuration/TimeSpanSecondsOrInfiniteConverter.xml b/xml/System.Configuration/TimeSpanSecondsOrInfiniteConverter.xml index e066bc6d60a..471ce9465aa 100644 --- a/xml/System.Configuration/TimeSpanSecondsOrInfiniteConverter.xml +++ b/xml/System.Configuration/TimeSpanSecondsOrInfiniteConverter.xml @@ -33,20 +33,20 @@ Converts a expressed in seconds or as a standard infinite time span. - converts seconds, assigned to a configuration property, to seconds, and vice versa. If the configuration property has a value of "infinite", it converts this value to and vice versa. - - The infinite value is represented by the enumeration value. - - - -## Examples - Refer to the code examples in the and classes. - + converts seconds, assigned to a configuration property, to seconds, and vice versa. If the configuration property has a value of "infinite", it converts this value to and vice versa. + + The infinite value is represented by the enumeration value. + + + +## Examples + Refer to the code examples in the and classes. + ]]> @@ -87,11 +87,11 @@ Initializes a new instance of the class. - constructor is when you create your own conversion type. - + constructor is when you create your own conversion type. + ]]> @@ -136,16 +136,16 @@ Converts a to a . The TimeSpan.MaxValue, if the parameter is the "infinite"; otherwise, the representing the parameter in seconds. - when reading from a configuration file to convert a value to , or the "infinite" to . - - - -## Examples - Refer to the code examples in the and classes. - + when reading from a configuration file to convert a value to , or the "infinite" to . + + + +## Examples + Refer to the code examples in the and classes. + ]]> @@ -192,16 +192,16 @@ Converts a to a. . The "infinite", if the parameter is TimeSpan.MaxValue; otherwise, the representing the parameter in seconds. - when writing to a configuration file to convert a value or to a . - - - -## Examples - Refer to the code examples in the and classes. - + when writing to a configuration file to convert a value or to a . + + + +## Examples + Refer to the code examples in the and classes. + ]]> diff --git a/xml/System.Configuration/TimeSpanValidator.xml b/xml/System.Configuration/TimeSpanValidator.xml index 44b7047dbf4..e5bfb87d96c 100644 --- a/xml/System.Configuration/TimeSpanValidator.xml +++ b/xml/System.Configuration/TimeSpanValidator.xml @@ -33,21 +33,21 @@ Provides validation of a object. - class is used to ensure that a object meets specific criteria. The constructor with two parameters ensures that both a minimum and a maximum value are adhered to. The constructor with three parameters checks both the minimum and maximum values, as well as whether the validation range is exclusive. The constructor with four parameters checks the previous three parameters and also checks whether the value is equal to a specific number of seconds. - - The method determines whether the object type being validated matches the expected type. The object being validated is passed as a parameter of the method. - - - -## Examples - The following code example demonstrates how to use the type. - + class is used to ensure that a object meets specific criteria. The constructor with two parameters ensures that both a minimum and a maximum value are adhered to. The constructor with three parameters checks both the minimum and maximum values, as well as whether the validation range is exclusive. The constructor with four parameters checks the previous three parameters and also checks whether the value is equal to a specific number of seconds. + + The method determines whether the object type being validated matches the expected type. The object being validated is passed as a parameter of the method. + + + +## Examples + The following code example demonstrates how to use the type. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.TimeSpanValidator/CS/TimeSpanValidator.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.TimeSpanValidator/VB/TimeSpanValidator.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.TimeSpanValidator/VB/TimeSpanValidator.vb" id="Snippet1"::: + ]]> @@ -96,11 +96,11 @@ A object that specifies the maximum time allowed to pass validation. Initializes a new instance of the class, based on supplied parameters. - constructor with two parameters is used, the object validates that a value adheres to a specific range. - + constructor with two parameters is used, the object validates that a value adheres to a specific range. + ]]> @@ -141,11 +141,11 @@ A value that specifies whether the validation range is exclusive. Initializes a new instance of the class, based on supplied parameters. - constructor checks both the minimum and maximum values, as well as whether the validation range is exclusive. When the `rangeIsExclusive` parameter is set to `true`, the value must not be between the `minValue` and `maxValue` values. - + constructor checks both the minimum and maximum values, as well as whether the validation range is exclusive. When the `rangeIsExclusive` parameter is set to `true`, the value must not be between the `minValue` and `maxValue` values. + ]]> @@ -188,26 +188,26 @@ An value that specifies a number of seconds. Initializes a new instance of the class, based on supplied parameters. - object being validated must be equal to this value in order to pass validation. - - - -## Examples - The following code example demonstrates how to use the constructor. This code example is part of a larger example provided for the class. - + object being validated must be equal to this value in order to pass validation. + + + +## Examples + The following code example demonstrates how to use the constructor. This code example is part of a larger example provided for the class. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.TimeSpanValidator/CS/TimeSpanValidator.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.TimeSpanValidator/VB/TimeSpanValidator.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.TimeSpanValidator/VB/TimeSpanValidator.vb" id="Snippet2"::: + ]]> - is less than . - + is less than . + -or- - + is greater than . @@ -248,14 +248,14 @@ if the parameter matches a value; otherwise, . - method. This code example is part of a larger example provided for the class. - + method. This code example is part of a larger example provided for the class. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.TimeSpanValidator/CS/TimeSpanValidator.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.TimeSpanValidator/VB/TimeSpanValidator.vb" id="Snippet3"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.TimeSpanValidator/VB/TimeSpanValidator.vb" id="Snippet3"::: + ]]> @@ -295,19 +295,19 @@ The value of an object. Determines whether the value of an object is valid. - object contains the rules necessary to validate a object. The rules are established when an instance of the class is created. The object to validate is passed as a parameter of the method. - - - -## Examples - The following code example demonstrates how to use the method. This code example is part of a larger example provided for the class. - + object contains the rules necessary to validate a object. The rules are established when an instance of the class is created. The object to validate is passed as a parameter of the method. + + + +## Examples + The following code example demonstrates how to use the method. This code example is part of a larger example provided for the class. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.TimeSpanValidator/CS/TimeSpanValidator.cs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.TimeSpanValidator/VB/TimeSpanValidator.vb" id="Snippet4"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.TimeSpanValidator/VB/TimeSpanValidator.vb" id="Snippet4"::: + ]]> diff --git a/xml/System.Configuration/TimeSpanValidatorAttribute.xml b/xml/System.Configuration/TimeSpanValidatorAttribute.xml index 84c9621a153..ab0f95d2902 100644 --- a/xml/System.Configuration/TimeSpanValidatorAttribute.xml +++ b/xml/System.Configuration/TimeSpanValidatorAttribute.xml @@ -109,7 +109,7 @@ ## Examples - The following example shows how to use the constructor. + The following example shows how to use the constructor. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationValidatorAttributes/CS/ConfigurationValidatorAttributes.cs" id="Snippet12"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationValidatorAttributes/VB/ConfigurationValidatorAttributes.vb" id="Snippet12"::: @@ -154,7 +154,7 @@ and properties. When the property is `false`, the allowed values are outside the range. + The range is inclusive of the and properties. When the property is `false`, the allowed values are outside the range. @@ -481,7 +481,7 @@ property to perform string validation by calling its method. + You use the property to perform string validation by calling its method. ]]> diff --git a/xml/System.Configuration/TypeNameConverter.xml b/xml/System.Configuration/TypeNameConverter.xml index 9e9fb6be943..96dc48bbce7 100644 --- a/xml/System.Configuration/TypeNameConverter.xml +++ b/xml/System.Configuration/TypeNameConverter.xml @@ -33,45 +33,45 @@ Converts between type and string values. This class cannot be inherited. - class converts a value, assigned to a configuration type, to a value and vice versa. The type referred to is the class responsible for processing the configuration it is associated with. - - - -## Examples - The following example shows how to obtain a type associated with a custom section. For the implementation of the custom section, refer to the code example in the class reference. - + class converts a value, assigned to a configuration type, to a value and vice versa. The type referred to is the class responsible for processing the configuration it is associated with. + + + +## Examples + The following example shows how to obtain a type associated with a custom section. For the implementation of the custom section, refer to the code example in the class reference. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.TypeNameConverter/CS/TypeNameConverter.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.TypeNameConverter/VB/TypeNameConverter.vb" id="Snippet1"::: - - The following example is a configuration excerpt used by the previous example. - -```xml - - - - -
- - - - - -``` - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.TypeNameConverter/VB/TypeNameConverter.vb" id="Snippet1"::: + + The following example is a configuration excerpt used by the previous example. + +```xml + + + + +
+ + + + + +``` + ]]> @@ -111,11 +111,11 @@ Initializes a new instance of the class. - constructor is when you create your own conversion type. - + constructor is when you create your own conversion type. + ]]> @@ -160,11 +160,11 @@ Converts a object to a object. The that represents the parameter. - method when reading from a configuration file to convert a value to a value. - + method when reading from a configuration file to convert a value to a value. + ]]> The value cannot be resolved. @@ -212,11 +212,11 @@ Converts a object to a object. The that represents the parameter. - method when writing to a configuration file to convert a value to a value. - + method when writing to a configuration file to convert a value to a value. + ]]> diff --git a/xml/System.Configuration/WhiteSpaceTrimStringConverter.xml b/xml/System.Configuration/WhiteSpaceTrimStringConverter.xml index 21f5c36117a..ef0f39d1404 100644 --- a/xml/System.Configuration/WhiteSpaceTrimStringConverter.xml +++ b/xml/System.Configuration/WhiteSpaceTrimStringConverter.xml @@ -33,41 +33,41 @@ Converts a string to its canonical format. - object converts between a configuration string value and its canonical representation. Canonical representation means that all white spaces are trimmed from the beginning and end of a string value. - - - -## Examples - The following code example shows how to apply to a custom string property `FileName`. - + object converts between a configuration string value and its canonical representation. Canonical representation means that all white spaces are trimmed from the beginning and end of a string value. + + + +## Examples + The following code example shows how to apply to a custom string property `FileName`. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Configuration.ConfigurationConvertersCustomSection/CS/ConfigurationConvertersCustomSection.cs" id="Snippet0"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationConvertersCustomSection/VB/ConfigurationConvertersCustomSection.vb" id="Snippet0"::: - - The following is a configuration excerpt used by the previous example. - -```xml - - - - -
- - - - - -``` - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Configuration.ConfigurationConvertersCustomSection/VB/ConfigurationConvertersCustomSection.vb" id="Snippet0"::: + + The following is a configuration excerpt used by the previous example. + +```xml + + + + +
+ + + + + +``` + ]]> @@ -107,11 +107,11 @@ Initializes a new instance of the class. - constructor is when you create your own conversion type. - + constructor is when you create your own conversion type. + ]]> @@ -156,11 +156,11 @@ Converts a to canonical form. An object representing the converted value. - method when reading from a configuration file to convert a value to its canonical form. - + method when reading from a configuration file to convert a value to its canonical form. + ]]> @@ -207,11 +207,11 @@ Converts a to canonical form. An object representing the converted value. - method when writing to a configuration file to convert a value to its canonical form. - + method when writing to a configuration file to convert a value to its canonical form. + ]]> diff --git a/xml/System.EnterpriseServices.CompensatingResourceManager/Clerk.xml b/xml/System.EnterpriseServices.CompensatingResourceManager/Clerk.xml index a51f0b4fc6b..ead04660fcf 100644 --- a/xml/System.EnterpriseServices.CompensatingResourceManager/Clerk.xml +++ b/xml/System.EnterpriseServices.CompensatingResourceManager/Clerk.xml @@ -18,26 +18,26 @@ Writes records of transactional actions to a log. - class. - + :::code language="vb" source="~/snippets/visualbasic/System.EnterpriseServices/ContextUtil/SetAbort/crmserver.vb" id="Snippet10"::: + + The following code example demonstrates the corresponding class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/EnterpriseServices_Crm/cpp/crmclient.cpp" id="Snippet30"::: :::code language="csharp" source="~/snippets/csharp/System.EnterpriseServices/ContextUtil/SetAbort/crmclient.cs" id="Snippet30"::: - :::code language="vb" source="~/snippets/visualbasic/System.EnterpriseServices/ContextUtil/SetAbort/crmclient.vb" id="Snippet30"::: - + :::code language="vb" source="~/snippets/visualbasic/System.EnterpriseServices/ContextUtil/SetAbort/crmclient.vb" id="Snippet30"::: + ]]> @@ -103,15 +103,15 @@ A bitwise combination of the values. Initializes a new instance of the class. - @@ -160,20 +160,20 @@ Forces all log records to disk. - makes all log records that have been written durable on disk. - - - -## Examples - The following code example demonstrates the use of this method. - + makes all log records that have been written durable on disk. + + + +## Examples + The following code example demonstrates the use of this method. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/EnterpriseServices_Crm/cpp/crmserver.cpp" id="Snippet12"::: :::code language="csharp" source="~/snippets/csharp/System.EnterpriseServices/ContextUtil/SetAbort/crmserver.cs" id="Snippet12"::: - :::code language="vb" source="~/snippets/visualbasic/System.EnterpriseServices/ContextUtil/SetAbort/crmserver.vb" id="Snippet12"::: - + :::code language="vb" source="~/snippets/visualbasic/System.EnterpriseServices/ContextUtil/SetAbort/crmserver.vb" id="Snippet12"::: + ]]> @@ -222,11 +222,11 @@ Does not deliver the last log record that was written by this instance of this interface. - @@ -301,15 +301,15 @@ The log record to write to the log. Writes unstructured log records to the log. - diff --git a/xml/System.EnterpriseServices.CompensatingResourceManager/LogRecord.xml b/xml/System.EnterpriseServices.CompensatingResourceManager/LogRecord.xml index 84cb490846e..8deaf9c66f4 100644 --- a/xml/System.EnterpriseServices.CompensatingResourceManager/LogRecord.xml +++ b/xml/System.EnterpriseServices.CompensatingResourceManager/LogRecord.xml @@ -18,20 +18,20 @@ Represents an unstructured log record delivered as a COM+ structure. This class cannot be inherited. - field is a bit field that provides further information about whether this record was forgotten at some point, and when it was written. The field provides the sequence number of the log record. In most cases, sequence numbers are sequential but are not necessarily contiguous due to internal log records that are not delivered to the Compensating Resource Manager (CRM) Compensator. - - - -## Examples - The following code example demonstrates the use of this class. - + field is a bit field that provides further information about whether this record was forgotten at some point, and when it was written. The field provides the sequence number of the log record. In most cases, sequence numbers are sequential but are not necessarily contiguous due to internal log records that are not delivered to the Compensating Resource Manager (CRM) Compensator. + + + +## Examples + The following code example demonstrates the use of this class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/EnterpriseServices_Crm/cpp/crmserver.cpp" id="Snippet28"::: :::code language="csharp" source="~/snippets/csharp/System.EnterpriseServices/ContextUtil/SetAbort/crmserver.cs" id="Snippet28"::: - :::code language="vb" source="~/snippets/visualbasic/System.EnterpriseServices/ContextUtil/SetAbort/crmserver.vb" id="Snippet28"::: - + :::code language="vb" source="~/snippets/visualbasic/System.EnterpriseServices/ContextUtil/SetAbort/crmserver.vb" id="Snippet28"::: + ]]> @@ -80,15 +80,15 @@ Gets the log record user data. A single BLOB that contains the user data. - @@ -114,11 +114,11 @@ The sequence number of the log record. An integer value that specifies the sequence number of the log record. - diff --git a/xml/System.EnterpriseServices.Internal/AppDomainHelper.xml b/xml/System.EnterpriseServices.Internal/AppDomainHelper.xml index 415a7033874..1cea09d477d 100644 --- a/xml/System.EnterpriseServices.Internal/AppDomainHelper.xml +++ b/xml/System.EnterpriseServices.Internal/AppDomainHelper.xml @@ -24,11 +24,11 @@ Switches into the given application domain, which the object should be bound to, and does a callback on the given function. - is used internally by the .NET Framework. You do not need to use the class directly in your code. - + is used internally by the .NET Framework. You do not need to use the class directly in your code. + ]]> @@ -73,11 +73,11 @@ Releases unmanaged resources and performs other cleanup operations before the is reclaimed by garbage collection. - . Application code should not call this method; an object's method is automatically invoked during garbage collection, unless finalization by the garbage collector has been disabled by a call to the method. - + . Application code should not call this method; an object's method is automatically invoked during garbage collection, unless finalization by the garbage collector has been disabled by a call to the method. + ]]> diff --git a/xml/System.EnterpriseServices.Internal/ClientRemotingConfig.xml b/xml/System.EnterpriseServices.Internal/ClientRemotingConfig.xml index 81817392713..442a7cd0937 100644 --- a/xml/System.EnterpriseServices.Internal/ClientRemotingConfig.xml +++ b/xml/System.EnterpriseServices.Internal/ClientRemotingConfig.xml @@ -18,15 +18,15 @@ Defines a static method that creates a client remoting configuration file for a client type library. - method is used by the class while generating a COM interface from a client type library (with a .tlb extension). The class publishes COM interfaces in a SOAP-enabled COM+ application. One of the method's parameters is the name of an assembly that contains common language runtime (CLR) metadata that has already generated for the client type library. - - does not need to be called directly. Instead, call the method of the class. - - is used internally by the .NET Framework. You do not need to use the class directly in your code. - + method is used by the class while generating a COM interface from a client type library (with a .tlb extension). The class publishes COM interfaces in a SOAP-enabled COM+ application. One of the method's parameters is the name of an assembly that contains common language runtime (CLR) metadata that has already generated for the client type library. + + does not need to be called directly. Instead, call the method of the class. + + is used internally by the .NET Framework. You do not need to use the class directly in your code. + ]]> @@ -93,17 +93,17 @@ if the client remoting configuration file was successfully created; otherwise . - method is called by the class while generating a COM interface from a client type library (with a .tlb extension). The class publishes COM interfaces in a SOAP-enabled COM+ application. - - does not need to be called directly. Instead, call the method of the class. - - The `BaseUrl` and `VRoot` parameter values are concatenated (with a path separator, if needed) to form the client element's `URL` attribute value. - - The `AssemblyName` parameter identifies an assembly containing CLR metadata that , using the class, has already generated for the client type library. - + method is called by the class while generating a COM interface from a client type library (with a .tlb extension). The class publishes COM interfaces in a SOAP-enabled COM+ application. + + does not need to be called directly. Instead, call the method of the class. + + The `BaseUrl` and `VRoot` parameter values are concatenated (with a path separator, if needed) to form the client element's `URL` attribute value. + + The `AssemblyName` parameter identifies an assembly containing CLR metadata that , using the class, has already generated for the client type library. + ]]> diff --git a/xml/System.EnterpriseServices.Internal/ClrObjectFactory.xml b/xml/System.EnterpriseServices.Internal/ClrObjectFactory.xml index c87595863b4..60e89bc0ab6 100644 --- a/xml/System.EnterpriseServices.Internal/ClrObjectFactory.xml +++ b/xml/System.EnterpriseServices.Internal/ClrObjectFactory.xml @@ -28,11 +28,11 @@ Activates SOAP-enabled COM+ application proxies from a client. - is used internally by the .NET Framework. You do not need to use the class directly in your code. - + is used internally by the .NET Framework. You do not need to use the class directly in your code. + ]]> @@ -122,11 +122,11 @@ Activates a remote assembly through .NET remoting, using the remote assembly's mailbox. Currently not implemented; throws a if called. This method throws an exception if called. - Simple Mail Transfer Protocol (SMTP) is not implemented. @@ -162,15 +162,15 @@ Activates a remote assembly through .NET remoting, using the virtual root URL of the remote assembly. An instance of the representing the type, with culture, arguments, and binding and activation attributes set to , or if the assembly identified by the parameter is not found. - appends the string "?wsdl" to `VrootUrl` and calls to activate the remote object. - - The version of SOAP used by .NET remoting is RPC/encoded, not document/literal, which is required for SOAP interoperability. Therefore, will not work with most ASMX Web services. - - requires administrative privileges on the local computer the first time it is run, because it creates and installs a client proxy for communication with the remote assembly. - + appends the string "?wsdl" to `VrootUrl` and calls to activate the remote object. + + The version of SOAP used by .NET remoting is RPC/encoded, not document/literal, which is required for SOAP interoperability. Therefore, will not work with most ASMX Web services. + + requires administrative privileges on the local computer the first time it is run, because it creates and installs a client proxy for communication with the remote assembly. + ]]> A caller in the call chain does not have permission to access unmanaged code. @@ -207,15 +207,15 @@ Activates a remote assembly through .NET remoting, using the Web Services Description Language (WSDL) of the XML Web service. An instance of the representing the type, with culture, arguments, and binding and activation attributes set to , or if the assembly identified by the parameter is not found. - will not work with most ASMX Web services. - - requires administrative privileges on the local computer the first time it is run, because it creates and installs a client proxy for communication with the remote assembly. - + will not work with most ASMX Web services. + + requires administrative privileges on the local computer the first time it is run, because it creates and installs a client proxy for communication with the remote assembly. + ]]> A caller in the call chain does not have permission to access unmanaged code. diff --git a/xml/System.EnterpriseServices.Internal/ComManagedImportUtil.xml b/xml/System.EnterpriseServices.Internal/ComManagedImportUtil.xml index 93655d31da7..a39c90f5251 100644 --- a/xml/System.EnterpriseServices.Internal/ComManagedImportUtil.xml +++ b/xml/System.EnterpriseServices.Internal/ComManagedImportUtil.xml @@ -28,11 +28,11 @@ Identifies and installs components in the COM+ catalog. - is used internally by the .NET Framework. You do not need to use the class directly in your code. - + is used internally by the .NET Framework. You do not need to use the class directly in your code. + ]]> @@ -87,18 +87,18 @@ When this method returns, this parameter contains the information about the components. Gets the component information from the assembly. - - is an empty string, contains only white space, or contains one or more invalid characters as defined by . - - -or- - + is an empty string, contains only white space, or contains one or more invalid characters as defined by . + + -or- + The system could not retrieve the absolute path. The caller does not have the required permissions. @@ -139,23 +139,23 @@ The COM+ application name. Installs an assembly into a COM+ application. - calls , which performs the following steps: - -1. Registration of the assembly. - -2. Generation of a type library. - -3. Registration of the type library. - -4. Installation of the type library under the specified application. - -5. Configuration of the components contained in the type library. - - This method requires the caller to have administrative privileges on the local computer. - + calls , which performs the following steps: + +1. Registration of the assembly. + +2. Generation of a type library. + +3. Registration of the type library. + +4. Installation of the type library under the specified application. + +5. Configuration of the components contained in the type library. + + This method requires the caller to have administrative privileges on the local computer. + ]]> A caller in the call chain does not have permission to access unmanaged code. diff --git a/xml/System.EnterpriseServices.Internal/ComSoapPublishError.xml b/xml/System.EnterpriseServices.Internal/ComSoapPublishError.xml index 7d4800bd2ca..7a294b8db19 100644 --- a/xml/System.EnterpriseServices.Internal/ComSoapPublishError.xml +++ b/xml/System.EnterpriseServices.Internal/ComSoapPublishError.xml @@ -18,13 +18,13 @@ Error handler for publishing SOAP-enabled services in COM+ applications. - class provides a static method for writing to an event log errors that were encountered while publishing SOAP-enabled COM interfaces in COM+ applications. - - is used internally by the .NET Framework. You do not need to use the class directly in your code. - + class provides a static method for writing to an event log errors that were encountered while publishing SOAP-enabled COM interfaces in COM+ applications. + + is used internally by the .NET Framework. You do not need to use the class directly in your code. + ]]> @@ -75,11 +75,11 @@ An error message to be written to the event log. Writes to an event log an error encountered while publishing SOAP-enabled COM interfaces in COM+ applications. - method is used internally by the .NET Framework. You do not need to use the method directly in your code. - + method is used internally by the .NET Framework. You do not need to use the method directly in your code. + ]]> diff --git a/xml/System.EnterpriseServices.Internal/GenerateMetadata.xml b/xml/System.EnterpriseServices.Internal/GenerateMetadata.xml index e980d4eb89f..6260ec3cc43 100644 --- a/xml/System.EnterpriseServices.Internal/GenerateMetadata.xml +++ b/xml/System.EnterpriseServices.Internal/GenerateMetadata.xml @@ -28,13 +28,13 @@ Generates common language runtime (CLR) metadata for a COM+ component. - class generates an assembly that contains CLR metadata for a specified type library. - - is used internally by the .NET Framework. You do not need to use the class directly in your code. - + class generates an assembly that contains CLR metadata for a specified type library. + + is used internally by the .NET Framework. You do not need to use the class directly in your code. + ]]> @@ -90,13 +90,13 @@ Generates, or locates, an assembly that contains common language runtime (CLR) metadata for a COM+ component represented by the specified type library. The generated assembly name; otherwise, an empty string if the inputs are invalid. - method generates an assembly that contains CLR metadata for a specified type library. To do this processing, it calls the method. - - These methods do not need to be called directly from your code. - + method generates an assembly that contains CLR metadata for a specified type library. To do this processing, it calls the method. + + These methods do not need to be called directly from your code. + ]]> @@ -133,15 +133,15 @@ Generates, or locates, an assembly that contains common language runtime (CLR) metadata for a COM+ component represented by the specified type library, signs the assembly with a strong-named key pair, and installs it in the global assembly cache. The generated assembly name; otherwise, an empty string if the inputs are invalid. - method generates an assembly that contains CLR metadata for a specified type library. It does not generate an assembly if an assembly of the generated name already exists in the string `outPath` folder. - - does not need to be called directly from your code. It is called by both the and methods. - - If called by , also generates a strong-named key pair, signs the assembly, and installs it in the global assembly cache. - + method generates an assembly that contains CLR metadata for a specified type library. It does not generate an assembly if an assembly of the generated name already exists in the string `outPath` folder. + + does not need to be called directly from your code. It is called by both the and methods. + + If called by , also generates a strong-named key pair, signs the assembly, and installs it in the global assembly cache. + ]]> @@ -181,15 +181,15 @@ Generates, or locates, an assembly that contains common language runtime (CLR) metadata for a COM+ component represented by the specified type library, signs the assembly with a strong-named key pair, and installs it in the global assembly cache. The generated assembly name; otherwise, an empty string if the inputs are invalid. - method generates an assembly that contains CLR metadata for a specified type library. It also generates a strong-named key pair and signs the assembly. - - To do this processing, it calls the method. These methods do not need to be called directly from your code. - - The `InstallGac` parameter indicates whether to install the assembly in the global assembly cache. However, the implementation ignores this value and always attempts to install the signed assembly in the global assembly cache. - + method generates an assembly that contains CLR metadata for a specified type library. It also generates a strong-named key pair and signs the assembly. + + To do this processing, it calls the method. These methods do not need to be called directly from your code. + + The `InstallGac` parameter indicates whether to install the assembly in the global assembly cache. However, the implementation ignores this value and always attempts to install the signed assembly in the global assembly cache. + ]]> @@ -231,11 +231,11 @@ Searches for a specified file in a specified path. If the search succeeds, the return value is the length of the string copied to . If the search fails, the return value is 0. - diff --git a/xml/System.EnterpriseServices.Internal/IComManagedImportUtil.xml b/xml/System.EnterpriseServices.Internal/IComManagedImportUtil.xml index d859e45df12..24c6f40b211 100644 --- a/xml/System.EnterpriseServices.Internal/IComManagedImportUtil.xml +++ b/xml/System.EnterpriseServices.Internal/IComManagedImportUtil.xml @@ -21,13 +21,13 @@ Identifies and installs components in the COM+ catalog. - for the default implementation of . - - is used internally by the .NET Framework. You do not need to use it directly in your code. - + for the default implementation of . + + is used internally by the .NET Framework. You do not need to use it directly in your code. + ]]> @@ -66,18 +66,18 @@ When this method returns, this parameter contains the information about the components. Gets the component information from the assembly. - - is an empty string (""), contains only white space, or contains one or more invalid characters as defined by . - - -or- - + is an empty string (""), contains only white space, or contains one or more invalid characters as defined by . + + -or- + The system could not retrieve the absolute path. The caller does not have the required permissions. @@ -121,13 +121,13 @@ The COM+ application name. Installs an assembly into a COM+ application. - for more information on the implementation of this method. - - This method requires the caller to have administrative privileges on the local computer. - + for more information on the implementation of this method. + + This method requires the caller to have administrative privileges on the local computer. + ]]> A caller in the call chain does not have permission to access unmanaged code. diff --git a/xml/System.EnterpriseServices.Internal/IComSoapIISVRoot.xml b/xml/System.EnterpriseServices.Internal/IComSoapIISVRoot.xml index 8443ba06734..7734f151091 100644 --- a/xml/System.EnterpriseServices.Internal/IComSoapIISVRoot.xml +++ b/xml/System.EnterpriseServices.Internal/IComSoapIISVRoot.xml @@ -21,17 +21,17 @@ Interface definition for creating and deleting Internet Information Services (IIS) 6.0 virtual roots. - interface defines methods for creating and deleting virtual roots in IIS 6.0. - - This interface is implemented only by the class and is used only within the .NET Framework infrastructure while creating a SOAP-enabled COM+ application virtual root. - - does not need to be implemented directly in your code. Instead, use the class, which implements the interface that contains the and methods. However, is not fully implemented by . - - is used internally by the .NET Framework. You do not need to use it directly in your code. - + interface defines methods for creating and deleting virtual roots in IIS 6.0. + + This interface is implemented only by the class and is used only within the .NET Framework infrastructure while creating a SOAP-enabled COM+ application virtual root. + + does not need to be implemented directly in your code. Instead, use the class, which implements the interface that contains the and methods. However, is not fully implemented by . + + is used internally by the .NET Framework. You do not need to use it directly in your code. + ]]> @@ -73,11 +73,11 @@ A string to which an error message can be written. Creates an Internet Information Services (IIS) virtual root. - interface does not need to be implemented directly in your code. Instead, use the interface (implemented by the class), which exposes a method. - + interface does not need to be implemented directly in your code. Instead, use the interface (implemented by the class), which exposes a method. + ]]> @@ -119,11 +119,11 @@ A string to which an error message can be written. Deletes an Internet Information Services (IIS) virtual root. - interface does not need to be implemented directly in your code. Alternatively, the interface (implemented by the class), exposes a method. However, that method is not fully implemented by . - + interface does not need to be implemented directly in your code. Alternatively, the interface (implemented by the class), exposes a method. However, that method is not fully implemented by . + ]]> diff --git a/xml/System.EnterpriseServices.Internal/IComSoapMetadata.xml b/xml/System.EnterpriseServices.Internal/IComSoapMetadata.xml index e2fbd922e37..c7b93932fa0 100644 --- a/xml/System.EnterpriseServices.Internal/IComSoapMetadata.xml +++ b/xml/System.EnterpriseServices.Internal/IComSoapMetadata.xml @@ -21,15 +21,15 @@ Specifies methods for generating common language runtime (CLR) metadata for a COM+ component. - interface does not need to be implemented directly in your code. It is implemented by the class in the .NET Framework infrastructure. - - If necessary, specifies that an assembly that contains CLR metadata is generated for a specified type library. - - is used internally by the .NET Framework. You do not need to use it directly in your code. - + interface does not need to be implemented directly in your code. It is implemented by the class in the .NET Framework infrastructure. + + If necessary, specifies that an assembly that contains CLR metadata is generated for a specified type library. + + is used internally by the .NET Framework. You do not need to use it directly in your code. + ]]> @@ -68,11 +68,11 @@ Generates an assembly that contains common language runtime (CLR) metadata for a COM+ component represented by the specified type library. The generated assembly name. - method specifies that an assembly that contains CLR metadata is generated for a specified type library. - + method specifies that an assembly that contains CLR metadata is generated for a specified type library. + ]]> @@ -115,13 +115,13 @@ Generates an assembly that contains common language runtime (CLR) metadata for a COM+ component represented by the specified type library, signs the assembly with a strong-named key pair, and installs it in the global assembly cache. The generated assembly name. - method specifies that an assembly that contains CLR metadata is generated for a specified type library. Additionally, generates a strong-named key pair and signs the assembly. - - The `InstallGac` parameter indicates whether to install the assembly in the global assembly cache. However, the one implementation of , by the class, ignores this value and always attempts to install the signed assembly in the global assembly cache. - + method specifies that an assembly that contains CLR metadata is generated for a specified type library. Additionally, generates a strong-named key pair and signs the assembly. + + The `InstallGac` parameter indicates whether to install the assembly in the global assembly cache. However, the one implementation of , by the class, ignores this value and always attempts to install the signed assembly in the global assembly cache. + ]]> diff --git a/xml/System.EnterpriseServices.Internal/IComSoapPublisher.xml b/xml/System.EnterpriseServices.Internal/IComSoapPublisher.xml index f4d5c69cbfe..4f12b54f4da 100644 --- a/xml/System.EnterpriseServices.Internal/IComSoapPublisher.xml +++ b/xml/System.EnterpriseServices.Internal/IComSoapPublisher.xml @@ -21,13 +21,13 @@ Publishes COM interfaces for SOAP-enabled COM+ applications. - is ; see that topic for specifics. - - is used internally by the .NET Framework. You do not need to use it directly in your code. - + is ; see that topic for specifics. + + is used internally by the .NET Framework. You do not need to use it directly in your code. + ]]> @@ -72,11 +72,11 @@ When this method returns, this parameter contains an error message if a problem was encountered. Creates a SOAP-enabled COM+ application mailbox at a specified URL. Not fully implemented. - A caller in the call chain does not have permission to access unmanaged code. @@ -122,42 +122,42 @@ When this method returns, this parameter contains an error message if a problem was encountered. Creates a SOAP-enabled COM+ application virtual root. - be used instead of . - + be used instead of . + ]]> - A caller in the call chain does not have permission to access unmanaged code. - - -or- - + A caller in the call chain does not have permission to access unmanaged code. + + -or- + The caller does not have permission to access Domain Name System (DNS) information. is . An error is encountered when resolving the local host name. - is empty. - - -or- - - The scheme specified in is invalid. - - -or- - - contains more than two consecutive slashes. - - -or- - - The password specified in is invalid. - - -or- - - The host name specified in is invalid. - - -or- - + is empty. + + -or- + + The scheme specified in is invalid. + + -or- + + contains more than two consecutive slashes. + + -or- + + The password specified in is invalid. + + -or- + + The host name specified in is invalid. + + -or- + The file name specified in is invalid. @@ -195,11 +195,11 @@ When this method returns, this parameter contains an error message if a problem was encountered. Deletes a SOAP-enabled COM+ application mailbox at a specified URL. Not fully implemented. - A caller in the call chain does not have permission to access unmanaged code. @@ -239,16 +239,16 @@ When this method returns, this parameter contains an error message if a problem was encountered. Deletes a SOAP-enabled COM+ application virtual root. Not fully implemented. - is not yet available. - + is not yet available. + > [!CAUTION] -> The method currently returns without an error, but the virtual root is not deleted. - - When the functionality becomes available, the recommended method will be . - +> The method currently returns without an error, but the virtual root is not deleted. + + When the functionality becomes available, the recommended method will be . + ]]> A caller in the call chain does not have permission to access unmanaged code. @@ -360,11 +360,11 @@ When this method returns, this parameter contains the full path of the proxy assembly in the SoapCache directory. Returns the full path for a strong-named signed generated assembly in the SoapCache directory. - @@ -461,15 +461,15 @@ When this method returns, this parameter contains an error message if a problem was encountered. Processes a client type library, creating a configuration file on the client. - be used instead of . - + be used instead of . + ]]> A caller in the call chain does not have permission to access unmanaged code. @@ -517,13 +517,13 @@ When this method returns, this parameter contains an error message if a problem was encountered. Processes a server type library, either adding or deleting component entries to the Web.config and Default.disco files. Generates a proxy if necessary. - and be used instead of . - + and be used instead of . + ]]> A caller in the call chain does not have permission to access unmanaged code. @@ -560,18 +560,18 @@ The file system path for the assembly. Registers an assembly for COM interop. - uses the Assembly Registration tool (Regasm.exe) to register the creatable classes in the assembly. For more information, see [Regasm.exe (Assembly Registration Tool)](/dotnet/framework/tools/regasm-exe-assembly-registration-tool). - + uses the Assembly Registration tool (Regasm.exe) to register the creatable classes in the assembly. For more information, see [Regasm.exe (Assembly Registration Tool)](/dotnet/framework/tools/regasm-exe-assembly-registration-tool). + ]]> The input assembly does not have a strong name. - A caller in the call chain does not have permission to access unmanaged code. - - -or- - + A caller in the call chain does not have permission to access unmanaged code. + + -or- + A codebase that does not start with "file://" was specified without the required . is . @@ -580,14 +580,14 @@ is not a valid assembly. An assembly or module was loaded twice with two different evidences, or the assembly name exceeds the system-defined maximum length. - A method marked with is not . - - -or- - - There is more than one method marked with at a given level of the hierarchy. - - -or- - + A method marked with is not . + + -or- + + There is more than one method marked with at a given level of the hierarchy. + + -or- + The signature of the method marked with is not valid. @@ -621,17 +621,17 @@ The file system path for the assembly. Unregisters a COM interop assembly. - uses Regasm.exe to unregister the creatable classes in the assembly. For more information, see [Regasm.exe (Assembly Registration Tool)](/dotnet/framework/tools/regasm-exe-assembly-registration-tool). - + uses Regasm.exe to unregister the creatable classes in the assembly. For more information, see [Regasm.exe (Assembly Registration Tool)](/dotnet/framework/tools/regasm-exe-assembly-registration-tool). + ]]> - A caller in the call chain does not have permission to access unmanaged code. - - -or- - + A caller in the call chain does not have permission to access unmanaged code. + + -or- + A codebase that does not start with "file://" was specified without the required . is . @@ -640,14 +640,14 @@ is not a valid assembly. An assembly or module was loaded twice with two different evidences, or the assembly name exceeds the system-defined maximum length. - A method marked with is not . - - -or- - - There is more than one method marked with at a given level of the hierarchy. - - -or- - + A method marked with is not . + + -or- + + There is more than one method marked with at a given level of the hierarchy. + + -or- + The signature of the method marked with is not valid. diff --git a/xml/System.EnterpriseServices.Internal/IISVirtualRoot.xml b/xml/System.EnterpriseServices.Internal/IISVirtualRoot.xml index 952910b5cb5..6b038633848 100644 --- a/xml/System.EnterpriseServices.Internal/IISVirtualRoot.xml +++ b/xml/System.EnterpriseServices.Internal/IISVirtualRoot.xml @@ -28,17 +28,17 @@ Creates and deletes Internet Information Services (IIS) 6.0 virtual roots. - interface defines methods for creating and deleting virtual roots in IIS 6.0. - - This interface is implemented only by the class and is used only within the .NET Framework infrastructure while creating a SOAP-enabled COM+ application virtual root. - - does not need to be implemented directly in your code. Instead, use the class, which implements the interface that contains the and methods. However, is not fully implemented by . - - is used internally by the .NET Framework. You do not need to use it directly in your code. - + interface defines methods for creating and deleting virtual roots in IIS 6.0. + + This interface is implemented only by the class and is used only within the .NET Framework infrastructure while creating a SOAP-enabled COM+ application virtual root. + + does not need to be implemented directly in your code. Instead, use the class, which implements the interface that contains the and methods. However, is not fully implemented by . + + is used internally by the .NET Framework. You do not need to use it directly in your code. + ]]> @@ -97,11 +97,11 @@ A string to which an error message can be written. Creates an Internet Information Services (IIS) virtual root. - method from your code. Instead, use the method. - + method from your code. Instead, use the method. + ]]> @@ -140,13 +140,13 @@ A string to which an error message can be written. Deletes an Internet Information Services (IIS) virtual root. - method is not intended to be called directly. - - Alternatively, there is the method. However, this method is not fully implemented. - + method is not intended to be called directly. + + Alternatively, there is the method. However, this method is not fully implemented. + ]]> diff --git a/xml/System.EnterpriseServices.Internal/IServerWebConfig.xml b/xml/System.EnterpriseServices.Internal/IServerWebConfig.xml index 10b18a980bb..764d0beb249 100644 --- a/xml/System.EnterpriseServices.Internal/IServerWebConfig.xml +++ b/xml/System.EnterpriseServices.Internal/IServerWebConfig.xml @@ -21,13 +21,13 @@ Creates a Web.config file for a SOAP-enabled COM+ application and adds component entries to the file for COM interfaces being published in the application. - interface is implemented only by the class and is only used within the .NET Framework infrastructure. Rather than implementing this interface or instantiating an interface object, use the class, which implements the interface. - - is used internally by the .NET Framework. You do not need to use it directly in your code. - + interface is implemented only by the class and is only used within the .NET Framework infrastructure. Rather than implementing this interface or instantiating an interface object, use the class, which implements the interface. + + is used internally by the .NET Framework. You do not need to use it directly in your code. + ]]> @@ -73,11 +73,11 @@ A string to which an error message can be written. Adds XML elements to a Web.config file for a COM interface being published in a SOAP-enabled COM+ application. - method for implementation details. However, you do not need to call `AddElement` method directly. - + method for implementation details. However, you do not need to call `AddElement` method directly. + ]]> @@ -117,11 +117,11 @@ A string to which an error message can be written. Creates a Web.config file for a SOAP-enabled COM+ application so that the file is ready to have XML elements added for COM interfaces being published. - method for implementation details. However, you do not need to call `Create` directly. - + method for implementation details. However, you do not need to call `Create` directly. + ]]> diff --git a/xml/System.EnterpriseServices.Internal/ISoapClientImport.xml b/xml/System.EnterpriseServices.Internal/ISoapClientImport.xml index 9909d59c3bc..73d8409b896 100644 --- a/xml/System.EnterpriseServices.Internal/ISoapClientImport.xml +++ b/xml/System.EnterpriseServices.Internal/ISoapClientImport.xml @@ -21,13 +21,13 @@ Imports authenticated, encrypted SOAP client proxies. - for the default implementation. - - is used internally by the .NET Framework. You do not need to use it directly in your code. - + for the default implementation. + + is used internally by the .NET Framework. You do not need to use it directly in your code. + ]]> @@ -72,11 +72,11 @@ The name of the type. Creates a .NET remoting client configuration file that includes security and authentication options. - for the full URL is HTTPS and authentication is not provided, authentication is set to `Windows`. - + for the full URL is HTTPS and authentication is not provided, authentication is set to `Windows`. + ]]> The caller does not have the required permission. diff --git a/xml/System.EnterpriseServices.Internal/Publish.xml b/xml/System.EnterpriseServices.Internal/Publish.xml index 5cf8f3fb569..15639db5732 100644 --- a/xml/System.EnterpriseServices.Internal/Publish.xml +++ b/xml/System.EnterpriseServices.Internal/Publish.xml @@ -28,11 +28,11 @@ Publishes COM interfaces for SOAP-enabled COM+ applications. - is used internally by the .NET Framework. You do not need to use it directly in your code. - + is used internally by the .NET Framework. You do not need to use it directly in your code. + ]]> @@ -93,11 +93,11 @@ When this method returns, this parameter contains an error message if a problem was encountered. Creates a SOAP-enabled COM+ application mailbox at a specified URL. Not fully implemented. - A caller in the call chain does not have permission to access unmanaged code. @@ -140,42 +140,42 @@ When this method returns, this parameter contains an error message if a problem was encountered. Creates a SOAP-enabled COM+ application virtual root. - be used instead of . - + be used instead of . + ]]> - A caller in the call chain does not have permission to access unmanaged code. - - -or- - + A caller in the call chain does not have permission to access unmanaged code. + + -or- + The caller does not have permission to access DNS information. is . An error is encountered when resolving the local host name. - is empty. - - -or- - - The scheme specified in is invalid. - - -or- - - contains more than two consecutive slashes. - - -or- - - The password specified in is invalid. - - -or- - - The host name specified in is invalid. - - -or- - + is empty. + + -or- + + The scheme specified in is invalid. + + -or- + + contains more than two consecutive slashes. + + -or- + + The password specified in is invalid. + + -or- + + The host name specified in is invalid. + + -or- + The file name specified in is invalid. @@ -210,11 +210,11 @@ When this method returns, this parameter contains an error message if a problem was encountered. Deletes a SOAP-enabled COM+ application mailbox at a specified URL. Not fully implemented. - A caller in the call chain does not have permission to access unmanaged code. @@ -251,16 +251,16 @@ When this method returns, this parameter contains an error message if a problem was encountered. Deletes a SOAP-enabled COM+ application virtual root. Not fully implemented. - is not yet available. - + is not yet available. + > [!CAUTION] -> The method currently returns without an error, but the virtual root is not deleted. - - When the functionality becomes available, the recommended method will be . - +> The method currently returns without an error, but the virtual root is not deleted. + + When the functionality becomes available, the recommended method will be . + ]]> A caller in the call chain does not have permission to access unmanaged code. @@ -323,10 +323,10 @@ The file system path for the assembly. Removes an assembly from the global assembly cache. To be added. - A caller in the call chain does not have permission to access unmanaged code. - - -or- - + A caller in the call chain does not have permission to access unmanaged code. + + -or- + The caller does not have path discovery permission. is . @@ -368,11 +368,11 @@ When this method returns, this parameter contains the name of the SoapCache directory. Returns the full path for a strong-named signed generated assembly in the SoapCache directory. - @@ -410,11 +410,11 @@ Returns the path for the directory for storing client configuration files. The path for the directory to contain the configuration files. - The caller does not have the required permission. @@ -486,26 +486,26 @@ An error is encountered when resolving the local host name. The caller does not have permission to access DNS information. - is empty. - - -or- - - The scheme specified in is invalid. - - -or- - - contains too many slashes. - - -or- - - The password specified in is invalid. - - -or- - - The host name specified in is invalid. - - -or- - + is empty. + + -or- + + The scheme specified in is invalid. + + -or- + + contains too many slashes. + + -or- + + The password specified in is invalid. + + -or- + + The host name specified in is invalid. + + -or- + The file name specified in is invalid. @@ -554,15 +554,15 @@ When this method returns, this parameter contains an error message if a problem was encountered. Processes a client type library, creating a configuration file on the client. - be used instead of . - + be used instead of . + ]]> A caller in the call chain does not have permission to access unmanaged code. @@ -607,13 +607,13 @@ When this method returns, this parameter contains an error message if a problem was encountered. Processes a server type library, either adding or deleting component entries to the Web.config and Default.disco files. Generates a proxy if necessary. - adds an entry to the discovery file and the web.config file for the components in the typelib, and either generates or copies a proxy to the bin directory for unmanaged components. If `Operation` equals "delete," then the component entries are removed from the Web.config and Default.disco files. - - It is recommended that and be used instead of . - + adds an entry to the discovery file and the web.config file for the components in the typelib, and either generates or copies a proxy to the bin directory for unmanaged components. If `Operation` equals "delete," then the component entries are removed from the Web.config and Default.disco files. + + It is recommended that and be used instead of . + ]]> A caller in the call chain does not have permission to access unmanaged code. @@ -647,18 +647,18 @@ The file system path for the assembly. Registers an assembly for COM interop. - uses the Assembly Registration tool (Regasm.exe) to register the creatable classes in the assembly. For more information, see [Regasm.exe (Assembly Registration Tool)](/dotnet/framework/tools/regasm-exe-assembly-registration-tool). - + uses the Assembly Registration tool (Regasm.exe) to register the creatable classes in the assembly. For more information, see [Regasm.exe (Assembly Registration Tool)](/dotnet/framework/tools/regasm-exe-assembly-registration-tool). + ]]> The input assembly does not have a strong name. - A caller in the call chain does not have permission to access unmanaged code. - - -or- - + A caller in the call chain does not have permission to access unmanaged code. + + -or- + A codebase that does not start with "file://" was specified without the required . is . @@ -667,14 +667,14 @@ is not a valid assembly. An assembly or module was loaded twice with two different evidences, or the assembly name exceeds the system-defined maximum length. - A method marked with is not . - - -or- - - There is more than one method marked with at a given level of the hierarchy. - - -or- - + A method marked with is not . + + -or- + + There is more than one method marked with at a given level of the hierarchy. + + -or- + The signature of the method marked with is not valid. @@ -705,17 +705,17 @@ The file system path for the assembly. Unregisters a COM interop assembly. - uses Regasm.exe to unregister the creatable classes in the assembly. For more information, see [Regasm.exe (Assembly Registration Tool)](/dotnet/framework/tools/regasm-exe-assembly-registration-tool). - + uses Regasm.exe to unregister the creatable classes in the assembly. For more information, see [Regasm.exe (Assembly Registration Tool)](/dotnet/framework/tools/regasm-exe-assembly-registration-tool). + ]]> - A caller in the call chain does not have permission to access unmanaged code. - - -or- - + A caller in the call chain does not have permission to access unmanaged code. + + -or- + A codebase that does not start with "file://" was specified without the required . is . @@ -724,14 +724,14 @@ is not a valid assembly. An assembly or module was loaded twice with two different evidences, or the assembly name exceeds the system-defined maximum length. - A method marked with is not . - - -or- - - There is more than one method marked with at a given level of the hierarchy. - - -or- - + A method marked with is not . + + -or- + + There is more than one method marked with at a given level of the hierarchy. + + -or- + The signature of the method marked with is not valid. diff --git a/xml/System.EnterpriseServices.Internal/ServerWebConfig.xml b/xml/System.EnterpriseServices.Internal/ServerWebConfig.xml index 0127ef70dc7..3a7f0d37502 100644 --- a/xml/System.EnterpriseServices.Internal/ServerWebConfig.xml +++ b/xml/System.EnterpriseServices.Internal/ServerWebConfig.xml @@ -22,13 +22,13 @@ Creates a Web.config file for a SOAP-enabled COM+ application. Can also add component entries to the file for COM interfaces being published in the application. - class is used to create a Web.config file during creation of a virtual root in Internet Information Services (IIS) 6.0 for a SOAP-enabled COM+ application. It also can add XML elements to the Web.config file for component interfaces being added to the application. - - is used internally by the .NET Framework. You do not need to use it directly in your code. - + class is used to create a Web.config file during creation of a virtual root in Internet Information Services (IIS) 6.0 for a SOAP-enabled COM+ application. It also can add XML elements to the Web.config file for component interfaces being added to the application. + + is used internally by the .NET Framework. You do not need to use it directly in your code. + ]]> @@ -91,17 +91,17 @@ A string to which an error message can be written. Adds XML elements to a Web.config file for a COM interface being published in a SOAP-enabled COM+ application. - method adds to the Web.config file the `` and `` elements as children of the `` element with the following XPath: - - `/configuration/system.runtime.remoting/application/service` - - The `AssemblyName`, `TypeName`, `ProgId`, and `WkoMode` parameters are incorporated into the attribute values of the two added elements. - - should not be called directly. Instead, call the method. - + method adds to the Web.config file the `` and `` elements as children of the `` element with the following XPath: + + `/configuration/system.runtime.remoting/application/service` + + The `AssemblyName`, `TypeName`, `ProgId`, and `WkoMode` parameters are incorporated into the attribute values of the two added elements. + + should not be called directly. Instead, call the method. + ]]> @@ -138,17 +138,17 @@ A string to which an error message can be written. Creates a Web.config file for a SOAP-enabled COM+ application so that the file is ready to have XML elements added for COM interfaces being published. - method creates a Web.config file that contains the hierarchy for an empty element with the following XPath: - -``` -/configuration/system.runtime.remoting/application/service -``` - - Instead of instantiating a class object and calling directly, call the method. - + method creates a Web.config file that contains the hierarchy for an empty element with the following XPath: + +``` +/configuration/system.runtime.remoting/application/service +``` + + Instead of instantiating a class object and calling directly, call the method. + ]]> diff --git a/xml/System.EnterpriseServices.Internal/SoapClientImport.xml b/xml/System.EnterpriseServices.Internal/SoapClientImport.xml index 5ca42a9daef..35500b23d0b 100644 --- a/xml/System.EnterpriseServices.Internal/SoapClientImport.xml +++ b/xml/System.EnterpriseServices.Internal/SoapClientImport.xml @@ -28,11 +28,11 @@ Imports authenticated, encrypted SOAP client proxies. This class cannot be inherited. - is used internally by the .NET Framework. You do not need to use it directly in your code. - + is used internally by the .NET Framework. You do not need to use it directly in your code. + ]]> @@ -93,11 +93,11 @@ The name of the type. Creates a .NET remoting client configuration file that includes security and authentication options. - for the full URL is HTTPS and authentication is not provided, authentication is set to `Windows`. - + for the full URL is HTTPS and authentication is not provided, authentication is set to `Windows`. + ]]> The caller does not have the required permission. diff --git a/xml/System.EnterpriseServices/Activity.xml b/xml/System.EnterpriseServices/Activity.xml index 58fd8925c59..603bec46f7f 100644 --- a/xml/System.EnterpriseServices/Activity.xml +++ b/xml/System.EnterpriseServices/Activity.xml @@ -138,7 +138,7 @@ binds the batch work that is submitted by the or methods to the current single-threaded apartment (STA). has no effect if the current thread is being run in the multithreaded apartment (MTA). The current thread model is determined by the configuration of the property of the object. + binds the batch work that is submitted by the or methods to the current single-threaded apartment (STA). has no effect if the current thread is being run in the multithreaded apartment (MTA). The current thread model is determined by the configuration of the property of the object. ]]> @@ -194,7 +194,7 @@ has no effect if the batch work was not previously bound to a thread. + has no effect if the batch work was not previously bound to a thread. ]]> diff --git a/xml/System.EnterpriseServices/ApplicationIDAttribute.xml b/xml/System.EnterpriseServices/ApplicationIDAttribute.xml index e89425854bf..049ebcdfdf8 100644 --- a/xml/System.EnterpriseServices/ApplicationIDAttribute.xml +++ b/xml/System.EnterpriseServices/ApplicationIDAttribute.xml @@ -102,7 +102,7 @@ is set by the constructor using the GUID passed in as a parameter. + is set by the constructor using the GUID passed in as a parameter. diff --git a/xml/System.EnterpriseServices/ApplicationQueuingAttribute.xml b/xml/System.EnterpriseServices/ApplicationQueuingAttribute.xml index c3a73644ba8..44f1738542c 100644 --- a/xml/System.EnterpriseServices/ApplicationQueuingAttribute.xml +++ b/xml/System.EnterpriseServices/ApplicationQueuingAttribute.xml @@ -31,7 +31,7 @@ , see the constructor. + For a list of initial property values for an instance of , see the constructor. For more information about using attributes, see [Attributes](/dotnet/standard/attributes/). diff --git a/xml/System.EnterpriseServices/AutoCompleteAttribute.xml b/xml/System.EnterpriseServices/AutoCompleteAttribute.xml index a8cd5618c94..c025abc2e9d 100644 --- a/xml/System.EnterpriseServices/AutoCompleteAttribute.xml +++ b/xml/System.EnterpriseServices/AutoCompleteAttribute.xml @@ -33,7 +33,7 @@ ## Remarks If `AutoComplete` is specified, it must not be disabled in the COM+ catalog; if enabled in the COM+ catalog, it must be specified on the component. - The transaction automatically calls if the method call returns normally. If the method call throws an exception, the transaction is aborted. + The transaction automatically calls if the method call returns normally. If the method call throws an exception, the transaction is aborted. diff --git a/xml/System.EnterpriseServices/BYOT.xml b/xml/System.EnterpriseServices/BYOT.xml index 6eefdc4c033..4648c17a99a 100644 --- a/xml/System.EnterpriseServices/BYOT.xml +++ b/xml/System.EnterpriseServices/BYOT.xml @@ -18,15 +18,15 @@ Wraps the COM+ class and the COM+ DTC interfaces and . This class cannot be inherited. - (Bring Your Own Transaction) allows a component to be created with or to inherit an external transaction. That is, a component that does not already have an associated transaction can acquire a transaction. COM+ allows setting an arbitrary pre-existing Distributed Transaction Coordinator (DTC) or Transaction Internet Protocol (TIP) transaction as the transaction property of a new component's context. This allows COM+ components to be associated with transactions whose lifetimes are controlled by a transaction processing (TP) monitor, Object/Task Selector (OTS), or database management system (DBMS). - - transactions must be used with caution. In certain situations, they can result in a transaction spanning multiple synchronization domains - that is, they allow parallelism with another transaction, causing a deadlock condition. - - Automatic transactions, rather than transactions, are the preferred programming model for writers of business components. - + (Bring Your Own Transaction) allows a component to be created with or to inherit an external transaction. That is, a component that does not already have an associated transaction can acquire a transaction. COM+ allows setting an arbitrary pre-existing Distributed Transaction Coordinator (DTC) or Transaction Internet Protocol (TIP) transaction as the transaction property of a new component's context. This allows COM+ components to be associated with transactions whose lifetimes are controlled by a transaction processing (TP) monitor, Object/Task Selector (OTS), or database management system (DBMS). + + transactions must be used with caution. In certain situations, they can result in a transaction spanning multiple synchronization domains - that is, they allow parallelism with another transaction, causing a deadlock condition. + + Automatic transactions, rather than transactions, are the preferred programming model for writers of business components. + ]]> @@ -58,11 +58,11 @@ Creates an object that is enlisted within a manual transaction using the Transaction Internet Protocol (TIP). The requested transaction. - performs the managed equivalent of the COM+ DTC method `ICreateWithTIPTransaction::CreateInstance`. - + performs the managed equivalent of the COM+ DTC method `ICreateWithTIPTransaction::CreateInstance`. + ]]> @@ -94,11 +94,11 @@ Creates an object that is enlisted within a manual transaction. The requested transaction. - performs the managed equivalent of the COM+ Distributed Transaction Coordinator (DTC) method `ICreateWithTransaction::CreateInstance`. - + performs the managed equivalent of the COM+ Distributed Transaction Coordinator (DTC) method `ICreateWithTransaction::CreateInstance`. + ]]> diff --git a/xml/System.EnterpriseServices/ConstructionEnabledAttribute.xml b/xml/System.EnterpriseServices/ConstructionEnabledAttribute.xml index 1e9fca7d91d..0a7b8748370 100644 --- a/xml/System.EnterpriseServices/ConstructionEnabledAttribute.xml +++ b/xml/System.EnterpriseServices/ConstructionEnabledAttribute.xml @@ -28,22 +28,22 @@ Enables COM+ object construction support. This class cannot be inherited. - , see the constructor. - - For more information about using attributes, see [Attributes](/dotnet/standard/attributes/). - - - -## Examples - The following code example demonstrates the use of this attribute to associate an object constructor string with a class. - + , see the constructor. + + For more information about using attributes, see [Attributes](/dotnet/standard/attributes/). + + + +## Examples + The following code example demonstrates the use of this attribute to associate an object constructor string with a class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/EnterpriseServices_Security/CPP/employeeinformation.cpp" id="Snippet4"::: :::code language="csharp" source="~/snippets/csharp/System.EnterpriseServices/AccessChecksLevelOption/Overview/employeeinformation.cs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/System.EnterpriseServices/AccessChecksLevelOption/Overview/employeeinformation.vb" id="Snippet4"::: - + :::code language="vb" source="~/snippets/visualbasic/System.EnterpriseServices/AccessChecksLevelOption/Overview/employeeinformation.vb" id="Snippet4"::: + ]]> @@ -74,16 +74,16 @@ Initializes a new instance of the class and initializes the default settings for and . - . - -|Property|Value| -|--------------|-----------| -|`Default`|An empty string ("")| -|`Enabled`|`true`| - + . + +|Property|Value| +|--------------|-----------| +|`Default`|An empty string ("")| +|`Enabled`|`true`| + ]]> diff --git a/xml/System.EnterpriseServices/ContextUtil.xml b/xml/System.EnterpriseServices/ContextUtil.xml index 91ac726b67d..8f921f180e3 100644 --- a/xml/System.EnterpriseServices/ContextUtil.xml +++ b/xml/System.EnterpriseServices/ContextUtil.xml @@ -248,7 +248,7 @@ ## Examples - The following code example calls the method. + The following code example calls the method. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/EnterpriseServicesContextUtil/CPP/class1.cpp" id="Snippet3"::: :::code language="csharp" source="~/snippets/csharp/System.EnterpriseServices/ContextUtil/ActivityId/class1.cs" id="Snippet3"::: @@ -288,7 +288,7 @@ ## Examples - The following code example calls the method. + The following code example calls the method. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/EnterpriseServicesContextUtil/CPP/class1.cpp" id="Snippet4"::: :::code language="csharp" source="~/snippets/csharp/System.EnterpriseServices/ContextUtil/ActivityId/class1.cs" id="Snippet4"::: @@ -484,7 +484,7 @@ is set to `Commit`, the COM+ `consistent` bit is set to `true` and the COM+ context votes to commit the transaction. If is set to `Abort`, the `consistent` bit is set to `false` and the COM+ context votes to abort the transaction. The default value of the `consistent` bit is `true`. + When is set to `Commit`, the COM+ `consistent` bit is set to `true` and the COM+ context votes to commit the transaction. If is set to `Abort`, the `consistent` bit is set to `false` and the COM+ context votes to abort the transaction. The default value of the `consistent` bit is `true`. The `consistent` bit casts a vote to commit or abort the transaction in which it executes, and the `done` bit finalizes the vote. COM+ inspects the `consistent` bit when the `done` bit is set to `true` on a method call return or when the object deactivates. Although an object's `consistent` bit can change repeatedly within each method call, only the last change counts. diff --git a/xml/System.EnterpriseServices/EventClassAttribute.xml b/xml/System.EnterpriseServices/EventClassAttribute.xml index de2de79a000..74a04c1c139 100644 --- a/xml/System.EnterpriseServices/EventClassAttribute.xml +++ b/xml/System.EnterpriseServices/EventClassAttribute.xml @@ -28,17 +28,17 @@ Marks the attributed class as an event class. This class cannot be inherited. - , see the constructor. - - For more information about using attributes, see [Attributes](/dotnet/standard/attributes/). - + , see the constructor. + + For more information about using attributes, see [Attributes](/dotnet/standard/attributes/). + ]]> @@ -60,17 +60,17 @@ Initializes a new instance of the class. - . - -|Property|Value| -|--------------|-----------| -|`FireInParallel`|`false`| -|`AllowInProcSubscribers`|`true`| -|`PublisherFilter`|`null`| - + . + +|Property|Value| +|--------------|-----------| +|`FireInParallel`|`false`| +|`AllowInProcSubscribers`|`true`| +|`PublisherFilter`|`null`| + ]]> diff --git a/xml/System.EnterpriseServices/IAsyncErrorNotify.xml b/xml/System.EnterpriseServices/IAsyncErrorNotify.xml index d40e1c87ee8..c47252ef86f 100644 --- a/xml/System.EnterpriseServices/IAsyncErrorNotify.xml +++ b/xml/System.EnterpriseServices/IAsyncErrorNotify.xml @@ -25,13 +25,13 @@ Implements error trapping on the asynchronous batch work that is submitted by the object. - is used to implement error trapping on the asynchronous batch work that is submitted by the object. Implement this interface on the object that is passed in the call to on the object. determines if an error occurred in batch work that is running asynchronously. This interface enables you to be informed of errors that occur in asynchronous batch work, and the process will terminate (failfast) on any unrecoverable error. - - For information about failfast, see the "Fault Isolation and Failfast Policy" topic in the Platform SDK in MSDN. - + is used to implement error trapping on the asynchronous batch work that is submitted by the object. Implement this interface on the object that is passed in the call to on the object. determines if an error occurred in batch work that is running asynchronously. This interface enables you to be informed of errors that occur in asynchronous batch work, and the process will terminate (failfast) on any unrecoverable error. + + For information about failfast, see the "Fault Isolation and Failfast Policy" topic in the Platform SDK in MSDN. + ]]> @@ -60,13 +60,13 @@ The HRESULT of the error that occurred while the batch work was running asynchronously. Handles errors for asynchronous batch work. - , and it is run asynchronously by calling . - - This method supports the standard return values `E_FAIL`, `E_INVALIDARG`, and `E_OUTOFMEMORY`, as well as `S_OK`, which indicates the method call returned successfully. - + , and it is run asynchronously by calling . + + This method supports the standard return values `E_FAIL`, `E_INVALIDARG`, and `E_OUTOFMEMORY`, as well as `S_OK`, which indicates the method call returned successfully. + ]]> diff --git a/xml/System.EnterpriseServices/IPlaybackControl.xml b/xml/System.EnterpriseServices/IPlaybackControl.xml index 9e29549a1d0..bbd1b471157 100644 --- a/xml/System.EnterpriseServices/IPlaybackControl.xml +++ b/xml/System.EnterpriseServices/IPlaybackControl.xml @@ -25,19 +25,19 @@ Functions in Queued Components in the abnormal handling of server-side playback errors and client-side failures of the Message Queuing delivery mechanism. - and the interface for the original class. The method implementations of the original class interface are used to perform the exception handling for the failed methods in the class itself. They will be called after or to process exceptions for the method originally called. - - The Queued Components Player calls the methods of to inform the exception-handler object that a message is about to be placed on the final resting or dead letter queue. The Queued Components Player then calls the same method in the exception-handler object that had failed in the original method call. The exception-handler object can implement an alternative, for example, by gathering problem diagnosis information or generating an object or message that informs the client of the problem. If the application does not implement , the poison message is placed on the final resting or dead letter queue when the Queued Components Player exhausts all retries. - - A poison message is a message that cannot be processed for some reason, perhaps because of a problem with the server or queuing system. The transaction is rolled back, and the poison message goes to the top of the queue. When the message is dequeued again, the same condition occurs. This message can continue looping indefinitely until something is done to correct the problem. The Queued Components service handles the poison message by using a series of retries. After several unsuccessful retries, the message is moved to a final resting queue. Poison messages remain in the resting queue until manually moved by using the Queued Components Message Mover tool. - - The poison message situation can also be resolved programmatically, using the method, which informs the server-side component author that all attempts to play back the deferred activation have failed. - - If you discover a poison message, you might be able to solve the underlying cause of the problem quickly. For example, if the server was offline for some reason, you can bring the server back online. If you cannot solve the problem quickly, you can automatically generate another transaction that notifies the requestor that the transaction did not occur. The requestor can then make a compensating transaction that reverses the effect of a transaction that has already committed. - + and the interface for the original class. The method implementations of the original class interface are used to perform the exception handling for the failed methods in the class itself. They will be called after or to process exceptions for the method originally called. + + The Queued Components Player calls the methods of to inform the exception-handler object that a message is about to be placed on the final resting or dead letter queue. The Queued Components Player then calls the same method in the exception-handler object that had failed in the original method call. The exception-handler object can implement an alternative, for example, by gathering problem diagnosis information or generating an object or message that informs the client of the problem. If the application does not implement , the poison message is placed on the final resting or dead letter queue when the Queued Components Player exhausts all retries. + + A poison message is a message that cannot be processed for some reason, perhaps because of a problem with the server or queuing system. The transaction is rolled back, and the poison message goes to the top of the queue. When the message is dequeued again, the same condition occurs. This message can continue looping indefinitely until something is done to correct the problem. The Queued Components service handles the poison message by using a series of retries. After several unsuccessful retries, the message is moved to a final resting queue. Poison messages remain in the resting queue until manually moved by using the Queued Components Message Mover tool. + + The poison message situation can also be resolved programmatically, using the method, which informs the server-side component author that all attempts to play back the deferred activation have failed. + + If you discover a poison message, you might be able to solve the underlying cause of the problem quickly. For example, if the server was offline for some reason, you can bring the server back online. If you cannot solve the problem quickly, you can automatically generate another transaction that notifies the requestor that the transaction did not occur. The requestor can then make a compensating transaction that reverses the effect of a transaction that has already committed. + ]]> @@ -63,13 +63,13 @@ Informs the client-side exception-handling component that all Message Queuing attempts to deliver the message to the server were rejected, and the message ended up on the client-side Xact Dead Letter queue. - , then calling the exception-handling version of the failed method in the exception-handler object. This exception method can then take an exception action, such as recording the failure, sending a mail message to the administrator, or taking client-side compensating action (reversing the effect of an earlier transaction). If the exception method is not successful, the message is left on the Xact Dead Letter queue. - - The Xact Dead Letter queue can be viewed in the Microsoft Message Queue (MSMQ) Explorer. - + , then calling the exception-handling version of the failed method in the exception-handler object. This exception method can then take an exception action, such as recording the failure, sending a mail message to the administrator, or taking client-side compensating action (reversing the effect of an earlier transaction). If the exception method is not successful, the message is left on the Xact Dead Letter queue. + + The Xact Dead Letter queue can be viewed in the Microsoft Message Queue (MSMQ) Explorer. + ]]> @@ -95,11 +95,11 @@ Informs the server-side exception class implementation that all attempts to play back the deferred activation to the server have failed, and the message is about to be moved to its final resting queue. - , then calling the exception handling version of the failed method in the exception handler object. This exception method can then take an exception action, such as recording the failure, sending a mail message to the administrator, or taking client-side compensating action (reversing the effect of an earlier transaction). The server object should make every effort to complete this transaction successfully. Otherwise, manual intervention is required to reprocess the message. If the exception method is not successful, the message is moved to the final resting queue. - + , then calling the exception handling version of the failed method in the exception handler object. This exception method can then take an exception action, such as recording the failure, sending a mail message to the administrator, or taking client-side compensating action (reversing the effect of an earlier transaction). The server object should make every effort to complete this transaction successfully. Otherwise, manual intervention is required to reprocess the message. If the exception method is not successful, the message is moved to the final resting queue. + ]]> diff --git a/xml/System.EnterpriseServices/IProcessInitControl.xml b/xml/System.EnterpriseServices/IProcessInitControl.xml index 4e4b8d7eca6..02da4c8bde0 100644 --- a/xml/System.EnterpriseServices/IProcessInitControl.xml +++ b/xml/System.EnterpriseServices/IProcessInitControl.xml @@ -51,11 +51,11 @@ The number of seconds that remain before the time taken to execute the start up method times out. Sets the number of seconds remaining before the method times out. - is initially given a default 30 seconds to execute unless the time-out value is reset using this method. - + is initially given a default 30 seconds to execute unless the time-out value is reset using this method. + ]]> diff --git a/xml/System.EnterpriseServices/IProcessInitializer.xml b/xml/System.EnterpriseServices/IProcessInitializer.xml index 85f2a251e40..926c1aebdbd 100644 --- a/xml/System.EnterpriseServices/IProcessInitializer.xml +++ b/xml/System.EnterpriseServices/IProcessInitializer.xml @@ -25,15 +25,15 @@ Supports methods that can be called when a COM component starts up or shuts down. - interface methods on serviced components if you want to run initialization or shutdown code when a server process (Dllhost.exe) starts up or shuts down, respectively. - + interface methods on serviced components if you want to run initialization or shutdown code when a server process (Dllhost.exe) starts up or shuts down, respectively. + COM+ provides `Startup` and `Shutdown` events when Dllhost.exe starts and ends. This feature enables any COM+ components that are installed in a COM+ server application (referred to as server components hereafter) to run custom initialization and clean up code. An instance of each component that implements the interface will be created and stored for the duration of the process. When implemented on a , the `InitializesServerApplication` parameter in the `COMAdminCatalogObject` within the Components collection needs to be set to `true` during registration of the component, in order for the interface methods to be called during startup and shutdown. - - Using the `Startup` and `Shutdown` events, you can initialize resources, create connections, initialize shared data, and run cleanup code. However, you must not access states that are specific to COM+ because instances of server components have not yet been created. In addition, the code in the `Startup` and `Shutdown` events should return as quickly as possible, because the system waits only 90 seconds for Dllhost.exe to prepare to accept activations after the system starts the process. If Dllhost.exe does not signal that it is ready within 90 seconds, the system ends the process; thus, all initialization processing needs to be completed within this time frame. Each server component that participates in initialization must support the interface. On DllHost.exe startup, COM+ creates all server components that requested this service, calls `QueryInterface` for the interface, and calls the function. Similarly, when the DllHost.exe process is shut down, it calls the function on those previously stored interface pointers. - + + Using the `Startup` and `Shutdown` events, you can initialize resources, create connections, initialize shared data, and run cleanup code. However, you must not access states that are specific to COM+ because instances of server components have not yet been created. In addition, the code in the `Startup` and `Shutdown` events should return as quickly as possible, because the system waits only 90 seconds for Dllhost.exe to prepare to accept activations after the system starts the process. If Dllhost.exe does not signal that it is ready within 90 seconds, the system ends the process; thus, all initialization processing needs to be completed within this time frame. Each server component that participates in initialization must support the interface. On DllHost.exe startup, COM+ creates all server components that requested this service, calls `QueryInterface` for the interface, and calls the function. Similarly, when the DllHost.exe process is shut down, it calls the function on those previously stored interface pointers. + ]]> @@ -59,11 +59,11 @@ Performs shutdown actions. Called when Dllhost.exe is shut down. - is not called during a failfast or other catastrophic shutdown events. - + is not called during a failfast or other catastrophic shutdown events. + ]]> @@ -92,13 +92,13 @@ In Microsoft Windows XP, a pointer to the interface of the COM component starting up. In Microsoft Windows 2000, this argument is always . Performs initialization at startup. Called when Dllhost.exe is started. - interface. supports the single method . - - The initialization code in can call the , with the time-out set equal to the number of seconds remaining before the startup of the component times out. - + interface. supports the single method . + + The initialization code in can call the , with the time-out set equal to the number of seconds remaining before the startup of the component times out. + ]]> diff --git a/xml/System.EnterpriseServices/IRemoteDispatch.xml b/xml/System.EnterpriseServices/IRemoteDispatch.xml index 888eee1dd45..7b655f45889 100644 --- a/xml/System.EnterpriseServices/IRemoteDispatch.xml +++ b/xml/System.EnterpriseServices/IRemoteDispatch.xml @@ -21,15 +21,15 @@ Implemented by the class to determine if the class attribute is set to or for a remote method invocation. - interface does not need to be implemented directly in your code. It is used internally by the .NET Framework infrastructure. - - The class attribute ensures that, in the COM+ context, the object's done bit is automatically set to `true` once the method returns. The object can then be deactivated. - - The interface methods do not appear in the class interface. Instead, explicitly implements . - + interface does not need to be implemented directly in your code. It is used internally by the .NET Framework infrastructure. + + The class attribute ensures that, in the COM+ context, the object's done bit is automatically set to `true` once the method returns. The object can then be deactivated. + + The interface methods do not appear in the class interface. Instead, explicitly implements . + ]]> @@ -68,11 +68,11 @@ Ensures that, in the COM+ context, the class object's done bit is set to after a remote method invocation. A string converted from a response object that implements the interface. - method does not belong to the published interface of the class and does not need to be implemented elsewhere. - + method does not belong to the published interface of the class and does not need to be implemented elsewhere. + ]]> @@ -109,11 +109,11 @@ Does not ensure that, in the COM+ context, the class object's done bit is set to after a remote method invocation. A string converted from a response object implementing the interface. - method does not belong to the published interface of the class and does not need to be implemented elsewhere. - + method does not belong to the published interface of the class and does not need to be implemented elsewhere. + ]]> diff --git a/xml/System.EnterpriseServices/IServiceCall.xml b/xml/System.EnterpriseServices/IServiceCall.xml index af5cc8e964d..30afe181000 100644 --- a/xml/System.EnterpriseServices/IServiceCall.xml +++ b/xml/System.EnterpriseServices/IServiceCall.xml @@ -25,11 +25,11 @@ Implements the batch work that is submitted through the activity created by . - to perform batch work that uses COM+ services without creating a component specifically for using those services. Script environments such as Internet Information Services (IIS) and ASP.NET can use this interface to utilize COM+ services without the need to create a COM+ component. - + to perform batch work that uses COM+ services without creating a component specifically for using those services. Script environments such as Internet Information Services (IIS) and ASP.NET can use this interface to utilize COM+ services without the need to create a COM+ component. + ]]> @@ -55,18 +55,18 @@ Starts the execution of the batch work implemented in this method. - . The batch work in this method is run by a call to either or . - + . The batch work in this method is run by a call to either or . + > [!CAUTION] -> You must ensure that this method is thread safe in situations where the activity object created by is not created with a synchronized context, because in such situations many calls to can run at the same time. - - To achieve the best performance from the system, the context configuration of the activity created by should be matched to the batch work performed by the method. For example, if the batch work in the method uses poolable objects, the activity created by should be configured to use the multithreaded apartment (MTA). - - For information about poolable objects, see the topic "Requirements for Poolable Objects" in the Platform SDK in MSDN. - +> You must ensure that this method is thread safe in situations where the activity object created by is not created with a synchronized context, because in such situations many calls to can run at the same time. + + To achieve the best performance from the system, the context configuration of the activity created by should be matched to the batch work performed by the method. For example, if the batch work in the method uses poolable objects, the activity created by should be configured to use the multithreaded apartment (MTA). + + For information about poolable objects, see the topic "Requirements for Poolable Objects" in the Platform SDK in MSDN. + ]]> diff --git a/xml/System.EnterpriseServices/IServicedComponentInfo.xml b/xml/System.EnterpriseServices/IServicedComponentInfo.xml index 6ebc53e82a4..45d0843a7eb 100644 --- a/xml/System.EnterpriseServices/IServicedComponentInfo.xml +++ b/xml/System.EnterpriseServices/IServicedComponentInfo.xml @@ -25,13 +25,13 @@ Implemented by the class to obtain information about the component via the method. - interface does not need to be implemented directly in your code. It is used internally by the .NET Framework infrastructure. - - The method does not appear in the class interface. Instead, explicitly implements . - + interface does not need to be implemented directly in your code. It is used internally by the .NET Framework infrastructure. + + The method does not appear in the class interface. Instead, explicitly implements . + ]]> @@ -64,11 +64,11 @@ A string array that may contain any or all of the following, in order: the serviced component's process ID, the application domain ID, and the serviced component's remote URI. Obtains certain information about the class instance. - method does not belong to the published interface of the class and does not need to be implemented elsewhere. - + method does not belong to the published interface of the class and does not need to be implemented elsewhere. + ]]> diff --git a/xml/System.EnterpriseServices/InheritanceOption.xml b/xml/System.EnterpriseServices/InheritanceOption.xml index ffca80c8abf..85c991e73a1 100644 --- a/xml/System.EnterpriseServices/InheritanceOption.xml +++ b/xml/System.EnterpriseServices/InheritanceOption.xml @@ -27,11 +27,11 @@ Indicates whether to create a new context based on the current context or on the information in . - is used for the value of . - + is used for the value of . + ]]> diff --git a/xml/System.EnterpriseServices/ObjectPoolingAttribute.xml b/xml/System.EnterpriseServices/ObjectPoolingAttribute.xml index 95a2763377f..54ea08fa3d7 100644 --- a/xml/System.EnterpriseServices/ObjectPoolingAttribute.xml +++ b/xml/System.EnterpriseServices/ObjectPoolingAttribute.xml @@ -33,7 +33,7 @@ ## Remarks If object pooling is specified, it must not be disabled in the COM+ catalog; if enabled in the COM+ catalog, it must be specified on the component. - For a list of initial property values for an instance of , see the constructor. + For a list of initial property values for an instance of , see the constructor. For more information about using attributes, see [Attributes](/dotnet/standard/attributes/). @@ -240,7 +240,7 @@ method is intended only to be used from within the .NET Framework infrastructure. It is sufficient for a developer to apply the class attribute and set other members in its interface. + Even though it is a public method, the method is intended only to be used from within the .NET Framework infrastructure. It is sufficient for a developer to apply the class attribute and set other members in its interface. ]]> @@ -275,7 +275,7 @@ method is intended only to be used from within the .NET Framework infrastructure. It is sufficient for a developer to apply the class attribute and set other members in its interface. + Even though it is a public method, the method is intended only to be used from within the .NET Framework infrastructure. It is sufficient for a developer to apply the class attribute and set other members in its interface. ]]> @@ -384,7 +384,7 @@ method is intended only to be used from within the .NET Framework infrastructure. It is sufficient for a developer to apply the class attribute and set other members in its interface. + Even though it is a public method, the method is intended only to be used from within the .NET Framework infrastructure. It is sufficient for a developer to apply the class attribute and set other members in its interface. ]]> @@ -414,7 +414,7 @@ represents the maximum number of pooled objects that the pooling manager will create, both actively used by clients and inactive in the pool. When creating objects, the pooling manager checks to verify that the maximum pool size has not been reached and, if it has not, the pooling manager creates a new object to dispense to the client. If the maximum pool size has been reached, client requests are queued and receive the first available object from the pool in the order in which they arrived. Object creation requests time-out after a specified period. + represents the maximum number of pooled objects that the pooling manager will create, both actively used by clients and inactive in the pool. When creating objects, the pooling manager checks to verify that the maximum pool size has not been reached and, if it has not, the pooling manager creates a new object to dispense to the client. If the maximum pool size has been reached, client requests are queued and receive the first available object from the pool in the order in which they arrived. Object creation requests time-out after a specified period. @@ -453,7 +453,7 @@ represents the number of objects that are created when the application starts and the minimum number of objects that are maintained in the pool while the application is running. If the number of available objects in the pool drops below the specified minimum, new objects are created to meet any outstanding object requests and refill the pool. If the number of available objects in the pool is greater than the minimum number, those surplus objects are destroyed during a clean-up cycle. + represents the number of objects that are created when the application starts and the minimum number of objects that are maintained in the pool while the application is running. If the number of available objects in the pool drops below the specified minimum, new objects are created to meet any outstanding object requests and refill the pool. If the number of available objects in the pool is greater than the minimum number, those surplus objects are destroyed during a clean-up cycle. diff --git a/xml/System.EnterpriseServices/RegistrationErrorInfo.xml b/xml/System.EnterpriseServices/RegistrationErrorInfo.xml index 52326dee5b0..36ec1e12533 100644 --- a/xml/System.EnterpriseServices/RegistrationErrorInfo.xml +++ b/xml/System.EnterpriseServices/RegistrationErrorInfo.xml @@ -24,15 +24,15 @@ Retrieves extended error information about methods related to multiple COM+ objects. This also includes methods that install, import, and export COM+ applications and components. This class cannot be inherited. - @@ -81,15 +81,15 @@ Gets the description of the . The description of the . - @@ -115,11 +115,11 @@ Gets the key value for the object that caused the error, if applicable. The key value for the object that caused the error, if applicable. - is the same as . Use this to look at the item that failed to update, or to find the component or DLL that failed to install. - + is the same as . Use this to look at the item that failed to update, or to find the component or DLL that failed to install. + ]]> diff --git a/xml/System.EnterpriseServices/RegistrationHelper.xml b/xml/System.EnterpriseServices/RegistrationHelper.xml index 71ffb633124..b242b8b3264 100644 --- a/xml/System.EnterpriseServices/RegistrationHelper.xml +++ b/xml/System.EnterpriseServices/RegistrationHelper.xml @@ -28,11 +28,11 @@ Installs and configures assemblies in the COM+ catalog. This class cannot be inherited. - is used by both the .NET Services Installation Tool (Regsvcs.exe) and the automatic registration steps that are performed on first activation of a . - + is used by both the .NET Services Installation Tool (Regsvcs.exe) and the automatic registration steps that are performed on first activation of a . + ]]> @@ -98,22 +98,22 @@ A bitwise combination of the values. Installs the named assembly in a COM+ application. - performs the following steps: registration, generation of a type library, registration of the type library, installation of the type library under the specified application, and configuration of the components contained in the type library. - - This method requires the caller to have administrative privileges on the local computer. - - - -## Examples - The following code example shows how to use the `InstalAssembly` method to install a named assembly in a COM+ application. - + performs the following steps: registration, generation of a type library, registration of the type library, installation of the type library under the specified application, and configuration of the components contained in the type library. + + This method requires the caller to have administrative privileges on the local computer. + + + +## Examples + The following code example shows how to use the `InstalAssembly` method to install a named assembly in a COM+ application. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/EnterpriseServices Registration/CPP/deployservicedcomponent.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.EnterpriseServices/RegistrationErrorInfo/Overview/deployservicedcomponent.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.EnterpriseServices/RegistrationErrorInfo/Overview/deployservicedcomponent.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.EnterpriseServices/RegistrationErrorInfo/Overview/deployservicedcomponent.vb" id="Snippet1"::: + ]]> The input assembly does not have a strong name. @@ -151,13 +151,13 @@ A bitwise combination of the values. Installs the named assembly in a COM+ application. - performs the following steps: registration, generation of a type library, registration of the type library, installation of the type library under the specified application, and configuration of the components contained in the type library. - - This method requires the caller to have administrative privileges on the local computer. - + performs the following steps: registration, generation of a type library, registration of the type library, installation of the type library under the specified application, and configuration of the components contained in the type library. + + This method requires the caller to have administrative privileges on the local computer. + ]]> The input assembly does not have a strong name. @@ -187,20 +187,20 @@ A identifying the assembly to install. Installs the named assembly in a COM+ application. - diff --git a/xml/System.EnterpriseServices/RegistrationHelperTx.xml b/xml/System.EnterpriseServices/RegistrationHelperTx.xml index bba5fb04377..e69785eb371 100644 --- a/xml/System.EnterpriseServices/RegistrationHelperTx.xml +++ b/xml/System.EnterpriseServices/RegistrationHelperTx.xml @@ -162,7 +162,7 @@ method does not need to be called directly from your code. Instead, call the method with the same parameters except object sync. + The method does not need to be called directly from your code. Instead, call the method with the same parameters except object sync. This method requires the caller to have administrative privileges on the local computer. @@ -208,7 +208,7 @@ method does not need to be called directly from your code. Instead, call the method with the same parameters except object sync. + The method does not need to be called directly from your code. Instead, call the method with the same parameters except object sync. This method requires the caller to have administrative privileges on the local computer. @@ -246,7 +246,7 @@ method is called from within the .NET Framework infrastructure. It does not need to be called directly from your code. Instead, call the method. + Under certain circumstances, the method is called from within the .NET Framework infrastructure. It does not need to be called directly from your code. Instead, call the method. This method requires the caller to have administrative privileges on the local computer. @@ -281,7 +281,7 @@ method is called from within the .NET Framework infrastructure. It does not need to be called directly from your code. + Under certain circumstances, the method is called from within the .NET Framework infrastructure. It does not need to be called directly from your code. ]]> @@ -329,7 +329,7 @@ method does not need to be called directly from your code. Instead, call the method with the same parameters except object sync. + The method does not need to be called directly from your code. Instead, call the method with the same parameters except object sync. ]]> @@ -369,7 +369,7 @@ method does not need to be called directly from your code. Instead, call the method with the same parameters except object sync. + The method does not need to be called directly from your code. Instead, call the method with the same parameters except object sync. ]]> @@ -405,7 +405,7 @@ method is called from within the .NET Framework infrastructure. It does not need to be called directly from your code. Instead, call the method. + Under certain circumstances, the method is called from within the .NET Framework infrastructure. It does not need to be called directly from your code. Instead, call the method. ]]> diff --git a/xml/System.EnterpriseServices/SecurityCallContext.xml b/xml/System.EnterpriseServices/SecurityCallContext.xml index 9f84d4a5e8d..909ad809b6a 100644 --- a/xml/System.EnterpriseServices/SecurityCallContext.xml +++ b/xml/System.EnterpriseServices/SecurityCallContext.xml @@ -55,7 +55,7 @@ accesses the `Callers` item in the `ISecurityCallContext` collection in COM+. + accesses the `Callers` item in the `ISecurityCallContext` collection in COM+. ]]> @@ -252,7 +252,7 @@ is the least secure authentication level of all callers in the chain. + is the least secure authentication level of all callers in the chain. ]]> @@ -282,7 +282,7 @@ is the number of callers in the chain of calls. + is the number of callers in the chain of calls. ]]> diff --git a/xml/System.EnterpriseServices/ServiceConfig.xml b/xml/System.EnterpriseServices/ServiceConfig.xml index 0dcc3093d07..eb6320f1512 100644 --- a/xml/System.EnterpriseServices/ServiceConfig.xml +++ b/xml/System.EnterpriseServices/ServiceConfig.xml @@ -27,7 +27,7 @@ and allow you to use the services configured by with no need to tie those services to a component. + and allow you to use the services configured by with no need to tie those services to a component. ]]> @@ -108,7 +108,7 @@ has no impact on the multithreaded apartment (MTA). This property is used to set the thread pool binding only when creating a . An error is returned if an attempt is made to set the thread pool binding when calling . + has no impact on the multithreaded apartment (MTA). This property is used to set the thread pool binding only when creating a . An error is returned if an attempt is made to set the thread pool binding when calling . ]]> @@ -137,7 +137,7 @@ (BYOT) identifies a transaction that supplies the context for the transaction. When you bring your own transaction, that transaction's settings override the other transaction settings in the object. The default value for is `null`. + (BYOT) identifies a transaction that supplies the context for the transaction. When you bring your own transaction, that transaction's settings override the other transaction settings in the object. The default value for is `null`. For more information on BYOT, see . @@ -170,7 +170,7 @@ (BYOT) identifies a transaction that supplies the context for the transaction. When you bring your own transaction, that transaction's settings override the other transaction settings in the object. The default value for is `null`. + (BYOT) identifies a transaction that supplies the context for the transaction. When you bring your own transaction, that transaction's settings override the other transaction settings in the object. The default value for is `null`. For more information on BYOT, see . @@ -290,7 +290,7 @@ is ignored if the enclosed code would not otherwise run in a transaction. + A new transaction is created if the enclosing transaction is not running at the specified isolation level. is ignored if the enclosed code would not otherwise run in a transaction. ]]> @@ -490,7 +490,7 @@ is similar to the property but allows the enclosed code to run as an existing transaction that is specified by a TIP URL. + is similar to the property but allows the enclosed code to run as an existing transaction that is specified by a TIP URL. ]]> @@ -520,9 +520,9 @@ . + Because no component is associated with this tracker property, tracker activity is reported as arising from a component with the name specified by . - For more information, see . + For more information, see . ]]> @@ -631,7 +631,7 @@ is used to describe the transaction. + If a description if not provided, the value of is used to describe the transaction. ]]> diff --git a/xml/System.EnterpriseServices/ServiceDomain.xml b/xml/System.EnterpriseServices/ServiceDomain.xml index 21bea96bb03..dd7f6a3e6df 100644 --- a/xml/System.EnterpriseServices/ServiceDomain.xml +++ b/xml/System.EnterpriseServices/ServiceDomain.xml @@ -24,11 +24,11 @@ Allows a code segment identified by and to run in its own context and behave as if it were a method that is called on an object created within the context. This class cannot be inherited. - and methods are used in pairs to surround code that can then use COM+ services. Code that is enclosed between calls to and runs in its own context and behaves as if it were a method that is called on an object created within the context. The and pairs can be nested. It is up to the user to make sure that pairs of calls are balanced so that every call to matches a previous call to . - + and methods are used in pairs to surround code that can then use COM+ services. Code that is enclosed between calls to and runs in its own context and behaves as if it were a method that is called on an object created within the context. The and pairs can be nested. It is up to the user to make sure that pairs of calls are balanced so that every call to matches a previous call to . + ]]> @@ -57,11 +57,11 @@ A that contains the configuration information for the services to be used within the enclosed code. Creates the context specified by the object and pushes it onto the context stack to become the current context. - first creates a context configured as specified by the object that is passed as the `cfg` parameter. Policies on both the client and server sides are then triggered as if a method call had occurred. The new context is then pushed onto a context stack and becomes the current context. Because of their efficient design and because no thread marshaling is involved, using and involves significantly reduced overhead compared to an equivalent method call. - + first creates a context configured as specified by the object that is passed as the `cfg` parameter. Policies on both the client and server sides are then triggered as if a method call had occurred. The new context is then pushed onto a context stack and becomes the current context. Because of their efficient design and because no thread marshaling is involved, using and involves significantly reduced overhead compared to an equivalent method call. + ]]> diff --git a/xml/System.EnterpriseServices/ServicedComponent.xml b/xml/System.EnterpriseServices/ServicedComponent.xml index 72dea59b19e..5965711aa99 100644 --- a/xml/System.EnterpriseServices/ServicedComponent.xml +++ b/xml/System.EnterpriseServices/ServicedComponent.xml @@ -37,7 +37,7 @@ that runs in a COM+ application may stop responding. This problem is caused by an Activity deadlock. Activities can deadlock on multithreaded applications because of an asynchronous cleanup of component references. To work around this problem, call the method when you complete work with objects derived from . + Under certain conditions, a class that is derived from that runs in a COM+ application may stop responding. This problem is caused by an Activity deadlock. Activities can deadlock on multithreaded applications because of an asynchronous cleanup of component references. To work around this problem, call the method when you complete work with objects derived from . > [!NOTE] > Client code must call `Dispose` on serviced components to ensure proper operation. @@ -256,9 +256,9 @@ regsvcs Calculator.dll ## Remarks Finalizes the object and removes the associated COM+ context. - It is recommended to explicitly release COM+ objects and external resources before the garbage collector frees the object. If the external resource is scarce or expensive, better performance can be achieved by explicitly releasing COM+ resources when they are no longer needed. Explicit control is provided by the method. + It is recommended to explicitly release COM+ objects and external resources before the garbage collector frees the object. If the external resource is scarce or expensive, better performance can be achieved by explicitly releasing COM+ resources when they are no longer needed. Explicit control is provided by the method. - Calling allows the resources used by the to be reallocated for other purposes. For more information about , see [Cleaning Up Unmanaged Resources](/dotnet/standard/garbage-collection/unmanaged). + Calling allows the resources used by the to be reallocated for other purposes. For more information about , see [Cleaning Up Unmanaged Resources](/dotnet/standard/garbage-collection/unmanaged). ]]> @@ -336,7 +336,7 @@ regsvcs Calculator.dll . + It is preferable to use the `Dispose` design pattern rather than . ]]> @@ -379,7 +379,7 @@ regsvcs Calculator.dll method does not belong to the published interface of the class and does not need to be implemented elsewhere. +The method does not belong to the published interface of the class and does not need to be implemented elsewhere. ]]> @@ -423,7 +423,7 @@ The m method does not belong to the published interface of the class and does not need to be implemented elsewhere. + The method does not belong to the published interface of the class and does not need to be implemented elsewhere. ]]> @@ -461,7 +461,7 @@ The m method does not belong to the published interface of the class and does not need to be implemented elsewhere. + The method does not belong to the published interface of the class and does not need to be implemented elsewhere. ]]> diff --git a/xml/System.EnterpriseServices/SharedPropertyGroup.xml b/xml/System.EnterpriseServices/SharedPropertyGroup.xml index 5a4dc2c35d2..79ba84f372e 100644 --- a/xml/System.EnterpriseServices/SharedPropertyGroup.xml +++ b/xml/System.EnterpriseServices/SharedPropertyGroup.xml @@ -24,20 +24,20 @@ Represents a collection of shared properties. This class cannot be inherited. - class to create a SharedPropertyGroup. - + class to create a SharedPropertyGroup. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/EnterpriseServices_SharedProperties/CPP/receiptcounterclass.cpp" id="Snippet0"::: :::code language="csharp" source="~/snippets/csharp/System.EnterpriseServices/SharedProperty/Overview/receiptcounterclass.cs" id="Snippet0"::: - :::code language="vb" source="~/snippets/visualbasic/System.EnterpriseServices/SharedProperty/Overview/receiptcounterclass.vb" id="Snippet0"::: - + :::code language="vb" source="~/snippets/visualbasic/System.EnterpriseServices/SharedProperty/Overview/receiptcounterclass.vb" id="Snippet0"::: + ]]> @@ -69,15 +69,15 @@ Creates a property with the given name. The requested . - @@ -136,11 +136,11 @@ Returns the property with the given name. The requested . - , this property must already exist. - + , this property must already exist. + ]]> @@ -170,11 +170,11 @@ Returns the property at the given position. The requested . - , this property must already exist. - + , this property must already exist. + ]]> diff --git a/xml/System.EnterpriseServices/SxsOption.xml b/xml/System.EnterpriseServices/SxsOption.xml index 49db5d514b1..48b7d8b98ed 100644 --- a/xml/System.EnterpriseServices/SxsOption.xml +++ b/xml/System.EnterpriseServices/SxsOption.xml @@ -27,11 +27,11 @@ Indicates how side-by-side assemblies are configured for . - is used for the value of . - + is used for the value of . + ]]> diff --git a/xml/System.EnterpriseServices/ThreadPoolOption.xml b/xml/System.EnterpriseServices/ThreadPoolOption.xml index c6a6b8ff9a6..74c7bfb7346 100644 --- a/xml/System.EnterpriseServices/ThreadPoolOption.xml +++ b/xml/System.EnterpriseServices/ThreadPoolOption.xml @@ -27,11 +27,11 @@ Indicates the thread pool in which the work, submitted by , runs. - is used for the value of . - + is used for the value of . + ]]> diff --git a/xml/System.EnterpriseServices/TransactionStatus.xml b/xml/System.EnterpriseServices/TransactionStatus.xml index c8cb903d32e..e6705a9900d 100644 --- a/xml/System.EnterpriseServices/TransactionStatus.xml +++ b/xml/System.EnterpriseServices/TransactionStatus.xml @@ -27,11 +27,11 @@ Indicates the transaction status. - is the value returned by . - + is the value returned by . + ]]> diff --git a/xml/System.Globalization/Calendar.xml b/xml/System.Globalization/Calendar.xml index 41cafffad42..e4adefdc868 100644 --- a/xml/System.Globalization/Calendar.xml +++ b/xml/System.Globalization/Calendar.xml @@ -281,7 +281,7 @@ The month part of the resulting is affected if the resulting day is outside the month of the specified . The year part of the resulting is affected if the resulting month is outside the year of the specified . The era part of the resulting is affected if the resulting year is outside the era of the specified . The time-of-day part of the resulting remains the same as the specified . - The property of the returned value always equals . You can preserve the property of the `time` parameter by calling the method, as the following example shows. + The property of the returned value always equals . You can preserve the property of the `time` parameter by calling the method, as the following example shows. :::code language="csharp" source="~/snippets/csharp/System.Globalization/Calendar/AddDays/add1.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/Calendar/AddDays/add1.vb" id="Snippet1"::: @@ -367,7 +367,7 @@ The day part of the resulting is affected if the resulting time is outside the day of the specified . The month part of the resulting is affected if the resulting day is outside the month of the specified . The year part of the resulting is affected if the resulting month is outside the year of the specified . The era part of the resulting is affected if the resulting year is outside the era of the specified . - The property of the returned value always equals . You can preserve the property of the `time` parameter by calling the method, as the following example shows. + The property of the returned value always equals . You can preserve the property of the `time` parameter by calling the method, as the following example shows. :::code language="csharp" source="~/snippets/csharp/System.Globalization/Calendar/AddDays/add1.cs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/Calendar/AddDays/add1.vb" id="Snippet2"::: @@ -453,7 +453,7 @@ The day part of the resulting is affected if the resulting time is outside the day of the specified . The month part of the resulting is affected if the resulting day is outside the month of the specified . The year part of the resulting is affected if the resulting month is outside the year of the specified . The era part of the resulting is affected if the resulting year is outside the era of the specified . - The property of the returned value always equals . You can preserve the property of the `time` parameter by calling the method, as the following example shows. + The property of the returned value always equals . You can preserve the property of the `time` parameter by calling the method, as the following example shows. :::code language="csharp" source="~/snippets/csharp/System.Globalization/Calendar/AddDays/add1.cs" id="Snippet3"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/Calendar/AddDays/add1.vb" id="Snippet3"::: @@ -539,7 +539,7 @@ The day part of the resulting is affected if the resulting time is outside the day of the specified . The month part of the resulting is affected if the resulting day is outside the month of the specified . The year part of the resulting is affected if the resulting month is outside the year of the specified . The era part of the resulting is affected if the resulting year is outside the era of the specified . - The property of the returned value always equals . You can preserve the property of the `time` parameter by calling the method, as the following example shows. + The property of the returned value always equals . You can preserve the property of the `time` parameter by calling the method, as the following example shows. :::code language="csharp" source="~/snippets/csharp/System.Globalization/Calendar/AddDays/add1.cs" id="Snippet4"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/Calendar/AddDays/add1.vb" id="Snippet4"::: @@ -629,7 +629,7 @@ If the value of the `months` parameter is negative, the resulting is earlier than the specified . - The property of the returned value always equals . You can preserve the property of the `time` parameter by calling the method, as the following example shows. + The property of the returned value always equals . You can preserve the property of the `time` parameter by calling the method, as the following example shows. :::code language="csharp" source="~/snippets/csharp/System.Globalization/Calendar/AddDays/add1.cs" id="Snippet5"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/Calendar/AddDays/add1.vb" id="Snippet5"::: @@ -715,7 +715,7 @@ The day part of the resulting is affected if the resulting time is outside the day of the specified . The month part of the resulting is affected if the resulting day is outside the month of the specified . The year part of the resulting is affected if the resulting month is outside the year of the specified . The era part of the resulting is affected if the resulting year is outside the era of the specified . - The property of the returned value always equals . You can preserve the property of the `time` parameter by calling the method, as the following example shows. + The property of the returned value always equals . You can preserve the property of the `time` parameter by calling the method, as the following example shows. :::code language="csharp" source="~/snippets/csharp/System.Globalization/Calendar/AddDays/add1.cs" id="Snippet6"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/Calendar/AddDays/add1.vb" id="Snippet6"::: @@ -803,7 +803,7 @@ In all .NET classes derived from the class, a week is defined as seven days. - The property of the returned value always equals . You can preserve the property of the `time` parameter by calling the method, as the following example shows. + The property of the returned value always equals . You can preserve the property of the `time` parameter by calling the method, as the following example shows. :::code language="csharp" source="~/snippets/csharp/System.Globalization/Calendar/AddDays/add1.cs" id="Snippet7"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/Calendar/AddDays/add1.vb" id="Snippet7"::: @@ -893,7 +893,7 @@ If `years` is negative, the resulting is earlier than the specified . - The property of the returned value always equals . You can preserve the property of the `time` parameter by calling the method, as the following example shows. + The property of the returned value always equals . You can preserve the property of the `time` parameter by calling the method, as the following example shows. :::code language="csharp" source="~/snippets/csharp/System.Globalization/Calendar/AddDays/add1.cs" id="Snippet8"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/Calendar/AddDays/add1.vb" id="Snippet8"::: @@ -1095,7 +1095,7 @@ field represents the index of the current era in the array. Because eras are arranged in reverse chronological order (from the current era to earlier eras), this field is a constant that has a value of 0. + The field represents the index of the current era in the array. Because eras are arranged in reverse chronological order (from the current era to earlier eras), this field is a constant that has a value of 0. ]]> @@ -1207,7 +1207,7 @@ The and classes support multiple eras. Most calendar implementations, on the other hand, support a single era. ## Examples - The following example displays the values contained in when the Heisei era (1989-2019) was the current era. + The following example displays the values contained in when the Heisei era (1989-2019) was the current era. :::code language="csharp" source="~/snippets/csharp/System.Globalization/Calendar/Eras/yslin_japanesecalendar_eras.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/Calendar/Eras/yslin_japanesecalendar_eras.vb" id="Snippet1"::: @@ -1419,7 +1419,7 @@ The and , for January 1 returns 1, and for December 31 returns 365 in a common year or 366 in a leap year. + The day of the year is defined as the number of days from the first day of the year. For example, in , for January 1 returns 1, and for December 31 returns 365 in a common year or 366 in a leap year. @@ -1508,7 +1508,7 @@ The and , for February returns 28 in a common year or 29 in a leap year. + For example, in , for February returns 28 in a common year or 29 in a leap year. @@ -1587,7 +1587,7 @@ The and , for February returns 28 in a common year or 29 in a leap year. + For example, in , for February returns 28 in a common year or 29 in a leap year. ]]> @@ -1673,7 +1673,7 @@ The and , returns 365 for a common year or 366 for a leap year. + For example, in , returns 365 for a common year or 366 for a leap year. @@ -1746,7 +1746,7 @@ The and , returns 365 for a common year or 366 for a leap year. + For example, in , returns 365 for a common year or 366 for a leap year. ]]> @@ -1984,7 +1984,7 @@ Only the and the method returns a number between 1 and 13 that indicates the month associated with a specified date. If there is a leap month between the eighth and ninth months of the year, the method returns 8 for the eighth month, 9 for the leap eighth month, and 10 for the ninth month. + In a calendar that supports the notion of a leap month, the leap month can occur either after a particular month or after any month in a year. For example, the method returns a number between 1 and 13 that indicates the month associated with a specified date. If there is a leap month between the eighth and ninth months of the year, the method returns 8 for the eighth month, 9 for the leap eighth month, and 10 for the ninth month. ]]> @@ -2053,7 +2053,7 @@ Only the and the method returns a number between 1 and 13 that indicates the month associated with a specified date. If there is a leap month between the eighth and ninth months of the year, the method returns 8 for the eighth month, 9 for the leap eighth month, and 10 for the ninth month. + In a calendar that supports the notion of a leap month, the leap month can occur either after a particular month or after any month in a year. For example, the method returns a number between 1 and 13 that indicates the month associated with a specified date. If there is a leap month between the eighth and ninth months of the year, the method returns 8 for the eighth month, 9 for the leap eighth month, and 10 for the ninth month. ]]> @@ -2255,7 +2255,7 @@ Only the and the , for Tishrei returns 1, and for Elul returns 12 in a common year or 13 in a leap year. + For example, in , for Tishrei returns 1, and for Elul returns 12 in a common year or 13 in a leap year. @@ -2342,7 +2342,7 @@ Only the and the , returns 12 for a common year or 13 for a leap year. + For example, in , returns 12 for a common year or 13 for a leap year. @@ -2414,7 +2414,7 @@ Only the and the , returns 12 for a common year or 13 for a leap year. + For example, in , returns 12 for a common year or 13 for a leap year. ]]> @@ -2570,14 +2570,14 @@ Only the and the property contains the default calendar week rule that can be used for the `rule` parameter. > [!NOTE] -> This does not map exactly to ISO 8601. The differences are discussed in the blog entry [ISO 8601 Week of Year format in Microsoft .NET](https://go.microsoft.com/fwlink/?LinkId=160851). Starting with .NET Core 3.0, and solve this problem. +> This does not map exactly to ISO 8601. The differences are discussed in the blog entry [ISO 8601 Week of Year format in Microsoft .NET](https://go.microsoft.com/fwlink/?LinkId=160851). Starting with .NET Core 3.0, and solve this problem. The following example uses the current culture's object to determine that January 1, 2011 is in the first week of the year in the Gregorian calendar. :::code language="csharp" source="~/snippets/csharp/System.Globalization/Calendar/GetWeekOfYear/getweekofyearex1.cs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/Calendar/GetWeekOfYear/getweekofyearex1.vb" id="Snippet2"::: - For some calendars, a call to the method throws an for particular combinations of `rule` and `firstDayOfWeek` values even if `time` is greater than the date returned by that calendar's property. The following table lists the affected calendars, the specific `rule` values, and the range of the earliest supported `time` values. The specific minimum value depends on the value of the `firstDayOfWeek` parameter. + For some calendars, a call to the method throws an for particular combinations of `rule` and `firstDayOfWeek` values even if `time` is greater than the date returned by that calendar's property. The following table lists the affected calendars, the specific `rule` values, and the range of the earliest supported `time` values. The specific minimum value depends on the value of the `firstDayOfWeek` parameter. |Calendar|CalendarWeekRule value|Gregorian date (M/dd/yyyy)|Date in calendar (M/dd/yyyy)| |--------------|----------------------------|------------------------------------|--------------------------------------| @@ -2604,7 +2604,7 @@ Only the and the varies depending on the and the used. If the specified date is the last day of the year, returns the total number of weeks in that year. + The following code example shows how the result of varies depending on the and the used. If the specified date is the last day of the year, returns the total number of weeks in that year. :::code language="csharp" source="~/snippets/csharp/System.Globalization/Calendar/GetWeekOfYear/yslin_calendar_getweekofyear.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/Calendar/GetWeekOfYear/yslin_calendar_getweekofyear.vb" id="Snippet1"::: @@ -3621,7 +3621,7 @@ This method returns a date and time based on the current era of a particular cal method is useful because it can convert any date in the current calendar to a Gregorian calendar date. The Gregorian date can subsequently be used, for example, to compare dates in different calendars or create an equivalent date in a particular calendar. + The method is useful because it can convert any date in the current calendar to a Gregorian calendar date. The Gregorian date can subsequently be used, for example, to compare dates in different calendars or create an equivalent date in a particular calendar. ]]> @@ -3717,11 +3717,11 @@ This method returns a date and time based on the current era of a particular cal is the last year in the 100-year range that can be represented by a two-digit year. The century is determined by finding the sole occurrence of the two-digit `year` within that 100-year range. For example, if is set to 2029, the 100-year range is from 1930 to 2029. Therefore, a 2-digit value of 30 is interpreted as 1930, while a 2-digit value of 29 is interpreted as 2029. + is the last year in the 100-year range that can be represented by a two-digit year. The century is determined by finding the sole occurrence of the two-digit `year` within that 100-year range. For example, if is set to 2029, the 100-year range is from 1930 to 2029. Therefore, a 2-digit value of 30 is interpreted as 1930, while a 2-digit value of 29 is interpreted as 2029. If `year` is greater than or equal to 100, the value of `year` is returned unchanged. - supports either a two-digit year or a four-digit year. Passing a two-digit year value (less than 100) causes the method to convert the value to a four-digit value according to the value representing the appropriate century. If the application supplies a four-digit year value that is within the supported calendar range to , the method returns the actual input value. If the application supplies a four-digit value that is outside the supported calendar range, or if it supplies a negative value, the method throws an exception. + supports either a two-digit year or a four-digit year. Passing a two-digit year value (less than 100) causes the method to convert the value to a four-digit value according to the value representing the appropriate century. If the application supplies a four-digit year value that is within the supported calendar range to , the method returns the actual input value. If the application supplies a four-digit value that is outside the supported calendar range, or if it supplies a negative value, the method throws an exception. ]]> diff --git a/xml/System.Globalization/CalendarWeekRule.xml b/xml/System.Globalization/CalendarWeekRule.xml index 83de13a34a2..88d8c5271b6 100644 --- a/xml/System.Globalization/CalendarWeekRule.xml +++ b/xml/System.Globalization/CalendarWeekRule.xml @@ -75,9 +75,9 @@ enumeration is returned by the property and is used by the culture's current calendar to determine the calendar week rule. The enumeration value is also used as a parameter to the method. + A member of the enumeration is returned by the property and is used by the culture's current calendar to determine the calendar week rule. The enumeration value is also used as a parameter to the method. - Calendar week rules depend on the value that indicates the first day of the week in addition to depending on a value. The property provides the default value for a culture, but any value can be specified as the first day of the week in the method. + Calendar week rules depend on the value that indicates the first day of the week in addition to depending on a value. The property provides the default value for a culture, but any value can be specified as the first day of the week in the method. The first week based on the `FirstDay` value can have one to seven days. The first week based on the `FirstFullWeek` value always has seven days. The first week based on the `FirstFourDayWeek` value can have four to seven days. @@ -120,9 +120,9 @@ :::code language="vb" source="~/snippets/visualbasic/System.Globalization/CalendarWeekRule/Overview/calendarweekruleex.vb" id="Snippet1"::: > [!NOTE] -> This does not map exactly to ISO 8601. The differences are discussed in the blog entry [ISO 8601 Week of Year format in Microsoft .NET](https://go.microsoft.com/fwlink/?LinkId=160851). Starting with .NET Core 3.0, and solve this problem. +> This does not map exactly to ISO 8601. The differences are discussed in the blog entry [ISO 8601 Week of Year format in Microsoft .NET](https://go.microsoft.com/fwlink/?LinkId=160851). Starting with .NET Core 3.0, and solve this problem. - Each object supports a set of calendars. The property returns the default calendar for the culture, and the property returns an array containing all the calendars supported by the culture. To change the calendar used by a , set the property of to a new . + Each object supports a set of calendars. The property returns the default calendar for the culture, and the property returns an array containing all the calendars supported by the culture. To change the calendar used by a , set the property of to a new . ]]> diff --git a/xml/System.Globalization/CharUnicodeInfo.xml b/xml/System.Globalization/CharUnicodeInfo.xml index 9e4db4a4e58..bc608c84b2a 100644 --- a/xml/System.Globalization/CharUnicodeInfo.xml +++ b/xml/System.Globalization/CharUnicodeInfo.xml @@ -92,7 +92,7 @@ In addition, the class is used inter - The class, which works with textual elements instead of single characters in a string. -- The overloads of the method, which determine the category to which a character or surrogate pair belongs. +- The overloads of the method, which determine the category to which a character or surrogate pair belongs. - The [character classes](/dotnet/standard/base-types/character-classes-in-regular-expressions) recognized by , .NET's regular expression engine. @@ -510,7 +510,7 @@ Each version of the Unicode standard includes information on changes to the Unic ## Remarks Numeric value is a Unicode character property that applies only to numeric characters, which include fractions, subscripts, superscripts, Roman numerals, currency numerators, encircled numbers, and script-specific digits. For more information on Unicode characters, see the [Unicode Standard](https://go.microsoft.com/fwlink/?linkid=37123). - The method assumes that `ch` corresponds to a single linguistic character and checks whether that character can be converted to a decimal digit. However, some numbers in the Unicode standard are represented by two objects that form a surrogate pair. For example, the Aegean numbering system consists of code points U+10107 through U+10133. The following example uses the method to instantiate a string that represents AEGEAN NUMBER ONE. As the output from the example shows, the method returns -1 if it is passed either a high surrogate or a low surrogate of this character. + The method assumes that `ch` corresponds to a single linguistic character and checks whether that character can be converted to a decimal digit. However, some numbers in the Unicode standard are represented by two objects that form a surrogate pair. For example, the Aegean numbering system consists of code points U+10107 through U+10133. The following example uses the method to instantiate a string that represents AEGEAN NUMBER ONE. As the output from the example shows, the method returns -1 if it is passed either a high surrogate or a low surrogate of this character. :::code language="csharp" source="~/snippets/csharp/System.Globalization/CharUnicodeInfo/GetNumericValue/getnumericvalue1.cs" interactive="try-dotnet-method" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/CharUnicodeInfo/GetNumericValue/getnumericvalue1.vb" id="Snippet2"::: @@ -592,7 +592,7 @@ Each version of the Unicode standard includes information on changes to the Unic ## Remarks Numeric value is a Unicode character property that applies only to numeric characters, which include fractions, subscripts, superscripts, Roman numerals, currency numerators, encircled numbers, and script-specific digits. For more information on Unicode characters, see the [Unicode Standard](https://go.microsoft.com/fwlink/?linkid=37123). - If the object at position `index` is the first character of a valid surrogate pair, the method determines whether the surrogate pair forms a numeric digit, and, if it does, returns its numeric value. For example, the Aegean numbering system consists of code points U+10107 through U+10133. The following example uses the method to instantiate a string that represents each Aegean number. As the output from the example shows, the method returns the correct numeric value if it is passed the high surrogate of an Aegean number. However, if it is passed the low surrogate, it considers only the low surrogate in isolation and returns -1. + If the object at position `index` is the first character of a valid surrogate pair, the method determines whether the surrogate pair forms a numeric digit, and, if it does, returns its numeric value. For example, the Aegean numbering system consists of code points U+10107 through U+10133. The following example uses the method to instantiate a string that represents each Aegean number. As the output from the example shows, the method returns the correct numeric value if it is passed the high surrogate of an Aegean number. However, if it is passed the low surrogate, it considers only the low surrogate in isolation and returns -1. :::code language="csharp" source="~/snippets/csharp/System.Globalization/CharUnicodeInfo/GetNumericValue/getnumericvalue1.cs" interactive="try-dotnet-method" id="Snippet3"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/CharUnicodeInfo/GetNumericValue/getnumericvalue1.vb" id="Snippet3"::: @@ -682,12 +682,12 @@ Each version of the Unicode standard includes information on changes to the Unic ## Remarks The Unicode characters are divided into categories. A character's category is one of its properties. For example, a character might be an uppercase letter, a lowercase letter, a decimal digit number, a letter number, a connector punctuation, a math symbol, or a currency symbol. The enumeration defines the category of a Unicode character. For more information on Unicode characters, see the [Unicode Standard](https://home.unicode.org/). - The method assumes that `ch` corresponds to a single linguistic character and returns its category. This means that, for surrogate pairs, it returns instead of the category to which the surrogate belongs. For example, the Ugaritic alphabet occupies code points U+10380 to U+1039F. The following example uses the method to instantiate a string that represents UGARITIC LETTER ALPA (U+10380), which is the first letter of the Ugaritic alphabet. As the output from the example shows, the method returns `false` if it is passed either the high surrogate or the low surrogate of this character. + The method assumes that `ch` corresponds to a single linguistic character and returns its category. This means that, for surrogate pairs, it returns instead of the category to which the surrogate belongs. For example, the Ugaritic alphabet occupies code points U+10380 to U+1039F. The following example uses the method to instantiate a string that represents UGARITIC LETTER ALPA (U+10380), which is the first letter of the Ugaritic alphabet. As the output from the example shows, the method returns `false` if it is passed either the high surrogate or the low surrogate of this character. :::code language="csharp" source="~/snippets/csharp/System.Globalization/CharUnicodeInfo/GetUnicodeCategory/getunicodecategory1.cs" interactive="try-dotnet-method" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/CharUnicodeInfo/GetUnicodeCategory/getunicodecategory1.vb" id="Snippet1"::: - Note that does not always return the same value as the method when passed a particular character as a parameter. The method is designed to reflect the current version of the Unicode standard. In contrast, although the method usually reflects the current version of the Unicode standard, it might return a character's category based on a previous version of the standard, or it might return a category that differs from the current standard to preserve backward compatibility. + Note that does not always return the same value as the method when passed a particular character as a parameter. The method is designed to reflect the current version of the Unicode standard. In contrast, although the method usually reflects the current version of the Unicode standard, it might return a character's category based on a previous version of the standard, or it might return a category that differs from the current standard to preserve backward compatibility. @@ -806,12 +806,12 @@ Each version of the Unicode standard includes information on changes to the Unic ## Remarks The Unicode characters are divided into categories. A character's category is one of its properties. For example, a character might be an uppercase letter, a lowercase letter, a decimal digit number, a letter number, a connector punctuation, a math symbol, or a currency symbol. The enumeration defines the category of a Unicode character. For more information on Unicode characters, see the [Unicode Standard](https://home.unicode.org/). - If the object at position `index` is the first character of a valid surrogate pair, the method returns the Unicode category of the surrogate pair instead of returning . For example, the Ugaritic alphabet occupies code points U+10380 to U+1039F. The following example uses the method to instantiate a string that represents UGARITIC LETTER ALPA (U+10380), which is the first letter of the Ugaritic alphabet. As the output from the example shows, the method returns if it is passed the high surrogate of this character, which indicates that it considers the surrogate pair. However, if it is passed the low surrogate, it considers only the low surrogate in isolation and returns . + If the object at position `index` is the first character of a valid surrogate pair, the method returns the Unicode category of the surrogate pair instead of returning . For example, the Ugaritic alphabet occupies code points U+10380 to U+1039F. The following example uses the method to instantiate a string that represents UGARITIC LETTER ALPA (U+10380), which is the first letter of the Ugaritic alphabet. As the output from the example shows, the method returns if it is passed the high surrogate of this character, which indicates that it considers the surrogate pair. However, if it is passed the low surrogate, it considers only the low surrogate in isolation and returns . :::code language="csharp" source="~/snippets/csharp/System.Globalization/CharUnicodeInfo/GetUnicodeCategory/getunicodecategory1.cs" interactive="try-dotnet-method" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/CharUnicodeInfo/GetUnicodeCategory/getunicodecategory1.vb" id="Snippet2"::: - Note that method does not always return the same value as the method when passed a particular character as a parameter. The method is designed to reflect the current version of the Unicode standard. In contrast, although the method usually reflects the current version of the Unicode standard, it might return a character's category based on a previous version of the standard, or it might return a category that differs from the current standard to preserve backward compatibility. + Note that method does not always return the same value as the method when passed a particular character as a parameter. The method is designed to reflect the current version of the Unicode standard. In contrast, although the method usually reflects the current version of the Unicode standard, it might return a character's category based on a previous version of the standard, or it might return a category that differs from the current standard to preserve backward compatibility. diff --git a/xml/System.Globalization/ChineseLunisolarCalendar.xml b/xml/System.Globalization/ChineseLunisolarCalendar.xml index 0f037ffaf77..67db9e640e1 100644 --- a/xml/System.Globalization/ChineseLunisolarCalendar.xml +++ b/xml/System.Globalization/ChineseLunisolarCalendar.xml @@ -79,11 +79,11 @@ > [!NOTE] > For information about using the class and the other calendar classes in the .NET Framework, see [Working with Calendars](/dotnet/standard/datetime/working-with-calendars). - A leap month can occur after any month in a year. For example, the method returns a number between 1 and 13 that indicates the month associated with a specified date. If there is a leap month between the eighth and ninth months of the year, the method returns 8 for the eighth month, 9 for the leap eighth month, and 10 for the ninth month. + A leap month can occur after any month in a year. For example, the method returns a number between 1 and 13 that indicates the month associated with a specified date. If there is a leap month between the eighth and ninth months of the year, the method returns 8 for the eighth month, 9 for the leap eighth month, and 10 for the ninth month. Currently, the is not used by any of the cultures supported by the class. Therefore, this class can be used only to calculate dates in the Chinese lunisolar calendar. - Each object supports a set of calendars. The property returns the default calendar for the culture, and the property returns an array containing all the calendars supported by the culture. To change the calendar used by a , the application should set the property of to a new . + Each object supports a set of calendars. The property returns the default calendar for the culture, and the property returns an array containing all the calendars supported by the culture. To change the calendar used by a , the application should set the property of to a new . ]]> diff --git a/xml/System.Globalization/CompareInfo.xml b/xml/System.Globalization/CompareInfo.xml index f87a5f94181..d1b7a9b4f89 100644 --- a/xml/System.Globalization/CompareInfo.xml +++ b/xml/System.Globalization/CompareInfo.xml @@ -207,12 +207,12 @@ - object associated with the Spanish (Spain) culture with international sort - object associated with the Spanish (Spain) culture with traditional sort -- object associated with the +- object associated with the :::code language="csharp" source="~/snippets/csharp/System.Globalization/CompareInfo/Compare/comparestrstr.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/CompareInfo/Compare/comparestrstr.vb" id="Snippet1"::: - The following example demonstrates calling the method. + The following example demonstrates calling the method. :::code language="csharp" source="~/snippets/csharp/System.Globalization/CompareInfo/Overview/CompareInfo.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/CompareInfo/Overview/CompareInfo.vb" id="Snippet1"::: @@ -372,7 +372,7 @@ :::code language="csharp" source="~/snippets/csharp/System.Globalization/CompareInfo/Compare/comparestrstropt.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/CompareInfo/Compare/comparestrstropt.vb" id="Snippet1"::: - The following example demonstrates calling the method. + The following example demonstrates calling the method. :::code language="csharp" source="~/snippets/csharp/System.Globalization/CompareInfo/Overview/CompareInfo.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/CompareInfo/Overview/CompareInfo.vb" id="Snippet1"::: @@ -483,7 +483,7 @@ - object associated with the Spanish (Spain) culture with traditional sort -- object associated with the +- object associated with the :::code language="csharp" source="~/snippets/csharp/System.Globalization/CompareInfo/Compare/comparestrintstrint.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/CompareInfo/Compare/comparestrintstrint.vb" id="Snippet1"::: @@ -722,7 +722,7 @@ - object associated with the Spanish (Spain) culture with traditional sort -- object associated with the +- object associated with the :::code language="csharp" source="~/snippets/csharp/System.Globalization/CompareInfo/Compare/comparestrintintstrintint.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/CompareInfo/Compare/comparestrintintstrintint.vb" id="Snippet1"::: @@ -948,9 +948,9 @@ objects are equal if their and properties are equal. + Two objects are equal if their and properties are equal. - This method overrides . + This method overrides . If a security decision depends on a string comparison or a case change, you should use the property to ensure that the behavior is consistent regardless of the culture settings of the operating system. @@ -1025,7 +1025,7 @@ - object associated with the Spanish (Spain) culture with traditional sort -- object associated with the +- object associated with the :::code language="csharp" source="~/snippets/csharp/System.Globalization/CompareInfo/Compare/comparestrstr.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/CompareInfo/Compare/comparestrstr.vb" id="Snippet1"::: @@ -1098,7 +1098,7 @@ - object associated with the Spanish (Spain) culture with traditional sort -- object associated with the +- object associated with the :::code language="csharp" source="~/snippets/csharp/System.Globalization/CompareInfo/Compare/comparestrstr.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/CompareInfo/Compare/comparestrstr.vb" id="Snippet1"::: @@ -1167,7 +1167,7 @@ > [!NOTE] > The behavior of this method is unpredictable. It is recommended for your application to use a version of this method that does not take an assembly input. - The `assembly` parameter must be of the same type as . + The `assembly` parameter must be of the same type as . ]]> @@ -1234,7 +1234,7 @@ > [!NOTE] > The behavior of this method is unpredictable. We recommend that you use a version of this method that does not take an assembly input. - The `assembly` parameter must be of the same type as . + The `assembly` parameter must be of the same type as . ]]> @@ -1312,9 +1312,9 @@ . + This method overrides . - This method generates the same hash code for two objects that are equal according to the method. + This method generates the same hash code for two objects that are equal according to the method. ]]> @@ -1436,10 +1436,10 @@ is dependent on its implementation, which might change from one version of the common language runtime to another, or from one .NET Framework platform to another. + The behavior of is dependent on its implementation, which might change from one version of the common language runtime to another, or from one .NET Framework platform to another. > [!IMPORTANT] -> If two string objects are equal, the method returns identical values. However, there is not a unique hash code value for each unique string value. Different strings can return the same hash code. +> If two string objects are equal, the method returns identical values. However, there is not a unique hash code value for each unique string value. Different strings can return the same hash code. > > The hash code itself is not guaranteed to be stable. Hash codes for identical strings can differ across versions of the .NET Framework and across platforms (such as 32-bit and 64-bit) for a single version of the .NET Framework. In some cases, they can even differ by application domain. > @@ -1517,7 +1517,7 @@ method is equivalent to the Windows API method `LCMapString` with the LCMAP_SORTKEY flag. + Each character in a string is given several categories of sort weights, including script, alphabetic, case, and diacritic weights. A sort key is the repository of these weights for a particular string. For example, a sort key might contain a string of alphabetic weights, followed by a string of case weights, and so on. The method is equivalent to the Windows API method `LCMapString` with the LCMAP_SORTKEY flag. ]]> @@ -1581,7 +1581,7 @@ method is equivalent to the Windows API method `LCMapString` with the LCMAP_SORTKEY flag. + Each character in a string is given several categories of sort weights, including script, alphabetic, case, and diacritic weights. A sort key is the repository of these weights for a particular string. For example, a sort key might contain a string of alphabetic weights, followed by a string of case weights, and so on. The method is equivalent to the Windows API method `LCMapString` with the LCMAP_SORTKEY flag. ]]> @@ -1763,7 +1763,7 @@ Use and use the value. Unlike , which performs a culture-sensitive comparison, overloads of the method that search for a character perform an ordinal comparison and overloads that search for a string perform a culture-sensitive comparison. + This overload performs a culture-sensitive search. If `value` represents a precomposed Unicode character, such as the ligature "Æ" (U+00C6), it might be considered equivalent to any occurrence of its components in the correct sequence, such as "AE" (U+0041, U+0045), depending on the culture. To perform an ordinal (culture-insensitive) search, where a character is considered equivalent to another character only if their Unicode code points are the same, you should call an overload that has a parameter of type and use the value. Unlike , which performs a culture-sensitive comparison, overloads of the method that search for a character perform an ordinal comparison and overloads that search for a string perform a culture-sensitive comparison. > [!NOTE] > When possible, you should use string comparison methods that have a parameter of type to specify the kind of comparison expected. As a general rule, use linguistic options (using the current culture) for comparing strings displayed in the user interface and specify or for security comparisons. @@ -2036,7 +2036,7 @@ Use and values are not valid for this method. - If `options` does not include the value, this overload performs a culture-sensitive search. If the character is a Unicode value representing a precomposed character, such as the ligature "Æ" (U+00C6), it might be considered equivalent to any occurrence of its components in the correct sequence, such as "AE" (U+0041, U+0045), depending on the culture. If `options` includes the value, this overload performs an ordinal (culture-insensitive) search. A character is considered equivalent to another character only if the Unicode values are the same. Overloads of that search for a character perform an ordinal search, whereas those that search for a string perform a culture-sensitive search. + If `options` does not include the value, this overload performs a culture-sensitive search. If the character is a Unicode value representing a precomposed character, such as the ligature "Æ" (U+00C6), it might be considered equivalent to any occurrence of its components in the correct sequence, such as "AE" (U+0041, U+0045), depending on the culture. If `options` includes the value, this overload performs an ordinal (culture-insensitive) search. A character is considered equivalent to another character only if the Unicode values are the same. Overloads of that search for a character perform an ordinal search, whereas those that search for a string perform a culture-sensitive search. > [!NOTE] > When possible, you should use string comparison methods that have a parameter of type to specify the kind of comparison expected. As a general rule, use linguistic options (using the current culture) for comparing strings displayed in the user interface and specify or for security comparisons. @@ -2126,7 +2126,7 @@ Use and use the value. Overloads of that search for a character perform an ordinal search, whereas those that search for a string perform a culture-sensitive search. + This overload performs a culture-sensitive search. If the character is a Unicode value representing a precomposed character, such as the ligature "Æ" (U+00C6), it might be considered equivalent to any occurrence of its components in the correct sequence, such as "AE" (U+0041, U+0045), depending on the culture. To perform an ordinal (culture-insensitive) search, where a character is considered equivalent to another character only if the Unicode values are the same, you should call one of the overloads that has a parameter of type and use the value. Overloads of that search for a character perform an ordinal search, whereas those that search for a string perform a culture-sensitive search. > [!NOTE] > When possible, you should call string comparison methods that have a parameter of type to specify the kind of comparison expected. As a general rule, use linguistic options (using the current culture) for comparing strings displayed in the user interface and specify or for security comparisons. @@ -2134,7 +2134,7 @@ Use and are searching in different portions of the string, even with the same `startIndex` parameter. + The following example determines the indexes of the first and last occurrences of a character or a substring within a portion of a string. Note that and are searching in different portions of the string, even with the same `startIndex` parameter. :::code language="csharp" source="~/snippets/csharp/System.Globalization/CompareInfo/IndexOf/indexofint.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/CompareInfo/IndexOf/indexofint.vb" id="Snippet1"::: @@ -2321,7 +2321,7 @@ Use and are searching in different portions of the string, even with the same `startIndex` parameter. + The following example determines the indexes of the first and last occurrences of a character or a substring within a portion of a string. Note that and are searching in different portions of the string, even with the same `startIndex` parameter. :::code language="csharp" source="~/snippets/csharp/System.Globalization/CompareInfo/IndexOf/indexofint.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/CompareInfo/IndexOf/indexofint.vb" id="Snippet1"::: @@ -2395,7 +2395,7 @@ Use overloads that don't take a `matchLength` argument. Call this overload only if you require the match length information. +This method has greater overhead than other overloads that don't take a `matchLength` argument. Call this overload only if you require the match length information. ]]> @@ -2470,7 +2470,7 @@ This method has greater overhead than other and values are not valid for this method. - If `options` does not include the value, this overload performs a culture-sensitive search. If the character is a Unicode value representing a precomposed character, such as the ligature "Æ" (U+00C6), it might be considered equivalent to any occurrence of its components in the correct sequence, such as "AE" (U+0041, U+0045), depending on the culture. If `options` includes the value, this overload performs an ordinal (culture-insensitive) search. A character is considered equivalent to another character only if the Unicode values are the same. Overloads of that search for a character perform an ordinal search, whereas those that search for a string perform a culture-sensitive search. + If `options` does not include the value, this overload performs a culture-sensitive search. If the character is a Unicode value representing a precomposed character, such as the ligature "Æ" (U+00C6), it might be considered equivalent to any occurrence of its components in the correct sequence, such as "AE" (U+0041, U+0045), depending on the culture. If `options` includes the value, this overload performs an ordinal (culture-insensitive) search. A character is considered equivalent to another character only if the Unicode values are the same. Overloads of that search for a character perform an ordinal search, whereas those that search for a string perform a culture-sensitive search. > [!NOTE] > When possible, you should call string comparison methods that have a parameter of type to specify the kind of comparison expected. As a general rule, use linguistic options (using the current culture) for comparing strings displayed in the user interface and specify or for security comparisons. @@ -2478,7 +2478,7 @@ This method has greater overhead than other and are searching in different portions of the string, even with the same `startIndex` parameter. + The following example determines the indexes of the first and last occurrences of a character or a substring within a portion of a string. Note that and are searching in different portions of the string, even with the same `startIndex` parameter. :::code language="csharp" source="~/snippets/csharp/System.Globalization/CompareInfo/IndexOf/indexofint.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/CompareInfo/IndexOf/indexofint.vb" id="Snippet1"::: @@ -2566,7 +2566,7 @@ This method has greater overhead than other and use the value. Overloads of that search for a character perform an ordinal search, whereas those that search for a string perform a culture-sensitive search. + This overload performs a culture-sensitive search. If the character is a Unicode value representing a precomposed character, such as the ligature "Æ" (U+00C6), it might be considered equivalent to any occurrence of its components in the correct sequence, such as "AE" (U+0041, U+0045), depending on the culture. To perform an ordinal (culture-insensitive) search, where a character is considered equivalent to another character only if the Unicode values are the same, you should call one of the overloads that has a parameter of type and use the value. Overloads of that search for a character perform an ordinal search, whereas those that search for a string perform a culture-sensitive search. > [!NOTE] > When possible, you should call string comparison methods that have a parameter of type to specify the kind of comparison expected. As a general rule, use linguistic options (using the current culture) for comparing strings displayed in the user interface and specify or for security comparisons. @@ -2677,7 +2677,7 @@ This method has greater overhead than other and are searching in different portions of the string, even with the same `startIndex` parameter. + The following example determines the indexes of the first and last occurrences of a character or a substring within a portion of a string. Note that and are searching in different portions of the string, even with the same `startIndex` parameter. :::code language="csharp" source="~/snippets/csharp/System.Globalization/CompareInfo/IndexOf/indexofint.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/CompareInfo/IndexOf/indexofint.vb" id="Snippet1"::: @@ -2888,7 +2888,7 @@ This method has greater overhead than other and values are not valid for this method. - If `options` does not include the value, this overload performs a culture-sensitive search. If the character is a Unicode value representing a precomposed character, such as the ligature "Æ" (U+00C6), it might be considered equivalent to any occurrence of its components in the correct sequence, such as "AE" (U+0041, U+0045), depending on the culture. If `options` includes the value, this overload performs an ordinal (culture-insensitive) search. A character is considered equivalent to another character only if the Unicode values are the same. Overloads of that search for a character perform an ordinal search, whereas those that search for a string perform a culture-sensitive search. + If `options` does not include the value, this overload performs a culture-sensitive search. If the character is a Unicode value representing a precomposed character, such as the ligature "Æ" (U+00C6), it might be considered equivalent to any occurrence of its components in the correct sequence, such as "AE" (U+0041, U+0045), depending on the culture. If `options` includes the value, this overload performs an ordinal (culture-insensitive) search. A character is considered equivalent to another character only if the Unicode values are the same. Overloads of that search for a character perform an ordinal search, whereas those that search for a string perform a culture-sensitive search. > [!NOTE] > When possible, you should call string comparison methods that have a parameter of type to specify the kind of comparison expected. As a general rule, use linguistic options (using the current culture) for comparing strings displayed in the user interface and specify or for security comparisons. @@ -3928,7 +3928,7 @@ This method has greater overhead than other and use the value. Overloads of that search for a character perform an ordinal search, whereas those that search for a string perform a culture-sensitive search. + This overload performs a culture-sensitive search. If the character is a Unicode value representing a precomposed character, such as the ligature "Æ" (U+00C6), it might be considered equivalent to any occurrence of its components in the correct sequence, such as "AE" (U+0041, U+0045), depending on the culture. To perform an ordinal (culture-insensitive) search, where a character is considered equivalent to another character only if the Unicode values are the same, you should call one of the overloads that has a parameter of type and use the value. Overloads of that search for a character perform an ordinal search, whereas those that search for a string perform a culture-sensitive search. > [!NOTE] > When possible, you should call string comparison methods that have a parameter of type to specify the kind of comparison expected. As a general rule, use linguistic options (using the current culture) for comparing strings displayed in the user interface and specify or for security comparisons. @@ -4206,7 +4206,7 @@ This method has greater overhead than other and values are not valid for this method. - If `options` does not include the value, this overload performs a culture-sensitive search. If the character is a Unicode value representing a precomposed character, such as the ligature "Æ" (U+00C6), it might be considered equivalent to any occurrence of its components in the correct sequence, such as "AE" (U+0041, U+0045), depending on the culture. If `options` includes the value, this overload performs an ordinal (culture-insensitive) search. A character is considered equivalent to another character only if the Unicode values are the same. Overloads of that search for a character perform an ordinal search, whereas those that search for a string perform a culture-sensitive search. + If `options` does not include the value, this overload performs a culture-sensitive search. If the character is a Unicode value representing a precomposed character, such as the ligature "Æ" (U+00C6), it might be considered equivalent to any occurrence of its components in the correct sequence, such as "AE" (U+0041, U+0045), depending on the culture. If `options` includes the value, this overload performs an ordinal (culture-insensitive) search. A character is considered equivalent to another character only if the Unicode values are the same. Overloads of that search for a character perform an ordinal search, whereas those that search for a string perform a culture-sensitive search. > [!NOTE] > When possible, you should call string comparison methods that have a parameter of type to specify the kind of comparison expected. As a general rule, use linguistic options (using the current culture) for comparing strings displayed in the user interface and specify or for security comparisons. @@ -4296,7 +4296,7 @@ This method has greater overhead than other and use the value. Overloads of that search for a character perform an ordinal search, whereas those that search for a string perform a culture-sensitive search. + This overload performs a culture-sensitive search. If the character is a Unicode value representing a precomposed character, such as the ligature "Æ" (U+00C6), it might be considered equivalent to any occurrence of its components in the correct sequence, such as "AE" (U+0041, U+0045), depending on the culture. To perform an ordinal (culture-insensitive) search, where a character is considered equivalent to another character only if the Unicode values are the same, you should call one of the overloads that has a parameter of type and use the value. Overloads of that search for a character perform an ordinal search, whereas those that search for a string perform a culture-sensitive search. > [!NOTE] > When possible, you should call string comparison methods that have a parameter of type to specify the kind of comparison expected. As a general rule, use linguistic options (using the current culture) for comparing strings displayed in the user interface and specify or for security comparisons. @@ -4304,7 +4304,7 @@ This method has greater overhead than other and are searching in different portions of the string, even with the same `startIndex` parameter. + The following example determines the indexes of the first and last occurrences of a character or a substring within a portion of a string. Note that and are searching in different portions of the string, even with the same `startIndex` parameter. :::code language="csharp" source="~/snippets/csharp/System.Globalization/CompareInfo/IndexOf/indexofint.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/CompareInfo/IndexOf/indexofint.vb" id="Snippet1"::: @@ -4497,7 +4497,7 @@ This method has greater overhead than other and are searching in different portions of the string, even with the same `startIndex` parameter. + The following example determines the indexes of the first and last occurrences of a character or a substring within a portion of a string. Note that and are searching in different portions of the string, even with the same `startIndex` parameter. :::code language="csharp" source="~/snippets/csharp/System.Globalization/CompareInfo/IndexOf/indexofint.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/CompareInfo/IndexOf/indexofint.vb" id="Snippet1"::: @@ -4569,7 +4569,7 @@ This method has greater overhead than other overloads that don't take a `matchLength` argument. Call this overload only if you require the match length information. +This method has greater overhead than other overloads that don't take a `matchLength` argument. Call this overload only if you require the match length information. ]]> @@ -4644,7 +4644,7 @@ This method has greater overhead than other and values are not valid for this method. - If `options` does not include the value, this overload performs a culture-sensitive search. If the character is a Unicode value representing a precomposed character, such as the ligature "Æ" (U+00C6), it might be considered equivalent to any occurrence of its components in the correct sequence, such as "AE" (U+0041, U+0045), depending on the culture. If `options` includes the value, this overload performs an ordinal (culture-insensitive) search. A character is considered equivalent to another character only if the Unicode values are the same. Overloads of that search for a character perform an ordinal search, whereas those that search for a string perform a culture-sensitive search. + If `options` does not include the value, this overload performs a culture-sensitive search. If the character is a Unicode value representing a precomposed character, such as the ligature "Æ" (U+00C6), it might be considered equivalent to any occurrence of its components in the correct sequence, such as "AE" (U+0041, U+0045), depending on the culture. If `options` includes the value, this overload performs an ordinal (culture-insensitive) search. A character is considered equivalent to another character only if the Unicode values are the same. Overloads of that search for a character perform an ordinal search, whereas those that search for a string perform a culture-sensitive search. > [!NOTE] > When possible, you should call string comparison methods that have a parameter of type to specify the kind of comparison expected. As a general rule, use linguistic options (using the current culture) for comparing strings displayed in the user interface and specify or for security comparisons. @@ -4652,7 +4652,7 @@ This method has greater overhead than other and are searching in different portions of the string, even with the same `startIndex` parameter. + The following example determines the indexes of the first and last occurrences of a character or a substring within a portion of a string. Note that and are searching in different portions of the string, even with the same `startIndex` parameter. :::code language="csharp" source="~/snippets/csharp/System.Globalization/CompareInfo/IndexOf/indexofint.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/CompareInfo/IndexOf/indexofint.vb" id="Snippet1"::: @@ -4740,7 +4740,7 @@ This method has greater overhead than other and use the value. Overloads of that search for a character perform an ordinal search, whereas those that search for a string perform a culture-sensitive search. + This overload performs a culture-sensitive search. If the character is a Unicode value representing a precomposed character, such as the ligature "Æ" (U+00C6), it might be considered equivalent to any occurrence of its components in the correct sequence, such as "AE" (U+0041, U+0045), depending on the culture. To perform an ordinal (culture-insensitive) search, where a character is considered equivalent to another character only if the Unicode values are the same, you should call one of the overloads that has a parameter of type and use the value. Overloads of that search for a character perform an ordinal search, whereas those that search for a string perform a culture-sensitive search. > [!NOTE] > When possible, you should call string comparison methods that have a parameter of type to specify the kind of comparison expected. As a general rule, use linguistic options (using the current culture) for comparing strings displayed in the user interface and specify or for security comparisons. @@ -4851,7 +4851,7 @@ This method has greater overhead than other and are searching in different portions of the string, even with the same `startIndex` parameter. + The following example determines the indexes of the first and last occurrences of a character or a substring within a portion of a string. Note that and are searching in different portions of the string, even with the same `startIndex` parameter. :::code language="csharp" source="~/snippets/csharp/System.Globalization/CompareInfo/IndexOf/indexofint.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/CompareInfo/IndexOf/indexofint.vb" id="Snippet1"::: @@ -5062,7 +5062,7 @@ This method has greater overhead than other and values are not valid for this method. - If `options` does not include the value, this overload performs a culture-sensitive search. If the character is a Unicode value representing a precomposed character, such as the ligature "Æ" (U+00C6), it might be considered equivalent to any occurrence of its components in the correct sequence, such as "AE" (U+0041, U+0045), depending on the culture. If `options` includes the value, this overload performs an ordinal (culture-insensitive) search. A character is considered equivalent to another character only if the Unicode values are the same. Overloads of that search for a character perform an ordinal search, whereas those that search for a string perform a culture-sensitive search. + If `options` does not include the value, this overload performs a culture-sensitive search. If the character is a Unicode value representing a precomposed character, such as the ligature "Æ" (U+00C6), it might be considered equivalent to any occurrence of its components in the correct sequence, such as "AE" (U+0041, U+0045), depending on the culture. If `options` includes the value, this overload performs an ordinal (culture-insensitive) search. A character is considered equivalent to another character only if the Unicode values are the same. Overloads of that search for a character perform an ordinal search, whereas those that search for a string perform a culture-sensitive search. > [!NOTE] > When possible, you should call string comparison methods that have a parameter of type to specify the kind of comparison expected. As a general rule, use linguistic options (using the current culture) for comparing strings displayed in the user interface and specify or for security comparisons. @@ -5331,7 +5331,7 @@ This method has greater overhead than other and properties can have different values. For example, an property value of hexadecimal 0x10407 identifies an alternate sort culture that sorts names as they might appear in a German telephone book. The property has a value of "de-de_phoneb", whereas the property of the associated German (Germany) culture has a value of "de-DE". + The and properties can have different values. For example, an property value of hexadecimal 0x10407 identifies an alternate sort culture that sorts names as they might appear in a German telephone book. The property has a value of "de-de_phoneb", whereas the property of the associated German (Germany) culture has a value of "de-DE". @@ -5397,7 +5397,7 @@ This method has greater overhead than other object is cast to an interface. For more information, see the method. + This member is an explicit interface member implementation that can be used only when the current object is cast to an interface. For more information, see the method. ]]> @@ -5453,7 +5453,7 @@ This method has greater overhead than other method. It returns a string that consists of the class name and the value of the instance property, separated by a hyphen. + This method overrides the method. It returns a string that consists of the class name and the value of the instance property, separated by a hyphen. ]]> diff --git a/xml/System.Globalization/CultureAndRegionInfoBuilder.xml b/xml/System.Globalization/CultureAndRegionInfoBuilder.xml index 3f8c3e9e9c6..52f7779ebf7 100644 --- a/xml/System.Globalization/CultureAndRegionInfoBuilder.xml +++ b/xml/System.Globalization/CultureAndRegionInfoBuilder.xml @@ -187,7 +187,7 @@ The following code example creates a custom culture with a private use prefix, t ## Remarks The property corresponds to the property. - The and objects that are assigned to the and properties both support culture-sensitive and case-sensitive string comparison. The object also has methods that include a parameter that supports culture-sensitive, case-insensitive comparison. These two properties should be assigned and objects that represent the same locale. + The and objects that are assigned to the and properties both support culture-sensitive and case-sensitive string comparison. The object also has methods that include a parameter that supports culture-sensitive, case-insensitive comparison. These two properties should be assigned and objects that represent the same locale. ]]> @@ -219,7 +219,7 @@ The following code example creates a custom culture with a private use prefix, t property corresponds to the method. Specify `null` in a set operation to indicate that the culture defined by the current object is the alternate user interface culture. If you attempt to set the property to a culture that itself has a different Console Fallback UI Culture, then it will be assigned that final "leaf" culture. + In a get operation, the property corresponds to the method. Specify `null` in a set operation to indicate that the culture defined by the current object is the alternate user interface culture. If you attempt to set the property to a culture that itself has a different Console Fallback UI Culture, then it will be assigned that final "leaf" culture. Languages such as Arabic, Hebrew, Persian, Urdu and Syriac are based on bi-directional text. Windows applications, which employ a graphical user interface, support bi-directional languages. However, console applications, which employ the text user interface of the operating system console, do not provide bi-directional support. Consequently, if a console application is localized to Arabic or Hebrew, it displays unreadable text on the console screen. @@ -257,7 +257,7 @@ The following code example creates a custom culture with a private use prefix, t object. The format of the XML file is called Locale Data Markup Language (LDML) version 1.1. A new object is created and initialized with the data in `xmlFileName`. The method performs the reverse operation of the method. + The `xmlFileName` parameter specifies a file name that contains the XML representation of a object. The format of the XML file is called Locale Data Markup Language (LDML) version 1.1. A new object is created and initialized with the data in `xmlFileName`. The method performs the reverse operation of the method. In the LDML file, the properties of a culture are specified as child elements of the `` element in the `` section. A property value is typically specified by the element's `type` attribute. For example, the following excerpt from an LDML file defines a culture's parent as the English neutral culture. @@ -278,7 +278,7 @@ The following code example creates a custom culture with a private use prefix, t ## Examples - The following example demonstrates the and methods. + The following example demonstrates the and methods. :::code language="csharp" source="~/snippets/csharp/System.Globalization/CultureAndRegionInfoBuilder/CreateFromLdml/sl.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/CultureAndRegionInfoBuilder/CreateFromLdml/sl.vb" id="Snippet1"::: @@ -364,7 +364,7 @@ The following code example creates a custom culture with a private use prefix, t constructor. If the specified culture name is the same as an existing culture, except for case, the return value is the name of the existing culture, not the specified culture name. + The return value is the name of the culture specified in the constructor. If the specified culture name is the same as an existing culture, except for case, the return value is the name of the existing culture, not the specified culture name. The property corresponds to the property. @@ -850,7 +850,7 @@ The following code example creates a custom culture with a private use prefix, t Your application should call this property only for specific cultures. - The , , , and properties of are ignored. The saved form of a culture does not save explicit values for these properties. Instead, when the culture is loaded, they always default to , , , and , respectively. + The , , , and properties of are ignored. The saved form of a culture does not save explicit values for these properties. Instead, when the culture is loaded, they always default to , , , and , respectively. ]]> @@ -882,13 +882,13 @@ The following code example creates a custom culture with a private use prefix, t . The parent culture encompasses only the set of information that is common among its children. + The cultures have a hierarchy. For predefined cultures, the parent of a specific culture is a neutral culture and the parent of a neutral culture is the . The parent culture encompasses only the set of information that is common among its children. - It is generally recommended that custom cultures conform to this hierarchy. However, by default, the of a custom culture is the of the culture on which it is based. If the application creates a culture with "en-US-MyCulture" based on "en-US", its parent is "en" because that is the of "en-US". If the application uses "en-US" as the of the new custom culture, it must set this value explicitly. + It is generally recommended that custom cultures conform to this hierarchy. However, by default, the of a custom culture is the of the culture on which it is based. If the application creates a culture with "en-US-MyCulture" based on "en-US", its parent is "en" because that is the of "en-US". If the application uses "en-US" as the of the new custom culture, it must set this value explicitly. If the resources for the specific culture are not available in the system, the resources for the neutral culture are used. If the resources for the neutral culture are not available, the resources embedded in the main assembly are used. For more information about the resource fallback process, see [Packaging and Deploying Resources](/dotnet/framework/resources/packaging-and-deploying-resources-in-desktop-apps). - The list of cultures in the Windows API is slightly different from the list of cultures in the .NET Framework. If interoperability with Windows is required, for example, through the platform invoke mechanism, the application should use a specific culture that is defined in the .NET Framework. This ensures consistency with the equivalent Windows locale, which is identified with the same . + The list of cultures in the Windows API is slightly different from the list of cultures in the .NET Framework. If interoperability with Windows is required, for example, through the platform invoke mechanism, the application should use a specific culture that is defined in the .NET Framework. This ensures consistency with the equivalent Windows locale, which is identified with the same . ]]> @@ -926,7 +926,7 @@ The following code example creates a custom culture with a private use prefix, t ## Remarks The property corresponds to the property. - For example, the return value of for the United States is "United States". + For example, the return value of for the United States is "United States". ]]> @@ -958,7 +958,7 @@ The following code example creates a custom culture with a private use prefix, t constructor. If the specified culture name is the same as an existing culture, except for case, the return value is the name of the existing culture, not the specified culture name. + The return value is the name of the culture specified in the constructor. If the specified culture name is the same as an existing culture, except for case, the return value is the name of the existing culture, not the specified culture name. The property corresponds to the property. @@ -1022,14 +1022,14 @@ The following code example creates a custom culture with a private use prefix, t method stores a custom culture as a file on the local computer, in the Globalization subdirectory of the directory returned by the Win32 [GetWindowsDirectory](https://go.microsoft.com/fwlink/?LinkId=191561) function. This process is called registering the custom culture. After the custom culture is registered, a new custom culture can be created by specifying the culture name in a constructor or when calling the method. + The method stores a custom culture as a file on the local computer, in the Globalization subdirectory of the directory returned by the Win32 [GetWindowsDirectory](https://go.microsoft.com/fwlink/?LinkId=191561) function. This process is called registering the custom culture. After the custom culture is registered, a new custom culture can be created by specifying the culture name in a constructor or when calling the method. - The custom culture can be removed by calling the method. + The custom culture can be removed by calling the method. ## Examples - The following example demonstrates the method. + The following example demonstrates the method. :::code language="csharp" source="~/snippets/csharp/System.Globalization/CultureAndRegionInfoBuilder/Register/persist.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/CultureAndRegionInfoBuilder/Register/persist.vb" id="Snippet1"::: @@ -1076,14 +1076,14 @@ The following code example creates a custom culture with a private use prefix, t method writes the current object to the file specified by the `filename` parameter in an XML format called Locale Data Markup Language (LDML) version 1.1. The method performs the reverse operation of the method. + The method writes the current object to the file specified by the `filename` parameter in an XML format called Locale Data Markup Language (LDML) version 1.1. The method performs the reverse operation of the method. - For information about the format of an LDML file, see the method. For information about the LDML standard, see [Unicode Technical Standard #35, "Locale Data Markup Language (LDML)"](https://go.microsoft.com/fwlink/p/?LinkId=252840) on the Unicode Consortium website. + For information about the format of an LDML file, see the method. For information about the LDML standard, see [Unicode Technical Standard #35, "Locale Data Markup Language (LDML)"](https://go.microsoft.com/fwlink/p/?LinkId=252840) on the Unicode Consortium website. ## Examples - The following example demonstrates the and methods. + The following example demonstrates the and methods. :::code language="csharp" source="~/snippets/csharp/System.Globalization/CultureAndRegionInfoBuilder/CreateFromLdml/sl.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/CultureAndRegionInfoBuilder/CreateFromLdml/sl.vb" id="Snippet1"::: @@ -1123,7 +1123,7 @@ The following code example creates a custom culture with a private use prefix, t ## Remarks The property provides culture-specific casing information for strings. It corresponds to the property. - The and objects that are assigned to the and properties both support culture-sensitive and case-sensitive string comparison. The object also has methods that include a parameter that supports culture-sensitive, case-insensitive comparison. These two properties should be assigned and objects that represent the same locale. + The and objects that are assigned to the and properties both support culture-sensitive and case-sensitive string comparison. The object also has methods that include a parameter that supports culture-sensitive, case-insensitive comparison. These two properties should be assigned and objects that represent the same locale. ]]> @@ -1194,7 +1194,7 @@ The following code example creates a custom culture with a private use prefix, t The property contains one of the three-letter codes defined in ISO 3166 for country/region. For example, the three-letter code for United States is "USA". - Case is not significant. However, the , , and the properties contain the appropriate code in uppercase. + Case is not significant. However, the , , and the properties contain the appropriate code in uppercase. The predefined country/region names are listed in the class topic. @@ -1370,12 +1370,12 @@ The following code example creates a custom culture with a private use prefix, t method does the reverse of the method. The method stores a custom culture as a file on the local computer, in the Globalization subdirectory of the directory returned by the Windows API [GetWindowsDirectory](https://go.microsoft.com/fwlink/?LinkId=191561) function. The method deletes the persisted custom culture file from the computer. After the file is deleted, existing instances of the custom culture in computer memory continue to work, but new instances of the custom culture cannot be created. + The method does the reverse of the method. The method stores a custom culture as a file on the local computer, in the Globalization subdirectory of the directory returned by the Windows API [GetWindowsDirectory](https://go.microsoft.com/fwlink/?LinkId=191561) function. The method deletes the persisted custom culture file from the computer. After the file is deleted, existing instances of the custom culture in computer memory continue to work, but new instances of the custom culture cannot be created. ## Examples - The following example demonstrates the method. + The following example demonstrates the method. :::code language="csharp" source="~/snippets/csharp/System.Globalization/CultureAndRegionInfoBuilder/Unregister/unregister.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/CultureAndRegionInfoBuilder/Unregister/unregister.vb" id="Snippet1"::: diff --git a/xml/System.Globalization/CultureAndRegionModifiers.xml b/xml/System.Globalization/CultureAndRegionModifiers.xml index 9b85a4f3be7..2e32de772f5 100644 --- a/xml/System.Globalization/CultureAndRegionModifiers.xml +++ b/xml/System.Globalization/CultureAndRegionModifiers.xml @@ -25,7 +25,7 @@ values as an argument to the constructor. You use the resulting object to create a custom culture. + Specify a bitwise combination of one or more values as an argument to the constructor. You use the resulting object to create a custom culture. A custom culture can have a combination of these characteristics: diff --git a/xml/System.Globalization/CultureInfo.xml b/xml/System.Globalization/CultureInfo.xml index f9d74fd6e1f..b872e805104 100644 --- a/xml/System.Globalization/CultureInfo.xml +++ b/xml/System.Globalization/CultureInfo.xml @@ -170,9 +170,9 @@ Predefined culture identifiers for cultures available on Windows system are list In most cases, the `culture` parameter is mapped to the corresponding National Language Support (NLS) locale identifier. The value of the `culture` parameter becomes the value of the property of the new . - We recommend that you call the locale name constructor , because locale names are preferable to LCIDs. For custom locales, a locale name is required. + We recommend that you call the locale name constructor , because locale names are preferable to LCIDs. For custom locales, a locale name is required. - The user might choose to override some of the values associated with the current culture of Windows through the regional and language options portion of Control Panel. For example, the user might choose to display the date in a different format or to use a currency other than the default for the culture. If the specified culture identifier matches the culture identifier of the current Windows culture, this constructor creates a that uses those overrides, including user settings for the properties of the instance returned by the property, and the properties of the instance returned by the property. If the user settings are incompatible with the culture associated with the (for example, if the selected calendar is not one of the ) the results of the methods and the values of the properties are undefined. + The user might choose to override some of the values associated with the current culture of Windows through the regional and language options portion of Control Panel. For example, the user might choose to display the date in a different format or to use a currency other than the default for the culture. If the specified culture identifier matches the culture identifier of the current Windows culture, this constructor creates a that uses those overrides, including user settings for the properties of the instance returned by the property, and the properties of the instance returned by the property. If the user settings are incompatible with the culture associated with the (for example, if the selected calendar is not one of the ) the results of the methods and the values of the properties are undefined. If the specified culture identifier does not match the identifier of the current Windows culture, this constructor creates a that uses the default values for the specified culture. @@ -180,9 +180,9 @@ Predefined culture identifiers for cultures available on Windows system are list For example, suppose that Arabic (Saudi Arabia) is the current Windows culture and the user has changed the calendar from Hijri to Gregorian. -- With `CultureInfo("0x0401")` (culture name ar-SA), is set to (which is the user setting) and is set to `true`. +- With `CultureInfo("0x0401")` (culture name ar-SA), is set to (which is the user setting) and is set to `true`. -- With `CultureInfo("0x041E")` (culture name th-TH), is set to (which is the default calendar for th-TH) and is set to `true`. +- With `CultureInfo("0x041E")` (culture name th-TH), is set to (which is the default calendar for th-TH) and is set to `true`. For cultures that use the euro, .NET Framework and Windows XP set the default currency as euro. However, older versions of Windows do not. Therefore, if the user of an older version of Windows has not changed the currency setting through the regional and language options portion of Control Panel, the currency might be incorrect. To use the .NET Framework default setting for the currency, the application should use a constructor overload that accepts a `useUserOverride` parameter and set it to `false`. @@ -269,7 +269,7 @@ For a list of predefined culture names on Windows systems, see the **Language ta If `name` is , the constructor creates an instance of the invariant culture; this is equivalent to retrieving the value of the property. - The user might choose to override some of the values associated with the current culture of Windows through the regional and language options portion of Control Panel. For example, the user might choose to display the date in a different format or to use a currency other than the default for the culture. If the culture identifier associated with `name` matches the culture identifier of the current Windows culture, this constructor creates a object that uses those overrides, including user settings for the properties of the instance returned by the property, and the properties of the instance returned by the property. If the user settings are incompatible with the culture associated with the , for example, if the selected calendar is not one of the , the results of the methods and the values of the properties are undefined. + The user might choose to override some of the values associated with the current culture of Windows through the regional and language options portion of Control Panel. For example, the user might choose to display the date in a different format or to use a currency other than the default for the culture. If the culture identifier associated with `name` matches the culture identifier of the current Windows culture, this constructor creates a object that uses those overrides, including user settings for the properties of the instance returned by the property, and the properties of the instance returned by the property. If the user settings are incompatible with the culture associated with the , for example, if the selected calendar is not one of the , the results of the methods and the values of the properties are undefined. If the culture identifier associated with `name` does not match the culture identifier of the current Windows culture, this constructor creates a object that uses the default values for the specified culture. @@ -277,13 +277,13 @@ For a list of predefined culture names on Windows systems, see the **Language ta For example, suppose that Arabic (Saudi Arabia) is the current culture of Windows and the user changed the calendar from Hijri to Gregorian: -- With `CultureInfo("ar-SA")`, is set to (which is the user setting) and is set to `true`. -- With `CultureInfo("th-TH")`, is set to (which is the default calendar for th-TH) and is set to `true`. +- With `CultureInfo("ar-SA")`, is set to (which is the user setting) and is set to `true`. +- With `CultureInfo("th-TH")`, is set to (which is the default calendar for th-TH) and is set to `true`. The property of the new is set to the culture identifier associated with the specified name. ## Examples - The following example retrieves the current culture. If it is anything other than the French (France) culture, it calls the constructor to instantiate a object that represents the French (France) culture and makes it the current culture. Otherwise, it instantiates a object that represents the French (Luxembourg) culture and makes it the current culture. + The following example retrieves the current culture. If it is anything other than the French (France) culture, it calls the constructor to instantiate a object that represents the French (France) culture and makes it the current culture. Otherwise, it instantiates a object that represents the French (Luxembourg) culture and makes it the current culture. :::code language="csharp" source="~/snippets/csharp/System.Globalization/CultureInfo/Overview/Change1.cs" id="Snippet3"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/CultureInfo/.ctor/Change1.vb" id="Snippet3"::: @@ -357,13 +357,13 @@ Predefined culture identifiers available on Windows systems are listed in the ** In most cases, the `culture` parameter is mapped to the corresponding National Language Support (NLS) locale identifier. The value of the `culture` parameter becomes the value of the property of the new . - We recommend that you call the locale name constructor , because locale names are preferable to LCIDs. For custom locales, a locale name is required. + We recommend that you call the locale name constructor , because locale names are preferable to LCIDs. For custom locales, a locale name is required. The user might choose to override some of the values associated with the current culture of Windows through the regional and language options portion of Control Panel. For example, the user might choose to display the date in a different format or to use a currency other than the default for the culture. Applications should typically not disallow user overrides. Disallowing overrides does not itself guarantee data stability. For more information, see the blog entry [Culture data shouldn't be considered stable (except for Invariant)](/archive/blogs/shawnste/culture-data-shouldnt-be-considered-stable-except-for-invariant). - If the property is set to `true` and the specified culture identifier matches the identifier of the current Windows culture, this constructor creates a that uses those overrides, including user settings for the properties of the instance returned by the property, and the properties of the instance returned by the property. If the user settings are incompatible with the culture associated with the , for example, if the selected calendar is not one of the , the results of the methods and the values of the properties are undefined. + If the property is set to `true` and the specified culture identifier matches the identifier of the current Windows culture, this constructor creates a that uses those overrides, including user settings for the properties of the instance returned by the property, and the properties of the instance returned by the property. If the user settings are incompatible with the culture associated with the , for example, if the selected calendar is not one of the , the results of the methods and the values of the properties are undefined. Otherwise, this constructor creates a that uses the default values for the specified culture. @@ -371,13 +371,13 @@ Predefined culture identifiers available on Windows systems are listed in the ** For example, suppose that Arabic (Saudi Arabia) is the current culture of Windows and the user has changed the calendar from Hijri to Gregorian. -- With `CultureInfo("0x0401", true)` (culture name ar-SA), is set to (which is the user setting) and is set to `true`. +- With `CultureInfo("0x0401", true)` (culture name ar-SA), is set to (which is the user setting) and is set to `true`. -- With `CultureInfo("0x0401", false)` (culture name ar-SA), is set to (which is the default calendar for ar-SA) and is set to `false`. +- With `CultureInfo("0x0401", false)` (culture name ar-SA), is set to (which is the default calendar for ar-SA) and is set to `false`. -- With `CultureInfo("0x041E", true)` (culture name th-TH), is set to (which is the default calendar for th-TH) and is set to `true`. +- With `CultureInfo("0x041E", true)` (culture name th-TH), is set to (which is the default calendar for th-TH) and is set to `true`. -- With `CultureInfo("0x041E", false)` (culture name th-TH), is set to (which is the default calendar for th-TH) and is set to `false`. +- With `CultureInfo("0x041E", false)` (culture name th-TH), is set to (which is the default calendar for th-TH) and is set to `false`. For cultures that use the euro, the .NET Framework and Windows XP set the default currency as euro. However, older versions of Windows do not. Therefore, if the user of an older version of Windows has not changed the currency setting through the regional and language options portion of Control Panel, the currency might be incorrect. To use the .NET Framework default setting for the currency, the application should set the `useUserOverride` parameter to `false`. @@ -459,7 +459,7 @@ If `name` is , the constr Applications should typically not disallow user overrides. Disallowing overrides does not itself guarantee data stability. For more information, see the blog entry [Culture data shouldn't be considered stable (except for Invariant)](/archive/blogs/shawnste/culture-data-shouldnt-be-considered-stable-except-for-invariant). - If the property is set to `true` and the culture identifier associated with the specified culture name matches the culture identifier of the current Windows culture, this constructor creates a that uses those overrides, including user settings for the properties of the instance returned by the property, and the properties of the instance returned by the property. If the user settings are incompatible with the culture associated with the , for example, if the selected calendar is not one of the , the results of the methods and the values of the properties are undefined. + If the property is set to `true` and the culture identifier associated with the specified culture name matches the culture identifier of the current Windows culture, this constructor creates a that uses those overrides, including user settings for the properties of the instance returned by the property, and the properties of the instance returned by the property. If the user settings are incompatible with the culture associated with the , for example, if the selected calendar is not one of the , the results of the methods and the values of the properties are undefined. Otherwise, this constructor creates a that uses the default values for the specified culture. @@ -467,13 +467,13 @@ If `name` is , the constr For example, suppose that Arabic (Saudi Arabia) is the current culture of Windows and the user changed the calendar from Hijri to Gregorian. -- With `CultureInfo("ar-SA", true)`, is set to (which is the user setting) and is set to `true`. +- With `CultureInfo("ar-SA", true)`, is set to (which is the user setting) and is set to `true`. -- With `CultureInfo("ar-SA", false)`, is set to (which is the default calendar for ar-SA) and is set to `false`. +- With `CultureInfo("ar-SA", false)`, is set to (which is the default calendar for ar-SA) and is set to `false`. -- With `CultureInfo("th-TH", true)`, is set to (which is the default calendar for th-TH) and is set to `true`. +- With `CultureInfo("th-TH", true)`, is set to (which is the default calendar for th-TH) and is set to `true`. -- With `CultureInfo("th-TH", false)`, is set to (which is the default calendar for th-TH) and is set to `false`. +- With `CultureInfo("th-TH", false)`, is set to (which is the default calendar for th-TH) and is set to `false`. The property of the new is set to the culture identifier associated with the specified name. @@ -550,11 +550,11 @@ If `name` is , the constr ## Remarks The user might choose to override some of the values associated with the current culture of Windows through the regional and language options portion of Control Panel. For example, the user might choose to display the date in a different format or to use a currency other than the default for the culture. - If is `true` and the specified culture matches the current culture of Windows, the uses those overrides, including user settings for the properties of the instance returned by the property, and the properties of the instance returned by the property. If the user settings are incompatible with the culture associated with the , for example, if the selected calendar is not one of the , the results of the methods and the values of the properties are undefined. + If is `true` and the specified culture matches the current culture of Windows, the uses those overrides, including user settings for the properties of the instance returned by the property, and the properties of the instance returned by the property. If the user settings are incompatible with the culture associated with the , for example, if the selected calendar is not one of the , the results of the methods and the values of the properties are undefined. - Therefore, if is `true`, the value of this property might be different from the default calendar used by the culture. + Therefore, if is `true`, the value of this property might be different from the default calendar used by the culture. - Your application changes the calendar used by the current by setting the property of , which is an instance of the class. The new calendar must be one of the calendars listed in . also includes other properties that customize the date and time formatting associated with that . + Your application changes the calendar used by the current by setting the property of , which is an instance of the class. The new calendar must be one of the calendars listed in . also includes other properties that customize the date and time formatting associated with that . ]]> @@ -611,9 +611,9 @@ If `name` is , the constr ## Remarks Information, such as the default culture and format patterns, is cached the first time it is requested. That information can change during the life of the , for example, when the user modifies the regional and language options portion of Control Panel. However, the class does not automatically detect changes in the system settings. - The method clears the cache of objects created by and refreshes the information in the , , and properties, based on the current system settings. + The method clears the cache of objects created by and refreshes the information in the , , and properties, based on the current system settings. - The method does not refresh the information in the property for existing threads. However, future threads will have any new property values. + The method does not refresh the information in the property for existing threads. However, future threads will have any new property values. ]]> @@ -681,7 +681,7 @@ If `name` is , the constr A shallow copy of an object is a copy of the object only. If the object contains references to other objects, the shallow copy does not create copies of the referred objects. It refers to the original objects instead. In contrast, a deep copy of an object creates a copy of the object and a copy of everything directly or indirectly referenced by that object. - The method creates an enhanced shallow copy. The objects returned by the , , , and properties are also copied. Consequently, the cloned object can modify its copied properties without affecting the original object. + The method creates an enhanced shallow copy. The objects returned by the , , , and properties are also copied. Consequently, the cloned object can modify its copied properties without affecting the original object. ## Examples The following code example shows that CultureInfo.Clone also clones the and instances associated with the . @@ -746,7 +746,7 @@ If `name` is , the constr The user might choose to override some of the values associated with the current culture of Windows through the regional and language options portion of Control Panel. For example, the user might choose to display the date in a different format or to use a currency other than the default for the culture. - If is `true` and the specified culture matches the current culture of Windows, the uses those overrides, including user settings for the properties of the instance returned by the property, and the properties of the instance returned by the property. If the user settings are incompatible with the culture associated with the , for example, if the selected calendar is not one of the , the results of the methods and the values of the properties are undefined. + If is `true` and the specified culture matches the current culture of Windows, the uses those overrides, including user settings for the properties of the instance returned by the property, and the properties of the instance returned by the property. If the user settings are incompatible with the culture associated with the , for example, if the selected calendar is not one of the , the results of the methods and the values of the properties are undefined. ## Examples The following code example shows how to create a for Spanish (Spain) with the international sort and another with the traditional sort. @@ -819,19 +819,19 @@ If `name` is , the constr method wraps a call to the constructor. + The method wraps a call to the constructor. > [!NOTE] > For a list of predefined culture names on Windows systems, see the **Language tag** column in the [list of language/region names supported by Windows](https://learn.microsoft.com/openspecs/windows_protocols/ms-lcid/a9eac961-e77d-41a6-90a5-ce1a8b0cdb9c). Culture names follow the standard defined by [BCP 47](https://tools.ietf.org/html/bcp47). In addition, starting with Windows 10, `name` can be any valid BCP-47 language tag. Cultures are grouped into three sets: the invariant culture, the neutral cultures, and the specific cultures. For more information, see the description of the class. - If the culture identifier of the specific culture returned by this method matches the culture identifier of the current Windows culture, this method creates a object that uses the Windows culture overrides. The overrides include user settings for the properties of the object returned by the property and the object returned by the property. To instantiate a object that with default culture settings rather than user overrides, call the constructor with a value of `false` for the `useUserOverride` argument. + If the culture identifier of the specific culture returned by this method matches the culture identifier of the current Windows culture, this method creates a object that uses the Windows culture overrides. The overrides include user settings for the properties of the object returned by the property and the object returned by the property. To instantiate a object that with default culture settings rather than user overrides, call the constructor with a value of `false` for the `useUserOverride` argument. - Although the method name includes the term "Specific", remember that culture data can change between versions, or due to custom cultures, or because of user overrides. Use the invariant culture or binary or fixed forms for saving data. + Although the method name includes the term "Specific", remember that culture data can change between versions, or due to custom cultures, or because of user overrides. Use the invariant culture or binary or fixed forms for saving data. ## Examples - The following example retrieves an array of objects that represent neutral cultures from the method and sorts the array. When it iterates the elements in the array, it passes the name of each neutral culture to the method and displays the name of the specific culture returned by the method. + The following example retrieves an array of objects that represent neutral cultures from the method and sorts the array. When it iterates the elements in the array, it passes the name of each neutral culture to the method and displays the name of the specific culture returned by the method. > [!NOTE] > The example uses the `zh-CHS` and `zh-CHT` culture names. However, applications that target Windows Vista and later should use `zh-Hans` instead of `zh-CHS` and `zh-Hant` instead of zh-CHT. `zh-Hans` and `zh-Hant` represent the current standard and should be used unless you have a reason for using the older names. @@ -977,7 +977,7 @@ If `name` is , the constr For more information about this API, see Supplemental API remarks for CultureInfo.CurrentCulture. and of the current thread. +The following example demonstrates how to change the and of the current thread. :::code language="csharp" source="~/snippets/csharp/System.Globalization/CultureInfo/CurrentCulture/currentculture.cs" id="Snippet11"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/CultureInfo/CurrentCulture/currentculture.vb" id="Snippet11"::: @@ -1051,7 +1051,7 @@ The following example demonstrates how to change the For more information about this API, see Supplemental API remarks for CultureInfo.CurrentUICulture. and of the current thread. +The following code example demonstrates how to change the and of the current thread. :::code language="csharp" source="~/snippets/csharp/System.Globalization/CultureInfo/CurrentCulture/currentculture.cs" id="Snippet11"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/CultureInfo/CurrentCulture/currentculture.vb" id="Snippet11"::: @@ -1121,9 +1121,9 @@ The following code example demonstrates how to change the is `true` and the specified culture matches the current culture of Windows, the uses those overrides, including user settings for the properties of the instance returned by the property, and the properties of the instance returned by the property. If the user settings are incompatible with the culture associated with the , for example, if the selected calendar is not one of the , the results of the methods and the values of the properties are undefined. + If is `true` and the specified culture matches the current culture of Windows, the uses those overrides, including user settings for the properties of the instance returned by the property, and the properties of the instance returned by the property. If the user settings are incompatible with the culture associated with the , for example, if the selected calendar is not one of the , the results of the methods and the values of the properties are undefined. - The value of the property and the property is not calculated until your application accesses the property. If the user can change the current culture to a new culture while the application is running and then the application accesses the or property, the application retrieves the defaults for the new culture instead of the overrides for the original culture. To preserve the overrides for the original current culture, the application should access the and properties before changing the current culture. + The value of the property and the property is not calculated until your application accesses the property. If the user can change the current culture to a new culture while the application is running and then the application accesses the or property, the application retrieves the defaults for the new culture instead of the overrides for the original culture. To preserve the overrides for the original current culture, the application should access the and properties before changing the current culture. ]]> @@ -1221,7 +1221,7 @@ You might choose to override some of the values associated with the current cult As the output from the example shows, when the example is run on a computer whose system culture is English (United States), the main thread displays its currency values using the formatting conventions of the French (France) culture. However, because the worker thread's culture is derived from the current Windows system culture rather than the application's current culture, the work thread displays its currency values using the formatting conventions of the English (United States) culture. - The following example uses the and properties to define the current culture and current UI culture of a new application thread. At startup, the example sets the current culture and the current UI culture to French (France) on all systems except those on which the default system culture is already French (France). If the default system culture is already French (France), it sets the current culture and the current UI culture to English (United States). It then calls the `DisplayRandomNumbers` routine, which generates three random numbers and displays them as currency values. Next, it creates a new thread, which also executes the `DisplayRandomNumbers` routine. + The following example uses the and properties to define the current culture and current UI culture of a new application thread. At startup, the example sets the current culture and the current UI culture to French (France) on all systems except those on which the default system culture is already French (France). If the default system culture is already French (France), it sets the current culture and the current UI culture to English (United States). It then calls the `DisplayRandomNumbers` routine, which generates three random numbers and displays them as currency values. Next, it creates a new thread, which also executes the `DisplayRandomNumbers` routine. :::code language="csharp" source="~/snippets/csharp/System.Globalization/CultureInfo/DefaultThreadCurrentCulture/defaultculture2.cs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/CultureInfo/DefaultThreadCurrentCulture/defaultculture2.vb" id="Snippet2"::: @@ -1352,7 +1352,7 @@ csc /resource:GreetingStrings.resources Example1.cs As the output from the example shows, when the example is run on a computer whose system culture is English (United States), the main thread displays its initial string in Russian. However, because the worker thread's culture is derived from the current Windows system culture rather than the application's current culture, the worker thread displays its string in English. - The following example uses the and properties to define the current culture and current UI culture of a new application thread. + The following example uses the and properties to define the current culture and current UI culture of a new application thread. The example uses the same resources files as the previous example. The commands to compile and to embed the localized Russian language resources into a satellite assembly are also identical, except that the name of the executable assembly changes. @@ -1505,7 +1505,7 @@ csc /resource:GreetingStrings.resources Example1.cs for the specific culture name en-US is "English (United States)". + For example, the for the specific culture name en-US is "English (United States)". The value of this property is the same, regardless of the language version of the .NET Framework. @@ -1591,9 +1591,9 @@ csc /resource:GreetingStrings.resources Example1.cs . + This method overrides . - Two objects are considered equal if their and properties are equal. + Two objects are considered equal if their and properties are equal. ]]> @@ -1658,7 +1658,7 @@ csc /resource:GreetingStrings.resources Example1.cs ## Remarks Languages such as Arabic, Hebrew, Urdu, and Syriac are based on bidirectional text. Windows applications, which have a graphical user interface, support bidirectional languages. However, console applications, which employ the text user interface of the operating system console, do not provide bidirectional support. Therefore, if you localize a console application to Arabic or Hebrew, your application displays unreadable text on the console screen. - The user interface culture specifies the resources an application needs to support user input and output, and by default is the same as the operating system culture. For example, the property returns an Arabic culture for an Arabic operating system. Use the method to retrieve a culture suitable for a console application user interface. After your application retrieves the fallback user interface culture, it should assign the culture to the current user interface culture of the current thread. For more information, see the "Explicitly Setting the Current UI Culture" section of the property. + The user interface culture specifies the resources an application needs to support user input and output, and by default is the same as the operating system culture. For example, the property returns an Arabic culture for an Arabic operating system. Use the method to retrieve a culture suitable for a console application user interface. After your application retrieves the fallback user interface culture, it should assign the culture to the current user interface culture of the current thread. For more information, see the "Explicitly Setting the Current UI Culture" section of the property. The following are predefined cultures that have a different fallback user interface culture name from the predefined culture name. @@ -1821,7 +1821,7 @@ csc /resource:GreetingStrings.resources Example1.cs ), because locale names should be used instead of LCIDs. For custom locales, the locale name is required. + We recommend that you use the string overload of this method (), because locale names should be used instead of LCIDs. For custom locales, the locale name is required. If `culture` is the locale identifier of the current culture, the returned object does not reflect any user overrides. @@ -1894,7 +1894,7 @@ csc /resource:GreetingStrings.resources Example1.cs For a list of predefined culture names on Windows systems, see the **Language tag** column in the [list of language/region names supported by Windows](https://learn.microsoft.com/openspecs/windows_protocols/ms-lcid/a9eac961-e77d-41a6-90a5-ce1a8b0cdb9c). Culture names follow the standard defined by [BCP 47](https://tools.ietf.org/html/bcp47). In addition, starting with Windows 10, `name` can be any valid BCP-47 language tag. - The method retrieves a cached, read-only object. It offers better performance than a corresponding call to the constructor. + The method retrieves a cached, read-only object. It offers better performance than a corresponding call to the constructor. If `name` is the name of the current culture, the returned object does not reflect any user overrides. This makes the method suitable for server applications or tools that do not have a real user account on the system and that need to load multiple cultures efficiently. @@ -2019,7 +2019,7 @@ Setting `predefinedOnly` to `true` will ensure a culture is created only if the ## Remarks For a list of predefined culture names on Windows systems, see the **Language tag** column in the [list of language/region names supported by Windows](https://learn.microsoft.com/openspecs/windows_protocols/ms-lcid/a9eac961-e77d-41a6-90a5-ce1a8b0cdb9c). Culture names follow the standard defined by [BCP 47](https://tools.ietf.org/html/bcp47). In addition, starting with Windows 10, `name` can be any valid BCP-47 language tag. - The method obtains a cached, read-only object. It offers better performance than a corresponding call to a constructor. The method is used to create a culture similar to that specified by the `name` parameter, but with different sorting and casing rules. + The method obtains a cached, read-only object. It offers better performance than a corresponding call to a constructor. The method is used to create a culture similar to that specified by the `name` parameter, but with different sorting and casing rules. If `name` or `altName` is the name of the current culture, the returned objects do not reflect any user overrides. If `name` is , the method returns the invariant culture. This is equivalent to retrieving the value of the property. If `altName` is , the method uses the writing system and comparison rules specified by the invariant culture. @@ -2088,7 +2088,7 @@ Setting `predefinedOnly` to `true` will ensure a culture is created only if the ## Remarks > [!NOTE] -> This method and the property are deprecated. Instead of using these APIs, we recommend using the constructors, , and the property. IETF tags and names are identical. +> This method and the property are deprecated. Instead of using these APIs, we recommend using the constructors, , and the property. IETF tags and names are identical. The RFC 4646 standard that is maintained by the Internet Engineering Task Force (IETF) defines an IETF language tag, which provides a uniform means of identifying a language. The format of an IETF language tag is the same as the culture name returned by the property, but does not identify a culture uniquely. Different cultures share the same IETF language tag if those cultures have identical linguistic characteristics. The linguistic characteristics of a culture are contained in the object associated with a object. @@ -2162,7 +2162,7 @@ Setting `predefinedOnly` to `true` will ensure a culture is created only if the method is most commonly called with the `types` parameter set to the following values: + The method is most commonly called with the `types` parameter set to the following values: - , which returns all specific cultures. @@ -2261,7 +2261,7 @@ Setting `predefinedOnly` to `true` will ensure a culture is created only if the implements . + implements . `NumberFormatInfo` provides the culture-specific numeric format used in conjunction with the Format methods in the base data types. `DateTimeFormatInfo` controls how the date and time values are formatted for a specific culture. @@ -2329,9 +2329,9 @@ Setting `predefinedOnly` to `true` will ensure a culture is created only if the . + This method overrides . - This method generates the same hash code for two objects that are equal according to the method. + This method generates the same hash code for two objects that are equal according to the method. ]]> @@ -2393,7 +2393,7 @@ Setting `predefinedOnly` to `true` will ensure a culture is created only if the ## Remarks > [!NOTE] -> This property (and the method) is deprecated. Instead, you should use the property. IETF tags and names are identical. +> This property (and the method) is deprecated. Instead, you should use the property. IETF tags and names are identical. The RFC 4646 standard that is maintained by the Internet Engineering Task Force (IETF) defines an IETF language tag, which provides a uniform means of identifying a language. The format of an IETF language tag is similar to the culture name returned by the property, but does not identify a culture uniquely. That is, different cultures share the same IETF language tag if those cultures have identical linguistic characteristics. The linguistic characteristics of a culture are contained in the object associated with a object. @@ -2640,12 +2640,12 @@ Setting `predefinedOnly` to `true` will ensure a culture is created only if the is read-only, the and instances are also read-only. + If the is read-only, the and instances are also read-only. ## Examples - The following code example shows that also helps protect the and instances associated with the . + The following code example shows that also helps protect the and instances associated with the . :::code language="csharp" source="~/snippets/csharp/System.Globalization/CultureInfo/IsReadOnly/yslin_cultureinfo_readonly.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/CultureInfo/IsReadOnly/yslin_cultureinfo_readonly.vb" id="Snippet1"::: @@ -2766,7 +2766,7 @@ Setting `predefinedOnly` to `true` will ensure a culture is created only if the ## Remarks In most cases, the culture identifier is mapped to the corresponding NLS locale identifier. - In versions of Windows prior to Windows 10, the locale identifier `LOCALE_CUSTOM_UNSPECIFIED` (0x1000, or 4096) is assigned to custom cultures created by the user. Starting with Windows 10, it is assigned to any culture that does not have a unique locale identifier and does not have complete system-provided data. As a result, code that iterates cultures and retrieves those with an value of `LOCALE_CUSTOM_UNSPECIFIED` returns a larger subset of objects if run under Windows 10. + In versions of Windows prior to Windows 10, the locale identifier `LOCALE_CUSTOM_UNSPECIFIED` (0x1000, or 4096) is assigned to custom cultures created by the user. Starting with Windows 10, it is assigned to any culture that does not have a unique locale identifier and does not have complete system-provided data. As a result, code that iterates cultures and retrieves those with an value of `LOCALE_CUSTOM_UNSPECIFIED` returns a larger subset of objects if run under Windows 10. > [!NOTE] > LCIDs are being deprecated, and implementers are strongly encouraged to use newer versions of APIs that support BCP 47 locale names instead. Each LCID can be represented by a BCP 47 locale name, but the reverse is not true. The LCID range is restricted and unable to uniquely identify all the possible combinations of language and region. @@ -2834,7 +2834,7 @@ For a list of predefined culture names and identifiers that the property follows the naming standards provided in the class topic. It returns the short form of the culture name that excludes any indication of an alternate sort order. For example, if you instantiate a object by using the string "de-DE_phoneb" to reflect an alternate sort order, the property returns "de-DE". - To get the full name of the culture, you should use the , , or property. + To get the full name of the culture, you should use the , , or property. @@ -2978,9 +2978,9 @@ For a list of predefined culture names and identifiers that the is `true` and the specified culture matches the current culture of Windows, the uses those overrides, including user settings for the properties of the instance returned by the property, and the properties of the instance returned by the property. If the user settings are incompatible with the culture associated with the , for example, if the selected calendar is not one of the , the results of the methods and the values of the properties are undefined. + If is `true` and the specified culture matches the current culture of Windows, the uses those overrides, including user settings for the properties of the instance returned by the property, and the properties of the instance returned by the property. If the user settings are incompatible with the culture associated with the , for example, if the selected calendar is not one of the , the results of the methods and the values of the properties are undefined. - The values of the property and the property are not calculated until the user accesses the property. If the user uses the Control Panel to change the current culture to a new culture while the application is running and then accesses the or property, the application retrieves the defaults for the new culture. not the overrides for the original culture. To preserve the overrides for the original current culture, the application should access the and properties before changing the current culture. + The values of the property and the property are not calculated until the user accesses the property. If the user uses the Control Panel to change the current culture to a new culture while the application is running and then accesses the or property, the application retrieves the defaults for the new culture. not the overrides for the original culture. To preserve the overrides for the original current culture, the application should access the and properties before changing the current culture. ]]> @@ -3053,7 +3053,7 @@ The following code example shows that CultureInfo.Clone also clones the by setting the property of , which is an instance of the class. The new calendar must be one of the calendars listed in . also includes other properties that customize the date and time formatting associated with that . + Your application changes the calendar used by the current by setting the property of , which is an instance of the class. The new calendar must be one of the calendars listed in . also includes other properties that customize the date and time formatting associated with that . ## Examples The following code example demonstrates how to determine the versions supported by the culture. @@ -3122,7 +3122,7 @@ The following code example shows that CultureInfo.Clone also clones the , and the parent of the is the invariant culture itself. The parent culture encompasses only the set of information that is common among its children. + The cultures have a hierarchy in which the parent of a specific culture is a neutral culture, the parent of a neutral culture is the , and the parent of the is the invariant culture itself. The parent culture encompasses only the set of information that is common among its children. If the resources for the specific culture are not available in the system, the resources for the neutral culture are used. If the resources for the neutral culture are not available, the resources embedded in the main assembly are used. For more information on the resource fallback process, see [Packaging and Deploying Resources](/dotnet/framework/resources/packaging-and-deploying-resources-in-desktop-apps). @@ -3203,12 +3203,12 @@ The following code example shows that CultureInfo.Clone also clones the and `ci`. properties. + This wrapper prevents any modifications to `ci`, or the objects returned by the `ci`. and `ci`. properties. ## Examples - The following example shows that the method helps protect the and instances associated with the . + The following example shows that the method helps protect the and instances associated with the . :::code language="csharp" source="~/snippets/csharp/System.Globalization/CultureInfo/IsReadOnly/yslin_cultureinfo_readonly.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/CultureInfo/IsReadOnly/yslin_cultureinfo_readonly.vb" id="Snippet1"::: @@ -3268,7 +3268,7 @@ The following code example shows that CultureInfo.Clone also clones the property provides culture-specific casing information for strings. To perform culture-insensitive casing, the application should use the property of . + The property provides culture-specific casing information for strings. To perform culture-insensitive casing, the application should use the property of . @@ -3338,7 +3338,7 @@ The following code example shows that CultureInfo.Clone also clones the [!NOTE] -> When communicating between processes or persisting data it is usually better to use the full . Using just the language can lose context and data. +> When communicating between processes or persisting data it is usually better to use the full . Using just the language can lose context and data. @@ -3416,7 +3416,7 @@ The following code example shows that CultureInfo.Clone also clones the [!NOTE] -> When communicating between processes or persisting data it is usually better to use the full . Using just the language can lose context and data. +> When communicating between processes or persisting data it is usually better to use the full . Using just the language can lose context and data. @@ -3488,7 +3488,7 @@ The following code example shows that CultureInfo.Clone also clones the . It returns a normalized version of the culture name that is passed to the or constructor or to the or method. It normalizes the result string by converting characters in *languagecode2* to lowercase and converting characters in *country/regioncode2* to uppercase if necessary. + This method overrides . It returns a normalized version of the culture name that is passed to the or constructor or to the or method. It normalizes the result string by converting characters in *languagecode2* to lowercase and converting characters in *country/regioncode2* to uppercase if necessary. Predefined culture names on Windows systems are listed in the **Language tag** column in the [list of language/region names supported by Windows](https://learn.microsoft.com/openspecs/windows_protocols/ms-lcid/a9eac961-e77d-41a6-90a5-ce1a8b0cdb9c). Culture names follow the standard defined by [BCP 47](https://tools.ietf.org/html/bcp47). @@ -3555,7 +3555,7 @@ The following code example shows that CultureInfo.Clone also clones the property value for the invariant culture is "iv". > [!NOTE] -> When communicating between processes or persisting data it is usually better to use the full . Using just the language can lose context and data. +> When communicating between processes or persisting data it is usually better to use the full . Using just the language can lose context and data. If ISO 639-1 does not define a two-letter language code for a particular culture, the property returns a string that consists of three or more letters. For more information, see the example. @@ -3626,7 +3626,7 @@ The following code example shows that CultureInfo.Clone also clones the is `true` and the specified culture matches the current culture of Windows, the uses those overrides, including user settings for the properties of the instance returned by the property, and the properties of the instance returned by the property. If the user settings are incompatible with the culture associated with the , for example, if the selected calendar is not one of the , the results of the methods and the values of the properties are undefined. + If is `true` and the specified culture matches the current culture of Windows, the uses those overrides, including user settings for the properties of the instance returned by the property, and the properties of the instance returned by the property. If the user settings are incompatible with the culture associated with the , for example, if the selected calendar is not one of the , the results of the methods and the values of the properties are undefined. This property is set when the is created. diff --git a/xml/System.Globalization/CultureNotFoundException.xml b/xml/System.Globalization/CultureNotFoundException.xml index e3a1b19bfda..45f066f071b 100644 --- a/xml/System.Globalization/CultureNotFoundException.xml +++ b/xml/System.Globalization/CultureNotFoundException.xml @@ -86,16 +86,16 @@ ## Remarks A exception is thrown whenever the construction of an invalid culture is eventually attempted within a method. Most commonly, this exception is thrown when a call to one of the following methods fails to create or return a culture: -- constructors. +- constructors. -- The method. +- The method. -- The method. +- The method. > [!WARNING] > On Windows 7 and later operating systems, the .NET Framework retrieves culture data from the operating system. The exception is thrown if the operating system is unable to find the culture, and the culture is not a custom culture or a replacement culture. - If the calling code attempted to instantiate a object by using a culture name, the property contains the invalid name, and the property of the object returned by the property is `false`. If the calling code attempted to instantiate a object by using a culture identifier, the property of the object returned by the property contains the invalid identifier, and the value of the property is `null`. + If the calling code attempted to instantiate a object by using a culture name, the property contains the invalid name, and the property of the object returned by the property is `false`. If the calling code attempted to instantiate a object by using a culture identifier, the property of the object returned by the property contains the invalid identifier, and the value of the property is `null`. uses the HRESULT COR_E_ARGUMENT, which has the value 0x80070057. @@ -708,7 +708,7 @@ sets a with all the exception object data targeted for serialization. During deserialization, the exception object is reconstituted from the transmitted over the stream. + sets a with all the exception object data targeted for serialization. During deserialization, the exception object is reconstituted from the transmitted over the stream. For more information, see . @@ -762,7 +762,7 @@ object by using an invalid culture identifier, the property of the object returned by the property contains the invalid identifier. Otherwise, its property is `false`. + If the calling code attempted to instantiate or retrieve a object by using an invalid culture identifier, the property of the object returned by the property contains the invalid identifier. Otherwise, its property is `false`. ]]> diff --git a/xml/System.Globalization/CultureTypes.xml b/xml/System.Globalization/CultureTypes.xml index 3522407d1c4..8da68de329a 100644 --- a/xml/System.Globalization/CultureTypes.xml +++ b/xml/System.Globalization/CultureTypes.xml @@ -64,7 +64,7 @@ ## Remarks -These culture type values are returned by the property, and also serve as a filter that limits the cultures returned by the method. For more information on cultures, see . +These culture type values are returned by the property, and also serve as a filter that limits the cultures returned by the method. For more information on cultures, see . Generally, you enumerate all cultures by using the `CultureTypes.AllCultures` value. This allows enumeration of custom cultures as well as the other culture types. @@ -76,11 +76,11 @@ Note that all `CultureTypes` members have been deprecated except for `CultureTyp - **Neutral cultures**, which specify a language without respect to a country/region. The names of neutral cultures consist of the lowercase two-letter code derived from ISO 639-1. For example: "en" (English) is a neutral culture. Custom neutral cultures (that is, cultures that are application- rather than system-defined) can have any user-specified name, not just a two-letter code. - The invariant culture is included in the array of cultures returned by the method that specifies this value. + The invariant culture is included in the array of cultures returned by the method that specifies this value. - **Custom cultures**, which are application-defined cultures. Custom cultures can represent either specific cultures or neutral cultures and can have any application-specified name. - In Windows versions prior to Windows 10, the `UserCustomCulture` value is assigned to custom cultures created by the developer. In Windows 10, the `UserCustomCulture` value is also assigned to system cultures that are not backed by a complete set of cultural data and that do not have unique local identifiers. (All cultures of type `UserCustomCulture` share a value of `LOCALE_CUSTOM_UNSPECIFIED` (0x1000, or 4096)). As a result, the `CultureInfo.GetCultures(CultureTypes.UserCustomCulture)` method returns different sets of cultures on different Windows versions. + In Windows versions prior to Windows 10, the `UserCustomCulture` value is assigned to custom cultures created by the developer. In Windows 10, the `UserCustomCulture` value is also assigned to system cultures that are not backed by a complete set of cultural data and that do not have unique local identifiers. (All cultures of type `UserCustomCulture` share a value of `LOCALE_CUSTOM_UNSPECIFIED` (0x1000, or 4096)). As a result, the `CultureInfo.GetCultures(CultureTypes.UserCustomCulture)` method returns different sets of cultures on different Windows versions. ## Examples @@ -450,7 +450,7 @@ On .NET Framework 4 and later versions and .NET Core running on Windows, it incl ## Remarks -If it is used as an argument to the method on .NET Framework 4 and later versions, the method returns an empty array. +If it is used as an argument to the method on .NET Framework 4 and later versions, the method returns an empty array. ]]> diff --git a/xml/System.Globalization/DateTimeFormatInfo.xml b/xml/System.Globalization/DateTimeFormatInfo.xml index c37ed212b76..dd7aa2d65b1 100644 --- a/xml/System.Globalization/DateTimeFormatInfo.xml +++ b/xml/System.Globalization/DateTimeFormatInfo.xml @@ -214,9 +214,9 @@ ## Remarks If setting this property, the array must be one-dimensional and must have exactly seven elements. The first element (the element at index zero) represents the first day of the week in the calendar defined by the property. - If a custom format string includes the "ddd" format specifier, the or method includes the appropriate member of the array in place of the "ddd" in the result string. + If a custom format string includes the "ddd" format specifier, the or method includes the appropriate member of the array in place of the "ddd" in the result string. - This property is affected if the value of the property changes. If the selected does not support abbreviated day names, the array contains the full day names. + This property is affected if the value of the property changes. If the selected does not support abbreviated day names, the array contains the full day names. ## Examples The following example creates a read/write object that represents the English (United States) culture and assigns abbreviated day names to its property. It then uses the "ddd" format specifier in a [custom date and time format string](/dotnet/standard/base-types/custom-date-and-time-format-strings) to display the string representation of dates for one week beginning May 28, 2014. @@ -291,14 +291,14 @@ or method includes the appropriate member of the array in place of the "MMM" in the result string. + In some languages, a month name that is part of a date appears in the genitive case. For example, a date in the ru-RU or Russian (Russia) culture consists of the day number and the genitive month name, such as 1 Января (1 January). For these cultures, if a custom format string includes the "MMM" format specifier, the or method includes the appropriate member of the array in place of the "MMM" in the result string. In a set operation, the array must be one-dimensional with exactly 13 elements, because objects accommodate calendars that have 13 months. For calendars that have 12 months, the thirteenth element should be . The first element (the element at index zero) represents the first month of the year defined by the property. If you set the property, you must also set the property. ## Examples - The following example creates a read/write object that represents the English (United States) culture and assigns abbreviated genitive month names to its and properties. It then displays the string representation of dates that include the abbreviated month name of each month in the culture's supported calendar. + The following example creates a read/write object that represents the English (United States) culture and assigns abbreviated genitive month names to its and properties. It then displays the string representation of dates that include the abbreviated month name of each month in the culture's supported calendar. :::code language="csharp" source="~/snippets/csharp/System.Globalization/DateTimeFormatInfo/AbbreviatedMonthGenitiveNames/abbreviatedmonthnames1.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/DateTimeFormatInfo/AbbreviatedMonthGenitiveNames/abbreviatedmonthnames1.vb" id="Snippet1"::: @@ -362,15 +362,15 @@ ## Remarks If you set this property, the array must be one-dimensional with exactly 13 elements. objects accommodate calendars with 13 months. The first element (the element at index zero) represents the first month of the year defined by the property. - If you set the property, you must also set the property. The and properties are used to format dates using the following format strings: + If you set the property, you must also set the property. The and properties are used to format dates using the following format strings: - A standard date and time format string that aliases a custom format string that includes the "MMM" format specifier. - A custom date and time format string that includes the "MMM" format specifier. - This property is affected if the value of the property changes. If the selected does not support abbreviated month names, the array contains the full month names. + This property is affected if the value of the property changes. If the selected does not support abbreviated month names, the array contains the full month names. ## Examples - The following example creates a read/write object that represents the English (United States) culture and assigns abbreviated genitive month names to its and properties. It then displays the string representation of dates that include the abbreviated name of each month in the culture's supported calendar. + The following example creates a read/write object that represents the English (United States) culture and assigns abbreviated genitive month names to its and properties. It then displays the string representation of dates that include the abbreviated name of each month in the culture's supported calendar. :::code language="csharp" source="~/snippets/csharp/System.Globalization/DateTimeFormatInfo/AbbreviatedMonthGenitiveNames/abbreviatedmonthnames1.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/DateTimeFormatInfo/AbbreviatedMonthGenitiveNames/abbreviatedmonthnames1.vb" id="Snippet1"::: @@ -442,7 +442,7 @@ ## Remarks The property is used for all times from 0:00:00 (midnight) to 11:59:59.999. - If a custom format string includes the "tt" format specifier and the time is before noon, the or method includes the value of the property in place of "tt" in the result string. If the custom format string includes the "t" custom format specifier, only the first character of the property value is included. You should use "tt" for languages for which it is necessary to maintain the distinction between A.M. and P.M. An example is Japanese, in which the A.M. and P.M. designators differ in the second character instead of the first character. + If a custom format string includes the "tt" format specifier and the time is before noon, the or method includes the value of the property in place of "tt" in the result string. If the custom format string includes the "t" custom format specifier, only the first character of the property value is included. You should use "tt" for languages for which it is necessary to maintain the distinction between A.M. and P.M. An example is Japanese, in which the A.M. and P.M. designators differ in the second character instead of the first character. For cultures that do not use an A.M. designator, this property returns an empty string. @@ -511,12 +511,12 @@ [!INCLUDE[japanese-era-note](~/includes/calendar-era.md)] -Changing the value of this property affects the following properties as well: , , , , , , , , , , and . +Changing the value of this property affects the following properties as well: , , , , , , , , , , and . For example, if the culture of the current thread is Japanese, this property accepts , , or . When the is used, the default long date specifier is "gg y'\x5e74'M'\x6708'd'\x65e5'". When the , is used, the default long date specifier is "yyyy'\x5e74'M'\x6708'd'\x65e5'". ## Examples - The following example defines a `ChangeCalendar` method that changes a culture's current calendar to a specified calendar unless it is already the current calendar or if it is not supported by the culture. The code that calls the method instantiates a object that represents the Arabic (Egypt) culture and first attempts to change its calendar to the Japanese calendar. Because the Japanese calendar is not supported, the method makes not change the culture's calendar. However, because the Umm al-Qura calendar is a member of the collection, the method does succeed in making it the current calendar for the ar-EG culture. + The following example defines a `ChangeCalendar` method that changes a culture's current calendar to a specified calendar unless it is already the current calendar or if it is not supported by the culture. The code that calls the method instantiates a object that represents the Arabic (Egypt) culture and first attempts to change its calendar to the Japanese calendar. Because the Japanese calendar is not supported, the method makes not change the culture's calendar. However, because the Umm al-Qura calendar is a member of the collection, the method does succeed in making it the current calendar for the ar-EG culture. :::code language="csharp" source="~/snippets/csharp/System.Globalization/DateTimeFormatInfo/Calendar/CalendarTest1.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/DateTimeFormatInfo/Calendar/CalendarTest1.vb" id="Snippet1"::: @@ -774,7 +774,7 @@ Changing the value of this property affects the following properties as well: method displays the value of in place of the "/" in the result string. + If a custom format string includes the "/" format specifier, the method displays the value of in place of the "/" in the result string. The property defines the string that replaces the date separator ("/" custom date and time format specifier) in a result string in a formatting operation. It also defines the date separator string in a parsing operation. @@ -843,7 +843,7 @@ Changing the value of this property affects the following properties as well: property. - If a custom format string includes the "dddd" format specifier, the method includes the value of the appropriate member in place of "dddd" in the result string. + If a custom format string includes the "dddd" format specifier, the method includes the value of the appropriate member in place of "dddd" in the result string. This property is affected if the value of the property changes. @@ -970,7 +970,7 @@ Changing the value of this property affects the following properties as well: property. In other words, the custom format string assigned to this property defines the format of the result string for the "F" standard format string. For more information, see [Standard Date and Time Format Strings](/dotnet/standard/base-types/standard-date-and-time-format-strings). - The value of the property is generated dynamically by concatenating the and properties separated by a space. This dynamic assignment occurs under the following conditions: + The value of the property is generated dynamically by concatenating the and properties separated by a space. This dynamic assignment occurs under the following conditions: - If the property value is retrieved before it has been explicitly set. - When the value of the property changes. @@ -979,7 +979,7 @@ Changing the value of this property affects the following properties as well: property changes. ## Examples - The following example displays the value of for a few cultures. + The following example displays the value of for a few cultures. :::code language="csharp" source="~/snippets/csharp/System.Globalization/DateTimeFormatInfo/FullDateTimePattern/dtfi_fulldatetimepattern.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/DateTimeFormatInfo/FullDateTimePattern/dtfi_fulldatetimepattern.vb" id="Snippet1"::: @@ -1130,7 +1130,7 @@ This property is affected if the value of the property of the appropriate class derived from . For example: displays a list of eras that are supported by this implementation. + The valid values for `era` are listed in the property of the appropriate class derived from . For example: displays a list of eras that are supported by this implementation. In the class, the abbreviated era name is the first character of the full era name. This character is either the single-character case-insensitive Latin alphabet abbreviation or the single-character Kanji abbreviation. @@ -1286,22 +1286,22 @@ This property is affected if the value of the method in formatting operations. However, if you do, the string representation of a date and time value returned in that formatting operation cannot always be parsed successfully by the `Parse` and `TryParse` methods. Therefore, you cannot assume that the custom format strings returned by the method can be used to round-trip date and time values. The following example illustrates this problem. It retrieves a object that contains formatting information for the Italy (Italian) culture. It passes each custom format string in the array returned by the method to the method to create the string representation of a date and time. This example then attempts to parse this value by calling the method. As the output from the example shows, some of the custom format strings do not produce a date and time value that successfully round-trips. + You can use the custom format strings in the array returned by the method in formatting operations. However, if you do, the string representation of a date and time value returned in that formatting operation cannot always be parsed successfully by the `Parse` and `TryParse` methods. Therefore, you cannot assume that the custom format strings returned by the method can be used to round-trip date and time values. The following example illustrates this problem. It retrieves a object that contains formatting information for the Italy (Italian) culture. It passes each custom format string in the array returned by the method to the method to create the string representation of a date and time. This example then attempts to parse this value by calling the method. As the output from the example shows, some of the custom format strings do not produce a date and time value that successfully round-trips. :::code language="csharp" source="~/snippets/csharp/System.Globalization/DateTimeFormatInfo/GetAllDateTimePatterns/getalldatetimepatternsex1.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/DateTimeFormatInfo/GetAllDateTimePatterns/getalldatetimepatternsex1.vb" id="Snippet1"::: To parse the string representation of a date and time that can be expressed in a number of predefined custom formats, call one of the following methods: -- +- -- +- -- +- -- +- - The custom format strings in the array returned by the method depends on the current calendar of the culture for which the object supplies formatting information. If the calendar changes, the array returned by this method also changes. + The custom format strings in the array returned by the method depends on the current calendar of the culture for which the object supplies formatting information. If the calendar changes, the array returned by this method also changes. ## Examples The following example displays the date and time format strings for the invariant culture, as well as the result string that is produced when that format string is used to format a particular date. @@ -1309,7 +1309,7 @@ This property is affected if the value of the object that represents the invariant culture by calling the constructor. It could also retrieve a that represents the invariant culture from the property. + The example instantiates a object that represents the invariant culture by calling the constructor. It could also retrieve a that represents the invariant culture from the property. ]]> @@ -1368,22 +1368,22 @@ This property is affected if the value of the method in formatting operations. However, if you do, the string representation of a date and time value returned in that formatting operation cannot always be parsed successfully by the `Parse` and `TryParse` methods. Therefore, you cannot assume that the custom format strings returned by the method can be used to round-trip date and time values. The following example illustrates this problem. It retrieves a object that contains formatting information for the Russia (Russian) culture. It calls the method for each standard format string, and then passes each custom format string in the returned array to the method to create the string representation of a date and time. This example then attempts to parse this value by calling the method. As the output from the example shows, some of the custom format strings do not produce a date and time value that successfully round-trips. + You can use the custom format strings in the array returned by the method in formatting operations. However, if you do, the string representation of a date and time value returned in that formatting operation cannot always be parsed successfully by the `Parse` and `TryParse` methods. Therefore, you cannot assume that the custom format strings returned by the method can be used to round-trip date and time values. The following example illustrates this problem. It retrieves a object that contains formatting information for the Russia (Russian) culture. It calls the method for each standard format string, and then passes each custom format string in the returned array to the method to create the string representation of a date and time. This example then attempts to parse this value by calling the method. As the output from the example shows, some of the custom format strings do not produce a date and time value that successfully round-trips. :::code language="csharp" source="~/snippets/csharp/System.Globalization/DateTimeFormatInfo/GetAllDateTimePatterns/getalldatetimepatternsex2.cs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/DateTimeFormatInfo/GetAllDateTimePatterns/getalldatetimepatternsex2.vb" id="Snippet2"::: To parse the string representation of a date and time that can be expressed in a number of predefined custom formats, call one of the following methods: -- +- -- +- -- +- -- +- - The custom format strings in the array returned by the method depends on the current calendar of the culture for which the object supplies formatting information. If the calendar changes, the array returned by this method also changes. + The custom format strings in the array returned by the method depends on the current calendar of the culture for which the object supplies formatting information. If the calendar changes, the array returned by this method also changes. ## Examples The following example displays the date and time patterns for the current calendar. @@ -1534,9 +1534,9 @@ This property is affected if the value of the ignores punctuation in abbreviated era names, only if the is selected in and the culture uses "A.D." as the era name, that is, "A.D." is equivalent to "AD". + ignores punctuation in abbreviated era names, only if the is selected in and the culture uses "A.D." as the era name, that is, "A.D." is equivalent to "AD". - compares `eraName` with the full era name returned by and with the abbreviated era name returned by . + compares `eraName` with the full era name returned by and with the abbreviated era name returned by . [!INCLUDE[japanese-era-note](~/includes/calendar-era.md)] @@ -1608,7 +1608,7 @@ This property is affected if the value of the property of the appropriate class derived from . For example: displays a list of eras that are supported by this implementation. + The valid values for `era` are listed in the property of the appropriate class derived from . For example: displays a list of eras that are supported by this implementation. [!INCLUDE[japanese-era-note](~/includes/calendar-era.md)] @@ -1678,7 +1678,7 @@ This property is affected if the value of the object is passed as the parameter. This method implements . + The `Format(String, IFormatProvider)` method supported by the base data types invoke this method when the current object is passed as the parameter. This method implements . ]]> @@ -1756,12 +1756,12 @@ This property is affected if the value of the method of `formatProvider` using an object as the `Type` parameter. If `formatProvider` is `null` or if returns `null`, this method returns . + This method uses the method of `formatProvider` using an object as the `Type` parameter. If `formatProvider` is `null` or if returns `null`, this method returns . Your application can get a object for a specific culture using one of the following methods: - The property. -- The method, where `provider` is a object. +- The method, where `provider` is a object. A object can be created only for the invariant culture or for specific cultures, not for neutral cultures. @@ -2083,7 +2083,7 @@ This property is affected if the value of the property defines the culture-specific format of date strings that are returned by calls to the and methods and by composite format strings that are supplied the "D" standard format string. The following example illustrates the relationships among the following: the "D" standard format string, the custom format string returned by the property, and the culture-specific representation of a date. + The property defines the culture-specific format of date strings that are returned by calls to the and methods and by composite format strings that are supplied the "D" standard format string. The following example illustrates the relationships among the following: the "D" standard format string, the custom format string returned by the property, and the culture-specific representation of a date. :::code language="csharp" source="~/snippets/csharp/System.Globalization/DateTimeFormatInfo/LongDatePattern/longdatepattern1.cs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/DateTimeFormatInfo/LongDatePattern/longdatepattern1.vb" id="Snippet2"::: @@ -2169,12 +2169,12 @@ This property is affected if the value of the property defines the culture-specific format of date strings that are returned by calls to the and methods and by composite format strings that are supplied the "T" standard format string. + The property defines the culture-specific format of date strings that are returned by calls to the and methods and by composite format strings that are supplied the "T" standard format string. We recommend that you set the time separator in the long time pattern to an exact string instead of using the time separator placeholder. For example, to obtain the pattern h-mm-ss, set the long date pattern to "h-mm-ss". ## Examples - The following example displays the value of for a few cultures. + The following example displays the value of for a few cultures. :::code language="csharp" source="~/snippets/csharp/System.Globalization/DateTimeFormatInfo/LongTimePattern/dtfi_longtimepattern.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/DateTimeFormatInfo/LongTimePattern/dtfi_longtimepattern.vb" id="Snippet1"::: @@ -2241,14 +2241,14 @@ This property is affected if the value of the property defines the culture-specific format of date strings that are returned by calls to the and methods and by composite format strings that are supplied the "m" and "M" standard format strings. + The property defines the culture-specific format of date strings that are returned by calls to the and methods and by composite format strings that are supplied the "m" and "M" standard format strings. This property is affected if the value of the property changes. We recommend that you set the date separator in the month and day pattern to an exact string instead of using the date separator placeholder. For example, to obtain the pattern MM-DD, set the month and day pattern to "MM-DD". ## Examples - The following example displays the value of for a few cultures. + The following example displays the value of for a few cultures. :::code language="csharp" source="~/snippets/csharp/System.Globalization/DateTimeFormatInfo/MonthDayPattern/dtfi_monthdaypattern.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/DateTimeFormatInfo/MonthDayPattern/dtfi_monthdaypattern.vb" id="Snippet1"::: @@ -2390,7 +2390,7 @@ This property is affected if the value of the property, you must also set the property. - If the custom pattern includes the format pattern "MMMM", displays the value of in place of the "MMMM" in the format pattern. + If the custom pattern includes the format pattern "MMMM", displays the value of in place of the "MMMM" in the format pattern. This property is affected if the value of the property changes. @@ -2523,7 +2523,7 @@ This property is affected if the value of the property is used for all times from 12:00:00 (noon) to 23:59:59.999. - If the custom pattern includes the format pattern "tt" and the time is after noon, displays the value of in place of the "tt" in the format pattern. If the custom pattern includes the format pattern "t", only the first character of is displayed. Your application should use "tt" for languages for which it is necessary to maintain the distinction between AM and PM. An example is Japanese, for which the AM and PM designators differ in the second character instead of the first character. + If the custom pattern includes the format pattern "tt" and the time is after noon, displays the value of in place of the "tt" in the format pattern. If the custom pattern includes the format pattern "t", only the first character of is displayed. Your application should use "tt" for languages for which it is necessary to maintain the distinction between AM and PM. An example is Japanese, for which the AM and PM designators differ in the second character instead of the first character. For cultures that do not use a PM designator, this property returns an empty string. @@ -2649,7 +2649,7 @@ This property is affected if the value of the property defines the culture-specific format of date strings that are returned by calls to the and methods and by composite format strings that are supplied the "r" and "R" standard format strings. + The property defines the culture-specific format of date strings that are returned by calls to the and methods and by composite format strings that are supplied the "r" and "R" standard format strings. The RFC1123 pattern reflects a defined standard, and the property is read-only. Therefore, it is always the same, regardless of the culture. The custom format string is "ddd, dd MMM yyyy HH':'mm':'ss 'GMT'". @@ -2721,17 +2721,17 @@ This property is affected if the value of the method defines the custom format strings that correspond to a particular standard date and time format string. If a call to a date and time formatting method includes the standard date and time format string specified by `format`, the method uses the first element in the `patterns` array to define the format of the resulting string. + The method defines the custom format strings that correspond to a particular standard date and time format string. If a call to a date and time formatting method includes the standard date and time format string specified by `format`, the method uses the first element in the `patterns` array to define the format of the resulting string. > [!WARNING] -> The `Parse` and `TryParse` methods do not fully iterate all strings in `patterns` when parsing the string representation of a date and time. If you require a date and time string to have particular formats in a parsing operation, you should pass the array of valid formats to the , , , or method. +> The `Parse` and `TryParse` methods do not fully iterate all strings in `patterns` when parsing the string representation of a date and time. If you require a date and time string to have particular formats in a parsing operation, you should pass the array of valid formats to the , , , or method. - You can define custom format strings that correspond to the "d", "D", "t", "T", and "y" or "Y" standard date and time format strings. If the value of `format` is any other standard format string, the method throws an . + You can define custom format strings that correspond to the "d", "D", "t", "T", and "y" or "Y" standard date and time format strings. If the value of `format` is any other standard format string, the method throws an . If your custom date and time format strings include date separators, you should explicitly specify a date separator instead of relying on the parsing or formatting method that replaces the "/" custom format specifier with a particular date separator. For example, to obtain the pattern MM-DD-yyyy, use the pattern "MM-DD-yyyy". ## Examples - The following example instantiates a object that represents the "en-US" (English - United States) culture and uses it to parse an array of date and time strings using the "Y" standard format string. It then uses the method to associate a new custom format string with the "Y" standard format string, and then attempts to parse the array of date and time strings. Output from the example demonstrates that the new custom format string is used in both the parsing and formatting operations. + The following example instantiates a object that represents the "en-US" (English - United States) culture and uses it to parse an array of date and time strings using the "Y" standard format string. It then uses the method to associate a new custom format string with the "Y" standard format string, and then attempts to parse the array of date and time strings. Output from the example demonstrates that the new custom format string is used in both the parsing and formatting operations. :::code language="csharp" source="~/snippets/csharp/System.Globalization/DateTimeFormatInfo/SetAllDateTimePatterns/setalldatetimepatterns.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/DateTimeFormatInfo/SetAllDateTimePatterns/setalldatetimepatterns.vb" id="Snippet1"::: @@ -2800,7 +2800,7 @@ This property is affected if the value of the property defines the culture-specific format of date strings that are returned by calls to the and methods and by composite format strings that are supplied the "d" standard format string. + The property defines the culture-specific format of date strings that are returned by calls to the and methods and by composite format strings that are supplied the "d" standard format string. This property is affected if the value of the property changes. @@ -2950,12 +2950,12 @@ The default array starts on Sunday. property defines the culture-specific format of date strings that are returned by calls to the and methods and by composite format strings that are supplied the "t" standard format string. + The property defines the culture-specific format of date strings that are returned by calls to the and methods and by composite format strings that are supplied the "t" standard format string. We recommend that you set the time separator in the short time pattern to an exact string instead of using the time separator placeholder. For example, to obtain the pattern h-mm-ss, set the short time pattern to "h-mm-ss". ## Examples - The following example displays the value of for a few cultures. + The following example displays the value of for a few cultures. :::code language="csharp" source="~/snippets/csharp/System.Globalization/DateTimeFormatInfo/ShortTimePattern/dtfi_shorttimepattern.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/DateTimeFormatInfo/ShortTimePattern/dtfi_shorttimepattern.vb" id="Snippet1"::: @@ -3016,12 +3016,12 @@ The default array starts on Sunday. property defines the culture-specific format of date strings that are returned by calls to the and methods and by composite format strings that are supplied the "s" standard format string. + The property defines the culture-specific format of date strings that are returned by calls to the and methods and by composite format strings that are supplied the "s" standard format string. The format string returned by the property reflects a defined standard (ISO 8601), and the property is read-only. Therefore, it is always the same, regardless of the culture. The custom format string is "yyyy'-'MM'-'dd'T'HH':'mm':'ss". ## Examples - The following example displays the value of for a few cultures. + The following example displays the value of for a few cultures. :::code language="csharp" source="~/snippets/csharp/System.Globalization/DateTimeFormatInfo/SortableDateTimePattern/dtfi_sortabledatetimepattern.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/DateTimeFormatInfo/SortableDateTimePattern/dtfi_sortabledatetimepattern.vb" id="Snippet1"::: @@ -3118,7 +3118,7 @@ The default array starts on Sunday. ## Remarks -If the custom pattern includes the format pattern ":", displays the value of in place of the ":" in the format pattern. +If the custom pattern includes the format pattern ":", displays the value of in place of the ":" in the format pattern. > [!NOTE] > Standard format patterns, such as , don't necessarily use ":". Changing may not have an effect when using these patterns. @@ -3188,12 +3188,12 @@ If the custom pattern includes the format pattern ":", property defines the format of date strings that are returned by calls to the and methods and by composite format strings that are supplied the "u" standard format string. It can be used to display dates and times in a sortable order with the universal time designator "Z" at the end. The format is sortable because it uses leading zeros for year, month, day, hour, minute, and second. The custom format string ("yyyy'-'MM'-'dd HH':'mm':'ss'Z'") is the same regardless of culture or format provider. + The property defines the format of date strings that are returned by calls to the and methods and by composite format strings that are supplied the "u" standard format string. It can be used to display dates and times in a sortable order with the universal time designator "Z" at the end. The format is sortable because it uses leading zeros for year, month, day, hour, minute, and second. The custom format string ("yyyy'-'MM'-'dd HH':'mm':'ss'Z'") is the same regardless of culture or format provider. The format string returned by the property reflects a defined standard, and the property is read-only. Therefore, it is always the same, regardless of the culture. The custom format string is "yyyy'-'MM'-'dd HH':'mm':'ss'Z'". ## Examples - The following example displays the value of for a few cultures. + The following example displays the value of for a few cultures. :::code language="csharp" source="~/snippets/csharp/System.Globalization/DateTimeFormatInfo/UniversalSortableDateTimePattern/dtfi_universalsortabledatetimepattern.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/DateTimeFormatInfo/UniversalSortableDateTimePattern/dtfi_universalsortabledatetimepattern.vb" id="Snippet1"::: @@ -3263,14 +3263,14 @@ If the custom pattern includes the format pattern ":", property defines the culture-specific format of date strings that are returned by calls to the and methods and by composite format strings that are supplied the "y" and "Y" standard format strings. + The property defines the culture-specific format of date strings that are returned by calls to the and methods and by composite format strings that are supplied the "y" and "Y" standard format strings. This property is affected if the value of the property changes. We recommend that you set the date separator in the year month pattern to an exact string instead of using the date separator placeholder. For example, to get the pattern MM-yyyy, set the year month pattern to "MM-yyyy". ## Examples - The following example displays the value of for a few cultures. + The following example displays the value of for a few cultures. :::code language="csharp" source="~/snippets/csharp/System.Globalization/DateTimeFormatInfo/YearMonthPattern/dtfi_yearmonthpattern.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/DateTimeFormatInfo/YearMonthPattern/dtfi_yearmonthpattern.vb" id="Snippet1"::: diff --git a/xml/System.Globalization/DateTimeStyles.xml b/xml/System.Globalization/DateTimeStyles.xml index e8fb731ec5f..47fc09bc543 100644 --- a/xml/System.Globalization/DateTimeStyles.xml +++ b/xml/System.Globalization/DateTimeStyles.xml @@ -65,31 +65,31 @@ Defines the formatting options that customize string parsing for some date and time parsing methods. - values can be used with any of the following date and time parsing methods that include a `styles` parameter to define the interpretation of the style elements that may be present in the string to be parsed: - -- - -- - -- - -- - -- - -- - -- - -- - - The `ParseExact` and `TryParseExact` methods can use any of the values. However, if none of the `Allow*` values is selected, the input string must have exactly the same white-space characters as the format string. - - If the input string does not contain any indication of the time zone, the date and time parsing methods interpret the value of the date and time string based on the time zone setting for the operating system. To convert the date and time to the Universal Time or Greenwich Mean Time (GMT), the application should use the value. The same effect can be achieved by calling the or method. However, using the value with the date and time parsing method is more efficient. - + values can be used with any of the following date and time parsing methods that include a `styles` parameter to define the interpretation of the style elements that may be present in the string to be parsed: + +- + +- + +- + +- + +- + +- + +- + +- + + The `ParseExact` and `TryParseExact` methods can use any of the values. However, if none of the `Allow*` values is selected, the input string must have exactly the same white-space characters as the format string. + + If the input string does not contain any indication of the time zone, the date and time parsing methods interpret the value of the date and time string based on the time zone setting for the operating system. To convert the date and time to the Universal Time or Greenwich Mean Time (GMT), the application should use the value. The same effect can be achieved by calling the or method. However, using the value with the date and time parsing method is more efficient. + ]]> diff --git a/xml/System.Globalization/DaylightTime.xml b/xml/System.Globalization/DaylightTime.xml index 6ff4877d804..946fa6be56d 100644 --- a/xml/System.Globalization/DaylightTime.xml +++ b/xml/System.Globalization/DaylightTime.xml @@ -63,7 +63,7 @@ Daylight saving time is a period during the year when the clock is advanced, usually by an hour, to take advantage of extended daylight hours. At the end of the period, the clock is set back to the standard time. > [!WARNING] -> The object returned by the method recognizes only the time zone adjustment rule that is currently in effect, and ignores any previous adjustment rules for which the system has information. Instead, it applies the current adjustment rule backward in time to periods when it may not have been in effect. To retrieve information about all the known adjustment rules for a particular time zone, use the method. +> The object returned by the method recognizes only the time zone adjustment rule that is currently in effect, and ignores any previous adjustment rules for which the system has information. Instead, it applies the current adjustment rule backward in time to periods when it may not have been in effect. To retrieve information about all the known adjustment rules for a particular time zone, use the method. ]]> diff --git a/xml/System.Globalization/EastAsianLunisolarCalendar.xml b/xml/System.Globalization/EastAsianLunisolarCalendar.xml index 684a2a403ae..b5a76947276 100644 --- a/xml/System.Globalization/EastAsianLunisolarCalendar.xml +++ b/xml/System.Globalization/EastAsianLunisolarCalendar.xml @@ -74,14 +74,14 @@ class supports the sexagenary cycle of years (which repeats every 60 years) in addition to solar years and lunar months. Each solar year in the calendar is associated with a Sexagenary Year (see ), a Celestial Stem (see ), and a Terrestrial Branch (see ). + The class supports the sexagenary cycle of years (which repeats every 60 years) in addition to solar years and lunar months. Each solar year in the calendar is associated with a Sexagenary Year (see ), a Celestial Stem (see ), and a Terrestrial Branch (see ). > [!NOTE] > For information about using the class and the other calendar classes in the .NET Framework, see [Working with Calendars](/dotnet/standard/datetime/working-with-calendars). - A year can have a leap month after any month of the year, and a month can have a leap day. For example, the method returns a positive integer that indicates the month associated with a specified date. If there is a leap month between the eighth and ninth months of the year, the method returns 8 for the eighth month, 9 for the leap eighth month, and 10 for the ninth month. + A year can have a leap month after any month of the year, and a month can have a leap day. For example, the method returns a positive integer that indicates the month associated with a specified date. If there is a leap month between the eighth and ninth months of the year, the method returns 8 for the eighth month, 9 for the leap eighth month, and 10 for the ninth month. - Each supports a set of calendars. Currently, none of the lunisolar calendar classes that derive from is used by any of the cultures supported by the class. Therefore, this class and those that derive from it can be used only to calculate dates in the East Asian lunisolar calendars. This class supports several "get" methods to describe a in the terms used by lunisolar calendars, and the method to convert from lunisolar calendar data to a . + Each supports a set of calendars. Currently, none of the lunisolar calendar classes that derive from is used by any of the cultures supported by the class. Therefore, this class and those that derive from it can be used only to calculate dates in the East Asian lunisolar calendars. This class supports several "get" methods to describe a in the terms used by lunisolar calendars, and the method to convert from lunisolar calendar data to a . ]]> @@ -147,7 +147,7 @@ If the value of the `months` parameter is negative, the resulting is earlier than the specified . - The property of the returned value always equals . You can preserve the property of the `time` parameter by calling the method, as the following example shows. + The property of the returned value always equals . You can preserve the property of the `time` parameter by calling the method, as the following example shows. :::code language="csharp" source="~/snippets/csharp/System.Globalization/Calendar/AddDays/add1.cs" id="Snippet5"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/Calendar/AddDays/add1.vb" id="Snippet5"::: @@ -222,7 +222,7 @@ If `years` is negative, the resulting is earlier than the specified . - The property of the returned value always equals . You can preserve the property of the `time` parameter by calling the method, as the following example shows. + The property of the returned value always equals . You can preserve the property of the `time` parameter by calling the method, as the following example shows. :::code language="csharp" source="~/snippets/csharp/System.Globalization/Calendar/AddDays/add1.cs" id="Snippet8"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/Calendar/AddDays/add1.vb" id="Snippet8"::: @@ -483,7 +483,7 @@ for the first day of the first month returns 1, and for the last day of the last month returns the total number of days in that year, which is the same value returned by . + The day of the year is defined as the number of days from the first day of the year. For example, for the first day of the first month returns 1, and for the last day of the last month returns the total number of days in that year, which is the same value returned by . ]]> @@ -544,7 +544,7 @@ method returns 28 or 29, depending on whether the `year` parameter is a leap year. + If the `month` parameter is the second month, the method returns 28 or 29, depending on whether the `year` parameter is a leap year. ]]> @@ -605,7 +605,7 @@ method returns 365 or 366, depending on whether the `year` parameter is a leap year. + The method returns 365 or 366, depending on whether the `year` parameter is a leap year. ]]> @@ -670,7 +670,7 @@ method returns a number from 1 through 13 that indicates the month associated with a specified date. If there is a leap month between the eighth and ninth months of the year, the method returns 8 for the eighth month, 9 for the leap eighth month, and 10 for the ninth month. + In a calendar that supports a leap month, the leap month can occur either after a particular month or after any month in a year. For example, the method returns a number from 1 through 13 that indicates the month associated with a specified date. If there is a leap month between the eighth and ninth months of the year, the method returns 8 for the eighth month, 9 for the leap eighth month, and 10 for the ninth month. ]]> @@ -1168,7 +1168,7 @@ method can convert any date in the current calendar to a Gregorian calendar date. The Gregorian date can subsequently be used, for example, to compare dates in different calendars or create an equivalent date in a particular calendar. + The method can convert any date in the current calendar to a Gregorian calendar date. The Gregorian date can subsequently be used, for example, to compare dates in different calendars or create an equivalent date in a particular calendar. ]]> @@ -1227,9 +1227,9 @@ method uses the property to determine the appropriate century. + The method uses the property to determine the appropriate century. - supports either a two-digit year or a four-digit year. Passing a two-digit year value (less than 100) causes the method to convert the value to a four-digit value according to the value representing the appropriate century. If the application supplies a four-digit year value that is within the supported calendar range to , the method returns the actual input value. If the application supplies a four-digit value that is outside the supported calendar range, or if it supplies a negative value, the method throws an exception. + supports either a two-digit year or a four-digit year. Passing a two-digit year value (less than 100) causes the method to convert the value to a four-digit value according to the value representing the appropriate century. If the application supplies a four-digit year value that is within the supported calendar range to , the method returns the actual input value. If the application supplies a four-digit value that is outside the supported calendar range, or if it supplies a negative value, the method throws an exception. ]]> diff --git a/xml/System.Globalization/GregorianCalendar.xml b/xml/System.Globalization/GregorianCalendar.xml index 5f666bdd6ea..7ed376000db 100644 --- a/xml/System.Globalization/GregorianCalendar.xml +++ b/xml/System.Globalization/GregorianCalendar.xml @@ -100,7 +100,7 @@ Each supports a set of calendars. The property returns the default calendar for the culture, and the property returns an array containing all the calendars supported by the culture. To change the calendar used by a , the application can set the property to a new . - ignores punctuation in abbreviated era names, only if the is selected in and the culture uses "A.D." as the era name, that is, "A.D." is equivalent to "AD". + ignores punctuation in abbreviated era names, only if the is selected in and the culture uses "A.D." as the era name, that is, "A.D." is equivalent to "AD". @@ -296,7 +296,7 @@ If the value of the `months` parameter is negative, the resulting is earlier than the specified . - The property of the returned value always equals . You can preserve the property of the `time` parameter by calling the method, as the following example shows. + The property of the returned value always equals . You can preserve the property of the `time` parameter by calling the method, as the following example shows. :::code language="csharp" source="~/snippets/csharp/System.Globalization/Calendar/AddDays/add1.cs" id="Snippet5"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/Calendar/AddDays/add1.vb" id="Snippet5"::: @@ -423,7 +423,7 @@ If `years` is negative, the resulting is earlier than the specified . - The property of the returned value always equals . You can preserve the property of the `time` parameter by calling the method, as the following example shows. + The property of the returned value always equals . You can preserve the property of the `time` parameter by calling the method, as the following example shows. :::code language="csharp" source="~/snippets/csharp/System.Globalization/Calendar/AddDays/add1.cs" id="Snippet8"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/Calendar/AddDays/add1.vb" id="Snippet8"::: @@ -872,7 +872,7 @@ for the first day of the first month returns 1, and for the last day of the last month returns the total number of days in that year, which is the same value returned by . + The day of the year is defined as the number of days from the first day of the year. For example, for the first day of the first month returns 1, and for the last day of the last month returns the total number of days in that year, which is the same value returned by . @@ -2016,9 +2016,9 @@ is the last year in the 100-year range that can be represented by a two-digit year. The century is determined by finding the sole occurrence of the two-digit `year` within that 100-year range. For example, if is set to 2029, the 100-year range is from 1930 to 2029. Therefore, a 2-digit value of 30 is interpreted as 1930, while a 2-digit value of 29 is interpreted as 2029. + is the last year in the 100-year range that can be represented by a two-digit year. The century is determined by finding the sole occurrence of the two-digit `year` within that 100-year range. For example, if is set to 2029, the 100-year range is from 1930 to 2029. Therefore, a 2-digit value of 30 is interpreted as 1930, while a 2-digit value of 29 is interpreted as 2029. - supports either a two-digit year or a four-digit year. Passing a two-digit year value (less than 100) causes the method to convert the value to a four-digit value according to the value representing the appropriate century. If the application supplies a four-digit year value that is within the supported calendar range to , the method returns the actual input value. If the application supplies a four-digit value that is outside the supported calendar range, or if it supplies a negative value, the method throws an exception. + supports either a two-digit year or a four-digit year. Passing a two-digit year value (less than 100) causes the method to convert the value to a four-digit value according to the value representing the appropriate century. If the application supplies a four-digit year value that is within the supported calendar range to , the method returns the actual input value. If the application supplies a four-digit value that is outside the supported calendar range, or if it supplies a negative value, the method throws an exception. ]]> diff --git a/xml/System.Globalization/GregorianCalendarTypes.xml b/xml/System.Globalization/GregorianCalendarTypes.xml index da7b8589966..070ca273d37 100644 --- a/xml/System.Globalization/GregorianCalendarTypes.xml +++ b/xml/System.Globalization/GregorianCalendarTypes.xml @@ -74,17 +74,17 @@ vary depending on the language. If the is selected in , can be used to specify which date and time patterns to use in that . + The date and time patterns associated with the vary depending on the language. If the is selected in , can be used to specify which date and time patterns to use in that . For Arabic cultures, more language versions of the Gregorian calendar are available. For example, you can use the French version of using the `MiddleEastFrench` value. - A culture that supports might not support all language versions of . The and properties specify the calendars supported by that culture. If is supported, can be used to determine which language versions of are supported. + A culture that supports might not support all language versions of . The and properties specify the calendars supported by that culture. If is supported, can be used to determine which language versions of are supported. ## Examples The following code example demonstrates how to determine the GregorianCalendar language version supported by the culture. - + :::code language="csharp" source="~/snippets/csharp/System.Globalization/CultureInfo/OptionalCalendars/gregoriancalendartypes.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/CultureInfo/OptionalCalendars/gregoriancalendartypes.vb" id="Snippet1"::: diff --git a/xml/System.Globalization/HebrewCalendar.xml b/xml/System.Globalization/HebrewCalendar.xml index 8b252596acf..3eefda92796 100644 --- a/xml/System.Globalization/HebrewCalendar.xml +++ b/xml/System.Globalization/HebrewCalendar.xml @@ -105,11 +105,11 @@ |11|12|אב (Av)|30|30| |12|13|אלול (Elul)|29|29| - The days in Cheshvan and Kislev vary depending on the placement of Jewish holidays. During leap years, Adar is replaced by Adar Alef with 30 days and Adar Beit with 29 days. Adar Alef is considered the leap month. The last day of Adar Alef and all the days in Adar Beit are considered leap days; that is, the method returns `true` for these days. + The days in Cheshvan and Kislev vary depending on the placement of Jewish holidays. During leap years, Adar is replaced by Adar Alef with 30 days and Adar Beit with 29 days. Adar Alef is considered the leap month. The last day of Adar Alef and all the days in Adar Beit are considered leap days; that is, the method returns `true` for these days. The date January 1, 2001 A.D. in the Gregorian calendar is equivalent to the sixth day of Tevet in the year 5761 A.M. in the Hebrew calendar. - Each supports a set of calendars. The property returns the default calendar for the culture, and the property returns an array containing all the calendars supported by the culture. To change the calendar used by a , the application should set the property of to a new . + Each supports a set of calendars. The property returns the default calendar for the culture, and the property returns an array containing all the calendars supported by the culture. To change the calendar used by a , the application should set the property of to a new . @@ -234,7 +234,7 @@ If the value of the `months` parameter is negative, the resulting is earlier than the specified . - The property of the returned value always equals . You can preserve the property of the `time` parameter by calling the method, as the following example shows. + The property of the returned value always equals . You can preserve the property of the `time` parameter by calling the method, as the following example shows. :::code language="csharp" source="~/snippets/csharp/System.Globalization/Calendar/AddDays/add1.cs" id="Snippet5"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/Calendar/AddDays/add1.vb" id="Snippet5"::: @@ -328,7 +328,7 @@ If `years` is negative, the resulting is earlier than the specified . - The property of the returned value always equals . You can preserve the property of the `time` parameter by calling the method, as the following example shows. + The property of the returned value always equals . You can preserve the property of the `time` parameter by calling the method, as the following example shows. :::code language="csharp" source="~/snippets/csharp/System.Globalization/Calendar/AddDays/add1.cs" id="Snippet8"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/Calendar/AddDays/add1.vb" id="Snippet8"::: @@ -668,7 +668,7 @@ for the first day of the first month returns 1, and for the last day of the last month returns the total number of days in that year, which is the same value returned by . + The day of the year is defined as the number of days from the first day of the year. For example, for the first day of the first month returns 1, and for the last day of the last month returns the total number of days in that year, which is the same value returned by . This implementation of the class recognizes only the Hebrew years 5343 to 5999 (1583 to 2239 in the Gregorian calendar). @@ -982,7 +982,7 @@ method returns a number between 1 and 13 that indicates the month associated with a specified date. If there is a leap month between the eighth and ninth months of the year, the method returns 8 for the eighth month, 9 for the leap eighth month, and 10 for the ninth month. + In a calendar that supports the notion of a leap month, the leap month can occur either after a particular month or after any month in a year. For example, the method returns a number between 1 and 13 that indicates the month associated with a specified date. If there is a leap month between the eighth and ninth months of the year, the method returns 8 for the eighth month, 9 for the leap eighth month, and 10 for the ninth month. ]]> @@ -1707,7 +1707,7 @@ method is useful because it can convert any date in the current calendar to a Gregorian calendar date. The Gregorian date can subsequently be used, for example, to compare dates in different calendars or create an equivalent date in a particular calendar. + The method is useful because it can convert any date in the current calendar to a Gregorian calendar date. The Gregorian date can subsequently be used, for example, to compare dates in different calendars or create an equivalent date in a particular calendar. This implementation of the class recognizes only the Hebrew years 5343 to 5999 (1583 to 2239 in the Gregorian calendar). @@ -1791,11 +1791,11 @@ method uses the `year` parameter, the property, and a year to calculate a 4-digit year. The century is determined by finding the sole occurrence of the `year` parameter within that 100-year range. For example, if is set to 5729, the 100-year range is from 5630 to 5729. Therefore, a value of 30 is interpreted as 5630, while a value of 29 is interpreted as 5729. + The method uses the `year` parameter, the property, and a year to calculate a 4-digit year. The century is determined by finding the sole occurrence of the `year` parameter within that 100-year range. For example, if is set to 5729, the 100-year range is from 5630 to 5729. Therefore, a value of 30 is interpreted as 5630, while a value of 29 is interpreted as 5729. - If the property has the special value 99, the method ignores the settings in the regional and language options in Control Panel and returns the value of the `year` parameter unchanged. + If the property has the special value 99, the method ignores the settings in the regional and language options in Control Panel and returns the value of the `year` parameter unchanged. - supports either a two-digit year or a four-digit year. Passing a two-digit year value (less than 100) causes the method to convert the value to a four-digit value according to the value representing the appropriate century. If the application supplies a four-digit year value that is within the supported calendar range to , the method returns the actual input value. If the application supplies a four-digit value that is outside the supported calendar range, or if it supplies a negative value, the method throws an exception. + supports either a two-digit year or a four-digit year. Passing a two-digit year value (less than 100) causes the method to convert the value to a four-digit value according to the value representing the appropriate century. If the application supplies a four-digit year value that is within the supported calendar range to , the method returns the actual input value. If the application supplies a four-digit value that is outside the supported calendar range, or if it supplies a negative value, the method throws an exception. ]]> @@ -1860,7 +1860,7 @@ The initial value of this property is derived from the settings in the regional and language options portion of Control Panel. If the initial system setting changes during the life of your application the class does not automatically detect the change. - The special value 99 causes the method to ignore the system settings and return the specified year unchanged. + The special value 99 causes the method to ignore the system settings and return the specified year unchanged. ]]> diff --git a/xml/System.Globalization/HijriCalendar.xml b/xml/System.Globalization/HijriCalendar.xml index dd7400f9235..221544c5a03 100644 --- a/xml/System.Globalization/HijriCalendar.xml +++ b/xml/System.Globalization/HijriCalendar.xml @@ -107,9 +107,9 @@ The date January 1, 2001 A.D. in the Gregorian calendar is roughly equivalent to the sixth day of Shawwal in the year 1421 A.H. in the Hijri calendar. - This implementation of the class adjusts the calendar date by adding or subtracting a value from zero to two days to accommodate the variances in the start and the end of Ramadan and to accommodate the date difference between countries/regions. That value is stored in the property. If is not set explicitly, it derives its value from the settings in the regional and language options portion of Control Panel and is stored in the registry value HKEY_CURRENT_USER\Control Panel\International\AddHijriDate. However, that information can change during the life of the . The class does not detect changes in the system settings automatically. + This implementation of the class adjusts the calendar date by adding or subtracting a value from zero to two days to accommodate the variances in the start and the end of Ramadan and to accommodate the date difference between countries/regions. That value is stored in the property. If is not set explicitly, it derives its value from the settings in the regional and language options portion of Control Panel and is stored in the registry value HKEY_CURRENT_USER\Control Panel\International\AddHijriDate. However, that information can change during the life of the . The class does not detect changes in the system settings automatically. - Each supports a set of calendars. The property returns the default calendar for the culture, and the property returns an array containing all the calendars supported by the culture. To change the calendar used by a , the application should set the property of to a new . + Each supports a set of calendars. The property returns the default calendar for the culture, and the property returns an array containing all the calendars supported by the culture. To change the calendar used by a , the application should set the property of to a new . ]]> @@ -223,7 +223,7 @@ If the value of the `months` parameter is negative, the resulting is earlier than the specified . - The property of the returned value always equals . You can preserve the property of the `time` parameter by calling the method, as the following example shows. + The property of the returned value always equals . You can preserve the property of the `time` parameter by calling the method, as the following example shows. :::code language="csharp" source="~/snippets/csharp/System.Globalization/Calendar/AddDays/add1.cs" id="Snippet5"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/Calendar/AddDays/add1.vb" id="Snippet5"::: @@ -315,7 +315,7 @@ If `years` is negative, the resulting is earlier than the specified . - The property of the returned value always equals . You can preserve the property of the `time` parameter by calling the method, as the following example shows. + The property of the returned value always equals . You can preserve the property of the `time` parameter by calling the method, as the following example shows. :::code language="csharp" source="~/snippets/csharp/System.Globalization/Calendar/AddDays/add1.cs" id="Snippet8"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/Calendar/AddDays/add1.vb" id="Snippet8"::: @@ -711,7 +711,7 @@ for the first day of the first month returns 1, and for the last day of the last month returns the total number of days in that year, which is the same value returned by . + The day of the year is defined as the number of days from the first day of the year. For example, for the first day of the first month returns 1, and for the last day of the last month returns the total number of days in that year, which is the same value returned by . @@ -1026,7 +1026,7 @@ method returns a number between 1 and 13 that indicates the month associated with a specified date. If there is a leap month between the eighth and ninth months of the year, the method returns 8 for the eighth month, 9 for the leap eighth month, and 10 for the ninth month. + In a calendar that supports the notion of a leap month, the leap month can occur either after a particular month or after any month in a year. For example, the method returns a number between 1 and 13 that indicates the month associated with a specified date. If there is a leap month between the eighth and ninth months of the year, the method returns 8 for the eighth month, 9 for the leap eighth month, and 10 for the ninth month. ]]> @@ -1310,12 +1310,12 @@ class adjusts the calendar date by adding or subtracting a value from zero to two days to accommodate the variances in the start and the end of Ramadan and to accommodate the date difference between countries/regions. That value is stored in the property. If is not set explicitly, it derives its value from the settings in the regional and language options portion of Control Panel and is stored in the registry value HKEY_CURRENT_USER\Control Panel\International\AddHijriDate. However, that information can change during the life of the . The class does not detect changes in the system settings automatically. + This implementation of the class adjusts the calendar date by adding or subtracting a value from zero to two days to accommodate the variances in the start and the end of Ramadan and to accommodate the date difference between countries/regions. That value is stored in the property. If is not set explicitly, it derives its value from the settings in the regional and language options portion of Control Panel and is stored in the registry value HKEY_CURRENT_USER\Control Panel\International\AddHijriDate. However, that information can change during the life of the . The class does not detect changes in the system settings automatically. ## Examples - The following code example shows how affects the date. + The following code example shows how affects the date. :::code language="csharp" source="~/snippets/csharp/System.Globalization/HijriCalendar/HijriAdjustment/hijriadjustment.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/HijriCalendar/HijriAdjustment/hijriadjustment.vb" id="Snippet1"::: @@ -1931,9 +1931,9 @@ is the last year in the 100-year range that can be represented by a two-digit year. The century is determined by finding the sole occurrence of the two-digit `year` within that 100-year range. For example, if is set to 1429, the 100-year range is from 1330 to 1429; therefore, a 2-digit value of 30 is interpreted as 1330, while a 2-digit value of 29 is interpreted as 1429. + is the last year in the 100-year range that can be represented by a two-digit year. The century is determined by finding the sole occurrence of the two-digit `year` within that 100-year range. For example, if is set to 1429, the 100-year range is from 1330 to 1429; therefore, a 2-digit value of 30 is interpreted as 1330, while a 2-digit value of 29 is interpreted as 1429. - supports either a two-digit year or a four-digit year. Passing a two-digit year value (less than 100) causes the method to convert the value to a four-digit value according to the value representing the appropriate century. If the application supplies a four-digit year value that is within the supported calendar range to , the method returns the actual input value. If the application supplies a four-digit value that is outside the supported calendar range, or if it supplies a negative value, the method throws an exception. + supports either a two-digit year or a four-digit year. Passing a two-digit year value (less than 100) causes the method to convert the value to a four-digit value according to the value representing the appropriate century. If the application supplies a four-digit year value that is within the supported calendar range to , the method returns the actual input value. If the application supplies a four-digit value that is outside the supported calendar range, or if it supplies a negative value, the method throws an exception. ]]> diff --git a/xml/System.Globalization/IdnMapping.xml b/xml/System.Globalization/IdnMapping.xml index abe196eeebe..45f61a04e09 100644 --- a/xml/System.Globalization/IdnMapping.xml +++ b/xml/System.Globalization/IdnMapping.xml @@ -81,14 +81,14 @@ > > See [Unicode Technical Standard #46: IDNA Compatibility Processing](https://go.microsoft.com/fwlink/?LinkId=232459) for the differences in the way these standards handle particular sets of characters. - The method normalizes a domain name, converts the normalized name to a representation that consists of displayable Unicode characters in the US-ASCII code point range (U+0020 to U+007E), and prepends an ASCII-compatible encoding (ACE) prefix ("xn--") to each label. The method restores the domain name labels converted by the method. + The method normalizes a domain name, converts the normalized name to a representation that consists of displayable Unicode characters in the US-ASCII code point range (U+0020 to U+007E), and prepends an ASCII-compatible encoding (ACE) prefix ("xn--") to each label. The method restores the domain name labels converted by the method. - If the string to be converted includes the label separator characters IDEOGRAPHIC FULL STOP (U+3002), FULLWIDTH FULL STOP (U+FF0E), and HALFWIDTH IDEOGRAPHIC FULL STOP (U+FF61), the method converts them to the label separator FULL STOP (period, U+002E). The method, however, does not restore the original label separator character. + If the string to be converted includes the label separator characters IDEOGRAPHIC FULL STOP (U+3002), FULLWIDTH FULL STOP (U+FF0E), and HALFWIDTH IDEOGRAPHIC FULL STOP (U+FF61), the method converts them to the label separator FULL STOP (period, U+002E). The method, however, does not restore the original label separator character. ## Examples - The following example uses the method to convert an array of internationalized domain names to Punycode. The method then converts the Punycode domain name back to the original domain name, but replaces the original label separators with the standard label separator. + The following example uses the method to convert an array of internationalized domain names to Punycode. The method then converts the Punycode domain name back to the original domain name, but replaces the original label separators with the standard label separator. :::code language="csharp" source="~/snippets/csharp/System.Globalization/IdnMapping/Overview/conversion1.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/IdnMapping/Overview/conversion1.vb" id="Snippet1"::: @@ -142,7 +142,7 @@ and properties are initialized to `false`. A small subset of ASCII characters other than A-Z, 0-9, the hyphen (-) character (U+002D), and the period (.) character are permitted in domain names, but unassigned Unicode code points are not. + The and properties are initialized to `false`. A small subset of ASCII characters other than A-Z, 0-9, the hyphen (-) character (U+002D), and the period (.) character are permitted in domain names, but unassigned Unicode code points are not. ]]> @@ -336,14 +336,14 @@ - Characters that are prohibited by a specific version of the IDNA standard. For more information about prohibited characters, see [RFC 3454: Preparation of Internationalized Strings ("stringprep")](https://go.microsoft.com/fwlink/?LinkId=231873) for IDNA 2003, and [RFC 5982: The Unicode Code Points and Internationalized Domain Names for Applications](https://go.microsoft.com/fwlink/?LinkId=231877) for IDNA 2008. - The method converts all label separators to FULL STOP (period, U+002E). + The method converts all label separators to FULL STOP (period, U+002E). If `unicode` contains no characters outside the US-ASCII character range and no characters within the US-ASCII character range are prohibited, the method returns `unicode` unchanged. ## Examples - The following example uses the method to convert an array of internationalized domain names to Punycode, which is an encoded equivalent that consists of characters in the US-ASCII character range. The method then converts the Punycode domain name back into the original domain name, but replaces the original label separators with the standard label separator. + The following example uses the method to convert an array of internationalized domain names to Punycode, which is an encoded equivalent that consists of characters in the US-ASCII character range. The method then converts the Punycode domain name back into the original domain name, but replaces the original label separators with the standard label separator. :::code language="csharp" source="~/snippets/csharp/System.Globalization/IdnMapping/Overview/conversion1.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/IdnMapping/Overview/conversion1.vb" id="Snippet1"::: @@ -430,7 +430,7 @@ - Characters that are prohibited by a specific version of the IDNA standard. For more information about prohibited characters, see [RFC 3454: Preparation of Internationalized Strings ("stringprep")](https://go.microsoft.com/fwlink/?LinkId=231873) for IDNA 2003, and [RFC 5982: The Unicode Code Points and Internationalized Domain Names for Applications](https://go.microsoft.com/fwlink/?LinkId=231877) for IDNA 2008. - The method converts all label separators to FULL STOP (period, U+002E). + The method converts all label separators to FULL STOP (period, U+002E). If `unicode` contains no characters outside the US-ASCII character range and no characters within the US-ASCII character range are prohibited, the method returns `unicode` unchanged. @@ -526,12 +526,12 @@ - Characters that are prohibited by a specific version of the IDNA standard. For more information about prohibited characters, see [RFC 3454: Preparation of Internationalized Strings ("stringprep")](https://go.microsoft.com/fwlink/?LinkId=231873) for IDNA 2003, and [RFC 5982: The Unicode Code Points and Internationalized Domain Names for Applications](https://go.microsoft.com/fwlink/?LinkId=231877) for IDNA 2008. - The method converts all label separators to FULL STOP (period, U+002E). If the substring contains no characters outside the US-ASCII character range, and no characters within the US-ASCII character range are prohibited, the method returns the substring unchanged. + The method converts all label separators to FULL STOP (period, U+002E). If the substring contains no characters outside the US-ASCII character range, and no characters within the US-ASCII character range are prohibited, the method returns the substring unchanged. ## Examples - The following example uses the method to convert an internationalized domain name to a domain name that complies with the IDNA standard. The method then converts the standardized domain name back into the original domain name, but replaces the original label separators with the standard label separator. + The following example uses the method to convert an internationalized domain name to a domain name that complies with the IDNA standard. The method then converts the standardized domain name back into the original domain name, but replaces the original label separators with the standard label separator. :::code language="csharp" source="~/snippets/csharp/System.Globalization/IdnMapping/GetAscii/getx.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/IdnMapping/GetAscii/getx.vb" id="Snippet1"::: @@ -611,12 +611,12 @@ method if your application needs to implement a meaningful hash code algorithm. + Override the method if your application needs to implement a meaningful hash code algorithm. ## Examples - The following example assumes that a single string can contain multiple email addresses separated by spaces. It removes the local part and the @ character from each email address, and passes the resulting domain name to the or method to create a Punycode domain name. The method then converts the Punycode domain name back into the original domain name. + The following example assumes that a single string can contain multiple email addresses separated by spaces. It removes the local part and the @ character from each email address, and passes the resulting domain name to the or method to create a Punycode domain name. The method then converts the Punycode domain name back into the original domain name. :::code language="csharp" source="~/snippets/csharp/System.Globalization/IdnMapping/GetHashCode/conversion1b.cs" id="Snippet3"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/IdnMapping/GetHashCode/conversion1b.vb" id="Snippet3"::: @@ -685,12 +685,12 @@ method. + For more information about domain names, labels, and label separators, see the remarks for the method. ## Examples - The following example uses the method to convert an array of internationalized domain names to Punycode. The method then converts the Punycode domain name back into the original domain name, but replaces the original label separators with the standard label separator. + The following example uses the method to convert an array of internationalized domain names to Punycode. The method then converts the Punycode domain name back into the original domain name, but replaces the original label separators with the standard label separator. :::code language="csharp" source="~/snippets/csharp/System.Globalization/IdnMapping/Overview/conversion1.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/IdnMapping/Overview/conversion1.vb" id="Snippet1"::: @@ -756,7 +756,7 @@ method. + For more information about domain names, labels, and label separators, see the remarks for the method. ]]> @@ -827,7 +827,7 @@ method. + For more information about domain names, labels, and label separators, see the remarks for the method. ]]> @@ -965,7 +965,7 @@ is `true`, only standard characters can appear in a label returned by the method. + Domain names that follow standard naming rules consist of a specific subset of characters in the US-ASCII character range. The characters are the letters A through Z, the digits 0 through 9, the hyphen (-) character (U+002D), and the period (.) character. The case of the characters is not significant. Relaxed naming conventions allow the use of a broader range of ASCII characters, including the space character (U+0020), the exclamation point character (U+0021), and the underbar character (U+005F). If is `true`, only standard characters can appear in a label returned by the method. By default, the value of the property is `false`, and an expanded subset of ASCII characters is permitted in a label. @@ -975,7 +975,7 @@ ## Examples - The following example generates URLs that contain characters in the ASCII range from U+0000 to U+007F and passes them to the method of two objects. One object has its property set to `true`, and the other object has it set to `false`. The output displays the characters that are invalid when the property is `true` but valid when it is `false`. + The following example generates URLs that contain characters in the ASCII range from U+0000 to U+007F and passes them to the method of two objects. One object has its property set to `true`, and the other object has it set to `false`. The output displays the characters that are invalid when the property is `true` but valid when it is `false`. :::code language="csharp" source="~/snippets/csharp/System.Globalization/IdnMapping/UseStd3AsciiRules/usestd3asciirules1.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/IdnMapping/UseStd3AsciiRules/usestd3asciirules1.vb" id="Snippet1"::: diff --git a/xml/System.Globalization/JapaneseCalendar.xml b/xml/System.Globalization/JapaneseCalendar.xml index 55b14e6289e..605f60cd700 100644 --- a/xml/System.Globalization/JapaneseCalendar.xml +++ b/xml/System.Globalization/JapaneseCalendar.xml @@ -123,7 +123,7 @@ Nigatsu, which is equivalent to the Gregorian calendar month of February, has 29 The date January 1, 2001 A.D. in the Gregorian calendar is equivalent to the first day of Ichigatsu in the year Heisei 13 in the Japanese calendar. -If the is the current calendar of the Japanese culture, recognizes the era abbreviations in front of the year. The abbreviation is either the single-character case-insensitive Latin alphabet abbreviation or the single-character Kanji abbreviation. also recognizes either "1" or Gannen (元年) as the first year of an era. +If the is the current calendar of the Japanese culture, recognizes the era abbreviations in front of the year. The abbreviation is either the single-character case-insensitive Latin alphabet abbreviation or the single-character Kanji abbreviation. also recognizes either "1" or Gannen (元年) as the first year of an era. Each object supports a set of calendars. The property returns the default calendar for the culture, and the property returns an array containing all the calendars supported by the culture. To change the calendar used by a , set the property to a new . @@ -239,7 +239,7 @@ For example, if the specified month is Juugatsu (October), which has 31 days, th If `months` is negative, the resulting is earlier than the specified . -The property of the returned value always equals . You can preserve the property of the `time` parameter by calling the method, as the following example shows. +The property of the returned value always equals . You can preserve the property of the `time` parameter by calling the method, as the following example shows. :::code language="csharp" source="~/snippets/csharp/System.Globalization/Calendar/AddDays/add1.cs" id="Snippet5"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/Calendar/AddDays/add1.vb" id="Snippet5"::: @@ -329,7 +329,7 @@ For example, Nigatsu (February) has 28 days except during leap years when it has If `years` is negative, the resulting is earlier than the specified . -The property of the returned value always equals . You can preserve the property of the `time` parameter by calling the method, as the following example shows. +The property of the returned value always equals . You can preserve the property of the `time` parameter by calling the method, as the following example shows. :::code language="csharp" source="~/snippets/csharp/System.Globalization/Calendar/AddDays/add1.cs" id="Snippet8"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/Calendar/AddDays/add1.vb" id="Snippet8"::: @@ -701,7 +701,7 @@ The following code example displays the values of several components of a for the first day of the first month returns 1, and for the last day of the last month returns the total number of days in that year, which is the same value as that returned by . +The day of the year is defined as the number of days from the first day of the year. For example, for the first day of the first month returns 1, and for the last day of the last month returns the total number of days in that year, which is the same value as that returned by . ## Examples @@ -780,7 +780,7 @@ For example, this method returns 28 or 29 for Nigatsu (February, `month` = 2), d ## Examples -The following code example calls for the second month in each of five years in each era. +The following code example calls for the second month in each of five years in each era. :::code language="csharp" source="~/snippets/csharp/System.Globalization/JapaneseCalendar/GetDaysInMonth/japanesecalendar_getdaysinmonth.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/JapaneseCalendar/GetDaysInMonth/japanesecalendar_getdaysinmonth.vb" id="Snippet1"::: @@ -860,7 +860,7 @@ For example, this method returns 365 or 366, depending on whether `year` is a le ## Examples -The following example calls for five years in each era. +The following example calls for five years in each era. :::code language="csharp" source="~/snippets/csharp/System.Globalization/JapaneseCalendar/GetDaysInYear/japanesecalendar_getdaysinyear.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/JapaneseCalendar/GetDaysInYear/japanesecalendar_getdaysinyear.vb" id="Snippet1"::: @@ -944,7 +944,7 @@ This class assigns numbers to the eras as follows: | 2 | 大正 (Taisho) | 大 (T, t) | July 30, 1912 to December 24, 1926 | | 1 | 明治 (Meiji) | 明 (M, m) | October 23, 1868 to July 29, 1912 | -Ordinarily, the class supports dates from October 23 in the year Meiji 1 (October 23, 1868 of the Gregorian calendar), which is the value of the property in .NET 11 and later versions. However, the method successfully returns the era for dates from January 1 through October 22 in the year Meiji 1 (January 1, 1868 through October 22, 1868 in the Gregorian calendar). For dates earlier than January 1, 1868 in the Gregorian calendar, the method throws an exception. +Ordinarily, the class supports dates from October 23 in the year Meiji 1 (October 23, 1868 of the Gregorian calendar), which is the value of the property in .NET 11 and later versions. However, the method successfully returns the era for dates from January 1 through October 22 in the year Meiji 1 (January 1, 1868 through October 22, 1868 in the Gregorian calendar). For dates earlier than January 1, 1868 in the Gregorian calendar, the method throws an exception. ## Examples @@ -1029,7 +1029,7 @@ The following example displays the values of several components of a method returns a number between 1 and 13 that indicates the month associated with a specified date. If there is a leap month between the eighth and ninth months of the year, the method returns 8 for the eighth month, 9 for the leap eighth month, and 10 for the ninth month. +In a calendar that supports the notion of a leap month, the leap month can occur either after a particular month or after any month in a year. For example, the method returns a number between 1 and 13 that indicates the month associated with a specified date. If there is a leap month between the eighth and ninth months of the year, the method returns 8 for the eighth month, 9 for the leap eighth month, and 10 for the ninth month. ]]> @@ -1165,7 +1165,7 @@ The following example displays the values of several components of a for the first five years in each era. Because the class supports only 12-month years, it indicates that there are 12 months in each of the eras supported by the class. +The following example calls for the first five years in each era. Because the class supports only 12-month years, it indicates that there are 12 months in each of the eras supported by the class. :::code language="csharp" source="~/snippets/csharp/System.Globalization/JapaneseCalendar/GetMonthsInYear/japanesecalendar_getmonthsinyear.cs"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/JapaneseCalendar/GetMonthsInYear/japanesecalendar_getmonthsinyear.vb"::: @@ -1248,15 +1248,15 @@ This method can be used to determine the number of weeks in the year by setting The property contains culture-specific values that can be used for the `rule` and `firstDayOfWeek` parameters. -The property of contains the default value that represents the first day of the week for a specific culture, using the calendar specified in the property of . +The property of contains the default value that represents the first day of the week for a specific culture, using the calendar specified in the property of . -The property of contains the default value that defines a calendar week for a specific culture, using the calendar specified in the property of . +The property of contains the default value that defines a calendar week for a specific culture, using the calendar specified in the property of . -For example, in , the method for January 1 returns 1. +For example, in , the method for January 1 returns 1. ## Examples -The following code example shows how the result of varies depending on the and values used. If the specified date is the last day of the year, returns the total number of weeks in that year. +The following code example shows how the result of varies depending on the and values used. If the specified date is the last day of the year, returns the total number of weeks in that year. :::code language="csharp" source="~/snippets/csharp/System.Globalization/Calendar/GetWeekOfYear/yslin_calendar_getweekofyear.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/Calendar/GetWeekOfYear/yslin_calendar_getweekofyear.vb" id="Snippet1"::: @@ -1408,7 +1408,7 @@ A leap day is a day that occurs only in a leap year. For example, the 29th day o ## Examples -The following example calls for the last day of the second month (February) for five years in each of the eras. The current era in the example output is the Reiwa era. +The following example calls for the last day of the second month (February) for five years in each of the eras. The current era in the example output is the Reiwa era. :::code language="csharp" source="~/snippets/csharp/System.Globalization/JapaneseCalendar/IsLeapDay/japanesecalendar_isleapday.cs"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/JapaneseCalendar/IsLeapDay/japanesecalendar_isleapday.vb"::: @@ -1498,7 +1498,7 @@ A leap month is an entire month that occurs only in a leap year. The Japanese ca ## Examples -The following example calls for all the months in the first five years in the current era. +The following example calls for all the months in the first five years in the current era. :::code language="csharp" source="~/snippets/csharp/System.Globalization/JapaneseCalendar/IsLeapMonth/japanesecalendar_isleapmonth.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/JapaneseCalendar/IsLeapMonth/japanesecalendar_isleapmonth.vb" id="Snippet1"::: @@ -1580,7 +1580,7 @@ Leap years in the Japanese calendar correspond to the same leap years in the Gre ## Examples -The following example calls for five years in each of the eras. The current era in the example output is the Reiwa era. +The following example calls for five years in each of the eras. The current era in the example output is the Reiwa era. :::code language="csharp" source="~/snippets/csharp/System.Globalization/JapaneseCalendar/IsLeapYear/japanesecalendar_isleapyear.cs"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/JapaneseCalendar/IsLeapYear/japanesecalendar_isleapyear.vb"::: @@ -1714,7 +1714,7 @@ The following code example gets the minimum value and the maximum value of the c class is October 23, 1868 C.E., in the first year of the Meiji era. Ordinarily, date and time operations that use the class throw an exception for dates before this date. However, some members, such as the method, support dates from January 1, 1868 through October 22 in the year Meiji 1. +The earliest date supported by the class is October 23, 1868 C.E., in the first year of the Meiji era. Ordinarily, date and time operations that use the class throw an exception for dates before this date. However, some members, such as the method, support dates from January 1, 1868 through October 22 in the year Meiji 1. > [!NOTE] > In .NET Framework versions and in .NET Core 1.0 through .NET 10, this property returns a date and time representing the first moment of September 8, 1868 C.E. in the Gregorian calendar. @@ -1795,7 +1795,7 @@ The following example gets the earliest and latest dates supported by the calend method is useful because it can convert any date in the current calendar to a Gregorian calendar date. The Gregorian date can subsequently be used, for example, to compare dates in different calendars or create an equivalent date in a particular calendar. +The method is useful because it can convert any date in the current calendar to a Gregorian calendar date. The Gregorian date can subsequently be used, for example, to compare dates in different calendars or create an equivalent date in a particular calendar. Because the supports multiple eras based on the reign of the emperor, you should always call this method and explicitly specify an era to avoid an unintended date and to make the intent of your code clear. The example shows how to instantiate a date that is always in the current era and one that belongs to a specified era. @@ -1896,11 +1896,11 @@ The following example instantiates two dates. The first is always the first day . +This method implements . Because the year in the Japanese calendar is typically less than four digits long, this implementation always returns the value of the `year` parameter. - supports either a two-digit year or a four-digit year. However, a valid year is generally represented as two digits (less than 100). Passing a two-digit year value causes the method to convert the value to a four-digit value according to the value representing the appropriate century. If the application supplies a four-digit value, or if it supplies zero or a negative value, throws an exception. + supports either a two-digit year or a four-digit year. However, a valid year is generally represented as two digits (less than 100). Passing a two-digit year value causes the method to convert the value to a four-digit value according to the value representing the appropriate century. If the application supplies a four-digit value, or if it supplies zero or a negative value, throws an exception. ]]> @@ -1956,9 +1956,9 @@ Because the year in the Japanese calendar is typically less than four digits lon . +This property implements . -Because the year in the Japanese calendar is typically less than four digits long, this implementation returns 99 by default and does not affect the return value of . +Because the year in the Japanese calendar is typically less than four digits long, this implementation returns 99 by default and does not affect the return value of . ]]> diff --git a/xml/System.Globalization/JapaneseLunisolarCalendar.xml b/xml/System.Globalization/JapaneseLunisolarCalendar.xml index 62db083e5fb..593747cf59d 100644 --- a/xml/System.Globalization/JapaneseLunisolarCalendar.xml +++ b/xml/System.Globalization/JapaneseLunisolarCalendar.xml @@ -74,7 +74,7 @@ class is derived from the class, which represents the lunisolar calendar. The class supports the sexagenary year cycle (which repeats every 60 years) in addition to solar years and lunar months. Each solar year in the calendar is associated with a Sexagenary Year, a Celestial Stem, and a Terrestrial Branch, and these calendars can have leap months after any month of the year. The method returns a number between 1 and 13 that indicates the month associated with a specified date. If there is a leap month between the eighth and ninth months of the year, the method returns 8 for the eighth month, 9 for the leap eighth month, and 10 for the ninth month. + The class is derived from the class, which represents the lunisolar calendar. The class supports the sexagenary year cycle (which repeats every 60 years) in addition to solar years and lunar months. Each solar year in the calendar is associated with a Sexagenary Year, a Celestial Stem, and a Terrestrial Branch, and these calendars can have leap months after any month of the year. The method returns a number between 1 and 13 that indicates the month associated with a specified date. If there is a leap month between the eighth and ninth months of the year, the method returns 8 for the eighth month, 9 for the leap eighth month, and 10 for the ninth month. > [!NOTE] > For information about using the class and the other calendar classes in the .NET Class Library, see [Working with Calendars](/dotnet/standard/datetime/working-with-calendars). @@ -248,7 +248,7 @@ Unlike the class, the `JapaneseLuni [!INCLUDE[japanese-era-note](~/includes/calendar-era.md)] -While the defines the Meiji and Taisho eras (eras 1 and 2, respectively), the calendar does not support dates in their ranges. For example, a call to or with a date in those era ranges throws an . +While the defines the Meiji and Taisho eras (eras 1 and 2, respectively), the calendar does not support dates in their ranges. For example, a call to or with a date in those era ranges throws an . The property returns the same values as the property. diff --git a/xml/System.Globalization/JulianCalendar.xml b/xml/System.Globalization/JulianCalendar.xml index f2483a15884..59547a543e8 100644 --- a/xml/System.Globalization/JulianCalendar.xml +++ b/xml/System.Globalization/JulianCalendar.xml @@ -94,7 +94,7 @@ Currently, the is not used by any of the cultures supported by the class. Therefore, the class can be used only to calculate dates in the Julian calendar. - Each object supports a set of calendars. The property returns the default calendar for the culture, and the property returns an array containing all the calendars supported by the culture. To change the calendar used by a , the application should set the property of to a new . + Each object supports a set of calendars. The property returns the default calendar for the culture, and the property returns an array containing all the calendars supported by the culture. To change the calendar used by a , the application should set the property of to a new . ]]> @@ -208,7 +208,7 @@ If the value of the `months` parameter is negative, the resulting is earlier than the specified . - The property of the returned value always equals . You can preserve the property of the `time` parameter by calling the method, as the following example shows. + The property of the returned value always equals . You can preserve the property of the `time` parameter by calling the method, as the following example shows. :::code language="csharp" source="~/snippets/csharp/System.Globalization/Calendar/AddDays/add1.cs" id="Snippet5"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/Calendar/AddDays/add1.vb" id="Snippet5"::: @@ -300,7 +300,7 @@ If `years` is negative, the resulting is earlier than the specified . - The property of the returned value always equals . You can preserve the property of the `time` parameter by calling the method, as the following example shows. + The property of the returned value always equals . You can preserve the property of the `time` parameter by calling the method, as the following example shows. :::code language="csharp" source="~/snippets/csharp/System.Globalization/Calendar/AddDays/add1.cs" id="Snippet8"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/Calendar/AddDays/add1.vb" id="Snippet8"::: @@ -636,7 +636,7 @@ for the first day of the first month returns 1, and for the last day of the last month returns the total number of days in that year. The total is the same value as that returned by . + The day of the year is defined as the number of days from the first day of the year. For example, for the first day of the first month returns 1, and for the last day of the last month returns the total number of days in that year. The total is the same value as that returned by . @@ -718,7 +718,7 @@ ## Examples - The following example calls for the second month in each of five years in each era. + The following example calls for the second month in each of five years in each era. :::code language="csharp" source="~/snippets/csharp/System.Globalization/JulianCalendar/GetDaysInMonth/juliancalendar_getdaysinmonth.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/JulianCalendar/GetDaysInMonth/juliancalendar_getdaysinmonth.vb" id="Snippet1"::: @@ -801,7 +801,7 @@ ## Examples - The following example calls for five years in each era. + The following example calls for five years in each era. :::code language="csharp" source="~/snippets/csharp/System.Globalization/JulianCalendar/GetDaysInYear/juliancalendar_getdaysinyear.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/JulianCalendar/GetDaysInYear/juliancalendar_getdaysinyear.vb" id="Snippet1"::: @@ -960,7 +960,7 @@ method returns a number between 1 and 13 that indicates the month associated with a specified date. If there is a leap month between the eighth and ninth months of the year, the method returns 8 for the eighth month, 9 for the leap eighth month, and 10 for the ninth month. + In a calendar that supports the notion of a leap month, the leap month can occur either after a particular month or after any month in a year. For example, the method returns a number between 1 and 13 that indicates the month associated with a specified date. If there is a leap month between the eighth and ninth months of the year, the method returns 8 for the eighth month, 9 for the leap eighth month, and 10 for the ninth month. ]]> @@ -1092,7 +1092,7 @@ for five years in each era. + The following example calls for five years in each era. :::code language="csharp" source="~/snippets/csharp/System.Globalization/JulianCalendar/GetMonthsInYear/juliancalendar_getmonthsinyear.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/JulianCalendar/GetMonthsInYear/juliancalendar_getmonthsinyear.vb" id="Snippet1"::: @@ -1250,7 +1250,7 @@ ## Examples - The following example calls for the last day of the second month (February) for five years in each of the eras. + The following example calls for the last day of the second month (February) for five years in each of the eras. :::code language="csharp" source="~/snippets/csharp/System.Globalization/JulianCalendar/IsLeapDay/juliancalendar_isleapday.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/JulianCalendar/IsLeapDay/juliancalendar_isleapday.vb" id="Snippet1"::: @@ -1343,7 +1343,7 @@ ## Examples - The following example calls for all the months in five years in the current era. + The following example calls for all the months in five years in the current era. :::code language="csharp" source="~/snippets/csharp/System.Globalization/JulianCalendar/IsLeapMonth/juliancalendar_isleapmonth.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/JulianCalendar/IsLeapMonth/juliancalendar_isleapmonth.vb" id="Snippet1"::: @@ -1428,7 +1428,7 @@ ## Examples - The following example calls for five years in each of the eras. + The following example calls for five years in each of the eras. :::code language="csharp" source="~/snippets/csharp/System.Globalization/JulianCalendar/IsLeapYear/juliancalendar_isleapyear.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/JulianCalendar/IsLeapYear/juliancalendar_isleapyear.vb" id="Snippet1"::: @@ -1778,9 +1778,9 @@ is the last year in the 100-year range that can be represented by a two-digit year. The century is determined by finding the sole occurrence of the specified `year` within that 100-year range. For example, if is set to 2029, the 100-year range is from 1930 to 2029. Therefore, a 2-digit value of 30 is interpreted as 1930, while a 2-digit value of 29 is interpreted as 2029. + is the last year in the 100-year range that can be represented by a two-digit year. The century is determined by finding the sole occurrence of the specified `year` within that 100-year range. For example, if is set to 2029, the 100-year range is from 1930 to 2029. Therefore, a 2-digit value of 30 is interpreted as 1930, while a 2-digit value of 29 is interpreted as 2029. - supports either a two-digit year or a four-digit year. Passing a two-digit year value (less than 100) causes the method to convert the value to a four-digit value according to the value representing the appropriate century. If the application supplies a four-digit year value that is within the supported calendar range to , the method returns the actual input value. If the application supplies a four-digit value that is outside the supported calendar range, or if it supplies a negative value, the method throws an exception. + supports either a two-digit year or a four-digit year. Passing a two-digit year value (less than 100) causes the method to convert the value to a four-digit value according to the value representing the appropriate century. If the application supplies a four-digit year value that is within the supported calendar range to , the method returns the actual input value. If the application supplies a four-digit value that is outside the supported calendar range, or if it supplies a negative value, the method throws an exception. ]]> diff --git a/xml/System.Globalization/KoreanCalendar.xml b/xml/System.Globalization/KoreanCalendar.xml index 1eed15706a2..c2a22f61f16 100644 --- a/xml/System.Globalization/KoreanCalendar.xml +++ b/xml/System.Globalization/KoreanCalendar.xml @@ -110,7 +110,7 @@ The date January 1, 2001 A.D. in the Gregorian calendar is equivalent to the first day of January in the year 4334 of the current era in the Korean calendar. - Each object supports a set of calendars. The property returns the default calendar for the culture, and the property returns an array containing all the calendars supported by the culture. To change the calendar used by a , the application should set the property of to a new . + Each object supports a set of calendars. The property returns the default calendar for the culture, and the property returns an array containing all the calendars supported by the culture. To change the calendar used by a , the application should set the property of to a new . ]]> @@ -225,7 +225,7 @@ If the value of the `months` parameter is negative, the resulting is earlier than the specified . - The property of the returned value always equals . You can preserve the property of the `time` parameter by calling the method, as the following example shows. + The property of the returned value always equals . You can preserve the property of the `time` parameter by calling the method, as the following example shows. :::code language="csharp" source="~/snippets/csharp/System.Globalization/Calendar/AddDays/add1.cs" id="Snippet5"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/Calendar/AddDays/add1.vb" id="Snippet5"::: @@ -316,7 +316,7 @@ If `years` is negative, the resulting is earlier than the specified . - The property of the returned value always equals . You can preserve the property of the `time` parameter by calling the method, as the following example shows. + The property of the returned value always equals . You can preserve the property of the `time` parameter by calling the method, as the following example shows. :::code language="csharp" source="~/snippets/csharp/System.Globalization/Calendar/AddDays/add1.cs" id="Snippet8"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/Calendar/AddDays/add1.vb" id="Snippet8"::: @@ -663,7 +663,7 @@ for the first day of the first month returns 1, and for the last day of the last month returns the total number of days in that year. The total is the same value as that returned by . + The day of the year is defined as the number of days from the first day of the year. For example, for the first day of the first month returns 1, and for the last day of the last month returns the total number of days in that year. The total is the same value as that returned by . @@ -828,7 +828,7 @@ ## Examples - The following example calls for five years in each era. + The following example calls for five years in each era. :::code language="csharp" source="~/snippets/csharp/System.Globalization/KoreanCalendar/GetDaysInYear/koreancalendar_getdaysinyear.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/KoreanCalendar/GetDaysInYear/koreancalendar_getdaysinyear.vb" id="Snippet1"::: @@ -987,7 +987,7 @@ method returns a number between 1 and 13 that indicates the month associated with a specified date. If there is a leap month between the eighth and ninth months of the year, the method returns 8 for the eighth month, 9 for the leap eighth month, and 10 for the ninth month. + In a calendar that supports the notion of a leap month, the leap month can occur either after a particular month or after any month in a year. For example, the method returns a number between 1 and 13 that indicates the month associated with a specified date. If there is a leap month between the eighth and ninth months of the year, the method returns 8 for the eighth month, 9 for the leap eighth month, and 10 for the ninth month. ]]> @@ -1119,7 +1119,7 @@ for five years in each era. + The following example calls for five years in each era. :::code language="csharp" source="~/snippets/csharp/System.Globalization/KoreanCalendar/GetMonthsInYear/koreancalendar_getmonthsinyear.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/KoreanCalendar/GetMonthsInYear/koreancalendar_getmonthsinyear.vb" id="Snippet1"::: @@ -1202,18 +1202,18 @@ ## Remarks This method can be used to determine the number of weeks in the year by setting the `time` parameter to the last day of the year. - contains culture-specific values that can be used for the `rule` and `firstDayOfWeek` parameters. + contains culture-specific values that can be used for the `rule` and `firstDayOfWeek` parameters. - The property of contains the default value that represents the first day of the week for a specific culture, using the calendar specified in the property of . + The property of contains the default value that represents the first day of the week for a specific culture, using the calendar specified in the property of . - The property of contains the default value that defines a calendar week for a specific culture, using the calendar specified in the property of . + The property of contains the default value that defines a calendar week for a specific culture, using the calendar specified in the property of . - For example, in , for January 1 returns 1. + For example, in , for January 1 returns 1. ## Examples - The following code example shows how the result of varies depending on the and values used. If the specified date is the last day of the year, returns the total number of weeks in that year. + The following code example shows how the result of varies depending on the and values used. If the specified date is the last day of the year, returns the total number of weeks in that year. :::code language="csharp" source="~/snippets/csharp/System.Globalization/Calendar/GetWeekOfYear/yslin_calendar_getweekofyear.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/Calendar/GetWeekOfYear/yslin_calendar_getweekofyear.vb" id="Snippet1"::: @@ -1366,7 +1366,7 @@ ## Examples - The following example calls for the last day of the second month (February) for five years in each of the eras. + The following example calls for the last day of the second month (February) for five years in each of the eras. :::code language="csharp" source="~/snippets/csharp/System.Globalization/KoreanCalendar/IsLeapDay/koreancalendar_isleapday.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/KoreanCalendar/IsLeapDay/koreancalendar_isleapday.vb" id="Snippet1"::: @@ -1459,7 +1459,7 @@ ## Examples - The following example calls for all the months in five years in the current era. + The following example calls for all the months in five years in the current era. :::code language="csharp" source="~/snippets/csharp/System.Globalization/KoreanCalendar/IsLeapMonth/koreancalendar_isleapmonth.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/KoreanCalendar/IsLeapMonth/koreancalendar_isleapmonth.vb" id="Snippet1"::: @@ -1544,7 +1544,7 @@ ## Examples - The following example calls for five years in each of the eras. + The following example calls for five years in each of the eras. :::code language="csharp" source="~/snippets/csharp/System.Globalization/KoreanCalendar/IsLeapYear/koreancalendar_isleapyear.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/KoreanCalendar/IsLeapYear/koreancalendar_isleapyear.vb" id="Snippet1"::: @@ -1895,9 +1895,9 @@ defines the last year in the 100-year range that can be represented by . The century is determined by finding the sole occurrence of the two-digit year within that 100-year range. For example, if is set to 2029, the 100-year range is from 1930 to 2029. Therefore, a two-digit value of 30 is interpreted as 1930, while a two-digit value of 29 is interpreted as 2029. + defines the last year in the 100-year range that can be represented by . The century is determined by finding the sole occurrence of the two-digit year within that 100-year range. For example, if is set to 2029, the 100-year range is from 1930 to 2029. Therefore, a two-digit value of 30 is interpreted as 1930, while a two-digit value of 29 is interpreted as 2029. - supports either a two-digit year or a four-digit year. Passing a two-digit year value (less than 100) causes the method to convert the value to a four-digit value according to the value representing the appropriate century. If the application supplies a four-digit year value that is within the supported calendar range to , the method returns the actual input value. If the application supplies a four-digit value that is outside the supported calendar range, or if it supplies a negative value, the method throws an exception. + supports either a two-digit year or a four-digit year. Passing a two-digit year value (less than 100) causes the method to convert the value to a four-digit value according to the value representing the appropriate century. If the application supplies a four-digit year value that is within the supported calendar range to , the method returns the actual input value. If the application supplies a four-digit value that is outside the supported calendar range, or if it supplies a negative value, the method throws an exception. ]]> diff --git a/xml/System.Globalization/KoreanLunisolarCalendar.xml b/xml/System.Globalization/KoreanLunisolarCalendar.xml index ad915b98698..c305fa2c5a6 100644 --- a/xml/System.Globalization/KoreanLunisolarCalendar.xml +++ b/xml/System.Globalization/KoreanLunisolarCalendar.xml @@ -81,11 +81,11 @@ The class calculates years using the Gregorian calendar, and days and months using the class. - A leap month can occur after any month in a year. For example, the method returns a number between 1 and 13 that indicates the month associated with a specified date. If there is a leap month between the eighth and ninth months of the year, the method returns 8 for the eighth month, 9 for the leap eighth month, and 10 for the ninth month. + A leap month can occur after any month in a year. For example, the method returns a number between 1 and 13 that indicates the month associated with a specified date. If there is a leap month between the eighth and ninth months of the year, the method returns 8 for the eighth month, 9 for the leap eighth month, and 10 for the ninth month. Currently, the is not used by any of the cultures supported by the class. Therefore, this class can be used only to calculate dates in the Korean lunisolar calendar. - Each supports a set of calendars. The property returns the default calendar for the culture, and the property returns an array containing all the calendars supported by the culture. To change the calendar used by a , the application should set the property of to a new . + Each supports a set of calendars. The property returns the default calendar for the culture, and the property returns an array containing all the calendars supported by the culture. To change the calendar used by a , the application should set the property of to a new . ]]> diff --git a/xml/System.Globalization/NumberFormatInfo.xml b/xml/System.Globalization/NumberFormatInfo.xml index 0140c0be354..3a22b1daaa6 100644 --- a/xml/System.Globalization/NumberFormatInfo.xml +++ b/xml/System.Globalization/NumberFormatInfo.xml @@ -229,7 +229,7 @@ A shallow copy of an object is a copy of the object only. If the object contains references to other objects, the shallow copy will not create copies of the referred objects. It will refer to the original objects instead. On the other hand, a deep copy of an object creates a copy of the object and a copy of everything directly or indirectly referenced by that object. In the case of a object, a shallow copy is sufficient for copying all instance properties, because all properties that return object references are `static` (`Shared` in Visual Basic). ## Examples - The following example uses the method to create a read/write copy of a object that represents the numeric formatting conventions of the current culture. + The following example uses the method to create a read/write copy of a object that represents the numeric formatting conventions of the current culture. :::code language="csharp" source="~/snippets/csharp/System.Globalization/NumberFormatInfo/Clone/isreadonly1.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/NumberFormatInfo/Clone/isreadonly1.vb" id="Snippet1"::: @@ -505,7 +505,7 @@ On Windows, the initial value of this property is derived from the settings in t ## Remarks The property is used with the "C" standard format string to define the number of digits that appear in integral groups. For more information, see [Standard Numeric Format Strings](/dotnet/standard/base-types/standard-numeric-format-strings). Every element in the one-dimensional array must be an integer from 1 through 9. The last element can be 0. - The first element of the array defines the number of elements in the least significant group of digits immediately to the left of the . Each subsequent element refers to the next significant group of digits to the left of the previous group. If the last element of the array is not 0, the remaining digits are grouped based on the last element of the array. If the last element is 0, the remaining digits are not grouped. + The first element of the array defines the number of elements in the least significant group of digits immediately to the left of the . Each subsequent element refers to the next significant group of digits to the left of the previous group. If the last element of the array is not 0, the remaining digits are grouped based on the last element of the array. If the last element is 0, the remaining digits are not grouped. For example, if the array contains { 3, 4, 5 }, the digits are grouped similar to "\\$55,55555,55555,55555,4444,333.00". If the array contains { 3, 4, 0 }, the digits are grouped similar to "\\$55555555555555555,4444,333.00". @@ -582,7 +582,7 @@ On Windows, the initial value of this property is derived from the settings in t property is used with the "C" standard format string to define the pattern of negative currency values. For more information, see [Standard Numeric Format Strings](/dotnet/standard/base-types/standard-numeric-format-strings). This property has one of the values in the following table. The symbol "$" is the , the symbol "-" is the , and `n` is a number. + The property is used with the "C" standard format string to define the pattern of negative currency values. For more information, see [Standard Numeric Format Strings](/dotnet/standard/base-types/standard-numeric-format-strings). This property has one of the values in the following table. The symbol "$" is the , the symbol "-" is the , and `n` is a number. | Value | Associated pattern | |-------|--------------------| @@ -672,7 +672,7 @@ On Windows, the initial value of this property is derived from the settings in t property is used with the "C" standard format string to define pattern of positive currency values. For more information, see [Standard Numeric Format Strings](/dotnet/standard/base-types/standard-numeric-format-strings). This property has one of the values in the following table. The symbol "$" is the and `n` is a number. + The property is used with the "C" standard format string to define pattern of positive currency values. For more information, see [Standard Numeric Format Strings](/dotnet/standard/base-types/standard-numeric-format-strings). This property has one of the values in the following table. The symbol "$" is the and `n` is a number. | Value | Associated pattern | |-------|--------------------| @@ -824,7 +824,7 @@ The pattern does not support a positive sign. Retrieving a object from the property is equivalent to retrieving a object from the `CultureInfo.CurrentCulture.NumberFormat` property. ## Examples - The following example shows that the objects returned by the and `CultureInfo.CurrentCulture.NumberFormat` properties are identical. It then uses reflection to display the property values of the object returned by the property on a system whose current culture is en-US. + The following example shows that the objects returned by the and `CultureInfo.CurrentCulture.NumberFormat` properties are identical. It then uses reflection to display the property values of the object returned by the property on a system whose current culture is en-US. :::code language="csharp" source="~/snippets/csharp/System.Globalization/NumberFormatInfo/CurrentInfo/currentinfo1.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/NumberFormatInfo/CurrentInfo/currentinfo1.vb" id="Snippet1"::: @@ -950,7 +950,7 @@ The pattern does not support a positive sign. is passed as the parameter. This method implements . + The `Format(String, IFormatProvider)` methods supported by the base data types invoke this method when the current is passed as the parameter. This method implements . ]]> @@ -1028,12 +1028,12 @@ The pattern does not support a positive sign. method of `formatProvider` using as the Type parameter. If `formatProvider` is `null` or if returns `null`, this method returns . + This method uses the method of `formatProvider` using as the Type parameter. If `formatProvider` is `null` or if returns `null`, this method returns . Your application gets a object for a specific culture using one of the following methods: - Through the property. -- Through the method where `provider` is a . +- Through the method where `provider` is a . A object is created only for the invariant culture or for specific cultures, not for neutral cultures. For more information about the invariant culture, specific cultures, and neutral cultures, see the class. @@ -1093,7 +1093,7 @@ The pattern does not support a positive sign. This object returned by this property does not change, regardless of the current culture. It represents the formatting conventions of the invariant culture, which is a culture associated with the English language but not with any country/region. The invariant culture is used in formatting operations that are culture-independent or that produce result strings suitable for display across multiple cultures. ## Examples - The following example displays the default property values of the . + The following example displays the default property values of the . :::code language="csharp" source="~/snippets/csharp/System.Globalization/NumberFormatInfo/InvariantInfo/invariantinfo.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/NumberFormatInfo/InvariantInfo/invariantinfo.vb" id="Snippet1"::: @@ -1153,7 +1153,7 @@ The pattern does not support a positive sign. ## Remarks Attempting to perform an assignment to a property of a read-only causes an . - You can call the method to create a read/write object from a read-only object, as the following example illustrates. + You can call the method to create a read/write object from a read-only object, as the following example illustrates. :::code language="csharp" source="~/snippets/csharp/System.Globalization/NumberFormatInfo/Clone/isreadonly1.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/NumberFormatInfo/Clone/isreadonly1.vb" id="Snippet1"::: @@ -1690,7 +1690,7 @@ On Windows, the initial value of this property is derived from the settings in t Every element in the one-dimensional array must be an integer from 1 through 9. The last element can be 0. - The first element of the array defines the number of elements in the least significant group of digits immediately to the left of the . Each subsequent element refers to the next significant group of digits to the left of the previous group. If the last element of the array is not 0, the remaining digits are grouped based on the last element of the array. If the last element is 0, the remaining digits are not grouped. + The first element of the array defines the number of elements in the least significant group of digits immediately to the left of the . Each subsequent element refers to the next significant group of digits to the left of the previous group. If the last element of the array is not 0, the remaining digits are grouped based on the last element of the array. If the last element is 0, the remaining digits are not grouped. For example, if the array contains { 3, 4, 5 }, the digits are grouped similar to "55,55555,55555,55555,4444,333.00". If the array contains { 3, 4, 0 }, the digits are grouped similar to "55555555555555555,4444,333.00". @@ -1700,7 +1700,7 @@ On Windows, the initial value of this property is derived from the settings in t :::code language="csharp" source="~/snippets/csharp/System.Globalization/NumberFormatInfo/NumberGroupSizes/numbergroupsizes.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/NumberFormatInfo/NumberGroupSizes/numbergroupsizes.vb" id="Snippet1"::: - The following example prints a value using different arrays. + The following example prints a value using different arrays. :::code language="csharp" source="~/snippets/csharp/System.Globalization/NumberFormatInfo/NumberGroupSizes/source.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/NumberFormatInfo/NumberGroupSizes/source.vb" id="Snippet1"::: @@ -1771,7 +1771,7 @@ On Windows, the initial value of this property is derived from the settings in t property defines the format of negative values formatted with the "N" standard numeric format string. This property has one of the values in the following table. The symbol "-" is the and `n` is a number. + The property defines the format of negative values formatted with the "N" standard numeric format string. This property has one of the values in the following table. The symbol "-" is the and `n` is a number. | Value | Associated pattern | |-------|--------------------| @@ -1784,7 +1784,7 @@ On Windows, the initial value of this property is derived from the settings in t The default value for the invariant culture returned by the property is 1, which represents "-n", where *n* is a number. ## Examples - The following example displays a value using different patterns. + The following example displays a value using different patterns. :::code language="csharp" source="~/snippets/csharp/System.Globalization/NumberFormatInfo/NumberNegativePattern/source.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/NumberFormatInfo/NumberNegativePattern/source.vb" id="Snippet1"::: @@ -2063,7 +2063,7 @@ On Windows, the initial value of this property is derived from the settings in t ## Remarks The property is used with the "P" standard format string to define the number of digits that appear in integral groups. For more information, see [Standard Numeric Format Strings](/dotnet/standard/base-types/standard-numeric-format-strings). Every element in the one-dimensional array must be an integer from 1 through 9. The last element can be 0. - The first element of the array defines the number of elements in the least significant group of digits immediately to the left of the . Each subsequent element refers to the next significant group of digits to the left of the previous group. If the last element of the array is not 0, the remaining digits are grouped based on the last element of the array. If the last element is 0, the remaining digits are not grouped. + The first element of the array defines the number of elements in the least significant group of digits immediately to the left of the . Each subsequent element refers to the next significant group of digits to the left of the previous group. If the last element of the array is not 0, the remaining digits are grouped based on the last element of the array. If the last element is 0, the remaining digits are not grouped. For example, if the array contains { 3, 4, 5 }, the digits are grouped similar to "55,55555,55555,55555,4444,333.00%". If the array contains { 3, 4, 0 }, the digits are grouped similar to "55555555555555555,4444,333.00%". @@ -2140,7 +2140,7 @@ On Windows, the initial value of this property is derived from the settings in t property is used with the "P" standard format string to define the pattern of negative percentage values. For more information, see [Standard Numeric Format Strings](/dotnet/standard/base-types/standard-numeric-format-strings). This property has one of the values in the following table. The symbol "%" is the , the symbol "-" is the , and `n` is a number. + The property is used with the "P" standard format string to define the pattern of negative percentage values. For more information, see [Standard Numeric Format Strings](/dotnet/standard/base-types/standard-numeric-format-strings). This property has one of the values in the following table. The symbol "%" is the , the symbol "-" is the , and `n` is a number. | Value | Associated pattern | |-------|--------------------| @@ -2219,7 +2219,7 @@ On Windows, the initial value of this property is derived from the settings in t property is used with the "P" standard format string to define pattern of positive percentage values. For more information, see [Standard Numeric Format Strings](/dotnet/standard/base-types/standard-numeric-format-strings). This property has one of the values in the following table. The symbol "%" is the and `n` is a number. + The property is used with the "P" standard format string to define pattern of positive percentage values. For more information, see [Standard Numeric Format Strings](/dotnet/standard/base-types/standard-numeric-format-strings). This property has one of the values in the following table. The symbol "%" is the and `n` is a number. | Value | Associated pattern | |-------|--------------------| diff --git a/xml/System.Globalization/PersianCalendar.xml b/xml/System.Globalization/PersianCalendar.xml index 9fd6272a525..da344e3f127 100644 --- a/xml/System.Globalization/PersianCalendar.xml +++ b/xml/System.Globalization/PersianCalendar.xml @@ -195,7 +195,7 @@ property of the returned value always equals . You can preserve the property of the `time` parameter by calling the method, as the following example shows. + The property of the returned value always equals . You can preserve the property of the `time` parameter by calling the method, as the following example shows. :::code language="csharp" source="~/snippets/csharp/System.Globalization/Calendar/AddDays/add1.cs" id="Snippet5"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/Calendar/AddDays/add1.vb" id="Snippet5"::: @@ -203,7 +203,7 @@ ## Examples - The following code example demonstrates the use of the method. + The following code example demonstrates the use of the method. :::code language="csharp" source="~/snippets/csharp/System.Globalization/PersianCalendar/Overview/pcal.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/PersianCalendar/Overview/pcal.vb" id="Snippet1"::: @@ -270,7 +270,7 @@ property of the returned value always equals . You can preserve the property of the `time` parameter by calling the method, as the following example shows. + The property of the returned value always equals . You can preserve the property of the `time` parameter by calling the method, as the following example shows. :::code language="csharp" source="~/snippets/csharp/System.Globalization/Calendar/AddDays/add1.cs" id="Snippet8"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/Calendar/AddDays/add1.vb" id="Snippet8"::: @@ -278,7 +278,7 @@ ## Examples - The following code example demonstrates the use of the method. + The following code example demonstrates the use of the method. :::code language="csharp" source="~/snippets/csharp/System.Globalization/PersianCalendar/Overview/pcal.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/PersianCalendar/Overview/pcal.vb" id="Snippet1"::: @@ -460,7 +460,7 @@ method. + The following code example demonstrates the use of the method. :::code language="csharp" source="~/snippets/csharp/System.Globalization/PersianCalendar/Overview/pcal.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/PersianCalendar/Overview/pcal.vb" id="Snippet1"::: @@ -525,7 +525,7 @@ method. + The following code example demonstrates the use of the method. :::code language="csharp" source="~/snippets/csharp/System.Globalization/PersianCalendar/Overview/pcal.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/PersianCalendar/Overview/pcal.vb" id="Snippet1"::: @@ -590,7 +590,7 @@ method. + The following code example demonstrates the use of the method. :::code language="csharp" source="~/snippets/csharp/System.Globalization/PersianCalendar/Overview/pcal.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/PersianCalendar/Overview/pcal.vb" id="Snippet1"::: @@ -660,7 +660,7 @@ method. + The following code example demonstrates the use of the method. :::code language="csharp" source="~/snippets/csharp/System.Globalization/PersianCalendar/Overview/pcal.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/PersianCalendar/Overview/pcal.vb" id="Snippet1"::: @@ -726,7 +726,7 @@ method. + The following code example demonstrates use of the method. :::code language="csharp" source="~/snippets/csharp/System.Globalization/PersianCalendar/Overview/pcal.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/PersianCalendar/Overview/pcal.vb" id="Snippet1"::: @@ -790,7 +790,7 @@ method. + The following code example demonstrates the use of the method. :::code language="csharp" source="~/snippets/csharp/System.Globalization/PersianCalendar/Overview/pcal.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/PersianCalendar/Overview/pcal.vb" id="Snippet1"::: @@ -856,7 +856,7 @@ method. + The following code example demonstrates the use of the method. :::code language="csharp" source="~/snippets/csharp/System.Globalization/PersianCalendar/Overview/pcal.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/PersianCalendar/Overview/pcal.vb" id="Snippet1"::: @@ -918,7 +918,7 @@ method. + The following code example demonstrates the use of the method. :::code language="csharp" source="~/snippets/csharp/System.Globalization/PersianCalendar/Overview/pcal.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/PersianCalendar/Overview/pcal.vb" id="Snippet1"::: @@ -984,7 +984,7 @@ method. + The following code example demonstrates the use of the method. :::code language="csharp" source="~/snippets/csharp/System.Globalization/PersianCalendar/Overview/pcal.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/PersianCalendar/Overview/pcal.vb" id="Snippet1"::: @@ -1047,7 +1047,7 @@ method. + The following code example demonstrates the use of the method. :::code language="csharp" source="~/snippets/csharp/System.Globalization/PersianCalendar/Overview/pcal.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/PersianCalendar/Overview/pcal.vb" id="Snippet1"::: @@ -1122,7 +1122,7 @@ ## Examples - The following code example demonstrates the use of the method. + The following code example demonstrates the use of the method. :::code language="csharp" source="~/snippets/csharp/System.Globalization/PersianCalendar/Overview/pcal.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/PersianCalendar/Overview/pcal.vb" id="Snippet1"::: @@ -1191,7 +1191,7 @@ method. + The following code example demonstrates the use of the method. :::code language="csharp" source="~/snippets/csharp/System.Globalization/PersianCalendar/Overview/pcal.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/PersianCalendar/Overview/pcal.vb" id="Snippet1"::: @@ -1258,12 +1258,12 @@ class has changed from an observational algorithm to the Hijri solar algorithm. As a result, the method may return different values when run on .NET Framework 4.6 than when run on previous versions of the .NET Framework. + Starting with the .NET Framework 4.6, the implementation of the class has changed from an observational algorithm to the Hijri solar algorithm. As a result, the method may return different values when run on .NET Framework 4.6 than when run on previous versions of the .NET Framework. ## Examples - The following code example demonstrates the use of the method. + The following code example demonstrates the use of the method. :::code language="csharp" source="~/snippets/csharp/System.Globalization/PersianCalendar/Overview/pcal.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/PersianCalendar/Overview/pcal.vb" id="Snippet1"::: @@ -1529,12 +1529,12 @@ method is useful because it can convert any date in the current calendar to a Gregorian calendar date. The Gregorian date can subsequently be used, for example, to compare dates in different calendars or create an equivalent date in a particular calendar. + The method is useful because it can convert any date in the current calendar to a Gregorian calendar date. The Gregorian date can subsequently be used, for example, to compare dates in different calendars or create an equivalent date in a particular calendar. ## Examples - The following code example demonstrates the use of the method. + The following code example demonstrates the use of the method. :::code language="csharp" source="~/snippets/csharp/System.Globalization/PersianCalendar/Overview/pcal.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/PersianCalendar/Overview/pcal.vb" id="Snippet1"::: @@ -1604,12 +1604,12 @@ ## Remarks This method converts the `year` parameter to a four-digit year representation using the property. The return value is the upper boundary of a 100-year range that allows a two-digit year to be properly translated to a four-digit year. For example, if the 100-year range is from 1930 through 2029, then a two-digit value of 30 is interpreted as 1930 while a two-digit value of 29 is interpreted as 2029. - supports either a two-digit year or a four-digit year. Passing a two-digit year value (less than 100) causes the method to convert the value to a four-digit value according to the value representing the appropriate century. If the application supplies a four-digit year value that is within the supported calendar range to , the method returns the actual input value. If the application supplies a four-digit value that is outside the supported calendar range, or if it supplies a negative value, the method throws an exception. + supports either a two-digit year or a four-digit year. Passing a two-digit year value (less than 100) causes the method to convert the value to a four-digit value according to the value representing the appropriate century. If the application supplies a four-digit year value that is within the supported calendar range to , the method returns the actual input value. If the application supplies a four-digit value that is outside the supported calendar range, or if it supplies a negative value, the method throws an exception. ## Examples - The following code example demonstrates the use of the method. + The following code example demonstrates the use of the method. :::code language="csharp" source="~/snippets/csharp/System.Globalization/PersianCalendar/Overview/pcal.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/PersianCalendar/Overview/pcal.vb" id="Snippet1"::: diff --git a/xml/System.Globalization/RegionInfo.xml b/xml/System.Globalization/RegionInfo.xml index 255d3cdf57d..2d112e053a8 100644 --- a/xml/System.Globalization/RegionInfo.xml +++ b/xml/System.Globalization/RegionInfo.xml @@ -528,7 +528,7 @@ The following code example displays the properties of the . The class does not automatically detect changes in the system settings, but the property is updated when you call the method. +The value of this property is based on the culture selected through the regional and language options portion of Control Panel. However, that information can change during the life of the . The class does not automatically detect changes in the system settings, but the property is updated when you call the method. ]]> @@ -589,7 +589,7 @@ The value of this property is based on the culture selected through the regional The property displays the country/region name in the language of the localized version of .NET. For example, the property displays the country/region in English on the English version of .NET, and in Spanish on the Spanish version of .NET. -The value of the property is taken from the resource files in the language of the current user interface culture, represented by . Custom regions or those synthesized from the operating system might not have resource information, in which case the value for is the same as the value of the property. +The value of the property is taken from the resource files in the language of the current user interface culture, represented by . Custom regions or those synthesized from the operating system might not have resource information, in which case the value for is the same as the value of the property. ## Examples @@ -738,7 +738,7 @@ The following code example displays the properties of the . +This method overrides . ## Examples @@ -865,9 +865,9 @@ The following code example demonstrates the . +This method overrides . -This method generates the same hash code for two objects that are equal according to the method. +This method generates the same hash code for two objects that are equal according to the method. ]]> @@ -1456,7 +1456,7 @@ The following code example displays the properties of the . +This method overrides . This method returns the value of the property. diff --git a/xml/System.Globalization/SortKey.xml b/xml/System.Globalization/SortKey.xml index 4597354001b..01928b08dd8 100644 --- a/xml/System.Globalization/SortKey.xml +++ b/xml/System.Globalization/SortKey.xml @@ -72,7 +72,7 @@ :::code language="csharp" source="~/snippets/csharp/System.Globalization/SortKey/Overview/sortkey_compare.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/SortKey/Overview/sortkey_compare.vb" id="Snippet1"::: - The following example shows how you can use the class to improve performance in an application that relies extensively on sorting and searching a large array. The example creates an unordered array of names, which in this case has 13 elements. It then stores the sort key of each name in a parallel array, which it passes to the method. The result is a sorted array. The example then searches the array for three strings. For each search string, it calls the method to retrieve the string's sort key, and then calls the method to retrieve the index of that sort key in the array of sort keys. Because the name and sort key arrays are parallel, the returned index is also the index of the name in the `names` array. + The following example shows how you can use the class to improve performance in an application that relies extensively on sorting and searching a large array. The example creates an unordered array of names, which in this case has 13 elements. It then stores the sort key of each name in a parallel array, which it passes to the method. The result is a sorted array. The example then searches the array for three strings. For each search string, it calls the method to retrieve the string's sort key, and then calls the method to retrieve the index of that sort key in the array of sort keys. Because the name and sort key arrays are parallel, the returned index is also the index of the name in the `names` array. :::code language="csharp" source="~/snippets/csharp/System.Globalization/SortKey/Overview/sortkey1.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/SortKey/Overview/sortkey1.vb" id="Snippet1"::: @@ -149,14 +149,14 @@ method compares the properties of the `sortkey1` and `sortkey2` parameters. The method yields the same results as the method. + The method compares the properties of the `sortkey1` and `sortkey2` parameters. The method yields the same results as the method. - For more information about the method and the comparison of sort keys, see the class topic. + For more information about the method and the comparison of sort keys, see the class topic. ## Examples - The following code example compares two strings using the method and the equivalent method. + The following code example compares two strings using the method and the equivalent method. :::code language="csharp" source="~/snippets/csharp/System.Globalization/SortKey/Compare/skcmp.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/SortKey/Compare/skcmp.vb" id="Snippet1"::: @@ -223,14 +223,14 @@ objects are considered equal if their properties are equal. + Two objects are considered equal if their properties are equal. - This method overrides . + This method overrides . ## Examples - The following code example shows the results of when compared with different objects. + The following code example shows the results of when compared with different objects. :::code language="csharp" source="~/snippets/csharp/System.Globalization/SortKey/Equals/sortkey_equals.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/SortKey/Equals/sortkey_equals.vb" id="Snippet1"::: @@ -287,9 +287,9 @@ method. + This method generates the same hash code for two objects that are equal according to the method. - This method overrides . + This method overrides . ]]> @@ -459,12 +459,12 @@ ## Remarks The return value is the concatenation of the string "SortKey - ", the culture identifier and compare options of the current object, and the value of the property. - This method overrides . + This method overrides . ## Examples - The following code example displays an original string, the strings yielded by the method for case-sensitive and case-insensitive sort keys, and the key data for case-sensitive and case-insensitive sort keys. + The following code example displays an original string, the strings yielded by the method for case-sensitive and case-insensitive sort keys, and the key data for case-sensitive and case-insensitive sort keys. :::code language="csharp" source="~/snippets/csharp/System.Globalization/SortKey/KeyData/ts.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/SortKey/KeyData/ts.vb" id="Snippet1"::: diff --git a/xml/System.Globalization/SortVersion.xml b/xml/System.Globalization/SortVersion.xml index a015b7ce288..92104e10548 100644 --- a/xml/System.Globalization/SortVersion.xml +++ b/xml/System.Globalization/SortVersion.xml @@ -196,7 +196,7 @@ objects are equal if their and properties are equal. + Two objects are equal if their and properties are equal. ]]> @@ -257,7 +257,7 @@ objects are equal if their and properties are equal. + Two objects are equal if their and properties are equal. ]]> @@ -401,7 +401,7 @@ objects are equal if both are `null`, or if their and properties are equal. + Two objects are equal if both are `null`, or if their and properties are equal. ]]> @@ -458,7 +458,7 @@ objects are not equal if one is `null` and the other is not, or if they have different or property values. + Two objects are not equal if one is `null` and the other is not, or if they have different or property values. ]]> diff --git a/xml/System.Globalization/StringInfo.xml b/xml/System.Globalization/StringInfo.xml index 8fc2e1aa504..b5f9f85afb5 100644 --- a/xml/System.Globalization/StringInfo.xml +++ b/xml/System.Globalization/StringInfo.xml @@ -87,15 +87,15 @@ The class enables you to work with a stri To instantiate a object that represents a specified string, you can do either of the following: -- Call the constructor and pass it the string that the object is to represent as an argument. +- Call the constructor and pass it the string that the object is to represent as an argument. - Call the default constructor, and assign the string that the object is to represent to the property. You can work with the individual text elements in a string in two ways: -- By enumerating each text element. To do this, you call the method, and then repeatedly call the method on the returned object until the method returns `false`. +- By enumerating each text element. To do this, you call the method, and then repeatedly call the method on the returned object until the method returns `false`. -- By calling the method to retrieve an array that contains the starting index of each text element. You can then retrieve individual text elements by passing these indexes to the method. +- By calling the method to retrieve an array that contains the starting index of each text element. You can then retrieve individual text elements by passing these indexes to the method. The following example illustrates both ways of working with the text elements in a string. It creates two strings: @@ -103,14 +103,14 @@ The following example illustrates both ways of working with the text elements in - `strSurrogates`, which is a string that includes three surrogate pairs: GREEK ACROPHONIC FIVE TALENTS (U+10148) from the Supplementary Multilingual Plane, U+20026 from the Supplementary Ideographic Plane, and U+F1001 from the private user area. The UTF-16 encoding of each character is a surrogate pair that consists of a high surrogate followed by a low surrogate. -Each string is parsed once by the method and then by the method. Both methods correctly parse the text elements in the two strings and display the results of the parsing operation. +Each string is parsed once by the method and then by the method. Both methods correctly parse the text elements in the two strings and display the results of the parsing operation. :::code language="csharp" source="~/snippets/csharp/System.Globalization/StringInfo/Overview/indexing1.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/StringInfo/Overview/indexing1.vb" id="Snippet1"::: ## Examples -This example uses the and methods of the class to manipulate a string that contains surrogate and combining characters. +This example uses the and methods of the class to manipulate a string that contains surrogate and combining characters. :::code language="csharp" source="~/snippets/csharp/System.Globalization/StringInfo/Overview/StringInfo.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/StringInfo/Overview/stringinfo.vb" id="Snippet1"::: @@ -178,7 +178,7 @@ This example uses the object is initialized to the empty string (""). You can assign another string to it by using the property. You can also instantiate a object that represents a specified string in a single step by calling the constructor. + The value of the new object is initialized to the empty string (""). You can assign another string to it by using the property. You can also instantiate a object that represents a specified string in a single step by calling the constructor. ]]> @@ -360,7 +360,7 @@ This example uses the is dependent on its implementation, which might change from one version of the common language runtime to another. This might happen to improve the performance of . To make the behavior of constant, the application should override the runtime implementation of with an implementation known to never change. + The behavior of is dependent on its implementation, which might change from one version of the common language runtime to another. This might happen to improve the performance of . To make the behavior of constant, the application should override the runtime implementation of with an implementation known to never change. ]]> @@ -432,7 +432,7 @@ This example uses the object generated by the method. + This method only returns the first text element. To iterate through the text elements of the string, the application should use the object generated by the method. ]]> @@ -505,7 +505,7 @@ This example uses the generated by the method. + This method only returns the first text element of the substring that starts at the specified index. To iterate through the text elements of the string, the application should use the generated by the method. ]]> @@ -732,18 +732,18 @@ A grapheme cluster is a sequence of one or more Unicode code points that should The text element enumerator is used only to read data in the string; it cannot modify the underlying string. The enumerator does not have exclusive access to the string. - The enumerator is in an invalid state if it is positioned before the first text element in the string or after the last text element in the string. When the enumerator is in an invalid state, calling throws an exception. + The enumerator is in an invalid state if it is positioned before the first text element in the string or after the last text element in the string. When the enumerator is in an invalid state, calling throws an exception. - Initially, the enumerator is positioned before the first text element in the string. also brings the enumerator back to this position. Therefore, after an enumerator is created or after is called, must be called to advance the enumerator to the first text element of the string before reading the value of . + Initially, the enumerator is positioned before the first text element in the string. also brings the enumerator back to this position. Therefore, after an enumerator is created or after is called, must be called to advance the enumerator to the first text element of the string before reading the value of . - returns the same object until either or is called. + returns the same object until either or is called. - After the end of the string is passed, the enumerator is again in an invalid state and calling returns `false`. Calling throws an exception if the last call to returned `false`. + After the end of the string is passed, the enumerator is again in an invalid state and calling returns `false`. Calling throws an exception if the last call to returned `false`. ## Examples - The following example demonstrates calling the method. This example is part of a larger example provided for the class. + The following example demonstrates calling the method. This example is part of a larger example provided for the class. :::code language="csharp" source="~/snippets/csharp/System.Globalization/StringInfo/Overview/StringInfo.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/StringInfo/Overview/stringinfo.vb" id="Snippet1"::: @@ -819,13 +819,13 @@ A grapheme cluster is a sequence of one or more Unicode code points that should The text element enumerator is used only to read data in the string; it cannot modify the underlying string. The enumerator does not have exclusive access to the string. - The enumerator is in an invalid state if it is positioned before the first text element in the string or after the last text element in the string. When the enumerator is in an invalid state, calling throws an exception. + The enumerator is in an invalid state if it is positioned before the first text element in the string or after the last text element in the string. When the enumerator is in an invalid state, calling throws an exception. - Initially, the enumerator is positioned before the first text element in the string. also brings the enumerator back to this position. Therefore, after an enumerator is created or after is called, must be called to advance the enumerator to the first text element of the string before reading the value of . + Initially, the enumerator is positioned before the first text element in the string. also brings the enumerator back to this position. Therefore, after an enumerator is created or after is called, must be called to advance the enumerator to the first text element of the string before reading the value of . - returns the same object until either or is called. + returns the same object until either or is called. - After the end of the string is passed, the enumerator is again in an invalid state and calling returns `false`. Calling throws an exception if the last call to returned `false`. + After the end of the string is passed, the enumerator is again in an invalid state and calling returns `false`. Calling throws an exception if the last call to returned `false`. ]]> @@ -953,12 +953,12 @@ A grapheme cluster is a sequence of one or more Unicode code points that should The length of each element is easily computed as the difference between successive indexes. The length of the array will always be less than or equal to the length of the string. For example, given the string "\u4f00\u302a\ud800\udc00\u4f01", this method returns the indexes 0, 2, and 4. ## Equivalent Members - Starting in version 2.0 of the .NET Framework, the method and property provide an easy to use implementation of the functionality offered by the method. + Starting in version 2.0 of the .NET Framework, the method and property provide an easy to use implementation of the functionality offered by the method. ## Examples - The following example demonstrates calling the method. This code example is part of a larger example provided for the class. + The following example demonstrates calling the method. This code example is part of a larger example provided for the class. :::code language="csharp" source="~/snippets/csharp/System.Globalization/StringInfo/Overview/StringInfo.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/StringInfo/Overview/stringinfo.vb" id="Snippet1"::: @@ -1022,7 +1022,7 @@ A grapheme cluster is a sequence of one or more Unicode code points that should - if the default is called. You should then use the property to assign the string that this object rperesents. -- The string supplied as the `value` argument to the constructor. +- The string supplied as the `value` argument to the constructor. ]]> @@ -1088,7 +1088,7 @@ A grapheme cluster is a sequence of one or more Unicode code points that should method returns a substring that consists of the text elements for which the indexes are 1, 2, 3, and 4. + Consider a string that consists of five text elements, indexed from 0 through 4. If the `startingTextElement` parameter is 1, the method returns a substring that consists of the text elements for which the indexes are 1, 2, 3, and 4. ]]> @@ -1151,7 +1151,7 @@ A grapheme cluster is a sequence of one or more Unicode code points that should method returns a substring that consists of the text elements for which the indexes are 1, 2, and 3. + Consider a string that consists of five text elements, indexed from 0 through 4. If the `startingTextElement` parameter is 1 and the `lengthInTextElements` parameter is 3, the method returns a substring that consists of the text elements for which the indexes are 1, 2, and 3. ]]> diff --git a/xml/System.Globalization/TaiwanCalendar.xml b/xml/System.Globalization/TaiwanCalendar.xml index d3f3e9c41a7..20ccf02e9f3 100644 --- a/xml/System.Globalization/TaiwanCalendar.xml +++ b/xml/System.Globalization/TaiwanCalendar.xml @@ -108,7 +108,7 @@ The date January 1, 2001 C.E. in the Gregorian calendar is equivalent to the first day of January in the year 90 of the current era in the Taiwan calendar. - Each supports a set of calendars. The property returns the default calendar for the culture, and the property returns an array containing all the calendars supported by the culture. To change the calendar used by a , the application should set the property of to a new . + Each supports a set of calendars. The property returns the default calendar for the culture, and the property returns an array containing all the calendars supported by the culture. To change the calendar used by a , the application should set the property of to a new . ]]> @@ -226,7 +226,7 @@ If the value of the `months` parameter is negative, the resulting is earlier than the specified . - The property of the returned value always equals . You can preserve the property of the `time` parameter by calling the method, as the following example shows. + The property of the returned value always equals . You can preserve the property of the `time` parameter by calling the method, as the following example shows. :::code language="csharp" source="~/snippets/csharp/System.Globalization/Calendar/AddDays/add1.cs" id="Snippet5"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/Calendar/AddDays/add1.vb" id="Snippet5"::: @@ -234,7 +234,7 @@ ## Examples - The following code example demonstrates the use of the method. + The following code example demonstrates the use of the method. :::code language="csharp" source="~/snippets/csharp/System.Globalization/TaiwanCalendar/AddMonths/taiwancalendar_addget.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/TaiwanCalendar/AddMonths/taiwancalendar_addget.vb" id="Snippet1"::: @@ -313,7 +313,7 @@ If `years` is negative, the resulting is earlier than the specified . - The property of the returned value always equals . You can preserve the property of the `time` parameter by calling the method, as the following example shows. + The property of the returned value always equals . You can preserve the property of the `time` parameter by calling the method, as the following example shows. :::code language="csharp" source="~/snippets/csharp/System.Globalization/Calendar/AddDays/add1.cs" id="Snippet8"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/Calendar/AddDays/add1.vb" id="Snippet8"::: @@ -321,7 +321,7 @@ ## Examples - The following code example displays the use of the method. + The following code example displays the use of the method. :::code language="csharp" source="~/snippets/csharp/System.Globalization/TaiwanCalendar/AddMonths/taiwancalendar_addget.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/TaiwanCalendar/AddMonths/taiwancalendar_addget.vb" id="Snippet1"::: @@ -500,7 +500,7 @@ method. + The following code example demonstrates the use of the method. :::code language="csharp" source="~/snippets/csharp/System.Globalization/TaiwanCalendar/AddMonths/taiwancalendar_addget.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/TaiwanCalendar/AddMonths/taiwancalendar_addget.vb" id="Snippet1"::: @@ -580,7 +580,7 @@ ## Examples - The following code example demonstrates the use of the method. + The following code example demonstrates the use of the method. :::code language="csharp" source="~/snippets/csharp/System.Globalization/TaiwanCalendar/AddMonths/taiwancalendar_addget.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/TaiwanCalendar/AddMonths/taiwancalendar_addget.vb" id="Snippet1"::: @@ -646,12 +646,12 @@ for the first day of the first month returns 1, and for the last day of the last month returns the total number of days in that year. The total is the same as the value returned by . + The day of the year is defined as the number of days from the first day of the year. For example, for the first day of the first month returns 1, and for the last day of the last month returns the total number of days in that year. The total is the same as the value returned by . ## Examples - The following code example demonstrates the use of the method. + The following code example demonstrates the use of the method. :::code language="csharp" source="~/snippets/csharp/System.Globalization/TaiwanCalendar/AddMonths/taiwancalendar_addget.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/TaiwanCalendar/AddMonths/taiwancalendar_addget.vb" id="Snippet1"::: @@ -725,7 +725,7 @@ ## Examples - The following example calls for the second month in each of five years in each era. + The following example calls for the second month in each of five years in each era. :::code language="csharp" source="~/snippets/csharp/System.Globalization/TaiwanCalendar/GetDaysInMonth/taiwancalendar_getdaysinmonth.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/TaiwanCalendar/GetDaysInMonth/taiwancalendar_getdaysinmonth.vb" id="Snippet1"::: @@ -807,7 +807,7 @@ ## Examples - The following example calls for five years in each era. + The following example calls for five years in each era. :::code language="csharp" source="~/snippets/csharp/System.Globalization/TaiwanCalendar/GetDaysInYear/taiwancalendar_getdaysinyear.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/TaiwanCalendar/GetDaysInYear/taiwancalendar_getdaysinyear.vb" id="Snippet1"::: @@ -883,7 +883,7 @@ ## Examples - The following code example demonstrates the use of the method. + The following code example demonstrates the use of the method. :::code language="csharp" source="~/snippets/csharp/System.Globalization/TaiwanCalendar/AddMonths/taiwancalendar_addget.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/TaiwanCalendar/AddMonths/taiwancalendar_addget.vb" id="Snippet1"::: @@ -955,7 +955,7 @@ method returns a number between 1 and 13 that indicates the month associated with a specified date. If there is a leap month between the eighth and ninth months of the year, the method returns 8 for the eighth month, 9 for the leap eighth month, and 10 for the ninth month. + In a calendar that supports the notion of a leap month, the leap month can occur either after a particular month or after any month in a year. For example, the method returns a number between 1 and 13 that indicates the month associated with a specified date. If there is a leap month between the eighth and ninth months of the year, the method returns 8 for the eighth month, 9 for the leap eighth month, and 10 for the ninth month. ]]> @@ -1013,7 +1013,7 @@ method. + The following code example demonstrates the use of the method. :::code language="csharp" source="~/snippets/csharp/System.Globalization/TaiwanCalendar/AddMonths/taiwancalendar_addget.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/TaiwanCalendar/AddMonths/taiwancalendar_addget.vb" id="Snippet1"::: @@ -1078,7 +1078,7 @@ for five years in each era. + The following example calls for five years in each era. :::code language="csharp" source="~/snippets/csharp/System.Globalization/TaiwanCalendar/GetMonthsInYear/taiwancalendar_getmonthsinyear.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/TaiwanCalendar/GetMonthsInYear/taiwancalendar_getmonthsinyear.vb" id="Snippet1"::: @@ -1162,16 +1162,16 @@ The property contains culture-specific values that can be used for the `rule` and `firstDayOfWeek` parameters. - The property of contains the default value that represents the first day of the week for a specific culture, using the calendar specified in the property of . + The property of contains the default value that represents the first day of the week for a specific culture, using the calendar specified in the property of . - The property of contains the default value that defines a calendar week for a specific culture, using the calendar specified in the property of . + The property of contains the default value that defines a calendar week for a specific culture, using the calendar specified in the property of . - For example, in , the method for January 1 returns 1. + For example, in , the method for January 1 returns 1. ## Examples - The following code example shows how the result of varies depending on the and values used. If the specified date is the last day of the year, returns the total number of weeks in that year. + The following code example shows how the result of varies depending on the and values used. If the specified date is the last day of the year, returns the total number of weeks in that year. :::code language="csharp" source="~/snippets/csharp/System.Globalization/Calendar/GetWeekOfYear/yslin_calendar_getweekofyear.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/Calendar/GetWeekOfYear/yslin_calendar_getweekofyear.vb" id="Snippet1"::: @@ -1238,7 +1238,7 @@ method. + The following code example demonstrates the use of the method. :::code language="csharp" source="~/snippets/csharp/System.Globalization/TaiwanCalendar/AddMonths/taiwancalendar_addget.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/TaiwanCalendar/AddMonths/taiwancalendar_addget.vb" id="Snippet1"::: @@ -1317,7 +1317,7 @@ ## Examples - The following example calls for the last day of the second month (February) for five years in each of the eras. + The following example calls for the last day of the second month (February) for five years in each of the eras. :::code language="csharp" source="~/snippets/csharp/System.Globalization/TaiwanCalendar/IsLeapDay/taiwancalendar_isleapday.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/TaiwanCalendar/IsLeapDay/taiwancalendar_isleapday.vb" id="Snippet1"::: @@ -1408,7 +1408,7 @@ ## Examples - The following example calls for all the months in five years in the current era. + The following example calls for all the months in five years in the current era. :::code language="csharp" source="~/snippets/csharp/System.Globalization/TaiwanCalendar/IsLeapMonth/taiwancalendar_isleapmonth.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/TaiwanCalendar/IsLeapMonth/taiwancalendar_isleapmonth.vb" id="Snippet1"::: @@ -1491,7 +1491,7 @@ ## Examples - The following example calls for five years in each of the eras. + The following example calls for five years in each of the eras. :::code language="csharp" source="~/snippets/csharp/System.Globalization/TaiwanCalendar/IsLeapYear/taiwancalendar_isleapyear.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/TaiwanCalendar/IsLeapYear/taiwancalendar_isleapyear.vb" id="Snippet1"::: @@ -1789,11 +1789,11 @@ . + This method implements . Because the year in the Taiwan calendar is typically less than four digits long, this implementation always returns the value of the `year` parameter. - supports either a two-digit year or a four-digit year. Passing a two-digit year value (less than 100) causes the method to convert the value to a four-digit value according to the value representing the appropriate century. If the application supplies a four-digit year value that is within the supported calendar range to , the method returns the actual input value. If the application supplies a four-digit value that is outside the supported calendar range, or if it supplies a negative value, the method throws an exception. + supports either a two-digit year or a four-digit year. Passing a two-digit year value (less than 100) causes the method to convert the value to a four-digit value according to the value representing the appropriate century. If the application supplies a four-digit year value that is within the supported calendar range to , the method returns the actual input value. If the application supplies a four-digit value that is outside the supported calendar range, or if it supplies a negative value, the method throws an exception. ]]> @@ -1850,9 +1850,9 @@ . + This property implements . - Because the year in the Taiwan calendar is typically less than four digits long, this implementation returns 99 by default and does not affect the return value of . + Because the year in the Taiwan calendar is typically less than four digits long, this implementation returns 99 by default and does not affect the return value of . ]]> diff --git a/xml/System.Globalization/TaiwanLunisolarCalendar.xml b/xml/System.Globalization/TaiwanLunisolarCalendar.xml index 5fff0acb896..e47af42e0f0 100644 --- a/xml/System.Globalization/TaiwanLunisolarCalendar.xml +++ b/xml/System.Globalization/TaiwanLunisolarCalendar.xml @@ -81,11 +81,11 @@ The class is derived from the class, which represents the lunisolar calendar. The class supports the sexagenary year cycle (which repeats every 60 years) in addition to solar years and lunar months. Each solar year in the calendar is associated with a Sexagenary Year, a Celestial Stem, and a Terrestrial Branch, and these calendars can have leap months after any month of the year. - A leap month can occur after any month in a year. For example, the method returns a number between 1 and 13 that indicates the month associated with a specified date. If there is a leap month between the eighth and ninth months of the year, the method returns 8 for the eighth month, 9 for the leap eighth month, and 10 for the ninth month. + A leap month can occur after any month in a year. For example, the method returns a number between 1 and 13 that indicates the month associated with a specified date. If there is a leap month between the eighth and ninth months of the year, the method returns 8 for the eighth month, 9 for the leap eighth month, and 10 for the ninth month. Currently, the is not used by any of the cultures supported by the class. Therefore, this class can be used only to calculate dates in the Taiwan lunisolar calendar. - Each object supports a set of calendars. The property returns the default calendar for the culture, and the property returns an array containing all the calendars supported by the culture. To change the calendar used by a , the application should set the property of to a new . + Each object supports a set of calendars. The property returns the default calendar for the culture, and the property returns an array containing all the calendars supported by the culture. To change the calendar used by a , the application should set the property of to a new . ]]> diff --git a/xml/System.Globalization/TextElementEnumerator.xml b/xml/System.Globalization/TextElementEnumerator.xml index 32052347ada..301e64cb658 100644 --- a/xml/System.Globalization/TextElementEnumerator.xml +++ b/xml/System.Globalization/TextElementEnumerator.xml @@ -94,9 +94,9 @@ The class allows you to work with the text elements in a string rather than with single objects. - You instantiate a object that represents a particular string by passing the string to the method. This returns an enumerator that is positioned before the first text element in the string. Calling the method also brings the enumerator back to this position. Because this represents an invalid state, you must call to advance the enumerator to the first text element of the string before reading the value of the property to return the current text element. + You instantiate a object that represents a particular string by passing the string to the method. This returns an enumerator that is positioned before the first text element in the string. Calling the method also brings the enumerator back to this position. Because this represents an invalid state, you must call to advance the enumerator to the first text element of the string before reading the value of the property to return the current text element. - When working with a object, you are responsible for positioning the enumerator. The property returns the same text element until you call either or . The enumerator is in an invalid state if it is positioned before the first text element or after the last text element in the string. When the enumerator is in an invalid state, attempting to retrieve the value of the property throws an exception. You can determine whether the enumerator is in an invalid state by testing whether the return value of the property is `false`. + When working with a object, you are responsible for positioning the enumerator. The property returns the same text element until you call either or . The enumerator is in an invalid state if it is positioned before the first text element or after the last text element in the string. When the enumerator is in an invalid state, attempting to retrieve the value of the property throws an exception. You can determine whether the enumerator is in an invalid state by testing whether the return value of the property is `false`. The object represents a snapshot of the current state of a string variable or string literal at the moment that the object is instantiated. Note that: @@ -106,7 +106,7 @@ - A object enumerates the text elements present in the string at the time that the object was instantiated. It does not reflect any subsequent changes to the string variable if that variable is modified afterward. -- Because the class does not override , two objects that represent the same string will be considered unequal. +- Because the class does not override , two objects that represent the same string will be considered unequal. @@ -172,11 +172,11 @@ is called, must be called to advance the enumerator to the first text element of the string before reading the value of . Otherwise, is undefined. + After an enumerator is created or after a is called, must be called to advance the enumerator to the first text element of the string before reading the value of . Otherwise, is undefined. - also throws an exception if the last call to returned `false`, which indicates the end of the string. + also throws an exception if the last call to returned `false`, which indicates the end of the string. - does not move the position of the enumerator, and consecutive calls to return the same object until either or is called. + does not move the position of the enumerator, and consecutive calls to return the same object until either or is called. ]]> @@ -354,11 +354,11 @@ is called, the enumerator is positioned before the first text element of the string, and the first call to moves the enumerator over the first text element of the string. + After an enumerator is created or after a is called, the enumerator is positioned before the first text element of the string, and the first call to moves the enumerator over the first text element of the string. - If the string is modified after this enumerator was created, throws an exception. + If the string is modified after this enumerator was created, throws an exception. - After the end of the string is passed, subsequent calls to return `false` until is called. + After the end of the string is passed, subsequent calls to return `false` until is called. ]]> @@ -423,7 +423,7 @@ method moves the enumerator to the beginning of the string, before the first text element. After calling , you must call to advance the enumerator to the first text element of the string before calling to read the value of the first text element. + The method moves the enumerator to the beginning of the string, before the first text element. After calling , you must call to advance the enumerator to the first text element of the string before calling to read the value of the first text element. ]]> diff --git a/xml/System.Globalization/TextInfo.xml b/xml/System.Globalization/TextInfo.xml index 906e8f7bbd3..3c9499f6c08 100644 --- a/xml/System.Globalization/TextInfo.xml +++ b/xml/System.Globalization/TextInfo.xml @@ -107,7 +107,7 @@ A writing system is the collection of scripts and orthographic rules required to The application should use the property to obtain the object for a particular object. If a security decision depends on a string comparison or a case-change operation, the application should use the property of the object returned by the property to ensure that the behavior of the operation is consistent regardless of the operating system culture settings. -The user might use the regional and language options portion of Control Panel to override the values associated with the current culture of Windows. For example, the user might choose to display the date in a different format or to use a currency other than the default for the culture. If the property is set to `true`, the property values of the objects returned by the , , and properties are also retrieved from the user settings. If the user settings are incompatible with the culture associated with the , for example, if the selected calendar is not one of the , the results of the methods and the values of the properties are undefined. +The user might use the regional and language options portion of Control Panel to override the values associated with the current culture of Windows. For example, the user might choose to display the date in a different format or to use a currency other than the default for the culture. If the property is set to `true`, the property values of the objects returned by the , , and properties are also retrieved from the user settings. If the user settings are incompatible with the culture associated with the , for example, if the selected calendar is not one of the , the results of the methods and the values of the properties are undefined. ]]> @@ -231,7 +231,7 @@ The user might use the regional and language options portion of Control Panel to ## Examples - The following code example demonstrates the and methods. + The following code example demonstrates the and methods. :::code language="csharp" source="~/snippets/csharp/System.Globalization/TextInfo/Clone/ro.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/TextInfo/Clone/ro.vb" id="Snippet1"::: @@ -296,9 +296,9 @@ The user might use the regional and language options portion of Control Panel to ## Remarks A object is created from a specific culture, and the property returns the name of that culture. - The property always reflects a specific culture rather than a neutral culture. If has a neutral culture as its value, then the corresponding has as its value an arbitrary specific culture that uses the same language. For example, the property returns "en" for the English neutral culture, but the corresponding property might return "en-US" for the English (United States) culture. If the object is associated with a specific culture instead of a neutral culture, the value of its property is always identical to the property value of its associated object. + The property always reflects a specific culture rather than a neutral culture. If has a neutral culture as its value, then the corresponding has as its value an arbitrary specific culture that uses the same language. For example, the property returns "en" for the English neutral culture, but the corresponding property might return "en-US" for the English (United States) culture. If the object is associated with a specific culture instead of a neutral culture, the value of its property is always identical to the property value of its associated object. - Similarly, the property never reflects a particular sort. It always corresponds to a default sort order. For example, the default sort order for Spanish (Spain) is the international sort order. If is es-ES_tradnl (Spanish with the traditional sort order) then the corresponding is es-ES (Spanish with the default international sort order). + Similarly, the property never reflects a particular sort. It always corresponds to a default sort order. For example, the default sort order for Spanish (Spain) is the international sort order. If is es-ES_tradnl (Spanish with the traditional sort order) then the corresponding is es-ES (Spanish with the default international sort order). ]]> @@ -416,7 +416,7 @@ The user might use the regional and language options portion of Control Panel to . + This method overrides . ]]> @@ -472,9 +472,9 @@ The user might use the regional and language options portion of Control Panel to . + This method overrides . - This method generates the same hash code for two objects that are equal according to the method. + This method generates the same hash code for two objects that are equal according to the method. ]]> @@ -660,9 +660,9 @@ The user might use the regional and language options portion of Control Panel to Certain predefined culture names and identifiers are used by this and other classes in the namespace. For detailed culture information for Windows systems, see the **Language tag** column in the [list of language/region names supported by Windows](https://learn.microsoft.com/openspecs/windows_protocols/ms-lcid/a9eac961-e77d-41a6-90a5-ce1a8b0cdb9c). Culture names follow the standard defined by [BCP 47](https://tools.ietf.org/html/bcp47). -The property always reflects a specific culture identifier instead of a neutral culture identifier. If is set to a neutral culture identifier, the corresponding has as its value an arbitrary specific culture identifier that uses the same language. For example, the property returns 0x0009 for the English neutral culture, named "en". However, the corresponding property might return 0x0409 for the English (United States) culture, named en-US. +The property always reflects a specific culture identifier instead of a neutral culture identifier. If is set to a neutral culture identifier, the corresponding has as its value an arbitrary specific culture identifier that uses the same language. For example, the property returns 0x0009 for the English neutral culture, named "en". However, the corresponding property might return 0x0409 for the English (United States) culture, named en-US. - Similarly, the property always corresponds to a default sort order, and never reflects a specific sort order. For example, the default sort order for Spanish (Spain) is the international sort order. If is set to "0x040A" (Spanish with the traditional sort order), the corresponding value is "0x0C0A" (Spanish with the default international sort order). + Similarly, the property always corresponds to a default sort order, and never reflects a specific sort order. For example, the default sort order for Spanish (Spain) is the international sort order. If is set to "0x040A" (Spanish with the traditional sort order), the corresponding value is "0x0C0A" (Spanish with the default international sort order). ]]> @@ -899,7 +899,7 @@ The property always reflects a specifi and methods. + The following code example demonstrates the and methods. :::code language="csharp" source="~/snippets/csharp/System.Globalization/TextInfo/Clone/ro.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/TextInfo/Clone/ro.vb" id="Snippet1"::: @@ -1053,7 +1053,7 @@ The property always reflects a specifi ## Remarks Casing semantics depend on the culture in use. For the invariant culture, the casing semantics are not culture-sensitive. For a specific culture, the casing semantics are sensitive to that culture. - If a security decision depends on a string comparison or a case-change operation, the application should use the to ensure that the behavior is consistent regardless of the culture settings of the system. However, the invariant culture must be used only by processes that require culture-independent results, such as system services. Otherwise, it produces results that might be linguistically incorrect or culturally inappropriate. + If a security decision depends on a string comparison or a case-change operation, the application should use the to ensure that the behavior is consistent regardless of the culture settings of the system. However, the invariant culture must be used only by processes that require culture-independent results, such as system services. Otherwise, it produces results that might be linguistically incorrect or culturally inappropriate. For more information on cultures, see . @@ -1130,7 +1130,7 @@ The property always reflects a specifi Casing semantics depend on the culture in use. For the invariant culture, the casing semantics are not culture-sensitive. For a specific culture, the casing semantics are sensitive to that culture. - If a security decision depends on a string comparison or a case-change operation, the application should use the to ensure that the behavior is consistent regardless of the culture settings of the system. However, the invariant culture must be used only by processes that require culture-independent results, such as system services. Otherwise, it produces results that might be linguistically incorrect or culturally inappropriate. + If a security decision depends on a string comparison or a case-change operation, the application should use the to ensure that the behavior is consistent regardless of the culture settings of the system. However, the invariant culture must be used only by processes that require culture-independent results, such as system services. Otherwise, it produces results that might be linguistically incorrect or culturally inappropriate. For more information on cultures, see . @@ -1225,7 +1225,7 @@ The property always reflects a specifi . + This method overrides . ]]> @@ -1291,9 +1291,9 @@ The property always reflects a specifi |Per anhalter durch die Galaxis|German|Per Anhalter durch die Galaxis|Per Anhalter Durch Die Galaxis| |les naufragés d'ythaq|French|Les Naufragés d'Ythaq|Les Naufragés D'ythaq| - As illustrated above, the method provides an arbitrary casing behavior which is not necessarily linguistically correct. A linguistically correct solution would require additional rules, and the current algorithm is somewhat simpler and faster. We reserve the right to make this API slower in the future. + As illustrated above, the method provides an arbitrary casing behavior which is not necessarily linguistically correct. A linguistically correct solution would require additional rules, and the current algorithm is somewhat simpler and faster. We reserve the right to make this API slower in the future. - The current implementation of the method yields an output string that is the same length as the input string. However, this behavior is not guaranteed and could change in a future implementation. + The current implementation of the method yields an output string that is the same length as the input string. However, this behavior is not guaranteed and could change in a future implementation. @@ -1303,7 +1303,7 @@ The property always reflects a specifi :::code language="csharp" source="~/snippets/csharp/System.Globalization/TextInfo/ToTitleCase/textinfo_casing.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/TextInfo/ToTitleCase/textinfo_casing.vb" id="Snippet1"::: - The following example passes each string in an array to the method. The strings include proper title strings as well as acronyms. The strings are converted to title case by using the conventions of the en-US culture. + The following example passes each string in an array to the method. The strings include proper title strings as well as acronyms. The strings are converted to title case by using the conventions of the en-US culture. :::code language="csharp" source="~/snippets/csharp/System.Globalization/TextInfo/ToTitleCase/totitlecase2.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/TextInfo/ToTitleCase/totitlecase2.vb" id="Snippet1"::: @@ -1406,7 +1406,7 @@ The property always reflects a specifi ## Remarks Casing semantics depend on the culture in use. For the invariant culture, the casing semantics are not culture-sensitive. For a specific culture, the casing semantics are sensitive to that culture. - If a security decision depends on a string comparison or a case-change operation, the application should use the to ensure that the behavior is consistent regardless of the culture settings of the system. However, the invariant culture must be used only by processes that require culture-independent results, such as system services. Otherwise, it produces results that might be linguistically incorrect or culturally inappropriate. + If a security decision depends on a string comparison or a case-change operation, the application should use the to ensure that the behavior is consistent regardless of the culture settings of the system. However, the invariant culture must be used only by processes that require culture-independent results, such as system services. Otherwise, it produces results that might be linguistically incorrect or culturally inappropriate. For more information on cultures, see . @@ -1483,7 +1483,7 @@ The property always reflects a specifi Casing semantics depend on the culture in use. For the invariant culture, the casing semantics are not culture-sensitive. For a specific culture, the casing semantics are sensitive to that culture. - If a security decision depends on a string comparison or a case-change operation, the application should use the to ensure that the behavior is consistent regardless of the culture settings of the system. However, the invariant culture must be used only by processes that require culture-independent results, such as system services. Otherwise, it produces results that might be linguistically incorrect or culturally inappropriate. + If a security decision depends on a string comparison or a case-change operation, the application should use the to ensure that the behavior is consistent regardless of the culture settings of the system. However, the invariant culture must be used only by processes that require culture-independent results, such as system services. Otherwise, it produces results that might be linguistically incorrect or culturally inappropriate. For more information on cultures, see . diff --git a/xml/System.Globalization/ThaiBuddhistCalendar.xml b/xml/System.Globalization/ThaiBuddhistCalendar.xml index fa040ce996a..5aad0ca9b2f 100644 --- a/xml/System.Globalization/ThaiBuddhistCalendar.xml +++ b/xml/System.Globalization/ThaiBuddhistCalendar.xml @@ -110,7 +110,7 @@ The date January 1, 2001 A.D. in the Gregorian calendar is equivalent to the first day of January in the year 2544 of the current era in the Thai Buddhist calendar. - Each supports a set of calendars. The property returns the default calendar for the culture, and the property returns an array containing all the calendars supported by the culture. To change the calendar used by a , the application should set the property of to a new . + Each supports a set of calendars. The property returns the default calendar for the culture, and the property returns an array containing all the calendars supported by the culture. To change the calendar used by a , the application should set the property of to a new . ]]> @@ -224,7 +224,7 @@ If the value of the `months` parameter is negative, the resulting is earlier than the specified . - The property of the returned value always equals . You can preserve the property of the `time` parameter by calling the method, as the following example shows. + The property of the returned value always equals . You can preserve the property of the `time` parameter by calling the method, as the following example shows. :::code language="csharp" source="~/snippets/csharp/System.Globalization/Calendar/AddDays/add1.cs" id="Snippet5"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/Calendar/AddDays/add1.vb" id="Snippet5"::: @@ -232,7 +232,7 @@ ## Examples - The following example demonstrates the use of the method. + The following example demonstrates the use of the method. :::code language="csharp" source="~/snippets/csharp/System.Globalization/ThaiBuddhistCalendar/AddMonths/thaibuddhistcalendar_addget.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/ThaiBuddhistCalendar/AddMonths/thaibuddhistcalendar_addget.vb" id="Snippet1"::: @@ -310,7 +310,7 @@ If `years` is negative, the resulting is earlier than the specified . - The property of the returned value always equals . You can preserve the property of the `time` parameter by calling the method, as the following example shows. + The property of the returned value always equals . You can preserve the property of the `time` parameter by calling the method, as the following example shows. :::code language="csharp" source="~/snippets/csharp/System.Globalization/Calendar/AddDays/add1.cs" id="Snippet8"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/Calendar/AddDays/add1.vb" id="Snippet8"::: @@ -318,7 +318,7 @@ ## Examples - The following example demonstrates the use of the method. + The following example demonstrates the use of the method. :::code language="csharp" source="~/snippets/csharp/System.Globalization/ThaiBuddhistCalendar/AddMonths/thaibuddhistcalendar_addget.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/ThaiBuddhistCalendar/AddMonths/thaibuddhistcalendar_addget.vb" id="Snippet1"::: @@ -498,7 +498,7 @@ method. + The following example demonstrates the use of the method. :::code language="csharp" source="~/snippets/csharp/System.Globalization/ThaiBuddhistCalendar/AddMonths/thaibuddhistcalendar_addget.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/ThaiBuddhistCalendar/AddMonths/thaibuddhistcalendar_addget.vb" id="Snippet1"::: @@ -578,7 +578,7 @@ ## Examples - The following example demonstrates the use of the method. + The following example demonstrates the use of the method. :::code language="csharp" source="~/snippets/csharp/System.Globalization/ThaiBuddhistCalendar/AddMonths/thaibuddhistcalendar_addget.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/ThaiBuddhistCalendar/AddMonths/thaibuddhistcalendar_addget.vb" id="Snippet1"::: @@ -644,12 +644,12 @@ for the first day of the first month returns 1, and for the last day of the last month returns the total number of days in that year. The total is the same as the value returned by . + The day of the year is defined as the number of days from the first day of the year. For example, for the first day of the first month returns 1, and for the last day of the last month returns the total number of days in that year. The total is the same as the value returned by . ## Examples - The following example demonstrates the use of the method. + The following example demonstrates the use of the method. :::code language="csharp" source="~/snippets/csharp/System.Globalization/ThaiBuddhistCalendar/AddMonths/thaibuddhistcalendar_addget.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/ThaiBuddhistCalendar/AddMonths/thaibuddhistcalendar_addget.vb" id="Snippet1"::: @@ -723,7 +723,7 @@ ## Examples - The following example calls for the second month in each of five years in each era. + The following example calls for the second month in each of five years in each era. :::code language="csharp" source="~/snippets/csharp/System.Globalization/ThaiBuddhistCalendar/GetDaysInMonth/thaibuddhistcalendar_getdaysinmonth.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/ThaiBuddhistCalendar/GetDaysInMonth/thaibuddhistcalendar_getdaysinmonth.vb" id="Snippet1"::: @@ -805,7 +805,7 @@ ## Examples - The following example calls for five years in each era. + The following example calls for five years in each era. :::code language="csharp" source="~/snippets/csharp/System.Globalization/ThaiBuddhistCalendar/GetDaysInYear/thaibuddhistcalendar_getdaysinyear.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/ThaiBuddhistCalendar/GetDaysInYear/thaibuddhistcalendar_getdaysinyear.vb" id="Snippet1"::: @@ -881,7 +881,7 @@ ## Examples - The following example demonstrates the use of the method. + The following example demonstrates the use of the method. :::code language="csharp" source="~/snippets/csharp/System.Globalization/ThaiBuddhistCalendar/AddMonths/thaibuddhistcalendar_addget.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/ThaiBuddhistCalendar/AddMonths/thaibuddhistcalendar_addget.vb" id="Snippet1"::: @@ -953,7 +953,7 @@ method returns a number between 1 and 13 that indicates the month associated with a specified date. If there is a leap month between the eighth and ninth months of the year, the method returns 8 for the eighth month, 9 for the leap eighth month, and 10 for the ninth month. + In a calendar that supports the notion of a leap month, the leap month can occur either after a particular month or after any month in a year. For example, the method returns a number between 1 and 13 that indicates the month associated with a specified date. If there is a leap month between the eighth and ninth months of the year, the method returns 8 for the eighth month, 9 for the leap eighth month, and 10 for the ninth month. ]]> @@ -1011,7 +1011,7 @@ method. + The following example demonstrates the use of the method. :::code language="csharp" source="~/snippets/csharp/System.Globalization/ThaiBuddhistCalendar/AddMonths/thaibuddhistcalendar_addget.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/ThaiBuddhistCalendar/AddMonths/thaibuddhistcalendar_addget.vb" id="Snippet1"::: @@ -1077,7 +1077,7 @@ for five years in each era. + The following example calls for five years in each era. :::code language="csharp" source="~/snippets/csharp/System.Globalization/ThaiBuddhistCalendar/GetMonthsInYear/thaibuddhistcalendar_getmonthsinyear.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/ThaiBuddhistCalendar/GetMonthsInYear/thaibuddhistcalendar_getmonthsinyear.vb" id="Snippet1"::: @@ -1159,18 +1159,18 @@ ## Remarks This method can be used to determine the number of weeks in the year by setting the `time` parameter to the last day of the year. - contains culture-specific values that can be used for the `rule` and `firstDayOfWeek` parameters. + contains culture-specific values that can be used for the `rule` and `firstDayOfWeek` parameters. - The property of contains the default value that represents the first day of the week for a specific culture, using the calendar specified in the property of . + The property of contains the default value that represents the first day of the week for a specific culture, using the calendar specified in the property of . - The property of contains the default value that defines a calendar week for a specific culture, using the calendar specified in the property of . + The property of contains the default value that defines a calendar week for a specific culture, using the calendar specified in the property of . - For example, in , for January 1 returns 1. + For example, in , for January 1 returns 1. ## Examples - The following example shows how the result of the method varies depending on the and values used. If the specified date is the last day of the year, returns the total number of weeks in that year. + The following example shows how the result of the method varies depending on the and values used. If the specified date is the last day of the year, returns the total number of weeks in that year. :::code language="csharp" source="~/snippets/csharp/System.Globalization/Calendar/GetWeekOfYear/yslin_calendar_getweekofyear.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/Calendar/GetWeekOfYear/yslin_calendar_getweekofyear.vb" id="Snippet1"::: @@ -1241,7 +1241,7 @@ Method. + The following example demonstrates the use of the Method. :::code language="csharp" source="~/snippets/csharp/System.Globalization/ThaiBuddhistCalendar/AddMonths/thaibuddhistcalendar_addget.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/ThaiBuddhistCalendar/AddMonths/thaibuddhistcalendar_addget.vb" id="Snippet1"::: @@ -1319,7 +1319,7 @@ ## Examples - The following example calls for the last day of the second month (February) for five years in each of the eras. + The following example calls for the last day of the second month (February) for five years in each of the eras. :::code language="csharp" source="~/snippets/csharp/System.Globalization/ThaiBuddhistCalendar/IsLeapDay/thaibuddhistcalendar_isleapday.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/ThaiBuddhistCalendar/IsLeapDay/thaibuddhistcalendar_isleapday.vb" id="Snippet1"::: @@ -1411,7 +1411,7 @@ ## Examples - The following example calls for all the months in five years in the current era. + The following example calls for all the months in five years in the current era. :::code language="csharp" source="~/snippets/csharp/System.Globalization/ThaiBuddhistCalendar/IsLeapMonth/thaibuddhistcalendar_isleapmonth.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/ThaiBuddhistCalendar/IsLeapMonth/thaibuddhistcalendar_isleapmonth.vb" id="Snippet1"::: @@ -1495,7 +1495,7 @@ ## Examples - The following example calls for five years in each of the eras. + The following example calls for five years in each of the eras. :::code language="csharp" source="~/snippets/csharp/System.Globalization/ThaiBuddhistCalendar/IsLeapYear/thaibuddhistcalendar_isleapyear.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/ThaiBuddhistCalendar/IsLeapYear/thaibuddhistcalendar_isleapyear.vb" id="Snippet1"::: @@ -1844,9 +1844,9 @@ is the last year in the 100-year range that can be represented by a two-digit year. The century is determined by finding the sole occurrence of the two-digit `year` within that 100-year range. For example, if is set to 2029, the 100-year range is from 1930 to 2029. Therefore, a 2-digit value of 30 is interpreted as 1930, while a 2-digit value of 29 is interpreted as 2029. + is the last year in the 100-year range that can be represented by a two-digit year. The century is determined by finding the sole occurrence of the two-digit `year` within that 100-year range. For example, if is set to 2029, the 100-year range is from 1930 to 2029. Therefore, a 2-digit value of 30 is interpreted as 1930, while a 2-digit value of 29 is interpreted as 2029. - supports either a two-digit year or a four-digit year. Passing a two-digit year value (less than 100) causes the method to convert the value to a four-digit value according to the value representing the appropriate century. If the application supplies a four-digit year value that is within the supported calendar range to , the method returns the actual input value. If the application supplies a four-digit value that is outside the supported calendar range, or if it supplies a negative value, the method throws an exception. + supports either a two-digit year or a four-digit year. Passing a two-digit year value (less than 100) causes the method to convert the value to a four-digit value according to the value representing the appropriate century. If the application supplies a four-digit year value that is within the supported calendar range to , the method returns the actual input value. If the application supplies a four-digit value that is outside the supported calendar range, or if it supplies a negative value, the method throws an exception. ]]> diff --git a/xml/System.Globalization/UmAlQuraCalendar.xml b/xml/System.Globalization/UmAlQuraCalendar.xml index 3e6d0944435..c584030c2fe 100644 --- a/xml/System.Globalization/UmAlQuraCalendar.xml +++ b/xml/System.Globalization/UmAlQuraCalendar.xml @@ -195,7 +195,7 @@ If the value of the `months` parameter is negative, the resulting is earlier than the specified . - The property of the returned value always equals . You can preserve the property of the `time` parameter by calling the method, as the following example shows. + The property of the returned value always equals . You can preserve the property of the `time` parameter by calling the method, as the following example shows. :::code language="csharp" source="~/snippets/csharp/System.Globalization/Calendar/AddDays/add1.cs" id="Snippet5"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/Calendar/AddDays/add1.vb" id="Snippet5"::: @@ -203,7 +203,7 @@ ## Examples - The following example instantiates a value and displays the values of several of its components in the Um Al Qura calendar. Next, it calls the and methods to add 2 years and 10 months in the Um Al Qura calendar to the date value. Finally, it again displays the values of these date components in the Um Al Qura calendar. + The following example instantiates a value and displays the values of several of its components in the Um Al Qura calendar. Next, it calls the and methods to add 2 years and 10 months in the Um Al Qura calendar to the date value. Finally, it again displays the values of these date components in the Um Al Qura calendar. :::code language="csharp" source="~/snippets/csharp/System.Globalization/UmAlQuraCalendar/AddMonths/addmonths1.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/UmAlQuraCalendar/AddMonths/addmonths1.vb" id="Snippet1"::: @@ -278,7 +278,7 @@ If `years` is negative, the resulting is earlier than the specified . - The property of the returned value always equals . You can preserve the property of the `time` parameter by calling the method, as the following example shows. + The property of the returned value always equals . You can preserve the property of the `time` parameter by calling the method, as the following example shows. :::code language="csharp" source="~/snippets/csharp/System.Globalization/Calendar/AddDays/add1.cs" id="Snippet8"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/Calendar/AddDays/add1.vb" id="Snippet8"::: @@ -286,7 +286,7 @@ ## Examples - The following example instantiates a value and displays the values of several of its components in the Um AL Qura calendar. Next, it calls the and methods to add 2 years and 10 months in the Um Al Qura calendar to the date value. Finally, it again displays the values of these date components in the Um Al Qura calendar. + The following example instantiates a value and displays the values of several of its components in the Um AL Qura calendar. Next, it calls the and methods to add 2 years and 10 months in the Um Al Qura calendar to the date value. Finally, it again displays the values of these date components in the Um Al Qura calendar. :::code language="csharp" source="~/snippets/csharp/System.Globalization/UmAlQuraCalendar/AddMonths/addmonths1.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/UmAlQuraCalendar/AddMonths/addmonths1.vb" id="Snippet1"::: @@ -652,7 +652,7 @@ method returns 1 for the first day of the first month of the year, and the total number of days in the year for the last day of the last month. + The day of the year is defined as the number of days from the first day of the year. For example, the method returns 1 for the first day of the first month of the year, and the total number of days in the year for the last day of the last month. @@ -729,7 +729,7 @@ ## Examples - The following example calls the method to get the number of days in each month of five consecutive years. + The following example calls the method to get the number of days in each month of five consecutive years. :::code language="csharp" source="~/snippets/csharp/System.Globalization/UmAlQuraCalendar/GetDaysInMonth/getdaysinmonth1.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/UmAlQuraCalendar/GetDaysInMonth/getdaysinmonth1.vb" id="Snippet1"::: @@ -793,7 +793,7 @@ method to get the number of days in ten consecutive years in each era supported by the class. + The following example calls the method to get the number of days in ten consecutive years in each era supported by the class. :::code language="csharp" source="~/snippets/csharp/System.Globalization/UmAlQuraCalendar/GetDaysInYear/getdaysinyear1.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/UmAlQuraCalendar/GetDaysInYear/getdaysinyear1.vb" id="Snippet1"::: @@ -925,7 +925,7 @@ method returns a number between 1 and 13 that indicates the month associated with a specified date. If there is a leap month between the eighth and ninth months of the year, the method returns 8 for the eighth month, 9 for the leap eighth month, and 10 for the ninth month. + In a calendar that supports the notion of a leap month, the leap month can occur either after a particular month or after any month in a year. For example, the method returns a number between 1 and 13 that indicates the month associated with a specified date. If there is a leap month between the eighth and ninth months of the year, the method returns 8 for the eighth month, 9 for the leap eighth month, and 10 for the ninth month. ]]> @@ -988,7 +988,7 @@ class in both the Gregorian and Um Al Qura calendars. The method is used to retrieve the month of the minimum and maximum supported dates in the Um Al Qura calendar if it is not the current culture's current calendar. + The following example displays the date ranges supported by the class in both the Gregorian and Um Al Qura calendars. The method is used to retrieve the month of the minimum and maximum supported dates in the Um Al Qura calendar if it is not the current culture's current calendar. :::code language="csharp" source="~/snippets/csharp/System.Globalization/UmAlQuraCalendar/GetMonth/getmonth1.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/UmAlQuraCalendar/GetMonth/getmonth1.vb" id="Snippet1"::: @@ -1053,7 +1053,7 @@ method to determine the number of months in four consecutive years, and then calls the method to determine how many days there are in each month. + The following example calls the method to determine the number of months in four consecutive years, and then calls the method to determine how many days there are in each month. :::code language="csharp" source="~/snippets/csharp/System.Globalization/UmAlQuraCalendar/GetDaysInMonth/getdaysinmonth1.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/UmAlQuraCalendar/GetDaysInMonth/getdaysinmonth1.vb" id="Snippet1"::: @@ -1117,7 +1117,7 @@ class in both the Gregorian and Um Al Qura calendars. The method is used to retrieve the year of the minimum and maximum supported dates in the Um Al Qura calendar if it is not the current culture's current calendar. + The following example displays the date ranges supported by the class in both the Gregorian and Um Al Qura calendars. The method is used to retrieve the year of the minimum and maximum supported dates in the Um Al Qura calendar if it is not the current culture's current calendar. :::code language="csharp" source="~/snippets/csharp/System.Globalization/UmAlQuraCalendar/GetMonth/getmonth1.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/UmAlQuraCalendar/GetMonth/getmonth1.vb" id="Snippet1"::: @@ -1191,7 +1191,7 @@ ## Examples - The following example calls the method for the last day of the second month (February) for five years in each of the eras. + The following example calls the method for the last day of the second month (February) for five years in each of the eras. :::code language="csharp" source="~/snippets/csharp/System.Globalization/HijriCalendar/IsLeapDay/hijricalendar_isleapday.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/HijriCalendar/IsLeapDay/hijricalendar_isleapday.vb" id="Snippet1"::: @@ -1324,7 +1324,7 @@ ## Examples - The following example lists the number of days in ten consecutive years and calls the method to determine which years are leap years. + The following example lists the number of days in ten consecutive years and calls the method to determine which years are leap years. :::code language="csharp" source="~/snippets/csharp/System.Globalization/UmAlQuraCalendar/IsLeapYear/isleapyear1.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/UmAlQuraCalendar/IsLeapYear/isleapyear1.vb" id="Snippet1"::: @@ -1519,7 +1519,7 @@ method is useful because it can convert any date in the current calendar to a Gregorian calendar date. The Gregorian date can subsequently be used, for example, to compare dates in different calendars or create an equivalent date in a particular calendar. + The method is useful because it can convert any date in the current calendar to a Gregorian calendar date. The Gregorian date can subsequently be used, for example, to compare dates in different calendars or create an equivalent date in a particular calendar. ]]> @@ -1594,11 +1594,11 @@ method uses the `year` parameter, the property, and a year to calculate a 4-digit year. The century is determined by finding the sole occurrence of the 2-digit `year` parameter within that 100-year range. For example, if is set to 1429, the 100-year range is from 1330 through 1429. Therefore, a 2-digit value of 30 is interpreted as 1330, while a 2-digit value of 29 is interpreted as 1429. + The method uses the `year` parameter, the property, and a year to calculate a 4-digit year. The century is determined by finding the sole occurrence of the 2-digit `year` parameter within that 100-year range. For example, if is set to 1429, the 100-year range is from 1330 through 1429. Therefore, a 2-digit value of 30 is interpreted as 1330, while a 2-digit value of 29 is interpreted as 1429. - If the property is the special value 99, the method ignores the settings in the regional and language options in Control Panel and returns the `year` parameter unchanged. + If the property is the special value 99, the method ignores the settings in the regional and language options in Control Panel and returns the `year` parameter unchanged. - supports either a two-digit year or a four-digit year. Passing a two-digit year value (less than 100) causes the method to convert the value to a four-digit value according to the value representing the appropriate century. If the application supplies a four-digit year value that is within the supported calendar range to , the method returns the actual input value. If the application supplies a four-digit value that is outside the supported calendar range, or if it supplies a negative value, the method throws an exception. + supports either a two-digit year or a four-digit year. Passing a two-digit year value (less than 100) causes the method to convert the value to a four-digit value according to the value representing the appropriate century. If the application supplies a four-digit year value that is within the supported calendar range to , the method returns the actual input value. If the application supplies a four-digit value that is outside the supported calendar range, or if it supplies a negative value, the method throws an exception. ]]> @@ -1658,7 +1658,7 @@ The initial value of this property is derived from the settings in the regional and language options portion of Control Panel. However, that information can change during the life of the . The class does not detect changes in the system settings automatically. - The special value 99 causes the method to ignore the system settings and return the specified year unchanged. + The special value 99 causes the method to ignore the system settings and return the specified year unchanged. ]]> diff --git a/xml/System.Globalization/UnicodeCategory.xml b/xml/System.Globalization/UnicodeCategory.xml index a8ba3bdf725..e7cf5eb81ca 100644 --- a/xml/System.Globalization/UnicodeCategory.xml +++ b/xml/System.Globalization/UnicodeCategory.xml @@ -72,34 +72,34 @@ Defines the Unicode category of a character. - enumeration is returned by the and methods. The enumeration is also used to support methods, such as . Such methods determine whether a specified character is a member of a particular Unicode general category. A Unicode general category defines the broad classification of a character, that is, designation as a type of letter, decimal digit, separator, mathematical symbol, punctuation, and so on. - - This enumeration is based on The Unicode Standard, version 5.0. For more information, see the "UCD File Format" and "General Category Values" subtopics at the [Unicode Character Database](https://go.microsoft.com/fwlink/?LinkId=57650). - - The Unicode Standard defines the following: - - A surrogate pair is a coded character representation for a single abstract character that consists of a sequence of two code units, where the first unit of the pair is a high surrogate and the second is a low surrogate. A high surrogate is a Unicode code point in the range U+D800 through U+DBFF and a low surrogate is a Unicode code point in the range U+DC00 through U+DFFF. - - A combining character sequence is a combination of a base character and one or more combining characters. A surrogate pair represents a base character or a combining character. A combining character is either spacing or nonspacing. A spacing combining character takes up a spacing position by itself when rendered, while a nonspacing combining character does not. Diacritics are an example of nonspacing combining characters. - - A modifier letter is a free-standing spacing character that, like a combining character, indicates modifications of a preceding letter. - - An enclosing mark is a nonspacing combining character that surrounds all previous characters up to and including a base character. - - A format character is a character that is not normally rendered but that affects the layout of text or the operation of text processes. - - The Unicode Standard defines several variations to some punctuation marks. For example, a hyphen can be one of several code values that represent a hyphen, such as U+002D (hyphen-minus) or U+00AD (soft hyphen) or U+2010 (hyphen) or U+2011 (nonbreaking hyphen). The same is true for dashes, space characters, and quotation marks. - - The Unicode Standard also assigns codes to representations of decimal digits that are specific to a given script or language, for example, U+0030 (digit zero) and U+0660 (Arabic-Indic digit zero). - - - -## Examples - The following example displays the characters and their corresponding code points for characters in the UppercaseLetter category. You can modify the example to display the letters in any other category by replacing UppercaseLetter with the category of interest to you in the assignment to the `category` variable. Note that the output for some categories can be extensive. - + enumeration is returned by the and methods. The enumeration is also used to support methods, such as . Such methods determine whether a specified character is a member of a particular Unicode general category. A Unicode general category defines the broad classification of a character, that is, designation as a type of letter, decimal digit, separator, mathematical symbol, punctuation, and so on. + + This enumeration is based on The Unicode Standard, version 5.0. For more information, see the "UCD File Format" and "General Category Values" subtopics at the [Unicode Character Database](https://go.microsoft.com/fwlink/?LinkId=57650). + + The Unicode Standard defines the following: + + A surrogate pair is a coded character representation for a single abstract character that consists of a sequence of two code units, where the first unit of the pair is a high surrogate and the second is a low surrogate. A high surrogate is a Unicode code point in the range U+D800 through U+DBFF and a low surrogate is a Unicode code point in the range U+DC00 through U+DFFF. + + A combining character sequence is a combination of a base character and one or more combining characters. A surrogate pair represents a base character or a combining character. A combining character is either spacing or nonspacing. A spacing combining character takes up a spacing position by itself when rendered, while a nonspacing combining character does not. Diacritics are an example of nonspacing combining characters. + + A modifier letter is a free-standing spacing character that, like a combining character, indicates modifications of a preceding letter. + + An enclosing mark is a nonspacing combining character that surrounds all previous characters up to and including a base character. + + A format character is a character that is not normally rendered but that affects the layout of text or the operation of text processes. + + The Unicode Standard defines several variations to some punctuation marks. For example, a hyphen can be one of several code values that represent a hyphen, such as U+002D (hyphen-minus) or U+00AD (soft hyphen) or U+2010 (hyphen) or U+2011 (nonbreaking hyphen). The same is true for dashes, space characters, and quotation marks. + + The Unicode Standard also assigns codes to representations of decimal digits that are specific to a given script or language, for example, U+0030 (digit zero) and U+0660 (Arabic-Indic digit zero). + + + +## Examples + The following example displays the characters and their corresponding code points for characters in the UppercaseLetter category. You can modify the example to display the letters in any other category by replacing UppercaseLetter with the category of interest to you in the assignment to the `category` variable. Note that the output for some categories can be extensive. + :::code language="csharp" source="~/snippets/csharp/System.Globalization/UnicodeCategory/Overview/Characters1.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Globalization/UnicodeCategory/Overview/Characters1.vb" id="Snippet1"::: diff --git a/xml/System.Management.Instrumentation/InstrumentationManager.xml b/xml/System.Management.Instrumentation/InstrumentationManager.xml index 573aa3810d4..870b5118799 100644 --- a/xml/System.Management.Instrumentation/InstrumentationManager.xml +++ b/xml/System.Management.Instrumentation/InstrumentationManager.xml @@ -22,11 +22,11 @@ and methods. + Decoupled providers are hosted by an application. Two methods can be used by the application to make instances of WMI classes available: publish/revoke or the callback method. The callback method uses the and methods. In the publish/revoke model, the WMI infrastructure provides default behavior for many of the methods you have to write yourself in the callback method. These include the enumeration and bind methods. In this model, the application creates instances and publishes them. The application is responsible for ensuring that the key properties of the classes are respected. The application is also responsible for deleting instances. - In the callback model, the WMI infrastructure expects the application to have methods that handle enumeration, binding and any other methods required to implement the functionality of the provider. It calls into the application for this functionality and fails if it does not exist or is not implemented properly. The application registers the type of its WMI classes with the infrastructure by calling and indicates that it no longer wants the WMI classes exposed by calling . + In the callback model, the WMI infrastructure expects the application to have methods that handle enumeration, binding and any other methods required to implement the functionality of the provider. It calls into the application for this functionality and fails if it does not exist or is not implemented properly. The application registers the type of its WMI classes with the infrastructure by calling and indicates that it no longer wants the WMI classes exposed by calling . diff --git a/xml/System.Management.Instrumentation/WmiProviderInstallationException.xml b/xml/System.Management.Instrumentation/WmiProviderInstallationException.xml index 7cf244e7aa2..b8fe957ade5 100644 --- a/xml/System.Management.Instrumentation/WmiProviderInstallationException.xml +++ b/xml/System.Management.Instrumentation/WmiProviderInstallationException.xml @@ -23,7 +23,7 @@ Represents an exception to throw when WMI provider installation fails. - Note: the WMI .NET libraries are now considered in final state, and no further development, enhancements, or updates will be available for non-security related issues affecting these libraries. The MI APIs should be used for all new development. + Note: the WMI .NET libraries are now considered in final state, and no further development, enhancements, or updates will be available for non-security related issues affecting these libraries. The MI APIs should be used for all new development. To be added. diff --git a/xml/System.Management/EventQuery.xml b/xml/System.Management/EventQuery.xml index bde09c59ff4..ac947641af0 100644 --- a/xml/System.Management/EventQuery.xml +++ b/xml/System.Management/EventQuery.xml @@ -26,14 +26,14 @@ Represents a WMI *event query*. - method. This example can be tested by starting a process, such as Notepad, while the example code is running. - + method. This example can be tested by starting a process, such as Notepad, while the example code is running. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WindowsServer/wminet_EventQuery/cs/EventQuery.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Management/EventQuery/Overview/EventQuery.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.Management/EventQuery/Overview/EventQuery.vb" id="Snippet1"::: + ]]> @@ -65,21 +65,21 @@ Initializes a new instance of the class. This is the parameterless constructor. - method. This example can be tested by starting a process, such as Notepad, while the example code is running. - + method. This example can be tested by starting a process, such as Notepad, while the example code is running. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WindowsServer/wminet_EventQuery/cs/EventQuery.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Management/EventQuery/Overview/EventQuery.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.Management/EventQuery/Overview/EventQuery.vb" id="Snippet1"::: + ]]> @@ -106,21 +106,21 @@ A textual representation of the event query. Initializes a new instance of the class for the specified query. - method. This example can be tested by starting a process, such as Notepad, while the example code is running. - + method. This example can be tested by starting a process, such as Notepad, while the example code is running. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WindowsServer/wminet_EventQuery-1/cs/EventQuery-1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Management/EventQuery/.ctor/EventQuery-1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.Management/EventQuery/.ctor/EventQuery-1.vb" id="Snippet1"::: + ]]> @@ -149,21 +149,21 @@ The string representation of the query. Initializes a new instance of the class for the specified language and query. - method. This example can be tested by starting a process, such as Notepad, while the example code is running. - + method. This example can be tested by starting a process, such as Notepad, while the example code is running. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WindowsServer/wminet_EventQuery-2/cs/EventQuery-2.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Management/EventQuery/.ctor/EventQuery-2.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.Management/EventQuery/.ctor/EventQuery-2.vb" id="Snippet1"::: + ]]> @@ -191,13 +191,13 @@ Returns a copy of the object. The cloned object. - diff --git a/xml/System.Management/EventWatcherOptions.xml b/xml/System.Management/EventWatcherOptions.xml index bde1bdbb927..41bbc45f6eb 100644 --- a/xml/System.Management/EventWatcherOptions.xml +++ b/xml/System.Management/EventWatcherOptions.xml @@ -26,14 +26,14 @@ Specifies options for management event watching. - method. This example can be tested by starting a process, such as Notepad, while the example code is running. - + method. This example can be tested by starting a process, such as Notepad, while the example code is running. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WindowsServer/wminet_EventWatcherOptions/cs/EventWatcherOptions.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Management/EventWatcherOptions/Overview/EventWatcherOptions.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.Management/EventWatcherOptions/Overview/EventWatcherOptions.vb" id="Snippet1"::: + ]]> @@ -65,21 +65,21 @@ Initializes a new instance of the class for event watching, using default values. This is the parameterless constructor. - method. This example can be tested by starting a process, such as Notepad, while the example code is running. - + method. This example can be tested by starting a process, such as Notepad, while the example code is running. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WindowsServer/wminet_EventWatcherOptions/cs/EventWatcherOptions.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Management/EventWatcherOptions/Overview/EventWatcherOptions.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.Management/EventWatcherOptions/Overview/EventWatcherOptions.vb" id="Snippet1"::: + ]]> @@ -110,21 +110,21 @@ The number of events to wait for in each block. Initializes a new instance of the class with the given values. - method. This example can be tested by starting a process, such as Notepad, while the example code is running. - + method. This example can be tested by starting a process, such as Notepad, while the example code is running. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WindowsServer/wminet_EventWatcherOptions-3/cs/EventWatcherOptions-3.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Management/EventWatcherOptions/.ctor/EventWatcherOptions-3.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.Management/EventWatcherOptions/.ctor/EventWatcherOptions-3.vb" id="Snippet1"::: + ]]> @@ -151,24 +151,24 @@ Gets or sets the block size for block operations. When waiting for events, this value specifies how many events to wait for before returning. An integer value indicating the block size for a block of operations. - method. This example can be tested by starting a process, such as Notepad, while the example code is running. - + method. This example can be tested by starting a process, such as Notepad, while the example code is running. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WindowsServer/wminet_EventWatcherOptions_BlockSize/cs/EventWatcherOptions_BlockSize.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Management/EventWatcherOptions/BlockSize/EventWatcherOptions_BlockSize.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.Management/EventWatcherOptions/BlockSize/EventWatcherOptions_BlockSize.vb" id="Snippet1"::: + ]]> @@ -196,13 +196,13 @@ Returns a copy of the object. The cloned object. - diff --git a/xml/System.Management/ManagementBaseObject.xml b/xml/System.Management/ManagementBaseObject.xml index e267d46a4e9..d10741dc87e 100644 --- a/xml/System.Management/ManagementBaseObject.xml +++ b/xml/System.Management/ManagementBaseObject.xml @@ -385,7 +385,7 @@ ## Examples - The following example uses the method to display the value of the **Description** qualifier for each of the properties in the **Win32_Process** class. For more information on the **Win32_Process** class, see the [Windows Management Instrumentation](/windows/desktop/wmisdk/wmi-start-page) documentation. + The following example uses the method to display the value of the **Description** qualifier for each of the properties in the **Win32_Process** class. For more information on the **Win32_Process** class, see the [Windows Management Instrumentation](/windows/desktop/wmisdk/wmi-start-page) documentation. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WindowsServer/wminet_ManagementBaseObject_GetPropertyQualifierValue/cs/ManagementBaseObject_GetPropertyQualifierValue.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementBaseObject/GetPropertyQualifierValue/ManagementBaseObject_GetPropertyQualifierValue.vb" id="Snippet1"::: @@ -430,7 +430,7 @@ ## Examples - The following example lists all the names of the processes running on the local computer. The code uses the method to get the process names. + The following example lists all the names of the processes running on the local computer. The code uses the method to get the process names. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WindowsServer/wminet_ManagementBaseObject_GetPropertyValue/cs/ManagementBaseObject_GetPropertyValue.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementBaseObject/GetPropertyValue/ManagementBaseObject_GetPropertyValue.vb" id="Snippet1"::: @@ -475,7 +475,7 @@ ## Examples - The following example displays the **Win32_Process** class description by using the method. For more information on the **Win32_Process** class, see the [Windows Management Instrumentation](/windows/desktop/wmisdk/wmi-start-page) documentation. + The following example displays the **Win32_Process** class description by using the method. For more information on the **Win32_Process** class, see the [Windows Management Instrumentation](/windows/desktop/wmisdk/wmi-start-page) documentation. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WindowsServer/wminet_ManagementBaseObject_GetQualifierValue/cs/ManagementBaseObject_GetQualifierValue.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementBaseObject/GetQualifierValue/ManagementBaseObject_GetQualifierValue.vb" id="Snippet1"::: @@ -521,7 +521,7 @@ ## Examples - The following example displays the MOF code for the **Win32_Process** class by using the method. For more information about the **Win32_Process** class, see the [Windows Management Instrumentation](/windows/desktop/wmisdk/wmi-start-page) documentation. + The following example displays the MOF code for the **Win32_Process** class by using the method. For more information about the **Win32_Process** class, see the [Windows Management Instrumentation](/windows/desktop/wmisdk/wmi-start-page) documentation. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WindowsServer/wminet_ManagementBaseObject_GetText/cs/ManagementBaseObject_GetText.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementBaseObject/GetText/ManagementBaseObject_GetText.vb" id="Snippet1"::: diff --git a/xml/System.Management/ManagementClass.xml b/xml/System.Management/ManagementClass.xml index 530b4ce3f24..6f5f699f8be 100644 --- a/xml/System.Management/ManagementClass.xml +++ b/xml/System.Management/ManagementClass.xml @@ -457,7 +457,7 @@ () method is called. Before committing it, the key properties must be specified. + Note that the new instance is not committed until the () method is called. Before committing it, the key properties must be specified. ## .NET Framework Security Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see [Using Libraries from Partially Trusted Code](/dotnet/framework/misc/using-libraries-from-partially-trusted-code). @@ -545,7 +545,7 @@ () method is explicitly called. + Note that the newly returned class has not been committed until the () method is explicitly called. ## .NET Framework Security Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see [Using Libraries from Partially Trusted Code](/dotnet/framework/misc/using-libraries-from-partially-trusted-code). @@ -1008,7 +1008,7 @@ ## Examples - The following example uses the method to list the related classes to the **CIM_LogicalDisk** class. For more information, see [CIM_LogicalDisk](/windows/win32/cimwin32prov/cim-logicaldisk). + The following example uses the method to list the related classes to the **CIM_LogicalDisk** class. For more information, see [CIM_LogicalDisk](/windows/win32/cimwin32prov/cim-logicaldisk). :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WindowsServer/wminet_ManagementClass_GetRelatedClasses-7/cs/ManagementClass_GetRelatedClasses-7.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementClass/GetRelatedClasses/ManagementClass_GetRelatedClasses-7.vb" id="Snippet1"::: @@ -1119,7 +1119,7 @@ ## Examples - The following example uses the method to list the relationship classes to the **CIM_LogicalDisk** class. For more information, see [CIM_LogicalDisk](/windows/win32/cimwin32prov/cim-logicaldisk). + The following example uses the method to list the relationship classes to the **CIM_LogicalDisk** class. For more information, see [CIM_LogicalDisk](/windows/win32/cimwin32prov/cim-logicaldisk). :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WindowsServer/wminet_ManagementClass_GetRelationshipClasses/cs/ManagementClass_GetRelationshipClasses.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementClass/GetRelationshipClasses/ManagementClass_GetRelationshipClasses.vb" id="Snippet1"::: @@ -1497,7 +1497,7 @@ ## Examples - The following example uses the method to list the subclasses to the **CIM_LogicalDisk** class. For more information, see [CIM_LogicalDisk](/windows/win32/cimwin32prov/cim-logicaldisk). + The following example uses the method to list the subclasses to the **CIM_LogicalDisk** class. For more information, see [CIM_LogicalDisk](/windows/win32/cimwin32prov/cim-logicaldisk). :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WindowsServer/wminet_ManagementClass_GetSubClasses/cs/ManagementClass_GetSubclasses.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementClass/GetSubclasses/ManagementClass_GetSubclasses.vb" id="Snippet1"::: diff --git a/xml/System.Management/ManagementDateTimeConverter.xml b/xml/System.Management/ManagementDateTimeConverter.xml index 42c904b54d8..b6c4d187043 100644 --- a/xml/System.Management/ManagementDateTimeConverter.xml +++ b/xml/System.Management/ManagementDateTimeConverter.xml @@ -103,7 +103,7 @@ A DMTF datetime string has an UTC offset, which this datetime string represents. ## Remarks -The resulting DMTF datetime string is based on the UTC offset of the current time zone. The lowest precision in DMTF is microseconds; in , the lowest precision is , which are equivalent to 100 nanoseconds. During conversion, are converted to microseconds and rounded off to the nearest microsecond. +The resulting DMTF datetime string is based on the UTC offset of the current time zone. The lowest precision in DMTF is microseconds; in , the lowest precision is , which are equivalent to 100 nanoseconds. During conversion, are converted to microseconds and rounded off to the nearest microsecond. ## .NET Framework security Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see [Using Libraries from Partially Trusted Code](/dotnet/framework/misc/using-libraries-from-partially-trusted-code). @@ -148,7 +148,7 @@ The resulting DMTF datetime string is based on the UTC offset of the current tim ## Remarks -The lowest precision in DMTF is microseconds; in , the lowest precision is , which is equivalent to 100 nanoseconds. During conversion, are converted to microseconds and rounded off to the nearest microsecond. +The lowest precision in DMTF is microseconds; in , the lowest precision is , which is equivalent to 100 nanoseconds. During conversion, are converted to microseconds and rounded off to the nearest microsecond. ## .NET Framework security Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see [Using Libraries from Partially Trusted Code](/dotnet/framework/misc/using-libraries-from-partially-trusted-code). diff --git a/xml/System.Management/ManagementEventWatcher.xml b/xml/System.Management/ManagementEventWatcher.xml index d4448c1fb05..50c08668d53 100644 --- a/xml/System.Management/ManagementEventWatcher.xml +++ b/xml/System.Management/ManagementEventWatcher.xml @@ -32,14 +32,14 @@ Subscribes to temporary event notifications based on a specified *event query*. - method. This example can be tested by starting a process, such as Notepad, while the example code is running. - + method. This example can be tested by starting a process, such as Notepad, while the example code is running. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WindowsServer/wminet_ManagementEventWatcher/cs/ManagementEventWatcher.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementEventWatcher/Overview/ManagementEventWatcher.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementEventWatcher/Overview/ManagementEventWatcher.vb" id="Snippet1"::: + ]]> @@ -71,21 +71,21 @@ Initializes a new instance of the class. For further initialization, set the properties on the object. This is the parameterless constructor. - method. This example can be tested by starting a process, such as Notepad, while the example code is running. - + method. This example can be tested by starting a process, such as Notepad, while the example code is running. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WindowsServer/wminet_ManagementEventWatcher/cs/ManagementEventWatcher.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementEventWatcher/Overview/ManagementEventWatcher.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementEventWatcher/Overview/ManagementEventWatcher.vb" id="Snippet1"::: + ]]> @@ -112,22 +112,22 @@ An representing a WMI event query, which determines the events for which the watcher will listen. Initializes a new instance of the class when given a WMI *event query*. - method. This example can be tested by starting a process, such as Notepad, while the example code is running. - + method. This example can be tested by starting a process, such as Notepad, while the example code is running. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WindowsServer/wminet_ManagementEventWatcher-E/cs/ManagementEventWatcher-E.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementEventWatcher/.ctor/ManagementEventWatcher-E.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementEventWatcher/.ctor/ManagementEventWatcher-E.vb" id="Snippet1"::: + ]]> @@ -154,22 +154,22 @@ A WMI event query, which defines the events for which the watcher will listen. Initializes a new instance of the class when given a WMI *event query* in the form of a string. - method. This example can be tested by starting a process, such as Notepad, while the example code is running. - + method. This example can be tested by starting a process, such as Notepad, while the example code is running. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WindowsServer/wminet_ManagementEventWatcher-S/cs/ManagementEventWatcher-S.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementEventWatcher/.ctor/ManagementEventWatcher-S.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementEventWatcher/.ctor/ManagementEventWatcher-S.vb" id="Snippet1"::: + ]]> @@ -198,21 +198,21 @@ An representing a WMI event query, which determines the events for which the watcher will listen. Initializes a new instance of the class that listens for events conforming to the given WMI *event query*. - method. This example can be tested by starting a process, such as Notepad, while the example code is running. - + method. This example can be tested by starting a process, such as Notepad, while the example code is running. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WindowsServer/wminet_ManagementEventWatcher-M_E/cs/ManagementEventWatcher-M_E.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementEventWatcher/.ctor/ManagementEventWatcher-M_E.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementEventWatcher/.ctor/ManagementEventWatcher-M_E.vb" id="Snippet1"::: + ]]> @@ -241,21 +241,21 @@ The query that defines the events for which the watcher will listen. Initializes a new instance of the class that listens for events conforming to the given WMI *event query*. For this variant, the query and the scope are specified as strings. - method. This example can be tested by starting a process, such as Notepad, while the example code is running. - + method. This example can be tested by starting a process, such as Notepad, while the example code is running. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WindowsServer/wminet_ManagementEventWatcher-S_S/cs/ManagementEventWatcher-S_S.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementEventWatcher/.ctor/ManagementEventWatcher-S_S.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementEventWatcher/.ctor/ManagementEventWatcher-S_S.vb" id="Snippet1"::: + ]]> @@ -286,21 +286,21 @@ An representing additional options used to watch for events. Initializes a new instance of the class that listens for events conforming to the given WMI event query, according to the specified options. For this variant, the query and the scope are specified objects. The options object can specify options such as time-out and context information. - method. This example can be tested by starting a process, such as Notepad, while the example code is running. - + method. This example can be tested by starting a process, such as Notepad, while the example code is running. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WindowsServer/wminet_ManagementEventWatcher-M_E_E/cs/ManagementEventWatcher-M_E_E.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementEventWatcher/.ctor/ManagementEventWatcher-M_E_E.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementEventWatcher/.ctor/ManagementEventWatcher-M_E_E.vb" id="Snippet1"::: + ]]> @@ -331,21 +331,21 @@ An representing additional options used to watch for events. Initializes a new instance of the class that listens for events conforming to the given WMI *event query*, according to the specified options. For this variant, the query and the scope are specified as strings. The options object can specify options such as a time-out and context information. - method. This example can be tested by starting a process, such as Notepad, while the example code is running. - + method. This example can be tested by starting a process, such as Notepad, while the example code is running. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WindowsServer/wminet_ManagementEventWatcher-S_S_E/cs/ManagementEventWatcher-S_S_E.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementEventWatcher/.ctor/ManagementEventWatcher-S_S_E.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementEventWatcher/.ctor/ManagementEventWatcher-S_S_E.vb" id="Snippet1"::: + ]]> @@ -372,21 +372,21 @@ Occurs when a new event arrives. - containing data related to this event. The following properties provide information specific to this event. - -|Property|Description| -|--------------|-----------------| -| (inherited from )|Gets the operation context echoed back from the operation that triggered the event.| -||Gets the WMI event that was delivered.| - -## .NET Framework Security - Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see [Using Libraries from Partially Trusted Code](/dotnet/framework/misc/using-libraries-from-partially-trusted-code). - + containing data related to this event. The following properties provide information specific to this event. + +|Property|Description| +|--------------|-----------------| +| (inherited from )|Gets the operation context echoed back from the operation that triggered the event.| +||Gets the WMI event that was delivered.| + +## .NET Framework Security + Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see [Using Libraries from Partially Trusted Code](/dotnet/framework/misc/using-libraries-from-partially-trusted-code). + ]]> @@ -413,13 +413,13 @@ Ensures that outstanding calls are cleared. This is the destructor for the object. In C#, finalizers are expressed using destructor syntax. - @@ -446,24 +446,24 @@ Gets or sets the options used to watch for events. The event options used to watch for events. - method. This example can be tested by starting a process, such as Notepad, while the example code is running. - + method. This example can be tested by starting a process, such as Notepad, while the example code is running. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WindowsServer/wminet_ManagementEventWatcher_Options/cs/ManagementEventWatcher_Options.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementEventWatcher/Options/ManagementEventWatcher_Options.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementEventWatcher/Options/ManagementEventWatcher_Options.vb" id="Snippet1"::: + ]]> @@ -490,24 +490,24 @@ Gets or sets the criteria to apply to events. The query to apply to events. - method. This example can be tested by starting a process, such as Notepad, while the example code is running. - + method. This example can be tested by starting a process, such as Notepad, while the example code is running. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WindowsServer/wminet_ManagementEventWatcher_Query/cs/ManagementEventWatcher_Query.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementEventWatcher/Query/ManagementEventWatcher_Query.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementEventWatcher/Query/ManagementEventWatcher_Query.vb" id="Snippet1"::: + ]]> @@ -534,24 +534,24 @@ Gets or sets the scope in which to watch for events (namespace or scope). The scope in which to watch for events. - method. This example can be tested by starting a process, such as Notepad, while the example code is running. - + method. This example can be tested by starting a process, such as Notepad, while the example code is running. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WindowsServer/wminet_ManagementEventWatcher_Scope/cs/ManagementEventWatcher_Scope.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementEventWatcher/Scope/ManagementEventWatcher_Scope.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementEventWatcher/Scope/ManagementEventWatcher_Scope.vb" id="Snippet1"::: + ]]> @@ -578,13 +578,13 @@ Subscribes to events with the given query and delivers them, asynchronously, through the event. - @@ -611,21 +611,21 @@ Cancels the subscription whether it is synchronous or asynchronous. - method. This example can be tested by starting a process, such as Notepad, while the example code is running. - + method. This example can be tested by starting a process, such as Notepad, while the example code is running. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WindowsServer/wminet_ManagementEventWatcher_Stop/cs/ManagementEventWatcher_Stop.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementEventWatcher/Stop/ManagementEventWatcher_Stop.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementEventWatcher/Stop/ManagementEventWatcher_Stop.vb" id="Snippet1"::: + ]]> @@ -652,21 +652,21 @@ Occurs when a subscription is canceled. - containing data related to this event. The following properties provide information specific to this event. - -|Property|Description| -|--------------|-----------------| -| (inherited from )|Gets the operation context echoed back from the operation that triggered the event.| -||Gets the completion status of the operation.| - -## .NET Framework Security - Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see [Using Libraries from Partially Trusted Code](/dotnet/framework/misc/using-libraries-from-partially-trusted-code). - + containing data related to this event. The following properties provide information specific to this event. + +|Property|Description| +|--------------|-----------------| +| (inherited from )|Gets the operation context echoed back from the operation that triggered the event.| +||Gets the completion status of the operation.| + +## .NET Framework Security + Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see [Using Libraries from Partially Trusted Code](/dotnet/framework/misc/using-libraries-from-partially-trusted-code). + ]]> @@ -694,22 +694,22 @@ Waits for the next event that matches the specified query to arrive, and then returns it. A representing the newly arrived event. - method. This example can be tested by starting a process, such as Notepad, while the example code is running. - + method. This example can be tested by starting a process, such as Notepad, while the example code is running. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WindowsServer/wminet_ManagementEventWatcher_WaitForNextEvent/cs/ManagementEventWatcher_WaitForNextEvent.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementEventWatcher/WaitForNextEvent/ManagementEventWatcher_WaitForNextEvent.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementEventWatcher/WaitForNextEvent/ManagementEventWatcher_WaitForNextEvent.vb" id="Snippet1"::: + ]]> diff --git a/xml/System.Management/ManagementObject.xml b/xml/System.Management/ManagementObject.xml index 32ca01ce910..21eb6f6df22 100644 --- a/xml/System.Management/ManagementObject.xml +++ b/xml/System.Management/ManagementObject.xml @@ -66,21 +66,21 @@ Initializes a new instance of the class. This is the parameterless constructor. - class with the parameterless constructor. - + class with the parameterless constructor. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WindowsServer/wminet_ManagementObject/cs/ManagementObject.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementObject/.ctor/ManagementObject.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementObject/.ctor/ManagementObject.vb" id="Snippet1"::: + ]]> @@ -107,21 +107,21 @@ A that contains a path to a WMI object. Initializes a new instance of the class for the specified WMI object path. The path is provided as a . - class with a specified WMI object path. - + class with a specified WMI object path. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WindowsServer/wminet_ManagementObject-M/cs/ManagementObject-M.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementObject/.ctor/ManagementObject-M.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementObject/.ctor/ManagementObject-M.vb" id="Snippet1"::: + ]]> @@ -148,22 +148,22 @@ A WMI path. Initializes a new instance of the class for the specified WMI object path. The path is provided as a string. - path (by default, root\cimv2). If the user specifies a full path, the default settings are overridden. - -## .NET Framework Security - Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see [Using Libraries from Partially Trusted Code](/dotnet/framework/misc/using-libraries-from-partially-trusted-code). - - - -## Examples - The following example initializes a new instance of the class. - + path (by default, root\cimv2). If the user specifies a full path, the default settings are overridden. + +## .NET Framework Security + Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see [Using Libraries from Partially Trusted Code](/dotnet/framework/misc/using-libraries-from-partially-trusted-code). + + + +## Examples + The following example initializes a new instance of the class. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WindowsServer/wminet_ManagementObject-S/cs/ManagementObject-S.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementObject/.ctor/ManagementObject-S.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementObject/.ctor/ManagementObject-S.vb" id="Snippet1"::: + ]]> @@ -192,21 +192,21 @@ An containing additional options for binding to the WMI object. This parameter could be null if default options are to be used. Initializes a new instance of the class bound to the specified WMI path, including the specified additional options. - class that is bound to a specific WMI path. - + class that is bound to a specific WMI path. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WindowsServer/wminet_ManagementObject-M_O/cs/ManagementObject-M_O.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementObject/.ctor/ManagementObject-M_O.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementObject/.ctor/ManagementObject-M_O.vb" id="Snippet1"::: + ]]> @@ -249,13 +249,13 @@ The destination (see ) for this serialization. Initializes a new instance of the class that is serializable. - @@ -284,21 +284,21 @@ An representing options to get the specified WMI object. Initializes a new instance of the class bound to the specified WMI path, including the specified additional options. In this variant, the path can be specified as a string. - class. - + class. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WindowsServer/wminet_ManagementObject-S_O/cs/ManagementObject-S_O.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementObject/.ctor/ManagementObject-S_O.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementObject/.ctor/ManagementObject-S_O.vb" id="Snippet1"::: + ]]> @@ -329,28 +329,28 @@ An specifying additional options for getting the object. Initializes a new instance of the class bound to the specified WMI path that includes the specified options. - . - - If a scope is not specified and a full WMI path is specified, then the scope will be inferred from the scope portion of the full path. For example, the full WMI path: `\\MyMachine\root\MyNamespace:MyClass.Name='abc'` will represent the WMI object 'MyClass.Name='abc'" in the scope '\\\MyMachine\root\MyNamespace'. - - If a scope is specified and a full WMI path is specified, then the scope will override the scope portion of the full path. For example, if the following scope was specified: \\\MyMachine\root\MyScope, and the following full path was specified: \\\MyMachine\root\MyNamespace:MyClass.Name='abc', then look for the following `object: \\MyMachine\root\MyScope:MyClass.Name= 'abc'` (the scope part of the full path is ignored). - -## .NET Framework Security - Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see [Using Libraries from Partially Trusted Code](/dotnet/framework/misc/using-libraries-from-partially-trusted-code). - - - -## Examples - The following example initializes a new instance of the class that is bound to a specific WMI path. - + . + + If a scope is not specified and a full WMI path is specified, then the scope will be inferred from the scope portion of the full path. For example, the full WMI path: `\\MyMachine\root\MyNamespace:MyClass.Name='abc'` will represent the WMI object 'MyClass.Name='abc'" in the scope '\\\MyMachine\root\MyNamespace'. + + If a scope is specified and a full WMI path is specified, then the scope will override the scope portion of the full path. For example, if the following scope was specified: \\\MyMachine\root\MyScope, and the following full path was specified: \\\MyMachine\root\MyNamespace:MyClass.Name='abc', then look for the following `object: \\MyMachine\root\MyScope:MyClass.Name= 'abc'` (the scope part of the full path is ignored). + +## .NET Framework Security + Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see [Using Libraries from Partially Trusted Code](/dotnet/framework/misc/using-libraries-from-partially-trusted-code). + + + +## Examples + The following example initializes a new instance of the class that is bound to a specific WMI path. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WindowsServer/wminet_ManagementObject-M_M_O/cs/ManagementObject-M_M_O.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementObject/.ctor/ManagementObject-M_M_O.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementObject/.ctor/ManagementObject-M_M_O.vb" id="Snippet1"::: + ]]> @@ -381,22 +381,22 @@ An representing additional options for getting the WMI object. Initializes a new instance of the class bound to the specified WMI path, and includes the specified options. The scope and the path are specified as strings. - class with a specific WMI path and options. - + class with a specific WMI path and options. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WindowsServer/wminet_ManagementObject-S_S_O/cs/ManagementObject-S_S_O.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementObject/.ctor/ManagementObject-S_S_O.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementObject/.ctor/ManagementObject-S_S_O.vb" id="Snippet1"::: + ]]> @@ -423,22 +423,22 @@ Gets or sets the path to the object's class. A representing the path to the object's class. - class and then retrieves the class path for the . - + class and then retrieves the class path for the . + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WindowsServer/wminet_ManagementObject_Path/cs/ManagementObject_Path.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementObject/ClassPath/ManagementObject_Path.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementObject/ClassPath/ManagementObject_Path.vb" id="Snippet1"::: + ]]> @@ -469,13 +469,13 @@ Creates a copy of the object. The copied object. - @@ -515,13 +515,13 @@ Copies the object to a different location. The new path of the copied object. - @@ -552,13 +552,13 @@ Copies the object to a different location. The new path of the copied object. - @@ -590,13 +590,13 @@ A specifying the path to which the object should be copied. Copies the object to a different location, asynchronously. - @@ -628,13 +628,13 @@ The path to which the object should be copied. Copies the object to a different location, asynchronously. - @@ -667,13 +667,13 @@ Copies the object to a different location. The new path of the copied object. - @@ -706,13 +706,13 @@ Copies the object to a different location. The new path of the copied object. - @@ -746,13 +746,13 @@ The options for how the object should be put. Copies the object to a different location, asynchronously. - @@ -786,13 +786,13 @@ The options for how the object should be put. Copies the object to a different location, asynchronously. - @@ -828,13 +828,13 @@ Deletes the object. - @@ -864,13 +864,13 @@ The options for how to delete the object. Deletes the object. - @@ -900,13 +900,13 @@ The object that will receive the results of the operation. Deletes the object. - @@ -938,13 +938,13 @@ The options for how to delete the object. Deletes the object. - @@ -980,13 +980,13 @@ Binds to the management object. - @@ -1013,22 +1013,22 @@ Binds WMI class information to the management object. - method to get an instance of the class. - + method to get an instance of the class. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WindowsServer/wminet_ManagementObject_GetMethod/cs/ManagementObject_GetMethod.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementObject/Get/ManagementObject_GetMethod.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementObject/Get/ManagementObject_GetMethod.vb" id="Snippet1"::: + ]]> @@ -1058,22 +1058,22 @@ The object to receive the results of the operation as events. Binds to the management object asynchronously. - method to asynchronously get an instance of the class. - + method to asynchronously get an instance of the class. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WindowsServer/wminet_ManagementObject_GetMethod-M/cs/ManagementObject_GetMethod-M.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementObject/Get/ManagementObject_GetMethod-M.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementObject/Get/ManagementObject_GetMethod-M.vb" id="Snippet1"::: + ]]> @@ -1104,14 +1104,14 @@ Returns a representing the list of input parameters for a method. A containing the input parameters to the method. - call. - -## .NET Framework Security - Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see [Using Libraries from Partially Trusted Code](/dotnet/framework/misc/using-libraries-from-partially-trusted-code). - + call. + +## .NET Framework Security + Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see [Using Libraries from Partially Trusted Code](/dotnet/framework/misc/using-libraries-from-partially-trusted-code). + ]]> @@ -1142,13 +1142,13 @@ The location where serialized data will be stored and retrieved. Populates a with the data necessary to deserialize the field represented by this instance. - @@ -1185,22 +1185,22 @@ Gets a collection of objects related to the object (associators). A containing the related objects. - method to get a collection of objects related to an instance of the class. - + method to get a collection of objects related to an instance of the class. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WindowsServer/wminet_ManagementObject_GetRelated/cs/ManagementObject_GetRelated.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementObject/GetRelated/ManagementObject_GetRelated.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementObject/GetRelated/ManagementObject_GetRelated.vb" id="Snippet1"::: + ]]> @@ -1230,13 +1230,13 @@ The object to use to return results. Gets a collection of objects related to the object (associators) asynchronously. This call returns immediately, and a delegate is called when the results are available. - @@ -1267,21 +1267,21 @@ Gets a collection of objects related to the object (associators). A containing the related objects. - method to get a collection of objects related to an instance of the class. - + method to get a collection of objects related to an instance of the class. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WindowsServer/wminet_ManagementObject_GetRelated-S/cs/ManagementObject_GetRelated-S.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementObject/GetRelated/ManagementObject_GetRelated-S.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementObject/GetRelated/ManagementObject_GetRelated-S.vb" id="Snippet1"::: + ]]> @@ -1313,14 +1313,14 @@ The class of related objects. Gets a collection of objects related to the object (associators). - @@ -1365,14 +1365,14 @@ Gets a collection of objects related to the object (associators). A containing the related objects. - @@ -1418,14 +1418,14 @@ Extended options for how to execute the query. Gets a collection of objects related to the object (associators). - @@ -1462,14 +1462,14 @@ Gets a collection of associations to the object. A containing the association objects. - @@ -1499,14 +1499,14 @@ The object to use to return results. Gets a collection of associations to the object. - @@ -1537,14 +1537,14 @@ Gets a collection of associations to the object. A containing the association objects. - @@ -1576,14 +1576,14 @@ The associations to include. Gets a collection of associations to the object. - @@ -1622,14 +1622,14 @@ Gets a collection of associations to the object. A containing the association objects. - @@ -1669,14 +1669,14 @@ The extended options for the query execution. Gets a collection of associations to the object. - @@ -1718,22 +1718,22 @@ Invokes a method on the object. The object value returned by the method. - @@ -1767,14 +1767,14 @@ An array containing parameter values. Invokes a method on the object, asynchronously. - @@ -1809,21 +1809,21 @@ Invokes a method on the WMI object. The input and output parameters are represented as objects. A containing the output parameters and return value of the executed method. - @@ -1859,14 +1859,14 @@ An containing additional options used to execute the method. Invokes a method on the object, asynchronously. - . - -## .NET Framework Security - Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see [Using Libraries from Partially Trusted Code](/dotnet/framework/misc/using-libraries-from-partially-trusted-code). - + . + +## .NET Framework Security + Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see [Using Libraries from Partially Trusted Code](/dotnet/framework/misc/using-libraries-from-partially-trusted-code). + ]]> @@ -1893,22 +1893,22 @@ Gets or sets additional information to use when retrieving the object. An to use when retrieving the object. - class and then change the default options for the . - + class and then change the default options for the . + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WindowsServer/wminet_ManagementObject_Options/cs/ManagementObject_Options.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementObject/Options/ManagementObject_Options.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementObject/Options/ManagementObject_Options.vb" id="Snippet1"::: + ]]> @@ -1935,24 +1935,24 @@ Gets or sets the object's WMI path. A representing the object's path. - class with the default namespace, and then changes the WMI path of the . - + class with the default namespace, and then changes the WMI path of the . + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WindowsServer/wminet_ManagementObject_Path/cs/ManagementObject_Path.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementObject/ClassPath/ManagementObject_Path.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementObject/ClassPath/ManagementObject_Path.vb" id="Snippet1"::: + ]]> @@ -1989,13 +1989,13 @@ Commits the changes to the object. A containing the path to the committed object. - @@ -2025,13 +2025,13 @@ A used to handle the progress and results of the asynchronous operation. Commits the changes to the object, asynchronously. - @@ -2062,13 +2062,13 @@ Commits the changes to the object. A containing the path to the committed object. - @@ -2100,13 +2100,13 @@ A used to specify additional options for the commit operation. Commits the changes to the object asynchronously and using the specified options. - @@ -2133,24 +2133,24 @@ Gets or sets the scope in which this object resides. The scope in which this object resides. - class with the default namespace, and then changes the scope of the . - + class with the default namespace, and then changes the scope of the . + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WindowsServer/wminet_ManagementObject_Scope/cs/ManagementObject_Scope.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementObject/Scope/ManagementObject_Scope.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementObject/Scope/ManagementObject_Scope.vb" id="Snippet1"::: + ]]> @@ -2178,13 +2178,13 @@ Returns the full path of the object. This is an override of the default object implementation. The full path of the object. - diff --git a/xml/System.Management/ManagementObjectCollection.xml b/xml/System.Management/ManagementObjectCollection.xml index 7ca438894ad..19a55a57be5 100644 --- a/xml/System.Management/ManagementObjectCollection.xml +++ b/xml/System.Management/ManagementObjectCollection.xml @@ -77,13 +77,13 @@ The index to start from. Copies the collection to an array. - @@ -116,13 +116,13 @@ The index to start from. Copies the items in the collection to a array. - @@ -152,17 +152,17 @@ Gets a value indicating the number of objects in the collection. The number of objects in the collection. - @@ -193,13 +193,13 @@ Releases resources associated with this object. After this method has been called, an attempt to use this object will result in an being thrown. - @@ -227,13 +227,13 @@ Disposes of resources the object is holding. This is the destructor for the object. Finalizers are expressed using destructor syntax. - @@ -261,18 +261,18 @@ Returns the enumerator for the collection. An that can be used to iterate through the collection. - method cannot be used since it requires rewinding the enumerator. - - Forward-only enumerators are generally much faster and use less memory than conventional enumerators, but they do not allow calls to . - - If an enumerator is rewindable, the objects in the collection will be kept available for multiple enumerations. - -## .NET Framework Security - Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see [Using Libraries from Partially Trusted Code](/dotnet/framework/misc/using-libraries-from-partially-trusted-code). - + method cannot be used since it requires rewinding the enumerator. + + Forward-only enumerators are generally much faster and use less memory than conventional enumerators, but they do not allow calls to . + + If an enumerator is rewindable, the objects in the collection will be kept available for multiple enumerations. + +## .NET Framework Security + Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see [Using Libraries from Partially Trusted Code](/dotnet/framework/misc/using-libraries-from-partially-trusted-code). + ]]> @@ -303,16 +303,16 @@ if the object is synchronized; otherwise, . - @@ -343,16 +343,16 @@ Gets the object to be used for synchronization. An object that can be used for synchronization. - @@ -384,26 +384,26 @@ Returns an that iterates through the . An for the . - also brings the enumerator back to this position. At this position, calling throws an exception. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . - - returns the same object until either or is called. sets to the next element. - - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, calling throws an exception. To set to the first element of the collection again, you can call followed by . - - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . If the collection is modified between and , returns the element that it is set to, even if the enumerator is already invalidated. - - The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread safe procedure. Even when a collection is synchronized, other threads can still modify the collection, which causes the enumerator to throw an exception. To guarantee thread safety during enumeration, you can either lock the collection during the entire enumeration or catch the exceptions resulting from changes made by other threads. - - This method is an O(1) operation. - + also brings the enumerator back to this position. At this position, calling throws an exception. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . + + returns the same object until either or is called. sets to the next element. + + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, calling throws an exception. To set to the first element of the collection again, you can call followed by . + + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . If the collection is modified between and , returns the element that it is set to, even if the enumerator is already invalidated. + + The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread safe procedure. Even when a collection is synchronized, other threads can still modify the collection, which causes the enumerator to throw an exception. To guarantee thread safety during enumeration, you can either lock the collection during the entire enumeration or catch the exceptions resulting from changes made by other threads. + + This method is an O(1) operation. + ]]> diff --git a/xml/System.Management/ManagementObjectSearcher.xml b/xml/System.Management/ManagementObjectSearcher.xml index e0d022ecb69..c8bbfba551e 100644 --- a/xml/System.Management/ManagementObjectSearcher.xml +++ b/xml/System.Management/ManagementObjectSearcher.xml @@ -61,13 +61,13 @@ Initializes a new instance of the class. After some properties on this object are set, the object can be used to invoke a query for management information. This is the parameterless constructor. - @@ -94,21 +94,21 @@ An representing the query to be invoked by the searcher. Initializes a new instance of the class used to invoke the specified query for management information. - class with a specific query. - + class with a specific query. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WindowsServer/wminet_ManagementObjectSearcher-O/cs/ManagementObjectSearcher-O.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementObjectSearcher/.ctor/ManagementObjectSearcher-O.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementObjectSearcher/.ctor/ManagementObjectSearcher-O.vb" id="Snippet1"::: + ]]> @@ -135,21 +135,21 @@ The WMI query to be invoked by the object. Initializes a new instance of the class used to invoke the specified query for management information. - class with a specific query. - + class with a specific query. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WindowsServer/wminet_ManagementObjectSearcher-S/cs/ManagementObjectSearcher-S.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementObjectSearcher/.ctor/ManagementObjectSearcher-S.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementObjectSearcher/.ctor/ManagementObjectSearcher-S.vb" id="Snippet1"::: + ]]> @@ -178,22 +178,22 @@ An representing the query to be invoked. Initializes a new instance of the class used to invoke the specified query in the specified scope. - ) is used. - -## .NET Framework Security - Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see [Using Libraries from Partially Trusted Code](/dotnet/framework/misc/using-libraries-from-partially-trusted-code). - - - -## Examples - The following example initializes a new instance of the class with a specific query and scope. - + ) is used. + +## .NET Framework Security + Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see [Using Libraries from Partially Trusted Code](/dotnet/framework/misc/using-libraries-from-partially-trusted-code). + + + +## Examples + The following example initializes a new instance of the class with a specific query and scope. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WindowsServer/wminet_ManagementObjectSearcher-M_O/cs/ManagementObjectSearcher-M_O.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementObjectSearcher/.ctor/ManagementObjectSearcher-M_O.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementObjectSearcher/.ctor/ManagementObjectSearcher-M_O.vb" id="Snippet1"::: + ]]> @@ -222,22 +222,22 @@ The query to be invoked. Initializes a new instance of the class used to invoke the specified query in the specified scope. - ) is used. - -## .NET Framework Security - Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see [Using Libraries from Partially Trusted Code](/dotnet/framework/misc/using-libraries-from-partially-trusted-code). - - - -## Examples - The following example initializes a new instance of the class with a specific query and scope. - + ) is used. + +## .NET Framework Security + Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see [Using Libraries from Partially Trusted Code](/dotnet/framework/misc/using-libraries-from-partially-trusted-code). + + + +## Examples + The following example initializes a new instance of the class with a specific query and scope. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WindowsServer/wminet_ManagementObjectSearcher-S_S/cs/ManagementObjectSearcher-S_S.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementObjectSearcher/.ctor/ManagementObjectSearcher-S_S.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementObjectSearcher/.ctor/ManagementObjectSearcher-S_S.vb" id="Snippet1"::: + ]]> @@ -268,21 +268,21 @@ An specifying additional options to be used for the query. Initializes a new instance of the class to be used to invoke the specified query in the specified scope, with the specified options. - class with a specific query, scope, and enumeration options. - + class with a specific query, scope, and enumeration options. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WindowsServer/wminet_ManagementObjectSearcher-M_O_E/cs/ManagementObjectSearcher-M_O_E.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementObjectSearcher/.ctor/ManagementObjectSearcher-M_O_E.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementObjectSearcher/.ctor/ManagementObjectSearcher-M_O_E.vb" id="Snippet1"::: + ]]> @@ -313,21 +313,21 @@ An specifying additional options for the query. Initializes a new instance of the class used to invoke the specified query, in the specified scope, and with the specified options. - class with a specific query, scope, and enumeration options. - + class with a specific query, scope, and enumeration options. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WindowsServer/wminet_ManagementObjectSearcher-S_S_E/cs/ManagementObjectSearcher-S_S_E.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementObjectSearcher/.ctor/ManagementObjectSearcher-S_S_E.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementObjectSearcher/.ctor/ManagementObjectSearcher-S_S_E.vb" id="Snippet1"::: + ]]> @@ -364,21 +364,21 @@ Invokes the specified WMI query and returns the resulting collection. A containing the objects that match the specified query. - class with a specific query, scope, and enumeration options. - + class with a specific query, scope, and enumeration options. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WindowsServer/wminet_ManagementObjectSearcher_Get/cs/ManagementObjectSearcher_Get.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementObjectSearcher/Get/ManagementObjectSearcher_Get.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementObjectSearcher/Get/ManagementObjectSearcher_Get.vb" id="Snippet1"::: + ]]> @@ -408,13 +408,13 @@ The watcher that raises events triggered by the operation. Invokes the WMI query asynchronously, and binds to a watcher to deliver the results. - @@ -441,16 +441,16 @@ Gets or sets the options for how to search for objects. The options for searching for WMI objects. - @@ -477,17 +477,17 @@ Gets or sets the query to be invoked in the searcher (that is, the criteria to be applied to the search for management objects). The query to be invoked in the searcher. - is reset to use the new query. - -## Property Value - The criteria to apply to the query. - -## .NET Framework Security - Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see [Using Libraries from Partially Trusted Code](/dotnet/framework/misc/using-libraries-from-partially-trusted-code). - + is reset to use the new query. + +## Property Value + The criteria to apply to the query. + +## .NET Framework Security + Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see [Using Libraries from Partially Trusted Code](/dotnet/framework/misc/using-libraries-from-partially-trusted-code). + ]]> @@ -514,25 +514,25 @@ Gets or sets the scope in which to look for objects (the scope represents a WMI namespace). The scope (namespace) in which to look for the WMI objects. - is re-bound to the new scope. - -## Property Value - The scope (namespace) in which to look for objects. - -## .NET Framework Security - Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see [Using Libraries from Partially Trusted Code](/dotnet/framework/misc/using-libraries-from-partially-trusted-code). - - - -## Examples - The following example initializes a new instance of the class with a specific query and then changes the scope of the instance. - + is re-bound to the new scope. + +## Property Value + The scope (namespace) in which to look for objects. + +## .NET Framework Security + Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see [Using Libraries from Partially Trusted Code](/dotnet/framework/misc/using-libraries-from-partially-trusted-code). + + + +## Examples + The following example initializes a new instance of the class with a specific query and then changes the scope of the instance. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WindowsServer/wminet_ManagementObjectSearcher_Scope/cs/ManagementObjectSearcher_Scope.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementObjectSearcher/Scope/ManagementObjectSearcher_Scope.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementObjectSearcher/Scope/ManagementObjectSearcher_Scope.vb" id="Snippet1"::: + ]]> diff --git a/xml/System.Management/ManagementOperationObserver.xml b/xml/System.Management/ManagementOperationObserver.xml index 888ac2b8255..51a0fd69b90 100644 --- a/xml/System.Management/ManagementOperationObserver.xml +++ b/xml/System.Management/ManagementOperationObserver.xml @@ -26,14 +26,14 @@ Manages asynchronous operations and handles management information and events received asynchronously. - class to handle management information and events asynchronously. - + class to handle management information and events asynchronously. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WindowsServer/wminet_ManagementOperationObserver/cs/ManagementOperationObserver.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementOperationObserver/Overview/ManagementOperationObserver.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementOperationObserver/Overview/ManagementOperationObserver.vb" id="Snippet1"::: + ]]> @@ -56,21 +56,21 @@ Initializes a new instance of the class. This is the parameterless constructor. - class to handle management information and events asynchronously. - + class to handle management information and events asynchronously. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WindowsServer/wminet_ManagementOperationObserver/cs/ManagementOperationObserver.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementOperationObserver/Overview/ManagementOperationObserver.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementOperationObserver/Overview/ManagementOperationObserver.vb" id="Snippet1"::: + ]]> @@ -97,13 +97,13 @@ Cancels all outstanding operations. - @@ -130,30 +130,30 @@ Occurs when an operation has completed. - containing data related to this event. The following properties provide information specific to this event. - -|Property|Description| -|--------------|-----------------| -| (inherited from )|Gets the operation context echoed back from the operation that triggered the event.| -||Gets the completion status of the operation.| -||Gets or sets additional status information within a WMI object. This may be null.| - -## .NET Framework Security - Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see [Using Libraries from Partially Trusted Code](/dotnet/framework/misc/using-libraries-from-partially-trusted-code). - - - -## Examples - The following example demonstrates how to perform an asynchronous instance enumeration. The example uses the class to handle management information and events asynchronously. - + containing data related to this event. The following properties provide information specific to this event. + +|Property|Description| +|--------------|-----------------| +| (inherited from )|Gets the operation context echoed back from the operation that triggered the event.| +||Gets the completion status of the operation.| +||Gets or sets additional status information within a WMI object. This may be null.| + +## .NET Framework Security + Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see [Using Libraries from Partially Trusted Code](/dotnet/framework/misc/using-libraries-from-partially-trusted-code). + + + +## Examples + The following example demonstrates how to perform an asynchronous instance enumeration. The example uses the class to handle management information and events asynchronously. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WindowsServer/wminet_ManagementOperationObserver_Completed/cs/ManagementOperationObserver_Completed.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementOperationObserver/Completed/ManagementOperationObserver_Completed.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementOperationObserver/Completed/ManagementOperationObserver_Completed.vb" id="Snippet1"::: + ]]> @@ -180,21 +180,21 @@ Occurs when an object has been successfully committed. - containing data related to this event. The following properties provide information specific to this event. - -|Property|Description| -|--------------|-----------------| -| (inherited from )|Gets the operation context echoed back from the operation that triggered the event.| -||Gets the identity of the object that has been put.| - -## .NET Framework Security - Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see [Using Libraries from Partially Trusted Code](/dotnet/framework/misc/using-libraries-from-partially-trusted-code). - + containing data related to this event. The following properties provide information specific to this event. + +|Property|Description| +|--------------|-----------------| +| (inherited from )|Gets the operation context echoed back from the operation that triggered the event.| +||Gets the identity of the object that has been put.| + +## .NET Framework Security + Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see [Using Libraries from Partially Trusted Code](/dotnet/framework/misc/using-libraries-from-partially-trusted-code). + ]]> @@ -221,29 +221,29 @@ Occurs when a new object is available. - containing data related to this event. The following properties provide information specific to this event. - -|Property|Description| -|--------------|-----------------| -| (inherited from )|Gets the operation context echoed back from the operation that triggered the event.| -||Gets the newly-returned object.| - -## .NET Framework Security - Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see [Using Libraries from Partially Trusted Code](/dotnet/framework/misc/using-libraries-from-partially-trusted-code). - - - -## Examples - The following example demonstrates how to perform an asynchronous instance enumeration. The example uses the class to handle management information and events asynchronously. - + containing data related to this event. The following properties provide information specific to this event. + +|Property|Description| +|--------------|-----------------| +| (inherited from )|Gets the operation context echoed back from the operation that triggered the event.| +||Gets the newly-returned object.| + +## .NET Framework Security + Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see [Using Libraries from Partially Trusted Code](/dotnet/framework/misc/using-libraries-from-partially-trusted-code). + + + +## Examples + The following example demonstrates how to perform an asynchronous instance enumeration. The example uses the class to handle management information and events asynchronously. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WindowsServer/wminet_ManagementOperationObserver_ObjectReady/cs/ManagementOperationObserver_ObjectReady.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementOperationObserver/ObjectReady/ManagementOperationObserver_ObjectReady.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementOperationObserver/ObjectReady/ManagementOperationObserver_ObjectReady.vb" id="Snippet1"::: + ]]> @@ -270,23 +270,23 @@ Occurs to indicate the progress of an ongoing operation. - containing data related to this event. The following properties provide information specific to this event. - -|Property|Description| -|--------------|-----------------| -| (inherited from )|Gets the operation context echoed back from the operation that triggered the event.| -||Gets the current amount of work done by the operation. This is always less than or equal to .| -||Gets or sets optional additional information regarding the operation's progress.| -||Gets the total amount of work required to be done by the operation.| - -## .NET Framework Security - Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see [Using Libraries from Partially Trusted Code](/dotnet/framework/misc/using-libraries-from-partially-trusted-code). - + containing data related to this event. The following properties provide information specific to this event. + +|Property|Description| +|--------------|-----------------| +| (inherited from )|Gets the operation context echoed back from the operation that triggered the event.| +||Gets the current amount of work done by the operation. This is always less than or equal to .| +||Gets or sets optional additional information regarding the operation's progress.| +||Gets the total amount of work required to be done by the operation.| + +## .NET Framework Security + Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see [Using Libraries from Partially Trusted Code](/dotnet/framework/misc/using-libraries-from-partially-trusted-code). + ]]> diff --git a/xml/System.Management/ManagementScope.xml b/xml/System.Management/ManagementScope.xml index 714aa4ada91..ae8f47e2b9c 100644 --- a/xml/System.Management/ManagementScope.xml +++ b/xml/System.Management/ManagementScope.xml @@ -36,14 +36,14 @@ Represents a scope (namespace) for management operations. - with a specific path and then connects the scope object to a WMI namespace. The example connects to a namespace on a remote computer. - + with a specific path and then connects the scope object to a WMI namespace. The example connects to a namespace on a remote computer. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WindowsServer/wminet_ManagementScope/cs/ManagementScope.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementScope/Overview/ManagementScope.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementScope/Overview/ManagementScope.vb" id="Snippet1"::: + ]]> @@ -75,14 +75,14 @@ Initializes a new instance of the class, with default values. This is the parameterless constructor. - @@ -109,13 +109,13 @@ A containing the path to a server and namespace for the . Initializes a new instance of the class representing the specified scope path. - @@ -142,21 +142,21 @@ The server and namespace path for the . Initializes a new instance of the class representing the specified scope path. - with a specific path and then connects the scope object to a WMI namespace. The example connects to a namespace on a remote computer. - + with a specific path and then connects the scope object to a WMI namespace. The example connects to a namespace on a remote computer. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WindowsServer/wminet_ManagementScope-S/cs/ManagementScope-S.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementScope/.ctor/ManagementScope-S.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementScope/.ctor/ManagementScope-S.vb" id="Snippet1"::: + ]]> @@ -185,13 +185,13 @@ The containing options for the connection. Initializes a new instance of the class representing the specified scope path, with the specified options. - @@ -220,21 +220,21 @@ A containing options for the connection. Initializes a new instance of the class representing the specified scope path, with the specified options. - with a specific path and then connects the scope object to a WMI namespace. The example connects to a namespace on a remote computer. - + with a specific path and then connects the scope object to a WMI namespace. The example connects to a namespace on a remote computer. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WindowsServer/wminet_ManagementScope-S_C/cs/ManagementScope-S_C.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementScope/.ctor/ManagementScope-S_C.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementScope/.ctor/ManagementScope-S_C.vb" id="Snippet1"::: + ]]> @@ -262,13 +262,13 @@ Returns a copy of the object. A new copy of the . - @@ -295,22 +295,22 @@ Connects this to the actual WMI scope. - with a specific path and then connects the scope object to a WMI namespace. The example connects to a namespace on a remote computer. - + with a specific path and then connects the scope object to a WMI namespace. The example connects to a namespace on a remote computer. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WindowsServer/wminet_ManagementScope_Connect/cs/ManagementScope_Connect.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementScope/Connect/ManagementScope_Connect.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.Management/ManagementScope/Connect/ManagementScope_Connect.vb" id="Snippet1"::: + ]]> @@ -337,17 +337,17 @@ Gets a value indicating whether the is currently bound to a WMI server and namespace. Returns a value indicating whether the scope is currently bound to a WMI server and namespace. - , or uses the scope for any operation that requires a live connection. Also, the scope is disconnected from the previous connection whenever the identifying properties of the scope are changed. - -## Property Value - `true` if a connection is alive (bound to a server and namespace); otherwise, `false`. - -## .NET Framework Security - Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see [Using Libraries from Partially Trusted Code](/dotnet/framework/misc/using-libraries-from-partially-trusted-code). - + , or uses the scope for any operation that requires a live connection. Also, the scope is disconnected from the previous connection whenever the identifying properties of the scope are changed. + +## Property Value + `true` if a connection is alive (bound to a server and namespace); otherwise, `false`. + +## .NET Framework Security + Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see [Using Libraries from Partially Trusted Code](/dotnet/framework/misc/using-libraries-from-partially-trusted-code). + ]]> @@ -374,16 +374,16 @@ Gets or sets options for making the WMI connection. Returns a that contains the options for making a WMI connection. - containing options for the WMI connection. - -## .NET Framework Security - Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see [Using Libraries from Partially Trusted Code](/dotnet/framework/misc/using-libraries-from-partially-trusted-code). - + containing options for the WMI connection. + +## .NET Framework Security + Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see [Using Libraries from Partially Trusted Code](/dotnet/framework/misc/using-libraries-from-partially-trusted-code). + ]]> @@ -410,16 +410,16 @@ Gets or sets the path for the . Returns a containing the path to the scope (namespace). - containing the path to a server and namespace. - -## .NET Framework Security - Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see [Using Libraries from Partially Trusted Code](/dotnet/framework/misc/using-libraries-from-partially-trusted-code). - + containing the path to a server and namespace. + +## .NET Framework Security + Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see [Using Libraries from Partially Trusted Code](/dotnet/framework/misc/using-libraries-from-partially-trusted-code). + ]]> @@ -450,13 +450,13 @@ Creates a new object that is a copy of the current instance. A new object that is a copy of this instance. - diff --git a/xml/System.Management/MethodDataCollection.xml b/xml/System.Management/MethodDataCollection.xml index 5e471ac7e62..b3c0177077e 100644 --- a/xml/System.Management/MethodDataCollection.xml +++ b/xml/System.Management/MethodDataCollection.xml @@ -33,14 +33,14 @@ Represents the set of methods available in the collection. - class. For more information on the **Win32_Process** class, see the [Windows Management Instrumentation](/windows/desktop/wmisdk/wmi-start-page) documentation. - + class. For more information on the **Win32_Process** class, see the [Windows Management Instrumentation](/windows/desktop/wmisdk/wmi-start-page) documentation. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WindowsServer/wminet_MethodDataCollection/cs/MethodDataCollection.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Management/MethodDataCollection/Overview/MethodDataCollection.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.Management/MethodDataCollection/Overview/MethodDataCollection.vb" id="Snippet1"::: + ]]> @@ -79,14 +79,14 @@ The name of the method to add. Adds a to the . This overload will add a new method with no parameters to the collection. - objects to the can only be done when the class has no instances. Any other case will result in an exception. - -## .NET Framework Security - Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see [Using Libraries from Partially Trusted Code](/dotnet/framework/misc/using-libraries-from-partially-trusted-code). - + objects to the can only be done when the class has no instances. Any other case will result in an exception. + +## .NET Framework Security + Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see [Using Libraries from Partially Trusted Code](/dotnet/framework/misc/using-libraries-from-partially-trusted-code). + ]]> @@ -129,14 +129,14 @@ The holding the output parameters to the method. Adds a to the . This overload will add a new method with the specified parameter objects to the collection. - objects to the can only be done when the class has no instances. Any other case will result in an exception. - -## .NET Framework Security - Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see [Using Libraries from Partially Trusted Code](/dotnet/framework/misc/using-libraries-from-partially-trusted-code). - + objects to the can only be done when the class has no instances. Any other case will result in an exception. + +## .NET Framework Security + Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see [Using Libraries from Partially Trusted Code](/dotnet/framework/misc/using-libraries-from-partially-trusted-code). + ]]> @@ -180,13 +180,13 @@ The index from which to start. Copies the into an array. - @@ -219,13 +219,13 @@ The index in the destination array from which to start the copy. Copies the to a specialized array. - @@ -255,16 +255,16 @@ Gets the number of objects in the collection. Returns an value representing the number of objects in the collection. - . - -## .NET Framework Security - Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see [Using Libraries from Partially Trusted Code](/dotnet/framework/misc/using-libraries-from-partially-trusted-code). - + . + +## .NET Framework Security + Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see [Using Libraries from Partially Trusted Code](/dotnet/framework/misc/using-libraries-from-partially-trusted-code). + ]]> @@ -293,20 +293,20 @@ Returns an enumerator for the . An to enumerate through the collection. - method cannot be used since it requires rewinding the enumerator. - - Forward-only enumerators are generally much faster and use less memory than conventional enumerators, but they do not allow calls to . - - If an enumerator is rewindable, the objects in the collection will be kept available for multiple enumerations. - -## .NET Framework Security - Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see [Using Libraries from Partially Trusted Code](/dotnet/framework/misc/using-libraries-from-partially-trusted-code). - + method cannot be used since it requires rewinding the enumerator. + + Forward-only enumerators are generally much faster and use less memory than conventional enumerators, but they do not allow calls to . + + If an enumerator is rewindable, the objects in the collection will be kept available for multiple enumerations. + +## .NET Framework Security + Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see [Using Libraries from Partially Trusted Code](/dotnet/framework/misc/using-libraries-from-partially-trusted-code). + ]]> @@ -336,16 +336,16 @@ Gets a value that indicates whether the object is synchronized. Returns a value indicating whether the object is synchronized. - @@ -377,16 +377,16 @@ Gets the specified from the . Returns a containing the method data for a specified method from the collection. - containing all information about the specified method. - -## .NET Framework Security - Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see [Using Libraries from Partially Trusted Code](/dotnet/framework/misc/using-libraries-from-partially-trusted-code). - + containing all information about the specified method. + +## .NET Framework Security + Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see [Using Libraries from Partially Trusted Code](/dotnet/framework/misc/using-libraries-from-partially-trusted-code). + ]]> @@ -416,14 +416,14 @@ The name of the method to remove from the collection. Removes a from the . - objects from the can only be done when the class has no instances. Any other case will result in an exception. - -## .NET Framework Security - Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see [Using Libraries from Partially Trusted Code](/dotnet/framework/misc/using-libraries-from-partially-trusted-code). - + objects from the can only be done when the class has no instances. Any other case will result in an exception. + +## .NET Framework Security + Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see [Using Libraries from Partially Trusted Code](/dotnet/framework/misc/using-libraries-from-partially-trusted-code). + ]]> @@ -453,16 +453,16 @@ Gets the object to be used for synchronization. Returns an value representing the object to be used for synchronization. - @@ -494,26 +494,26 @@ Returns an that iterates through the . An for the . - also brings the enumerator back to this position. At this position, calling throws an exception. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . - - returns the same object until either or is called. sets to the next element. - - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, calling throws an exception. To set to the first element of the collection again, you can call followed by . - - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . If the collection is modified between and , returns the element that it is set to, even if the enumerator is already invalidated. - - The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread safe procedure. Even when a collection is synchronized, other threads can still modify the collection, which causes the enumerator to throw an exception. To guarantee thread safety during enumeration, you can either lock the collection during the entire enumeration or catch the exceptions resulting from changes made by other threads. - - This method is an O(1) operation. - + also brings the enumerator back to this position. At this position, calling throws an exception. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . + + returns the same object until either or is called. sets to the next element. + + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, calling throws an exception. To set to the first element of the collection again, you can call followed by . + + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . If the collection is modified between and , returns the element that it is set to, even if the enumerator is already invalidated. + + The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread safe procedure. Even when a collection is synchronized, other threads can still modify the collection, which causes the enumerator to throw an exception. To guarantee thread safety during enumeration, you can either lock the collection during the entire enumeration or catch the exceptions resulting from changes made by other threads. + + This method is an O(1) operation. + ]]> diff --git a/xml/System.Management/PropertyDataCollection.xml b/xml/System.Management/PropertyDataCollection.xml index 94b107f09b3..ba1d2422fae 100644 --- a/xml/System.Management/PropertyDataCollection.xml +++ b/xml/System.Management/PropertyDataCollection.xml @@ -33,14 +33,14 @@ Represents the set of properties of a WMI object. - class. For more information about **Win32_OperatingSystem**, see the [Windows Management Instrumentation](/windows/desktop/wmisdk/wmi-start-page) documentation. - + class. For more information about **Win32_OperatingSystem**, see the [Windows Management Instrumentation](/windows/desktop/wmisdk/wmi-start-page) documentation. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WindowsServer/wminet_PropertyDataCollection/cs/PropertyDataCollection.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Management/PropertyDataCollection/Overview/PropertyDataCollection.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.Management/PropertyDataCollection/Overview/PropertyDataCollection.vb" id="Snippet1"::: + ]]> @@ -81,14 +81,14 @@ The value of the property (cannot be null). Adds a new with the specified value. The value cannot be null and must be convertible to a Common Information Model (CIM) type. - in a . - -## .NET Framework Security - Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see [Using Libraries from Partially Trusted Code](/dotnet/framework/misc/using-libraries-from-partially-trusted-code). - + in a . + +## .NET Framework Security + Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see [Using Libraries from Partially Trusted Code](/dotnet/framework/misc/using-libraries-from-partially-trusted-code). + ]]> @@ -123,14 +123,14 @@ to specify that the property is an array type; otherwise, . Adds a new with no assigned value. - in a . - -## .NET Framework Security - Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see [Using Libraries from Partially Trusted Code](/dotnet/framework/misc/using-libraries-from-partially-trusted-code). - + in a . + +## .NET Framework Security + Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see [Using Libraries from Partially Trusted Code](/dotnet/framework/misc/using-libraries-from-partially-trusted-code). + ]]> @@ -164,14 +164,14 @@ The CIM type of the property. Adds a new with the specified value and Common Information Model (CIM) type. - in a . - -## .NET Framework Security - Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see [Using Libraries from Partially Trusted Code](/dotnet/framework/misc/using-libraries-from-partially-trusted-code). - + in a . + +## .NET Framework Security + Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see [Using Libraries from Partially Trusted Code](/dotnet/framework/misc/using-libraries-from-partially-trusted-code). + ]]> @@ -215,13 +215,13 @@ The index from which to start copying. Copies the into an array. - @@ -254,13 +254,13 @@ The index in the destination array from which to start copying. Copies the to a specialized object array. - @@ -290,16 +290,16 @@ Gets the number of objects in the . Returns an value representing the number of objects in the collection. - @@ -328,18 +328,18 @@ Returns the enumerator for this . An that can be used to iterate through the collection. - method cannot be used since it requires rewinding the enumerator. - - Forward-only enumerators are generally much faster and use less memory than conventional enumerators, but they do not allow calls to . - - If an enumerator is rewindable, the objects in the collection will be kept available for multiple enumerations. - -## .NET Framework Security - Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see [Using Libraries from Partially Trusted Code](/dotnet/framework/misc/using-libraries-from-partially-trusted-code). - + method cannot be used since it requires rewinding the enumerator. + + Forward-only enumerators are generally much faster and use less memory than conventional enumerators, but they do not allow calls to . + + If an enumerator is rewindable, the objects in the collection will be kept available for multiple enumerations. + +## .NET Framework Security + Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see [Using Libraries from Partially Trusted Code](/dotnet/framework/misc/using-libraries-from-partially-trusted-code). + ]]> @@ -369,16 +369,16 @@ Gets a value indicating whether the object is synchronized. Returns a value indicating whether the object is synchronized. - @@ -410,24 +410,24 @@ Gets the specified property from the , using [] syntax. This property is the indexer for the class. Returns a containing the data for a specified property in the collection. - , based on the name specified. - -## .NET Framework Security - Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see [Using Libraries from Partially Trusted Code](/dotnet/framework/misc/using-libraries-from-partially-trusted-code). - - - -## Examples - The following example gets the **Freespace** property from a . - + , based on the name specified. + +## .NET Framework Security + Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see [Using Libraries from Partially Trusted Code](/dotnet/framework/misc/using-libraries-from-partially-trusted-code). + + + +## Examples + The following example gets the **Freespace** property from a . + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WindowsServer/wminet_PropertyDataCollection_Item/cs/PropertyDataCollection_Item.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Management/PropertyDataCollection/Item/PropertyDataCollection_Item.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.Management/PropertyDataCollection/Item/PropertyDataCollection_Item.vb" id="Snippet1"::: + ]]> @@ -457,14 +457,14 @@ The name of the property to be removed. Removes a from the . - . - -## .NET Framework Security - Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see [Using Libraries from Partially Trusted Code](/dotnet/framework/misc/using-libraries-from-partially-trusted-code). - + . + +## .NET Framework Security + Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see [Using Libraries from Partially Trusted Code](/dotnet/framework/misc/using-libraries-from-partially-trusted-code). + ]]> @@ -494,16 +494,16 @@ Gets the object to be used for synchronization. Returns an value containing the object to be used for synchronization. - @@ -535,26 +535,26 @@ Returns an that iterates through the . An for the . - also brings the enumerator back to this position. At this position, calling throws an exception. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . - - returns the same object until either or is called. sets to the next element. - - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, calling throws an exception. To set to the first element of the collection again, you can call followed by . - - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . If the collection is modified between and , returns the element that it is set to, even if the enumerator is already invalidated. - - The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread safe procedure. Even when a collection is synchronized, other threads can still modify the collection, which causes the enumerator to throw an exception. To guarantee thread safety during enumeration, you can either lock the collection during the entire enumeration or catch the exceptions resulting from changes made by other threads. - - This method is an O(1) operation. - + also brings the enumerator back to this position. At this position, calling throws an exception. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . + + returns the same object until either or is called. sets to the next element. + + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, calling throws an exception. To set to the first element of the collection again, you can call followed by . + + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . If the collection is modified between and , returns the element that it is set to, even if the enumerator is already invalidated. + + The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread safe procedure. Even when a collection is synchronized, other threads can still modify the collection, which causes the enumerator to throw an exception. To guarantee thread safety during enumeration, you can either lock the collection during the entire enumeration or catch the exceptions resulting from changes made by other threads. + + This method is an O(1) operation. + ]]> diff --git a/xml/System.Management/QualifierDataCollection.xml b/xml/System.Management/QualifierDataCollection.xml index d688834daa2..4ed30aee1f4 100644 --- a/xml/System.Management/QualifierDataCollection.xml +++ b/xml/System.Management/QualifierDataCollection.xml @@ -33,14 +33,14 @@ Represents a collection of objects. - class. For more information about **Win32_Service**, see the [Windows Management Instrumentation](/windows/desktop/wmisdk/wmi-start-page) documentation. - + class. For more information about **Win32_Service**, see the [Windows Management Instrumentation](/windows/desktop/wmisdk/wmi-start-page) documentation. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WindowsServer/wminet_QualifierDataCollection/cs/QualifierDataCollection.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Management/QualifierDataCollection/Overview/QualifierDataCollection.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System.Management/QualifierDataCollection/Overview/QualifierDataCollection.vb" id="Snippet1"::: + ]]> @@ -81,13 +81,13 @@ The value for the new qualifier. Adds a to the . This overload specifies the qualifier name and value. - @@ -131,13 +131,13 @@ to specify that this qualifier's value is overridable in instances of subclasses; otherwise, . Adds a to the . This overload specifies all property values for a . - @@ -181,13 +181,13 @@ The index from which to start copying. Copies the into an array. - @@ -220,13 +220,13 @@ The index from which to start copying. Copies the into a specialized array. - @@ -256,16 +256,16 @@ Gets the number of objects in the . The number of objects in the collection. - @@ -294,18 +294,18 @@ Returns an enumerator for the . This method is strongly typed. An that can be used to iterate through the collection. - method cannot be used since it requires rewinding the enumerator. - - Forward-only enumerators are generally much faster and use less memory than conventional enumerators, but they do not allow calls to . - - If an enumerator is rewindable, the objects in the collection will be kept available for multiple enumerations. - -## .NET Framework Security - Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see [Using Libraries from Partially Trusted Code](/dotnet/framework/misc/using-libraries-from-partially-trusted-code). - + method cannot be used since it requires rewinding the enumerator. + + Forward-only enumerators are generally much faster and use less memory than conventional enumerators, but they do not allow calls to . + + If an enumerator is rewindable, the objects in the collection will be kept available for multiple enumerations. + +## .NET Framework Security + Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see [Using Libraries from Partially Trusted Code](/dotnet/framework/misc/using-libraries-from-partially-trusted-code). + ]]> @@ -336,16 +336,16 @@ if the object is synchronized; otherwise, . - @@ -377,16 +377,16 @@ Gets the specified from the . The data for a specified qualifier in the collection. - , based on the name specified. - -## .NET Framework Security - Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see [Using Libraries from Partially Trusted Code](/dotnet/framework/misc/using-libraries-from-partially-trusted-code). - + , based on the name specified. + +## .NET Framework Security + Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see [Using Libraries from Partially Trusted Code](/dotnet/framework/misc/using-libraries-from-partially-trusted-code). + ]]> @@ -416,13 +416,13 @@ The name of the to remove. Removes a from the by name. - @@ -452,16 +452,16 @@ Gets the object to be used for synchronization. The object to be used for synchronization. - @@ -493,26 +493,26 @@ Returns an that iterates through the . An for the . - also brings the enumerator back to this position. At this position, calling throws an exception. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . - - returns the same object until either or is called. sets to the next element. - - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, calling throws an exception. To set to the first element of the collection again, you can call followed by . - - An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . If the collection is modified between and , returns the element that it is set to, even if the enumerator is already invalidated. - - The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread safe procedure. Even when a collection is synchronized, other threads can still modify the collection, which causes the enumerator to throw an exception. To guarantee thread safety during enumeration, you can either lock the collection during the entire enumeration or catch the exceptions resulting from changes made by other threads. - - This method is an O(1) operation. - + also brings the enumerator back to this position. At this position, calling throws an exception. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . + + returns the same object until either or is called. sets to the next element. + + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, calling throws an exception. To set to the first element of the collection again, you can call followed by . + + An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and the next call to or throws an . If the collection is modified between and , returns the element that it is set to, even if the enumerator is already invalidated. + + The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread safe procedure. Even when a collection is synchronized, other threads can still modify the collection, which causes the enumerator to throw an exception. To guarantee thread safety during enumeration, you can either lock the collection during the entire enumeration or catch the exceptions resulting from changes made by other threads. + + This method is an O(1) operation. + ]]> diff --git a/xml/System.Media/SoundPlayer.xml b/xml/System.Media/SoundPlayer.xml index 3246432ea96..e429f4e332a 100644 --- a/xml/System.Media/SoundPlayer.xml +++ b/xml/System.Media/SoundPlayer.xml @@ -53,7 +53,7 @@ ## Remarks The class provides a simple interface for loading and playing a .wav file. The class supports loading a .wav file from a file path, a URL, a that contains a .wav file, or an embedded resource that contains a .wav file. - To play a sound using the class, configure a with a path to the .wav file and call one of the play methods. You can identify the .wav file to play by using one of the constructors or by setting either the or property. The file can be loaded prior to playing by using one of the load methods, or loading can be deferred until one of the play methods is called. A configured to load a .wav file from a or URL must load the .wav file into memory before playback begins. + To play a sound using the class, configure a with a path to the .wav file and call one of the play methods. You can identify the .wav file to play by using one of the constructors or by setting either the or property. The file can be loaded prior to playing by using one of the load methods, or loading can be deferred until one of the play methods is called. A configured to load a .wav file from a or URL must load the .wav file into memory before playback begins. You can load or play a .wav file synchronously or asynchronously. If you call a synchronous load or play method, the calling thread will wait until the method returns, which may cause painting and other events to be interrupted. Calling an asynchronous load or play method will allow the calling thread to continue without interruption. For more information on asynchronous method calls, see [How to: Run an Operation in the Background](/dotnet/desktop/winforms/controls/how-to-run-an-operation-in-the-background). @@ -166,7 +166,7 @@ passed to the `stream` parameter should be a containing a .wav file. The data returned by the method of the should be the data within a .wav file. + The passed to the `stream` parameter should be a containing a .wav file. The data returned by the method of the should be the data within a .wav file. ]]> @@ -341,15 +341,15 @@ method uses the current thread to load a .wav file, preventing the thread from handling other messages until the load is complete. + The method uses the current thread to load a .wav file, preventing the thread from handling other messages until the load is complete. > [!CAUTION] -> The method may produce a delay while loading a large .wav file. In addition, painting and other events will be blocked until the load is completed. Use the method to load a sound asynchronously, which allows the calling thread to continue without interruption. +> The method may produce a delay while loading a large .wav file. In addition, painting and other events will be blocked until the load is completed. Use the method to load a sound asynchronously, which allows the calling thread to continue without interruption. This method raises the event when loading completes, even if the load was not successful. ## Examples - The following code example demonstrates the use of the method to attach a .wav file to an instance of the class. This code example is part of a larger example provided for the class. + The following code example demonstrates the use of the method to attach a .wav file to an instance of the class. This code example is part of a larger example provided for the class. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.Sound/CPP/soundtestform.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Media/SoundPlayer/Overview/soundtestform.cs" id="Snippet2"::: @@ -410,7 +410,7 @@ This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as , are still thrown synchronously. For the stored exceptions, see the exceptions thrown by . ## Examples - The following code example demonstrates the use of the method to asynchronously load a .wav file for use by an instance of the class. This code example is part of a larger example provided for the class. + The following code example demonstrates the use of the method to asynchronously load a .wav file for use by an instance of the class. This code example is part of a larger example provided for the class. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.Sound/CPP/soundtestform.cpp" id="Snippet3"::: :::code language="csharp" source="~/snippets/csharp/System.Media/SoundPlayer/Overview/soundtestform.cs" id="Snippet3"::: @@ -468,7 +468,7 @@ This method stores in the task it returns all non-usage exceptions that the meth ## Examples - The following code example demonstrates the use of the event handler to receive a notification indicating that the contents of a .wav file have been loaded. This code example is part of a larger example provided for the class. + The following code example demonstrates the use of the event handler to receive a notification indicating that the contents of a .wav file have been loaded. This code example is part of a larger example provided for the class. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.Sound/CPP/soundtestform.cpp" id="Snippet8"::: :::code language="csharp" source="~/snippets/csharp/System.Media/SoundPlayer/Overview/soundtestform.cs" id="Snippet8"::: @@ -570,7 +570,7 @@ This method stores in the task it returns all non-usage exceptions that the meth Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). - The method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + The method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. ]]> @@ -623,7 +623,7 @@ This method stores in the task it returns all non-usage exceptions that the meth Raising an event invokes the event handler through a delegate. For more information, see How to: Provide Event functionality and [Handling and Raising Events](/dotnet/standard/events/). - The method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + The method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. ]]> @@ -676,7 +676,7 @@ This method stores in the task it returns all non-usage exceptions that the meth Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). - The method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + The method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. ]]> @@ -728,14 +728,14 @@ This method stores in the task it returns all non-usage exceptions that the meth method plays the sound using a new thread. If you call before the .wav file has been loaded into memory, the .wav file will be loaded before playback starts. You can use the or method to load the .wav file to memory in advance. After a .wav file is successfully loaded from a or URL, future calls to playback methods for the will not need to reload the .wav file until the path for the sound changes. + The method plays the sound using a new thread. If you call before the .wav file has been loaded into memory, the .wav file will be loaded before playback starts. You can use the or method to load the .wav file to memory in advance. After a .wav file is successfully loaded from a or URL, future calls to playback methods for the will not need to reload the .wav file until the path for the sound changes. - If the .wav file has not been specified or it fails to load, the method will play the default beep sound. + If the .wav file has not been specified or it fails to load, the method will play the default beep sound. ## Examples - The following code example demonstrates the use of the method to asynchronously play a .wav file. This code example is part of a larger example provided for the class. + The following code example demonstrates the use of the method to asynchronously play a .wav file. This code example is part of a larger example provided for the class. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.Sound/CPP/soundtestform.cpp" id="Snippet5"::: :::code language="csharp" source="~/snippets/csharp/System.Media/SoundPlayer/Overview/soundtestform.cs" id="Snippet5"::: @@ -792,16 +792,16 @@ This method stores in the task it returns all non-usage exceptions that the meth method plays and loops the sound using a new thread. If you call before the .wav file has been loaded into memory, the .wav file will be loaded before playback starts. You can use the or method to load the .wav file to memory in advance. After a .wav file is successfully loaded from a or URL, future calls to playback methods for the will not need to reload the .wav file until the path for the sound changes. + The method plays and loops the sound using a new thread. If you call before the .wav file has been loaded into memory, the .wav file will be loaded before playback starts. You can use the or method to load the .wav file to memory in advance. After a .wav file is successfully loaded from a or URL, future calls to playback methods for the will not need to reload the .wav file until the path for the sound changes. - If the .wav file has not been specified or it fails to load, the method will play the default beep sound. + If the .wav file has not been specified or it fails to load, the method will play the default beep sound. - For more information about , see [How to: Loop a Sound Playing on a Windows Form](/dotnet/desktop/winforms/controls/how-to-loop-a-sound-playing-on-a-windows-form). + For more information about , see [How to: Loop a Sound Playing on a Windows Form](/dotnet/desktop/winforms/controls/how-to-loop-a-sound-playing-on-a-windows-form). ## Examples - The following code example demonstrates the use of the method to repeatedly play a .wav file. The .wav will be played until the method is called. This code example is part of a larger example provided for the class. + The following code example demonstrates the use of the method to repeatedly play a .wav file. The .wav will be played until the method is called. This code example is part of a larger example provided for the class. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.Sound/CPP/soundtestform.cpp" id="Snippet6"::: :::code language="csharp" source="~/snippets/csharp/System.Media/SoundPlayer/Overview/soundtestform.cs" id="Snippet6"::: @@ -858,14 +858,14 @@ This method stores in the task it returns all non-usage exceptions that the meth method uses the current thread to play a .wav file, preventing the thread from handling other messages until the load is complete. You can use the or method to load the .wav file to memory in advance. After a .wav file is successfully loaded from a or URL, future calls to playback methods for the will not need to reload the .wav file until the path for the sound changes. + The method uses the current thread to play a .wav file, preventing the thread from handling other messages until the load is complete. You can use the or method to load the .wav file to memory in advance. After a .wav file is successfully loaded from a or URL, future calls to playback methods for the will not need to reload the .wav file until the path for the sound changes. - If the .wav file has not been specified or it fails to load, the method will play the default beep sound. + If the .wav file has not been specified or it fails to load, the method will play the default beep sound. ## Examples - The following code example demonstrates the use of the method to synchronously play a .wav file. + The following code example demonstrates the use of the method to synchronously play a .wav file. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.PlaySync/CPP/system.windows.forms.sound.playasync.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Media/SoundPlayer/PlaySync/system.windows.forms.sound.playasync.cs" id="Snippet1"::: @@ -980,7 +980,7 @@ This method stores in the task it returns all non-usage exceptions that the meth ## Examples - The following code example demonstrates the use of the event handler to receive a notification when the has been attached to a different .wav file. This code example is part of a larger example provided for the class. + The following code example demonstrates the use of the event handler to receive a notification when the has been attached to a different .wav file. This code example is part of a larger example provided for the class. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.Sound/CPP/soundtestform.cpp" id="Snippet9"::: :::code language="csharp" source="~/snippets/csharp/System.Media/SoundPlayer/Overview/soundtestform.cs" id="Snippet9"::: @@ -1026,7 +1026,7 @@ This method stores in the task it returns all non-usage exceptions that the meth method to halt a .wav file that is currently playing. This code example is part of a larger example provided for the class. + The following code example demonstrates the use of the method to halt a .wav file that is currently playing. This code example is part of a larger example provided for the class. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.Sound/CPP/soundtestform.cpp" id="Snippet7"::: :::code language="csharp" source="~/snippets/csharp/System.Media/SoundPlayer/Overview/soundtestform.cs" id="Snippet7"::: diff --git a/xml/System.Media/SystemSound.xml b/xml/System.Media/SystemSound.xml index 5f70e9fe372..51ffd72a4b4 100644 --- a/xml/System.Media/SystemSound.xml +++ b/xml/System.Media/SystemSound.xml @@ -80,7 +80,7 @@ method plays the sound asynchronously. + The method plays the sound asynchronously. diff --git a/xml/System.Media/SystemSounds.xml b/xml/System.Media/SystemSounds.xml index 36f5f3c3ed5..6c669f2a717 100644 --- a/xml/System.Media/SystemSounds.xml +++ b/xml/System.Media/SystemSounds.xml @@ -44,7 +44,7 @@ ## Remarks The class provides methods for retrieving the sounds associated with a set of operating system sound-event types for the current user. The sounds associated with each type of operating system sound event can be configured in Windows Control Panel. - provides static methods to access the sounds associated with the , , , and sound events. Each property returns a that can be used to play the sound. + provides static methods to access the sounds associated with the , , , and sound events. Each property returns a that can be used to play the sound. ]]> diff --git a/xml/System.Numerics/BigInteger.xml b/xml/System.Numerics/BigInteger.xml index df9a9c58c73..78e23efabb0 100644 --- a/xml/System.Numerics/BigInteger.xml +++ b/xml/System.Numerics/BigInteger.xml @@ -303,19 +303,19 @@ The individual bytes in the `value` array should be in little-endian order, from |Hexadecimal string|E8D4A51000| |Byte array (lowest index first)|00 10 A5 D4 E8 00| - Most methods that convert numeric values to byte arrays, such as and , return byte arrays in little-endian order. + Most methods that convert numeric values to byte arrays, such as and , return byte arrays in little-endian order. The constructor expects positive values in the byte array to use sign-and-magnitude representation, and negative values to use two's complement representation. In other words, if the highest-order bit of the highest-order byte in `value` is set, the resulting value is negative. Depending on the source of the byte array, this might cause a positive value to be misinterpreted as a negative value. Byte arrays are typically generated in the following ways: -- By calling the method. Because this method returns a byte array with the highest-order bit of the highest-order byte in the array set to zero for positive values, there is no chance of misinterpreting a positive value as negative. Unmodified byte arrays created by the method always successfully round-trip when they are passed to the constructor. +- By calling the method. Because this method returns a byte array with the highest-order bit of the highest-order byte in the array set to zero for positive values, there is no chance of misinterpreting a positive value as negative. Unmodified byte arrays created by the method always successfully round-trip when they are passed to the constructor. -- By calling the method and passing it a signed integer as a parameter. Because signed integers handle both sign-and-magnitude representation and two's complement representation, there is no chance of misinterpreting a positive value as negative. +- By calling the method and passing it a signed integer as a parameter. Because signed integers handle both sign-and-magnitude representation and two's complement representation, there is no chance of misinterpreting a positive value as negative. -- By calling the method and passing it an unsigned integer as a parameter. Because unsigned integers are represented by their magnitude only, positive values can be misinterpreted as negative values. To prevent this misinterpretation, you can add a zero-byte value to the end of the array. The example in the next section provides an illustration. +- By calling the method and passing it an unsigned integer as a parameter. Because unsigned integers are represented by their magnitude only, positive values can be misinterpreted as negative values. To prevent this misinterpretation, you can add a zero-byte value to the end of the array. The example in the next section provides an illustration. - By creating a byte array either dynamically or statically without necessarily calling any of the previous methods, or by modifying an existing byte array. To prevent positive values from being misinterpreted as negative values, you can add a zero-byte value to the end of the array. - If `value` is an empty array, the new object is initialized to a value of . If `value` is `null`, the constructor throws an . + If `value` is an empty array, the new object is initialized to a value of . If `value` is `null`, the constructor throws an . ## Examples The following example instantiates a object from a 5-element byte array whose value is {5, 4, 3, 2, 1}. It then displays the value, represented as both decimal and hexadecimal numbers, to the console. A comparison of the input array with the text output makes it clear why this overload of the class constructor creates a object whose value is 4328719365 (or 0x102030405). The first element of the byte array, whose value is 5, defines the value of the lowest-order byte of the object, which is 0x05. The second element of the byte array, whose value is 4, defines the value of the second byte of the object, which is 0x04, and so on. @@ -324,7 +324,7 @@ The individual bytes in the `value` array should be in little-endian order, from :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/.ctor/Example1.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Numerics/BigInteger/.ctor/Example1.vb" id="Snippet1"::: - The following example instantiates a positive and a negative value, passes them to the method, and then restores the original values from the resulting byte array. Note that the two values are represented by identical byte arrays. The only difference between them is in the most significant bit of the last element in the byte array. This bit is set (the value of the byte is 0xFF) if the array is created from a negative value. The bit is not set (the value of the byte is zero), if the array is created from a positive value. + The following example instantiates a positive and a negative value, passes them to the method, and then restores the original values from the resulting byte array. Note that the two values are represented by identical byte arrays. The only difference between them is in the most significant bit of the last element in the byte array. This bit is set (the value of the byte is 0xFF) if the array is created from a negative value. The bit is not set (the value of the byte is zero), if the array is created from a positive value. :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/.ctor/Example1.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/.ctor/Example1.fs" id="Snippet2"::: @@ -392,7 +392,7 @@ The individual bytes in the `value` array should be in little-endian order, from ## Examples - The following example illustrates the use of the constructor to instantiate a object. It defines an array of values, and then passes each value to the constructor. Note that the value is truncated instead of rounded when it is assigned to the object. + The following example illustrates the use of the constructor to instantiate a object. It defines an array of values, and then passes each value to the constructor. Note that the value is truncated instead of rounded when it is assigned to the object. :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/.ctor/Example2.cs" id="Snippet4"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/.ctor/Example2.fs" id="Snippet4"::: @@ -453,7 +453,7 @@ The individual bytes in the `value` array should be in little-endian order, from ## Examples - The following example illustrates the use of the constructor to instantiate a object. It also illustrates the loss of precision that may occur when you use the data type. A is assigned a large value, which is then assigned to a object. As the output shows, this assignment involves a loss of precision. Both values are then incremented by one. The output shows that the object reflects the changed value, whereas the object does not. + The following example illustrates the use of the constructor to instantiate a object. It also illustrates the loss of precision that may occur when you use the data type. A is assigned a large value, which is then assigned to a object. As the output shows, this assignment involves a loss of precision. Both values are then incremented by one. The output shows that the object reflects the changed value, whereas the object does not. :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/.ctor/Example2.cs" id="Snippet5"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/.ctor/Example2.fs" id="Snippet5"::: @@ -516,7 +516,7 @@ The individual bytes in the `value` array should be in little-endian order, from ## Examples - The following example calls the constructor to instantiate values from an array of 32-bit integers. It also uses implicit conversion to assign each 32-bit integer value to a variable. It then compares the two values to establish that the resulting values are the same. + The following example calls the constructor to instantiate values from an array of 32-bit integers. It also uses implicit conversion to assign each 32-bit integer value to a variable. It then compares the two values to establish that the resulting values are the same. :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/.ctor/Example2.cs" id="Snippet6"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/.ctor/Example2.fs" id="Snippet6"::: @@ -575,7 +575,7 @@ The individual bytes in the `value` array should be in little-endian order, from ## Examples - The following example calls the constructor to instantiate values from an array of 64-bit integers. It also uses implicit conversion to assign each 64-bit integer value to a variable. It then compares the two values to establish that the resulting values are the same. + The following example calls the constructor to instantiate values from an array of 64-bit integers. It also uses implicit conversion to assign each 64-bit integer value to a variable. It then compares the two values to establish that the resulting values are the same. :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/.ctor/Example2.cs" id="Snippet7"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/.ctor/Example2.fs" id="Snippet7"::: @@ -636,7 +636,7 @@ The individual bytes in the `value` array should be in little-endian order, from ## Examples - The following example illustrates the use of the constructor to instantiate a object. It also illustrates the loss of precision that may occur when you use the data type. A is assigned a large negative value, which is then assigned to a object. As the output shows, this assignment involves a loss of precision. Both values are then incremented by one. The output shows that the object reflects the changed value, whereas the object does not. + The following example illustrates the use of the constructor to instantiate a object. It also illustrates the loss of precision that may occur when you use the data type. A is assigned a large negative value, which is then assigned to a object. As the output shows, this assignment involves a loss of precision. Both values are then incremented by one. The output shows that the object reflects the changed value, whereas the object does not. :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/.ctor/Example2.cs" id="Snippet8"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/.ctor/Example2.fs" id="Snippet8"::: @@ -703,7 +703,7 @@ The individual bytes in the `value` array should be in little-endian order, from ## Examples - The following example uses the constructor and an assignment statement to initialize values from an array of unsigned 32-bit integers. It then compares the two values to demonstrate that the two methods of initializing a value produce identical results. + The following example uses the constructor and an assignment statement to initialize values from an array of unsigned 32-bit integers. It then compares the two values to demonstrate that the two methods of initializing a value produce identical results. :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/.ctor/Example2.cs" id="Snippet9"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/.ctor/Example2.fs" id="Snippet9"::: @@ -769,7 +769,7 @@ The individual bytes in the `value` array should be in little-endian order, from ## Examples - The following example uses the constructor to instantiate a object whose value is equal to . + The following example uses the constructor to instantiate a object whose value is equal to . :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/.ctor/Example2.cs" id="Snippet10"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/.ctor/Example2.fs" id="Snippet10"::: @@ -878,7 +878,7 @@ The individual bytes in the `value` array should be in little-endian order, from |`value` >= 0|`value`| |`value` < 0|`value` * -1| - The method is equivalent to the method for the primitive numeric types. + The method is equivalent to the method for the primitive numeric types. ]]> @@ -939,9 +939,9 @@ The individual bytes in the `value` array should be in little-endian order, from method to perform addition using values. + Languages that do not support operator overloading or custom operators can use the method to perform addition using values. - The method is a useful substitute for the addition operator when instantiating a variable by assigning it a sum that results from addition, as shown in the following example. + The method is a useful substitute for the addition operator when instantiating a variable by assigning it a sum that results from addition, as shown in the following example. :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/Add/Multiply1.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/Add/Multiply1.fs" id="Snippet2"::: @@ -1061,7 +1061,7 @@ The individual bytes in the `value` array should be in little-endian order, from type has no fixed range, comparisons of values are not characterized by the lack of precision that characterizes the comparison of floating-point numbers. The following example compares two values that differ by one and that each have 1,896 digits. The method correctly reports that the two values are not equal. + Although the type has no fixed range, comparisons of values are not characterized by the lack of precision that characterizes the comparison of floating-point numbers. The following example compares two values that differ by one and that each have 1,896 digits. The method correctly reports that the two values are not equal. :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/Compare/Compare1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/Compare/Compare1.fs" id="Snippet1"::: @@ -1146,12 +1146,12 @@ The individual bytes in the `value` array should be in little-endian order, from , , , , , or value, it is implicitly converted to an value when the method is called. + If `other` is a , , , , , or value, it is implicitly converted to an value when the method is called. ## Examples - The following example illustrates the result of calling the method with integral values. + The following example illustrates the result of calling the method with integral values. :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/CompareTo/Example2.cs" id="Snippet3"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/CompareTo/Example2.fs" id="Snippet3"::: @@ -1228,18 +1228,18 @@ The individual bytes in the `value` array should be in little-endian order, from method implements the method. It is used by generic collection objects to order the items in the collection. + This overload of the method implements the method. It is used by generic collection objects to order the items in the collection. ## Examples - The following example illustrates the use of the method to order a list of `StarInfo` objects. Each `StarInfo` object provides information about a star's name and its distance from the Earth in miles. `StarInfo` implements the interface, which enables `StarInfo` objects to be sorted by generic collection classes. Its implementation just wraps a call to . + The following example illustrates the use of the method to order a list of `StarInfo` objects. Each `StarInfo` object provides information about a star's name and its distance from the Earth in miles. `StarInfo` implements the interface, which enables `StarInfo` objects to be sorted by generic collection classes. Its implementation just wraps a call to . :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/CompareTo/Example1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/CompareTo/Example1.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Numerics/BigInteger/CompareTo/Example1.vb" id="Snippet1"::: - The following code then instantiates four `StarInfo` objects and stores them in a generic object. After the method is called, `StarInfo` objects are displayed in order of their distance from the Earth. + The following code then instantiates four `StarInfo` objects and stores them in a generic object. After the method is called, `StarInfo` objects are displayed in order of their distance from the Earth. :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/CompareTo/Example1.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/CompareTo/Example1.fs" id="Snippet2"::: @@ -1319,7 +1319,7 @@ The individual bytes in the `value` array should be in little-endian order, from method implements the method. It is used by non-generic collection objects to order the items in the collection. + This overload of the method implements the method. It is used by non-generic collection objects to order the items in the collection. The `obj` parameter must be one of the following: @@ -1330,7 +1330,7 @@ The individual bytes in the `value` array should be in little-endian order, from ## Examples - The following example calls the method to compare a value with each element in an object array: + The following example calls the method to compare a value with each element in an object array: :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/CompareTo/Example2.cs" id="Snippet4"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/CompareTo/Example2.fs" id="Snippet4"::: @@ -1649,14 +1649,14 @@ The individual bytes in the `value` array should be in little-endian order, from method performs integer division; any remainder that results from the division is discarded. To perform integer division while preserving the remainder, call the method. To retrieve only the remainder, call the method. + The method performs integer division; any remainder that results from the division is discarded. To perform integer division while preserving the remainder, call the method. To retrieve only the remainder, call the method. - The method can be used by languages that do not support operator overloading. Its behavior is identical to division using the division operator. + The method can be used by languages that do not support operator overloading. Its behavior is identical to division using the division operator. ## Examples - The following example creates an array of values. It then uses each element as the quotient in a division operation that uses the method, the division operator (/), and the method. + The following example creates an array of values. It then uses each element as the quotient in a division operation that uses the method, the division operator (/), and the method. :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/Divide/Divide1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/Divide/Divide1.fs" id="Snippet1"::: @@ -1770,16 +1770,16 @@ The individual bytes in the `value` array should be in little-endian order, from method or the division operator; if you are only interested in the remainder, use the method. + This method preserves both the quotient and the remainder that results from integer division. If you are not interested in the remainder, use the method or the division operator; if you are only interested in the remainder, use the method. The sign of the returned `remainder` value is the same as the sign of the `dividend` parameter. - The behavior of the method is identical to that of the method. + The behavior of the method is identical to that of the method. ## Examples - The following example creates an array of values. It then uses each element as the quotient in a division operation that uses the method, the division operator (/), and the method. + The following example creates an array of values. It then uses each element as the quotient in a division operation that uses the method, the division operator (/), and the method. :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/Divide/Divide1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/Divide/Divide1.fs" id="Snippet1"::: @@ -1850,12 +1850,12 @@ The individual bytes in the `value` array should be in little-endian order, from ## Remarks If `other` is a , , , , , or value, it is implicitly converted to an value when the method is called. - To determine the relationship between the two objects instead of just testing for equality, call the method. + To determine the relationship between the two objects instead of just testing for equality, call the method. ## Examples - The following example instantiates a object from each integral type except . It then calls the method to compare the value with the original integer value that was passed to the constructor. As the output shows, the values are equal in each case. + The following example instantiates a object from each integral type except . It then calls the method to compare the value with the original integer value that was passed to the constructor. As the output shows, the values are equal in each case. :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/Equals/EqualsExample1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/Equals/EqualsExample1.fs" id="Snippet1"::: @@ -1915,14 +1915,14 @@ The individual bytes in the `value` array should be in little-endian order, from interface and performs slightly better than because it does not have to convert the `other` parameter to a object. + This method implements the interface and performs slightly better than because it does not have to convert the `other` parameter to a object. - To determine the relationship between the two objects instead of just testing for equality, call the method. + To determine the relationship between the two objects instead of just testing for equality, call the method. ## Examples - The following example compares the approximate distance of several stars from Earth with the distance of Epsilon Indi from Earth to determine whether they are equal. The example uses each overload of the method to test for equality. + The following example compares the approximate distance of several stars from Earth with the distance of Epsilon Indi from Earth to determine whether they are equal. The example uses each overload of the method to test for equality. :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/Equals/EqualsExample1.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/Equals/EqualsExample1.fs" id="Snippet2"::: @@ -1989,7 +1989,7 @@ The individual bytes in the `value` array should be in little-endian order, from ## Remarks If the `obj` argument is not a value, the method returns `false`. The method returns `true` only if `obj` is a instance whose value is equal to the current instance. - To determine the relationship between the two objects instead of just testing for equality, call the method. + To determine the relationship between the two objects instead of just testing for equality, call the method. @@ -2057,12 +2057,12 @@ The individual bytes in the `value` array should be in little-endian order, from method. + To determine the relationship between the two objects instead of just testing for equality, call the method. ## Examples - The following example compares the approximate distance of several stars from Earth with the distance of Epsilon Indi from Earth to determine whether they are equal. The example uses each overload of the method to test for equality. + The following example compares the approximate distance of several stars from Earth with the distance of Epsilon Indi from Earth to determine whether they are equal. The example uses each overload of the method to test for equality. :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/Equals/EqualsExample1.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/Equals/EqualsExample1.fs" id="Snippet2"::: @@ -2251,12 +2251,12 @@ This method returns 0 if the value of current object is equal to [!NOTE] > Computing the greatest common divisor of very large values of `left` and `right` can be a very time-consuming operation. - The value returned by the method is always positive (including zero) regardless of the sign of the `left` and `right` parameters. + The value returned by the method is always positive (including zero) regardless of the sign of the `left` and `right` parameters. ## Examples - The following example illustrates a call to the method and the exception handling necessary to provide useful information about an . The result indicates that the greatest common divisor of these two numbers is 1. + The following example illustrates a call to the method and the exception handling necessary to provide useful information about an . The result indicates that the greatest common divisor of these two numbers is 1. :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/GreatestCommonDivisor/BigInteger_Examples.cs" id="Snippet10"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/GreatestCommonDivisor/BigInteger_Examples.fs" id="Snippet10"::: @@ -2319,7 +2319,7 @@ value % 2 == 0; value Mod 2 = 0 ``` - If the value of the current object is , the property returns `true`. + If the value of the current object is , the property returns `true`. ]]> @@ -2368,7 +2368,7 @@ value Mod 2 = 0 This method correctly handles floating-point values and so `2.0` will return `true` while `2.2` will return `false`. -A return value of `false` does not imply that will return `true`. A number with a fractional portion, for example, `3.3`, is not even or odd. +A return value of `false` does not imply that will return `true`. A number with a fractional portion, for example, `3.3`, is not even or odd. ]]> @@ -2416,7 +2416,7 @@ A return value of `false` does not imply that will return `true`. A complex number, `a + bi` for non-zero `b`, is not positive or negative +A return value of `false` does not imply that will return `true`. A complex number, `a + bi` for non-zero `b`, is not positive or negative ]]> @@ -2466,7 +2466,7 @@ A return value of `false` does not imply that will return `true`. A number with a fractional portion, for example, `3.3`, is not even or odd. +A return value of `false` does not imply that will return `true`. A number with a fractional portion, for example, `3.3`, is not even or odd. ]]> @@ -2564,7 +2564,7 @@ A return value of `false` does not imply that will return `true`. A complex number, `a + bi` for non-zero `b`, is not positive or negative +A return value of `false` does not imply that will return `true`. A complex number, `a + bi` for non-zero `b`, is not positive or negative ]]> @@ -2821,15 +2821,15 @@ A return value of `false` does not imply that . | | Negative | . | - To calculate the base 10 logarithm of a value, call the method. To calculate the logarithm of a number in another base, call the method. + To calculate the base 10 logarithm of a value, call the method. To calculate the logarithm of a number in another base, call the method. - You can find the square root of a number by calling the method along with the method. Note that the result is if the result is greater than . The following example calculates the square root of each element in an array of values. + You can find the square root of a number by calling the method along with the method. Note that the result is if the result is greater than . The following example calculates the square root of each element in an array of values. :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/LogMethod/log1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/LogMethod/log1.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Numerics/BigInteger/LogMethod/log1.vb" id="Snippet1"::: - This method corresponds to the method for the primitive numeric types. + This method corresponds to the method for the primitive numeric types. ]]> @@ -2903,9 +2903,9 @@ A return value of `false` does not imply that |0| - To calculate the base 10 logarithm of a value, call the method. To calculate the natural logarithm of a number, call the method. + To calculate the base 10 logarithm of a value, call the method. To calculate the natural logarithm of a number, call the method. - This method corresponds to the method for the primitive numeric types. + This method corresponds to the method for the primitive numeric types. ]]> @@ -2975,9 +2975,9 @@ A return value of `false` does not imply that .| |Negative|.| - To calculate the natural logarithm of a value, call the method. To calculate the logarithm of a number in another base, call the method. + To calculate the natural logarithm of a value, call the method. To calculate the logarithm of a number in another base, call the method. - This method corresponds to the method for the primitive numeric types. + This method corresponds to the method for the primitive numeric types. ]]> @@ -3075,12 +3075,12 @@ A return value of `false` does not imply that method for primitive numeric types. + This method corresponds to the method for primitive numeric types. ## Examples - The following example uses the method to select the largest number in an array of values. + The following example uses the method to select the largest number in an array of values. :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/Max/Max1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/Max/Max1.fs" id="Snippet1"::: @@ -3134,7 +3134,7 @@ A return value of `false` does not imply that this method matches the IEEE 754:2019 `maximumMagnitude` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. +For this method matches the IEEE 754:2019 `maximumMagnitude` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. ]]> @@ -3193,12 +3193,12 @@ For this method matches the IEE method for primitive numeric types. + This method corresponds to the method for primitive numeric types. ## Examples - The following example uses the method to select the smallest number in an array of values. + The following example uses the method to select the smallest number in an array of values. :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/Min/Min1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/Min/Min1.fs" id="Snippet1"::: @@ -3252,7 +3252,7 @@ For this method matches the IEE ## Remarks -For this method matches the IEEE 754:2019 `minimumMagnitude` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. +For this method matches the IEEE 754:2019 `minimumMagnitude` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. ]]> @@ -3365,16 +3365,16 @@ For this method matches the IEE method evaluates the following expression: + The method evaluates the following expression: (baseValue ^ exponent) Mod modulus - To perform exponentiation on values without modulus division, use the method. + To perform exponentiation on values without modulus division, use the method. ## Examples - The following example provides a simple illustration of calling the method. + The following example provides a simple illustration of calling the method. :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/ModPow/ModPow1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/ModPow/ModPow1.fs" id="Snippet1"::: @@ -3443,18 +3443,18 @@ For this method matches the IEE method is implemented for languages that do not support operator overloading. Its behavior is identical to multiplication using the multiplication operator. In addition, the method is a useful substitute for the multiplication operator when instantiating a variable by assigning it a product that results from multiplication, as shown in the following example. + The method is implemented for languages that do not support operator overloading. Its behavior is identical to multiplication using the multiplication operator. In addition, the method is a useful substitute for the multiplication operator when instantiating a variable by assigning it a product that results from multiplication, as shown in the following example. :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/Add/Multiply1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/Add/Multiply1.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Numerics/BigInteger/Add/Multiply1.vb" id="Snippet1"::: - If necessary, this method automatically performs implicit conversion of other integral types to objects. This is illustrated in the example in the next section, where the method is passed two values. + If necessary, this method automatically performs implicit conversion of other integral types to objects. This is illustrated in the example in the next section, where the method is passed two values. ## Examples - The following example tries to perform multiplication with two long integers. Because the result exceeds the range of a long integer, an is thrown, and the method is called to handle the multiplication. Note that C# requires that you use either the `checked` keyword (as in this example) or the `/checked+` compiler option to make sure an exception is thrown on a numeric overflow. + The following example tries to perform multiplication with two long integers. Because the result exceeds the range of a long integer, an is thrown, and the method is called to handle the multiplication. Note that C# requires that you use either the `checked` keyword (as in this example) or the `/checked+` compiler option to make sure an exception is thrown on a numeric overflow. :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/GreatestCommonDivisor/BigInteger_Examples.cs" id="Snippet7"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/GreatestCommonDivisor/BigInteger_Examples.fs" id="Snippet7"::: @@ -3519,7 +3519,7 @@ For this method matches the IEE ## Remarks Negation obtains the additive inverse of a number. The additive inverse of a number is a number that produces a value of zero when it is added to the original number. - The method is implemented for languages that do not support custom operators. Its behavior is identical to negation using the unary negation operator. In addition, the method is a useful substitute for the negation operator when instantiating a variable, as shown in the following example. + The method is implemented for languages that do not support custom operators. Its behavior is identical to negation using the unary negation operator. In addition, the method is a useful substitute for the negation operator when instantiating a variable, as shown in the following example. :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/Add/Multiply1.cs" id="Snippet4"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/Add/Multiply1.fs" id="Snippet4"::: @@ -3651,13 +3651,13 @@ For this method matches the IEE method defines the addition operation for values. It enables code such as the following: + The method defines the addition operation for values. It enables code such as the following: :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/GreatestCommonDivisor/BigInteger_Examples.cs" id="Snippet12"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/GreatestCommonDivisor/BigInteger_Examples.fs" id="Snippet12"::: :::code language="vb" source="~/snippets/visualbasic/System.Numerics/BigInteger/GreatestCommonDivisor/BigInteger_Examples.vb" id="Snippet12"::: - Languages that do not support custom operators can call the method instead. + Languages that do not support custom operators can call the method instead. ]]> @@ -3716,7 +3716,7 @@ For this method matches the IEE method defines the bitwise `And` operation for values. The bitwise `And` operation sets a result bit only if the corresponding bits in `left` and `right` are also set, as shown in the following table. + The method defines the bitwise `And` operation for values. The bitwise `And` operation sets a result bit only if the corresponding bits in `left` and `right` are also set, as shown in the following table. |Bit in `left`|Bit in `right`|Bit in result| |-------------------|--------------------|-------------------| @@ -3725,13 +3725,13 @@ For this method matches the IEE |1|1|1| |0|1|0| - The method enables code such as the following: + The method enables code such as the following: :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.vb" id="Snippet1"::: - The method performs the bitwise `And` operation on two values as if they were both in two's complement representation with virtual sign extension. + The method performs the bitwise `And` operation on two values as if they were both in two's complement representation with virtual sign extension. ]]> @@ -3789,7 +3789,7 @@ For this method matches the IEE method defines the bitwise `Or` operation for values. The bitwise `Or` operation sets a result bit only if either or both of the corresponding bits in `left` and `right` are set, as shown in the following table. + The method defines the bitwise `Or` operation for values. The bitwise `Or` operation sets a result bit only if either or both of the corresponding bits in `left` and `right` are set, as shown in the following table. |Bit in `left`|Bit in `right`|Bit in result| |-------------------|--------------------|-------------------| @@ -3798,13 +3798,13 @@ For this method matches the IEE |1|1|1| |0|1|1| - The method enables code such as the following: + The method enables code such as the following: :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.fs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.vb" id="Snippet2"::: - The method performs the bitwise `Or` operation on two values as if they were both in two's complement representation with virtual sign extension. + The method performs the bitwise `Or` operation on two values as if they were both in two's complement representation with virtual sign extension. ]]> @@ -3860,20 +3860,20 @@ For this method matches the IEE method defines the decrement operation for values. It enables code such as the following: + The method defines the decrement operation for values. It enables code such as the following: :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/GreatestCommonDivisor/BigInteger_Examples.cs" id="Snippet17"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/GreatestCommonDivisor/BigInteger_Examples.fs" id="Snippet17"::: - Languages that do not support custom operators can call the method instead. For example: + Languages that do not support custom operators can call the method instead. For example: :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.cs" id="Snippet3"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.fs" id="Snippet3"::: :::code language="vb" source="~/snippets/visualbasic/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.vb" id="Snippet3"::: - Because objects are immutable, the operator creates a new object whose value is one less than the object represented by `value`. This means that repeated calls to may be expensive. + Because objects are immutable, the operator creates a new object whose value is one less than the object represented by `value`. This means that repeated calls to may be expensive. - The equivalent method for this operator is .]]> + The equivalent method for this operator is .]]> @@ -3930,18 +3930,18 @@ For this method matches the IEE method defines the division operation for values. It enables code such as the following: + The method defines the division operation for values. It enables code such as the following: :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/GreatestCommonDivisor/BigInteger_Examples.cs" id="Snippet13"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/GreatestCommonDivisor/BigInteger_Examples.fs" id="Snippet13"::: :::code language="vb" source="~/snippets/visualbasic/System.Numerics/BigInteger/GreatestCommonDivisor/BigInteger_Examples.vb" id="Snippet13"::: - Languages that do not support custom operators and operator overloading can call the method instead. + Languages that do not support custom operators and operator overloading can call the method instead. - The equivalent method for this operator is + The equivalent method for this operator is ## Examples - The following example creates an array of values. It then uses each element as the quotient in a division operation that uses the method, the division operator (/), and the method. + The following example creates an array of values. It then uses each element as the quotient in a division operation that uses the method, the division operator (/), and the method. :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/Divide/Divide1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/Divide/Divide1.fs" id="Snippet1"::: @@ -4013,17 +4013,17 @@ For this method matches the IEE method defines the equality comparison operation for values. It enables code such as the following: + The method defines the equality comparison operation for values. It enables code such as the following: :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.cs" id="Snippet4"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.fs" id="Snippet4"::: :::code language="vb" source="~/snippets/visualbasic/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.vb" id="Snippet4"::: - Languages that do not support custom operators can call the instance method instead. + Languages that do not support custom operators can call the instance method instead. If `left` is a , , , , , or value, it is implicitly converted to an value when the operation is performed. - The equivalent method for this operator is .]]> + The equivalent method for this operator is .]]> @@ -4077,17 +4077,17 @@ For this method matches the IEE method defines the equality comparison operation for values. It enables code such as the following: + The method defines the equality comparison operation for values. It enables code such as the following: :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.cs" id="Snippet5"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.fs" id="Snippet5"::: :::code language="vb" source="~/snippets/visualbasic/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.vb" id="Snippet5"::: - Languages that do not support custom operators can call the instance method instead. + Languages that do not support custom operators can call the instance method instead. If `right` is a , , , , , or value, it is implicitly converted to an value when the operation is performed. - The equivalent method for this operator is .]]> + The equivalent method for this operator is .]]> @@ -4145,15 +4145,15 @@ For this method matches the IEE method defines the operation of the equality operator for values. It enables code such as the following: + The method defines the operation of the equality operator for values. It enables code such as the following: :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/GreatestCommonDivisor/BigInteger_Examples.cs" id="Snippet19"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/GreatestCommonDivisor/BigInteger_Examples.fs" id="Snippet19"::: :::code language="vb" source="~/snippets/visualbasic/System.Numerics/BigInteger/GreatestCommonDivisor/BigInteger_Examples.vb" id="Snippet19"::: - Languages that do not support custom operators can call the instance method instead. + Languages that do not support custom operators can call the instance method instead. - The equivalent method for this operator is .]]> + The equivalent method for this operator is .]]> @@ -4214,13 +4214,13 @@ For this method matches the IEE method defines the equality comparison operation for values. It enables code such as the following: + The method defines the equality comparison operation for values. It enables code such as the following: :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.cs" id="Snippet6"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.fs" id="Snippet6"::: :::code language="vb" source="~/snippets/visualbasic/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.vb" id="Snippet6"::: - Languages that do not support custom operators can call the instance method instead. + Languages that do not support custom operators can call the instance method instead. ]]> @@ -4282,13 +4282,13 @@ For this method matches the IEE method defines the equality comparison operation for values. It enables code such as the following: + The method defines the equality comparison operation for values. It enables code such as the following: :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.cs" id="Snippet7"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.fs" id="Snippet7"::: :::code language="vb" source="~/snippets/visualbasic/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.vb" id="Snippet7"::: - Languages that do not support custom operators can call the instance method instead. + Languages that do not support custom operators can call the instance method instead. ]]> @@ -4356,13 +4356,13 @@ For this method matches the IEE |1|0|1| |1|1|0| - The method enables code such as the following: + The method enables code such as the following: :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.cs" id="Snippet8"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.fs" id="Snippet8"::: :::code language="vb" source="~/snippets/visualbasic/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.vb" id="Snippet8"::: - The method performs the bitwise exclusive `Or` operation on two values as if they were both in two's complement representation with virtual sign extension. + The method performs the bitwise exclusive `Or` operation on two values as if they were both in two's complement representation with virtual sign extension. ]]> @@ -4428,7 +4428,7 @@ For this method matches the IEE The overloads of the method define the types to which or from which a object can be converted. Because the conversion from to can involve truncating any fractional part of `value`, language compilers do not perform this conversion automatically. Instead, they perform the conversion only if a casting operator (in C#) or a conversion function (such as `CType` in Visual Basic) is used. Otherwise, they display a compiler error. - For languages that do not support custom operators, the alternative method is . + For languages that do not support custom operators, the alternative method is . ## Examples @@ -4492,7 +4492,7 @@ For this method matches the IEE The overloads of the method define the types to which or from which a object can be converted. Because the conversion from to can involve truncating any fractional part of `value`, language compilers do not perform this conversion automatically. Instead, they perform the conversion only if a casting operator (in C#) or a conversion function (such as `CType` in Visual Basic) is used. Otherwise, they display a compiler error. - For languages that do not support custom operators, the alternative method is . + For languages that do not support custom operators, the alternative method is . ## Examples @@ -4787,7 +4787,7 @@ For this method matches the IEE Because the value can be outside the range of the data type, this operation is a narrowing conversion. If the conversion is unsuccessful, it does not throw an . Instead, if the value is less than , the resulting value is . If the value is greater than , the resulting value is . - The conversion of a to a may involve a loss of precision. In some cases, the loss of precision may cause the casting or conversion operation to succeed even if the value is outside the range of the data type. The following example provides an illustration. It assigns the maximum value of a to two variables, increments one variable by 9.999e291, and tests the two variables for equality. As expected, the call to the method shows that they are unequal. However, the conversion of the larger value back to a succeeds, although the value now exceeds . + The conversion of a to a may involve a loss of precision. In some cases, the loss of precision may cause the casting or conversion operation to succeed even if the value is outside the range of the data type. The following example provides an illustration. It assigns the maximum value of a to two variables, increments one variable by 9.999e291, and tests the two variables for equality. As expected, the call to the method shows that they are unequal. However, the conversion of the larger value back to a succeeds, although the value now exceeds . :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/op_Explicit/Explicit1.cs" id="Snippet4"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/op_Explicit/Explicit1.fs" id="Snippet4"::: @@ -5256,7 +5256,7 @@ For this method matches the IEE Because the value can be outside the range of the data type, this operation is a narrowing conversion. If the conversion is unsuccessful, it does not throw an . Instead, if the value is less than , the resulting value is . If the value is greater than , the resulting value is . - The conversion of a to a may involve a loss of precision. In some cases, the loss of precision may cause the casting or conversion operation to succeed even if the value is outside the range of the data type. The following example provides an illustration. It assigns the maximum value of a to two variables, increments one variable by 9.999e291, and tests the two variables for equality. As expected, the call to the method shows that they are unequal. However, the conversion of the larger value back to a succeeds, although the value now exceeds . + The conversion of a to a may involve a loss of precision. In some cases, the loss of precision may cause the casting or conversion operation to succeed even if the value is outside the range of the data type. The following example provides an illustration. It assigns the maximum value of a to two variables, increments one variable by 9.999e291, and tests the two variables for equality. As expected, the call to the method shows that they are unequal. However, the conversion of the larger value back to a succeeds, although the value now exceeds . :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/op_Explicit/Explicit1.cs" id="Snippet5"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/op_Explicit/Explicit1.fs" id="Snippet5"::: @@ -5661,7 +5661,7 @@ For this method matches the IEE The overloads of the method define the types to which or from which a object can be converted. Because the conversion from to can involve truncating any fractional part of `value`, language compilers do not perform this conversion automatically. Instead, they perform the conversion only if a casting operator (in C#) or a conversion function (such as `CType` in Visual Basic) is used. Otherwise, they display a compiler error. - For languages that do not support custom operators, the alternative method is . + For languages that do not support custom operators, the alternative method is . ## Examples @@ -5736,19 +5736,19 @@ For this method matches the IEE method defines the operation of the greater than operator for values. It enables code such as the following: + The method defines the operation of the greater than operator for values. It enables code such as the following: :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.cs" id="Snippet9"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.fs" id="Snippet9"::: :::code language="vb" source="~/snippets/visualbasic/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.vb" id="Snippet9"::: - Languages that do not support custom operators can call the instance method instead. Some languages can also call the method directly, as the following example shows. + Languages that do not support custom operators can call the instance method instead. Some languages can also call the method directly, as the following example shows. :::code language="vb" source="~/snippets/visualbasic/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.vb" id="Snippet10"::: If `left` is a , , , , , or value, it is implicitly converted to an value when the operation is performed. - The equivalent method for this operator is .]]> + The equivalent method for this operator is .]]> @@ -5802,19 +5802,19 @@ For this method matches the IEE method defines the operation of the greater than operator for values. It enables code such as the following: + The method defines the operation of the greater than operator for values. It enables code such as the following: :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.cs" id="Snippet11"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.fs" id="Snippet11"::: :::code language="vb" source="~/snippets/visualbasic/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.vb" id="Snippet11"::: - Languages that do not support custom operators can call the method instead. Some languages can also call the method directly, as the following example shows. + Languages that do not support custom operators can call the method instead. Some languages can also call the method directly, as the following example shows. :::code language="vb" source="~/snippets/visualbasic/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.vb" id="Snippet12"::: If `right` is a , , , , , or value, it is implicitly converted to an value when the operation is performed. - The equivalent method for this operator is .]]> + The equivalent method for this operator is .]]> @@ -5872,13 +5872,13 @@ For this method matches the IEE method defines the operation of the greater than operator for values. It enables code such as the following: + The method defines the operation of the greater than operator for values. It enables code such as the following: :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/GreatestCommonDivisor/BigInteger_Examples.cs" id="Snippet20"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/GreatestCommonDivisor/BigInteger_Examples.fs" id="Snippet20"::: :::code language="vb" source="~/snippets/visualbasic/System.Numerics/BigInteger/GreatestCommonDivisor/BigInteger_Examples.vb" id="Snippet20"::: - Languages that do not support custom operators can call the method instead. They can also call the method directly, as the following example shows. + Languages that do not support custom operators can call the method instead. They can also call the method directly, as the following example shows. :::code language="vb" source="~/snippets/visualbasic/System.Numerics/BigInteger/GreatestCommonDivisor/BigInteger_Examples.vb" id="Snippet21"::: @@ -5942,13 +5942,13 @@ For this method matches the IEE method defines the operation of the greater than operator for values. It enables code such as the following: + The method defines the operation of the greater than operator for values. It enables code such as the following: :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.cs" id="Snippet13"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.fs" id="Snippet13"::: :::code language="vb" source="~/snippets/visualbasic/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.vb" id="Snippet13"::: - Languages that do not support custom operators can call the method instead. Some languages can also call the method directly, as the following example shows. + Languages that do not support custom operators can call the method instead. Some languages can also call the method directly, as the following example shows. :::code language="vb" source="~/snippets/visualbasic/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.vb" id="Snippet14"::: @@ -6011,13 +6011,13 @@ For this method matches the IEE method defines the operation of the greater than operator for values. It enables code such as the following: + The method defines the operation of the greater than operator for values. It enables code such as the following: :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.cs" id="Snippet15"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.fs" id="Snippet15"::: :::code language="vb" source="~/snippets/visualbasic/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.vb" id="Snippet15"::: - Languages that do not support custom operators can call the method instead. Some languages can also call the method directly, as the following example shows. + Languages that do not support custom operators can call the method instead. Some languages can also call the method directly, as the following example shows. :::code language="vb" source="~/snippets/visualbasic/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.vb" id="Snippet16"::: @@ -6085,19 +6085,19 @@ For this method matches the IEE method defines the operation of the greater than or equal to operator for values. It enables code such as the following: + The method defines the operation of the greater than or equal to operator for values. It enables code such as the following: :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.cs" id="Snippet17"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.fs" id="Snippet17"::: :::code language="vb" source="~/snippets/visualbasic/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.vb" id="Snippet17"::: - Languages that do not support custom operators can call the method instead. Some languages can also call the method directly, as the following example shows. + Languages that do not support custom operators can call the method instead. Some languages can also call the method directly, as the following example shows. :::code language="vb" source="~/snippets/visualbasic/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.vb" id="Snippet18"::: If `left` is a , , , , , or value, it is implicitly converted to an value when the operation is performed. - The equivalent method for this operator is .]]> + The equivalent method for this operator is .]]> @@ -6151,19 +6151,19 @@ For this method matches the IEE method defines the operation of the greater than or equal to operator for values. It enables code such as the following: + The method defines the operation of the greater than or equal to operator for values. It enables code such as the following: :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.cs" id="Snippet19"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.fs" id="Snippet19"::: :::code language="vb" source="~/snippets/visualbasic/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.vb" id="Snippet19"::: - Languages that do not support custom operators can call the method instead. Some languages can also call the method directly, as the following example shows. + Languages that do not support custom operators can call the method instead. Some languages can also call the method directly, as the following example shows. :::code language="vb" source="~/snippets/visualbasic/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.vb" id="Snippet20"::: If `right` is a , , , , , or value, it is implicitly converted to an value when the operation is performed. - The equivalent method for this operator is .]]> + The equivalent method for this operator is .]]> @@ -6221,13 +6221,13 @@ For this method matches the IEE method defines the operation of the greater than or equal to operator for values. It enables code such as the following: + The method defines the operation of the greater than or equal to operator for values. It enables code such as the following: :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/GreatestCommonDivisor/BigInteger_Examples.cs" id="Snippet22"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/GreatestCommonDivisor/BigInteger_Examples.fs" id="Snippet22"::: :::code language="vb" source="~/snippets/visualbasic/System.Numerics/BigInteger/GreatestCommonDivisor/BigInteger_Examples.vb" id="Snippet22"::: - Languages that do not support custom operators can call the method instead. Some languages can also call the method directly, as the following example shows. + Languages that do not support custom operators can call the method instead. Some languages can also call the method directly, as the following example shows. :::code language="vb" source="~/snippets/visualbasic/System.Numerics/BigInteger/GreatestCommonDivisor/BigInteger_Examples.vb" id="Snippet23"::: @@ -6291,17 +6291,17 @@ For this method matches the IEE method defines the operation of the greater than or equal to operator for values. It enables code such as the following: + The method defines the operation of the greater than or equal to operator for values. It enables code such as the following: :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.cs" id="Snippet21"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.fs" id="Snippet21"::: :::code language="vb" source="~/snippets/visualbasic/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.vb" id="Snippet21"::: - Languages that do not support custom operators can call the method instead. Some languages can also call the method directly, as the following example shows. + Languages that do not support custom operators can call the method instead. Some languages can also call the method directly, as the following example shows. :::code language="vb" source="~/snippets/visualbasic/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.vb" id="Snippet22"::: - The equivalent method for this operator is .]]> + The equivalent method for this operator is .]]> @@ -6361,17 +6361,17 @@ For this method matches the IEE method defines the operation of the greater than or equal to operator for values. It enables code such as the following: + The method defines the operation of the greater than or equal to operator for values. It enables code such as the following: :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.cs" id="Snippet23"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.fs" id="Snippet23"::: :::code language="vb" source="~/snippets/visualbasic/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.vb" id="Snippet23"::: - Languages that do not support custom operators can call the method instead. Some languages can also call the method directly, as the following example shows. + Languages that do not support custom operators can call the method instead. Some languages can also call the method directly, as the following example shows. :::code language="vb" source="~/snippets/visualbasic/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.vb" id="Snippet24"::: - The equivalent method for this operator is .]]> + The equivalent method for this operator is .]]> @@ -6434,7 +6434,7 @@ For this method matches the IEE ## Remarks Any fractional part of the `value` parameter is truncated before conversion. - For languages that do not support implicit operators, the alternative method is . + For languages that do not support implicit operators, the alternative method is . The overloads of the method define the types to which or from which a compiler can automatically convert a value without an explicit casting operator (in C#) or a call to a conversion function (in Visual Basic). They are widening conversions that do not involve data loss and do not throw an . This overload lets the compiler handle conversions from a value to a value, as the following example shows. @@ -6564,7 +6564,7 @@ For this method matches the IEE . + For languages that do not support implicit operators, the alternative method is . The overloads of the method define the types to which or from which a compiler can automatically convert a value without an explicit casting operator (in C#) or a call to a conversion function (in Visual Basic). They are widening conversions that do not involve data loss and do not throw an . This overload lets the compiler handle conversions from a value to a value, as the following example shows. @@ -6622,7 +6622,7 @@ For this method matches the IEE . + For languages that do not support implicit operators, the alternative method is . The overloads of the method define the types to which or from which a compiler can automatically convert a value without an explicit casting operator (in C#) or a call to a conversion function (in Visual Basic). They are widening conversions that do not involve data loss and do not throw an . This overload lets the compiler handle conversions from a value to a value, as the following example shows. @@ -6680,7 +6680,7 @@ For this method matches the IEE . + For languages that do not support implicit operators, the alternative method is . The overloads of the method define the types to which or from which a compiler can automatically convert a value without an explicit casting operator (in C#) or a call to a conversion function (in Visual Basic). They are widening conversions that do not involve data loss and do not throw an . This overload lets the compiler handle conversions from a value to a value, as the following example shows. @@ -6782,7 +6782,7 @@ For this method matches the IEE . + For languages that do not support implicit operators, the alternative method is . The overloads of the method define the types to which or from which a compiler can automatically convert a value without an explicit casting operator (in C#) or a call to a conversion function (in Visual Basic). They are widening conversions that do not involve data loss and do not throw an . This overload lets the compiler handle conversions from a value to a value, as the following example shows. @@ -6891,7 +6891,7 @@ For this method matches the IEE . + For languages that do not support implicit operators, the alternative method is . The overloads of the method define the types to which or from which a compiler can automatically convert a value without an explicit casting operator (in C#) or a call to a conversion function (in Visual Basic). They are widening conversions that do not involve data loss and do not throw an . This overload lets the compiler handle conversions from a value to a value, as the following example shows. @@ -6958,7 +6958,7 @@ For this method matches the IEE . + For languages that do not support implicit operators, the alternative method is . The overloads of the method define the types to which or from which a compiler can automatically convert a value without an explicit casting operator (in C#) or a call to a conversion function (in Visual Basic). They are widening conversions that do not involve data loss and do not throw an . This overload lets the compiler handle conversions from a value to a value, as the following example shows. @@ -7025,7 +7025,7 @@ For this method matches the IEE . + For languages that do not support implicit operators, the alternative method is . The overloads of the method define the types to which or from which a compiler can automatically convert a value without an explicit casting operator (in C#) or a call to a conversion function (in Visual Basic). They are widening conversions that do not involve data loss and do not throw an . This overload lets the compiler handle conversions from a value to a value, as the following example shows. @@ -7130,18 +7130,18 @@ For this method matches the IEE method defines the increment operation for values. It enables code such as the following: + The method defines the increment operation for values. It enables code such as the following: :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/GreatestCommonDivisor/BigInteger_Examples.cs" id="Snippet24"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/GreatestCommonDivisor/BigInteger_Examples.fs" id="Snippet24"::: - Some languages (such as Visual Basic) that lack an increment operator or do not support operator overloading can call the method directly, as the following example shows. + Some languages (such as Visual Basic) that lack an increment operator or do not support operator overloading can call the method directly, as the following example shows. :::code language="vb" source="~/snippets/visualbasic/System.Numerics/BigInteger/GreatestCommonDivisor/BigInteger_Examples.vb" id="Snippet25"::: - Because objects are immutable, the operator creates a new object whose value is one more than the object represented by `value`. Therefore, repeated calls to may be expensive. + Because objects are immutable, the operator creates a new object whose value is one more than the object represented by `value`. Therefore, repeated calls to may be expensive. - The equivalent method for this operator is .]]> + The equivalent method for this operator is .]]> @@ -7205,7 +7205,7 @@ For this method matches the IEE method defines the operation of the inequality operator for values. It enables code such as the following: + The method defines the operation of the inequality operator for values. It enables code such as the following: :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.cs" id="Snippet25"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.fs" id="Snippet25"::: @@ -7213,9 +7213,9 @@ For this method matches the IEE Languages that do not support custom operators can test for inequality by using one of the following techniques: -- Calling the instance method, which indicates the relationship between a and a signed long integer value. +- Calling the instance method, which indicates the relationship between a and a signed long integer value. -- Calling the instance method and reversing its value. +- Calling the instance method and reversing its value. If `left` is a , , , , , or value, it is implicitly converted to an value when the operation is performed. @@ -7273,7 +7273,7 @@ For this method matches the IEE method defines the operation of the inequality operator for values. It enables code such as the following: + The method defines the operation of the inequality operator for values. It enables code such as the following: :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.cs" id="Snippet26"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.fs" id="Snippet26"::: @@ -7281,13 +7281,13 @@ For this method matches the IEE Languages that do not support custom operators can test for inequality by using one of the following techniques: -- Calling the method, which indicates the relationship between a and a signed long integer value. +- Calling the method, which indicates the relationship between a and a signed long integer value. -- Calling the method and reversing its value. +- Calling the method and reversing its value. If `right` is a , , , , , or value, it is implicitly converted to an value when the operation is performed. - The equivalent method for this operator is .]]> + The equivalent method for this operator is .]]> @@ -7345,7 +7345,7 @@ For this method matches the IEE method defines the operation of the inequality operator for values. It enables code such as the following: + The method defines the operation of the inequality operator for values. It enables code such as the following: :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/GreatestCommonDivisor/BigInteger_Examples.cs" id="Snippet26"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/GreatestCommonDivisor/BigInteger_Examples.fs" id="Snippet26"::: @@ -7353,11 +7353,11 @@ For this method matches the IEE Languages that do not support custom operators can test for inequality by using one of the following techniques: -- Calling the method, which indicates the relationship between two objects. +- Calling the method, which indicates the relationship between two objects. -- Calling the method and reversing its value. +- Calling the method and reversing its value. - The equivalent method for this operator is .]]> + The equivalent method for this operator is .]]> @@ -7417,7 +7417,7 @@ For this method matches the IEE method defines the operation of the inequality operator for values. It enables code such as the following: + The method defines the operation of the inequality operator for values. It enables code such as the following: :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.cs" id="Snippet27"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.fs" id="Snippet27"::: @@ -7425,9 +7425,9 @@ For this method matches the IEE Languages that do not support custom operators can test for inequality by using one of the following techniques: -- Calling the method, which indicates the relationship between a and an unsigned long integer value. +- Calling the method, which indicates the relationship between a and an unsigned long integer value. -- Calling the method and reversing its value. +- Calling the method and reversing its value. ]]> @@ -7489,7 +7489,7 @@ For this method matches the IEE method defines the operation of the inequality operator for values. It enables code such as the following: + The method defines the operation of the inequality operator for values. It enables code such as the following: :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.cs" id="Snippet28"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.fs" id="Snippet28"::: @@ -7497,9 +7497,9 @@ For this method matches the IEE Languages that do not support custom operators can test for inequality by using one of the following techniques: -- Calling the method, which indicates the relationship between a and an unsigned long integer value. +- Calling the method, which indicates the relationship between a and an unsigned long integer value. -- Calling the method and reversing its value. +- Calling the method and reversing its value. ]]> @@ -7558,14 +7558,14 @@ For this method matches the IEE method defines the operation of the bitwise left-shift operator for values. It enables code such as the following: + The method defines the operation of the bitwise left-shift operator for values. It enables code such as the following: :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.cs" id="Snippet29"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.fs" id="Snippet29"::: :::code language="vb" source="~/snippets/visualbasic/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.vb" id="Snippet29"::: > [!NOTE] -> Unlike the bitwise left-shift operation with integer primitives, the method preserves the sign of the original value. +> Unlike the bitwise left-shift operation with integer primitives, the method preserves the sign of the original value. Languages that do not support custom operators can perform a bitwise left-shift operation by multiplying `value` by `BigInteger.Pow(2, shift)`. The following example shows that the results are identical to the results of using this operator. @@ -7637,19 +7637,19 @@ For this method matches the IEE method defines the operation of the less than operator for values. It enables code such as the following: + The method defines the operation of the less than operator for values. It enables code such as the following: :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.cs" id="Snippet31"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.fs" id="Snippet31"::: :::code language="vb" source="~/snippets/visualbasic/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.vb" id="Snippet31"::: - Languages that do not support custom operators can call the method instead. Some languages can also call the method directly, as the following example shows. + Languages that do not support custom operators can call the method instead. Some languages can also call the method directly, as the following example shows. :::code language="vb" source="~/snippets/visualbasic/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.vb" id="Snippet32"::: If `left` is a , , , , , or value, it is implicitly converted to an value when the operation is performed. - The equivalent method for this operator is .]]> + The equivalent method for this operator is .]]> @@ -7703,19 +7703,19 @@ For this method matches the IEE method defines the operation of the less than operator for values. It enables code such as the following: + The method defines the operation of the less than operator for values. It enables code such as the following: :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.cs" id="Snippet33"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.fs" id="Snippet33"::: :::code language="vb" source="~/snippets/visualbasic/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.vb" id="Snippet33"::: - Languages that do not support custom operators can call the method instead. Some languages can also call the method directly, as the following example shows. + Languages that do not support custom operators can call the method instead. Some languages can also call the method directly, as the following example shows. :::code language="vb" source="~/snippets/visualbasic/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.vb" id="Snippet34"::: If `right` is a , , , , , or value, it is implicitly converted to an value when the operation is performed. - The equivalent method for this operator is .]]> + The equivalent method for this operator is .]]> @@ -7773,17 +7773,17 @@ For this method matches the IEE method defines the operation of the less than operator for values. It enables code such as the following: + The method defines the operation of the less than operator for values. It enables code such as the following: :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/GreatestCommonDivisor/BigInteger_Examples.cs" id="Snippet27"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/GreatestCommonDivisor/BigInteger_Examples.fs" id="Snippet27"::: :::code language="vb" source="~/snippets/visualbasic/System.Numerics/BigInteger/GreatestCommonDivisor/BigInteger_Examples.vb" id="Snippet27"::: - Languages that do not support custom operators can call the method instead. Some languages can also call the method directly, as the following example shows. + Languages that do not support custom operators can call the method instead. Some languages can also call the method directly, as the following example shows. :::code language="vb" source="~/snippets/visualbasic/System.Numerics/BigInteger/GreatestCommonDivisor/BigInteger_Examples.vb" id="Snippet28"::: - The equivalent method for this operator is .]]> + The equivalent method for this operator is .]]> @@ -7843,17 +7843,17 @@ For this method matches the IEE method defines the operation of the less than operator for values. It enables code such as the following: + The method defines the operation of the less than operator for values. It enables code such as the following: :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.cs" id="Snippet35"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.fs" id="Snippet35"::: :::code language="vb" source="~/snippets/visualbasic/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.vb" id="Snippet35"::: - Languages that do not support custom operators can call the method instead. They can also call the method directly, as the following example shows. + Languages that do not support custom operators can call the method instead. They can also call the method directly, as the following example shows. :::code language="vb" source="~/snippets/visualbasic/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.vb" id="Snippet36"::: - The equivalent method for this operator is .]]> + The equivalent method for this operator is .]]> @@ -7913,17 +7913,17 @@ For this method matches the IEE method defines the operation of the less than operator for values. It enables code such as the following: + The method defines the operation of the less than operator for values. It enables code such as the following: :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.cs" id="Snippet37"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.fs" id="Snippet37"::: :::code language="vb" source="~/snippets/visualbasic/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.vb" id="Snippet37"::: - Languages that do not support custom operators can call the method instead. They can also call the method directly, as the following example shows. + Languages that do not support custom operators can call the method instead. They can also call the method directly, as the following example shows. :::code language="vb" source="~/snippets/visualbasic/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.vb" id="Snippet38"::: - The equivalent method for this operator is .]]> + The equivalent method for this operator is .]]> @@ -7987,19 +7987,19 @@ For this method matches the IEE method defines the operation of the less than or equal to operator for values. It enables code such as the following: + The method defines the operation of the less than or equal to operator for values. It enables code such as the following: :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.cs" id="Snippet39"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.fs" id="Snippet39"::: :::code language="vb" source="~/snippets/visualbasic/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.vb" id="Snippet39"::: - Languages that do not support custom operators can call the method instead. They can also call the method directly, as the following example shows. + Languages that do not support custom operators can call the method instead. They can also call the method directly, as the following example shows. :::code language="vb" source="~/snippets/visualbasic/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.vb" id="Snippet40"::: If `left` is a , , , , , or value, it is implicitly converted to an value when the operation is performed. - The equivalent method for this operator is .]]> + The equivalent method for this operator is .]]> @@ -8053,19 +8053,19 @@ For this method matches the IEE method defines the operation of the less than or equal to operator for values. It enables code such as the following: + The method defines the operation of the less than or equal to operator for values. It enables code such as the following: :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.cs" id="Snippet41"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.fs" id="Snippet41"::: :::code language="vb" source="~/snippets/visualbasic/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.vb" id="Snippet41"::: - Languages that do not support custom operators can call the method instead. They can also call the method directly, as the following example shows. + Languages that do not support custom operators can call the method instead. They can also call the method directly, as the following example shows. :::code language="vb" source="~/snippets/visualbasic/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.vb" id="Snippet42"::: If `right` is a , , , , , or value, it is implicitly converted to an value when the operation is performed. - The equivalent method for this operator is .]]> + The equivalent method for this operator is .]]> @@ -8123,17 +8123,17 @@ For this method matches the IEE method defines the operation of the less than or equal to operator for values. It enables code such as the following: + The method defines the operation of the less than or equal to operator for values. It enables code such as the following: :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/GreatestCommonDivisor/BigInteger_Examples.cs" id="Snippet29"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/GreatestCommonDivisor/BigInteger_Examples.fs" id="Snippet29"::: :::code language="vb" source="~/snippets/visualbasic/System.Numerics/BigInteger/GreatestCommonDivisor/BigInteger_Examples.vb" id="Snippet29"::: - Languages that do not support custom operators can call the method instead. They can also call the method directly, as the following example shows. + Languages that do not support custom operators can call the method instead. They can also call the method directly, as the following example shows. :::code language="vb" source="~/snippets/visualbasic/System.Numerics/BigInteger/GreatestCommonDivisor/BigInteger_Examples.vb" id="Snippet30"::: - The equivalent method for this operator is .]]> + The equivalent method for this operator is .]]> @@ -8193,17 +8193,17 @@ For this method matches the IEE method defines the operation of the less than or equal to operator for values. It enables code such as the following: + The method defines the operation of the less than or equal to operator for values. It enables code such as the following: :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.cs" id="Snippet43"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.fs" id="Snippet43"::: :::code language="vb" source="~/snippets/visualbasic/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.vb" id="Snippet43"::: - Languages that do not support custom operators can call the method instead. They can also call the method directly, as the following example shows. + Languages that do not support custom operators can call the method instead. They can also call the method directly, as the following example shows. :::code language="vb" source="~/snippets/visualbasic/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.vb" id="Snippet44"::: - The equivalent method for this operator is .]]> + The equivalent method for this operator is .]]> @@ -8263,17 +8263,17 @@ For this method matches the IEE method defines the operation of the less than or equal to operator for values. It enables code such as the following: + The method defines the operation of the less than or equal to operator for values. It enables code such as the following: :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.cs" id="Snippet45"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.fs" id="Snippet45"::: :::code language="vb" source="~/snippets/visualbasic/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.vb" id="Snippet45"::: - Languages that do not support custom operators can call the method instead. They can also call the method directly, as the following example shows. + Languages that do not support custom operators can call the method instead. They can also call the method directly, as the following example shows. :::code language="vb" source="~/snippets/visualbasic/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.vb" id="Snippet46"::: - The equivalent method for this operator is .]]> + The equivalent method for this operator is .]]> @@ -8330,17 +8330,17 @@ For this method matches the IEE method defines the operation of the modulus operator for values. It enables code such as the following: + The method defines the operation of the modulus operator for values. It enables code such as the following: :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/GreatestCommonDivisor/BigInteger_Examples.cs" id="Snippet31"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/GreatestCommonDivisor/BigInteger_Examples.fs" id="Snippet31"::: :::code language="vb" source="~/snippets/visualbasic/System.Numerics/BigInteger/GreatestCommonDivisor/BigInteger_Examples.vb" id="Snippet31"::: - Languages that do not support custom operators can call the method instead. + Languages that do not support custom operators can call the method instead. The sign of the value returned by the modulus operation depends on the sign of `dividend`: If `dividend` is positive, the modulus operation returns a positive result; if it is negative, the modulus operation returns a negative result. The behavior of the modulus operation with values is identical to the modulus operation with other integral types. - The equivalent method for this operator is .]]> + The equivalent method for this operator is .]]> is 0 (zero). @@ -8400,7 +8400,7 @@ For this method matches the IEE method defines the operation of the multiplication operator for values. It enables code such as the following: + The method defines the operation of the multiplication operator for values. It enables code such as the following: :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/GreatestCommonDivisor/BigInteger_Examples.cs" id="Snippet11"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/GreatestCommonDivisor/BigInteger_Examples.fs" id="Snippet11"::: @@ -8461,13 +8461,13 @@ For this method matches the IEE method defines the operation of the bitwise one's complement operator for values. The bitwise one's complement operator reverses each bit in a numeric value. That is, bits in `value` that are 0 are set to 1 in the result, and bits that are 1 are set to 0 in the result. The method enables code such as the following: + The method defines the operation of the bitwise one's complement operator for values. The bitwise one's complement operator reverses each bit in a numeric value. That is, bits in `value` that are 0 are set to 1 in the result, and bits that are 1 are set to 0 in the result. The method enables code such as the following: :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/op_OnesComplement/OnesComplement1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/op_OnesComplement/OnesComplement1.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Numerics/BigInteger/op_OnesComplement/OnesComplement1.vb" id="Snippet1"::: - Languages that do not support custom operators may be able to call the method directly to perform a bitwise one's complement operation. For example: + Languages that do not support custom operators may be able to call the method directly to perform a bitwise one's complement operation. For example: :::code language="vb" source="~/snippets/visualbasic/System.Numerics/BigInteger/op_OnesComplement/onescomplement2.vb" id="Snippet2"::: @@ -8527,7 +8527,7 @@ For this method matches the IEE method defines the operation of the bitwise right-shift operator for values. It enables code such as the following: + The method defines the operation of the bitwise right-shift operator for values. It enables code such as the following: :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/op_BitwiseAnd/RightShift1.cs" id="Snippet47"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/op_BitwiseAnd/RightShift1.fs" id="Snippet47"::: @@ -8539,7 +8539,7 @@ For this method matches the IEE :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/op_BitwiseAnd/RightShift1.fs" id="Snippet48"::: :::code language="vb" source="~/snippets/visualbasic/System.Numerics/BigInteger/op_BitwiseAnd/Operator1.vb" id="Snippet48"::: - If `shift` is greater than or equal to the number of bits in a positive value, the result of the right-shift operation is . If `shift` is greater than the number of bits in a negative value, the result of the right-shift operation is . + If `shift` is greater than or equal to the number of bits in a positive value, the result of the right-shift operation is . If `shift` is greater than the number of bits in a negative value, the result of the right-shift operation is . ]]> @@ -8598,15 +8598,15 @@ For this method matches the IEE method defines the operation of the subtraction operator for values. It enables code such as the following: + The method defines the operation of the subtraction operator for values. It enables code such as the following: :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/GreatestCommonDivisor/BigInteger_Examples.cs" id="Snippet14"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/GreatestCommonDivisor/BigInteger_Examples.fs" id="Snippet14"::: :::code language="vb" source="~/snippets/visualbasic/System.Numerics/BigInteger/GreatestCommonDivisor/BigInteger_Examples.vb" id="Snippet14"::: - Languages that do not support custom operators can call the method instead. + Languages that do not support custom operators can call the method instead. - The equivalent method for this operator is .]]> + The equivalent method for this operator is .]]> @@ -8661,9 +8661,9 @@ For this method matches the IEE method defines the operation of the unary negation operator (or the additive inverse operator) for values. The operation produces a value that results in 0 (zero) when it is added to the original number. Languages that do not support custom operators can call the method instead. + The method defines the operation of the unary negation operator (or the additive inverse operator) for values. The operation produces a value that results in 0 (zero) when it is added to the original number. Languages that do not support custom operators can call the method instead. - The equivalent method for this operator is + The equivalent method for this operator is ## Examples The following example illustrates three different ways to negate the value of a object. @@ -8726,7 +8726,7 @@ For this method matches the IEE method defines the operation of the unary positive operator for values. + The method defines the operation of the unary positive operator for values. ]]> @@ -8846,21 +8846,21 @@ This operation performs an unsigned (otherwise known as a logical) right shift o |Element|Description| |-------------|-----------------| |*ws*|Optional white space.| -|*sign*|An optional sign. Valid sign characters are determined by the and properties of the current culture.| +|*sign*|An optional sign. Valid sign characters are determined by the and properties of the current culture.| |*digits*|A sequence of digits ranging from 0 to 9. Any leading zeros are ignored.| > [!NOTE] > The string specified by the `value` parameter is interpreted by using the style. It cannot contain any group separators or decimal separator, and it cannot have a decimal portion. - The `value` parameter is parsed by using the formatting information in a object that is initialized for the current system culture. For more information, see . To parse a string by using the formatting information of a specific culture, use the method. + The `value` parameter is parsed by using the formatting information in a object that is initialized for the current system culture. For more information, see . To parse a string by using the formatting information of a specific culture, use the method. > [!IMPORTANT] -> If you use the method to round-trip the string representation of a value that was output by the method, you should use the method with the "R" format specifier to generate the string representation of the value. Otherwise, the string representation of the preserves only the 50 most significant digits of the original value, and data may be lost when you use the method to restore the value. +> If you use the method to round-trip the string representation of a value that was output by the method, you should use the method with the "R" format specifier to generate the string representation of the value. Otherwise, the string representation of the preserves only the 50 most significant digits of the original value, and data may be lost when you use the method to restore the value. ## Examples - The following example uses the method to instantiate two objects. It multiplies each object by another number and then calls the method to determine the relationship between the two values. + The following example uses the method to instantiate two objects. It multiplies each object by another number and then calls the method to determine the relationship between the two values. :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/Parse/Parse1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/Parse/Parse1.fs" id="Snippet1"::: @@ -9029,7 +9029,7 @@ This operation performs an unsigned (otherwise known as a logical) right shift o |Element|Description| |-------------|-----------------| |*ws*|Optional white space. White space can appear at the start of `value` if `style` includes the flag, and it can appear at the end of `value` if `style` includes the flag.| -|*$*|A culture-specific currency symbol. Its position in the string is defined by the and properties of the current culture. The current culture's currency symbol can appear in `value` if `style` includes the flag.| +|*$*|A culture-specific currency symbol. Its position in the string is defined by the and properties of the current culture. The current culture's currency symbol can appear in `value` if `style` includes the flag.| |*sign*|An optional sign. The sign can appear at the start of `value` if `style` includes the flag, and it can appear at the end of `value` if `style` includes the flag. Parentheses can be used in `value` to indicate a negative value if `style` includes the flag.| |*digits*

*fractional_digits*

*exponential_digits*|A sequence of digits from 0 through 9. For *fractional_digits*, only the digit 0 is valid.| |*,*|A culture-specific group separator symbol. The current culture's group separator can appear in `value` if `style` includes the flag.| @@ -9060,25 +9060,25 @@ This operation performs an unsigned (otherwise known as a logical) right shift o ||All elements. However, `value` cannot represent a hexadecimal number.| > [!IMPORTANT] -> If you use the method to round-trip the string representation of a value that was output by the method, you should use the method with the "R" format specifier to generate the string representation of the value. Otherwise, the string representation of the preserves only the 50 most significant digits of the original value, and data may be lost when you use the method to restore the value. +> If you use the method to round-trip the string representation of a value that was output by the method, you should use the method with the "R" format specifier to generate the string representation of the value. Otherwise, the string representation of the preserves only the 50 most significant digits of the original value, and data may be lost when you use the method to restore the value. Unlike the other values, which allow for, but do not require, the presence of particular style elements in `value`, the style value means that the individual numeric characters in `value` are always interpreted as hexadecimal characters. Valid hexadecimal characters are 0-9, A-F, and a-f. The only other flags that can be combined with the `style` parameter are and . (The enumeration includes a composite number style, , that includes both white-space flags.) > [!NOTE] > If `value` is the string representation of a hexadecimal number, it cannot be preceded by any decoration (such as `0x` or `&h`) that differentiates it as a hexadecimal number. This causes the conversion to fail. - If `value` is a hexadecimal string, the method interprets `value` as a negative number stored by using two's complement representation if its first two hexadecimal digits are greater than or equal to `0x80`. In other words, the method interprets the highest-order bit of the first byte in `value` as the sign bit. To make sure that a hexadecimal string is correctly interpreted as a positive number, the first digit in `value` must have a value of zero. For example, the method interprets `0x80` as a negative value, but it interprets either `0x080` or `0x0080` as a positive value. The following example illustrates the difference between hexadecimal strings that represent negative and positive values. + If `value` is a hexadecimal string, the method interprets `value` as a negative number stored by using two's complement representation if its first two hexadecimal digits are greater than or equal to `0x80`. In other words, the method interprets the highest-order bit of the first byte in `value` as the sign bit. To make sure that a hexadecimal string is correctly interpreted as a positive number, the first digit in `value` must have a value of zero. For example, the method interprets `0x80` as a negative value, but it interprets either `0x080` or `0x0080` as a positive value. The following example illustrates the difference between hexadecimal strings that represent negative and positive values. :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/Parse/ParseHex1.cs" id="Snippet3"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/Parse/ParseHex1.fs" id="Snippet3"::: :::code language="vb" source="~/snippets/visualbasic/System.Numerics/BigInteger/Parse/ParseHex1.vb" id="Snippet3"::: - The `value` parameter is parsed by using the formatting information in a object that is initialized for the current system culture. To specify the culture whose formatting information is used for the parse operation, call the overload. + The `value` parameter is parsed by using the formatting information in a object that is initialized for the current system culture. To specify the culture whose formatting information is used for the parse operation, call the overload. ## Examples - The following example illustrates calls to the method with several possible values for the `style` parameter. It illustrates how to interpret a string as a hexadecimal value, and how to disallow spaces and sign symbols. + The following example illustrates calls to the method with several possible values for the `style` parameter. It illustrates how to interpret a string as a hexadecimal value, and how to disallow spaces and sign symbols. :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/Parse/System.Numeric.BigInteger.Parse.cs" id="Snippet5"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/Parse/System.Numeric.BigInteger.Parse.fs" id="Snippet5"::: @@ -9168,31 +9168,31 @@ This operation performs an unsigned (otherwise known as a logical) right shift o |Element|Description| |-------------|-----------------| |*ws*|Optional white space.| -|*sign*|An optional sign. Valid sign characters are determined by the and properties of the object that is returned by the `provider` object's method.| +|*sign*|An optional sign. Valid sign characters are determined by the and properties of the object that is returned by the `provider` object's method.| |*digits*|A sequence of digits ranging from 0 to 9. Any leading zeros are ignored.| > [!NOTE] > The string specified by the `value` parameter is interpreted using the style. It cannot contain any group separators or decimal separator, and it cannot have a decimal portion. > [!IMPORTANT] -> If you use the method to round-trip the string representation of a value that was output by the method, you should use the method with the "R" format specifier to generate the string representation of the value. Otherwise, the string representation of the preserves only the 50 most significant digits of the original value, and data may be lost when you use the method to restore the value. +> If you use the method to round-trip the string representation of a value that was output by the method, you should use the method with the "R" format specifier to generate the string representation of the value. Otherwise, the string representation of the preserves only the 50 most significant digits of the original value, and data may be lost when you use the method to restore the value. - The `provider` parameter is an implementation whose method returns a object that provides culture-specific formatting information. When the method is invoked, it calls the `provider` parameter's method and passes it a object that represents the type. The method then returns the object that provides information about the format of the `value` parameter. There are three ways to use the `provider` parameter to supply custom formatting information to the parse operation: + The `provider` parameter is an implementation whose method returns a object that provides culture-specific formatting information. When the method is invoked, it calls the `provider` parameter's method and passes it a object that represents the type. The method then returns the object that provides information about the format of the `value` parameter. There are three ways to use the `provider` parameter to supply custom formatting information to the parse operation: -- You can pass a object that represents the culture that supplies formatting information. Its method returns the object that provides numeric formatting information for that culture. +- You can pass a object that represents the culture that supplies formatting information. Its method returns the object that provides numeric formatting information for that culture. -- You can pass the actual object that provides numeric formatting information. (Its implementation of just returns itself.) +- You can pass the actual object that provides numeric formatting information. (Its implementation of just returns itself.) -- You can pass a custom object that implements . Its method instantiates and returns the object that provides formatting information. +- You can pass a custom object that implements . Its method instantiates and returns the object that provides formatting information. If `provider` is `null`, the formatting of `value` is interpreted based on the object of the current culture. ## Examples - The following examples show two ways to define the tilde (~) as a negative sign for formatting values. Note that to display the values in the same format as the original strings, your code must call the method and pass it the object that provides formatting information. + The following examples show two ways to define the tilde (~) as a negative sign for formatting values. Note that to display the values in the same format as the original strings, your code must call the method and pass it the object that provides formatting information. - The first example defines a class that implements and uses the method to return the object that provides formatting information. + The first example defines a class that implements and uses the method to return the object that provides formatting information. :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/Parse/System.Numeric.BigInteger.Parse.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/Parse/System.Numeric.BigInteger.Parse.fs" id="Snippet2"::: @@ -9334,7 +9334,7 @@ Elements in square brackets ([ and ]) are optional. The following table describe |Element|Description| |-------------|-----------------| |*ws*|Optional white space. White space can appear at the start of `value` if `style` includes the flag, and it can appear at the end of `value` if `style` includes the flag.| -|*$*|A culture-specific currency symbol. Its position in `value` is defined by the and properties of the culture indicated by the `provider` parameter. The current culture's currency symbol can appear in `value` if `style` includes the flag.| +|*$*|A culture-specific currency symbol. Its position in `value` is defined by the and properties of the culture indicated by the `provider` parameter. The current culture's currency symbol can appear in `value` if `style` includes the flag.| |*sign*|An optional sign. The sign can appear at the start of `value` if `style` includes the flag, and it can appear at the end of `value` if `style` includes the flag. Parentheses can be used in `value` to indicate a negative value if `style` includes the flag.| |*digits*

*fractional_digits*

*exponential_digits*|A sequence of digits from 0 through 9. For *fractional_digits*, only the digit 0 is valid.| |*,*|A culture-specific group separator symbol. The group separator symbol of the culture specified by `provider` can appear in `value` if `style` includes the flag.| @@ -9367,13 +9367,13 @@ A `value` with digits only (which corresponds to the values, which allow for but do not require the presence of particular style elements in `value`, the style value means that the individual numeric characters in `value` are always interpreted as hexadecimal characters. Valid hexadecimal characters are 0-9, A-F, and a-f. The only other flags that can be combined with the `style` parameter are and . (The enumeration includes a composite number style, , that includes both white-space flags.) -The `provider` parameter is an implementation. Its method returns a object that provides culture-specific information about the format of `value`. Typically, `provider` can be any one of the following: +The `provider` parameter is an implementation. Its method returns a object that provides culture-specific information about the format of `value`. Typically, `provider` can be any one of the following: -- A object that represents the culture that provides numeric formatting information. Its method returns the object that provides numeric formatting information. +- A object that represents the culture that provides numeric formatting information. Its method returns the object that provides numeric formatting information. -- A object that provides formatting information. (Its implementation of just returns itself.) +- A object that provides formatting information. (Its implementation of just returns itself.) -- A custom object that implements and uses the method to instantiate and return the object that provides formatting information. +- A custom object that implements and uses the method to instantiate and return the object that provides formatting information. If `provider` is `null`, the object for the current culture is used. @@ -9469,7 +9469,7 @@ If `provider` is `null`, the object |Element|Description| |-------------|-----------------| |*ws*|Optional white space. White space can appear at the start of `value` if `style` includes the flag, and it can appear at the end of `value` if `style` includes the flag.| -|*$*|A culture-specific currency symbol. Its position in the string is defined by the and properties of the culture indicated by the `provider` parameter. The current culture's currency symbol can appear in `value` if `style` includes the flag.| +|*$*|A culture-specific currency symbol. Its position in the string is defined by the and properties of the culture indicated by the `provider` parameter. The current culture's currency symbol can appear in `value` if `style` includes the flag.| |*sign*|An optional sign. The sign can appear at the start of `value` if `style` includes the flag, and it can appear at the end of `value` if `style` includes the flag. Parentheses can be used in `value` to indicate a negative value if `style` includes the flag.| |*digits*

*fractional_digits*

*exponential_digits*|A sequence of digits from 0 through 9. For *fractional_digits*, only the digit 0 is valid.| |*,*|A culture-specific group separator symbol. The group separator symbol of the culture specified by `provider` can appear in `value` if `style` includes the flag.| @@ -9500,39 +9500,39 @@ If `provider` is `null`, the object ||All elements. However, `value` cannot represent a hexadecimal number.| > [!IMPORTANT] -> If you use the method to round-trip the string representation of a value that was output by the method, you should use the method with the "R" format specifier to generate the string representation of the value. Otherwise, the string representation of the preserves only the 50 most significant digits of the original value, and data may be lost when you use the method to restore the value. +> If you use the method to round-trip the string representation of a value that was output by the method, you should use the method with the "R" format specifier to generate the string representation of the value. Otherwise, the string representation of the preserves only the 50 most significant digits of the original value, and data may be lost when you use the method to restore the value. Unlike the other values, which allow for but do not require the presence of particular style elements in `value`, the style value means that the individual numeric characters in `value` are always interpreted as hexadecimal characters. Valid hexadecimal characters are 0-9, A-F, and a-f. The only other flags that can be combined with the `style` parameter are and . (The enumeration includes a composite number style, , that includes both white-space flags.) > [!NOTE] > If `value` is the string representation of a hexadecimal number, it cannot be preceded by any decoration (such as `0x` or `&h`) that differentiates it as a hexadecimal number. This causes the conversion to fail. - If `value` is a hexadecimal string, the method interprets `value` as a negative number stored by using two's complement representation if its first two hexadecimal digits are greater than or equal to `0x80`. In other words, the method interprets the highest-order bit of the first byte in `value` as the sign bit. To make sure that a hexadecimal string is correctly interpreted as a positive number, the first digit in `value` must have a value of zero. For example, the method interprets `0x80` as a negative value, but it interprets either `0x080` or `0x0080` as a positive value. The following example illustrates the difference between hexadecimal strings that represent negative and positive values. + If `value` is a hexadecimal string, the method interprets `value` as a negative number stored by using two's complement representation if its first two hexadecimal digits are greater than or equal to `0x80`. In other words, the method interprets the highest-order bit of the first byte in `value` as the sign bit. To make sure that a hexadecimal string is correctly interpreted as a positive number, the first digit in `value` must have a value of zero. For example, the method interprets `0x80` as a negative value, but it interprets either `0x080` or `0x0080` as a positive value. The following example illustrates the difference between hexadecimal strings that represent negative and positive values. :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/Parse/ParseHex1.cs" id="Snippet3"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/Parse/ParseHex1.fs" id="Snippet3"::: :::code language="vb" source="~/snippets/visualbasic/System.Numerics/BigInteger/Parse/ParseHex1.vb" id="Snippet3"::: - The `provider` parameter is an implementation. Its method returns a object that provides culture-specific information about the format of `value`. Typically, `provider` can be any one of the following: + The `provider` parameter is an implementation. Its method returns a object that provides culture-specific information about the format of `value`. Typically, `provider` can be any one of the following: -- A object that represents the culture that provides numeric formatting information. Its method returns the object that provides numeric formatting information. +- A object that represents the culture that provides numeric formatting information. Its method returns the object that provides numeric formatting information. -- A object that provides formatting information. (Its implementation of just returns itself.) +- A object that provides formatting information. (Its implementation of just returns itself.) -- A custom object that implements and uses the method to instantiate and return the object that provides formatting information. +- A custom object that implements and uses the method to instantiate and return the object that provides formatting information. If `provider` is `null`, the object for the current culture is used. ## Examples - The following example makes several calls to the method using various combinations of values for the `style` and `provider` parameters. + The following example makes several calls to the method using various combinations of values for the `style` and `provider` parameters. :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/Parse/Parse1.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/Parse/Parse1.fs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System.Numerics/BigInteger/Parse/Parse1.vb" id="Snippet2"::: - A number of the individual calls to the method pass an instance of the following `BigIntegerFormatProvider` class, which defines a tilde (~) as the negative sign. + A number of the individual calls to the method pass an instance of the following `BigIntegerFormatProvider` class, which defines a tilde (~) as the negative sign. :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/Parse/Parse1.cs" id="Snippet4"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/Parse/Parse1.fs" id="Snippet4"::: @@ -9640,9 +9640,9 @@ If `provider` is `null`, the object method returns 1 if the value of the exponent parameter is 0, or if the values of both the `value` and `exponent` parameters are 0. If `exponent` is 1, the method returns `value`. If `value` is negative and exponent is odd, the method returns a negative result. + The method returns 1 if the value of the exponent parameter is 0, or if the values of both the `value` and `exponent` parameters are 0. If `exponent` is 1, the method returns `value`. If `value` is negative and exponent is odd, the method returns a negative result. - This method corresponds to the method for primitive numeric types. + This method corresponds to the method for primitive numeric types. @@ -9715,14 +9715,14 @@ If `provider` is `null`, the object ## Remarks The sign of the remainder is the sign of the `dividend` parameter. - The method is implemented for languages that do not support custom operators. Its behavior is identical to division using the modulus operator. + The method is implemented for languages that do not support custom operators. Its behavior is identical to division using the modulus operator. If necessary, the method automatically performs implicit conversion of other integral types to objects before it performs the modulus operation. ## Examples - The following example compares the remainder from the method with the remainder returned by the method to establish that the two methods calculate identical remainders. + The following example compares the remainder from the method with the remainder returned by the method to establish that the two methods calculate identical remainders. :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/Remainder/Remainder1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/Remainder/Remainder1.fs" id="Snippet1"::: @@ -9878,7 +9878,7 @@ If `provider` is `null`, the object property is equivalent to the method for the primitive numeric types. + The property is equivalent to the method for the primitive numeric types. ]]> @@ -9938,9 +9938,9 @@ If `provider` is `null`, the object method to perform subtraction using values. + Languages that do not support custom operators can use the method to perform subtraction using values. - The method is a useful substitute for the subtraction operator when instantiating a variable by assigning it the difference that results from subtraction, as shown in the following example. + The method is a useful substitute for the subtraction operator when instantiating a variable by assigning it the difference that results from subtraction, as shown in the following example. :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/Add/Multiply1.cs" id="Snippet3"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/Add/Multiply1.fs" id="Snippet3"::: @@ -9996,7 +9996,7 @@ If `provider` is `null`, the object ## Examples -The following example calls the method to compare a value with each element in an object array: +The following example calls the method to compare a value with each element in an object array: :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/CompareTo/Example2.cs" id="Snippet4"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/CompareTo/Example2.fs" id="Snippet4"::: @@ -11516,9 +11516,9 @@ The following example calls the `- 1`) as the sign bit, the method returns a byte array with an extra element whose value is zero to disambiguate positive values that could otherwise be interpreted as having their sign bits set. For example, the value 120 or `0x78` is represented as a single-byte array: `0x78`. However, 128, or `0x80`, is represented as a two-byte array: `0x80`, `0x00`. + Because two's complement representation always interprets the highest-order bit of the last byte in the array (the byte at position `- 1`) as the sign bit, the method returns a byte array with an extra element whose value is zero to disambiguate positive values that could otherwise be interpreted as having their sign bits set. For example, the value 120 or `0x78` is represented as a single-byte array: `0x78`. However, 128, or `0x80`, is represented as a two-byte array: `0x80`, `0x00`. - You can round-trip a value by storing it to a byte array and then restoring it using the constructor. + You can round-trip a value by storing it to a byte array and then restoring it using the constructor. > [!CAUTION] > If your code modifies the value of individual bytes in the array returned by this method before it restores the value, you must make sure that you do not unintentionally change the sign bit. For example, if your modifications increase a positive value so that the highest-order bit in the last element of the byte array becomes set, you can add a new byte whose value is zero to the end of the array. @@ -11648,13 +11648,13 @@ The integer value `33022` can be exported in four different arrays: method formats a value in the "R", or round-trip, format of the current culture. If you want to specify a different format or culture, use the other overloads of the method, as follows: + The method formats a value in the "R", or round-trip, format of the current culture. If you want to specify a different format or culture, use the other overloads of the method, as follows: |To use format|For culture|Use the overload| |-------------------|-----------------|----------------------| -|Round-trip ("R") format|A specific culture|| -|A specific format|Default (current) culture|| -|A specific format|A specific culture|| +|Round-trip ("R") format|A specific culture|| +|A specific format|Default (current) culture|| +|A specific format|A specific culture|| The string representation of the value includes a negative sign if its value is negative, and a sequence of digits ranging from 0 to 9 without leading zeros. The negative sign is defined by the object for the current culture. @@ -11727,15 +11727,15 @@ The integer value `33022` can be exported in four different arrays: method formats a value in the "R", or round-trip, format by using the object of a specified culture. If you want to specify a different format or the current culture, use the other overloads of the method, as follows: + The method formats a value in the "R", or round-trip, format by using the object of a specified culture. If you want to specify a different format or the current culture, use the other overloads of the method, as follows: |To use format|For culture|Use the overload| |-------------------|-----------------|----------------------| |Round-trip ("R") format|Default (current) culture|| -|A specific format|Default (current) culture|| -|A specific format|A specific culture|| +|A specific format|Default (current) culture|| +|A specific format|A specific culture|| - The `provider` parameter is an implementation. Its method returns a object that provides culture-specific information about the format of the string returned by this method. If `provider` is `null`, the value is formatted using the object of the current culture. The only property of the object that controls the string representation of the value using the general format specifier is , which defines the character that represents the negative sign. + The `provider` parameter is an implementation. Its method returns a object that provides culture-specific information about the format of the string returned by this method. If `provider` is `null`, the value is formatted using the object of the current culture. The only property of the object that controls the string representation of the value using the general format specifier is , which defines the character that represents the negative sign. The `provider` parameter can be one of the following: @@ -11743,12 +11743,12 @@ The integer value `33022` can be exported in four different arrays: - The object that supplies formatting information. -- A custom object that implements . Its method returns the object that supplies formatting information. +- A custom object that implements . Its method returns the object that supplies formatting information. ## Examples - The following example instantiates a custom object that defines the tilde (~) as a negative sign. The method then uses the custom object to display a negative value. + The following example instantiates a custom object that defines the tilde (~) as a negative sign. The method then uses the custom object to display a negative value. :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/ToString/System.Numeric.BigInteger.ToString.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/ToString/System.Numeric.BigInteger.ToString.fs" id="Snippet1"::: @@ -11816,13 +11816,13 @@ The integer value `33022` can be exported in four different arrays: method formats a value in a specified format by using a object that represents the conventions of the current culture. If you want to use the "R", or round-trip, format or specify a different culture, use the other overloads of the method, as follows: + The method formats a value in a specified format by using a object that represents the conventions of the current culture. If you want to use the "R", or round-trip, format or specify a different culture, use the other overloads of the method, as follows: |To use format|For culture|Use the overload| |-------------------|-----------------|----------------------| |Round-trip ("R") format|Default (current) culture|| -|Round-trip ("R") format|A specific culture|| -|A specific format|A specific culture|| +|Round-trip ("R") format|A specific culture|| +|A specific format|A specific culture|| The `format` parameter can be any valid [standard numeric string](/dotnet/standard/base-types/standard-numeric-format-strings), or any combination of [custom numeric format strings](/dotnet/standard/base-types/custom-numeric-format-strings). If `format` is equal to or is `null`, the return value of the current object is formatted with the round-trip format specifier ("R"). If `format` is any other value, the method throws a . @@ -11832,7 +11832,7 @@ The integer value `33022` can be exported in four different arrays: - For more information about support for formatting in .NET, see [Formatting Types](/dotnet/standard/base-types/formatting-types). - The format of the returned string is determined by the object for the current culture. Depending on the `format` parameter, this object controls symbols such as the negative sign, the group separator, and the decimal point symbol in the output string. To provide formatting information for cultures other than the current culture, call the overload. + The format of the returned string is determined by the object for the current culture. Depending on the `format` parameter, this object controls symbols such as the negative sign, the group separator, and the decimal point symbol in the output string. To provide formatting information for cultures other than the current culture, call the overload. @@ -11910,13 +11910,13 @@ The integer value `33022` can be exported in four different arrays: method formats a value in a specified format by using the object of a specified culture. If you want to use the round-trip format or default culture settings, use the other overloads of the method, as follows: + The method formats a value in a specified format by using the object of a specified culture. If you want to use the round-trip format or default culture settings, use the other overloads of the method, as follows: |To use format|For culture|Use the overload| |-------------------|-----------------|----------------------| |Round-trip ("R") format|Default (current) culture|| -|Round-trip ("R") format|A specific culture|| -|A specific format|Default (current) culture|| +|Round-trip ("R") format|A specific culture|| +|A specific format|Default (current) culture|| The `format` parameter can be any valid [standard numeric string](/dotnet/standard/base-types/standard-numeric-format-strings), or any combination of [custom numeric format strings](/dotnet/standard/base-types/custom-numeric-format-strings). If `format` is equal to or is `null`, the return value of the current object is formatted with the round-trip format specifier ("R"). If `format` is any other value, the method throws a . @@ -11926,13 +11926,13 @@ The integer value `33022` can be exported in four different arrays: - For more information about support for formatting in .NET, see [Formatting Types](/dotnet/standard/base-types/formatting-types). - The `provider` parameter is an implementation. Its method returns a object that provides culture-specific information about the format of the string returned by this method. When the method is invoked, it calls the `provider` parameter's method and passes it a object that represents the type. The method then returns the object that provides information for formatting the `value` parameter, such as the negative sign symbol, the group separator symbol, or the decimal point symbol. There are three ways to use the `provider` parameter to supply formatting information to the method: + The `provider` parameter is an implementation. Its method returns a object that provides culture-specific information about the format of the string returned by this method. When the method is invoked, it calls the `provider` parameter's method and passes it a object that represents the type. The method then returns the object that provides information for formatting the `value` parameter, such as the negative sign symbol, the group separator symbol, or the decimal point symbol. There are three ways to use the `provider` parameter to supply formatting information to the method: -- You can pass a object that represents the culture that supplies formatting information. Its method returns the object that provides numeric formatting information for that culture. +- You can pass a object that represents the culture that supplies formatting information. Its method returns the object that provides numeric formatting information for that culture. -- You can pass the actual object that provides numeric formatting information. (Its implementation of just returns itself.) +- You can pass the actual object that provides numeric formatting information. (Its implementation of just returns itself.) -- You can pass a custom object that implements . Its method instantiates and returns the object that provides formatting information. +- You can pass a custom object that implements . Its method instantiates and returns the object that provides formatting information. If `provider` is `null`, the formatting of the returned string is based on the object of the current culture. @@ -12258,7 +12258,7 @@ The integer value `33022` can be exported in four different arrays: method is like the method, except that it does not throw an exception if the conversion fails. This method eliminates the need to use exception handling to test for a if `value` is invalid and cannot be successfully parsed. + The method is like the method, except that it does not throw an exception if the conversion fails. This method eliminates the need to use exception handling to test for a if `value` is invalid and cannot be successfully parsed. The `value` parameter should be the string representation of a decimal number in the following form: @@ -12269,22 +12269,22 @@ The integer value `33022` can be exported in four different arrays: |Element|Description| |-------------|-----------------| |*ws*|Optional white space.| -|*sign*|An optional sign. Valid sign characters are determined by the and properties of the current culture.| +|*sign*|An optional sign. Valid sign characters are determined by the and properties of the current culture.| |*digits*|A sequence of decimal digits ranging from 0 to 9.| > [!NOTE] > The string specified by the `value` parameter cannot contain any group separators or decimal separator, and it cannot have a decimal portion. - The `value` parameter is interpreted by using the style. In addition to the decimal digits, only leading and trailing spaces with a leading sign are allowed. To explicitly define the style elements with the culture-specific formatting information that can be present in `value`, call the method. + The `value` parameter is interpreted by using the style. In addition to the decimal digits, only leading and trailing spaces with a leading sign are allowed. To explicitly define the style elements with the culture-specific formatting information that can be present in `value`, call the method. - The `value` parameter is parsed by using the formatting information in a object for the current culture. For more information, see . + The `value` parameter is parsed by using the formatting information in a object for the current culture. For more information, see . - This overload interprets all digits in the `value` parameter as decimal digits. To parse the string representation of a hexadecimal number, call the overload instead. + This overload interprets all digits in the `value` parameter as decimal digits. To parse the string representation of a hexadecimal number, call the overload instead. ## Examples - The following example uses the method to instantiate two objects. If the conversions succeed, it multiplies each object by another number and then calls the method to determine the relationship between the two objects. + The following example uses the method to instantiate two objects. If the conversions succeed, it multiplies each object by another number and then calls the method to determine the relationship between the two objects. :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/TryParse/System.Numeric.BigInteger.TryParse.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/TryParse/System.Numeric.BigInteger.TryParse.fs" id="Snippet1"::: @@ -12553,7 +12553,7 @@ Elements in square brackets ([ and ]) are optional. The following table describe |Element|Description| |-------------|-----------------| |*ws*|Optional white space. White space can appear at the start of `value` if `style` includes the flag, or at the end of `value` if `style` includes the flag.| -|*$*|A culture-specific currency symbol. Its position in `value` is defined by the property of the object returned by the method of the `provider` parameter. The currency symbol can appear in `value` if `style` includes the flag.| +|*$*|A culture-specific currency symbol. Its position in `value` is defined by the property of the object returned by the method of the `provider` parameter. The currency symbol can appear in `value` if `style` includes the flag.| |*sign*|An optional sign. The sign can appear at the start of `value` if `style` includes the flag, and it can appear at the end of `value` if `style` includes the flag. Parentheses can be used in `value` to indicate a negative value if `style` includes the flag.| |*digits*|A sequence of digits from 0 through 9.| |*,*|A culture-specific group separator. The group separator of the culture specified by `provider` can appear in `value` if `style` includes the flag.| @@ -12585,13 +12585,13 @@ Elements in square brackets ([ and ]) are optional. The following table describe If the flag is used, `value` must be a hexadecimal value. The only other flags that can be present in `style` are and . (The enumeration has a composite style, , that includes both white-space flags.) -The `provider` parameter is an implementation. Its method returns a object that provides culture-specific information about the format of `value`. The `provider` parameter can be any one of the following: +The `provider` parameter is an implementation. Its method returns a object that provides culture-specific information about the format of `value`. The `provider` parameter can be any one of the following: -- A object that represents the culture that supplies formatting information. Its method returns the object that provides numeric formatting information for that culture. +- A object that represents the culture that supplies formatting information. Its method returns the object that provides numeric formatting information for that culture. -- A object that provides numeric formatting information. (Its implementation of just returns itself.) +- A object that provides numeric formatting information. (Its implementation of just returns itself.) -- A custom object that implements . Its method instantiates and returns the object that provides formatting information. +- A custom object that implements . Its method instantiates and returns the object that provides formatting information. If `provider` is `null`, the object for the current culture is used. @@ -12668,7 +12668,7 @@ If `provider` is `null`, the object method is like the method, except that it does not throw an exception if the conversion fails. This method eliminates the need to use exception handling to test for a if `value` is invalid and cannot be parsed successfully. + The method is like the method, except that it does not throw an exception if the conversion fails. This method eliminates the need to use exception handling to test for a if `value` is invalid and cannot be parsed successfully. The `style` parameter defines the style elements (such as white space or a positive or negative sign) that are allowed in the `value` parameter for the parse operation to succeed. It must be a combination of bit flags from the enumeration. Depending on the value of `style`, the `value` parameter may include the following elements: @@ -12683,7 +12683,7 @@ If `provider` is `null`, the object |Element|Description| |-------------|-----------------| |*ws*|Optional white space. White space can appear at the start of `value` if `style` includes the flag, or at the end of `value` if `style` includes the flag.| -|*$*|A culture-specific currency symbol. Its position in the string is defined by the property of the object returned by the method of the `provider` parameter. The currency symbol can appear in `value` if `style` includes the flag.| +|*$*|A culture-specific currency symbol. Its position in the string is defined by the property of the object returned by the method of the `provider` parameter. The currency symbol can appear in `value` if `style` includes the flag.| |*sign*|An optional sign. The sign can appear at the start of `value` if `style` includes the flag, and it can appear at the end of `value` if `style` includes the flag. Parentheses can be used in `value` to indicate a negative value if `style` includes the flag.| |*digits*|A sequence of digits from 0 through 9.| |*,*|A culture-specific group separator. The group separator of the culture specified by `provider` can appear in `value` if `style` includes the flag.| @@ -12716,39 +12716,39 @@ If `provider` is `null`, the object ||All elements. However, `value` cannot represent a hexadecimal number.| > [!IMPORTANT] -> If you use the method to round-trip the string representation of a value that was output by the method, you should use the method with the "R" format specifier to generate the string representation of the value. Otherwise, the string representation of the preserves only the 50 most significant digits of the original value, and data may be lost when you use the method to restore the value. +> If you use the method to round-trip the string representation of a value that was output by the method, you should use the method with the "R" format specifier to generate the string representation of the value. Otherwise, the string representation of the preserves only the 50 most significant digits of the original value, and data may be lost when you use the method to restore the value. If the flag is used, `value` must be a hexadecimal value. The only other flags that can be present in `style` are and . (The enumeration has a composite style, , that includes both white-space flags.) > [!NOTE] > If `value` is the string representation of a hexadecimal number, it cannot be preceded by any decoration (such as `0x` or `&h`) that differentiates it as a hexadecimal number. This causes the conversion to fail. - If `value` is a hexadecimal string, the method interprets `value` as a negative number stored by using two's complement representation if its first two hexadecimal digits are greater than or equal to `0x80`. In other words, the method interprets the highest-order bit of the first byte in `value` as the sign bit. To make sure that a hexadecimal string is correctly interpreted as a positive number, the first digit in `value` must have a value of zero. For example, the method interprets `0x80` as a negative value, but it interprets either `0x080` or `0x0080` as a positive value. The following example illustrates the difference between hexadecimal strings that represent negative and positive values. + If `value` is a hexadecimal string, the method interprets `value` as a negative number stored by using two's complement representation if its first two hexadecimal digits are greater than or equal to `0x80`. In other words, the method interprets the highest-order bit of the first byte in `value` as the sign bit. To make sure that a hexadecimal string is correctly interpreted as a positive number, the first digit in `value` must have a value of zero. For example, the method interprets `0x80` as a negative value, but it interprets either `0x080` or `0x0080` as a positive value. The following example illustrates the difference between hexadecimal strings that represent negative and positive values. :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/TryParse/TryParseHex1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/TryParse/TryParseHex1.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Numerics/BigInteger/TryParse/TryParseHex1.vb" id="Snippet1"::: - The `provider` parameter is an implementation. Its method returns a object that provides culture-specific information about the format of `value`. The `provider` parameter can be any one of the following: + The `provider` parameter is an implementation. Its method returns a object that provides culture-specific information about the format of `value`. The `provider` parameter can be any one of the following: -- A object that represents the culture that supplies formatting information. Its method returns the object that provides numeric formatting information for that culture. +- A object that represents the culture that supplies formatting information. Its method returns the object that provides numeric formatting information for that culture. -- A object that provides numeric formatting information. (Its implementation of just returns itself.) +- A object that provides numeric formatting information. (Its implementation of just returns itself.) -- A custom object that implements . Its method instantiates and returns the object that provides formatting information. +- A custom object that implements . Its method instantiates and returns the object that provides formatting information. If `provider` is `null`, the object for the current culture is used. ## Examples - The following example makes some calls to the method using various combinations of values for the `style` and `provider` parameters. + The following example makes some calls to the method using various combinations of values for the `style` and `provider` parameters. :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/TryParse/TryParse1.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/TryParse/TryParse1.fs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System.Numerics/BigInteger/TryParse/TryParse1.vb" id="Snippet2"::: - A number of the individual calls to the method pass an instance of the following `BigIntegerFormatProvider` class, which defines a tilde (~) as the negative sign. + A number of the individual calls to the method pass an instance of the following `BigIntegerFormatProvider` class, which defines a tilde (~) as the negative sign. :::code language="csharp" source="~/snippets/csharp/System.Numerics/BigInteger/TryParse/TryParse1.cs" id="Snippet3"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/BigInteger/TryParse/TryParse1.fs" id="Snippet3"::: diff --git a/xml/System.Numerics/Complex.xml b/xml/System.Numerics/Complex.xml index 1479ede3e8f..f4728f564dc 100644 --- a/xml/System.Numerics/Complex.xml +++ b/xml/System.Numerics/Complex.xml @@ -296,7 +296,7 @@ - If `a > b`, the result is $a \times \sqrt{1 + \frac{b^2}{a^2}}$. - If `b > a`, the result is $b \times \sqrt{1 + \frac{a^2}{b^2}}$. - If the calculation of the absolute value results in an overflow, the method returns either or . If either the or property is and the other property is neither nor , the method returns . + If the calculation of the absolute value results in an overflow, the method returns either or . If either the or property is and the other property is neither nor , the method returns . ## Examples The following example calculates the absolute value of a complex number and demonstrates that it is equivalent to the value of the property. @@ -355,14 +355,14 @@ method for complex numbers corresponds to the method for real numbers. + The method for complex numbers corresponds to the method for real numbers. - The method uses the following formula: + The method uses the following formula: `(-ImaginaryOne) * Log(value + ImaginaryOne * Sqrt(One - value * value))` ## Examples - The following example illustrates the method. It shows that passing the value returned by the method to the method returns the original value. + The following example illustrates the method. It shows that passing the value returned by the method to the method returns the original value. :::code language="csharp" source="~/snippets/csharp/System.Numerics/Complex/Acos/acos1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/Complex/Acos/acos1.fs" id="Snippet1"::: @@ -381,13 +381,13 @@ methods allow performing addition operations that involve complex numbers. + The methods allow performing addition operations that involve complex numbers. If the method call results in an overflow in either the real or imaginary component, the value of the component is either or . - Languages that don't support custom operators can use the method to perform addition with complex numbers. + Languages that don't support custom operators can use the method to perform addition with complex numbers. - The methods that receive one double are more efficient than the methods that receive two complex numbers. + The methods that receive one double are more efficient than the methods that receive two complex numbers. ## Examples @@ -607,14 +607,14 @@ $(a + c) + bi$ method for complex numbers corresponds to the method for real numbers. + The method for complex numbers corresponds to the method for real numbers. - The method uses the following formula: + The method uses the following formula: `-ImaginaryOne * Log(ImaginaryOne * value + Sqrt(One - value * value))` ## Examples - The following example illustrates the method. It shows that passing the value returned by the method to the method returns the original value. + The following example illustrates the method. It shows that passing the value returned by the method to the method returns the original value. :::code language="csharp" source="~/snippets/csharp/System.Numerics/Complex/Asin/asin1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/Complex/Asin/asin1.fs" id="Snippet1"::: @@ -672,14 +672,14 @@ $(a + c) + bi$ method for complex numbers corresponds to the method for real numbers. + The method for complex numbers corresponds to the method for real numbers. - The method uses the following formula: + The method uses the following formula: `(ImaginaryOne / new Complex(2.0, 0.0)) * (Log(One - ImaginaryOne * value) - Log(One + ImaginaryOne * value))` ## Examples - The following example illustrates the method. It shows that passing the value returned by the method to the method returns the original value. + The following example illustrates the method. It shows that passing the value returned by the method to the method returns the original value. :::code language="csharp" source="~/snippets/csharp/System.Numerics/Complex/Atan/atan1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/Complex/Atan/atan1.fs" id="Snippet1"::: @@ -796,15 +796,15 @@ $(a + c) + bi$ method for complex numbers corresponds to the method for real numbers. + The method for complex numbers corresponds to the method for real numbers. - The method calculates the cosine of the complex number `a + bi` as `x + yi`, where: + The method calculates the cosine of the complex number `a + bi` as `x + yi`, where: - `x` is $\cos a \times \cosh b$ - `y` is $-(\sin a \times \sinh b)$ ## Examples - The following example illustrates the method. It shows that passing the value returned by the method to the method returns the original value. + The following example illustrates the method. It shows that passing the value returned by the method to the method returns the original value. :::code language="csharp" source="~/snippets/csharp/System.Numerics/Complex/Acos/acos1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/Complex/Acos/acos1.fs" id="Snippet1"::: @@ -862,9 +862,9 @@ $(a + c) + bi$ method for complex numbers corresponds to the method for real numbers. + The method for complex numbers corresponds to the method for real numbers. - The method calculates the hyperbolic cosine of the complex number `a + bi` as `x + yi`, where: + The method calculates the hyperbolic cosine of the complex number `a + bi` as `x + yi`, where: - `x` is $\cosh a \times \cos b$ - `y` is $\sinh a \times \sin b$ @@ -1040,13 +1040,13 @@ $(a + c) + bi$ methods allow performing division operations that involve complex numbers. + The methods allow performing division operations that involve complex numbers. If the calculation of the quotient results in an overflow in either the real or imaginary component, the value of that component is either or . - The method can be used by Languages that don't support custom operators. Its behavior is identical to division using the division operator. + The method can be used by Languages that don't support custom operators. Its behavior is identical to division using the division operator. - The methods that receive one double are more efficient than the methods that receive two complex numbers. + The methods that receive one double are more efficient than the methods that receive two complex numbers. ## Examples The following example divides a complex number by each element in an array of complex numbers. @@ -1286,9 +1286,9 @@ $\frac{ac + bd}{c^2 + d^2} + (\frac{bc - ad}{c^2 + d^2})i$ method provides the implementation for the structure. It performs slightly better than method because it does not have to convert its parameter to a complex number. + The method provides the implementation for the structure. It performs slightly better than method because it does not have to convert its parameter to a complex number. - Two complex numbers are equal if their real parts are equal and their imaginary parts are equal. The method is equivalent to the following expression: + Two complex numbers are equal if their real parts are equal and their imaginary parts are equal. The method is equivalent to the following expression: :::code language="csharp" source="~/snippets/csharp/System.Numerics/Complex/Equals/equals1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/Complex/Equals/equals1.fs" id="Snippet1"::: @@ -1367,13 +1367,13 @@ $\frac{ac + bd}{c^2 + d^2} + (\frac{bc - ad}{c^2 + d^2})i$ method is equivalent to the following expression: + Two complex numbers are equal if their real parts are equal and their imaginary parts are equal. The method is equivalent to the following expression: :::code language="csharp" source="~/snippets/csharp/System.Numerics/Complex/Equals/equals1.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/Complex/Equals/equals1.fs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System.Numerics/Complex/Equals/equals1.vb" id="Snippet2"::: - If the `obj` parameter is not a object, but it is a data type for which an implicit conversion is defined, the method converts `obj` to a object whose real part is equal to the value of `obj` and whose imaginary part is equal to zero before it performs the comparison. The following example illustrates this by finding that a complex number and a double-precision floating-point value are equal. + If the `obj` parameter is not a object, but it is a data type for which an implicit conversion is defined, the method converts `obj` to a object whose real part is equal to the value of `obj` and whose imaginary part is equal to zero before it performs the comparison. The following example illustrates this by finding that a complex number and a double-precision floating-point value are equal. :::code language="csharp" source="~/snippets/csharp/System.Numerics/Complex/Equals/equals3.cs" id="Snippet6"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/Complex/Equals/equals3.fs" id="Snippet6"::: @@ -1442,12 +1442,12 @@ $\frac{ac + bd}{c^2 + d^2} + (\frac{bc - ad}{c^2 + d^2})i$ method to calculate the powers of other bases. + Use the method to calculate the powers of other bases. - The method for complex numbers corresponds to the method for real numbers. is the inverse of . + The method for complex numbers corresponds to the method for real numbers. is the inverse of . ## Examples - The following example illustrates the method. It shows that, with some allowance for the lack of precision of the data type, passing the value returned by the method to the method returns the original value. + The following example illustrates the method. It shows that, with some allowance for the lack of precision of the data type, passing the value returned by the method to the method returns the original value. :::code language="csharp" source="~/snippets/csharp/System.Numerics/Complex/Exp/log1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/Complex/Exp/log1.fs" id="Snippet1"::: @@ -1506,14 +1506,14 @@ $\frac{ac + bd}{c^2 + d^2} + (\frac{bc - ad}{c^2 + d^2})i$ method instantiates a complex number based on its polar coordinates. + The method instantiates a complex number based on its polar coordinates. - Because there are multiple representations of a point on a complex plane, the return value of the method is normalized. The magnitude is normalized to a positive number, and the phase is normalized to a value in the range of - to . As a result, the values of the and properties of the resulting complex number might not equal the original values of the `magnitude` and `phase` parameters. + Because there are multiple representations of a point on a complex plane, the return value of the method is normalized. The magnitude is normalized to a positive number, and the phase is normalized to a value in the range of - to . As a result, the values of the and properties of the resulting complex number might not equal the original values of the `magnitude` and `phase` parameters. To convert a value from degrees to radians for the `phase` parameter, multiply it by $\frac{\pi}{180}$. ## Examples - The following example uses the method to instantiate a complex number based on its polar coordinates and then displays the value of its and properties. + The following example uses the method to instantiate a complex number based on its polar coordinates and then displays the value of its and properties. :::code language="csharp" source="~/snippets/csharp/System.Numerics/Complex/FromPolarCoordinates/phase1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/Complex/FromPolarCoordinates/phase1.fs" id="Snippet1"::: @@ -1807,7 +1807,7 @@ This function returns `false` for a complex number `a + bi` where `b` is zero. This method correctly handles floating-point values and so `2.0` returns `true` while `2.2` returns `false`. -A return value of `false` does not imply that will return `true`. A number with a fractional portion, for example, `3.3`, is not even or odd. +A return value of `false` does not imply that will return `true`. A number with a fractional portion, for example, `3.3`, is not even or odd. ]]> @@ -2083,7 +2083,7 @@ This method correctly handles floating-point values and so `2.0` and `3.0` will ## Remarks -A return value of `false` does not imply that will return `true`. A complex number, `a + bi` for non-zero `b`, is not positive or negative. +A return value of `false` does not imply that will return `true`. A complex number, `a + bi` for non-zero `b`, is not positive or negative. ]]> @@ -2213,7 +2213,7 @@ A return value of `false` does not imply that will return `true`. A number with a fractional portion, for example, `3.3`, is not even or odd. +A return value of `false` does not imply that will return `true`. A number with a fractional portion, for example, `3.3`, is not even or odd. ]]> @@ -2261,7 +2261,7 @@ A return value of `false` does not imply that will return `true`. A complex number, `a + bi` for non-zero `b`, is not positive or negative. +A return value of `false` does not imply that will return `true`. A complex number, `a + bi` for non-zero `b`, is not positive or negative. ]]> @@ -2452,10 +2452,10 @@ This function returns `true` for a complex number `a + bi` where `b` is zero. method for complex numbers corresponds to the method for real numbers. + The method for complex numbers corresponds to the method for real numbers. ## Examples - The following example illustrates the method. It shows that, with some allowance for the lack of precision of the data type, passing the value returned by the method to the method returns the original value. + The following example illustrates the method. It shows that, with some allowance for the lack of precision of the data type, passing the value returned by the method to the method returns the original value. :::code language="csharp" source="~/snippets/csharp/System.Numerics/Complex/Exp/log1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/Complex/Exp/log1.fs" id="Snippet1"::: @@ -2515,7 +2515,7 @@ This function returns `true` for a complex number `a + bi` where `b` is zero. method for complex numbers corresponds to the method for real numbers. + The method for complex numbers corresponds to the method for real numbers. ]]> @@ -2567,7 +2567,7 @@ This function returns `true` for a complex number `a + bi` where `b` is zero. method for complex numbers corresponds to the method for real numbers. + The method for complex numbers corresponds to the method for real numbers. ]]> @@ -2621,9 +2621,9 @@ This function returns `true` for a complex number `a + bi` where `b` is zero. If the calculation of the absolute value results in an overflow, this property returns either or . - The and the properties define the position of a point that represents a complex number in the polar coordinate system. + The and the properties define the position of a point that represents a complex number in the polar coordinate system. - You can instantiate a complex number based on its polar coordinates instead of its Cartesian coordinates by calling the method. + You can instantiate a complex number based on its polar coordinates instead of its Cartesian coordinates by calling the method. ## Examples The following example calculates the absolute value of a complex number and demonstrates that it is equivalent to the value of the property. @@ -2680,7 +2680,7 @@ This function returns `true` for a complex number `a + bi` where `b` is zero. ## Remarks -For this method matches the IEEE 754:2019 `maximumMagnitude` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. +For this method matches the IEEE 754:2019 `maximumMagnitude` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. ]]> @@ -2730,7 +2730,7 @@ For this method matches the IEE ## Remarks -For this method matches the IEEE 754:2019 `minimumMagnitude` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. +For this method matches the IEEE 754:2019 `minimumMagnitude` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. ]]> @@ -2745,11 +2745,11 @@ For this method matches the IEE ## Remarks -The methods allow performing multiplication operations that involve complex numbers. +The methods allow performing multiplication operations that involve complex numbers. If the multiplication results in an overflow in either the real or imaginary component, the value of that component is either or . -The method is implemented for Languages that don't support custom operators. Its behavior is identical to multiplication using the multiplication operator. +The method is implemented for Languages that don't support custom operators. Its behavior is identical to multiplication using the multiplication operator. ## Examples @@ -3016,7 +3016,7 @@ $(ac - bd) + (ad + bc)i$ ## Remarks The additive inverse of a complex number is a complex number that produces a value of when it is added to the original complex number. This method returns a complex number in which the real and imaginary components of the original complex number are multiplied by -1. - The method is implemented for Languages that don't support custom operators. Its behavior is identical to negation using the unary negation operator, . + The method is implemented for Languages that don't support custom operators. Its behavior is identical to negation using the unary negation operator, . ## Examples The following example obtains the additive inverse of each element in an array of complex numbers. @@ -3091,7 +3091,7 @@ $(ac - bd) + (ad + bc)i$ ## Remarks -The operator allows performing addition operations that involve complex numbers. It enables code such as the following: +The operator allows performing addition operations that involve complex numbers. It enables code such as the following: :::code language="csharp" source="~/snippets/csharp/System.Numerics/Complex/Add/add3.cs" id="Snippet3"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/Complex/Add/add3.fs" id="Snippet3"::: @@ -3099,9 +3099,9 @@ The operator allows performing add If the addition results in an overflow in either the real or imaginary component, the value of that component is either or . -Languages that don't support custom operators can call the equivalent group of methods instead. +Languages that don't support custom operators can call the equivalent group of methods instead. -The operators that receive one double are more efficient than the operators that receive two Complex numbers. +The operators that receive one double are more efficient than the operators that receive two Complex numbers. ## Examples @@ -3162,7 +3162,7 @@ The addition of a real number (which can be regarded as the complex number `a + $(a + c) + di$ -Languages that don't support custom operators can call the equivalent method instead. +Languages that don't support custom operators can call the equivalent method instead. ]]> @@ -3216,7 +3216,7 @@ The addition of a complex number (`a + bi`) and a real number (which can be rega $(a + c) + bi$ -Languages that don't support custom operators can call the equivalent method instead. +Languages that don't support custom operators can call the equivalent method instead. ]]> @@ -3280,7 +3280,7 @@ The addition of a complex number, `a + bi`, and a second complex number, `c + di $(a + c) + (b + d)i$ -Languages that don't support custom operators can call the equivalent method instead. +Languages that don't support custom operators can call the equivalent method instead. ]]> @@ -3334,7 +3334,7 @@ Languages that don't support custom operators can call the operator allows performing division operations that involve complex numbers. It enables code such as the following: +The operator allows performing division operations that involve complex numbers. It enables code such as the following: :::code language="csharp" source="~/snippets/csharp/System.Numerics/Complex/Divide/divide2.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/Complex/Divide/divide2.fs" id="Snippet2"::: @@ -3342,9 +3342,9 @@ The operator allows performing div If the division results in an overflow in either the real or imaginary component, the value of that component is either or . -Languages that don't support custom operators and operator overloading can call the equivalent group of method instead. +Languages that don't support custom operators and operator overloading can call the equivalent group of method instead. -The operators that receive one double are more efficient than the operators that receive two Complex numbers. +The operators that receive one double are more efficient than the operators that receive two Complex numbers. ]]> @@ -3397,7 +3397,7 @@ The division of a real number (which can be regarded as the complex number `a + $\frac{ac}{c^2 + d^2} + (\frac{ad}{c^2 + d^2})i$ -Languages that don't support custom operators and operator overloading can call the equivalent method instead. +Languages that don't support custom operators and operator overloading can call the equivalent method instead. ]]> @@ -3451,7 +3451,7 @@ The division of a complex number (`a + bi`) and a real number (which can be rega $\frac{ac}{c^2} + (\frac{bc}{c^2})i$ -Languages that don't support custom operators and operator overloading can call the equivalent method instead. +Languages that don't support custom operators and operator overloading can call the equivalent method instead. ]]> @@ -3515,7 +3515,7 @@ The division of a complex number, `a + bi`, and a second complex number, `c + di $\frac{ac + cd}{c^2 + d^2} + (\frac{bc - ad}{c^2 + d^2})i$ -Languages that don't support custom operators and operator overloading can call the equivalent method instead. +Languages that don't support custom operators and operator overloading can call the equivalent method instead. ]]> @@ -3575,23 +3575,23 @@ Languages that don't support custom operators and operator overloading can call method defines the operation of the equality operator for values. It enables code such as the following: + The method defines the operation of the equality operator for values. It enables code such as the following: :::code language="csharp" source="~/snippets/csharp/System.Numerics/Complex/Equals/eqoperator1.cs" id="Snippet9"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/Complex/Equals/eqoperator1.fs" id="Snippet9"::: :::code language="vb" source="~/snippets/visualbasic/System.Numerics/Complex/Equals/eqoperator1.vb" id="Snippet9"::: - Languages that don't support custom operators can call the method instead. + Languages that don't support custom operators can call the method instead. - Two complex numbers are equal if their real parts are equal and their imaginary parts are equal. The method is equivalent to the following expression: + Two complex numbers are equal if their real parts are equal and their imaginary parts are equal. The method is equivalent to the following expression: :::code language="csharp" source="~/snippets/csharp/System.Numerics/Complex/Equals/equals1.cs" id="Snippet3"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/Complex/Equals/equals1.fs" id="Snippet3"::: :::code language="vb" source="~/snippets/visualbasic/System.Numerics/Complex/Equals/equals1.vb" id="Snippet3"::: - Note that, because of differences in precision, two complex numbers that are apparently equivalent can be considered unequal. For more information and a possible workaround, see the method. + Note that, because of differences in precision, two complex numbers that are apparently equivalent can be considered unequal. For more information and a possible workaround, see the method. - The equivalent method for this operator is ]]> + The equivalent method for this operator is ]]> @@ -3864,7 +3864,7 @@ Languages that don't support custom operators and operator overloading can call operator define the types from which a compiler can automatically convert a object without an explicit casting operator (in C#) or a call to a conversion function (in Visual Basic). They are widening conversions that do not involve data loss and do not throw an . + The overloads of the operator define the types from which a compiler can automatically convert a object without an explicit casting operator (in C#) or a call to a conversion function (in Visual Basic). They are widening conversions that do not involve data loss and do not throw an . This overload lets the compiler handle conversions from a value to a complex number, as the following example shows. Note that the result of the conversion is a complex number whose real part is equal to the value and whose imaginary part is equal to zero. @@ -3958,7 +3958,7 @@ Languages that don't support custom operators and operator overloading can call operator define the types from which a compiler can automatically convert a object without an explicit casting operator (in C#) or a call to a conversion function (in Visual Basic). They are widening conversions that do not involve data loss and do not throw an . + The overloads of the operator define the types from which a compiler can automatically convert a object without an explicit casting operator (in C#) or a call to a conversion function (in Visual Basic). They are widening conversions that do not involve data loss and do not throw an . This overload lets the compiler handle conversions from a value to a complex number, as the following example shows. Note that the result of the conversion is a complex number whose real part is equal to the value and whose imaginary part is equal to zero. @@ -4052,7 +4052,7 @@ Languages that don't support custom operators and operator overloading can call operator define the types from which a compiler can automatically convert a object without an explicit casting operator (in C#) or a call to a conversion function (in Visual Basic). They are widening conversions that do not involve data loss and do not throw an . + The overloads of the operator define the types from which a compiler can automatically convert a object without an explicit casting operator (in C#) or a call to a conversion function (in Visual Basic). They are widening conversions that do not involve data loss and do not throw an . This overload lets the compiler handle conversions from a signed 16-bit integer to a complex number, as the following example shows. Note that the result of the conversion is a complex number whose real part is equal to the signed 16-bit integer and whose imaginary part is equal to zero. @@ -4110,7 +4110,7 @@ Languages that don't support custom operators and operator overloading can call operator define the types from which a compiler can automatically convert a object without an explicit casting operator (in C#) or a call to a conversion function (in Visual Basic). They are widening conversions that do not involve data loss and do not throw an . + The overloads of the operator define the types from which a compiler can automatically convert a object without an explicit casting operator (in C#) or a call to a conversion function (in Visual Basic). They are widening conversions that do not involve data loss and do not throw an . This overload lets the compiler handle conversions from a signed 32-bit integer to a complex number, as the following example shows. Note that the result of the conversion is a complex number whose real part is equal to the signed 32-bit integer and whose imaginary part is equal to zero. @@ -4168,7 +4168,7 @@ Languages that don't support custom operators and operator overloading can call operator define the types from which a compiler can automatically convert a object without an explicit casting operator (in C#) or a call to a conversion function (in Visual Basic). They are widening conversions that do not involve data loss and do not throw an . + The overloads of the operator define the types from which a compiler can automatically convert a object without an explicit casting operator (in C#) or a call to a conversion function (in Visual Basic). They are widening conversions that do not involve data loss and do not throw an . This overload lets the compiler handle conversions from a signed 64-bit integer to a complex number, as the following example shows. Note that the result of the conversion is a complex number whose real part is equal to the signed 64-bit integer and whose imaginary part is equal to zero. @@ -4301,7 +4301,7 @@ This API is not CLS-compliant. operator define the types from which a compiler can automatically convert a object without an explicit casting operator (in C#) or a call to a conversion function (in Visual Basic). They are widening conversions that do not involve data loss and do not throw an . + The overloads of the operator define the types from which a compiler can automatically convert a object without an explicit casting operator (in C#) or a call to a conversion function (in Visual Basic). They are widening conversions that do not involve data loss and do not throw an . This overload lets the compiler handle conversions from a signed byte to a complex number, as the following example shows. Note that the result of the conversion is a complex number whose real part is equal to the signed byte and whose imaginary part is equal to zero. @@ -4359,7 +4359,7 @@ This API is not CLS-compliant. operator define the types from which a compiler can automatically convert a object without an explicit casting operator (in C#) or a call to a conversion function (in Visual Basic). They are widening conversions that do not involve data loss and do not throw an . + The overloads of the operator define the types from which a compiler can automatically convert a object without an explicit casting operator (in C#) or a call to a conversion function (in Visual Basic). They are widening conversions that do not involve data loss and do not throw an . This overload lets the compiler handle conversions from a value to a complex number, as the following example shows. Note that the result of the conversion is a complex number whose real part is equal to the value and whose imaginary part is equal to zero. @@ -4425,7 +4425,7 @@ This API is not CLS-compliant. operator define the types from which a compiler can automatically convert a object without an explicit casting operator (in C#) or a call to a conversion function (in Visual Basic). They are widening conversions that do not involve data loss and do not throw an . + The overloads of the operator define the types from which a compiler can automatically convert a object without an explicit casting operator (in C#) or a call to a conversion function (in Visual Basic). They are widening conversions that do not involve data loss and do not throw an . This overload lets the compiler handle conversions from an unsigned 16-bit integer to a complex number, as the following example shows. Note that the result of the conversion is a complex number whose real part is equal to the unsigned 16-bit integer and whose imaginary part is equal to zero. @@ -4491,7 +4491,7 @@ This API is not CLS-compliant. operator define the types from which a compiler can automatically convert a object without an explicit casting operator (in C#) or a call to a conversion function (in Visual Basic). They are widening conversions that do not involve data loss and do not throw an . + The overloads of the operator define the types from which a compiler can automatically convert a object without an explicit casting operator (in C#) or a call to a conversion function (in Visual Basic). They are widening conversions that do not involve data loss and do not throw an . This overload lets the compiler handle conversions from an unsigned 32-bit integer to a complex number, as the following example shows. Note that the result of the conversion is a complex number whose real part is equal to the unsigned 32-bit integer and whose imaginary part is equal to zero. @@ -4557,7 +4557,7 @@ This API is not CLS-compliant. operator define the types from which a compiler can automatically convert a object without an explicit casting operator (in C#) or a call to a conversion function (in Visual Basic). They are widening conversions that do not involve data loss and do not throw an . + The overloads of the operator define the types from which a compiler can automatically convert a object without an explicit casting operator (in C#) or a call to a conversion function (in Visual Basic). They are widening conversions that do not involve data loss and do not throw an . This overload lets the compiler handle conversions from an unsigned 64-bit integer to a complex number, as the following example shows. Note that the result of the conversion is a complex number whose real part is equal to the unsigned 64-bit integer and whose imaginary part is equal to zero. @@ -4703,15 +4703,15 @@ This API is not CLS-compliant. method defines the operation of the inequality operator for complex numbers. It enables code such as the following: + The method defines the operation of the inequality operator for complex numbers. It enables code such as the following: :::code language="csharp" source="~/snippets/csharp/System.Numerics/Complex/op_Inequality/inequality1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/Complex/op_Inequality/inequality1.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System.Numerics/Complex/op_Inequality/inequality1.vb" id="Snippet1"::: - Languages that don't support custom operators can test for inequality by calling the method and reversing its value. + Languages that don't support custom operators can test for inequality by calling the method and reversing its value. - Note that, because of differences in precision, two complex numbers that are apparently equivalent can be considered unequal. One possible workaround is to implement a comparison method that returns `true` only if the difference between the two real and imaginary parts of the complex numbers exceeds a certain threshold (such as .01% of the value of the real or imaginary component of one of the complex numbers). For more information, see the method. + Note that, because of differences in precision, two complex numbers that are apparently equivalent can be considered unequal. One possible workaround is to implement a comparison method that returns `true` only if the difference between the two real and imaginary parts of the complex numbers exceeds a certain threshold (such as .01% of the value of the real or imaginary component of one of the complex numbers). For more information, see the method. ]]> @@ -4726,7 +4726,7 @@ This API is not CLS-compliant. ## Remarks -The operator allows performing multiplication operations that involve complex numbers. It enables code such as the following: +The operator allows performing multiplication operations that involve complex numbers. It enables code such as the following: :::code language="csharp" source="~/snippets/csharp/System.Numerics/Complex/Multiply/multiply2.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/Complex/Multiply/multiply2.fs" id="Snippet2"::: @@ -4734,9 +4734,9 @@ The operator allows performing mul If the multiplication results in an overflow in either the real or imaginary component, the value of that component is either or . -Languages that don't support custom operators can call the equivalent group of methods instead. +Languages that don't support custom operators can call the equivalent group of methods instead. -The operators that receive one double are more efficient than the operators that receive two Complex numbers. +The operators that receive one double are more efficient than the operators that receive two Complex numbers. ]]> @@ -4789,7 +4789,7 @@ The multiplication of a real number (which can be regarded as the complex number $ac + adi$ -Languages that don't support custom operators can call the equivalent method instead. +Languages that don't support custom operators can call the equivalent method instead. ]]> @@ -4843,7 +4843,7 @@ The multiplication of a complex number (`a + bi`) and a real number (which can b $ac + bci$ -Languages that don't support custom operators can call the equivalent method instead. +Languages that don't support custom operators can call the equivalent method instead. ]]> @@ -4907,7 +4907,7 @@ The multiplication of a complex number, `a + bi`, and a second complex number, ` $(ac - bd) + (ad + bc)i$ -Languages that don't support custom operators can call the equivalent method instead. +Languages that don't support custom operators can call the equivalent method instead. ]]> @@ -4922,7 +4922,7 @@ Languages that don't support custom operators can call the operator allows performing subtraction operations that involve complex numbers. It enables code such as the following: +The operator allows performing subtraction operations that involve complex numbers. It enables code such as the following: :::code language="csharp" source="~/snippets/csharp/System.Numerics/Complex/op_Subtraction/subtract2.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/Complex/op_Subtraction/subtract2.fs" id="Snippet2"::: @@ -4930,9 +4930,9 @@ The operator allows performing If the subtraction results in an overflow in either the real or imaginary component, the value of that component is either or . -Languages that don't support custom operators can call the equivalent group of methods instead. +Languages that don't support custom operators can call the equivalent group of methods instead. -The operators that receive one double are more efficient than the operators that receive two Complex numbers. +The operators that receive one double are more efficient than the operators that receive two Complex numbers. ]]> @@ -4985,7 +4985,7 @@ The subtraction of a complex number (`c + di`) from a real number (which can be $(a - c) - di$ -Languages that don't support custom operators can call the method instead. +Languages that don't support custom operators can call the method instead. ]]> @@ -5039,7 +5039,7 @@ The subtraction of a real number (which can be regarded as the complex number `c $(a - c) + bi$ -Languages that don't support custom operators can call the method instead. +Languages that don't support custom operators can call the method instead. ]]> @@ -5103,7 +5103,7 @@ The subtraction of a complex number, `c + di`, from another complex number, `a + $(a - c) + (b - d)i$ -Languages that don't support custom operators can call the method instead. +Languages that don't support custom operators can call the method instead. ]]> @@ -5160,15 +5160,15 @@ Languages that don't support custom operators can call the method defines the operation of the unary negation (additive inverse) operator for complex numbers. It enables code such as the following: + The method defines the operation of the unary negation (additive inverse) operator for complex numbers. It enables code such as the following: :::code language="csharp" source="~/snippets/csharp/System.Numerics/Complex/Negate/negate2.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/Complex/Negate/negate2.fs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System.Numerics/Complex/Negate/negate2.vb" id="Snippet2"::: - The resulting complex number produces a value of when it is added to the original complex number. Languages that don't support custom operators can call the method instead. + The resulting complex number produces a value of when it is added to the original complex number. Languages that don't support custom operators can call the method instead. - The equivalent method for this operator is ]]> + The equivalent method for this operator is ]]> @@ -5542,12 +5542,12 @@ Languages that don't support custom operators can call the property) is the distance from the point of origin to the point that is represented by the complex number. - You can instantiate a complex number based on its polar coordinates instead of its Cartesian coordinates by calling the method. + You can instantiate a complex number based on its polar coordinates instead of its Cartesian coordinates by calling the method. To convert the phase from radians to degrees, multiply it by $\frac{180}{\pi}$. ## Examples - The following example uses the method to instantiate a complex number based on its polar coordinates, and then displays the value of its and properties. + The following example uses the method to instantiate a complex number based on its polar coordinates, and then displays the value of its and properties. :::code language="csharp" source="~/snippets/csharp/System.Numerics/Complex/FromPolarCoordinates/phase1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/Complex/FromPolarCoordinates/phase1.fs" id="Snippet1"::: @@ -5618,7 +5618,7 @@ Languages that don't support custom operators can call the , the method returns . For other values, if `power` is 0, the method returns , and if `power` is 1, it returns `value`. - This method corresponds to the method for primitive numeric types. + This method corresponds to the method for primitive numeric types. ## Examples The following example illustrates exponentiation using a complex number and an exponent whose value ranges from -1 to 10. @@ -5793,7 +5793,7 @@ $\frac{a}{a^2 + b^2} + -\frac{b}{a^2 + b^2}$ If value is , the method returns . Otherwise, it returns the result of the expression /`value`. ## Examples - The following example uses the method to calculate the reciprocal values of several complex numbers. It also demonstrates that the result of multiplying a complex number by its reciprocal is . + The following example uses the method to calculate the reciprocal values of several complex numbers. It also demonstrates that the result of multiplying a complex number by its reciprocal is . :::code language="csharp" source="~/snippets/csharp/System.Numerics/Complex/Reciprocal/reciprocal1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/Complex/Reciprocal/reciprocal1.fs" id="Snippet1"::: @@ -5849,15 +5849,15 @@ $\frac{a}{a^2 + b^2} + -\frac{b}{a^2 + b^2}$ method for complex numbers corresponds to the method for real numbers. + The method for complex numbers corresponds to the method for real numbers. - The method calculates the sine of the complex number `a + bi` as `x + yi`, where: + The method calculates the sine of the complex number `a + bi` as `x + yi`, where: - `x` is $\sin a \times \cosh b$ - `y` is $\cos a \times \sinh b$ ## Examples - The following example illustrates the method. It shows that passing the value returned by the method to the method returns the original value. + The following example illustrates the method. It shows that passing the value returned by the method to the method returns the original value. :::code language="csharp" source="~/snippets/csharp/System.Numerics/Complex/Asin/asin1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/Complex/Asin/asin1.fs" id="Snippet1"::: @@ -5915,9 +5915,9 @@ $\frac{a}{a^2 + b^2} + -\frac{b}{a^2 + b^2}$ method for complex numbers corresponds to the method for real numbers. + The method for complex numbers corresponds to the method for real numbers. - The method calculates the hyperbolic sine of the complex number `a + bi` as `x + yi`, where: + The method calculates the hyperbolic sine of the complex number `a + bi` as `x + yi`, where: - `x` is $\sinh a \times \cos b$ - `y` is $\cosh a \times \sin b$ @@ -5977,7 +5977,7 @@ $\frac{a}{a^2 + b^2} + -\frac{b}{a^2 + b^2}$ `Complex.FromPolarCoordinates(Math.Sqrt(value.Magnitude), value.Phase/2.0)` - The method for complex numbers corresponds to the method for real numbers. + The method for complex numbers corresponds to the method for real numbers. ]]> @@ -5991,13 +5991,13 @@ $\frac{a}{a^2 + b^2} + -\frac{b}{a^2 + b^2}$ ## Remarks -The method allows subtraction operations that involve complex numbers. +The method allows subtraction operations that involve complex numbers. If the subtraction results in an overflow in either the real or imaginary component, the value of that component is either or . -Languages that support custom operators can use the equivalent group of operators too. +Languages that support custom operators can use the equivalent group of operators too. -The methods that receive one double are more efficient than the method that receive two Complex numbers. +The methods that receive one double are more efficient than the method that receive two Complex numbers. ## Examples @@ -6058,7 +6058,7 @@ The subtraction of a complex number (`c + di`) from a real number (which can be $(a - c) - di$ -Languages that support custom operators can use the equivalent operator too. +Languages that support custom operators can use the equivalent operator too. ]]> @@ -6112,7 +6112,7 @@ The subtraction of a real number (which can be regarded as the complex number `c $(a - c) + bi$ -Languages that support custom operators can use the equivalent operator too. +Languages that support custom operators can use the equivalent operator too. ]]> @@ -6178,7 +6178,7 @@ The subtraction of a complex number, `c + di`, from another complex number, `a + $(a - c) + (b - d)i$ -Languages that support custom operators can use the equivalent operator too. +Languages that support custom operators can use the equivalent operator too. ]]> @@ -6976,14 +6976,14 @@ Languages that support custom operators can use the method for complex numbers corresponds to the method for real numbers. + The method for complex numbers corresponds to the method for real numbers. - The method uses the following formula to calculate the tangent of the complex number `value`: + The method uses the following formula to calculate the tangent of the complex number `value`: `Sin(value)/Cos(value)` ## Examples - The following example illustrates the method. It shows that passing the value returned by the method to the method returns the original value. + The following example illustrates the method. It shows that passing the value returned by the method to the method returns the original value. :::code language="csharp" source="~/snippets/csharp/System.Numerics/Complex/Atan/atan1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System.Numerics/Complex/Atan/atan1.fs" id="Snippet1"::: @@ -7041,9 +7041,9 @@ Languages that support custom operators can use the method for complex numbers corresponds to the method for real numbers. + The method for complex numbers corresponds to the method for real numbers. - The method uses the following formula to calculate the hyperbolic tangent of the complex number `value`: + The method uses the following formula to calculate the hyperbolic tangent of the complex number `value`: `Sinh(value)/Cosh(value)` @@ -7174,13 +7174,13 @@ Languages that support custom operators can use the ` (or `(a, b)` in .NET Framework), where *a* is the real part of the complex number, and *b* is its imaginary part. Both *a* and *b* are formatted using the general format specifier ("G") and the conventions of the culture defined by `provider`. - The `provider` parameter is an implementation. Its method returns a object that provides culture-specific information about the format of the real and imaginary numbers in the returned string. If `provider` is `null`, the returned string is formatted using the object of the current culture. + The `provider` parameter is an implementation. Its method returns a object that provides culture-specific information about the format of the real and imaginary numbers in the returned string. If `provider` is `null`, the returned string is formatted using the object of the current culture. The `provider` parameter can be one of the following: - A object that represents the culture that supplies formatting information - The object that supplies formatting information. -- A custom object that implements the interface. Its method returns the object that supplies formatting information. +- A custom object that implements the interface. Its method returns the object that supplies formatting information. ## Examples The following example displays the string representation of several complex numbers. The result uses the formatting conventions of the English - United States ("en-US") and French - France ("fr-FR") cultures. @@ -7258,7 +7258,7 @@ Languages that support custom operators can use the object for the current culture. Depending on the `format` parameter, this object controls symbols such as the negative sign, the group separator, and the decimal point symbol in the output string. To provide formatting information for cultures other than the current culture, call the overload. + The format of the returned string is determined by the object for the current culture. Depending on the `format` parameter, this object controls symbols such as the negative sign, the group separator, and the decimal point symbol in the output string. To provide formatting information for cultures other than the current culture, call the overload. ## Examples The following example initializes a complex number and displays it using several standard format strings. @@ -7341,13 +7341,13 @@ Languages that support custom operators can use the implementation. Its method returns a object that provides culture-specific information about the format of the real and imaginary numbers in the returned string. Depending on the `format` parameter, this object controls symbols such as the negative sign, the group separator, and the decimal point symbol in the output string. If `provider` is `null`, the returned string is formatted using the object of the current culture. + The `provider` parameter is an implementation. Its method returns a object that provides culture-specific information about the format of the real and imaginary numbers in the returned string. Depending on the `format` parameter, this object controls symbols such as the negative sign, the group separator, and the decimal point symbol in the output string. If `provider` is `null`, the returned string is formatted using the object of the current culture. The `provider` parameter can be one of the following: - A object that represents the culture that supplies formatting information - The object that supplies formatting information. -- A custom object that implements the interface. Its method returns the object that supplies formatting information. +- A custom object that implements the interface. Its method returns the object that supplies formatting information. ## Examples The following example creates an array of complex numbers, and displays each using several standard format strings as well as objects that represent the English - United States ("en-US") and French - France ("fr-FR") cultures. diff --git a/xml/System.Numerics/INumberBase`1.xml b/xml/System.Numerics/INumberBase`1.xml index 1862b331eb0..8d4e10d6595 100644 --- a/xml/System.Numerics/INumberBase`1.xml +++ b/xml/System.Numerics/INumberBase`1.xml @@ -384,7 +384,7 @@ This function returns `false` for a complex number `a + bi` where `a` or `b` is This method correctly handles floating-point values and so `2.0` will return `true` while `2.2` will return `false`. -A return value of `false` does not imply that will return `true`. A number with a fractional portion, for example, `3.3`, is not even or odd. +A return value of `false` does not imply that will return `true`. A number with a fractional portion, for example, `3.3`, is not even or odd. ]]> @@ -422,7 +422,7 @@ A return value of `false` does not imply that will return `true`. `NaN` is not finite or infinite. +A return value of `false` does not imply that will return `true`. `NaN` is not finite or infinite. ]]> @@ -498,7 +498,7 @@ This function returns `false` for a complex number `a + bi` where `a` is non-zer ## Remarks -A return value of `false` does not imply that will return `true`. `NaN` is not finite or infinite. +A return value of `false` does not imply that will return `true`. `NaN` is not finite or infinite. ]]> @@ -606,7 +606,7 @@ This method correctly handles floating-point values and so `2.0` and `3.0` will If this type has signed zero, then `-0` is also considered negative. -A return value of `false` does not imply that will return `true`. A complex number, `a + bi` for non-zero `b`, is not positive or negative +A return value of `false` does not imply that will return `true`. A complex number, `a + bi` for non-zero `b`, is not positive or negative ]]> @@ -706,7 +706,7 @@ A return value of `false` does not imply that will return `true`. A number with a fractional portion, for example, `3.3`, is not even or odd. +A return value of `false` does not imply that will return `true`. A number with a fractional portion, for example, `3.3`, is not even or odd. ]]>
@@ -746,7 +746,7 @@ A return value of `false` does not imply that will return `true`. A complex number, `a + bi` for non-zero `b`, is not positive or negative +A return value of `false` does not imply that will return `true`. A complex number, `a + bi` for non-zero `b`, is not positive or negative ]]>
@@ -924,7 +924,7 @@ This function treats both positive and negative zero as zero and so will return ## Remarks -For this method matches the IEEE 754:2019 `maximumMagnitude` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. +For this method matches the IEEE 754:2019 `maximumMagnitude` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. ]]>
@@ -964,7 +964,7 @@ For this method matches the IEE ## Remarks -For this method matches the IEEE 754:2019 `maximumMagnitudeNumber` function. This requires NaN inputs to not be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. +For this method matches the IEEE 754:2019 `maximumMagnitudeNumber` function. This requires NaN inputs to not be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. ]]>
@@ -1004,7 +1004,7 @@ For this method matches the IEE ## Remarks -For this method matches the IEEE 754:2019 `minimumMagnitude` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. +For this method matches the IEEE 754:2019 `minimumMagnitude` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. ]]>
@@ -1044,7 +1044,7 @@ For this method matches the IEE ## Remarks -For this method matches the IEEE 754:2019 `minimumMagnitudeNumber` function. This requires NaN inputs to not be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. +For this method matches the IEEE 754:2019 `minimumMagnitudeNumber` function. This requires NaN inputs to not be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. ]]>
diff --git a/xml/System.Numerics/INumber`1.xml b/xml/System.Numerics/INumber`1.xml index 2d68e39f77e..6c10874232e 100644 --- a/xml/System.Numerics/INumber`1.xml +++ b/xml/System.Numerics/INumber`1.xml @@ -244,7 +244,7 @@ ## Remarks -For , this method matches the IEEE 754:2019 `maximum` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. +For , this method matches the IEEE 754:2019 `maximum` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. ]]>
@@ -313,7 +313,7 @@ For , this method matches the IEEE 754: ## Remarks -For this method matches the IEEE 754:2019 `maximumNumber` function. This requires NaN inputs to not be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. +For this method matches the IEEE 754:2019 `maximumNumber` function. This requires NaN inputs to not be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. ]]>
@@ -353,7 +353,7 @@ For this method matches the IEEE 754:2 ## Remarks -For , this method matches the IEEE 754:2019 `minimum` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. +For , this method matches the IEEE 754:2019 `minimum` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. ]]>
@@ -422,7 +422,7 @@ For , this method matches the IEEE 754: ## Remarks -For this method matches the IEEE 754:2019 `minimumNumber` function. This requires NaN inputs to not be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. +For this method matches the IEEE 754:2019 `minimumNumber` function. This requires NaN inputs to not be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. ]]>
diff --git a/xml/System.Numerics/Matrix3x2.xml b/xml/System.Numerics/Matrix3x2.xml index fd23359fb51..2c861f05776 100644 --- a/xml/System.Numerics/Matrix3x2.xml +++ b/xml/System.Numerics/Matrix3x2.xml @@ -53,12 +53,12 @@ Represents a 3x2 matrix. - @@ -1002,11 +1002,11 @@ if the two matrices are equal; otherwise, . - @@ -1072,11 +1072,11 @@ if the current instance and are equal; otherwise, . If is , the method returns . - object and the corresponding elements of each matrix are equal. - + object and the corresponding elements of each matrix are equal. + ]]> @@ -1130,11 +1130,11 @@ Calculates the determinant for this matrix. The determinant. - @@ -2016,11 +2016,11 @@ Adds each element in one matrix with its corresponding element in a second matrix. The matrix that contains the summed values. - method defines the operation of the addition operator for objects. - + method defines the operation of the addition operator for objects. + ]]> @@ -2073,11 +2073,11 @@ if and are equal; otherwise, . - @@ -2190,11 +2190,11 @@ Returns the matrix that results from multiplying two matrices together. The product matrix. - method defines the operation of the multiplication operator for objects. - + method defines the operation of the multiplication operator for objects. + ]]> @@ -2246,11 +2246,11 @@ Returns the matrix that results from scaling all the elements of a specified matrix by a scalar factor. The scaled matrix. - method defines the operation of the multiplication operator for objects. - + method defines the operation of the multiplication operator for objects. + ]]> @@ -2302,11 +2302,11 @@ Subtracts each element in a second matrix from its corresponding element in a first matrix. The matrix containing the values that result from subtracting each element in from its corresponding element in . - method defines the operation of the subtraction operator for objects. - + method defines the operation of the subtraction operator for objects. + ]]> @@ -2457,11 +2457,11 @@ Returns a string that represents this matrix. The string representation of this matrix. - diff --git a/xml/System.Numerics/Matrix4x4.xml b/xml/System.Numerics/Matrix4x4.xml index dabd03977e2..287baa43a6e 100644 --- a/xml/System.Numerics/Matrix4x4.xml +++ b/xml/System.Numerics/Matrix4x4.xml @@ -53,12 +53,12 @@ Represents a 4x4 matrix. - @@ -115,11 +115,11 @@ A 3x2 matrix. Creates a object from a specified object. - , , , , , , , and components are zero, and whose and components are one. - + , , , , , , , and components are zero, and whose and components are one. + ]]> @@ -1186,14 +1186,14 @@ The perspective projection matrix. To be added. - is less than or equal to zero. - - -or- - - is less than or equal to zero. - - -or- - + is less than or equal to zero. + + -or- + + is less than or equal to zero. + + -or- + is greater than or equal to . @@ -1249,20 +1249,20 @@ The perspective projection matrix. To be added. - is less than or equal to zero. - - -or- - - is greater than or equal to . - - is less than or equal to zero. - - -or- - - is less than or equal to zero. - - -or- - + is less than or equal to zero. + + -or- + + is greater than or equal to . + + is less than or equal to zero. + + -or- + + is less than or equal to zero. + + -or- + is greater than or equal to . @@ -1430,14 +1430,14 @@ The perspective projection matrix. To be added. - is less than or equal to zero. - - -or- - - is less than or equal to zero. - - -or- - + is less than or equal to zero. + + -or- + + is less than or equal to zero. + + -or- + is greater than or equal to . @@ -2371,13 +2371,13 @@ The right-handed viewport matrix. @@ -2424,14 +2424,14 @@ Creates a left-handed viewport matrix from the specified parameters. The left-handed viewport matrix. - @@ -2485,11 +2485,11 @@ Creates a world matrix with the specified parameters. The world matrix. - @@ -2684,11 +2684,11 @@ if the current instance and are equal; otherwise, . If is , the method returns . - object and the corresponding elements of each matrix are equal. - + object and the corresponding elements of each matrix are equal. + ]]> @@ -4041,11 +4041,11 @@ Adds each element in one matrix with its corresponding element in a second matrix. The matrix that contains the summed values. - method defines the operation of the addition operator for objects. - + method defines the operation of the addition operator for objects. + ]]> @@ -4098,11 +4098,11 @@ if and are equal; otherwise, . - @@ -4215,11 +4215,11 @@ Returns the matrix that results from multiplying two matrices together. The product matrix. - method defines the operation of the multiplication operator for objects. - + method defines the operation of the multiplication operator for objects. + ]]> @@ -4271,11 +4271,11 @@ Returns the matrix that results from scaling all the elements of a specified matrix by a scalar factor. The scaled matrix. - method defines the operation of the multiplication operator for objects. - + method defines the operation of the multiplication operator for objects. + ]]> @@ -4327,11 +4327,11 @@ Subtracts each element in a second matrix from its corresponding element in a first matrix. The matrix containing the values that result from subtracting each element in from its corresponding element in . - method defines the operation of the subtraction operator for objects. - + method defines the operation of the subtraction operator for objects. + ]]> @@ -4481,11 +4481,11 @@ Returns a string that represents this matrix. The string representation of this matrix. - diff --git a/xml/System.Numerics/Plane.xml b/xml/System.Numerics/Plane.xml index e19f3513675..bde1c6d5f8a 100644 --- a/xml/System.Numerics/Plane.xml +++ b/xml/System.Numerics/Plane.xml @@ -53,12 +53,12 @@ Represents a plane in three-dimensional space. - @@ -622,11 +622,11 @@ if the two planes are equal; otherwise, . - objects are equal if their and fields are equal. - + objects are equal if their and fields are equal. + ]]> @@ -692,11 +692,11 @@ if the current instance and are equal; otherwise, . If is , the method returns . - object and their and fields are equal. - + object and their and fields are equal. + ]]> @@ -889,13 +889,13 @@ if and are equal; otherwise, . - objects are equal if their and fields are equal. - - The method defines the operation of the equality operator for objects. - + objects are equal if their and fields are equal. + + The method defines the operation of the equality operator for objects. + ]]> @@ -948,11 +948,11 @@ if and are not equal; otherwise, . - method defines the operation of the inequality operator for objects. - + method defines the operation of the inequality operator for objects. + ]]> @@ -1006,11 +1006,11 @@ Returns the string representation of this plane object. A string that represents this object. - object use the formatting conventions of the current culture to format the numeric values in the returned string. For example, a object whose string representation is formatted by using the conventions of the en-US culture might appear as `{Normal:<1.1, 2.2, 3.3> D:4.4}`. - + object use the formatting conventions of the current culture to format the numeric values in the returned string. For example, a object whose string representation is formatted by using the conventions of the en-US culture might appear as `{Normal:<1.1, 2.2, 3.3> D:4.4}`. + ]]> @@ -1073,11 +1073,11 @@ Transforms a normalized plane by a 4x4 matrix. The transformed plane. - vector is of unit length before this method is called. - + vector is of unit length before this method is called. + ]]> @@ -1129,11 +1129,11 @@ Transforms a normalized plane by a Quaternion rotation. A new plane that results from applying the Quaternion rotation. - vector is of unit length before this method is called. - + vector is of unit length before this method is called. + ]]> diff --git a/xml/System.Numerics/Quaternion.xml b/xml/System.Numerics/Quaternion.xml index b54d1aac3ea..6f87723721e 100644 --- a/xml/System.Numerics/Quaternion.xml +++ b/xml/System.Numerics/Quaternion.xml @@ -53,15 +53,15 @@ Represents a vector that is used to encode three-dimensional physical rotations. - structure is used to efficiently rotate an object about the (x,y,z) vector by the angle theta, where: - -``` -w = cos(theta/2) -``` - + structure is used to efficiently rotate an object about the (x,y,z) vector by the angle theta, where: + +``` +w = cos(theta/2) +``` + ]]> @@ -435,11 +435,11 @@ w = cos(theta/2) Creates a quaternion from a unit vector and an angle to rotate around the vector. The newly created quaternion. - will be incorrect. - + will be incorrect. + ]]> @@ -707,11 +707,11 @@ w = cos(theta/2) if the two quaternions are equal; otherwise, . - @@ -777,11 +777,11 @@ w = cos(theta/2) if the current instance and are equal; otherwise, . If is , the method returns . - object and the corresponding components of each matrix are equal. - + object and the corresponding components of each matrix are equal. + ]]> @@ -1424,11 +1424,11 @@ w = cos(theta/2) Adds each element in one quaternion with its corresponding element in a second quaternion. The quaternion that contains the summed values of and . - method defines the operation of the addition operator for objects. - + method defines the operation of the addition operator for objects. + ]]> @@ -1480,11 +1480,11 @@ w = cos(theta/2) Divides one quaternion by a second quaternion. The quaternion that results from dividing by . - method defines the division operation for objects. - + method defines the division operation for objects. + ]]> @@ -1537,13 +1537,13 @@ w = cos(theta/2) if the two quaternions are equal; otherwise, . - method defines the operation of the equality operator for objects. - + method defines the operation of the equality operator for objects. + ]]> @@ -1656,11 +1656,11 @@ w = cos(theta/2) Returns the quaternion that results from multiplying two quaternions together. The product quaternion. - method defines the operation of the multiplication operator for objects. - + method defines the operation of the multiplication operator for objects. + ]]> @@ -1712,11 +1712,11 @@ w = cos(theta/2) Returns the quaternion that results from scaling all the components of a specified quaternion by a scalar factor. The scaled quaternion. - method defines the operation of the multiplication operator for objects. - + method defines the operation of the multiplication operator for objects. + ]]> @@ -1768,11 +1768,11 @@ w = cos(theta/2) Subtracts each element in a second quaternion from its corresponding element in a first quaternion. The quaternion containing the values that result from subtracting each element in from its corresponding element in . - method defines the operation of the subtraction operator for objects. - + method defines the operation of the subtraction operator for objects. + ]]> @@ -1822,11 +1822,11 @@ w = cos(theta/2) Reverses the sign of each component of the quaternion. The negated quaternion. - method defines the operation of the unary negation operator for objects. - + method defines the operation of the unary negation operator for objects. + ]]> @@ -1980,11 +1980,11 @@ w = cos(theta/2) Returns a string that represents this quaternion. The string representation of this quaternion. - diff --git a/xml/System.Numerics/Vector2.xml b/xml/System.Numerics/Vector2.xml index 4e9e63ddc69..095fa7ceb56 100644 --- a/xml/System.Numerics/Vector2.xml +++ b/xml/System.Numerics/Vector2.xml @@ -2910,7 +2910,7 @@ method. + This operation offers better performance than a call to the method. ]]> @@ -4457,7 +4457,7 @@ The behavior of this method changed in .NET 5. For more information, see [Behavi method defines the addition operation for objects. + The method defines the addition operation for objects. ]]> @@ -4594,7 +4594,7 @@ The behavior of this method changed in .NET 5. For more information, see [Behavi method defines the division operation for objects. + The method defines the division operation for objects. ]]> @@ -4650,7 +4650,7 @@ The behavior of this method changed in .NET 5. For more information, see [Behavi method defines the division operation for objects. + The method defines the division operation for objects. ]]> @@ -4894,7 +4894,7 @@ The behavior of this method changed in .NET 5. For more information, see [Behavi method defines the multiplication operation for objects. + The method defines the multiplication operation for objects. ]]> @@ -4950,7 +4950,7 @@ The behavior of this method changed in .NET 5. For more information, see [Behavi method defines the multiplication operation for objects. + The method defines the multiplication operation for objects. ]]> @@ -5006,7 +5006,7 @@ The behavior of this method changed in .NET 5. For more information, see [Behavi method defines the multiplication operation for objects. + The method defines the multiplication operation for objects. ]]> @@ -5130,7 +5130,7 @@ The behavior of this method changed in .NET 5. For more information, see [Behavi method defines the subtraction operation for objects. + The method defines the subtraction operation for objects. ]]> @@ -5184,7 +5184,7 @@ The behavior of this method changed in .NET 5. For more information, see [Behavi method defines the unary negation operation for objects. + The method defines the unary negation operation for objects. ]]> diff --git a/xml/System.Numerics/Vector3.xml b/xml/System.Numerics/Vector3.xml index ab05d27a5b3..5bc67fb3c49 100644 --- a/xml/System.Numerics/Vector3.xml +++ b/xml/System.Numerics/Vector3.xml @@ -3004,7 +3004,7 @@ method. + This operation offers better performance than a call to the method. ]]> @@ -4543,7 +4543,7 @@ method defines the addition operation for objects. + The method defines the addition operation for objects. ]]> @@ -4680,7 +4680,7 @@ method defines the division operation for objects. + The method defines the division operation for objects. ]]> @@ -4736,7 +4736,7 @@ method defines the division operation for objects. + The method defines the division operation for objects. ]]> @@ -4980,7 +4980,7 @@ method defines the multiplication operation for objects. + The method defines the multiplication operation for objects. ]]> @@ -5036,7 +5036,7 @@ method defines the multiplication operation for objects. + The method defines the multiplication operation for objects. ]]> @@ -5092,7 +5092,7 @@ method defines the multiplication operation for objects. + The method defines the multiplication operation for objects. ]]> @@ -5216,7 +5216,7 @@ method defines the subtraction operation for objects. + The method defines the subtraction operation for objects. ]]> @@ -5270,7 +5270,7 @@ method defines the unary negation operation for objects. + The method defines the unary negation operation for objects. ]]> diff --git a/xml/System.Numerics/Vector4.xml b/xml/System.Numerics/Vector4.xml index 62cadff1cc6..5d664bc043c 100644 --- a/xml/System.Numerics/Vector4.xml +++ b/xml/System.Numerics/Vector4.xml @@ -3078,7 +3078,7 @@ method. + This operation offers better performance than a call to the method. ]]> @@ -4628,7 +4628,7 @@ The behavior of this method changed in .NET 5. For more information, see [Behavi method defines the addition operation for objects. + The method defines the addition operation for objects. ]]> @@ -4765,7 +4765,7 @@ The behavior of this method changed in .NET 5. For more information, see [Behavi method defines the division operation for objects. + The method defines the division operation for objects. ]]> @@ -4821,7 +4821,7 @@ The behavior of this method changed in .NET 5. For more information, see [Behavi method defines the division operation for objects. + The method defines the division operation for objects. ]]> @@ -5065,7 +5065,7 @@ The behavior of this method changed in .NET 5. For more information, see [Behavi method defines the multiplication operation for objects. + The method defines the multiplication operation for objects. ]]> @@ -5121,7 +5121,7 @@ The behavior of this method changed in .NET 5. For more information, see [Behavi method defines the multiplication operation for objects. + The method defines the multiplication operation for objects. ]]> @@ -5177,7 +5177,7 @@ The behavior of this method changed in .NET 5. For more information, see [Behavi method defines the multiplication operation for objects. + The method defines the multiplication operation for objects. ]]> @@ -5301,7 +5301,7 @@ The behavior of this method changed in .NET 5. For more information, see [Behavi method defines the subtraction operation for objects. + The method defines the subtraction operation for objects. ]]> @@ -5355,7 +5355,7 @@ The behavior of this method changed in .NET 5. For more information, see [Behavi method defines the unary negation operation for objects. + The method defines the unary negation operation for objects. ]]> diff --git a/xml/System.Numerics/Vector`1.xml b/xml/System.Numerics/Vector`1.xml index eec5a6205ca..83199ae761f 100644 --- a/xml/System.Numerics/Vector`1.xml +++ b/xml/System.Numerics/Vector`1.xml @@ -82,9 +82,9 @@ is an immutable structure that represents a single vector of a specified numeric type. The count of instances is fixed, but its upper limit is CPU-register dependent. It's intended to be used as a building block for vectorizing large algorithms, and therefore cannot be used directly as an arbitrary length vector or tensor. + is an immutable structure that represents a single vector of a specified numeric type. The count of instances is fixed, but its upper limit is CPU-register dependent. It's intended to be used as a building block for vectorizing large algorithms, and therefore cannot be used directly as an arbitrary length vector or tensor. - The structure provides support for hardware acceleration. + The structure provides support for hardware acceleration. The term *primitive numeric data type* in this article refers to numeric data types that are directly supported by the CPU and have instructions that can manipulate those data types. @@ -167,7 +167,7 @@ The type `T` can be any of the following numeric types: ## Remarks - Only the first elements are added to the vector. The remainders are ignored. + Only the first elements are added to the vector. The remainders are ignored. ]]> @@ -219,7 +219,7 @@ The type `T` can be any of the following numeric types: ## Remarks - Only the first elements are added to the vector. The remainders are ignored. + Only the first elements are added to the vector. The remainders are ignored. ]]>
@@ -279,7 +279,7 @@ The type `T` can be any of the following numeric types: ## Remarks - Only the first elements are added to the vector. The remainders are ignored. + Only the first elements are added to the vector. The remainders are ignored. ]]>
@@ -370,7 +370,7 @@ The type `T` can be any of the following numeric types: ## Remarks - Only the first elements are added to the vector. The remainders are ignored. + Only the first elements are added to the vector. The remainders are ignored. ]]>
@@ -425,7 +425,7 @@ The type `T` can be any of the following numeric types: ## Remarks - Only the first elements are added to the vector. The remainders are ignored. + Only the first elements are added to the vector. The remainders are ignored. ]]>
@@ -622,7 +622,7 @@ The type `T` can be any of the following numeric types: elements. + The copy operation begins at index 0 of `destination`. The destination array must have at least elements. ]]> @@ -685,7 +685,7 @@ The type `T` can be any of the following numeric types: elements. + The copy operation begins at index `startIndex` of `destination`. The destination array must have at least `startIndex` + elements. ]]> @@ -1157,7 +1157,7 @@ The type `T` can be any of the following numeric types: method defines the addition operation for objects. + The method defines the addition operation for objects. ]]> @@ -1224,7 +1224,7 @@ The type `T` can be any of the following numeric types: method defines the bitwise `And` operation for objects. + The method defines the bitwise `And` operation for objects. ]]> @@ -1291,7 +1291,7 @@ The type `T` can be any of the following numeric types: method defines the bitwise `Or` operation for objects. + The method defines the bitwise `Or` operation for objects. ]]> @@ -1358,7 +1358,7 @@ The type `T` can be any of the following numeric types: method defines the division operation for objects. + The method defines the division operation for objects. ]]> @@ -1539,7 +1539,7 @@ The type `T` can be any of the following numeric types: method defines the bitwise `XOr` operation for objects. + The method defines the bitwise `XOr` operation for objects. ]]> @@ -1597,7 +1597,7 @@ The type `T` can be any of the following numeric types: operator defines a narrowing conversion; it requires a casting operator (in C#) or a conversion method (in Visual Basic). + The operator defines a narrowing conversion; it requires a casting operator (in C#) or a conversion method (in Visual Basic). ]]> @@ -1655,7 +1655,7 @@ The type `T` can be any of the following numeric types: operator defines a narrowing conversion; it requires a casting operator (in C#) or a conversion method (in Visual Basic). + The operator defines a narrowing conversion; it requires a casting operator (in C#) or a conversion method (in Visual Basic). ]]> @@ -1713,7 +1713,7 @@ The type `T` can be any of the following numeric types: operator defines a narrowing conversion; it requires a casting operator (in C#) or a conversion method (in Visual Basic). + The operator defines a narrowing conversion; it requires a casting operator (in C#) or a conversion method (in Visual Basic). ]]> @@ -1771,7 +1771,7 @@ The type `T` can be any of the following numeric types: operator defines a narrowing conversion; it requires a casting operator (in C#) or a conversion method (in Visual Basic). + The operator defines a narrowing conversion; it requires a casting operator (in C#) or a conversion method (in Visual Basic). ]]> @@ -1829,7 +1829,7 @@ The type `T` can be any of the following numeric types: operator defines a narrowing conversion; it requires a casting operator (in C#) or a conversion method (in Visual Basic). + The operator defines a narrowing conversion; it requires a casting operator (in C#) or a conversion method (in Visual Basic). ]]> @@ -1937,7 +1937,7 @@ The type `T` can be any of the following numeric types: operator defines a narrowing conversion; it requires a casting operator (in C#) or a conversion method (in Visual Basic). + The operator defines a narrowing conversion; it requires a casting operator (in C#) or a conversion method (in Visual Basic). ]]> @@ -1995,7 +1995,7 @@ The type `T` can be any of the following numeric types: operator defines a narrowing conversion; it requires a casting operator (in C#) or a conversion method (in Visual Basic). + The operator defines a narrowing conversion; it requires a casting operator (in C#) or a conversion method (in Visual Basic). ]]> @@ -2059,7 +2059,7 @@ The type `T` can be any of the following numeric types: operator defines a narrowing conversion; it requires a casting operator (in C#) or a conversion method (in Visual Basic). + The operator defines a narrowing conversion; it requires a casting operator (in C#) or a conversion method (in Visual Basic). ]]> @@ -2123,7 +2123,7 @@ The type `T` can be any of the following numeric types: operator defines a narrowing conversion; it requires a casting operator (in C#) or a conversion method (in Visual Basic). + The operator defines a narrowing conversion; it requires a casting operator (in C#) or a conversion method (in Visual Basic). ]]> @@ -2187,7 +2187,7 @@ The type `T` can be any of the following numeric types: operator defines a narrowing conversion; it requires a casting operator (in C#) or a conversion method (in Visual Basic). + The operator defines a narrowing conversion; it requires a casting operator (in C#) or a conversion method (in Visual Basic). ]]> @@ -2411,7 +2411,7 @@ The type `T` can be any of the following numeric types: method defines the multiplication operation for objects. + The method defines the multiplication operation for objects. ]]> @@ -2471,7 +2471,7 @@ The type `T` can be any of the following numeric types: method defines the multiplication operation for objects. + The method defines the multiplication operation for objects. ]]> @@ -2531,7 +2531,7 @@ The type `T` can be any of the following numeric types: method defines the multiplication operation for objects. + The method defines the multiplication operation for objects. ]]> @@ -2695,7 +2695,7 @@ The type `T` can be any of the following numeric types: method defines the subtraction operation for objects. + The method defines the subtraction operation for objects. ]]> @@ -2753,7 +2753,7 @@ The type `T` can be any of the following numeric types: method defines the unary negation operation for objects. + The method defines the unary negation operation for objects. ]]> diff --git a/xml/System/AccessViolationException.xml b/xml/System/AccessViolationException.xml index 6a63e0b1049..abe59075ad9 100644 --- a/xml/System/AccessViolationException.xml +++ b/xml/System/AccessViolationException.xml @@ -117,8 +117,8 @@ |Property|Value| |--------------|-----------| -||`null`.| -||The localized error message string.| +||`null`.| +||The localized error message string.| ]]>
@@ -172,8 +172,8 @@ |Property|Value| |--------------|-----------| -||`null`.| -||The error message string specified in `message`.| +||`null`.| +||The error message string specified in `message`.| ]]>
@@ -296,8 +296,8 @@ |Property|Value| |--------------|-----------| -||`null`.| -||The error message string specified in `message`.| +||`null`.| +||The error message string specified in `message`.| ]]>
diff --git a/xml/System/Action.xml b/xml/System/Action.xml index 0f129e27393..850a253871f 100644 --- a/xml/System/Action.xml +++ b/xml/System/Action.xml @@ -70,7 +70,7 @@ 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 delegate instead. +> To reference a method that has no parameters and returns a value, use the generic delegate instead. When you use the 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. diff --git a/xml/System/Action`1.xml b/xml/System/Action`1.xml index e51c94964a7..26feaa8c744 100644 --- a/xml/System/Action`1.xml +++ b/xml/System/Action`1.xml @@ -77,39 +77,39 @@ 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. + You can use the 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 delegate instead. +> To reference a method that has one parameter and returns a value, use the generic delegate instead. - When you use the 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 method or the `ShowWindowsMessage` method to its delegate instance. + When you use the 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 method or the `ShowWindowsMessage` method to its delegate instance. :::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/System/ActionT/Overview/Delegate.vb" id="Snippet1"::: - The following example simplifies this code by instantiating the delegate instead of explicitly defining a new delegate and assigning a named method to it. + The following example simplifies this code by instantiating the delegate instead of explicitly defining a new delegate and assigning a named method to it. :::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/System/ActionT/Overview/Action1.vb" id="Snippet2"::: - You can also use the 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).) + You can also use the 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 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).) + You can also assign a lambda expression to an 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/System/ActionT/Overview/lambda.vb" id="Snippet4"::: - The and methods each take an 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 method to provide an illustration. + The and methods each take an 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 method to provide an illustration. ## Examples - The following example demonstrates the use of the delegate to print the contents of a 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 variable. Instead, it passes a reference to a method that takes a single parameter and that does not return a value to the method, whose single parameter is an delegate. Similarly, in the C# example, an delegate is not explicitly instantiated because the signature of the anonymous method matches the signature of the delegate that is expected by the method. + The following example demonstrates the use of the delegate to print the contents of a 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 variable. Instead, it passes a reference to a method that takes a single parameter and that does not return a value to the method, whose single parameter is an delegate. Similarly, in the C# example, an delegate is not explicitly instantiated because the signature of the anonymous method matches the signature of the delegate that is expected by the method. :::code language="csharp" source="~/snippets/csharp/System/ActionT/Overview/action.cs" id="Snippet01"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Action_PrintExample/fs/action.fs" id="Snippet01"::: diff --git a/xml/System/Action`10.xml b/xml/System/Action`10.xml index 1ce06fc40c0..b5c59414038 100644 --- a/xml/System/Action`10.xml +++ b/xml/System/Action`10.xml @@ -142,16 +142,16 @@ The tenth parameter of the method that this delegate encapsulates. Encapsulates a method that has 10 parameters and does not return a value. - 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. - + 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 delegate instead. - - You can also use the delegate with anonymous methods and lambda expressions. - +> To reference a method that has 10 parameters and returns a value, use the generic delegate instead. + + You can also use the delegate with anonymous methods and lambda expressions. + ]]> diff --git a/xml/System/Action`11.xml b/xml/System/Action`11.xml index 4f243f172b2..c4747633d27 100644 --- a/xml/System/Action`11.xml +++ b/xml/System/Action`11.xml @@ -150,16 +150,16 @@ The eleventh parameter of the method that this delegate encapsulates. Encapsulates a method that has 11 parameters and does not return a value. - 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. - + 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 delegate instead. - - You can also use the delegate with anonymous methods and lambda expressions. - +> To reference a method that has 11 parameters and returns a value, use the generic delegate instead. + + You can also use the delegate with anonymous methods and lambda expressions. + ]]> diff --git a/xml/System/Action`12.xml b/xml/System/Action`12.xml index 4093a07e7be..52d8413bd84 100644 --- a/xml/System/Action`12.xml +++ b/xml/System/Action`12.xml @@ -158,16 +158,16 @@ The twelfth parameter of the method that this delegate encapsulates. Encapsulates a method that has 12 parameters and does not return a value. - 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 12 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. - + 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 12 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 12 parameters and returns a value, use the generic delegate instead. - - You can also use the delegate with anonymous methods and lambda expressions. - +> To reference a method that has 12 parameters and returns a value, use the generic delegate instead. + + You can also use the delegate with anonymous methods and lambda expressions. + ]]> diff --git a/xml/System/Action`13.xml b/xml/System/Action`13.xml index 7b4a57eccfd..c7bf39354cd 100644 --- a/xml/System/Action`13.xml +++ b/xml/System/Action`13.xml @@ -166,16 +166,16 @@ The thirteenth parameter of the method that this delegate encapsulates. Encapsulates a method that has 13 parameters and does not return a value. - 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 13 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. - + 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 13 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 13 parameters and returns a value, use the generic delegate instead. - - You can also use the delegate with anonymous methods and lambda expressions. - +> To reference a method that has 13 parameters and returns a value, use the generic delegate instead. + + You can also use the delegate with anonymous methods and lambda expressions. + ]]> diff --git a/xml/System/Action`14.xml b/xml/System/Action`14.xml index 495a67a3462..6fe9767e94e 100644 --- a/xml/System/Action`14.xml +++ b/xml/System/Action`14.xml @@ -174,16 +174,16 @@ The fourteenth parameter of the method that this delegate encapsulates. Encapsulates a method that has 14 parameters and does not return a value. - 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 14 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. - + 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 14 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 14 parameters and returns a value, use the generic delegate instead. - - You can also use the delegate with anonymous methods and lambda expressions. - +> To reference a method that has 14 parameters and returns a value, use the generic delegate instead. + + You can also use the delegate with anonymous methods and lambda expressions. + ]]> diff --git a/xml/System/Action`15.xml b/xml/System/Action`15.xml index 41649a0a661..2c70e6153dd 100644 --- a/xml/System/Action`15.xml +++ b/xml/System/Action`15.xml @@ -182,16 +182,16 @@ The fifteenth parameter of the method that this delegate encapsulates. Encapsulates a method that has 15 parameters and does not return a value. - 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 15 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. - + 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 15 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 15 parameters and returns a value, use the generic delegate instead. - - You can also use the delegate with anonymous methods and lambda expressions. - +> To reference a method that has 15 parameters and returns a value, use the generic delegate instead. + + You can also use the delegate with anonymous methods and lambda expressions. + ]]> diff --git a/xml/System/Action`16.xml b/xml/System/Action`16.xml index 85615321818..cb560e3af37 100644 --- a/xml/System/Action`16.xml +++ b/xml/System/Action`16.xml @@ -190,16 +190,16 @@ The sixteenth parameter of the method that this delegate encapsulates. Encapsulates a method that has 16 parameters and does not return a value. - 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 16 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. - + 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 16 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 16 parameters and returns a value, use the generic delegate instead. - - You can also use the delegate with anonymous methods and lambda expressions. - +> To reference a method that has 16 parameters and returns a value, use the generic delegate instead. + + You can also use the delegate with anonymous methods and lambda expressions. + ]]> diff --git a/xml/System/Action`2.xml b/xml/System/Action`2.xml index b4cc39cbc6f..24e3c017e54 100644 --- a/xml/System/Action`2.xml +++ b/xml/System/Action`2.xml @@ -99,32 +99,32 @@ The second parameter of the method that this delegate encapsulates. Encapsulates a method that has two parameters and does not return a value. - 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 two parameters that are both passed to it by value, and it must not return a value. (In C#, the method must return `void`. In F#, the method or function 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. - + 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 two parameters that are both passed to it by value, and it must not return a value. (In C#, the method must return `void`. In F#, the method or function 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 two parameters and returns a value, use the generic delegate instead. - - When you use the delegate, you do not have to explicitly define a delegate that encapsulates a method with two parameters. For example, the following code explicitly declares a delegate named `ConcatStrings`. It then assigns a reference to either of two methods to its delegate instance. One method writes two strings to the console; the second writes two strings to a file. - +> To reference a method that has two parameters and returns a value, use the generic delegate instead. + + When you use the delegate, you do not have to explicitly define a delegate that encapsulates a method with two parameters. For example, the following code explicitly declares a delegate named `ConcatStrings`. It then assigns a reference to either of two methods to its delegate instance. One method writes two strings to the console; the second writes two strings to a file. + :::code language="csharp" source="~/snippets/csharp/System/ActionT1,T2/Overview/Delegate.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Action~2/fs/Delegate.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/ActionT1,T2/Overview/Delegate.vb" id="Snippet1"::: - - The following example simplifies this code by instantiating the delegate instead of explicitly defining a new delegate and assigning a named method to it. - + + The following example simplifies this code by instantiating the delegate instead of explicitly defining a new delegate and assigning a named method to it. + :::code language="csharp" source="~/snippets/csharp/System/ActionT1,T2/Overview/Action2.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Action~2/fs/Action2.fs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/System/ActionT1,T2/Overview/action2.vb" id="Snippet2"::: - - You can also use the 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="vb" source="~/snippets/visualbasic/System/ActionT1,T2/Overview/action2.vb" id="Snippet2"::: + + You can also use the 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/ActionT1,T2/Overview/Anon.cs" id="Snippet3"::: - You can also assign a lambda expression to an 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).) - + You can also assign a lambda expression to an 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/ActionT1,T2/Overview/Lambda.cs" id="Snippet4"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Action~2/fs/Lambda.fs" id="Snippet4"::: :::code language="vb" source="~/snippets/visualbasic/System/ActionT1,T2/Overview/lambda.vb" id="Snippet4"::: diff --git a/xml/System/Action`3.xml b/xml/System/Action`3.xml index bd3fdcc5f23..acd026ce5ed 100644 --- a/xml/System/Action`3.xml +++ b/xml/System/Action`3.xml @@ -116,28 +116,28 @@ 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 three parameters that are all passed to it by value, and it must not return a value. (In C#, the method must return `void`. In F#, the method or function 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. + You can use the 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 three parameters that are all passed to it by value, and it must not return a value. (In C#, the method must return `void`. In F#, the method or function 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 three parameters and returns a value, use the generic delegate instead. +> To reference a method that has three parameters and returns a value, use the generic delegate instead. - When you use the delegate, you don't have to explicitly define a delegate that encapsulates a method with three parameters. For example, the following code explicitly declares a delegate named `StringCopy` and assigns a reference to the `CopyStrings` method to its delegate instance. + When you use the delegate, you don't have to explicitly define a delegate that encapsulates a method with three parameters. For example, the following code explicitly declares a delegate named `StringCopy` and assigns a reference to the `CopyStrings` method to its delegate instance. :::code language="csharp" source="~/snippets/csharp/System/ActionT1,T2,T3/Overview/Delegate.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Action~3/fs/Delegate.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/ActionT1,T2,T3/Overview/Delegate.vb" id="Snippet1"::: - The following example simplifies this code by instantiating the delegate instead of explicitly defining a new delegate and assigning a named method to it. + The following example simplifies this code by instantiating the delegate instead of explicitly defining a new delegate and assigning a named method to it. :::code language="csharp" source="~/snippets/csharp/System/ActionT1,T2,T3/Overview/Action3.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Action~3/fs/Action3.fs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System/ActionT1,T2,T3/Overview/Action3.vb" id="Snippet2"::: - You can also use the 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).) + You can also use the 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/ActionT1,T2,T3/Overview/Anon.cs" id="Snippet3"::: - You can also assign a lambda expression to an 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).) + You can also assign a lambda expression to an 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/ActionT1,T2,T3/Overview/Lambda.cs" id="Snippet4"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Action~3/fs/Lambda.fs" id="Snippet4"::: diff --git a/xml/System/Action`4.xml b/xml/System/Action`4.xml index a989bb5863e..09b9210f5ad 100644 --- a/xml/System/Action`4.xml +++ b/xml/System/Action`4.xml @@ -107,36 +107,36 @@ The fourth parameter of the method that this delegate encapsulates. Encapsulates a method that has four parameters and does not return a value. - 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 four parameters that are all passed to it by value, and it must not return a value. (In C#, the method must return `void`. In F#, the method or function 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. - + 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 four parameters that are all passed to it by value, and it must not return a value. (In C#, the method must return `void`. In F#, the method or function 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 four parameters and returns a value, use the generic delegate instead. - - When you use the delegate, you do not have to explicitly define a delegate that encapsulates a method with four parameters. For example, the following code explicitly declares a delegate named `StringCopy` and assigns a reference to the `CopyStrings` method to its delegate instance. - +> To reference a method that has four parameters and returns a value, use the generic delegate instead. + + When you use the delegate, you do not have to explicitly define a delegate that encapsulates a method with four parameters. For example, the following code explicitly declares a delegate named `StringCopy` and assigns a reference to the `CopyStrings` method to its delegate instance. + :::code language="csharp" source="~/snippets/csharp/System/ActionT1,T2,T3,T4/Overview/Delegate.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Action~4/fs/Delegate.fs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System/ActionT1,T2,T3,T4/Overview/Delegate.vb" id="Snippet1"::: - - The following example simplifies this code by instantiating the delegate instead of explicitly defining a new delegate and assigning a named method to it. - + :::code language="vb" source="~/snippets/visualbasic/System/ActionT1,T2,T3,T4/Overview/Delegate.vb" id="Snippet1"::: + + The following example simplifies this code by instantiating the delegate instead of explicitly defining a new delegate and assigning a named method to it. + :::code language="csharp" source="~/snippets/csharp/System/ActionT1,T2,T3,T4/Overview/Action4.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Action~4/fs/Action4.fs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/System/ActionT1,T2,T3,T4/Overview/Action4.vb" id="Snippet2"::: - - You can also use the 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/ActionT1,T2,T3,T4/Overview/Anon.cs" id="Snippet3"::: - - You can also assign a lambda expression to an 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/System/ActionT1,T2,T3,T4/Overview/Action4.vb" id="Snippet2"::: + + You can also use the 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/ActionT1,T2,T3,T4/Overview/Anon.cs" id="Snippet3"::: + + You can also assign a lambda expression to an 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/ActionT1,T2,T3,T4/Overview/Lambda.cs" id="Snippet4"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Action~4/fs/Lambda.fs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/System/ActionT1,T2,T3,T4/Overview/lambda.vb" id="Snippet4"::: - + :::code language="vb" source="~/snippets/visualbasic/System/ActionT1,T2,T3,T4/Overview/lambda.vb" id="Snippet4"::: + ]]> diff --git a/xml/System/Action`5.xml b/xml/System/Action`5.xml index 5dca96cfec9..7dec2e1c2d9 100644 --- a/xml/System/Action`5.xml +++ b/xml/System/Action`5.xml @@ -102,16 +102,16 @@ The fifth parameter of the method that this delegate encapsulates. Encapsulates a method that has five parameters and does not return a value. - 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 five 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. - + 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 five 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 five parameters and returns a value, use the generic delegate instead. - - You can also use the delegate with anonymous methods and lambda expressions. - +> To reference a method that has five parameters and returns a value, use the generic delegate instead. + + You can also use the delegate with anonymous methods and lambda expressions. + ]]> diff --git a/xml/System/Action`6.xml b/xml/System/Action`6.xml index dd7798d7169..ef4fd544f31 100644 --- a/xml/System/Action`6.xml +++ b/xml/System/Action`6.xml @@ -110,16 +110,16 @@ The sixth parameter of the method that this delegate encapsulates. Encapsulates a method that has six parameters and does not return a value. - 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 six 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. - + 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 six 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 six parameters and returns a value, use the generic delegate instead. - - You can also use the delegate with anonymous methods and lambda expressions. - +> To reference a method that has six parameters and returns a value, use the generic delegate instead. + + You can also use the delegate with anonymous methods and lambda expressions. + ]]> diff --git a/xml/System/Action`7.xml b/xml/System/Action`7.xml index 0013af7c013..cec250fa200 100644 --- a/xml/System/Action`7.xml +++ b/xml/System/Action`7.xml @@ -118,16 +118,16 @@ The seventh parameter of the method that this delegate encapsulates. Encapsulates a method that has seven parameters and does not return a value. - 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 seven 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. - + 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 seven 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 seven parameters and returns a value, use the generic delegate instead. - - You can also use the delegate with anonymous methods and lambda expressions. - +> To reference a method that has seven parameters and returns a value, use the generic delegate instead. + + You can also use the delegate with anonymous methods and lambda expressions. + ]]> diff --git a/xml/System/Action`8.xml b/xml/System/Action`8.xml index d025ac83eac..b0cd8193fa3 100644 --- a/xml/System/Action`8.xml +++ b/xml/System/Action`8.xml @@ -126,16 +126,16 @@ The eighth parameter of the method that this delegate encapsulates. Encapsulates a method that has eight parameters and does not return a value. - 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 eight 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. - + 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 eight 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 eight parameters and returns a value, use the generic delegate instead. - - You can also use the delegate with anonymous methods and lambda expressions. - +> To reference a method that has eight parameters and returns a value, use the generic delegate instead. + + You can also use the delegate with anonymous methods and lambda expressions. + ]]> diff --git a/xml/System/Action`9.xml b/xml/System/Action`9.xml index 9650aaa6937..ccbeac12aa1 100644 --- a/xml/System/Action`9.xml +++ b/xml/System/Action`9.xml @@ -134,16 +134,16 @@ The ninth parameter of the method that this delegate encapsulates. Encapsulates a method that has nine parameters and does not return a value. - 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 nine 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. - + 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 nine 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 nine parameters and returns a value, use the generic delegate instead. - - You can also use the delegate with anonymous methods and lambda expressions. - +> To reference a method that has nine parameters and returns a value, use the generic delegate instead. + + You can also use the delegate with anonymous methods and lambda expressions. + ]]> diff --git a/xml/System/ActivationContext.xml b/xml/System/ActivationContext.xml index aad8822bc8a..2b1e48576b7 100644 --- a/xml/System/ActivationContext.xml +++ b/xml/System/ActivationContext.xml @@ -41,7 +41,7 @@ The class contains an and provides internal-only access to the application manifest. The activation context is used during manifest-based activation to set up the domain policy and provide an application-based security model. For more information, see the class. > [!IMPORTANT] -> This type implements the interface. When you have finished using the type, you should dispose of it either directly or indirectly. To dispose of the type directly, call its method in a `try`/`catch` block. To dispose of it indirectly, use a language construct such as `using` (in C#) or `Using` (in Visual Basic). For more information, see the "Using an Object that Implements IDisposable" section in the interface topic. +> This type implements the interface. When you have finished using the type, you should dispose of it either directly or indirectly. To dispose of the type directly, call its method in a `try`/`catch` block. To dispose of it indirectly, use a language construct such as `using` (in C#) or `Using` (in Visual Basic). For more information, see the "Using an Object that Implements IDisposable" section in the interface topic. @@ -128,7 +128,7 @@ method calls an internal constructor to create a new activation context. The implementation of the class in the .NET Framework version 2.0 is designed for applications that are neither fully installed in a store nor fully contained in a folder. This method provides backward compatibility for later releases in which public constructors provide full activation contexts. + The method calls an internal constructor to create a new activation context. The implementation of the class in the .NET Framework version 2.0 is designed for applications that are neither fully installed in a store nor fully contained in a folder. This method provides backward compatibility for later releases in which public constructors provide full activation contexts. ]]> @@ -166,7 +166,7 @@ method calls an internal constructor to create a new activation context. The implementation of the class in the .NET Framework version 2.0 is designed for applications that are neither fully installed in a store nor fully contained in a folder. This method provides backward compatibility for later releases in which public constructors provide full activation contexts. + The method calls an internal constructor to create a new activation context. The implementation of the class in the .NET Framework version 2.0 is designed for applications that are neither fully installed in a store nor fully contained in a folder. This method provides backward compatibility for later releases in which public constructors provide full activation contexts. ]]> @@ -248,10 +248,10 @@ when you are finished using the . The method leaves the in an unusable state. After calling , you must release all references to the so the garbage collector can reclaim the memory that the was occupying. For more information, see [Cleaning Up Unmanaged Resources](/dotnet/standard/garbage-collection/unmanaged) and [Implementing a Dispose Method](/dotnet/standard/garbage-collection/implementing-dispose). + Call when you are finished using the . The method leaves the in an unusable state. After calling , you must release all references to the so the garbage collector can reclaim the memory that the was occupying. For more information, see [Cleaning Up Unmanaged Resources](/dotnet/standard/garbage-collection/unmanaged) and [Implementing a Dispose Method](/dotnet/standard/garbage-collection/implementing-dispose). > [!NOTE] -> Always call before you release your last reference to the . Otherwise, the resources it is using will not be freed until the garbage collector calls the object's `Finalize` method. +> Always call before you release your last reference to the . Otherwise, the resources it is using will not be freed until the garbage collector calls the object's `Finalize` method. ]]> diff --git a/xml/System/Activator.xml b/xml/System/Activator.xml index 7c2c68e8546..5faa68bad01 100644 --- a/xml/System/Activator.xml +++ b/xml/System/Activator.xml @@ -81,7 +81,7 @@ method creates an instance of a type defined in an assembly by invoking the constructor that best matches the specified arguments. If no arguments are specified, the constructor that takes no parameters, that is, the parameterless constructor, is invoked. + The method creates an instance of a type defined in an assembly by invoking the constructor that best matches the specified arguments. If no arguments are specified, the constructor that takes no parameters, that is, the parameterless constructor, is invoked. You must have sufficient permission to search for and call a constructor; otherwise, an exception is thrown. By default, only public constructors are considered during the search for a constructor. If no constructor or parameterless constructor can be found, an exception is thrown. @@ -93,9 +93,9 @@ If the instance is created locally, a reference to that object is returned. If the instance is created remotely, a reference to a proxy is returned. The remote object is manipulated through the proxy as if it were a local object. - The method creates a proxy to a currently running remote object, server-activated well-known object, or XML Web service. You can specify the connection medium, that is, the channel. For more information, see the class. + The method creates a proxy to a currently running remote object, server-activated well-known object, or XML Web service. You can specify the connection medium, that is, the channel. For more information, see the class. - Assemblies contain type definitions. The method creates an instance of a type from a currently running assembly. The method creates an instance from a file that contains an assembly. The method creates an instance of a COM object from a file that contains an assembly. + Assemblies contain type definitions. The method creates an instance of a type from a currently running assembly. The method creates an instance from a file that contains an assembly. The method creates an instance of a COM object from a file that contains an assembly. ## Examples The following example shows how to use the class to dynamically construct objects at run time. @@ -160,11 +160,11 @@ method to unwrap the return value. + Use the method to unwrap the return value. - A attribute with a value of `true` must be applied either explicitly or by default to the COM type so the method can create an instance of that type; otherwise, is thrown. + A attribute with a value of `true` must be applied either explicitly or by default to the COM type so the method can create an instance of that type; otherwise, is thrown. - For information about other exceptions that can be thrown by invoked methods, see the Exceptions section of the and methods. + For information about other exceptions that can be thrown by invoked methods, see the Exceptions section of the and methods. > [!NOTE] > This method can be used to create nonpublic types if the caller has been granted with the flag and if the grant set of the assembly that contains the nonpublic types is restricted to the caller's grant set or to a subset thereof. (See [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection).) To use this functionality, your application should target .NET Framework 3.5 or later. @@ -237,11 +237,11 @@ method to unwrap the return value. + Use the method to unwrap the return value. - A attribute with a value of `true` must be applied either explicitly or by default to the COM type so the method can create an instance of that type; otherwise, is thrown. + A attribute with a value of `true` must be applied either explicitly or by default to the COM type so the method can create an instance of that type; otherwise, is thrown. - For information about other exceptions that can be thrown by invoked methods, see the Exceptions section of the and methods. + For information about other exceptions that can be thrown by invoked methods, see the Exceptions section of the and methods. > [!NOTE] > This method can be used to create nonpublic types if the caller has been granted with the flag and if the grant set of the assembly that contains the nonpublic types is restricted to the caller's grant set or to a subset thereof. (See [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection).) To use this functionality, your application should target .NET Framework 3.5 or later. @@ -327,7 +327,7 @@ method to unwrap the return value. + Use the method to unwrap the return value. The activation context is used during manifest-based activation to set up the domain policy and to provide an application-based security model. The class contains an object that provides access to the application manifest. For more information, see the class. @@ -409,7 +409,7 @@ > This method can be used to access nonpublic types if the caller has been granted with the flag and if the grant set of the assembly that contains the nonpublic types is restricted to the caller's grant set or to a subset thereof. (See [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection).) To use this functionality, your application should target .NET Framework 3.5 or later. ## Examples - The following code example demonstrates how to call the method. Instances of several different types are created and their default values are displayed. + The following code example demonstrates how to call the method. Instances of several different types are created and their default values are displayed. :::code language="csharp" source="~/snippets/csharp/System/Activator/Overview/source2.cs" id="Snippet4"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/ActivatorX/fs/source2.fs" id="Snippet4"::: @@ -493,7 +493,7 @@ Note: In .NET for Win method to unwrap the return value. + Use the method to unwrap the return value. The activation context is used during manifest-based activation to set up the domain policy and to provide an application-based security model. The class contains an object that provides access to the application manifest. For more information, see the class. @@ -567,7 +567,7 @@ Note: In .NET for Win to unwrap the return value. + Use to unwrap the return value. `assemblyName` can be either of the following: @@ -577,7 +577,7 @@ Note: In .NET for Win For more information on how the common language runtime identifies and loads assemblies, see [How the Runtime Locates Assemblies](/dotnet/framework/deployment/how-the-runtime-locates-assemblies). For information on using the application configuration file to define assembly locations, see [Specifying an Assembly's Location](/dotnet/framework/configure-apps/specify-assembly-location). If `assemblyName` is found, it is loaded in the default context. - In .NET Core 3.0 and later versions, assembly loads triggered by this API are affected by the current value of . + In .NET Core 3.0 and later versions, assembly loads triggered by this API are affected by the current value of . > [!NOTE] > This method can be used to create nonpublic types if the caller has been granted with the flag and if the grant set of the assembly that contains the nonpublic types is restricted to the caller's grant set or to a subset thereof. (See [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection).) To use this functionality, your application should target .NET Framework 3.5 or later. @@ -591,13 +591,13 @@ Note: In .NET for Win :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.activator.createinstance/fs/personinfo.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/Activator/CreateInstance/personinfo.vb" id="Snippet1"::: - The following example calls the method to instantiate the `Person` class. It requires a reference to PersonInfo.dll to be added to the project. Because the method calls the `Person` class parameterless constructor, the example assigns a value to its `Name` property. + The following example calls the method to instantiate the `Person` class. It requires a reference to PersonInfo.dll to be added to the project. Because the method calls the `Person` class parameterless constructor, the example assigns a value to its `Name` property. :::code language="csharp" source="~/snippets/csharp/System/Activator/CreateInstance/createinstanceex1.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.activator.createinstance/fs/createinstanceex1.fs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System/Activator/CreateInstance/createinstanceex1.vb" id="Snippet2"::: - However, is frequently called to instantiate a type that crosses machine boundaries or that is not known at design time. In this case, you cannot include a reference to the assembly in the project and cannot make early-bound calls to the type's members. To work around this limitation, the following example uses the method along with reflection to assign a value to the `Person` object's `Name` property and to display its value. + However, is frequently called to instantiate a type that crosses machine boundaries or that is not known at design time. In this case, you cannot include a reference to the assembly in the project and cannot make early-bound calls to the type's members. To work around this limitation, the following example uses the method along with reflection to assign a value to the `Person` object's `Name` property and to display its value. :::code language="csharp" source="~/snippets/csharp/System/Activator/CreateInstance/createinstanceex1a.cs" id="Snippet3"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.activator.createinstance/fs/createinstanceex1a.fs" id="Snippet3"::: @@ -819,13 +819,13 @@ Note: In .NET for Win ## Examples - The following example calls the method to create a object. It calls the constructor to instantiate a string that contains ten elements from a character array starting at the fourteenth position. + The following example calls the method to create a object. It calls the constructor to instantiate a string that contains ten elements from a character array starting at the fourteenth position. :::code language="csharp" source="~/snippets/csharp/System/Activator/CreateInstance/CreateInstance5.cs" id="Snippet5"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.activator.createinstance/fs/CreateInstance5.fs" id="Snippet5"::: :::code language="vb" source="~/snippets/visualbasic/System/Activator/CreateInstance/CreateInstance5.vb" id="Snippet5"::: - The following example creates a jagged array whose elements are arguments to be passed to a constructor. The example then passes each array to the method to invoke the appropriate string constructor. + The following example creates a jagged array whose elements are arguments to be passed to a constructor. The example then passes each array to the method to invoke the appropriate string constructor. :::code language="csharp" source="~/snippets/csharp/System/Activator/CreateInstance/createinstance2.cs" id="Snippet4"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.activator.createinstance/fs/createinstance2.fs" id="Snippet4"::: @@ -915,9 +915,9 @@ Note: In .NET for Win when a host needs to execute code in an application domain that has restricted security permissions. + Use when a host needs to execute code in an application domain that has restricted security permissions. - Use to unwrap the return value. + Use to unwrap the return value. ]]> @@ -1024,9 +1024,9 @@ Note: In .NET for Win to unwrap the return value. + Use to unwrap the return value. - In .NET Core 3.0 and later versions, assembly loads triggered by this API are affected by the current value of . + In .NET Core 3.0 and later versions, assembly loads triggered by this API are affected by the current value of . > [!NOTE] > This method can be used to create nonpublic types if the caller has been granted with the flag and if the grant set of the nonpublic types is restricted to the caller's grant set or to a subset thereof. (See [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection).) To use this functionality, your application should target .NET Framework 3.5 or later. @@ -1505,9 +1505,9 @@ An error occurred when attempting remote activation in a target specified in to unwrap the return value. + Use to unwrap the return value. - In .NET Core 3.0 and later versions, assembly loads triggered by this API are affected by the current value of . + In .NET Core 3.0 and later versions, assembly loads triggered by this API are affected by the current value of . > [!NOTE] > This method can be used to create nonpublic types and members if the caller has been granted with the flag and if the grant set of the assembly that contains the nonpublic types and members is restricted to the caller's grant set or to a subset thereof. (See [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection).) To use this functionality, your application should target .NET Framework 3.5 or later. @@ -1604,9 +1604,9 @@ An error occurred when attempting remote activation in a target specified in when a host needs to execute code in an application domain that has restricted security permissions. + Use when a host needs to execute code in an application domain that has restricted security permissions. - Use to unwrap the return value. + Use to unwrap the return value. ]]> @@ -1706,7 +1706,7 @@ An error occurred when attempting remote activation in a target specified in to unwrap the return value. + Use to unwrap the return value. > [!NOTE] > This method can be used to create nonpublic types and members if the caller has been granted with the flag and if the grant set of the assembly that contains the nonpublic types and members is restricted to the caller's grant set or to a subset thereof. (See [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection).) To use this functionality, your application should target .NET Framework 3.5 or later. @@ -1808,9 +1808,9 @@ An error occurred when attempting remote activation in a target specified in when a host needs to execute code in an application domain that has restricted security permissions. + Use when a host needs to execute code in an application domain that has restricted security permissions. - Use to unwrap the return value. + Use to unwrap the return value. ]]> @@ -1916,15 +1916,15 @@ An error occurred when attempting remote activation in a target specified in generic method is used by compilers to implement the instantiation of types specified by type parameters. For example, in the following generic method, the implementation of `new T()` uses the generic method. + The generic method is used by compilers to implement the instantiation of types specified by type parameters. For example, in the following generic method, the implementation of `new T()` uses the generic method. :::code language="csharp" source="~/snippets/csharp/System/Activator/CreateInstanceT/remarks.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.activation.createinstance~~1/fs/remarks.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/Activator/CreateInstanceT/remarks.vb" id="Snippet1"::: - In general, there is no use for the generic method in application code, because the type must be known at compile time. If the type is known at compile time, normal instantiation syntax can be used (`new` operator in C#, `New` in Visual Basic). If the type is not known at compile time, you can call a non-generic overload of . + In general, there is no use for the generic method in application code, because the type must be known at compile time. If the type is known at compile time, normal instantiation syntax can be used (`new` operator in C#, `New` in Visual Basic). If the type is not known at compile time, you can call a non-generic overload of . - There are no overloads of the generic method that take argument lists, because the non-generic overloads of already provide late-bound constructor resolution. + There are no overloads of the generic method that take argument lists, because the non-generic overloads of already provide late-bound constructor resolution. ]]> @@ -2007,12 +2007,12 @@ Note: In .NET for Win method to unwrap the return value. + Use the method to unwrap the return value. - For information about other exceptions that can be thrown by invoked methods, see the Exceptions section of the and methods. + For information about other exceptions that can be thrown by invoked methods, see the Exceptions section of the and methods. ## Examples - The following code example demonstrates how to call the method. This code example is part of a larger example provided for the class. + The following code example demonstrates how to call the method. This code example is part of a larger example provided for the class. :::code language="csharp" source="~/snippets/csharp/System/Activator/Overview/ActivatorX.cs" id="Snippet3"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/ActivatorX/fs/ActivatorX.fs" id="Snippet3"::: @@ -2082,11 +2082,11 @@ Note: In .NET for Win when a host needs to execute code in an application domain that has restricted security permissions. + Use when a host needs to execute code in an application domain that has restricted security permissions. - Use the method to unwrap the return value. + Use the method to unwrap the return value. - For information about other exceptions that can be thrown by invoked methods, see the Exceptions section of the and methods. + For information about other exceptions that can be thrown by invoked methods, see the Exceptions section of the and methods. ]]> @@ -2183,9 +2183,9 @@ Note: In .NET for Win method to unwrap the return value. + Use the method to unwrap the return value. - For information about other exceptions that can be thrown by invoked methods, see the Exceptions section of the and methods. + For information about other exceptions that can be thrown by invoked methods, see the Exceptions section of the and methods. ]]> @@ -2290,9 +2290,9 @@ Note: In .NET for Win method to unwrap the return value. + Use the method to unwrap the return value. - For information about other exceptions that can be thrown by invoked methods, see the Exceptions section of the and methods. + For information about other exceptions that can be thrown by invoked methods, see the Exceptions section of the and methods. ]]> @@ -2374,11 +2374,11 @@ Note: In .NET for Win when a host needs to execute code in an application domain that has restricted security permissions. + Use when a host needs to execute code in an application domain that has restricted security permissions. - Use the method to unwrap the return value. + Use the method to unwrap the return value. - For information about other exceptions that can be thrown by invoked methods, see the Exceptions sections of the and methods. + For information about other exceptions that can be thrown by invoked methods, see the Exceptions sections of the and methods. ]]> @@ -2462,9 +2462,9 @@ Note: In .NET for Win method to unwrap the return value. + Use the method to unwrap the return value. - For information about other exceptions that can be thrown by invoked methods, see the Exceptions section of the and methods. + For information about other exceptions that can be thrown by invoked methods, see the Exceptions section of the and methods. ]]> @@ -2553,11 +2553,11 @@ Note: In .NET for Win when a host needs to execute code in an application domain that has restricted security permissions. + Use when a host needs to execute code in an application domain that has restricted security permissions. - Use the method to unwrap the return value. + Use the method to unwrap the return value. - For information about other exceptions that can be thrown by invoked methods, see the Exceptions section of the and methods. + For information about other exceptions that can be thrown by invoked methods, see the Exceptions section of the and methods. ]]> @@ -2693,7 +2693,7 @@ Note: In .NET for Win ## Remarks Call the proxy to send messages to the remote object. No messages are sent over the network until a method is called on the proxy. - The `state` parameter communicates information to the channel, and is passed to the method. + The `state` parameter communicates information to the channel, and is passed to the method. ]]> diff --git a/xml/System/AggregateException.xml b/xml/System/AggregateException.xml index edcd891c6a4..e3afabfe644 100644 --- a/xml/System/AggregateException.xml +++ b/xml/System/AggregateException.xml @@ -87,7 +87,7 @@ ## Examples - The following example catches the exception and calls the method to handle each exception it contains. Compiling and running the example with the first `task1` variable should result in an object that contains an exception. Commenting out that line, uncommenting the second `task1` variable, and compiling and running the example produces an object that contains an exception. + The following example catches the exception and calls the method to handle each exception it contains. Compiling and running the example with the first `task1` variable should result in an object that contains an exception. Commenting out that line, uncommenting the second `task1` variable, and compiling and running the example produces an object that contains an exception. :::code language="csharp" source="~/snippets/csharp/System/AggregateException/Overview/exception1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.aggregateexception.class/fs/exception1.fs" id="Snippet1"::: @@ -156,8 +156,8 @@ |Property|Value| |--------------|-----------| -||`null`.| -||The localized error message string.| +||`null`.| +||The localized error message string.| ]]> @@ -316,8 +316,8 @@ |Property|Value| |--------------|-----------| -||`null`.| -||The error message string specified in `message`.| +||`null`.| +||The error message string specified in `message`.| ]]> @@ -512,8 +512,8 @@ |Property|Value| |--------------|-----------| -||`null`.| -||The error message string specified in `message`.| +||`null`.| +||The error message string specified in `message`.| ]]> @@ -632,7 +632,7 @@ exception before it is propagated to the parent task, which wraps that exception in its own exception before it propagates it back to the calling thread. In such cases, the property of the exception that is caught by the , , or method contains one or more instances, not the original exceptions that caused the fault. To avoid having to iterate over nested exceptions, you can use the method to remove all the nested exceptions, so that the property of the returned object contains the original exceptions. + If a task has an attached child task that throws an exception, that exception is wrapped in an exception before it is propagated to the parent task, which wraps that exception in its own exception before it propagates it back to the calling thread. In such cases, the property of the exception that is caught by the , , or method contains one or more instances, not the original exceptions that caused the fault. To avoid having to iterate over nested exceptions, you can use the method to remove all the nested exceptions, so that the property of the returned object contains the original exceptions. This method recursively flattens all instances of exceptions that are inner exceptions of the current instance. The inner exceptions returned in the new are the union of all the inner exceptions from exception tree rooted at the current instance. @@ -645,7 +645,7 @@ :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_Misc/tpl_exceptions/fs/flatten2.fs" id="Snippet22"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Misc/tpl_exceptions/vb/flatten2.vb" id="Snippet22"::: - You can also use the method to rethrow the inner exceptions from multiple instances thrown by multiple tasks in a single instance, as the following example shows. + You can also use the method to rethrow the inner exceptions from multiple instances thrown by multiple tasks in a single instance, as the following example shows. :::code language="csharp" source="~/snippets/csharp/System/AggregateException/Flatten/taskexceptions2.cs" id="Snippet13"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_Misc/tpl_exceptions/fs/taskexceptions2.fs" id="Snippet13"::: @@ -825,16 +825,16 @@ was handled. After all invocations, any unhandled exceptions are put into a new that will be thrown. If there are no unhandled exceptions, the method simply returns. If any invocations of the `predicate` throws an exception, it will halt the processing of any more exceptions and immediately propagate the thrown exception as-is. + Each invocation of the `predicate` returns true or false to indicate whether the was handled. After all invocations, any unhandled exceptions are put into a new that will be thrown. If there are no unhandled exceptions, the method simply returns. If any invocations of the `predicate` throws an exception, it will halt the processing of any more exceptions and immediately propagate the thrown exception as-is. ## Examples - Ordinarily, an exception handler that catches an exception uses a `foreach` loop (in C#) or `For Each` loop (in Visual Basic) to handle each exception in its collection. Instead, the following example uses the method to handle each exception, and only rethrows exceptions that are not `CustomException` instances. + Ordinarily, an exception handler that catches an exception uses a `foreach` loop (in C#) or `For Each` loop (in Visual Basic) to handle each exception in its collection. Instead, the following example uses the method to handle each exception, and only rethrows exceptions that are not `CustomException` instances. :::code language="csharp" source="~/snippets/csharp/System/AggregateException/Handle/handlemethod2.cs" id="Snippet16"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_Misc/tpl_exceptions/fs/handlemethod2.fs" id="Snippet16"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Misc/tpl_exceptions/vb/handlemethod2.vb" id="Snippet16"::: - The following is a more complete example that uses the method to provide special handling for an when enumerating files. + The following is a more complete example that uses the method to provide special handling for an when enumerating files. :::code language="csharp" source="~/snippets/csharp/System/AggregateException/Handle/taskexceptions.cs" id="Snippet12"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_Misc/tpl_exceptions/fs/taskexceptions.fs" id="Snippet12"::: diff --git a/xml/System/AppContext.xml b/xml/System/AppContext.xml index 2e6f5780e83..9087417bfe1 100644 --- a/xml/System/AppContext.xml +++ b/xml/System/AppContext.xml @@ -287,7 +287,7 @@ In .NET 5 and later versions, for bundled assemblies, the value returned is the ## Remarks The class enables library writers to provide a uniform opt-out mechanism for new functionality for their users. It establishes a loosely coupled contract between components in order to communicate an opt-out request. This capability is typically important when a change is made to existing functionality. Conversely, there is already an implicit opt-in for new functionality. - The method is called by an application (or a library) to declare the value of a switch (which is always a value) that a dependent library defines. The switch is always implicitly `false`, which provides the new behavior. Setting the switch to `true` enables it, which provides the legacy behavior. Explicitly setting the switch to `false` also provides the new behavior. The dependent library can then check the value of the switch by calling the method. + The method is called by an application (or a library) to declare the value of a switch (which is always a value) that a dependent library defines. The switch is always implicitly `false`, which provides the new behavior. Setting the switch to `true` enables it, which provides the legacy behavior. Explicitly setting the switch to `false` also provides the new behavior. The dependent library can then check the value of the switch by calling the method. > [!NOTE] > It's beneficial to use a consistent format for switch names, since they are a formal contract exposed by a library. The following are two obvious formats. @@ -307,12 +307,12 @@ In .NET 5 and later versions, for bundled assemblies, the value returned is the ``` -- By adding a string value whose name is the name of the switch to the **HKLM\SOFTWARE\Microsoft\\.NETFramework\AppContext** (and **HKLM\SOFTWARE\Wow6432Node\Microsoft\\.NETFramework\AppContext**) subkeys in the registry. Its value must be the string representation of a that can be parsed by the method; that is, it must be "True", "true", "False", or "false". +- By adding a string value whose name is the name of the switch to the **HKLM\SOFTWARE\Microsoft\\.NETFramework\AppContext** (and **HKLM\SOFTWARE\Wow6432Node\Microsoft\\.NETFramework\AppContext**) subkeys in the registry. Its value must be the string representation of a that can be parsed by the method; that is, it must be "True", "true", "False", or "false". - If the registry entry exists, its value is overwritten by the `isEnabled` argument when is called. That is, the most recent call to the method overrides the value defined in the registry, in an app configuration file, or by previous calls to the method. + If the registry entry exists, its value is overwritten by the `isEnabled` argument when is called. That is, the most recent call to the method overrides the value defined in the registry, in an app configuration file, or by previous calls to the method. ## Examples - The following line of code sets a switch named `Switch.AmazingLib.ThrowOnException` to `true`, which enables a legacy behavior. The library can then check whether a library consumer has set the value of the switch by calling the method. + The following line of code sets a switch named `Switch.AmazingLib.ThrowOnException` to `true`, which enables a legacy behavior. The library can then check whether a library consumer has set the value of the switch by calling the method. :::code language="csharp" source="~/snippets/csharp/System/AppContext/Overview/TestValue1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/System.AppContext.Class/fs/TestValue1.fs" id="Snippet1"::: @@ -446,9 +446,9 @@ In .NET 5 and later versions, for bundled assemblies, the value returned is the ## Remarks The class enables library writers to provide a uniform opt-out mechanism for new functionality for their users. It establishes a loosely coupled contract between components in order to communicate an opt-out request. This capability is typically important when a change is made to existing functionality. Conversely, there is already an implicit opt-in for new functionality. - The common language runtime automatically populates the switches assigned to an instance by reading the registry and the application's configuration file. The value of these switches can then be overridden, and new switches added, by calling the method. + The common language runtime automatically populates the switches assigned to an instance by reading the registry and the application's configuration file. The value of these switches can then be overridden, and new switches added, by calling the method. - A library calls the method to check whether its consumers have declared the value of the switch and then act appropriately on it. By default, if the switch is not defined, the new functionality is enabled. If the switch is defined and its value is `false`, the new functionality is also enabled. If its value is `true`, the legacy behavior is enabled. + A library calls the method to check whether its consumers have declared the value of the switch and then act appropriately on it. By default, if the switch is not defined, the new functionality is enabled. If the switch is defined and its value is `false`, the new functionality is also enabled. If its value is `true`, the legacy behavior is enabled. ## Examples The following example determines whether a library consumer has set a switch named `Switch.AmazingLib.ThrowOnException`. diff --git a/xml/System/AppDomain.xml b/xml/System/AppDomain.xml index 19290a27055..18f752dceb9 100644 --- a/xml/System/AppDomain.xml +++ b/xml/System/AppDomain.xml @@ -104,7 +104,7 @@ Application domains, which are represented by objects, h Multiple application domains can run in a single process; however, there is not a one-to-one correlation between application domains and threads. Several threads can belong to a single application domain, and while a given thread is not confined to a single application domain, at any given time, a thread executes in a single application domain. - Application domains are created using the method. instances are used to load and execute assemblies (). When an is no longer in use, it can be unloaded. + Application domains are created using the method. instances are used to load and execute assemblies (). When an is no longer in use, it can be unloaded. The class implements a set of events that enable applications to respond when an assembly is loaded, when an application domain will be unloaded, or when an unhandled exception is thrown. @@ -112,7 +112,7 @@ Application domains, which are represented by objects, h This class implements the , , and interfaces. - You should never create a remotable wrapper for an object. Doing so could publish a remote reference to that , exposing methods such as to remote access and effectively destroying code access security for that . Malicious clients connecting to the remoted could obtain access to any resource the itself has access to. Do not create remotable wrappers for any type that extends and that implements methods that could be used by malicious clients to bypass the security system. + You should never create a remotable wrapper for an object. Doing so could publish a remote reference to that , exposing methods such as to remote access and effectively destroying code access security for that . Malicious clients connecting to the remoted could obtain access to any resource the itself has access to. Do not create remotable wrappers for any type that extends and that implements methods that could be used by malicious clients to bypass the security system. > [!CAUTION] > The default value for the property is `false`. This setting is unsafe for services. To prevent services from downloading partially trusted code, set this property to `true`. @@ -382,7 +382,7 @@ Application domains, which are represented by objects, h method takes an assembly display name and returns the post-policy display name. This is useful if you need to load an assembly using policy, because the reflection-only context does not apply policy. + The method takes an assembly display name and returns the post-policy display name. This is useful if you need to load an assembly using policy, because the reflection-only context does not apply policy. ]]> @@ -543,7 +543,7 @@ Application domains, which are represented by objects, h For guidance on the use of this event, see [Resolving Assembly Loads](/dotnet/standard/assembly/resolve-loads). - Beginning with the .NET Framework 4, the property returns the assembly that requested the assembly load that could not be resolved. For example, the loader might be unable to load a dependency of the requesting assembly because the requesting assembly and its dependency are not in the probing path. Knowing the identity of the requesting assembly might be useful in locating the dependency or in identifying the correct version, if more than one version of the dependency is available. For more information, see . + Beginning with the .NET Framework 4, the property returns the assembly that requested the assembly load that could not be resolved. For example, the loader might be unable to load a dependency of the requesting assembly because the requesting assembly and its dependency are not in the probing path. Knowing the identity of the requesting assembly might be useful in locating the dependency or in identifying the correct version, if more than one version of the dependency is available. For more information, see . > [!IMPORTANT] > Beginning with the .NET Framework 4, the event is raised for all assemblies, including resource assemblies. In earlier versions, the event was not raised for resource assemblies. If the operating system is localized, the handler might be called multiple times: once for each culture in the fallback chain. @@ -629,7 +629,7 @@ Application domains, which are represented by objects, h property. It can also be retrieved using the method with the string "APPBASE". + This property corresponds to the property. It can also be retrieved using the method with the string "APPBASE". @@ -790,7 +790,7 @@ Application domains, which are represented by objects, h ## Remarks The shadow copy path is a list of directories where shadow copied assemblies are stored. - For more information, see and [Shadow Copying Assemblies](/dotnet/framework/app-domains/shadow-copy-assemblies). + For more information, see and [Shadow Copying Assemblies](/dotnet/framework/app-domains/shadow-copy-assemblies). ]]> @@ -1050,7 +1050,7 @@ The `friendlyName` parameter is intended to identify the domain in a manner that This method overload uses the information from the default application domain. ## Examples - The following sample demonstrates, in general, how to create a domain using one of the overloads. + The following sample demonstrates, in general, how to create a domain using one of the overloads. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/AppDomain_Setup/CPP/setup.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System/AppDomain/CreateDomain/setup.cs" id="Snippet1"::: @@ -1116,12 +1116,12 @@ This method overload uses the information from the If `securityInfo` is not supplied, the evidence from the current application domain is used. > [!IMPORTANT] -> Do not use this method overload to create sandboxed application domains. Beginning with the .NET Framework 4, the evidence that is supplied for `securityInfo` no longer affects the grant set of the application domain. Use the method overload to create sandboxed application domains. +> Do not use this method overload to create sandboxed application domains. Beginning with the .NET Framework 4, the evidence that is supplied for `securityInfo` no longer affects the grant set of the application domain. Use the method overload to create sandboxed application domains. ## Examples - The following sample demonstrates, in general, how to create a domain using one of the overloads. + The following sample demonstrates, in general, how to create a domain using one of the overloads. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/AppDomain_Setup/CPP/setup.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System/AppDomain/CreateDomain/setup.cs" id="Snippet1"::: @@ -1186,12 +1186,12 @@ This method overload uses the information from the If `securityInfo` is not supplied, the evidence from the current application domain is used. > [!IMPORTANT] -> Do not use this method overload to create sandboxed application domains. Beginning with the .NET Framework 4, the evidence that is supplied for `securityInfo` no longer affects the grant set of the application domain. Use the method overload to create sandboxed application domains. +> Do not use this method overload to create sandboxed application domains. Beginning with the .NET Framework 4, the evidence that is supplied for `securityInfo` no longer affects the grant set of the application domain. Use the method overload to create sandboxed application domains. ## Examples - The following sample demonstrates, in general, how to create a domain using one of the overloads. + The following sample demonstrates, in general, how to create a domain using one of the overloads. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/AppDomain_Setup/CPP/setup.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System/AppDomain/CreateDomain/setup.cs" id="Snippet1"::: @@ -1331,15 +1331,15 @@ This method overload uses the information from the ## Remarks If `securityInfo` is not supplied, the evidence from the current application domain is used. - For more information about shadow copying, see and [Shadow Copying Assemblies](/dotnet/framework/app-domains/shadow-copy-assemblies). + For more information about shadow copying, see and [Shadow Copying Assemblies](/dotnet/framework/app-domains/shadow-copy-assemblies). > [!IMPORTANT] -> Do not use this method overload to create sandboxed application domains. Beginning with the .NET Framework 4, the evidence that is supplied for `securityInfo` no longer affects the grant set of the application domain. Use the method overload to create sandboxed application domains. +> Do not use this method overload to create sandboxed application domains. Beginning with the .NET Framework 4, the evidence that is supplied for `securityInfo` no longer affects the grant set of the application domain. Use the method overload to create sandboxed application domains. ## Examples - The following sample demonstrates, in general, how to create a domain using one of the overloads. + The following sample demonstrates, in general, how to create a domain using one of the overloads. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/AppDomain_Setup/CPP/setup.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System/AppDomain/CreateDomain/setup.cs" id="Snippet1"::: @@ -1411,10 +1411,10 @@ This method overload uses the information from the If `securityInfo` is not supplied, the evidence from the current application domain is used. - For more information about shadow copying, see and [Shadow Copying Assemblies](/dotnet/framework/app-domains/shadow-copy-assemblies). + For more information about shadow copying, see and [Shadow Copying Assemblies](/dotnet/framework/app-domains/shadow-copy-assemblies). > [!IMPORTANT] -> Do not use this method overload to create sandboxed application domains. Beginning with the .NET Framework 4, the evidence that is supplied for `securityInfo` no longer affects the grant set of the application domain. Use the method overload to create sandboxed application domains. +> Do not use this method overload to create sandboxed application domains. Beginning with the .NET Framework 4, the evidence that is supplied for `securityInfo` no longer affects the grant set of the application domain. Use the method overload to create sandboxed application domains. ]]> @@ -1508,7 +1508,7 @@ This method overload uses the information from the See for the format of `assemblyName`. - An attempt to call on a target application domain that is not the current application domain will result in a successful load of the assembly in the target application domain. Since an is not , when this method attempts to return the for the loaded assembly to the current application domain, the common language runtime will try to load the assembly into the current application domain and the load might fail. The assembly that is loaded into the current application domain might be different from the assembly that was loaded first if the path settings for the two application domains are different. + An attempt to call on a target application domain that is not the current application domain will result in a successful load of the assembly in the target application domain. Since an is not , when this method attempts to return the for the loaded assembly to the current application domain, the common language runtime will try to load the assembly into the current application domain and the load might fail. The assembly that is loaded into the current application domain might be different from the assembly that was loaded first if the path settings for the two application domains are different. ]]> @@ -1616,7 +1616,7 @@ This method overload uses the information from the See for the format of `assemblyName`. - An attempt to call on a target application domain that is not the current application domain will result in a successful load of the assembly in the target application domain. Since an is not , when this method attempts to return the for the loaded assembly to the current application domain, the common language runtime will try to load the assembly into the current application domain and the load might fail. The assembly that is loaded into the current application domain might be different from the assembly that was loaded first if the path settings for the two application domains are different. + An attempt to call on a target application domain that is not the current application domain will result in a successful load of the assembly in the target application domain. Since an is not , when this method attempts to return the for the loaded assembly to the current application domain, the common language runtime will try to load the assembly into the current application domain and the load might fail. The assembly that is loaded into the current application domain might be different from the assembly that was loaded first if the path settings for the two application domains are different. ]]> @@ -1726,7 +1726,7 @@ This method overload uses the information from the ## Remarks See for the format of `assemblyName`. - An attempt to call on a target application domain that is not the current application domain will result in a successful load of the assembly in the target application domain. Since an is not , when this method attempts to return the for the loaded assembly to the current application domain, the common language runtime will try to load the assembly into the current application domain and the load might fail. The assembly that is loaded into the current application domain might be different from the assembly that was loaded first if the path settings for the two application domains are different. + An attempt to call on a target application domain that is not the current application domain will result in a successful load of the assembly in the target application domain. Since an is not , when this method attempts to return the for the loaded assembly to the current application domain, the common language runtime will try to load the assembly into the current application domain and the load might fail. The assembly that is loaded into the current application domain might be different from the assembly that was loaded first if the path settings for the two application domains are different. ]]> @@ -1818,7 +1818,7 @@ This method overload uses the information from the ## Remarks See for the format of `assemblyName`. - An attempt to call on a target application domain that is not the current application domain will result in a successful load of the assembly in the target application domain. Since an is not , when this method attempts to return the for the loaded assembly to the current application domain, the common language runtime will try to load the assembly into the current application domain and the load might fail. The assembly that is loaded into the current application domain might be different from the assembly that was loaded first if the path settings for the two application domains are different. + An attempt to call on a target application domain that is not the current application domain will result in a successful load of the assembly in the target application domain. Since an is not , when this method attempts to return the for the loaded assembly to the current application domain, the common language runtime will try to load the assembly into the current application domain and the load might fail. The assembly that is loaded into the current application domain might be different from the assembly that was loaded first if the path settings for the two application domains are different. ]]>
@@ -1920,12 +1920,12 @@ This method overload uses the information from the and . This method calls the parameterless constructor for `typeName`. + This is a convenience method that combines and . This method calls the parameterless constructor for `typeName`. See for the format of `assemblyName`. See the property for the format of `typeName`. > [!NOTE] -> If you make an early-bound call to a method `M` of an object of type `T1` that was returned by , and that method makes an early-bound call to a method of an object of type `T2` in an assembly `C` other than the current assembly or the assembly containing `T1`, assembly `C` is loaded into the current application domain. This loading occurs even if the early-bound call to `T1.M()` was made in the body of a , or in other dynamically generated code. If the current domain is the default domain, assembly `C` cannot be unloaded until the process ends. If the current domain later attempts to load assembly `C`, the load might fail. +> If you make an early-bound call to a method `M` of an object of type `T1` that was returned by , and that method makes an early-bound call to a method of an object of type `T2` in an assembly `C` other than the current assembly or the assembly containing `T1`, assembly `C` is loaded into the current application domain. This loading occurs even if the early-bound call to `T1.M()` was made in the body of a , or in other dynamically generated code. If the current domain is the default domain, assembly `C` cannot be unloaded until the process ends. If the current domain later attempts to load assembly `C`, the load might fail. @@ -2035,12 +2035,12 @@ This method overload uses the information from the and . This method calls the parameterless constructor for `typeName`. + This is a convenience method that combines and . This method calls the parameterless constructor for `typeName`. See for the format of `assemblyName`. See the property for the format of `typeName`. > [!NOTE] -> If you make an early-bound call to a method `M` of an object of type `T1` that was returned by , and that method makes an early-bound call to a method of an object of type `T2` in an assembly `C` other than the current assembly or the assembly containing `T1`, assembly `C` is loaded into the current application domain. This loading occurs even if the early-bound call to `T1.M()` was made in the body of a , or in other dynamically generated code. If the current domain is the default domain, assembly `C` cannot be unloaded until the process ends. If the current domain later attempts to load assembly `C`, the load might fail. +> If you make an early-bound call to a method `M` of an object of type `T1` that was returned by , and that method makes an early-bound call to a method of an object of type `T2` in an assembly `C` other than the current assembly or the assembly containing `T1`, assembly `C` is loaded into the current application domain. This loading occurs even if the early-bound call to `T1.M()` was made in the body of a , or in other dynamically generated code. If the current domain is the default domain, assembly `C` cannot be unloaded until the process ends. If the current domain later attempts to load assembly `C`, the load might fail. @@ -2155,12 +2155,12 @@ This method overload uses the information from the and . + This is a convenience method that combines and . See for the format of `assemblyName`. See the property for the format of `typeName`. > [!NOTE] -> If you make an early-bound call to a method `M` of an object of type `T1` that was returned by , and that method makes an early-bound call to a method of an object of type `T2` in an assembly `C` other than the current assembly or the assembly containing `T1`, assembly `C` is loaded into the current application domain. This loading occurs even if the early-bound call to `T1.M()` was made in the body of a , or in other dynamically generated code. If the current domain is the default domain, assembly `C` cannot be unloaded until the process ends. If the current domain later attempts to load assembly `C`, the load might fail. +> If you make an early-bound call to a method `M` of an object of type `T1` that was returned by , and that method makes an early-bound call to a method of an object of type `T2` in an assembly `C` other than the current assembly or the assembly containing `T1`, assembly `C` is loaded into the current application domain. This loading occurs even if the early-bound call to `T1.M()` was made in the body of a , or in other dynamically generated code. If the current domain is the default domain, assembly `C` cannot be unloaded until the process ends. If the current domain later attempts to load assembly `C`, the load might fail. @@ -2354,9 +2354,9 @@ This method overload uses the information from the ## Remarks The parameterless constructor for `typeName` is invoked. - For more information, see the method. + For more information, see the method. - When the method is used to create an instance in a target application domain, other than the application domain from which the call is made, the assembly is loaded in the target application domain. However, if the instance is unwrapped in the calling application domain, using the unwrapped instance in certain ways can cause the assembly to be loaded into the calling application domain. For example, after the instance is unwrapped, its type information might be requested, in order to call its methods late-bound. When the assembly is loaded into the calling application domain, exceptions can occur. + When the method is used to create an instance in a target application domain, other than the application domain from which the call is made, the assembly is loaded in the target application domain. However, if the instance is unwrapped in the calling application domain, using the unwrapped instance in certain ways can cause the assembly to be loaded into the calling application domain. For example, after the instance is unwrapped, its type information might be requested, in order to call its methods late-bound. When the assembly is loaded into the calling application domain, exceptions can occur. - If another version of the same assembly was previously loaded into the calling application domain, or if the load path of the calling application domain is different from that of the target application domain, exceptions such as can occur. @@ -2365,12 +2365,12 @@ This method overload uses the information from the ## Examples - The following example shows how to use the method overload to create an instance of an object in a target application domain and call its methods. + The following example shows how to use the method overload to create an instance of an object in a target application domain and call its methods. - The example defines the `MarshalableExample` class, which can be marshaled across application domain boundaries. The example builds a path to the currently executing assembly, creates a target application domain, and uses the method overload to load the example assembly into the target application domain and create an instance of `MarshalableExample`. + The example defines the `MarshalableExample` class, which can be marshaled across application domain boundaries. The example builds a path to the currently executing assembly, creates a target application domain, and uses the method overload to load the example assembly into the target application domain and create an instance of `MarshalableExample`. > [!NOTE] -> The path is absolute in this example, but a relative path would also work because the method is used to load the assembly. +> The path is absolute in this example, but a relative path would also work because the method is used to load the assembly. After unwrapping the object handle, the example demonstrates three ways to use an object in a target application domain: @@ -2495,9 +2495,9 @@ This method overload uses the information from the ## Remarks The parameterless constructor for `typeName` is invoked. - For more information about this method, see the method. + For more information about this method, see the method. - When the method is used to create an instance in a target application domain, other than the application domain from which the call is made, the assembly is loaded in the target application domain. However, if the instance is unwrapped in the calling application domain, using the unwrapped instance in certain ways can cause the assembly to be loaded into the calling application domain. For example, after the instance is unwrapped, its type information might be requested, in order to call its methods late-bound. When the assembly is loaded into the calling application domain, exceptions can occur. + When the method is used to create an instance in a target application domain, other than the application domain from which the call is made, the assembly is loaded in the target application domain. However, if the instance is unwrapped in the calling application domain, using the unwrapped instance in certain ways can cause the assembly to be loaded into the calling application domain. For example, after the instance is unwrapped, its type information might be requested, in order to call its methods late-bound. When the assembly is loaded into the calling application domain, exceptions can occur. - If another version of the same assembly was previously loaded into the calling application domain, or if the load path of the calling application domain is different from that of the target application domain, exceptions such as can occur. @@ -2609,9 +2609,9 @@ This method overload uses the information from the method. + For more information, see the method. - When the method is used to create an instance in a target application domain, other than the application domain from which the call is made, the assembly is loaded in the target application domain. However, if the instance is unwrapped in the calling application domain, using the unwrapped instance in certain ways can cause the assembly to be loaded into the calling application domain. For example, after the instance is unwrapped, its type information might be requested, in order to call its methods late-bound. When the assembly is loaded into the calling application domain, exceptions can occur. + When the method is used to create an instance in a target application domain, other than the application domain from which the call is made, the assembly is loaded in the target application domain. However, if the instance is unwrapped in the calling application domain, using the unwrapped instance in certain ways can cause the assembly to be loaded into the calling application domain. For example, after the instance is unwrapped, its type information might be requested, in order to call its methods late-bound. When the assembly is loaded into the calling application domain, exceptions can occur. - If another version of the same assembly was previously loaded into the calling application domain, or if the load path of the calling application domain is different from that of the target application domain, exceptions such as can occur. @@ -2709,9 +2709,9 @@ This method overload uses the information from the method. + For more information about this method, see the method. - When the method is used to create an instance in a target application domain, other than the application domain from which the call is made, the assembly is loaded in the target application domain. However, if the instance is unwrapped in the calling application domain, using the unwrapped instance in certain ways can cause the assembly to be loaded into the calling application domain. For example, after the instance is unwrapped, its type information might be requested, in order to call its methods late-bound. When the assembly is loaded into the calling application domain, exceptions can occur. + When the method is used to create an instance in a target application domain, other than the application domain from which the call is made, the assembly is loaded in the target application domain. However, if the instance is unwrapped in the calling application domain, using the unwrapped instance in certain ways can cause the assembly to be loaded into the calling application domain. For example, after the instance is unwrapped, its type information might be requested, in order to call its methods late-bound. When the assembly is loaded into the calling application domain, exceptions can occur. - If another version of the same assembly was previously loaded into the calling application domain, or if the load path of the calling application domain is different from that of the target application domain, exceptions such as can occur. @@ -2827,9 +2827,9 @@ This method overload uses the information from the and . This method calls the parameterless constructor for `typeName`. + This is a convenience method that combines and . This method calls the parameterless constructor for `typeName`. - For more information, see the method. + For more information, see the method. ]]> @@ -2936,9 +2936,9 @@ This method overload uses the information from the and . This method calls the parameterless constructor for `typeName`. + This is a convenience method that combines and . This method calls the parameterless constructor for `typeName`. - For more information about this method, see the method. + For more information about this method, see the method. ]]> @@ -3049,9 +3049,9 @@ This method overload uses the information from the and . + This is a convenience method that combines and . - For more information about this method, see the method. + For more information about this method, see the method. ]]> @@ -3144,9 +3144,9 @@ This method overload uses the information from the and . + This is a convenience method that combines and . - For more information about this method, see the method. + For more information about this method, see the method. ]]> @@ -3286,15 +3286,15 @@ This method overload uses the information from the method overload. + This method should only be used to define a dynamic assembly in the current application domain. For more information, see the method overload. > [!NOTE] -> During the development of code that emits dynamic assemblies, it is recommended that you use an overload of the method that specifies evidence and permissions, supply the evidence you want the dynamic assembly to have, and include in `refusedPermissions`. Including in the `refusedPermissions` parameter ensures that the MSIL is verified. A limitation of this technique is that it also causes to be thrown when used with code that demands full trust. +> During the development of code that emits dynamic assemblies, it is recommended that you use an overload of the method that specifies evidence and permissions, supply the evidence you want the dynamic assembly to have, and include in `refusedPermissions`. Including in the `refusedPermissions` parameter ensures that the MSIL is verified. A limitation of this technique is that it also causes to be thrown when used with code that demands full trust. ## Examples - The following sample demonstrates the method and event. + The following sample demonstrates the method and event. For this code example to run, you must provide the fully qualified assembly name. For information about how to obtain the fully qualified assembly name, see [Assembly Names](/dotnet/standard/assembly/names). @@ -3363,7 +3363,7 @@ This method overload uses the information from the ## Remarks Use this method overload to specify attributes that do not work correctly unless they are applied when a dynamic assembly is created. For example, security attributes such as and do not work correctly if they are added after a dynamic assembly has been created. - This method should be used only to define a dynamic assembly in the current application domain. For more information about this restriction, see the method overload. + This method should be used only to define a dynamic assembly in the current application domain. For more information about this restriction, see the method overload. This method overload is introduced in the .NET Framework 3.5. @@ -3372,9 +3372,9 @@ This method overload uses the information from the ## Examples The following code sample shows how to create a dynamic assembly that has the . The attribute must be specified as an element of an array of objects. - The first step in creating the is to obtain a constructor for the attribute. The constructor has no parameters, so the method is called with an empty array of objects to represent the types of the parameters. The second step is to pass the resulting object to the constructor for the class, together with an empty array of type to represent the arguments. + The first step in creating the is to obtain a constructor for the attribute. The constructor has no parameters, so the method is called with an empty array of objects to represent the types of the parameters. The second step is to pass the resulting object to the constructor for the class, together with an empty array of type to represent the arguments. - The resulting is then passed to the method as the only element of an array. + The resulting is then passed to the method as the only element of an array. The example code defines a module and a type in the new dynamic assembly, and then displays the assembly's attributes. @@ -3507,15 +3507,15 @@ This method overload uses the information from the method overload. + This method should only be used to define a dynamic assembly in the current application domain. For more information, see the method overload. > [!NOTE] -> During the development of code that emits dynamic assemblies, it is recommended that you use an overload of the method that specifies evidence and permissions, supply the evidence you want the dynamic assembly to have, and include in `refusedPermissions`. Including in the `refusedPermissions` parameter ensures that the MSIL is verified. A limitation of this technique is that it also causes to be thrown when used with code that demands full trust. +> During the development of code that emits dynamic assemblies, it is recommended that you use an overload of the method that specifies evidence and permissions, supply the evidence you want the dynamic assembly to have, and include in `refusedPermissions`. Including in the `refusedPermissions` parameter ensures that the MSIL is verified. A limitation of this technique is that it also causes to be thrown when used with code that demands full trust. ## Examples - The following sample demonstrates the method and event. + The following sample demonstrates the method and event. For this code example to run, you must provide the fully qualified assembly name. For information about how to obtain the fully qualified assembly name, see [Assembly Names](/dotnet/standard/assembly/names). @@ -3585,7 +3585,7 @@ This method overload uses the information from the ## Remarks Use this method overload to specify attributes that do not work correctly unless they are applied when a dynamic assembly is created. For example, security attributes such as and do not work correctly if they are added after a dynamic assembly has been created. - This method should be used only to define a dynamic assembly in the current application domain. For more information about this restriction, see the method overload. + This method should be used only to define a dynamic assembly in the current application domain. For more information about this restriction, see the method overload. ]]> @@ -3780,7 +3780,7 @@ This method overload uses the information from the ## Remarks Use this method overload to specify attributes that do not work correctly unless they are applied when a dynamic assembly is created. For example, security attributes such as and do not work correctly if they are added after a dynamic assembly has been created. - If `isSynchronized` is `true`, the following methods of the resulting will be synchronized: , , , , , and . If two of these methods are called on different threads, one will block until the other is completed. + If `isSynchronized` is `true`, the following methods of the resulting will be synchronized: , , , , , and . If two of these methods are called on different threads, one will block until the other is completed. ]]> @@ -4144,7 +4144,7 @@ This method overload uses the information from the If the dynamic assembly is saved to disk, subsequent loads will get grants based on policies that are associated with the location where the dynamic assembly was saved. - If `isSynchronized` is `true`, the following methods of the resulting will be synchronized: , , , , , and . If two of these methods are called on different threads, one will block until the other is completed. + If `isSynchronized` is `true`, the following methods of the resulting will be synchronized: , , , , , and . If two of these methods are called on different threads, one will block until the other is completed. This method overload is introduced in the .NET Framework 3.5. @@ -4205,21 +4205,21 @@ This method overload uses the information from the ## Examples - The following sample demonstrates using a static method. + The following sample demonstrates using a static method. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/AppDomain_DoCallBack/CPP/docallback_static.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System/AppDomain/DoCallBack/docallback_static.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/AppDomain/DoCallBack/docallback_static.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/AppDomain/DoCallBack/docallback_static.vb" id="Snippet1"::: - The following sample demonstrates using the method by value. + The following sample demonstrates using the method by value. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/AppDomain_DoCallBack/CPP/docallback_byval.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System/AppDomain/DoCallBack/docallback_byval.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/AppDomain/DoCallBack/docallback_byval.fs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System/AppDomain/DoCallBack/docallback_byval.vb" id="Snippet2"::: - The following sample demonstrates using the method by reference. + The following sample demonstrates using the method by reference. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/AppDomain_DoCallBack/CPP/docallback_byref.cpp" id="Snippet3"::: :::code language="csharp" source="~/snippets/csharp/System/AppDomain/DoCallBack/docallback_byref.cs" id="Snippet3"::: @@ -4347,7 +4347,7 @@ This method overload uses the information from the > [!NOTE] > This event is never raised in the default application domain. - Do not make assumptions about the thread the event is raised on. The event can be raised on a different thread than the one that called the method. + Do not make assumptions about the thread the event is raised on. The event can be raised on a different thread than the one that called the method. For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/). @@ -4568,14 +4568,14 @@ This method overload uses the information from the This method does not create a new process or application domain, and it does not execute the entry point method on a new thread. - This method loads assemblies using the method. You can also execute assemblies using the method, which loads assemblies using the method. + This method loads assemblies using the method. You can also execute assemblies using the method, which loads assemblies using the method. - To create the to load and execute, use the method. + To create the to load and execute, use the method. ## Examples - The following sample demonstrates using one of the overloads of on two different domains. + The following sample demonstrates using one of the overloads of on two different domains. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/AppDomain_ExecuteAssembly/CPP/executeassembly.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System/AppDomain/ExecuteAssembly/executeassembly.cs" id="Snippet1"::: @@ -4729,12 +4729,12 @@ This method overload uses the information from the This method does not create a new process or application domain, and it does not execute the entry point method on a new thread. - This method loads assemblies using the method. You can also execute assemblies using the method, which loads assemblies using the method. + This method loads assemblies using the method. You can also execute assemblies using the method, which loads assemblies using the method. ## Examples - The following sample demonstrates using one of the overloads of on two different domains. + The following sample demonstrates using one of the overloads of on two different domains. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/AppDomain_ExecuteAssembly/CPP/executeassembly.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System/AppDomain/ExecuteAssembly/executeassembly.cs" id="Snippet1"::: @@ -5036,13 +5036,13 @@ This method overload uses the information from the method provides similar functionality to the method, but specifies the assembly by display name or rather than by file location. Therefore, loads assemblies with the method rather than with the method. + The method provides similar functionality to the method, but specifies the assembly by display name or rather than by file location. Therefore, loads assemblies with the method rather than with the method. The assembly begins executing at the entry point specified in the .NET Framework header. This method does not create a new process or application domain, and it does not execute the entry point method on a new thread. - To create the to load and execute, use the method. + To create the to load and execute, use the method. ]]> @@ -5125,7 +5125,7 @@ This method overload uses the information from the method provides similar functionality to the method, but specifies the assembly by display name or rather than by file location. Therefore, loads assemblies with the method rather than with the method. + The method provides similar functionality to the method, but specifies the assembly by display name or rather than by file location. Therefore, loads assemblies with the method rather than with the method. The assembly begins executing at the entry point specified in the .NET Framework header. @@ -5188,14 +5188,14 @@ This method overload uses the information from the method provides similar functionality to the method, but specifies the assembly by display name or rather than by file location. Therefore, loads assemblies with the method rather than with the method. + The method provides similar functionality to the method, but specifies the assembly by display name or rather than by file location. Therefore, loads assemblies with the method rather than with the method. The assembly begins executing at the entry point specified in the .NET Framework header. - The method does not create a new process or application domain, and it does not execute the entry point method on a new thread. + The method does not create a new process or application domain, and it does not execute the entry point method on a new thread. > [!NOTE] -> When you use the method with an parameter, pieces of evidence are merged. Pieces of evidence supplied as an argument to the method supersede pieces of evidence supplied by the loader. +> When you use the method with an parameter, pieces of evidence are merged. Pieces of evidence supplied as an argument to the method supersede pieces of evidence supplied by the loader. ]]> @@ -5277,7 +5277,7 @@ This method overload uses the information from the method provides similar functionality to the method, but specifies the assembly by display name or rather than by file location. Therefore, loads assemblies with the method rather than with the method. + The method provides similar functionality to the method, but specifies the assembly by display name or rather than by file location. Therefore, loads assemblies with the method rather than with the method. The assembly begins executing at the entry point specified in the .NET Framework header. @@ -5351,14 +5351,14 @@ This method overload uses the information from the method provides similar functionality to the method, but specifies the assembly by display name or rather than by file location. Therefore, loads assemblies with the method rather than with the method. + The method provides similar functionality to the method, but specifies the assembly by display name or rather than by file location. Therefore, loads assemblies with the method rather than with the method. The assembly begins executing at the entry point specified in the .NET Framework header. This method does not create a new process or application domain, and it does not execute the entry point method on a new thread. > [!NOTE] -> When you use the method with an parameter, pieces of evidence are merged. Pieces of evidence supplied as an argument to the method supersede pieces of evidence supplied by the loader. +> When you use the method with an parameter, pieces of evidence are merged. Pieces of evidence supplied as an argument to the method supersede pieces of evidence supplied by the loader. ]]> @@ -5429,14 +5429,14 @@ This method overload uses the information from the method provides similar functionality to the method, but specifies the assembly by display name or rather than by file location. Therefore, loads assemblies with the method rather than with the method. + The method provides similar functionality to the method, but specifies the assembly by display name or rather than by file location. Therefore, loads assemblies with the method rather than with the method. The assembly begins executing at the entry point specified in the .NET Framework header. This method does not create a new process or application domain, and it does not execute the entry point method on a new thread. > [!NOTE] -> When you use the method with an parameter, pieces of evidence are merged. Pieces of evidence supplied as an argument to the method supersede pieces of evidence supplied by the loader. +> When you use the method with an parameter, pieces of evidence are merged. Pieces of evidence supplied as an argument to the method supersede pieces of evidence supplied by the loader. ]]> @@ -5672,9 +5672,9 @@ The friendly name of the default application domain is the file name of the proc method to get a list of all assemblies that have been loaded into the application domain. The assemblies are then displayed to the console. + The following code example uses the method to get a list of all assemblies that have been loaded into the application domain. The assemblies are then displayed to the console. - To run this code example, you need to create an assembly named `CustomLibrary.dll`, or change the assembly name that is passed to the method. + To run this code example, you need to create an assembly named `CustomLibrary.dll`, or change the assembly name that is passed to the method. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/ADGetAssemblies/CPP/adgetassemblies.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System/AppDomain/GetAssemblies/adgetassemblies.cs" id="Snippet1"::: @@ -5831,38 +5831,38 @@ The friendly name of the default application domain is the file name of the proc ## Remarks Use this method to retrieve the value of an entry in an internal cache of name-data pairs that describe properties of this instance of . Note that the comparison of `name` with the name of key-value pairs is case-sensitive. - The cache automatically contains predefined system entries that are inserted when the application domain is created. You can inspect their values with the method, or the equivalent properties. + The cache automatically contains predefined system entries that are inserted when the application domain is created. You can inspect their values with the method, or the equivalent properties. - You can insert or modify your own user defined name-data pairs with the method and inspect their values with the method. + You can insert or modify your own user defined name-data pairs with the method and inspect their values with the method. The following table describes the `name` of each predefined system entry and its corresponding property. |Value of 'name'|Property| |---------------------|--------------| -|"APPBASE"|| -|"APP_CONFIG_FILE"|| +|"APPBASE"|| +|"APP_CONFIG_FILE"|| |"APP_LAUNCH_URL"|(no property)

"APP_LAUNCH_URL" represents the URL originally requested by the user, before any redirection. It is available only when the application has been launched with a browser. Not all browsers provide this value.| -|"APP_NAME"|| -|"BINPATH_PROBE_ONLY"|| -|"CACHE_BASE"|| -|"CODE_DOWNLOAD_DISABLED"|| +|"APP_NAME"|| +|"BINPATH_PROBE_ONLY"|| +|"CACHE_BASE"|| +|"CODE_DOWNLOAD_DISABLED"|| |"DEV_PATH"|(no property)| -|"DISALLOW_APP"|| -|"DISALLOW_APP_BASE_PROBING"|| -|"DISALLOW_APP_REDIRECTS"|| -|"DYNAMIC_BASE"|| -|"FORCE_CACHE_INSTALL"|| -|"LICENSE_FILE", or an application-specific string|| -|"LOADER_OPTIMIZATION"|| +|"DISALLOW_APP"|| +|"DISALLOW_APP_BASE_PROBING"|| +|"DISALLOW_APP_REDIRECTS"|| +|"DYNAMIC_BASE"|| +|"FORCE_CACHE_INSTALL"|| +|"LICENSE_FILE", or an application-specific string|| +|"LOADER_OPTIMIZATION"|| |"LOCATION_URI"|(no property)| -|"PRIVATE_BINPATH"|| -|"REGEX_DEFAULT_MATCH_TIMEOUT"|

"REGEX_DEFAULT_MATCH_TIMEOUT" is not a system entry, and its value can be set by calling the method.| -|"SHADOW_COPY_DIRS"|| +|"PRIVATE_BINPATH"|| +|"REGEX_DEFAULT_MATCH_TIMEOUT"|

"REGEX_DEFAULT_MATCH_TIMEOUT" is not a system entry, and its value can be set by calling the method.| +|"SHADOW_COPY_DIRS"|| ## Examples - The following example creates a new application domain, sets a system-provided value for the domain, and adds a new value pair for the domain. The example then demonstrates how to use the method to retrieve the data from these value pairs and display them to the console. + The following example creates a new application domain, sets a system-provided value for the domain, and adds a new value pair for the domain. The example then demonstrates how to use the method to retrieve the data from these value pairs and display them to the console. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/ADGetData/CPP/adgetdata.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System/AppDomain/GetData/adgetdata.cs" id="Snippet1"::: @@ -6074,7 +6074,7 @@ The friendly name of the default application domain is the file name of the proc method before creating an application domain. + This method tests whether the specified compatibility switch has been set for the current application domain. Compatibility switches typically restore a behavior (such as the way strings are sorted) that was changed between versions of the .NET Framework. They are set by calling the method before creating an application domain. The following table provides examples of compatibility switches that can be set to restore the behavior of earlier versions of the .NET Framework. @@ -6210,7 +6210,7 @@ The friendly name of the default application domain is the file name of the proc ## Remarks The finalization method for an object provides you an opportunity to perform any necessary cleanup operations before the object is garbage collected. After finalization, the object is accessible but in an invalid state and therefore unusable. Eventually, garbage collection completes and reclaims the object. - An object's finalization method is called in one of the following situations: during garbage collection, when the common language runtime is shutting down, or when the application domain that contains the object is unloaded. The method returns `true` only in the last case; it does not return `true` if finalization results from routine garbage collection or from CLR shutdown. + An object's finalization method is called in one of the following situations: during garbage collection, when the common language runtime is shutting down, or when the application domain that contains the object is unloaded. The method returns `true` only in the last case; it does not return `true` if finalization results from routine garbage collection or from CLR shutdown. > [!NOTE] > To determine whether finalization is due to CLR shutdown, use the property. It returns `true` if finalization is due to an application domain being unloaded or to the CLR shutting down. @@ -6281,12 +6281,12 @@ The friendly name of the default application domain is the file name of the proc method overload, unless the permissions that are granted to the application domain are equivalent to full trust. + **.NET Framework only:** This method always returns `true` for the default application domain of an application that runs on the desktop. It returns `false` for a sandboxed application domain that was created by using the method overload, unless the permissions that are granted to the application domain are equivalent to full trust. ## Examples - The following example demonstrates the property and the property with fully trusted and partially trusted application domains. The fully trusted application domain is the default application domain for the application. The partially trusted application domain is created by using the method overload. + The following example demonstrates the property and the property with fully trusted and partially trusted application domains. The fully trusted application domain is the default application domain for the application. The partially trusted application domain is created by using the method overload. The example uses a `Worker` class that derives from , so it can be marshaled across application domain boundaries. The example creates a `Worker` object in the default application domain. It then calls the `TestIsFullyTrusted` method to display the property value for the application domain and for two assemblies that are loaded into the application domain: mscorlib, which is part of the .NET Framework, and the example assembly. The application domain is fully trusted, so both assemblies are fully trusted. @@ -6345,7 +6345,7 @@ The friendly name of the default application domain is the file name of the proc method overload. Sandboxed application domains have a homogenous set of permissions; that is, the same set of permissions is granted to all partially trusted assemblies that are loaded into the application domain. A sandboxed application domain optionally has a list of strong-named assemblies that are exempt from this permission set, and instead run with full trust. + This property returns `true` for sandboxed application domains that were created by using the method overload. Sandboxed application domains have a homogenous set of permissions; that is, the same set of permissions is granted to all partially trusted assemblies that are loaded into the application domain. A sandboxed application domain optionally has a list of strong-named assemblies that are exempt from this permission set, and instead run with full trust. Fully trusted code can use the property to determine the homogenous grant set of a sandboxed application domain. @@ -6432,7 +6432,7 @@ The friendly name of the default application domain is the file name of the proc method overload. + For information that is common to all overloads of this method, see the method overload. Beginning with the .NET Framework 4, the trust level of an assembly that is loaded by using this method is the same as the trust level of the application domain. @@ -6519,23 +6519,23 @@ The friendly name of the default application domain is the file name of the proc method. To load assemblies into other application domains, use a method such as . + This method should be used only to load an assembly into the current application domain. This method is provided as a convenience for interoperability callers who cannot call the static method. To load assemblies into other application domains, use a method such as . If a version of the requested assembly is already loaded, this method returns the loaded assembly, even if a different version is requested. - Supplying a partial assembly name for `assemblyRef` is not recommended. (A partial name omits one or more of culture, version, or public key token. For overloads that take a string instead of an object, "MyAssembly, Version=1.0.0.0" is an example of a partial name and "MyAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=18ab3442da84b47" is an example of a full name.) Using partial names has a negative effect on performance. In addition, a partial assembly name can load an assembly from the global assembly cache only if there is an exact copy of the assembly in the application base directory ( or ). + Supplying a partial assembly name for `assemblyRef` is not recommended. (A partial name omits one or more of culture, version, or public key token. For overloads that take a string instead of an object, "MyAssembly, Version=1.0.0.0" is an example of a partial name and "MyAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=18ab3442da84b47" is an example of a full name.) Using partial names has a negative effect on performance. In addition, a partial assembly name can load an assembly from the global assembly cache only if there is an exact copy of the assembly in the application base directory ( or ). - If the current object represents application domain `A`, and the method is called from application domain `B`, the assembly is loaded into both application domains. For example, the following code loads `MyAssembly` into the new application domain `ChildDomain` and also into the application domain where the code executes: + If the current object represents application domain `A`, and the method is called from application domain `B`, the assembly is loaded into both application domains. For example, the following code loads `MyAssembly` into the new application domain `ChildDomain` and also into the application domain where the code executes: :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR_System/system.appdomain.load/cpp/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System/AppDomain/Load/source.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/AppDomain/Load/source.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/AppDomain/Load/source.vb" id="Snippet1"::: - The assembly is loaded into both domains because does not derive from , and therefore the return value of the method cannot be marshaled. Instead, the common language runtime tries to load the assembly into the calling application domain. The assemblies that are loaded into the two application domains might be different if the path settings for the two application domains are different. + The assembly is loaded into both domains because does not derive from , and therefore the return value of the method cannot be marshaled. Instead, the common language runtime tries to load the assembly into the calling application domain. The assemblies that are loaded into the two application domains might be different if the path settings for the two application domains are different. > [!NOTE] -> If both the property and the property are set, the first attempt to load the assembly uses the display name (including version, culture, and so on, as returned by the property). If the file is not found, the property is used to search for the assembly. If the assembly is found using , the display name is matched against the assembly. If the match fails, a is thrown. +> If both the property and the property are set, the first attempt to load the assembly uses the display name (including version, culture, and so on, as returned by the property). If the file is not found, the property is used to search for the assembly. If the assembly is found using , the display name is matched against the assembly. If the match fails, a is thrown. ]]> @@ -6612,7 +6612,7 @@ The friendly name of the default application domain is the file name of the proc method overload. + For information that is common to all overloads of this method, see the method overload. ]]> @@ -6703,7 +6703,7 @@ The friendly name of the default application domain is the file name of the proc method overload. + For information that is common to all overloads of this method, see the method overload. Beginning with the .NET Framework 4, the trust level of an assembly that is loaded by using this method is the same as the trust level of the application domain. @@ -6780,7 +6780,7 @@ The friendly name of the default application domain is the file name of the proc method overload. + For information that is common to all overloads of this method, see the method overload. ]]> @@ -6847,7 +6847,7 @@ The friendly name of the default application domain is the file name of the proc method overload. + For information that is common to all overloads of this method, see the method overload. ]]> @@ -6916,7 +6916,7 @@ The friendly name of the default application domain is the file name of the proc method overload. + For information that is common to all overloads of this method, see the method overload. Beginning with the .NET Framework 4, the trust level of an assembly that is loaded by using this method is the same as the trust level of the application domain. @@ -6992,7 +6992,7 @@ The friendly name of the default application domain is the file name of the proc If you attempt to set this property to `false`, a exception is thrown, even if the current value of the property is `false`. - Once monitoring is enabled, you can use the , , , and instance properties to monitor CPU and memory use of individual application domains. + Once monitoring is enabled, you can use the , , , and instance properties to monitor CPU and memory use of individual application domains. ]]> @@ -7109,7 +7109,7 @@ The friendly name of the default application domain is the file name of the proc method. After an ephemeral collection, this number represents the number of bytes currently held live in ephemeral generations. + After a full, blocking collection, this number represents the number of bytes currently held live on managed heaps. It should be close to the number reported by the method. After an ephemeral collection, this number represents the number of bytes currently held live in ephemeral generations. ]]> @@ -7284,7 +7284,7 @@ The friendly name of the default application domain is the file name of the proc [!INCLUDE[cas-deprecated](~/includes/cas-deprecated.md)] - Sandboxed application domains that were created by using the method overload have a homogenous set of permissions; that is, the same set of permissions is granted to all partially trusted assemblies that are loaded into the application domain. A sandboxed application domain optionally has a list of strong-named assemblies that are exempt from this permission set, and instead run with full trust. + Sandboxed application domains that were created by using the method overload have a homogenous set of permissions; that is, the same set of permissions is granted to all partially trusted assemblies that are loaded into the application domain. A sandboxed application domain optionally has a list of strong-named assemblies that are exempt from this permission set, and instead run with full trust. ]]> @@ -7435,9 +7435,9 @@ The friendly name of the default application domain is the file name of the proc In the reflection-only context, dependencies are not resolved automatically. They must be preloaded or returned by the handler for this event. This event is raised when an assembly has a dependency that is not already loaded into the reflection-only context. The missing dependency is specified by the property. The for this event must return an assembly that satisfies the dependency. The assembly that is returned must be loaded into the reflection-only context. > [!IMPORTANT] -> This event is raised only for missing dependencies of the assembly that you are loading into the reflection-only context (for example, by using the method). It is not raised if the assembly that you are loading cannot be found. +> This event is raised only for missing dependencies of the assembly that you are loading into the reflection-only context (for example, by using the method). It is not raised if the assembly that you are loading cannot be found. - Beginning with the .NET Framework 4, the property returns the assembly that requested the assembly load that could not be resolved. Knowing the identity of the requesting assembly might be useful in identifying the correct version of the dependency, if more than one version is available. For more information, see . + Beginning with the .NET Framework 4, the property returns the assembly that requested the assembly load that could not be resolved. Knowing the identity of the requesting assembly might be useful in identifying the correct version of the dependency, if more than one version is available. For more information, see . For this event, the property returns the assembly name before policy is applied. @@ -7494,12 +7494,12 @@ The friendly name of the default application domain is the file name of the proc method. + This method returns the assemblies that have been loaded into the reflection-only context. To get the assemblies that have been loaded for execution, use the method. ## Examples - The following code example loads the System.dll assembly into the execution context and then into the reflection-only context. The and methods are used to display the assemblies loaded into each context. + The following code example loads the System.dll assembly into the execution context and then into the reflection-only context. The and methods are used to display the assemblies loaded into each context. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/AppDomain.ReflectionOnlyGetAssemblies/CPP/reflectiononly.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System/AppDomain/ReflectionOnlyGetAssemblies/reflectiononly.cs" id="Snippet1"::: @@ -7572,9 +7572,9 @@ The friendly name of the default application domain is the file name of the proc property is not under , it is ignored. + Private assemblies are deployed in the same directory structure as the application. If the path specified by the property is not under , it is ignored. - This property returns the value set using . + This property returns the value set using . ]]> @@ -7651,7 +7651,7 @@ The friendly name of the default application domain is the file name of the proc > [!IMPORTANT] > This event is not raised if resolution fails because no file can be found for a valid linked resource. It is raised if a manifest resource stream cannot be found, but it is not raised if an individual resource key cannot be found. - Beginning with the .NET Framework 4, the property contains the assembly that requested the resource. For more information, see . + Beginning with the .NET Framework 4, the property contains the assembly that requested the resource. For more information, see . To register an event handler for this event, you must have the required permissions, or a is thrown. @@ -7889,14 +7889,14 @@ The friendly name of the default application domain is the file name of the proc ## Remarks Use this method to insert an entry, or modify the value of an entry in an internal cache of name-data pairs that describe properties of this instance of . - The cache automatically contains predefined system entries that are inserted when the application domain is created. You cannot insert or modify system entries with this method. A method call that attempts to modify a system entry has no effect; the method does not throw an exception. You can inspect the values of system entries with the method, or the equivalent properties described in . + The cache automatically contains predefined system entries that are inserted when the application domain is created. You cannot insert or modify system entries with this method. A method call that attempts to modify a system entry has no effect; the method does not throw an exception. You can inspect the values of system entries with the method, or the equivalent properties described in . - You can call this method to set the value of the default timeout interval for evaluating regular expression patterns by supply "REGEX_DEFAULT_MATCH_TIMEOUT" as the value of the `name` argument and a value that represents the timeout interval as the value of the `data` argument. You can also insert or modify your own user defined name-data pairs with this method and inspect their values with the method. + You can call this method to set the value of the default timeout interval for evaluating regular expression patterns by supply "REGEX_DEFAULT_MATCH_TIMEOUT" as the value of the `name` argument and a value that represents the timeout interval as the value of the `data` argument. You can also insert or modify your own user defined name-data pairs with this method and inspect their values with the method. ## Examples - The following example demonstrates how to use the method to create a new value pair. The example then uses the method to retrieve the value, and displays it to the console. + The following example demonstrates how to use the method to create a new value pair. The example then uses the method to retrieve the value, and displays it to the console. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/ADGetData/CPP/adgetdata.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System/AppDomain/GetData/adgetdata.cs" id="Snippet1"::: @@ -7958,7 +7958,7 @@ The friendly name of the default application domain is the file name of the proc You cannot use this method to assign a security demand to a system-defined property string. - The cache automatically contains predefined system entries that are inserted when the application domain is created. You cannot insert or modify system entries with this method. A method call that attempts to modify a system entry has no effect; the method does not throw an exception. You can inspect the values of system entries with the method or the equivalent properties described in the Remarks section for the method. + The cache automatically contains predefined system entries that are inserted when the application domain is created. You cannot insert or modify system entries with this method. A method call that attempts to modify a system entry has no effect; the method does not throw an exception. You can inspect the values of system entries with the method or the equivalent properties described in the Remarks section for the method. ]]> @@ -8105,12 +8105,12 @@ The friendly name of the default application domain is the file name of the proc property. For example, if you set to a given principal (for example, a generic principal) and then use the method to set the to , the current principal will remain the generic principal. + Setting this value will only be effective if you set it before using the property. For example, if you set to a given principal (for example, a generic principal) and then use the method to set the to , the current principal will remain the generic principal. ## Examples - The following example shows the effect on threads of using the method to change the principal policy of the application domain. It also shows the effect of using the method to change the principal that is available for attaching to threads in the application domain. + The following example shows the effect on threads of using the method to change the principal policy of the application domain. It also shows the effect of using the method to change the principal that is available for attaching to threads in the application domain. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/ADPrincipal/CPP/adprincipal.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System/AppDomain/SetPrincipalPolicy/adprincipal.cs" id="Snippet1"::: @@ -8268,9 +8268,9 @@ The friendly name of the default application domain is the file name of the proc method restricts the shadow copy to the assemblies in the directories specified by `path`. + By default, a shadow copy includes all assemblies found through probing. The method restricts the shadow copy to the assemblies in the directories specified by `path`. - The method does not specify additional directories to be searched for assemblies. Assemblies to be shadow-copied must already be located in the search path, for example under . The method specifies which search paths are eligible to be shadow-copied. + The method does not specify additional directories to be searched for assemblies. Assemblies to be shadow-copied must already be located in the search path, for example under . The method specifies which search paths are eligible to be shadow-copied. This method sets the property of the internal associated with this instance. @@ -8343,7 +8343,7 @@ The friendly name of the default application domain is the file name of the proc method to change the principal that is available for attaching to threads that are executing in the application domain. It also shows the effect on threads of using the method to change the principal policy of the application domain. + The following example shows the effect of using the method to change the principal that is available for attaching to threads that are executing in the application domain. It also shows the effect on threads of using the method to change the principal policy of the application domain. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/ADPrincipal/CPP/adprincipal.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System/AppDomain/SetPrincipalPolicy/adprincipal.cs" id="Snippet1"::: @@ -8451,7 +8451,7 @@ The friendly name of the default application domain is the file name of the proc and [Shadow Copying Assemblies](/dotnet/framework/app-domains/shadow-copy-assemblies). + For more information, see and [Shadow Copying Assemblies](/dotnet/framework/app-domains/shadow-copy-assemblies). ]]> @@ -8726,7 +8726,7 @@ The friendly name of the default application domain is the file name of the proc method. + The following code example displays the return value of the method. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/ADToString/CPP/adtostring.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System/AppDomain/ToString/adtostring.cs" id="Snippet1"::: @@ -8802,13 +8802,13 @@ The friendly name of the default application domain is the file name of the proc event occurs when the common language runtime is unable to determine the assembly that can create the requested type. This can occur if the type is defined in a dynamic assembly, or the type is not defined in a dynamic assembly but the runtime does not know which assembly the type is defined in. The latter situation can occur when is called with a type name that is not qualified with the assembly name. + The event occurs when the common language runtime is unable to determine the assembly that can create the requested type. This can occur if the type is defined in a dynamic assembly, or the type is not defined in a dynamic assembly but the runtime does not know which assembly the type is defined in. The latter situation can occur when is called with a type name that is not qualified with the assembly name. The for this event can attempt to locate and create the type. However, the event does not occur if the runtime knows it is not possible to find a type in certain assemblies. For example, this event does not occur if the type is not found in a static assembly because the runtime knows types cannot be added dynamically to static assemblies. - Beginning with the .NET Framework 4, the property contains the assembly that requested the type. For more information, see . + Beginning with the .NET Framework 4, the property contains the assembly that requested the type. For more information, see . To register an event handler for this event, you must have the required permissions, or a is thrown. @@ -8971,12 +8971,12 @@ The following example demonstrates the , the target domain is marked for unloading. The dedicated thread attempts to unload the domain, and all threads in the domain are aborted. If a thread does not abort, for example because it is executing unmanaged code, or because it is executing a `finally` block, then after a period of time, a is thrown in the thread that originally called . If the thread that could not be aborted eventually ends, the target domain is not unloaded. Thus, `domain` is not guaranteed to unload, because it might not be possible to terminate executing threads. +There's a thread dedicated to unloading application domains. This improves reliability, especially when .NET Framework is hosted. When a thread calls , the target domain is marked for unloading. The dedicated thread attempts to unload the domain, and all threads in the domain are aborted. If a thread does not abort, for example because it is executing unmanaged code, or because it is executing a `finally` block, then after a period of time, a is thrown in the thread that originally called . If the thread that could not be aborted eventually ends, the target domain is not unloaded. Thus, `domain` is not guaranteed to unload, because it might not be possible to terminate executing threads. > [!NOTE] -> In some cases, calling causes an immediate , for example if it is called in a finalizer. +> In some cases, calling causes an immediate , for example if it is called in a finalizer. -The threads in `domain` are terminated using the method, which throws a in the thread. Although the thread should terminate promptly, it can continue executing for an unpredictable amount of time in a `finally` clause. +The threads in `domain` are terminated using the method, which throws a in the thread. Although the thread should terminate promptly, it can continue executing for an unpredictable amount of time in a `finally` clause. ## Examples The following code example shows how to unload an application domain. diff --git a/xml/System/AppDomainManager.xml b/xml/System/AppDomainManager.xml index 1ce20c55b23..a06a483b131 100644 --- a/xml/System/AppDomainManager.xml +++ b/xml/System/AppDomainManager.xml @@ -47,7 +47,7 @@ The is the managed equivalent of the unmanaged host. An object participates in the creation of new application domains in a process and can customize the new before other managed code runs. The can also supply host managers that participate in other aspects of common language runtime execution. For example, an can identify a object that participates in the security decisions of the application domain. > [!NOTE] -> Only assemblies granted `FullTrust`, such as assemblies in the global assembly cache or identified as `fullTrustAssemblies` in the method can be loaded in the constructor and the method. +> Only assemblies granted `FullTrust`, such as assemblies in the global assembly cache or identified as `fullTrustAssemblies` in the method can be loaded in the constructor and the method. > [!NOTE] > This class contains a link demand and an inheritance demand at the class level. A is thrown when either the immediate caller or the derived class does not have infrastructure permission. For details about security demands, see [Link Demands](/dotnet/framework/misc/link-demands) and [Inheritance Demands](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/x4yx82e6(v=vs.100)). @@ -86,7 +86,7 @@ ## Remarks > [!NOTE] -> Only assemblies granted `FullTrust`, such as assemblies in the global assembly cache or identified as `fullTrustAssemblies` in the method can be loaded in the constructor and the method. +> Only assemblies granted `FullTrust`, such as assemblies in the global assembly cache or identified as `fullTrustAssemblies` in the method can be loaded in the constructor and the method. ]]> @@ -151,7 +151,7 @@ ## Remarks The default implementation of this method returns `false`. - This method is called when the method has been called to increase the isolated storage quota. An application that hosts the common language runtime (CLR) can override the method to perform policy decisions based on an object (which inherits ), and can then allow or prevent the increase. For example, a host could prompt the end user to approve or deny the request to increase the quota. The host's implementation of should take into account the possibility of denial-of-service attacks. For example, it should prompt the user only if the method is called from a user-initiated event such as a button click. + This method is called when the method has been called to increase the isolated storage quota. An application that hosts the common language runtime (CLR) can override the method to perform policy decisions based on an object (which inherits ), and can then allow or prevent the increase. For example, a host could prompt the end user to approve or deny the request to increase the quota. The host's implementation of should take into account the possibility of denial-of-service attacks. For example, it should prompt the user only if the method is called from a user-initiated event such as a button click. ]]> @@ -196,7 +196,7 @@ ## Remarks The friendly name, specified by the `friendlyName` parameter, can be displayed in user interfaces to identify the domain. For more information, see the property. - The default method calls the protected method to create the . Overrides of this method do not need to call the method but can return an existing domain. + The default method calls the protected method to create the . Overrides of this method do not need to call the method but can return an existing domain. ]]> @@ -281,7 +281,7 @@ method. + If the application is a manifest-activated application, the entry assembly is determined from the application manifest. If the application is not manifest activated, the entry assembly is the process executable in the default application domain. In other application domains, the entry assembly is the first executable that was executed by the method. ]]> @@ -411,19 +411,19 @@ > [!IMPORTANT] > Do not use this method to initialize an application domain in ASP.NET. In ASP.NET, configuration must be handled by the host. If you use this method to initialize the application domain, the host throws when it attempts to initialize the application domain. The exception message indicates that initialization has already occurred. - This method is called immediately after the constructor. The default implementation does nothing. A custom implementation can set up internal classes and delegates, set up an interface with the unmanaged host interface, or set up event handlers for the new . + This method is called immediately after the constructor. The default implementation does nothing. A custom implementation can set up internal classes and delegates, set up an interface with the unmanaged host interface, or set up event handlers for the new . Also, for add-in activations, a custom implementation could identify the current as the target application domain. - Beginning with the .NET Framework 4, you can use this method to sandbox the default application domain at application startup, or to modify the sandbox of a new application domain. To do this, adjust the and properties on the object that is assigned to the property of `appDomainInfo`, before you initialize the application domain. + Beginning with the .NET Framework 4, you can use this method to sandbox the default application domain at application startup, or to modify the sandbox of a new application domain. To do this, adjust the and properties on the object that is assigned to the property of `appDomainInfo`, before you initialize the application domain. > [!NOTE] -> Only assemblies granted `FullTrust`, such as assemblies in the global assembly cache or identified as `fullTrustAssemblies` in the method can be loaded in the constructor and the method. +> Only assemblies granted `FullTrust`, such as assemblies in the global assembly cache or identified as `fullTrustAssemblies` in the method can be loaded in the constructor and the method. ## Examples - The following example shows an override of the method for a custom application domain manager. This code example is part of a larger example provided for the class. + The following example shows an override of the method for a custom application domain manager. This code example is part of a larger example provided for the class. :::code language="csharp" source="~/snippets/csharp/System/AppDomainManager/Overview/customAppDomainManager.cs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System/AppDomainManager/Overview/customAppDomainManager.vb" id="Snippet2"::: diff --git a/xml/System/AppDomainManagerInitializationOptions.xml b/xml/System/AppDomainManagerInitializationOptions.xml index 271d8ceb603..b770807e924 100644 --- a/xml/System/AppDomainManagerInitializationOptions.xml +++ b/xml/System/AppDomainManagerInitializationOptions.xml @@ -27,11 +27,11 @@ Specifies the action that a custom application domain manager takes when initializing a new domain. - class. The flags apply only to custom application domain managers; they do not apply to the default manager. The method in the default application domain manager does nothing. The default enumeration value is None. - + class. The flags apply only to custom application domain managers; they do not apply to the default manager. The method in the default application domain manager does nothing. The default enumeration value is None. + ]]> diff --git a/xml/System/AppDomainSetup.xml b/xml/System/AppDomainSetup.xml index 4960eb50311..9c19825a3b9 100644 --- a/xml/System/AppDomainSetup.xml +++ b/xml/System/AppDomainSetup.xml @@ -73,7 +73,7 @@ instance does not affect any existing . It can affect only the creation of a new , when the method is called with the instance as a parameter. + Changing the properties of an instance does not affect any existing . It can affect only the creation of a new , when the method is called with the instance as a parameter. This class implements the interface. @@ -382,7 +382,7 @@ ## Remarks To specify the type of the application domain manager, set both this property and the property. If either of these properties is not set, the other is ignored. - If no type is provided, the application domain manager is created from the same type as the parent application domain (that is, the application domain from which the method is called). + If no type is provided, the application domain manager is created from the same type as the parent application domain (that is, the application domain from which the method is called). When the application domain is loaded, is thrown if the assembly does not exist, or if the assembly does not contain the type specified by the property. is thrown if the assembly is found but the version information does not match. @@ -426,7 +426,7 @@ ## Remarks To specify the type of the application domain manager, set both this property and the property. If either of these properties is not set, the other is ignored. - If no type is provided, the application domain manager is created from the same type as the parent application domain (that is, the application domain from which the method is called). + If no type is provided, the application domain manager is created from the same type as the parent application domain (that is, the application domain from which the method is called). When the application domain is loaded, is thrown if the assembly specified by the property does not contain the type specified by this property. @@ -495,7 +495,7 @@ ## Remarks The application base directory is where the assembly manager begins probing for assemblies. - The property can influence which permissions are granted to an application domain. For example, an application domain originating from the local computer normally receives full trust based on its location of origin. However, if the property of that is set to the full name of an intranet directory, the setting restricts the permissions granted to the application domain to a LocalIntranet grant even though the application domain actually originates from the local computer. + The property can influence which permissions are granted to an application domain. For example, an application domain originating from the local computer normally receives full trust based on its location of origin. However, if the property of that is set to the full name of an intranet directory, the setting restricts the permissions granted to the application domain to a LocalIntranet grant even though the application domain actually originates from the local computer. @@ -549,9 +549,9 @@ ## Examples The following example shows how to set the property when you create a new application domain. - The example creates a new application domain, and then calls the method to load the example assembly into the new application domain and create an instance of the `Worker` class. The `Worker` class inherits , so the example can use the proxy returned by to call the `TestLoad` method. + The example creates a new application domain, and then calls the method to load the example assembly into the new application domain and create an instance of the `Worker` class. The `Worker` class inherits , so the example can use the proxy returned by to call the `TestLoad` method. - The `TestLoad` method loads an assembly that you specify. You must either specify a valid, fully qualified assembly name, or comment out the method. The `TestLoad` method lists the assemblies that are loaded into the new application domain, showing that your specified assembly and the example assembly are loaded. + The `TestLoad` method loads an assembly that you specify. You must either specify a valid, fully qualified assembly name, or comment out the method. The `TestLoad` method lists the assemblies that are loaded into the new application domain, showing that your specified assembly and the example assembly are loaded. The example uses the attribute to tell the assembly loader how the application will share code across application domains. @@ -741,7 +741,7 @@ ## Remarks If the property is `true`, the value of the property is ignored. That is, no assemblies are probed for in the directories specified by the property. In addition, the values of the property and the property are ignored. No assemblies are probed for in the directories specified by the property. - The property provides an additional layer of control over the loading process. In the normal assembly loading sequence, the application base is probed before the event is raised. However, some applications might need to load assemblies from an OLE compound file within a document, or from a unique known location that is neither in the global assembly cache nor in the directories specified by the and properties. Such applications can use the property to avoid the delay caused by normal probing, and to avoid loading copies of the necessary assembly that might be located in the normal probing paths. + The property provides an additional layer of control over the loading process. In the normal assembly loading sequence, the application base is probed before the event is raised. However, some applications might need to load assemblies from an OLE compound file within a document, or from a unique known location that is neither in the global assembly cache nor in the directories specified by the and properties. Such applications can use the property to avoid the delay caused by normal probing, and to avoid loading copies of the necessary assembly that might be located in the normal probing paths. ]]> @@ -915,7 +915,7 @@ > [!IMPORTANT] > Assigning a value to this property does not create any directories. The directories must be created or verified by the code that uses them. - The dynamic directory is a subdirectory of . Its simple name is the value returned by the property, so its format is *original path*\\*hash code*\\*application name*. + The dynamic directory is a subdirectory of . Its simple name is the value returned by the property, so its format is *original path*\\*hash code*\\*application name*. ## Examples The following example demonstrates how to use the property to set the path an application domain probes when loading dynamic assemblies. @@ -973,14 +973,14 @@ method provides a way to override the configuration information of an application that creates a new application domain. The configuration file information in `value` overrides the configuration file information for the application. For example, when the Example.exe application creates a new application domain, it can override the configuration information originally obtained from Example.exe.config file. + The method provides a way to override the configuration information of an application that creates a new application domain. The configuration file information in `value` overrides the configuration file information for the application. For example, when the Example.exe application creates a new application domain, it can override the configuration information originally obtained from Example.exe.config file. > [!IMPORTANT] -> Some consumers of configuration file information do not use the information stored by the method. The runtime does not enforce this. To ensure that all configuration file information is overridden in a new application domain, use the property to specify a configuration file. The method does affect assembly binding. +> Some consumers of configuration file information do not use the information stored by the method. The runtime does not enforce this. To ensure that all configuration file information is overridden in a new application domain, use the property to specify a configuration file. The method does affect assembly binding. The XML in `value` is the same as the XML in a normal configuration file, except that it is stored as a array. - To access the configuration bytes for an application domain, use the property to get the object for the application domain, then use the method. + To access the configuration bytes for an application domain, use the property to get the object for the application domain, then use the method. ]]> @@ -1149,7 +1149,7 @@ are not under , they are ignored. + Private assemblies are deployed in the same directory structure as the application. If the directories specified for are not under , they are ignored. ]]> @@ -1188,7 +1188,7 @@ (""), to exclude the application directory path - that is, - from the search path for the application, and to search for assemblies only in . + Set this property to any non-null string value, including (""), to exclude the application directory path - that is, - from the search path for the application, and to search for assemblies only in . ]]> @@ -1263,7 +1263,7 @@ method to specify that one or more of these breaking changes should be rolled back for the application domain, to make the behavior compatible with the previous version of the .NET Framework. + Major versions of the .NET Framework sometimes introduce breaking changes from the previous version. For example, the .NET Framework 4 introduces a small number of breaking changes from the .NET Framework 3.5. Use the method to specify that one or more of these breaking changes should be rolled back for the application domain, to make the behavior compatible with the previous version of the .NET Framework. Each time you call this method, it replaces the existing switch settings. To erase the settings, specify `null` for the `switches` parameter. @@ -1320,10 +1320,10 @@ method provides a way to replace the configuration information of an application that creates a new application domain. The configuration file information in `value` replaces the configuration file information for the application. For example, when the Example.exe application creates a new application domain, it can replace the configuration information originally obtained from the Example.exe.config file. + The method provides a way to replace the configuration information of an application that creates a new application domain. The configuration file information in `value` replaces the configuration file information for the application. For example, when the Example.exe application creates a new application domain, it can replace the configuration information originally obtained from the Example.exe.config file. > [!IMPORTANT] -> Some consumers of configuration file information do not use the information stored by the method. The runtime does not enforce this. To ensure that all configuration file information is replaced in a new application domain, use the property to specify a configuration file. The method does affect assembly binding. +> Some consumers of configuration file information do not use the information stored by the method. The runtime does not enforce this. To ensure that all configuration file information is replaced in a new application domain, use the property to specify a configuration file. The method does affect assembly binding. The XML in `value` is the same as the XML in a normal configuration file, except that it is stored as a array. @@ -1373,7 +1373,7 @@ method: + The following string comparison and sorting methods can be overridden by the method: - `IsNLSDefinedString` @@ -1440,9 +1440,9 @@ and properties. The property restricts the shadow copy to the assemblies in the directories specified by . + When shadow copying is enabled, the default is to shadow copy all assemblies found through probing; that is, in the directories specified by the and properties. The property restricts the shadow copy to the assemblies in the directories specified by . - If you don't assign a string to the property, or if you set this property to `null`, all assemblies in the directories specified by the and properties are shadow copied. + If you don't assign a string to the property, or if you set this property to `null`, all assemblies in the directories specified by the and properties are shadow copied. > [!IMPORTANT] > Directory paths must not contain semicolons, because the semicolon is the delimiter character. There is no escape character for semicolons. diff --git a/xml/System/AppDomainUnloadedException.xml b/xml/System/AppDomainUnloadedException.xml index a2b5d19ce1c..f1b6ccb3332 100644 --- a/xml/System/AppDomainUnloadedException.xml +++ b/xml/System/AppDomainUnloadedException.xml @@ -84,7 +84,7 @@ uses the HRESULT COR_E_APPDOMAINUNLOADED, which has the value 0x80131014. - For a list of initial property values for an instance of , see the constructors. + For a list of initial property values for an instance of , see the constructors. @@ -175,8 +175,8 @@ |Property|Value| |--------------|-----------| -||A null reference (`Nothing` in Visual Basic).| -||The localized error message string.| +||A null reference (`Nothing` in Visual Basic).| +||The localized error message string.| ]]> @@ -235,8 +235,8 @@ |Property|Value| |--------------|-----------| -||A null reference (`Nothing` in Visual Basic).| -||The error message string.| +||A null reference (`Nothing` in Visual Basic).| +||The error message string.| ]]> @@ -368,8 +368,8 @@ |Property|Value| |--------------|-----------| -||The inner exception reference.| -||The error message string.| +||The inner exception reference.| +||The error message string.| ]]> diff --git a/xml/System/ApplicationException.xml b/xml/System/ApplicationException.xml index b9cb211511c..6f72fe724cc 100644 --- a/xml/System/ApplicationException.xml +++ b/xml/System/ApplicationException.xml @@ -130,8 +130,8 @@ |Property|Value| |--------------|-----------| -||A null reference (`Nothing` in Visual Basic).| -||The localized error message string.| +||A null reference (`Nothing` in Visual Basic).| +||The localized error message string.| ]]> @@ -189,7 +189,7 @@ |Property|Value| |--------------|-----------| -||A null reference (`Nothing` in Visual Basic).| +||A null reference (`Nothing` in Visual Basic).| |`Message`|The error message string.| ]]> @@ -316,8 +316,8 @@ |Property|Value| |--------------|-----------| -||The inner exception reference.| -||The error message string.| +||The inner exception reference.| +||The error message string.| ]]> diff --git a/xml/System/ApplicationId.xml b/xml/System/ApplicationId.xml index 4b31cd11fb8..660b967e9aa 100644 --- a/xml/System/ApplicationId.xml +++ b/xml/System/ApplicationId.xml @@ -158,7 +158,7 @@ , , , , and properties of the . + The constructor initializes the , , , , and properties of the . ]]> @@ -222,7 +222,7 @@ method. The hash codes for the original and the copy are also equal. + The copy returned by this method is equal to the original as substantiated by the method. The hash codes for the original and the copy are also equal. ]]> @@ -280,7 +280,7 @@ value can include language information, for example, "en-US". + The value can include language information, for example, "en-US". For information about culture values, see . @@ -355,7 +355,7 @@ method. + This method overrides the method. ]]> @@ -407,7 +407,7 @@ and properties. + This method generates the same hash code for two objects that have the same values for their and properties. ]]> @@ -458,7 +458,7 @@ is the simple, unencrypted name of the application. + is the simple, unencrypted name of the application. @@ -587,7 +587,7 @@ ## Remarks The public key token is represented by the last 8 bytes of the SHA-1 hash of the public key under which the application is signed. - For more information, see . + For more information, see . @@ -648,7 +648,7 @@ method. + This method overrides the method. ]]> diff --git a/xml/System/ApplicationIdentity.xml b/xml/System/ApplicationIdentity.xml index ace1cf67c87..9d1fbf5d3da 100644 --- a/xml/System/ApplicationIdentity.xml +++ b/xml/System/ApplicationIdentity.xml @@ -272,7 +272,7 @@ http://testserver/ActivationContext/ActivationContext.application property, see the constructor. + For a description of the format of the property, see the constructor. @@ -372,7 +372,7 @@ http://testserver/ActivationContext/ActivationContext.application constructor. + For a description of the format of a full name for a manifest activated application, see the constructor. ]]> diff --git a/xml/System/ArgIterator.xml b/xml/System/ArgIterator.xml index 8c6b7428acf..32d0ad70030 100644 --- a/xml/System/ArgIterator.xml +++ b/xml/System/ArgIterator.xml @@ -43,13 +43,13 @@ Represents a variable-length argument list; that is, the parameters of a function that takes a variable number of arguments. - structure to enumerate the mandatory and optional arguments in an argument list. The structure is not generally useful for applications other than compilers. - - The functionality in the structure is typically hidden in the syntax of a specific programming language. For example, in the C++ programming language you declare a variable-length argument list by specifying an ellipsis ("...") at the end of the argument list. The structure is useful primarily when a development language does not provide direct support for accessing variable-length parameters. - + structure to enumerate the mandatory and optional arguments in an argument list. The structure is not generally useful for applications other than compilers. + + The functionality in the structure is typically hidden in the syntax of a specific programming language. For example, in the C++ programming language you declare a variable-length argument list by specifying an ellipsis ("...") at the end of the argument list. The structure is useful primarily when a development language does not provide direct support for accessing variable-length parameters. + ]]> @@ -108,11 +108,11 @@ An argument list consisting of mandatory and optional arguments. Initializes a new instance of the structure using the specified argument list. - object enumerates the argument list starting from the first optional argument. - + object enumerates the argument list starting from the first optional argument. + ]]> @@ -166,11 +166,11 @@ A pointer to the argument in to access first, or the first mandatory argument in if is . Initializes a new instance of the structure using the specified argument list and a pointer to an item in the list. - object enumerates the argument list starting from the argument specified by `ptr`, or the first mandatory argument if `ptr` is `null`. - + object enumerates the argument list starting from the argument specified by `ptr`, or the first mandatory argument if `ptr` is `null`. + ]]> @@ -213,13 +213,13 @@ Concludes processing of the variable-length argument list represented by this instance. - concludes the processing of a variable-length argument list. However, this method has no actual implementation; the method body is empty. You can use this method in your code as a marker to indicate where variable-length argument list processing logically ends. - - The method corresponds to the `va_end` method in the C standard library. - + concludes the processing of a variable-length argument list. However, this method has no actual implementation; the method body is empty. You can use this method in your code as a marker to indicate where variable-length argument list processing logically ends. + + The method corresponds to the `va_end` method in the C standard library. + ]]> @@ -370,11 +370,11 @@ Returns the next argument in a variable-length argument list. The next argument as a object. - An attempt was made to read beyond the end of the list. @@ -432,11 +432,11 @@ Returns the next argument in a variable-length argument list that has a specified type. The next argument as a object. - An attempt was made to read beyond the end of the list. @@ -488,13 +488,13 @@ Returns the type of the next argument. The type of the next argument. - returns the type of the argument as specified in the calling function. For example, if an argument is type , but the calling function specifies the argument as type , reports the argument as type . - + returns the type of the argument as specified in the calling function. For example, if an argument is type , but the calling function specifies the argument as type , reports the argument as type . + ]]> diff --git a/xml/System/ArgumentException.xml b/xml/System/ArgumentException.xml index 01ba6ad722a..1bb262d3294 100644 --- a/xml/System/ArgumentException.xml +++ b/xml/System/ArgumentException.xml @@ -175,8 +175,8 @@ The following example demonstrates how to throw and catch an |A null reference (`Nothing` in Visual Basic).| -||The localized error message string.| +||A null reference (`Nothing` in Visual Basic).| +||The localized error message string.| ]]> @@ -236,8 +236,8 @@ The following example demonstrates how to throw and catch an |A null reference (`Nothing` in Visual Basic).| -||The error message string.| +||A null reference (`Nothing` in Visual Basic).| +||The error message string.| ]]> @@ -367,8 +367,8 @@ The following example demonstrates how to throw and catch an |The inner exception reference.| -||The localized error message string.| +||The inner exception reference.| +||The localized error message string.| ]]> @@ -434,11 +434,11 @@ The following example demonstrates how to throw and catch an |The error message string.| -||The parameter name string.| +||The error message string.| +||The parameter name string.| ## Examples - The following code example demonstrates how to call the constructor. This code example is part of a larger example provided for the class. + The following code example demonstrates how to call the constructor. This code example is part of a larger example provided for the class. :::code language="csharp" source="~/snippets/csharp/System/ArgumentException/Overview/argumentexception.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/ArgumentException/FS/argumentexception.fs" id="Snippet2"::: @@ -509,9 +509,9 @@ The following example demonstrates how to throw and catch an |The inner exception reference.| -||The localized error message string.| -||The parameter name string.| +||The inner exception reference.| +||The localized error message string.| +||The parameter name string.| ]]> @@ -584,7 +584,7 @@ The following example demonstrates how to throw and catch an sets a with all the exception object data targeted for serialization. During deserialization, the exception object is reconstituted from the transmitted over the stream. + sets a with all the exception object data targeted for serialization. During deserialization, the exception object is reconstituted from the transmitted over the stream. For more information, see . @@ -662,7 +662,7 @@ The following example demonstrates how to throw and catch an . The error message should be localized. + This property overrides . The error message should be localized. ]]> diff --git a/xml/System/ArgumentNullException.xml b/xml/System/ArgumentNullException.xml index 1f2fb084efa..77efd49e575 100644 --- a/xml/System/ArgumentNullException.xml +++ b/xml/System/ArgumentNullException.xml @@ -151,8 +151,8 @@ |Property|Value| |--------------|-----------| -||A null reference (`Nothing` in Visual Basic).| -||A localized error message string, such as "Value cannot be null." for the English language.| +||A null reference (`Nothing` in Visual Basic).| +||A localized error message string, such as "Value cannot be null." for the English language.| ]]> @@ -214,9 +214,9 @@ |Property|Value| |--------------|-----------| -||A null reference (`Nothing` in Visual Basic).| -||A localized error message string that identifies the null argument. For example, if the `paramName` argument is "arg1", the English language message string is:

On .NET 5+ and .NET Core: `Value cannot be null. (Parameter name: 'arg1')`

On .NET Framework: `Value cannot be null.\r\nParameter name: arg1`| -||The parameter name string.| +||A null reference (`Nothing` in Visual Basic).| +||A localized error message string that identifies the null argument. For example, if the `paramName` argument is "arg1", the English language message string is:

On .NET 5+ and .NET Core: `Value cannot be null. (Parameter name: 'arg1')`

On .NET Framework: `Value cannot be null.\r\nParameter name: arg1`| +||The parameter name string.| ]]>
@@ -394,9 +394,9 @@ |Property|Value| |--------------|-----------| -||A null reference (`Nothing` in Visual Basic).| -||The error message string.| -||The parameter name string.| +||A null reference (`Nothing` in Visual Basic).| +||The error message string.| +||The parameter name string.| ]]>
diff --git a/xml/System/ArgumentOutOfRangeException.xml b/xml/System/ArgumentOutOfRangeException.xml index 1a6a780ddb2..2fceb20b211 100644 --- a/xml/System/ArgumentOutOfRangeException.xml +++ b/xml/System/ArgumentOutOfRangeException.xml @@ -106,7 +106,7 @@ The conditions in which an exception i :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/System.ArgumentOutOfRangeException/fs/NoElements.fs" id="Snippet5"::: :::code language="vb" source="~/snippets/visualbasic/System/ArgumentOutOfRangeException/Overview/NoElements.vb" id="Snippet5"::: - 2. In some cases, the exception may occur because you are attempting to add a member to a collection by using an index that does not exist, rather than by calling the method, such as `Add`, that exists for this purpose. The following example attempts to add an element to a collection by using a non-existent index rather than calling the method. + 2. In some cases, the exception may occur because you are attempting to add a member to a collection by using an index that does not exist, rather than by calling the method, such as `Add`, that exists for this purpose. The following example attempts to add an element to a collection by using a non-existent index rather than calling the method. :::code language="csharp" source="~/snippets/csharp/System/ArgumentOutOfRangeException/Overview/NoElements2.cs" id="Snippet13"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/System.ArgumentOutOfRangeException/fs/NoElements2.fs" id="Snippet13"::: @@ -118,7 +118,7 @@ The conditions in which an exception i :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/System.ArgumentOutOfRangeException/fs/NoElements2.fs" id="Snippet14"::: :::code language="vb" source="~/snippets/visualbasic/System/ArgumentOutOfRangeException/Overview/NoElements2.vb" id="Snippet14"::: - 3. You're attempting to retrieve an item whose index is negative. This usually occurs because you've searched a collection for the index of a particular element and have erroneously assumed that the search is successful. In the following example, the call to the method fails to find a string equal to "Z" and so returns -1. However, this is an invalid index value. + 3. You're attempting to retrieve an item whose index is negative. This usually occurs because you've searched a collection for the index of a particular element and have erroneously assumed that the search is successful. In the following example, the call to the method fails to find a string equal to "Z" and so returns -1. However, this is an invalid index value. :::code language="csharp" source="~/snippets/csharp/System/ArgumentOutOfRangeException/Overview/BadSearch.cs" id="Snippet6"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/System.ArgumentOutOfRangeException/fs/BadSearch.fs" id="Snippet6"::: @@ -144,7 +144,7 @@ The conditions in which an exception i - You are attempting to perform a string operation by calling a string manipulation method, and the starting index does not exist in the string. - Overloads of methods such as such as , , , , , , , , or that allow you to specify the starting index of the operation require that the index be a valid position within the string. Valid indexes range from 0 to - 1. + Overloads of methods such as such as , , , , , , , , or that allow you to specify the starting index of the operation require that the index be a valid position within the string. Valid indexes range from 0 to - 1. There are four common causes of this exception: @@ -154,7 +154,7 @@ The conditions in which an exception i :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/System.ArgumentOutOfRangeException/fs/EmptyString1.fs" id="Snippet15"::: :::code language="vb" source="~/snippets/visualbasic/System/ArgumentOutOfRangeException/Overview/EmptyString1.vb" id="Snippet15"::: - You can eliminate the exception by testing whether the string's is greater than zero or by calling the method to ensure that the string is not `null` or empty. The following code fragment does the latter. In this case, if the string is `null` or empty, the `GetFirstCharacter` method returns U+0000. + You can eliminate the exception by testing whether the string's is greater than zero or by calling the method to ensure that the string is not `null` or empty. The following code fragment does the latter. In this case, if the string is `null` or empty, the `GetFirstCharacter` method returns U+0000. :::code language="csharp" source="~/snippets/csharp/System/ArgumentOutOfRangeException/Overview/EmptyString1.cs" id="Snippet16"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/System.ArgumentOutOfRangeException/fs/EmptyString1.fs" id="Snippet16"::: @@ -162,7 +162,7 @@ The conditions in which an exception i 2. You're manipulating a string based on the position of a substring within that string, and you've failed to determine whether the substring was actually found. - The following example extracts the second word of a two-word phrase. It throws an exception if the phrase consists of only one word, and therefore does not contain an embedded space character. This occurs because the call to the method returns -1 to indicate that the search failed, and this invalid value is then passed to the method. + The following example extracts the second word of a two-word phrase. It throws an exception if the phrase consists of only one word, and therefore does not contain an embedded space character. This occurs because the call to the method returns -1 to indicate that the search failed, and this invalid value is then passed to the method. :::code language="csharp" source="~/snippets/csharp/System/ArgumentOutOfRangeException/Overview/NoFind1.cs" id="Snippet17"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/System.ArgumentOutOfRangeException/fs/NoFind1.fs" id="Snippet17"::: @@ -178,21 +178,21 @@ The conditions in which an exception i The methods that extract substrings all require that you specify the starting position of the substring and, for substrings that do not continue to the end of the string, the number of characters in the substring. Note that this is not the *index* of the last character in the substring. - An exception is typically thrown in this case because you've incorrectly calculated the number of characters in the substring. If you are using a search method like to identify the starting and ending positions of a substring: + An exception is typically thrown in this case because you've incorrectly calculated the number of characters in the substring. If you are using a search method like to identify the starting and ending positions of a substring: - - If the character in the ending position returned by is to be included in the substring, the ending position of the substring is given by the formula + - If the character in the ending position returned by is to be included in the substring, the ending position of the substring is given by the formula ``` endIndex - startIndex + 1 ``` - - If the character in the ending position returned by is to be excluded from the substring, the ending position of the substring is given by the formula + - If the character in the ending position returned by is to be excluded from the substring, the ending position of the substring is given by the formula ``` endIndex - startIndex ``` - The following example defines a `FindWords` method that uses the method to identify space characters and punctuation marks in a string and returns an array that contains the words found in the string. + The following example defines a `FindWords` method that uses the method to identify space characters and punctuation marks in a string and returns an array that contains the words found in the string. :::code language="csharp" source="~/snippets/csharp/System/ArgumentOutOfRangeException/Overview/FindWords1.cs" id="Snippet19"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/System.ArgumentOutOfRangeException/fs/FindWords1.fs" id="Snippet19"::: @@ -200,7 +200,7 @@ The conditions in which an exception i - You have passed a negative number to a method with an argument that requires only positive numbers and zero, or you have passed either a negative number or zero to a method with an argument that requires only positive numbers. - For example, the method requires that you specify the number of elements in each dimension of a two-dimensional array; valid values for each dimension can range from 0 to . But because the dimension argument in the following example has a negative value, the method throws an exception. + For example, the method requires that you specify the number of elements in each dimension of a two-dimensional array; valid values for each dimension can range from 0 to . But because the dimension argument in the following example has a negative value, the method throws an exception. :::code language="csharp" source="~/snippets/csharp/System/ArgumentOutOfRangeException/Overview/OOR1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/System.ArgumentOutOfRangeException/fs/OOR1.fs" id="Snippet1"::: @@ -220,7 +220,7 @@ The conditions in which an exception i - A race condition exists in an app that is multithreaded or has tasks that execute asynchronously and that updates an array or collection. - The following example uses a object to populate a collection of `Continent` objects. It throws an if the example attempts to display the seven items in the collection before the collection is fully populated. + The following example uses a object to populate a collection of `Continent` objects. It throws an if the example attempts to display the seven items in the collection before the collection is fully populated. :::code language="csharp" source="~/snippets/csharp/System/ArgumentOutOfRangeException/Overview/Race1.cs" id="Snippet11"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/System.ArgumentOutOfRangeException/fs/Race1.fs" id="Snippet11"::: @@ -228,7 +228,7 @@ The conditions in which an exception i In this case, two resources are accessed from multiple threads: - - The `continents` collection. Its method is called from multiple threads. In addition, the main or primary thread assumes the collection is fully populated with seven elements when it iterates its members. + - The `continents` collection. Its method is called from multiple threads. In addition, the main or primary thread assumes the collection is fully populated with seven elements when it iterates its members. - The `msg` string, which is concatenated from multiple threads. @@ -238,7 +238,7 @@ The conditions in which an exception i - Ensure that shared state (that is, resources that can be accessed by multiple threads) is accessed in a thread-safe way, so that only one thread at a time has exclusive access to the resources. A large number of classes, such as , , , and , are available to synchronize access to resources. For more information, see [Threading](/dotnet/standard/threading/). In addition, language support is available through the [lock](/dotnet/csharp/language-reference/keywords/lock-statement) statement in C# and the [SyncLock](/dotnet/visual-basic/language-reference/statements/synclock-statement) construct in Visual Basic. - The following example addresses the and the other issues from the previous example. It replaces the object with a object to ensure that access to the collection is thread-safe, uses a object to ensure that the application thread continues only after other threads have executed, and uses a lock to ensure that only one thread can access the `msg` variable at a time. + The following example addresses the and the other issues from the previous example. It replaces the object with a object to ensure that access to the collection is thread-safe, uses a object to ensure that the application thread continues only after other threads have executed, and uses a lock to ensure that only one thread can access the `msg` variable at a time. :::code language="csharp" source="~/snippets/csharp/System/ArgumentOutOfRangeException/Overview/Race2.cs" id="Snippet12"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/System.ArgumentOutOfRangeException/fs/Race2.fs" id="Snippet12"::: @@ -323,8 +323,8 @@ The following example defines a class to contain information about an invited gu |Property|Value| |--------------|-----------| -||A null reference (`Nothing` in Visual Basic).| -||The localized error message string.| +||A null reference (`Nothing` in Visual Basic).| +||The localized error message string.| ]]>
@@ -386,9 +386,9 @@ The following example defines a class to contain information about an invited gu |Property|Value| |--------------|-----------| -||A null reference (`Nothing` in Visual Basic).| -||The empty string ("").| -||The parameter name string.| +||A null reference (`Nothing` in Visual Basic).| +||The empty string ("").| +||The parameter name string.| ]]>
@@ -566,9 +566,9 @@ The following example defines a class to contain information about an invited gu |Property|Value| |--------------|-----------| -||`null`.| -||The error message string.| -||The parameter name string.| +||`null`.| +||The error message string.| +||The parameter name string.| ]]>
@@ -636,10 +636,10 @@ The following example defines a class to contain information about an invited gu |Property|Value| |--------------|-----------| -||The argument value.| -||The null reference (`Nothing` in Visual Basic).| -||The error message string.| -||The parameter name string.| +||The argument value.| +||The null reference (`Nothing` in Visual Basic).| +||The error message string.| +||The parameter name string.| ]]>
@@ -778,7 +778,7 @@ The following example defines a class to contain information about an invited gu sets a object with all the exception object data targeted for serialization. During deserialization, the exception object is reconstituted from the transmitted over the stream. + sets a object with all the exception object data targeted for serialization. During deserialization, the exception object is reconstituted from the transmitted over the stream. For more information, see . @@ -850,7 +850,7 @@ The following example defines a class to contain information about an invited gu . + This property overrides . The error message should describe the expected values of the parameter that causes this exception. The error message should be localized. diff --git a/xml/System/ArithmeticException.xml b/xml/System/ArithmeticException.xml index 55ebcea311a..ca7efa27516 100644 --- a/xml/System/ArithmeticException.xml +++ b/xml/System/ArithmeticException.xml @@ -157,8 +157,8 @@ |Property|Value| |--------------|-----------| -||`null`.| -||The localized error message string.| +||`null`.| +||The localized error message string.| ]]> @@ -218,8 +218,8 @@ |Property|Value| |--------------|-----------| -||The null reference (`Nothing` in Visual Basic).| -||The error message string.| +||The null reference (`Nothing` in Visual Basic).| +||The error message string.| ]]> @@ -347,8 +347,8 @@ |Property|Value| |--------------|-----------| -||The inner exception reference.| -||The error message string.| +||The inner exception reference.| +||The error message string.| ]]>
diff --git a/xml/System/Array.xml b/xml/System/Array.xml index b9f1222e252..c5e99d6a8df 100644 --- a/xml/System/Array.xml +++ b/xml/System/Array.xml @@ -104,7 +104,7 @@ The class is the base class for language implementations that support arrays. However, only the system and compilers can derive explicitly from the class. Users should employ the array constructs provided by the language. - An element is a value in an . The length of an is the total number of elements it can contain. The lower bound of an is the index of its first element. An can have any lower bound, but it has a lower bound of zero by default. A different lower bound can be defined when creating an instance of the class using . A multidimensional can have different bounds for each dimension. An array can have a maximum of 32 dimensions. + An element is a value in an . The length of an is the total number of elements it can contain. The lower bound of an is the index of its first element. An can have any lower bound, but it has a lower bound of zero by default. A different lower bound can be defined when creating an instance of the class using . A multidimensional can have different bounds for each dimension. An array can have a maximum of 32 dimensions. Unlike the classes in the namespaces, has a fixed capacity. To increase the capacity, you must create a new object with the required capacity, copy the elements from the old object to the new one, and delete the old . @@ -112,23 +112,23 @@ **.NET Framework only:** By default, the maximum size of an is 2 gigabytes (GB). In a 64-bit environment, you can avoid the size restriction by setting the `enabled` attribute of the [gcAllowVeryLargeObjects](/dotnet/framework/configure-apps/file-schema/runtime/gcallowverylargeobjects-element) configuration element to `true` in the run-time environment. - Single-dimensional arrays implement the , , , and generic interfaces. The implementations are provided to arrays at run time, and as a result, the generic interfaces do not appear in the declaration syntax for the class. In addition, there are no reference topics for interface members that are accessible only by casting an array to the generic interface type (explicit interface implementations). The key thing to be aware of when you cast an array to one of these interfaces is that members which add, insert, or remove elements throw . + Single-dimensional arrays implement the , , , and generic interfaces. The implementations are provided to arrays at run time, and as a result, the generic interfaces do not appear in the declaration syntax for the class. In addition, there are no reference topics for interface members that are accessible only by casting an array to the generic interface type (explicit interface implementations). The key thing to be aware of when you cast an array to one of these interfaces is that members which add, insert, or remove elements throw . objects provide information about array type declarations. objects with the same array type share the same object. - and might not return the expected results with because if an array is cast to the type , the result is an object, not an array. That is, `typeof(System.Array).IsArray` returns `false`, and `typeof(System.Array).GetElementType` returns `null`. + and might not return the expected results with because if an array is cast to the type , the result is an object, not an array. That is, `typeof(System.Array).IsArray` returns `false`, and `typeof(System.Array).GetElementType` returns `null`. - The method copies elements not only between arrays of the same type but also between standard arrays of different types; it handles type casting automatically. + The method copies elements not only between arrays of the same type but also between standard arrays of different types; it handles type casting automatically. - Some methods, such as , , , , and , provide overloads that accept 64-bit integers as parameters to accommodate large capacity arrays. and return 64-bit integers indicating the length of the array. + Some methods, such as , , , , and , provide overloads that accept 64-bit integers as parameters to accommodate large capacity arrays. and return 64-bit integers indicating the length of the array. - The is not guaranteed to be sorted. You must sort the prior to performing operations (such as ) that require the to be sorted. + The is not guaranteed to be sorted. You must sort the prior to performing operations (such as ) that require the to be sorted. Using an object of pointers in native code is not supported and will throw a for several methods. ## Examples - The following code example shows how copies elements between an array of type integer and an array of type . + The following code example shows how copies elements between an array of type integer and an array of type . :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_Classic/classic Array Example/FS/source.fs" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System/Array/Overview/source.cs" id="Snippet1"::: @@ -219,7 +219,7 @@ This method is an O(1) operation. ## Examples - The following example wraps an array in a read-only . + The following example wraps an array in a read-only . :::code language="csharp" source="~/snippets/csharp/System/Array/AsReadOnlyT/arrayasreadonly.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Array.AsReadOnly/FS/arrayasreadonly.fs" id="Snippet1"::: @@ -327,15 +327,15 @@ > [!NOTE] > For every element tested, `value` is passed to the appropriate implementation, even if `value` is `null`. That is, the implementation determines how a given element compares to `null`. - This method is an O(log `n`) operation, where `n` is the of `array`. + This method is an O(log `n`) operation, where `n` is the of `array`. ## Examples - The following code example shows how to use to locate a specific object in an . + The following code example shows how to use to locate a specific object in an . > [!NOTE] -> The array is created with its elements in ascending sort order. The method requires the array to be sorted in ascending order. +> The array is created with its elements in ascending sort order. The method requires the array to be sorted in ascending order. :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_Classic/classic Array.BinarySearch Example/FS/source.fs" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System/Array/BinarySearch/source.cs" id="Snippet1"::: @@ -449,7 +449,7 @@ > [!NOTE] > For every element tested, `value` is passed to the appropriate implementation, even if `value` is `null`. That is, the implementation determines how a given element compares to `null`. - This method is an O(log `n`) operation, where `n` is the of `array`. + This method is an O(log `n`) operation, where `n` is the of `array`. ]]>
@@ -783,28 +783,28 @@ If `array` does not contain the specified value, the method returns a negative integer. You can apply the bitwise complement operator (~ in C#, `Not` in Visual Basic) to the negative result to produce an index. If this index is equal to the size of the array, there are no elements larger than `value` in the array. Otherwise, it is the index of the first element that is larger than `value`. - `T` must implement the generic interface, which is used for comparisons. The elements of `array` must already be sorted in increasing value according to the sort order defined by the implementation; otherwise, the result might be incorrect. + `T` must implement the generic interface, which is used for comparisons. The elements of `array` must already be sorted in increasing value according to the sort order defined by the implementation; otherwise, the result might be incorrect. Duplicate elements are allowed. If the contains more than one element equal to `value`, the method returns the index of only one of the occurrences, and not necessarily the first one. `null` can always be compared with any other reference type; therefore, comparisons with `null` do not generate an exception. > [!NOTE] -> For every element tested, `value` is passed to the appropriate implementation, even if `value` is `null`. That is, the implementation determines how a given element compares to `null`. +> For every element tested, `value` is passed to the appropriate implementation, even if `value` is `null`. That is, the implementation determines how a given element compares to `null`. - This method is an O(log `n`) operation, where `n` is the of `array`. + This method is an O(log `n`) operation, where `n` is the of `array`. ## Examples - The following code example demonstrates the generic method overload and the generic method overload. An array of strings is created, in no particular order. + The following code example demonstrates the generic method overload and the generic method overload. An array of strings is created, in no particular order. - The array is displayed, sorted, and displayed again. Arrays must be sorted in order to use the method. + The array is displayed, sorted, and displayed again. Arrays must be sorted in order to use the method. > [!NOTE] -> The calls to the and generic methods do not look any different from calls to their nongeneric counterparts, because Visual Basic, F#, C#, and C++ infer the type of the generic type parameter from the type of the first argument. If you use the [Ildasm.exe (IL Disassembler)](/dotnet/framework/tools/ildasm-exe-il-disassembler) to examine the Microsoft intermediate language (MSIL), you can see that the generic methods are being called. +> The calls to the and generic methods do not look any different from calls to their nongeneric counterparts, because Visual Basic, F#, C#, and C++ infer the type of the generic type parameter from the type of the first argument. If you use the [Ildasm.exe (IL Disassembler)](/dotnet/framework/tools/ildasm-exe-il-disassembler) to examine the Microsoft intermediate language (MSIL), you can see that the generic methods are being called. - The generic method overload is then used to search for two strings, one that is not in the array and one that is. The array and the return value of the method are passed to the `ShowWhere` generic method (the `showWhere` function in the F# example), which displays the index value if the string is found, and otherwise the elements the search string would fall between if it were in the array. The index is negative if the string is not in the array, so the `ShowWhere` method takes the bitwise complement (the ~ operator in C#, the ~~~ operator in F#, `Xor`-1 in Visual Basic) to obtain the index of the first element in the list that is larger than the search string. + The generic method overload is then used to search for two strings, one that is not in the array and one that is. The array and the return value of the method are passed to the `ShowWhere` generic method (the `showWhere` function in the F# example), which displays the index value if the string is found, and otherwise the elements the search string would fall between if it were in the array. The index is negative if the string is not in the array, so the `ShowWhere` method takes the bitwise complement (the ~ operator in C#, the ~~~ operator in F#, `Xor`-1 in Visual Basic) to obtain the index of the first element in the list that is larger than the search string. :::code language="csharp" source="~/snippets/csharp/System/Array/BinarySearchT/source.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/Array_SortSearch/fs/source.fs" id="Snippet1"::: @@ -910,33 +910,33 @@ The comparer customizes how the elements are compared. For example, you can use a as the comparer to perform case-insensitive string searches. - If `comparer` is not `null`, the elements of `array` are compared to the specified value using the specified generic interface implementation. The elements of `array` must already be sorted in increasing value according to the sort order defined by `comparer`; otherwise, the result might be incorrect. + If `comparer` is not `null`, the elements of `array` are compared to the specified value using the specified generic interface implementation. The elements of `array` must already be sorted in increasing value according to the sort order defined by `comparer`; otherwise, the result might be incorrect. - If `comparer` is `null`, the comparison is done using the generic interface implementation provided by `T`. The elements of `array` must already be sorted in increasing value according to the sort order defined by the implementation; otherwise, the result might be incorrect. + If `comparer` is `null`, the comparison is done using the generic interface implementation provided by `T`. The elements of `array` must already be sorted in increasing value according to the sort order defined by the implementation; otherwise, the result might be incorrect. > [!NOTE] -> If `comparer` is `null` and `value` does not implement the generic interface, the elements of `array` are not tested for before the search begins. An exception is thrown if the search encounters an element that does not implement . +> If `comparer` is `null` and `value` does not implement the generic interface, the elements of `array` are not tested for before the search begins. An exception is thrown if the search encounters an element that does not implement . Duplicate elements are allowed. If the contains more than one element equal to `value`, the method returns the index of only one of the occurrences, and not necessarily the first one. `null` can always be compared with any other reference type; therefore, comparisons with `null` do not generate an exception. > [!NOTE] -> For every element tested, `value` is passed to the appropriate implementation, even if `value` is `null`. That is, the implementation determines how a given element compares to `null`. +> For every element tested, `value` is passed to the appropriate implementation, even if `value` is `null`. That is, the implementation determines how a given element compares to `null`. - This method is an O(log `n`) operation, where `n` is the of `array`. + This method is an O(log `n`) operation, where `n` is the of `array`. ## Examples - The following example demonstrates the generic method overload and the generic method overload. + The following example demonstrates the generic method overload and the generic method overload. The code example defines an alternative comparer for strings, named `ReverseCompare`, which implements the `IComparer` (`IComparer(Of String)` in Visual Basic) generic interface. The comparer calls the method, reversing the order of the comparands so that the strings sort high-to-low instead of low-to-high. - The array is displayed, sorted, and displayed again. Arrays must be sorted in order to use the method. + The array is displayed, sorted, and displayed again. Arrays must be sorted in order to use the method. > [!NOTE] -> The calls to the and generic methods do not look any different from calls to their nongeneric counterparts, because Visual Basic, C#, and C++ infer the type of the generic type parameter from the type of the first argument. If you use the [Ildasm.exe (IL Disassembler)](/dotnet/framework/tools/ildasm-exe-il-disassembler) to examine the Microsoft intermediate language (MSIL), you can see that the generic methods are being called. +> The calls to the and generic methods do not look any different from calls to their nongeneric counterparts, because Visual Basic, C#, and C++ infer the type of the generic type parameter from the type of the first argument. If you use the [Ildasm.exe (IL Disassembler)](/dotnet/framework/tools/ildasm-exe-il-disassembler) to examine the Microsoft intermediate language (MSIL), you can see that the generic methods are being called. - The generic method overload is then used to search for two strings, one that is not in the array and one that is. The array and the return value of the method are passed to the `ShowWhere` generic method (the `showWhere` function in the F# example), which displays the index value if the string is found, and otherwise the elements the search string would fall between if it were in the array. The index is negative if the string is not n the array, so the `ShowWhere` method takes the bitwise complement (the ~ operator in C#, the ~~~ operator in F#, `Xor` -1 in Visual Basic) to obtain the index of the first element in the list that is larger than the search string. + The generic method overload is then used to search for two strings, one that is not in the array and one that is. The array and the return value of the method are passed to the `ShowWhere` generic method (the `showWhere` function in the F# example), which displays the index value if the string is found, and otherwise the elements the search string would fall between if it were in the array. The index is negative if the string is not n the array, so the `ShowWhere` method takes the bitwise complement (the ~ operator in C#, the ~~~ operator in F#, `Xor` -1 in Visual Basic) to obtain the index of the first element in the list that is larger than the search string. :::code language="csharp" source="~/snippets/csharp/System/Array/BinarySearchT/source1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/Array_SortSearchComparer/fs/source.fs" id="Snippet1"::: @@ -1033,14 +1033,14 @@ If the array does not contain the specified value, the method returns a negative integer. You can apply the bitwise complement operator (~ in C#, `Not` in Visual Basic) to the negative result to produce an index. If this index is equal to the size of the array, there are no elements larger than `value` in the array. Otherwise, it is the index of the first element that is larger than `value`. - `T` must implement the generic interface, which is used for comparisons. The elements of `array` must already be sorted in increasing value according to the sort order defined by the implementation; otherwise, the result might be incorrect. + `T` must implement the generic interface, which is used for comparisons. The elements of `array` must already be sorted in increasing value according to the sort order defined by the implementation; otherwise, the result might be incorrect. Duplicate elements are allowed. If the contains more than one element equal to `value`, the method returns the index of only one of the occurrences, and not necessarily the first one. `null` can always be compared with any other reference type; therefore, comparisons with `null` do not generate an exception. > [!NOTE] -> For every element tested, `value` is passed to the appropriate implementation, even if `value` is `null`. That is, the implementation determines how a given element compares to `null`. +> For every element tested, `value` is passed to the appropriate implementation, even if `value` is `null`. That is, the implementation determines how a given element compares to `null`. This method is an O(log `n`) operation, where `n` is `length`. @@ -1164,16 +1164,16 @@ The comparer customizes how the elements are compared. For example, you can use a as the comparer to perform case-insensitive string searches. - If `comparer` is not `null`, the elements of `array` are compared to the specified value using the specified generic interface implementation. The elements of `array` must already be sorted in increasing value according to the sort order defined by `comparer`; otherwise, the result might be incorrect. + If `comparer` is not `null`, the elements of `array` are compared to the specified value using the specified generic interface implementation. The elements of `array` must already be sorted in increasing value according to the sort order defined by `comparer`; otherwise, the result might be incorrect. - If `comparer` is `null`, the comparison is done using the generic interface implementation provided for type `T`. The elements of `array` must already be sorted in increasing value according to the sort order defined by the implementation; otherwise, the result might be incorrect. + If `comparer` is `null`, the comparison is done using the generic interface implementation provided for type `T`. The elements of `array` must already be sorted in increasing value according to the sort order defined by the implementation; otherwise, the result might be incorrect. Duplicate elements are allowed. If the contains more than one element equal to `value`, the method returns the index of only one of the occurrences, and not necessarily the first one. - `null` can always be compared with any other reference type; therefore, comparisons with `null` do not generate an exception when using . + `null` can always be compared with any other reference type; therefore, comparisons with `null` do not generate an exception when using . > [!NOTE] -> For every element tested, `value` is passed to the appropriate implementation, even if `value` is `null`. That is, the implementation determines how a given element compares to `null`. +> For every element tested, `value` is passed to the appropriate implementation, even if `value` is `null`. That is, the implementation determines how a given element compares to `null`. This method is an O(log `n`) operation, where `n` is `length`. @@ -1318,13 +1318,13 @@ This method is an $O(n)$ operation, where $n$ is `length`. ## Examples - The following example uses the method to reset integer values in a one-dimensional, two-dimensional, and three-dimensional array. + The following example uses the method to reset integer values in a one-dimensional, two-dimensional, and three-dimensional array. :::code language="csharp" source="~/snippets/csharp/System/Array/Clear/example.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Array.Clear/fs/example.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/Array/Clear/example.vb" id="Snippet1"::: - The following example defines a `TimeZoneTime` structure that includes a field and a field. It then calls the method to clear one element in a two-element array of `TimeZoneTime` values. The method sets the value of the cleared element to the default value of a object, which is `null`, and the default value of a object, which is . + The following example defines a `TimeZoneTime` structure that includes a field and a field. It then calls the method to clear one element in a two-element array of `TimeZoneTime` values. The method sets the value of the cleared element to the default value of a object, which is `null`, and the default value of a object, which is . :::code language="csharp" source="~/snippets/csharp/System/Array/Clear/clearstruct1.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Array.Clear/fs/clearstruct1.fs" id="Snippet2"::: @@ -1414,7 +1414,7 @@ The clone is of the same as the original . - This method is an O(`n`) operation, where `n` is . + This method is an O(`n`) operation, where `n` is . @@ -1498,7 +1498,7 @@ is thrown. Unlike , verifies the compatibility of the array types before performing any operation. + The `sourceArray` and `destinationArray` parameters must have the same number of dimensions. The `sourceArray` type must be the same as or derived from the `destinationArray` type; otherwise, an is thrown. Unlike , verifies the compatibility of the array types before performing any operation. When copying between multidimensional arrays, the array behaves like a long one-dimensional array, where the rows (or columns) are conceptually laid end-to-end. For example, if an array has three rows (or columns) with four elements each, copying six elements from the beginning of the array would copy all four elements of the first row (or column) and the first two elements of the second row (or column). To start copying from the second element of the third row (or column), `sourceIndex` must be the upper bound of the first row (or column) plus the length of the second row (or column) plus two. @@ -1510,7 +1510,7 @@ The arrays can be reference-type or value-type arrays. If `sourceArray` and `destinationArray` are both reference-type arrays or are both arrays of type , a shallow copy is performed. A shallow copy of an is a new containing references to the same elements as the original . The elements themselves or anything referenced by the elements are not copied. In contrast, a deep copy of an copies the elements and everything directly or indirectly referenced by the elements. - If this method throws an exception while copying, the `destinationArray` remains unchanged; therefore, can be used within a constrained execution region (). + If this method throws an exception while copying, the `destinationArray` remains unchanged; therefore, can be used within a constrained execution region (). This method is an $O(n)$ operation, where $n$ is `length`. @@ -1616,17 +1616,17 @@ is a delegate to a method that converts an object to the target type. The elements of `array` are individually passed to the , and the converted elements are saved in the new array. + The is a delegate to a method that converts an object to the target type. The elements of `array` are individually passed to the , and the converted elements are saved in the new array. The source `array` remains unchanged. - This method is an O(`n`) operation, where `n` is the of `array`. + This method is an O(`n`) operation, where `n` is the of `array`. In F#, the [Array.map](https://fsharp.github.io/fsharp-core-docs/reference/fsharp-collections-arraymodule.html#map) function is generally used instead. ## Examples - The following code example defines a method named `PointFToPoint` that converts a structure to a structure. The example then creates an array of structures, creates a `Converter` delegate (`Converter(Of PointF, Point)` in Visual Basic) to represent the `PointFToPoint` method, and passes the delegate to the method. The method passes each element of the input list to the `PointFToPoint` method and puts the converted elements into a new list of structures. In the F# example, the `pointFToPoint` function is implicitly casted to the `Converter` delegate. Both lists are displayed. + The following code example defines a method named `PointFToPoint` that converts a structure to a structure. The example then creates an array of structures, creates a `Converter` delegate (`Converter(Of PointF, Point)` in Visual Basic) to represent the `PointFToPoint` method, and passes the delegate to the method. The method passes each element of the input list to the `PointFToPoint` method and puts the converted elements into a new list of structures. In the F# example, the `pointFToPoint` function is implicitly casted to the `Converter` delegate. Both lists are displayed. :::code language="csharp" source="~/snippets/csharp/System/Array/ConvertAllTInput,TOutput/source.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/Array_ConvertAll/fs/source.fs" id="Snippet1"::: @@ -2266,11 +2266,11 @@ ## Remarks This method copies all the elements of the current array instance to the `array` destination array, starting at index `index`. The `array` destination array must already have been dimensioned and must have a sufficient number of elements to accommodate the copied elements. Otherwise, the method throws an exception. - This method supports the interface. If implementing is not explicitly required, use to avoid an extra indirection. + This method supports the interface. If implementing is not explicitly required, use to avoid an extra indirection. If this method throws an exception while copying, the state of `array` is undefined. - This method is an O(`n`) operation, where `n` is . It performs a shallow copy only. + This method is an O(`n`) operation, where `n` is . It performs a shallow copy only. ]]> @@ -2352,11 +2352,11 @@ ## Remarks This method copies all the elements of the current array instance to the `array` destination array, starting at index `index`. The `array` destination array must already have been dimensioned and must have a sufficient number of elements to accommodate the copied elements. Otherwise, the method throws an exception. - This method supports the interface. If implementing is not explicitly required, use to avoid an extra indirection. + This method supports the interface. If implementing is not explicitly required, use to avoid an extra indirection. If this method throws an exception while copying, the state of `array` is undefined. - This method is an O(`n`) operation, where `n` is . It performs a shallow copy only. + This method is an O(`n`) operation, where `n` is . It performs a shallow copy only. ]]> @@ -2449,7 +2449,7 @@ provides the method, instead of public constructors, to allow for late bound access. + Unlike most classes, provides the method, instead of public constructors, to allow for late bound access. Reference-type elements are initialized to `null`. Value-type elements are initialized to zero. @@ -2550,7 +2550,7 @@ provides the method, instead of public constructors, to allow for late bound access. + Unlike most classes, provides the method, instead of public constructors, to allow for late bound access. The number of elements in the `lengths` array must equal the number of dimensions in the new . Each element of the `lengths` array must specify the length of the corresponding dimension in the new . @@ -2652,7 +2652,7 @@ provides the method, instead of public constructors, to allow for late bound access. + Unlike most classes, provides the method, instead of public constructors, to allow for late bound access. The number of elements in the `lengths` array must equal the number of dimensions in the new . Each element of the `lengths` array must specify the length of the corresponding dimension in the new . @@ -2749,7 +2749,7 @@ provides the method, instead of public constructors, to allow for late bound access. + Unlike most classes, provides the method, instead of public constructors, to allow for late bound access. Reference-type elements are initialized to `null`. Value-type elements are initialized to zero. @@ -2849,7 +2849,7 @@ provides the method, instead of public constructors, to allow for late bound access. + Unlike most classes, provides the method, instead of public constructors, to allow for late bound access. The `lengths` and `lowerBounds` arrays must have the same number of elements. The number of elements in the `lengths` array must equal the number of dimensions in the new . @@ -2965,7 +2965,7 @@ provides the method, instead of public constructors, to allow for late bound access. + Unlike most classes, provides the method, instead of public constructors, to allow for late bound access. Reference-type elements are initialized to `null`. Value-type elements are initialized to zero. @@ -3293,23 +3293,23 @@ is a delegate to a method that returns `true` if the object passed to it matches the conditions defined in the delegate. The elements of `array` are individually passed to the , and processing is stopped when a match is found. + The is a delegate to a method that returns `true` if the object passed to it matches the conditions defined in the delegate. The elements of `array` are individually passed to the , and processing is stopped when a match is found. > [!NOTE] -> In C# and Visual Basic, it is not necessary to create the delegate explicitly. These languages infer the correct delegate from context and create it automatically. In F#, functions and lambda expressions are implicitly converted. +> In C# and Visual Basic, it is not necessary to create the delegate explicitly. These languages infer the correct delegate from context and create it automatically. In F#, functions and lambda expressions are implicitly converted. - This method is an O(`n`) operation, where `n` is the of `array`. + This method is an O(`n`) operation, where `n` is the of `array`. ## Examples - The following example specifies the match conditions for the method using lambda expressions to check whether a planet starts with a given letter or whether the planet is found on the given array. + The following example specifies the match conditions for the method using lambda expressions to check whether a planet starts with a given letter or whether the planet is found on the given array. :::code language="csharp" source="~/snippets/csharp/System/Array/ExistsT/exists3.cs" id="Snippet3"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.array.exists/fs/exists3.fs" id="Snippet3"::: :::code language="vb" source="~/snippets/visualbasic/System/Array/ExistsT/exists3.vb" id="Snippet3"::: - The following example uses the method to indicate whether any names in a string array begin with a specified character. The example instantiates a `StringSearcher` object by passing the string to search for to its class constructor. The `StringSearcher.StartsWith` method has same signature as the delegate. When the method is called, each member of the array is passed to the delegate until it returns `true` or iterates all the elements in the array. + The following example uses the method to indicate whether any names in a string array begin with a specified character. The example instantiates a `StringSearcher` object by passing the string to search for to its class constructor. The `StringSearcher.StartsWith` method has same signature as the delegate. When the method is called, each member of the array is passed to the delegate until it returns `true` or iterates all the elements in the array. :::code language="csharp" source="~/snippets/csharp/System/Array/ExistsT/exists1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.array.exists/fs/exists1.fs" id="Snippet1"::: @@ -3516,14 +3516,14 @@ is a delegate to a method or a lambda expression that returns `true` if the object passed to it matches the conditions defined in the delegate or lambda expression. The elements of `array` are individually passed to the , starting with the first element and ending with the last element. Processing is stopped when a match is found. + The is a delegate to a method or a lambda expression that returns `true` if the object passed to it matches the conditions defined in the delegate or lambda expression. The elements of `array` are individually passed to the , starting with the first element and ending with the last element. Processing is stopped when a match is found. - This method is an O(`n`) operation, where `n` is the of `array`. + This method is an O(`n`) operation, where `n` is the of `array`. In F#, the [Array.find](https://fsharp.github.io/fsharp-core-docs/reference/fsharp-collections-arraymodule.html#find) function can be used instead. ## Examples - The following example uses a delegate with the generic method to search an array of structures. The method the delegate represents, `ProductGT10`, returns `true` if the product of the X and Y fields is greater than 100,000. The method calls the delegate for each element of the array, returning the first point that meets the test condition. + The following example uses a delegate with the generic method to search an array of structures. The method the delegate represents, `ProductGT10`, returns `true` if the product of the X and Y fields is greater than 100,000. The method calls the delegate for each element of the array, returning the first point that meets the test condition. > [!NOTE] > Visual Basic, C#, and F# users do not have to create the delegate explicitly or specify the type argument of the generic method. The compilers determine the necessary types from the method arguments you supply. @@ -3532,7 +3532,7 @@ :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.array.find/fs/source.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/Array/FindT/source.vb" id="Snippet1"::: - Rather than explicitly defining a method with the necessary signature, instantiating a delegate, and passing the delegate to the method, it is customary to use a lambda expression. The following example is identical to the previous one, except that it uses a lambda expression as the `match` argument. + Rather than explicitly defining a method with the necessary signature, instantiating a delegate, and passing the delegate to the method, it is customary to use a lambda expression. The following example is identical to the previous one, except that it uses a lambda expression as the `match` argument. :::code language="csharp" source="~/snippets/csharp/System/Array/FindT/lambda.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.array.find/fs/lambda.fs" id="Snippet2"::: @@ -3618,31 +3618,31 @@ is a delegate to a method that returns `true` if the object passed to it matches the conditions defined in the delegate. The elements of `array` are individually passed to the , and the elements that match the conditions are saved in the returned array. + The is a delegate to a method that returns `true` if the object passed to it matches the conditions defined in the delegate. The elements of `array` are individually passed to the , and the elements that match the conditions are saved in the returned array. - This method is an O(`n`) operation, where `n` is the of `array`. + This method is an O(`n`) operation, where `n` is the of `array`. In F#, the [Array.filter](https://fsharp.github.io/fsharp-core-docs/reference/fsharp-collections-arraymodule.html#filter) function may be used instead. ## Examples - The following example creates an array of 50 random numbers with values that can range from 0 to 1,000. It then calls the method with a lambda expression that returns the values that range from 300 to 600. Note that the lambda expression is passed a parameter named `x`; this represents the individual array member that is passed to the . Also note that the local `lBound` and `uBound` variables are accessible within the lambda expression. + The following example creates an array of 50 random numbers with values that can range from 0 to 1,000. It then calls the method with a lambda expression that returns the values that range from 300 to 600. Note that the lambda expression is passed a parameter named `x`; this represents the individual array member that is passed to the . Also note that the local `lBound` and `uBound` variables are accessible within the lambda expression. :::code language="csharp" source="~/snippets/csharp/System/Array/FindAllT/findall.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.array.findall/fs/findall.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/Array/FindAllT/findall.vb" id="Snippet1"::: - The following code example demonstrates the , , and generic methods. An array of strings is created, containing 8 dinosaur names, two of which (at positions 1 and 5) end with "saurus". The code example also defines a search predicate method named `EndsWithSaurus`, which accepts a string parameter and returns a Boolean value indicating whether the input string ends in "saurus". + The following code example demonstrates the , , and generic methods. An array of strings is created, containing 8 dinosaur names, two of which (at positions 1 and 5) end with "saurus". The code example also defines a search predicate method named `EndsWithSaurus`, which accepts a string parameter and returns a Boolean value indicating whether the input string ends in "saurus". - The generic method traverses the array from the beginning, passing each element in turn to the `EndsWithSaurus` method. The search stops when the `EndsWithSaurus` method returns `true` for the element "Amargasaurus". + The generic method traverses the array from the beginning, passing each element in turn to the `EndsWithSaurus` method. The search stops when the `EndsWithSaurus` method returns `true` for the element "Amargasaurus". > [!NOTE] > In C#, F#, and Visual Basic, it is not necessary to create the `Predicate` delegate (`Predicate(Of String)` in Visual Basic) explicitly. These languages infer the correct delegate from context and create it automatically. - The generic method is used to search the array backward from the end. It finds the element "Dilophosaurus" at position 5. The generic method is used to return an array containing all the elements that end in "saurus". The elements are displayed. + The generic method is used to search the array backward from the end. It finds the element "Dilophosaurus" at position 5. The generic method is used to return an array containing all the elements that end in "saurus". The elements are displayed. - The code example also demonstrates the and generic methods. + The code example also demonstrates the and generic methods. :::code language="csharp" source="~/snippets/csharp/System/Array/FindAllT/source.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/Array_FindEtAl/fs/source.fs" id="Snippet1"::: @@ -3680,14 +3680,14 @@ generic method. An array of strings is created, containing 8 dinosaur names, two of which (at positions 1 and 5) end with "saurus". The code example also defines a search predicate method named `EndsWithSaurus`, which accepts a string parameter and returns a Boolean value indicating whether the input string ends in "saurus". + The following code example demonstrates all three overloads of the generic method. An array of strings is created, containing 8 dinosaur names, two of which (at positions 1 and 5) end with "saurus". The code example also defines a search predicate method named `EndsWithSaurus`, which accepts a string parameter and returns a Boolean value indicating whether the input string ends in "saurus". - The method overload traverses the array from the beginning, passing each element in turn to the `EndsWithSaurus` method. The search stops when the `EndsWithSaurus` method returns `true` for the element at position 1. + The method overload traverses the array from the beginning, passing each element in turn to the `EndsWithSaurus` method. The search stops when the `EndsWithSaurus` method returns `true` for the element at position 1. > [!NOTE] > In C#, F#, and Visual Basic, it is not necessary to create the `Predicate` delegate (`Predicate(Of String)` in Visual Basic) explicitly. These languages infer the correct delegate from context and create it automatically. - The method overload is used to search the array beginning at position 2 and continuing to the end of the array. It finds the element at position 5. Finally, the method overload is used to search the range of three elements beginning at position 2. It returns -1 because there are no dinosaur names in that range that end with "saurus". + The method overload is used to search the array beginning at position 2 and continuing to the end of the array. It finds the element at position 5. Finally, the method overload is used to search the range of three elements beginning at position 2. It returns -1 because there are no dinosaur names in that range that end with "saurus". :::code language="csharp" source="~/snippets/csharp/System/Array/FindIndexT/source.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/Array_FindIndex/fs/source.fs" id="Snippet1"::: @@ -3762,9 +3762,9 @@ ## Remarks The is searched forward starting at the first element and ending at the last element. - The is a delegate to a method that returns `true` if the object passed to it matches the conditions defined in the delegate. The elements of `array` are individually passed to the . + The is a delegate to a method that returns `true` if the object passed to it matches the conditions defined in the delegate. The elements of `array` are individually passed to the . - This method is an O(`n`) operation, where `n` is the of `array`. + This method is an O(`n`) operation, where `n` is the of `array`. ]]> @@ -3851,7 +3851,7 @@ ## Remarks The is searched forward starting at `startIndex` and ending at the last element. - The is a delegate to a method that returns `true` if the object passed to it matches the conditions defined in the delegate. The elements of `array` are individually passed to the . + The is a delegate to a method that returns `true` if the object passed to it matches the conditions defined in the delegate. The elements of `array` are individually passed to the . This method is an O(`n`) operation, where `n` is the number of elements from `startIndex` to the end of `array`. @@ -3944,7 +3944,7 @@ ## Remarks The is searched forward starting at `startIndex` and ending at `startIndex` plus `count` minus 1, if `count` is greater than 0. - The is a delegate to a method that returns `true` if the object passed to it matches the conditions defined in the delegate. The elements of `array` are individually passed to the . + The is a delegate to a method that returns `true` if the object passed to it matches the conditions defined in the delegate. The elements of `array` are individually passed to the . This method is an O(`n`) operation, where `n` is `count`. @@ -4040,23 +4040,23 @@ is a delegate to a method that returns `true` if the object passed to it matches the conditions defined in the delegate. The elements of `array` are individually passed to the , moving backward in the , starting with the last element and ending with the first element. Processing is stopped when a match is found. + The is a delegate to a method that returns `true` if the object passed to it matches the conditions defined in the delegate. The elements of `array` are individually passed to the , moving backward in the , starting with the last element and ending with the first element. Processing is stopped when a match is found. - This method is an O(`n`) operation, where `n` is the of `array`. + This method is an O(`n`) operation, where `n` is the of `array`. ## Examples - The following code example demonstrates the , , and generic methods. An array of strings is created, containing 8 dinosaur names, two of which (at positions 1 and 5) end with "saurus". The code example also defines a search predicate method named `EndsWithSaurus`, which accepts a string parameter and returns a Boolean value indicating whether the input string ends in "saurus". + The following code example demonstrates the , , and generic methods. An array of strings is created, containing 8 dinosaur names, two of which (at positions 1 and 5) end with "saurus". The code example also defines a search predicate method named `EndsWithSaurus`, which accepts a string parameter and returns a Boolean value indicating whether the input string ends in "saurus". - The generic method traverses the array from the beginning, passing each element in turn to the `EndsWithSaurus` method. The search stops when the `EndsWithSaurus` method returns `true` for the element "Amargasaurus". + The generic method traverses the array from the beginning, passing each element in turn to the `EndsWithSaurus` method. The search stops when the `EndsWithSaurus` method returns `true` for the element "Amargasaurus". > [!NOTE] > In C# and Visual Basic, it is not necessary to create the`Predicate` delegate (`Predicate(Of String)` in Visual Basic) explicitly. These languages infer the correct delegate from context and create it automatically. - The generic method is used to search the array backward from the end. It finds the element "Dilophosaurus" at position 5. The generic method is used to return an array containing all the elements that end in "saurus". The elements are displayed. + The generic method is used to search the array backward from the end. It finds the element "Dilophosaurus" at position 5. The generic method is used to return an array containing all the elements that end in "saurus". The elements are displayed. - The code example also demonstrates the and generic methods. + The code example also demonstrates the and generic methods. :::code language="csharp" source="~/snippets/csharp/System/Array/FindAllT/source.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/Array_FindEtAl/fs/source.fs" id="Snippet1"::: @@ -4094,14 +4094,14 @@ generic method. An array of strings is created, containing 8 dinosaur names, two of which (at positions 1 and 5) end with "saurus". The code example also defines a search predicate method named `EndsWithSaurus`, which accepts a string parameter and returns a Boolean value indicating whether the input string ends in "saurus". + The following code example demonstrates all three overloads of the generic method. An array of strings is created, containing 8 dinosaur names, two of which (at positions 1 and 5) end with "saurus". The code example also defines a search predicate method named `EndsWithSaurus`, which accepts a string parameter and returns a Boolean value indicating whether the input string ends in "saurus". - The method overload traverses the array backward from the end, passing each element in turn to the `EndsWithSaurus` method. The search stops when the `EndsWithSaurus` method returns `true` for the element at position 5. + The method overload traverses the array backward from the end, passing each element in turn to the `EndsWithSaurus` method. The search stops when the `EndsWithSaurus` method returns `true` for the element at position 5. > [!NOTE] > In C#, F# and Visual Basic, it is not necessary to create the `Predicate` delegate (`Predicate(Of String)` in Visual Basic) explicitly. These languages infer the correct delegate from context and create it automatically. - The method overload is used to search the array beginning at position 4 and continuing backward to the beginning of the array. It finds the element at position 1. Finally, the method overload is used to search the range of three elements beginning at position 4 and working backward (that is, elements 4, 3, and 2). It returns -1 because there are no dinosaur names in that range that end with "saurus". + The method overload is used to search the array beginning at position 4 and continuing backward to the beginning of the array. It finds the element at position 1. Finally, the method overload is used to search the range of three elements beginning at position 4 and working backward (that is, elements 4, 3, and 2). It returns -1 because there are no dinosaur names in that range that end with "saurus". :::code language="csharp" source="~/snippets/csharp/System/Array/FindLastIndexT/source.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/Array_FindLastIndex/fs/source.fs" id="Snippet1"::: @@ -4176,9 +4176,9 @@ ## Remarks The is searched backward starting at the last element and ending at the first element. - The is a delegate to a method that returns `true` if the object passed to it matches the conditions defined in the delegate. The elements of `array` are individually passed to the . + The is a delegate to a method that returns `true` if the object passed to it matches the conditions defined in the delegate. The elements of `array` are individually passed to the . - This method is an O(`n`) operation, where `n` is the of `array`. + This method is an O(`n`) operation, where `n` is the of `array`. ]]> @@ -4265,7 +4265,7 @@ ## Remarks The is searched backward starting at `startIndex` and ending at the first element. - The is a delegate to a method that returns `true` if the object passed to it matches the conditions defined in the delegate. The elements of `array` are individually passed to the . + The is a delegate to a method that returns `true` if the object passed to it matches the conditions defined in the delegate. The elements of `array` are individually passed to the . This method is an O(`n`) operation, where `n` is the number of elements from the beginning of `array` to `startIndex`. @@ -4358,7 +4358,7 @@ ## Remarks The is searched backward starting at `startIndex` and ending at `startIndex` minus `count` plus 1, if `count` is greater than 0. - The is a delegate to a method that returns `true` if the object passed to it matches the conditions defined in the delegate. The elements of `array` are individually passed to the . + The is a delegate to a method that returns `true` if the object passed to it matches the conditions defined in the delegate. The elements of `array` are individually passed to the . This method is an O(`n`) operation, where `n` is `count`. @@ -4448,14 +4448,14 @@ is a delegate to a method that performs an action on the object passed to it. The elements of `array` are individually passed to the . + The is a delegate to a method that performs an action on the object passed to it. The elements of `array` are individually passed to the . - This method is an O(`n`) operation, where `n` is the of `array`. + This method is an O(`n`) operation, where `n` is the of `array`. In F#, the [Array.iter](https://fsharp.github.io/fsharp-core-docs/reference/fsharp-collections-arraymodule.html#iter) function can be used instead. ## Examples - The following example shows how to use to display the squares of each element in an integer array. + The following example shows how to use to display the squares of each element in an integer array. :::code language="csharp" source="~/snippets/csharp/System/Array/ForEachT/source.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.array.foreach/fs/source.fs" id="Snippet1"::: @@ -4530,11 +4530,11 @@ Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection. - Initially, the enumerator is positioned before the first element in the collection. also brings the enumerator back to this position. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . + Initially, the enumerator is positioned before the first element in the collection. also brings the enumerator back to this position. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of . - returns the same object until either or is called. sets to the next element. + returns the same object until either or is called. sets to the next element. - If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. To set to the first element of the collection again, you can call followed by . + If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns `false`. When the enumerator is at this position, subsequent calls to also return `false`. If the last call to returned `false`, is undefined. To set to the first element of the collection again, you can call followed by . An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and its behavior is undefined. @@ -4545,7 +4545,7 @@ ## Examples - The following code example shows how to use to list the elements of an array. + The following code example shows how to use to list the elements of an array. :::code language="csharp" source="~/snippets/csharp/System/Array/GetEnumerator/array_getenumerator.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Array_GetEnumerator/FS/array_getenumerator.fs" id="Snippet1"::: @@ -4612,14 +4612,14 @@ is `GetLength(0)`, which returns the number of elements in the first dimension of the . + An example of is `GetLength(0)`, which returns the number of elements in the first dimension of the . This method is an O(1) operation. ## Examples - The following example shows how to use to display the dimensions of two arrays with different ranks. + The following example shows how to use to display the dimensions of two arrays with different ranks. :::code language="csharp" source="~/snippets/csharp/System/Array/GetLength/source.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.array.getlength/fs/source.fs" id="Snippet1"::: @@ -4692,7 +4692,7 @@ is `GetLongLength(0)`, which returns the number of elements in the first dimension of the . + An example of is `GetLongLength(0)`, which returns the number of elements in the first dimension of the . This method is an O(1) operation. @@ -4773,14 +4773,14 @@ ## Remarks `GetLowerBound(0)` returns the starting index of the first dimension of the array, and `GetLowerBound(Rank - 1)` returns the starting index of the last dimension of the array. - The method always returns a value that indicates the index of the lower bound of the array, even if the array is empty. + The method always returns a value that indicates the index of the lower bound of the array, even if the array is empty. - Note that, although most arrays in .NET are zero-based (that is, the method returns zero for each dimension of an array), .NET does support arrays that are not zero-based. Such arrays can be created with the method, and can also be returned from unmanaged code. + Note that, although most arrays in .NET are zero-based (that is, the method returns zero for each dimension of an array), .NET does support arrays that are not zero-based. Such arrays can be created with the method, and can also be returned from unmanaged code. This method is an O(1) operation. ## Examples - The following example uses the and methods to display the bounds of a one-dimensional and two-dimensional array and to display the values of their array elements. + The following example uses the and methods to display the bounds of a one-dimensional and two-dimensional array and to display the values of their array elements. :::code language="csharp" source="~/snippets/csharp/System/Array/GetLowerBound/source.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.array.getupperbound/fs/source.fs" id="Snippet1"::: @@ -4866,7 +4866,7 @@ ## Examples - The following example uses the and methods to display the bounds of a one-dimensional and two-dimensional array and to display the values of their array elements. + The following example uses the and methods to display the bounds of a one-dimensional and two-dimensional array and to display the values of their array elements. :::code language="csharp" source="~/snippets/csharp/System/Array/GetLowerBound/source.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.array.getupperbound/fs/source.fs" id="Snippet1"::: @@ -4963,7 +4963,7 @@ and methods can determine whether the value of `index` is out of bounds. + The and methods can determine whether the value of `index` is out of bounds. This method is an O(1) operation. @@ -5044,7 +5044,7 @@ ## Remarks The number of elements in `indices` must equal the number of dimensions in the . All elements in the `indices` array must collectively specify the position of the desired element in the multidimensional . - The and methods can determine whether any of the indexes is out of bounds. + The and methods can determine whether any of the indexes is out of bounds. This method is an O(1) operation. @@ -5113,7 +5113,7 @@ and methods can determine whether the value of `index` is out of bounds. + The and methods can determine whether the value of `index` is out of bounds. This method is an O(1) operation. @@ -5196,7 +5196,7 @@ ## Remarks The number of elements in `indices` must equal the number of dimensions in the . All elements in the `indices` array must collectively specify the position of the desired element in the multidimensional . - The and methods can determine whether any of the indexes is out of bounds. + The and methods can determine whether any of the indexes is out of bounds. This method is an O(1) operation. @@ -5267,7 +5267,7 @@ and methods can determine whether any of the indexes is out of bounds. + The and methods can determine whether any of the indexes is out of bounds. This method is an O(1) operation. @@ -5336,7 +5336,7 @@ and methods can determine whether any of the indexes is out of bounds. + The and methods can determine whether any of the indexes is out of bounds. This method is an O(1) operation. @@ -5407,7 +5407,7 @@ and methods can determine whether any of the indexes is out of bounds. + The and methods can determine whether any of the indexes is out of bounds. This method is an O(1) operation. @@ -5479,7 +5479,7 @@ and methods can determine whether any of the indexes is out of bounds. + The and methods can determine whether any of the indexes is out of bounds. This method is an O(1) operation. @@ -5574,16 +5574,16 @@ . + This method searches all the elements of a one-dimensional array for `value`. To determine whether `value` exists in `array`, the method performs an equality comparison by using the default equality comparer . Because most arrays have a lower bound of zero, this method generally returns -1 if`value` isn't found. In the rare case that the lower bound of the array is equal to (0x80000000) and `value` isn't found, this method returns (0x7FFFFFFF). - This method is an O(`n`) operation, where `n` is the of `array`. + This method is an O(`n`) operation, where `n` is the of `array`. ## Examples - The example calls the following three overloads of the method to find the index of a string in a string array: + The example calls the following three overloads of the method to find the index of a string in a string array: - , to determine the first occurrence of the string "the" in a string array. @@ -5673,18 +5673,18 @@ . + This method searches a one-dimensional array from the element at index `startIndex` to the last element. To determine whether `value` exists in `array`, the method performs an equality comparison by using the default equality comparer . Because most arrays have a lower bound of zero, this method generally returns -1 if `value` isn't found. In the rare case that the lower bound of the array is equal to (0x80000000) and `value` isn't found, this method returns (0x7FFFFFFF). - If `startIndex` equals ,the method returns -1. If `startIndex` is greater than , the method throws an . + If `startIndex` equals ,the method returns -1. If `startIndex` is greater than , the method throws an . This method is an O(`n`) operation, where `n` is the number of elements from `startIndex` to the end of `array`. ## Examples - The example calls the following three overloads of the method to find the index of a string in a string array: + The example calls the following three overloads of the method to find the index of a string in a string array: - , to determine the first occurrence of the string "the" in a string array. @@ -5783,18 +5783,18 @@ . + This method searches the elements of a one-dimensional array from `startIndex` to `startIndex` plus `count` minus 1, if `count` is greater than 0. To determine whether `value` exists in `array`, the method performs an equality comparison by using the default equality comparer . Because most arrays have a lower bound of zero, this method generally returns -1 when `value` isn't found. In the rare case that the lower bound of the array is equal to (0x80000000) and `value` isn't found, this method returns (0x7FFFFFFF). - If `startindex` equals , the method returns -1. If `startIndex` is greater than , the method throws an . + If `startindex` equals , the method returns -1. If `startIndex` is greater than , the method throws an . This method is an O(`n`) operation, where `n` is `count`. ## Examples - The example calls the following three overloads of the method to find the index of a string in a string array: + The example calls the following three overloads of the method to find the index of a string in a string array: - , to determine the first occurrence of the string "the" in a string array. @@ -5889,14 +5889,14 @@ . + This method searches all the elements of a one-dimensional array for `value`. To determine whether `value` exists in `array`, the method performs an equality comparison by using the default equality comparer . - This method is an O(`n`) operation, where `n` is the of `array`. + This method is an O(`n`) operation, where `n` is the of `array`. ## Examples - The following example demonstrates all three generic overloads of the method. An array of strings is created, with one entry that appears twice, at index location 0 and index location 5. The method overload searches the array from the beginning, and finds the first occurrence of the string. The method overload is used to search the array beginning with index location 3 and continuing to the end of the array, and finds the second occurrence of the string. Finally, the method overload is used to search a range of two entries, beginning at index location two; it returns -1 because there are no instances of the search string in that range. + The following example demonstrates all three generic overloads of the method. An array of strings is created, with one entry that appears twice, at index location 0 and index location 5. The method overload searches the array from the beginning, and finds the first occurrence of the string. The method overload is used to search the array beginning with index location 3 and continuing to the end of the array, and finds the second occurrence of the string. Finally, the method overload is used to search a range of two entries, beginning at index location two; it returns -1 because there are no instances of the search string in that range. :::code language="csharp" source="~/snippets/csharp/System/Array/IndexOfT/source.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/Array_IndexOf/fs/source.fs" id="Snippet1"::: @@ -5975,16 +5975,16 @@ . + This method searches a one-dimensional array from the element at `startIndex` to the end of the array. To determine whether `value` exists in `array`, the method performs an equality comparison by using the default equality comparer . - If `startIndex` equals ,the method returns -1. If `startIndex` is greater than , the method throws an . + If `startIndex` equals ,the method returns -1. If `startIndex` is greater than , the method throws an . This method is an O(`n`) operation, where `n` is the number of elements from `startIndex` to the end of `array`. ## Examples - The following example demonstrates all three generic overloads of the method. An array of strings is created, with one entry that appears twice, at index location 0 and index location 5. The method overload searches the array from the beginning, and finds the first occurrence of the string. The method overload is used to search the array beginning with index location 3 and continuing to the end of the array, and finds the second occurrence of the string. Finally, the method overload is used to search a range of two entries, beginning at index location two; it returns -1 because there are no instances of the search string in that range. + The following example demonstrates all three generic overloads of the method. An array of strings is created, with one entry that appears twice, at index location 0 and index location 5. The method overload searches the array from the beginning, and finds the first occurrence of the string. The method overload is used to search the array beginning with index location 3 and continuing to the end of the array, and finds the second occurrence of the string. Finally, the method overload is used to search a range of two entries, beginning at index location two; it returns -1 because there are no instances of the search string in that range. :::code language="csharp" source="~/snippets/csharp/System/Array/IndexOfT/source.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/Array_IndexOf/fs/source.fs" id="Snippet1"::: @@ -6067,16 +6067,16 @@ . + This method searches the elements of a one-dimensional array from `startIndex` to `startIndex` plus `count` minus 1, if `count` is greater than 0. To determine whether `value` exists in `array`, the method performs an equality comparison by using the default equality comparer . - If `startIndex` equals , the method returns -1. If `startIndex` is greater than , the method throws an . + If `startIndex` equals , the method returns -1. If `startIndex` is greater than , the method throws an . This method is an O(`n`) operation, where `n` is `count`. ## Examples - The following example demonstrates all three generic overloads of the method. An array of strings is created, with one entry that appears twice, at index location 0 and index location 5. The method overload searches the array from the beginning, and finds the first occurrence of the string. The method overload is used to search the array beginning with index location 3 and continuing to the end of the array, and finds the second occurrence of the string. Finally, the method overload is used to search a range of two entries, beginning at index location two; it returns -1 because there are no instances of the search string in that range. + The following example demonstrates all three generic overloads of the method. An array of strings is created, with one entry that appears twice, at index location 0 and index location 5. The method overload searches the array from the beginning, and finds the first occurrence of the string. The method overload is used to search the array beginning with index location 3 and continuing to the end of the array, and finds the second occurrence of the string. Finally, the method overload is used to search a range of two entries, beginning at index location two; it returns -1 because there are no instances of the search string in that range. :::code language="csharp" source="~/snippets/csharp/System/Array/IndexOfT/source.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/Array_IndexOf/fs/source.fs" id="Snippet1"::: @@ -6159,7 +6159,7 @@ The value-type can have any lower bound and any number of dimensions. - This method is an O(`n`) operation, where `n` is . + This method is an O(`n`) operation, where `n` is . ]]> @@ -6278,7 +6278,7 @@ If you require a read-only collection, use a class that implements the interface. - If you cast or convert an array to an interface object, the property returns `false`. However, if you cast or convert an array to a interface, the `IsReadOnly` property returns `true`. + If you cast or convert an array to an interface object, the property returns `false`. However, if you cast or convert an array to a interface, the `IsReadOnly` property returns `true`. Retrieving the value of this property is an O(1) operation. @@ -6343,7 +6343,7 @@ .NET classes based on provide their own synchronized version of the collection using the property. - Classes that use arrays can also implement their own synchronization using the property. The synchronizing code must perform operations on the `SyncRoot` of the collection, not directly on the collection. This ensures proper operation of collections that are derived from other objects. Specifically, it maintains proper synchronization with other threads that might be simultaneously modifying the collection. Note that some implementations of might return the itself. + Classes that use arrays can also implement their own synchronization using the property. The synchronizing code must perform operations on the `SyncRoot` of the collection, not directly on the collection. This ensures proper operation of collections that are derived from other objects. Specifically, it maintains proper synchronization with other threads that might be simultaneously modifying the collection. Note that some implementations of might return the itself. Enumerating through a collection is intrinsically not a thread safe procedure. Even when a collection is synchronized, other threads can still modify the collection, which causes the enumerator to throw an exception. To guarantee thread safety during enumeration, you can either lock the collection during the entire enumeration or catch the exceptions resulting from changes made by other threads. @@ -6447,15 +6447,15 @@ ## Remarks The one-dimensional is searched backward starting at the last element and ending at the first element. - The elements are compared to the specified value using the method. If the element type is a nonintrinsic (user-defined) type, the `Equals` implementation of that type is used. + The elements are compared to the specified value using the method. If the element type is a nonintrinsic (user-defined) type, the `Equals` implementation of that type is used. Since most arrays will have a lower bound of zero, this method would generally return -1 when `value` is not found. In the rare case that the lower bound of the array is equal to and `value` is not found, this method returns , which is `System.Int32.MinValue - 1`. - This method is an O(`n`) operation, where `n` is the of `array`. + This method is an O(`n`) operation, where `n` is the of `array`. - This method uses the and methods of the to determine whether the specified by the `value` parameter exists. + This method uses the and methods of the to determine whether the specified by the `value` parameter exists. - methods of the `item` parameter on the objects in the collection. + methods of the `item` parameter on the objects in the collection. ## Examples The following code example shows how to determine the index of the last occurrence of a specified element in an array. @@ -6545,13 +6545,13 @@ ## Remarks The one-dimensional is searched backward starting at `startIndex` and ending at the first element. - The elements are compared to the specified value using the method. If the element type is a nonintrinsic (user-defined) type, the `Equals` implementation of that type is used. + The elements are compared to the specified value using the method. If the element type is a nonintrinsic (user-defined) type, the `Equals` implementation of that type is used. Since most arrays will have a lower bound of zero, this method would generally return -1 when `value` is not found. In the rare case that the lower bound of the array is equal to and `value` is not found, this method returns , which is `System.Int32.MinValue - 1`. This method is an O(`n`) operation, where `n` is the number of elements from the beginning of `array` to `startIndex`. - This method uses the and methods of the to determine whether the specified by the `value` parameter exists. + This method uses the and methods of the to determine whether the specified by the `value` parameter exists. ## Examples The following code example shows how to determine the index of the last occurrence of a specified element in an array. @@ -6649,16 +6649,16 @@ ## Remarks The one-dimensional is searched backward starting at `startIndex` and ending at `startIndex` minus `count` plus 1, if `count` is greater than 0. - The elements are compared to the specified value using the method. If the element type is a nonintrinsic (user-defined) type, the`Equals` implementation of that type is used. + The elements are compared to the specified value using the method. If the element type is a nonintrinsic (user-defined) type, the`Equals` implementation of that type is used. Since most arrays will have a lower bound of zero, this method would generally return -1 when `value` is not found. In the rare case that the lower bound of the array is equal to and `value` is not found, this method returns , which is `System.Int32.MinValue - 1`. This method is an O(`n`) operation, where `n` is `count`. - This method uses the and methods of the to determine whether the specified by the `value` parameter exists. + This method uses the and methods of the to determine whether the specified by the `value` parameter exists. ## Examples - The following code example shows how to determine the index of the last occurrence of a specified element in an array. Note that the method is a backward search; therefore, `count` must be less than or equal to (`startIndex` minus the lower bound of the array plus 1). + The following code example shows how to determine the index of the last occurrence of a specified element in an array. Note that the method is a backward search; therefore, `count` must be less than or equal to (`startIndex` minus the lower bound of the array plus 1). :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_Classic/classic Array.LastIndexOf Example/FS/source.fs" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System/Array/LastIndexOf/source.cs" id="Snippet1"::: @@ -6749,14 +6749,14 @@ ## Remarks The is searched backward starting at the last element and ending at the first element. - The elements are compared to the specified value using the method. If the element type is a nonintrinsic (user-defined) type, the `Equals` implementation of that type is used. + The elements are compared to the specified value using the method. If the element type is a nonintrinsic (user-defined) type, the `Equals` implementation of that type is used. - This method is an O(`n`) operation, where `n` is the of `array`. + This method is an O(`n`) operation, where `n` is the of `array`. ## Examples - The following code example demonstrates all three generic overloads of the method. An array of strings is created, with one entry that appears twice, at index location 0 and index location 5. The method overload searches the entire array from the end, and finds the second occurrence of the string. The method overload is used to search the array backward beginning with index location 3 and continuing to the beginning of the array, and finds the first occurrence of the string. Finally, the method overload is used to search a range of four entries, beginning at index location 4 and extending backward (that is, it searches the items at locations 4, 3, 2, and 1); this search returns -1 because there are no instances of the search string in that range. + The following code example demonstrates all three generic overloads of the method. An array of strings is created, with one entry that appears twice, at index location 0 and index location 5. The method overload searches the entire array from the end, and finds the second occurrence of the string. The method overload is used to search the array backward beginning with index location 3 and continuing to the beginning of the array, and finds the first occurrence of the string. Finally, the method overload is used to search a range of four entries, beginning at index location 4 and extending backward (that is, it searches the items at locations 4, 3, 2, and 1); this search returns -1 because there are no instances of the search string in that range. :::code language="csharp" source="~/snippets/csharp/System/Array/LastIndexOfT/source.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/Array_LastIndexOf/fs/source.fs" id="Snippet1"::: @@ -6837,14 +6837,14 @@ ## Remarks The is searched backward starting at `startIndex` and ending at the first element. - The elements are compared to the specified value using the method. If the element type is a nonintrinsic (user-defined) type, the `Equals` implementation of that type is used. + The elements are compared to the specified value using the method. If the element type is a nonintrinsic (user-defined) type, the `Equals` implementation of that type is used. This method is an O(`n`) operation, where `n` is the number of elements from the beginning of `array` to `startIndex`. ## Examples - The following code example demonstrates all three generic overloads of the method. An array of strings is created, with one entry that appears twice, at index location 0 and index location 5. The method overload searches the entire array from the end, and finds the second occurrence of the string. The method overload is used to search the array backward beginning with index location 3 and continuing to the beginning of the array, and finds the first occurrence of the string. Finally, the method overload is used to search a range of four entries, beginning at index location 4 and extending backward (that is, it searches the items at locations 4, 3, 2, and 1); this search returns -1 because there are no instances of the search string in that range. + The following code example demonstrates all three generic overloads of the method. An array of strings is created, with one entry that appears twice, at index location 0 and index location 5. The method overload searches the entire array from the end, and finds the second occurrence of the string. The method overload is used to search the array backward beginning with index location 3 and continuing to the beginning of the array, and finds the first occurrence of the string. Finally, the method overload is used to search a range of four entries, beginning at index location 4 and extending backward (that is, it searches the items at locations 4, 3, 2, and 1); this search returns -1 because there are no instances of the search string in that range. :::code language="csharp" source="~/snippets/csharp/System/Array/LastIndexOfT/source.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/Array_LastIndexOf/fs/source.fs" id="Snippet1"::: @@ -6929,14 +6929,14 @@ ## Remarks The is searched backward starting at `startIndex` and ending at `startIndex` minus `count` plus 1, if `count` is greater than 0. - The elements are compared to the specified value using the method. If the element type is a nonintrinsic (user-defined) type, the `Equals` implementation of that type is used. + The elements are compared to the specified value using the method. If the element type is a nonintrinsic (user-defined) type, the `Equals` implementation of that type is used. This method is an O(`n`) operation, where `n` is `count`. ## Examples - The following code example demonstrates all three generic overloads of the method. An array of strings is created, with one entry that appears twice, at index location 0 and index location 5. The method overload searches the entire array from the end, and finds the second occurrence of the string. The method overload is used to search the array backward beginning with index location 3 and continuing to the beginning of the array, and finds the first occurrence of the string. Finally, the method overload is used to search a range of four entries, beginning at index location 4 and extending backward (that is, it searches the items at locations 4, 3, 2, and 1); this search returns -1 because there are no instances of the search string in that range. + The following code example demonstrates all three generic overloads of the method. An array of strings is created, with one entry that appears twice, at index location 0 and index location 5. The method overload searches the entire array from the end, and finds the second occurrence of the string. The method overload is used to search the array backward beginning with index location 3 and continuing to the beginning of the array, and finds the first occurrence of the string. Finally, the method overload is used to search a range of four entries, beginning at index location 4 and extending backward (that is, it searches the items at locations 4, 3, 2, and 1); this search returns -1 because there are no instances of the search string in that range. :::code language="csharp" source="~/snippets/csharp/System/Array/LastIndexOfT/source.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/Array_LastIndexOf/fs/source.fs" id="Snippet1"::: @@ -7022,7 +7022,7 @@ ## Examples - The following example uses the property to get the total number of elements in an array. It also uses the method to determine the number of elements in each dimension of a multidimensional array. + The following example uses the property to get the total number of elements in an array. It also uses the method to determine the number of elements in each dimension of a multidimensional array. :::code language="csharp" source="~/snippets/csharp/System/Array/Length/length1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.array.length/fs/length1.fs" id="Snippet1"::: @@ -7318,11 +7318,11 @@ int[,,] TDArray = new int[1,1,1]; If `array` is `null`, this method creates a new array with the specified size. - If `newSize` is greater than the of the old array, a new array is allocated and all the elements are copied from the old array to the new one. If `newSize` is less than the of the old array, a new array is allocated and elements are copied from the old array to the new one until the new one is filled; the rest of the elements in the old array are ignored. If `newSize` is equal to the of the old array, this method does nothing. + If `newSize` is greater than the of the old array, a new array is allocated and all the elements are copied from the old array to the new one. If `newSize` is less than the of the old array, a new array is allocated and elements are copied from the old array to the new one until the new one is filled; the rest of the elements in the old array are ignored. If `newSize` is equal to the of the old array, this method does nothing. This method is an O(`n`) operation, where `n` is `newSize`. - The method resizes a one-dimensional array only. The class does not include a method for resizing multi-dimensional arrays. To do this, you must either provide your own code or call a special-purpose method in a third-party library. The following code illustrates one possible implementation for a method that resizes an array of *n* dimensions. + The method resizes a one-dimensional array only. The class does not include a method for resizing multi-dimensional arrays. To do this, you must either provide your own code or call a special-purpose method in a third-party library. The following code illustrates one possible implementation for a method that resizes an array of *n* dimensions. :::code language="csharp" source="~/snippets/csharp/System/Array/ResizeT/resizexd.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Array.Resize/FS/resizexd.fs" id="Snippet2"::: @@ -7414,11 +7414,11 @@ int[,,] TDArray = new int[1,1,1]; ## Remarks After a call to this method, the element at `myArray[i]`, where `i` is any index in the array, moves to `myArray[j]`, where `j` equals `(myArray.Length + myArray.GetLowerBound(0)) - (i - myArray.GetLowerBound(0)) - 1`. - This method is an O(`n`) operation, where `n` is the of `array`. + This method is an O(`n`) operation, where `n` is the of `array`. In F#, the [Array.rev](https://fsharp.github.io/fsharp-core-docs/reference/fsharp-collections-arraymodule.html#rev) function can be used instead. - As the following example shows, the method can be used to reverse a jagged array. It initializes a jagged array with one element for each month of the current year in the current culture's calendar. Each element contains an array with as many elements as that month has days. The example displays the contents of the array, calls the method, and then displays the contents of the reversed array. + As the following example shows, the method can be used to reverse a jagged array. It initializes a jagged array with one element for each month of the current year in the current culture's calendar. Each element contains an array with as many elements as that month has days. The example displays the contents of the array, calls the method, and then displays the contents of the reversed array. :::code language="csharp" source="~/snippets/csharp/System/Array/Reverse/reversejagged.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.array.reverse/fs/reversejagged.fs" id="Snippet1"::: @@ -7507,7 +7507,7 @@ int[,,] TDArray = new int[1,1,1]; ## Remarks After a call to this method, the element at `myArray[i]`, where `i` is any index in the array, moves to `myArray[j]`, where `j` equals `(myArray.Length + myArray.GetLowerBound(0)) - (i - myArray.GetLowerBound(0)) - 1`. - The method can be used to reverse a jagged array. + The method can be used to reverse a jagged array. This method is an O(`n`) operation, where `n` is `length`. @@ -7737,14 +7737,14 @@ int[,,] TDArray = new int[1,1,1]; and methods can determine whether the value of `index` is out of bounds. + The and methods can determine whether the value of `index` is out of bounds. For more information about conversions, see . This method is an O(1) operation. > [!NOTE] -> If is used to assign `null` to an element of an array of value types, all fields of the element are initialized to zero. The value of the element is not a null reference, and cannot be found by searching for a null reference. +> If is used to assign `null` to an element of an array of value types, all fields of the element are initialized to zero. The value of the element is not a null reference, and cannot be found by searching for a null reference. @@ -7835,14 +7835,14 @@ int[,,] TDArray = new int[1,1,1]; ## Remarks The number of elements in `indices` must equal the number of dimensions in the . All elements in the `indices` array must collectively specify the position of the desired element in the multidimensional . - The and methods can determine whether any of the values in the `indices` array is out of bounds. + The and methods can determine whether any of the values in the `indices` array is out of bounds. For more information about conversions, see . This method is an O(1) operation. > [!NOTE] -> If is used to assign `null` to an element of an array of value types, all fields of the element are initialized to zero. The value of the element is not a null reference, and cannot be found by searching for a null reference. +> If is used to assign `null` to an element of an array of value types, all fields of the element are initialized to zero. The value of the element is not a null reference, and cannot be found by searching for a null reference. @@ -7914,14 +7914,14 @@ int[,,] TDArray = new int[1,1,1]; and methods can determine whether the value of `index` is out of bounds. + The and methods can determine whether the value of `index` is out of bounds. For more information about conversions, see . This method is an O(1) operation. > [!NOTE] -> If is used to assign `null` to an element of an array of value types, all fields of the element are initialized to zero. The value of the element is not a null reference, and cannot be found by searching for a null reference. +> If is used to assign `null` to an element of an array of value types, all fields of the element are initialized to zero. The value of the element is not a null reference, and cannot be found by searching for a null reference. @@ -8008,14 +8008,14 @@ int[,,] TDArray = new int[1,1,1]; ## Remarks The number of elements in `indices` must equal the number of dimensions in the . All elements in the `indices` array must collectively specify the position of the desired element in the multidimensional . - The and methods can determine whether any of the values in the `indices` array is out of bounds. + The and methods can determine whether any of the values in the `indices` array is out of bounds. For more information about conversions, see . This method is an O(1) operation. > [!NOTE] -> If is used to assign `null` to an element of an array of value types, all fields of the element are initialized to zero. The value of the element is not a null reference, and cannot be found by searching for a null reference. +> If is used to assign `null` to an element of an array of value types, all fields of the element are initialized to zero. The value of the element is not a null reference, and cannot be found by searching for a null reference. @@ -8089,14 +8089,14 @@ int[,,] TDArray = new int[1,1,1]; and methods can determine whether any of the indexes is out of bounds. + The and methods can determine whether any of the indexes is out of bounds. For more information about conversions, see . This method is an O(1) operation. > [!NOTE] -> If is used to assign `null` to an element of an array of value types, all fields of the element are initialized to zero. The value of the element is not a null reference, and cannot be found by searching for a null reference. +> If is used to assign `null` to an element of an array of value types, all fields of the element are initialized to zero. The value of the element is not a null reference, and cannot be found by searching for a null reference. @@ -8168,14 +8168,14 @@ int[,,] TDArray = new int[1,1,1]; and methods can determine whether any of the indexes is out of bounds. + The and methods can determine whether any of the indexes is out of bounds. For more information about conversions, see . This method is an O(1) operation. > [!NOTE] -> If is used to assign `null` to an element of an array of value types, all fields of the element are initialized to zero. The value of the element is not a null reference, and cannot be found by searching for a null reference. +> If is used to assign `null` to an element of an array of value types, all fields of the element are initialized to zero. The value of the element is not a null reference, and cannot be found by searching for a null reference. @@ -8249,14 +8249,14 @@ int[,,] TDArray = new int[1,1,1]; and methods can determine whether any of the indexes is out of bounds. + The and methods can determine whether any of the indexes is out of bounds. For more information about conversions, see . This method is an O(1) operation. > [!NOTE] -> If is used to assign `null` to an element of an array of value types, all fields of the element are initialized to zero. The value of the element is not a null reference, and cannot be found by searching for a null reference. +> If is used to assign `null` to an element of an array of value types, all fields of the element are initialized to zero. The value of the element is not a null reference, and cannot be found by searching for a null reference. ]]> @@ -8330,14 +8330,14 @@ int[,,] TDArray = new int[1,1,1]; and methods can determine whether any of the indexes is out of bounds. + The and methods can determine whether any of the indexes is out of bounds. For more information about conversions, see . This method is an O(1) operation. > [!NOTE] -> If is used to assign `null` to an element of an array of value types, all fields of the element are initialized to zero. The value of the element is not a null reference, and cannot be found by searching for a null reference. +> If is used to assign `null` to an element of an array of value types, all fields of the element are initialized to zero. The value of the element is not a null reference, and cannot be found by searching for a null reference. @@ -8436,7 +8436,7 @@ int[,,] TDArray = new int[1,1,1]; This implementation performs an unstable sort; that is, if two elements are equal, their order might not be preserved. In contrast, a stable sort preserves the order of elements that are equal. - This method is an O(`n` log `n`) operation, where `n` is the of `array`. + This method is an O(`n` log `n`) operation, where `n` is the of `array`. @@ -8545,7 +8545,7 @@ int[,,] TDArray = new int[1,1,1]; This implementation performs an unstable sort; that is, if two elements are equal, their order might not be preserved. In contrast, a stable sort preserves the order of elements that are equal. - This method is an O(`n` log `n`) operation, where `n` is the of `keys`. + This method is an O(`n` log `n`) operation, where `n` is the of `keys`. @@ -8658,7 +8658,7 @@ int[,,] TDArray = new int[1,1,1]; This implementation performs an unstable sort; that is, if two elements are equal, their order might not be preserved. In contrast, a stable sort preserves the order of elements that are equal. -This method is an O(`n` log `n`) operation, where `n` is the of `array`. +This method is an O(`n` log `n`) operation, where `n` is the of `array`. .NET includes predefined implementations listed in the following table. @@ -8667,7 +8667,7 @@ This method is an O(`n` log `n`) operation, where `n` is the |Compares any two objects, but performs a case-insensitive comparison of strings.| ||Compares any two objects by using the sorting conventions of the current culture.| ||Compares any two objects by using the sorting conventions of the invariant culture.| -||Compares two objects of type `T` by using the type's default sort order.| +||Compares two objects of type `T` by using the type's default sort order.| You can also support custom comparisons by providing an instance of your own implementation to the `comparer` parameter. The example does this by defining a `ReverseComparer` class that reverses the default sort order for instances of a type and performs case-insensitive string comparison. @@ -8787,7 +8787,7 @@ This method is an O(`n` log `n`) operation, where `n` is the |Compares any two objects, but performs a case-insensitive comparison of strings.| ||Compares any two objects by using the sorting conventions of the current culture.| ||Compares any two objects by using the sorting conventions of the invariant culture.| -||Compares two objects of type `T` by using the type's default sort order.| +||Compares two objects of type `T` by using the type's default sort order.| You can also support custom comparisons by providing an instance of your own implementation to the `comparer` parameter. The example does this by defining an implementation that reverses the default sort order and performs case-insensitive string comparison. @@ -8801,7 +8801,7 @@ This method is an O(`n` log `n`) operation, where `n` is the of `keys`. + This method is an O(`n` log `n`) operation, where `n` is the of `keys`. @@ -9160,7 +9160,7 @@ This method is an O(`n` log `n`) operation, where `n` is the |Compares any two objects, but performs a case-insensitive comparison of strings.| ||Compares any two objects by using the sorting conventions of the current culture.| ||Compares any two objects by using the sorting conventions of the invariant culture.| -||Compares two objects of type `T` by using the type's default sort order.| +||Compares two objects of type `T` by using the type's default sort order.| You can also support custom comparisons by providing an instance of your own implementation to the `comparer` parameter. The example does this by defining a `ReverseComparer` class that reverses the default sort order for instances of a type and performs case-insensitive string comparison. @@ -9311,7 +9311,7 @@ This method is an O(`n` log `n`) operation, where `n` is the |Compares any two objects, but performs a case-insensitive comparison of strings.| ||Compares any two objects by using the sorting conventions of the current culture.| ||Compares any two objects by using the sorting conventions of the invariant culture.| -||Compares two objects of type `T` by using the type's default sort order.| +||Compares two objects of type `T` by using the type's default sort order.| You can also support custom comparisons by providing an instance of your own implementation to the `comparer` parameter. The example does this by defining a custom implementation that reverses the default sort order and performs case-insensitive string comparison. @@ -9446,7 +9446,7 @@ This method is an O(`n` log `n`) operation, where `n` is the generic interface to be capable of comparisons with every other element in `array`. + Each element of `array` must implement the generic interface to be capable of comparisons with every other element in `array`. If the sort is not successfully completed, the results are undefined. @@ -9460,19 +9460,19 @@ This method is an O(`n` log `n`) operation, where `n` is the of `array`. + This method is an O(`n` log `n`) operation, where `n` is the of `array`. ## Examples - The following code example demonstrates the generic method overload and the generic method overload. An array of strings is created, in no particular order. + The following code example demonstrates the generic method overload and the generic method overload. An array of strings is created, in no particular order. The array is displayed, sorted, and displayed again. > [!NOTE] -> The calls to the and generic methods do not look any different from calls to their nongeneric counterparts, because Visual Basic, C#, and C++ infer the type of the generic type parameter from the type of the first argument. If you use the [Ildasm.exe (IL Disassembler)](/dotnet/framework/tools/ildasm-exe-il-disassembler) to examine the Microsoft intermediate language (MSIL), you can see that the generic methods are being called. +> The calls to the and generic methods do not look any different from calls to their nongeneric counterparts, because Visual Basic, C#, and C++ infer the type of the generic type parameter from the type of the first argument. If you use the [Ildasm.exe (IL Disassembler)](/dotnet/framework/tools/ildasm-exe-il-disassembler) to examine the Microsoft intermediate language (MSIL), you can see that the generic methods are being called. - The generic method overload is then used to search for two strings, one that is not in the array and one that is. The array and the return value of the method are passed to the `ShowWhere` generic method, which displays the index value if the string is found, and otherwise the elements the search string would fall between if it were in the array. The index is negative if the string is not n the array, so the `ShowWhere` method takes the bitwise complement (the ~ operator in C#, `Xor` -1 in Visual Basic) to obtain the index of the first element in the list that is larger than the search string. + The generic method overload is then used to search for two strings, one that is not in the array and one that is. The array and the return value of the method are passed to the `ShowWhere` generic method, which displays the index value if the string is found, and otherwise the elements the search string would fall between if it were in the array. The index is negative if the string is not n the array, so the `ShowWhere` method takes the bitwise complement (the ~ operator in C#, `Xor` -1 in Visual Basic) to obtain the index of the first element in the list that is larger than the search string. :::code language="csharp" source="~/snippets/csharp/System/Array/BinarySearchT/source.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/Array_SortSearch/fs/source.fs" id="Snippet1"::: @@ -9564,7 +9564,7 @@ This method is an O(`n` log `n`) operation, where `n` is the generic interface to be capable of comparisons with every other element in `array`. + If `comparer` is `null`, each element of `array` must implement the generic interface to be capable of comparisons with every other element in `array`. If the sort is not successfully completed, the results are undefined. @@ -9578,21 +9578,21 @@ This method is an O(`n` log `n`) operation, where `n` is the of `array`. + This method is an O(`n` log `n`) operation, where `n` is the of `array`. ## Examples - The following code example demonstrates the generic method overload and the generic method overload. + The following code example demonstrates the generic method overload and the generic method overload. The code example defines an alternative comparer for strings, named `ReverseCompare`, which implements the `IComparer` (`IComparer(Of String)` in Visual Basic,) generic interface. The comparer calls the method, reversing the order of the comparands so that the strings sort high-to-low instead of low-to-high. - The array is displayed, sorted, and displayed again. Arrays must be sorted in order to use the method. + The array is displayed, sorted, and displayed again. Arrays must be sorted in order to use the method. > [!NOTE] -> The calls to the and generic methods do not look any different from calls to their nongeneric counterparts, because Visual Basic, C#, and C++ infer the type of the generic type parameter from the type of the first argument. If you use the [Ildasm.exe (IL Disassembler)](/dotnet/framework/tools/ildasm-exe-il-disassembler) to examine the Microsoft intermediate language (MSIL), you can see that the generic methods are being called. +> The calls to the and generic methods do not look any different from calls to their nongeneric counterparts, because Visual Basic, C#, and C++ infer the type of the generic type parameter from the type of the first argument. If you use the [Ildasm.exe (IL Disassembler)](/dotnet/framework/tools/ildasm-exe-il-disassembler) to examine the Microsoft intermediate language (MSIL), you can see that the generic methods are being called. - The generic method overload is then used to search for two strings, one that is not in the array and one that is. The array and the return value of the method are passed to the `ShowWhere` generic method, which displays the index value if the string is found, and otherwise the elements the search string would fall between if it were in the array. The index is negative if the string is not n the array, so the `ShowWhere` method takes the bitwise complement (the ~ operator in C#, `Xor` -1 in Visual Basic) to obtain the index of the first element in the list that is larger than the search string. + The generic method overload is then used to search for two strings, one that is not in the array and one that is. The array and the return value of the method are passed to the `ShowWhere` generic method, which displays the index value if the string is found, and otherwise the elements the search string would fall between if it were in the array. The index is negative if the string is not n the array, so the `ShowWhere` method takes the bitwise complement (the ~ operator in C#, `Xor` -1 in Visual Basic) to obtain the index of the first element in the list that is larger than the search string. :::code language="csharp" source="~/snippets/csharp/System/Array/BinarySearchT/source1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/Array_SortSearchComparer/fs/source.fs" id="Snippet1"::: @@ -9688,16 +9688,16 @@ This method is an O(`n` log `n`) operation, where `n` is the of `array`. + This method is an O(`n` log `n`) operation, where `n` is the of `array`. ## Examples - The following code example demonstrates the method overload. + The following code example demonstrates the method overload. The code example defines an alternative comparison method for strings, named `CompareDinosByLength`. This method works as follows: First, the comparands are tested for`null`, and a null reference is treated as less than a non-null. Second, the string lengths are compared, and the longer string is deemed to be greater. Third, if the lengths are equal, ordinary string comparison is used. - A array of strings is created and populated with four strings, in no particular order. The list also includes an empty string and a null reference. The list is displayed, sorted using a generic delegate representing the `CompareDinosByLength` method, and displayed again. + A array of strings is created and populated with four strings, in no particular order. The list also includes an empty string and a null reference. The list is displayed, sorted using a generic delegate representing the `CompareDinosByLength` method, and displayed again. :::code language="csharp" source="~/snippets/csharp/System/Array/SortT/source.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/Array_SortComparison/fs/source.fs" id="Snippet1"::: @@ -9790,7 +9790,7 @@ This method is an O(`n` log `n`) operation, where `n` is the generic interface to be capable of comparisons with every other element in `array`. + Each element within the specified range of elements in `array` must implement the generic interface to be capable of comparisons with every other element in `array`. If the sort is not successfully completed, the results are undefined. @@ -9809,14 +9809,14 @@ This method is an O(`n` log `n`) operation, where `n` is the generic method overload and the generic method overload for sorting a range in an array. + The following code example demonstrates the generic method overload and the generic method overload for sorting a range in an array. The code example defines an alternative comparer for strings, named `ReverseCompare`, which implements the `IComparer` (`IComparer(Of String)` in Visual Basic) generic interface. The comparer calls the method, reversing the order of the comparands so that the strings sort high-to-low instead of low-to-high. - The code example creates and displays an array of dinosaur names, consisting of three herbivores followed by three carnivores (tyrannosaurids, to be precise). The generic method overload is used to sort the last three elements of the array, which is then displayed. The generic method overload is used with `ReverseCompare` to sort the last three elements in reverse order. The thoroughly confused dinosaurs are displayed again. + The code example creates and displays an array of dinosaur names, consisting of three herbivores followed by three carnivores (tyrannosaurids, to be precise). The generic method overload is used to sort the last three elements of the array, which is then displayed. The generic method overload is used with `ReverseCompare` to sort the last three elements in reverse order. The thoroughly confused dinosaurs are displayed again. > [!NOTE] -> The calls to the and generic methods do not look any different from calls to their nongeneric counterparts, because Visual Basic, C#, and C++ infer the type of the generic type parameter from the type of the first argument. If you use the [Ildasm.exe (IL Disassembler)](/dotnet/framework/tools/ildasm-exe-il-disassembler) to examine the Microsoft intermediate language (MSIL), you can see that the generic methods are being called. +> The calls to the and generic methods do not look any different from calls to their nongeneric counterparts, because Visual Basic, C#, and C++ infer the type of the generic type parameter from the type of the first argument. If you use the [Ildasm.exe (IL Disassembler)](/dotnet/framework/tools/ildasm-exe-il-disassembler) to examine the Microsoft intermediate language (MSIL), you can see that the generic methods are being called. :::code language="csharp" source="~/snippets/csharp/System/Array/SortT/source1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/Array_SortIntIntIComparer/fs/source.fs" id="Snippet1"::: @@ -9924,7 +9924,7 @@ This method is an O(`n` log `n`) operation, where `n` is the generic interface to be capable of comparisons with every other element in `array`. + If `comparer` is `null`, each element within the specified range of elements in `array` must implement the generic interface to be capable of comparisons with every other element in `array`. If the sort is not successfully completed, the results are undefined. @@ -9943,14 +9943,14 @@ This method is an O(`n` log `n`) operation, where `n` is the generic method overload and the generic method overload for sorting a range in an array. + The following code example demonstrates the generic method overload and the generic method overload for sorting a range in an array. The code example defines an alternative comparer for strings, named `ReverseCompare`, which implements the `IComparer` (`IComparer(Of String)` in Visual Basic) generic interface. The comparer calls the method, reversing the order of the comparands so that the strings sort high-to-low instead of low-to-high. - The code example creates and displays an array of dinosaur names, consisting of three herbivores followed by three carnivores (tyrannosaurids, to be precise). The generic method overload is used to sort the last three elements of the array, which is then displayed. The generic method overload is used with `ReverseCompare` to sort the last three elements in reverse order. The thoroughly confused dinosaurs are displayed again. + The code example creates and displays an array of dinosaur names, consisting of three herbivores followed by three carnivores (tyrannosaurids, to be precise). The generic method overload is used to sort the last three elements of the array, which is then displayed. The generic method overload is used with `ReverseCompare` to sort the last three elements in reverse order. The thoroughly confused dinosaurs are displayed again. > [!NOTE] -> The calls to the and generic methods do not look any different from calls to their nongeneric counterparts, because Visual Basic, C#, and C++ infer the type of the generic type parameter from the type of the first argument. If you use the [Ildasm.exe (IL Disassembler)](/dotnet/framework/tools/ildasm-exe-il-disassembler) to examine the Microsoft intermediate language (MSIL), you can see that the generic methods are being called. +> The calls to the and generic methods do not look any different from calls to their nongeneric counterparts, because Visual Basic, C#, and C++ infer the type of the generic type parameter from the type of the first argument. If you use the [Ildasm.exe (IL Disassembler)](/dotnet/framework/tools/ildasm-exe-il-disassembler) to examine the Microsoft intermediate language (MSIL), you can see that the generic methods are being called. :::code language="csharp" source="~/snippets/csharp/System/Array/SortT/source1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/Array_SortIntIntIComparer/fs/source.fs" id="Snippet1"::: @@ -10061,7 +10061,7 @@ This method is an O(`n` log `n`) operation, where `n` is the has a corresponding item in the `items` . When a key is repositioned during the sorting, the corresponding item in the `items` is similarly repositioned. Therefore, the `items` is sorted according to the arrangement of the corresponding keys in the `keys` . - Each key in the `keys` must implement the generic interface to be capable of comparisons with every other key. + Each key in the `keys` must implement the generic interface to be capable of comparisons with every other key. You can sort if there are more items than keys, but the items that have no corresponding keys will not be sorted. You cannot sort if there are more keys than items; doing this throws an . @@ -10077,21 +10077,21 @@ This method is an O(`n` log `n`) operation, where `n` is the of `array`. + This method is an O(`n` log `n`) operation, where `n` is the of `array`. ## Examples - The following code example demonstrates the , , , and generic method overloads, for sorting pairs of arrays that represent keys and values. + The following code example demonstrates the , , , and generic method overloads, for sorting pairs of arrays that represent keys and values. The code example defines an alternative comparer for strings, named `ReverseCompare`, which implements the `IComparer` (`IComparer(Of String)` in Visual Basic) generic interface. The comparer calls the method, reversing the order of the comparands so that the strings sort high-to-low instead of low-to-high. The code example creates and displays an array of dinosaur names (the keys) and an array of integers representing the maximum length of each dinosaur in meters (the values). The arrays are then sorted and displayed several times: -- The overload is used to sort both arrays in order of the dinosaur names in the first array. -- The overload and an instance of `ReverseCompare` are used to reverse the sort order of the paired arrays. -- The overload is used to sort the last three elements of both arrays. -- The overload is used to sort the last three elements of both arrays in reverse order. +- The overload is used to sort both arrays in order of the dinosaur names in the first array. +- The overload and an instance of `ReverseCompare` are used to reverse the sort order of the paired arrays. +- The overload is used to sort the last three elements of both arrays. +- The overload is used to sort the last three elements of both arrays in reverse order. > [!NOTE] > The calls to the generic methods do not look any different from calls to their nongeneric counterparts, because Visual Basic, C#, and C++ infer the type of the generic type parameter from the type of the first two arguments. If you use the [Ildasm.exe (IL Disassembler)](/dotnet/framework/tools/ildasm-exe-il-disassembler) to examine the Microsoft intermediate language (MSIL), you can see that the generic methods are being called. @@ -10204,7 +10204,7 @@ This method is an O(`n` log `n`) operation, where `n` is the has a corresponding item in the `items` . When a key is repositioned during the sorting, the corresponding item in the `items` is similarly repositioned. Therefore, the `items` is sorted according to the arrangement of the corresponding keys in the `keys` . - If `comparer` is `null`, each key in the `keys` must implement the generic interface to be capable of comparisons with every other key. + If `comparer` is `null`, each key in the `keys` must implement the generic interface to be capable of comparisons with every other key. You can sort if there are more items than keys, but the items that have no corresponding keys will not be sorted. You cannot sort if there are more keys than items; doing this throws an . @@ -10220,19 +10220,19 @@ This method is an O(`n` log `n`) operation, where `n` is the of `array`. + This method is an O(`n` log `n`) operation, where `n` is the of `array`. ## Examples - The following code example demonstrates the , [\], , , and generic method overloads, for sorting pairs of arrays that represent keys and values. + The following code example demonstrates the , [\], , , and generic method overloads, for sorting pairs of arrays that represent keys and values. The code example defines an alternative comparer for strings, named `ReverseCompare`, which implements the `IComparer` (`IComparer(Of String)` in Visual Basic) generic interface. The comparer calls the method, reversing the order of the comparands so that the strings sort high-to-low instead of low-to-high. The code example creates and displays an array of dinosaur names (the keys) and an array of integers representing the maximum length of each dinosaur in meters (the values). The arrays are then sorted and displayed several times: -- The overload is used to sort both arrays in order of the dinosaur names in the first array. -- The overload and an instance of `ReverseCompare` are used to reverse the sort order of the paired arrays. -- The overload is used to sort the last three elements of both arrays. -- The overload is used to sort the last three elements of both arrays in reverse order. +- The overload is used to sort both arrays in order of the dinosaur names in the first array. +- The overload and an instance of `ReverseCompare` are used to reverse the sort order of the paired arrays. +- The overload is used to sort the last three elements of both arrays. +- The overload is used to sort the last three elements of both arrays in reverse order. > [!NOTE] > The calls to the generic methods do not look any different from calls to their nongeneric counterparts, because Visual Basic, C#, and C++ infer the type of the generic type parameter from the type of the first two arguments. If you use the [Ildasm.exe (IL Disassembler)](/dotnet/framework/tools/ildasm-exe-il-disassembler) to examine the Microsoft intermediate language (MSIL), you can see that the generic methods are being called. @@ -10348,7 +10348,7 @@ This method is an O(`n` log `n`) operation, where `n` is the has a corresponding item in the `items` . When a key is repositioned during the sorting, the corresponding item in the `items` is similarly repositioned. Therefore, the `items` is sorted according to the arrangement of the corresponding keys in the `keys` . - Each key within the specified range of elements in the `keys` must implement the generic interface to be capable of comparisons with every other key. + Each key within the specified range of elements in the `keys` must implement the generic interface to be capable of comparisons with every other key. You can sort if there are more items than keys, but the items that have no corresponding keys will not be sorted. You cannot sort if there are more keys than items; doing this throws an . @@ -10367,16 +10367,16 @@ This method is an O(`n` log `n`) operation, where `n` is the , , , and generic method overloads, for sorting pairs of arrays that represent keys and values. + The following code example demonstrates the , , , and generic method overloads, for sorting pairs of arrays that represent keys and values. The code example defines an alternative comparer for strings, named `ReverseCompare`, which implements the `IComparer` (`IComparer(Of String)` in Visual Basic) generic interface. The comparer calls the method, reversing the order of the comparands so that the strings sort high-to-low instead of low-to-high. The code example creates and displays an array of dinosaur names (the keys) and an array of integers representing the maximum length of each dinosaur in meters (the values). The arrays are then sorted and displayed several times: -- The overload is used to sort both arrays in order of the dinosaur names in the first array. -- The overload and an instance of `ReverseCompare` are used to reverse the sort order of the paired arrays. -- The overload is used to sort the last three elements of both arrays. -- The overload is used to sort the last three elements of both arrays in reverse order. +- The overload is used to sort both arrays in order of the dinosaur names in the first array. +- The overload and an instance of `ReverseCompare` are used to reverse the sort order of the paired arrays. +- The overload is used to sort the last three elements of both arrays. +- The overload is used to sort the last three elements of both arrays in reverse order. > [!NOTE] > The calls to the generic methods do not look any different from calls to their nongeneric counterparts, because Visual Basic, C#, and C++ infer the type of the generic type parameter from the type of the first two arguments. If you use the [Ildasm.exe (IL Disassembler)](/dotnet/framework/tools/ildasm-exe-il-disassembler) to examine the Microsoft intermediate language (MSIL), you can see that the generic methods are being called. @@ -10510,7 +10510,7 @@ This method is an O(`n` log `n`) operation, where `n` is the has a corresponding item in the `items` . When a key is repositioned during the sorting, the corresponding item in the `items` is similarly repositioned. Therefore, the `items` is sorted according to the arrangement of the corresponding keys in the `keys` . - If `comparer` is `null`, each key within the specified range of elements in the `keys` must implement the generic interface to be capable of comparisons with every other key. + If `comparer` is `null`, each key within the specified range of elements in the `keys` must implement the generic interface to be capable of comparisons with every other key. You can sort if there are more items than keys, but the items that have no corresponding keys will not be sorted. You cannot sort if there are more keys than items; doing this throws an . @@ -10529,16 +10529,16 @@ This method is an O(`n` log `n`) operation, where `n` is the , , , and generic method overloads, for sorting pairs of arrays that represent keys and values. + The following code example demonstrates the , , , and generic method overloads, for sorting pairs of arrays that represent keys and values. The code example defines an alternative comparer for strings, named `ReverseCompare`, which implements the `IComparer`(`IComparer(Of String)` in Visual Basic) generic interface. The comparer calls the method, reversing the order of the comparands so that the strings sort high-to-low instead of low-to-high. The code example creates and displays an array of dinosaur names (the keys) and an array of integers representing the maximum length of each dinosaur in meters (the values). The arrays are then sorted and displayed several times: -- The overload is used to sort both arrays in order of the dinosaur names in the first array. -- The overload and an instance of `ReverseCompare` are used to reverse the sort order of the paired arrays. -- The overload is used to sort the last three elements of both arrays. -- The overload is used to sort the last three elements of both arrays in reverse order. +- The overload is used to sort both arrays in order of the dinosaur names in the first array. +- The overload and an instance of `ReverseCompare` are used to reverse the sort order of the paired arrays. +- The overload is used to sort the last three elements of both arrays. +- The overload is used to sort the last three elements of both arrays in reverse order. > [!NOTE] > The calls to the generic methods do not look any different from calls to their nongeneric counterparts, because Visual Basic, C#, and C++ infer the type of the generic type parameter from the type of the first two arguments. If you use the [Ildasm.exe (IL Disassembler)](/dotnet/framework/tools/ildasm-exe-il-disassembler) to examine the Microsoft intermediate language (MSIL), you can see that the generic methods are being called. @@ -10640,7 +10640,7 @@ This property implements the provide their own synchronized version of the collection using the property. - Classes that use arrays can also implement their own synchronization using the property. The synchronizing code must perform operations on the `SyncRoot` of the collection, not directly on the collection. This ensures proper operation of collections that are derived from other objects. Specifically, it maintains proper synchronization with other threads that might be simultaneously modifying the collection. Note that some implementations of might return the itself. + Classes that use arrays can also implement their own synchronization using the property. The synchronizing code must perform operations on the `SyncRoot` of the collection, not directly on the collection. This ensures proper operation of collections that are derived from other objects. Specifically, it maintains proper synchronization with other threads that might be simultaneously modifying the collection. Note that some implementations of might return the itself. Enumerating through a collection is intrinsically not a thread safe procedure. Even when a collection is synchronized, other threads can still modify the collection, which causes the enumerator to throw an exception. To guarantee thread safety during enumeration, you can either lock the collection during the entire enumeration or catch the exceptions resulting from changes made by other threads. @@ -10850,7 +10850,7 @@ This member is an explicit interface member implementation. It can be used only implementation adds a member to a collection. However, because arrays have a fixed size (the property always returns `true`), this method always throws a exception. + Ordinarily, an implementation adds a member to a collection. However, because arrays have a fixed size (the property always returns `true`), this method always throws a exception. This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. @@ -11653,26 +11653,26 @@ This member is an explicit interface member implementation. It can be used only is a delegate to a method that returns`true` if the object passed to it matches the conditions defined in the delegate. The elements of `array` are individually passed to the , and processing is stopped when the delegate returns `false` for any element. + The is a delegate to a method that returns`true` if the object passed to it matches the conditions defined in the delegate. The elements of `array` are individually passed to the , and processing is stopped when the delegate returns `false` for any element. - This method is an O(`n`) operation, where `n` is the of `array`. + This method is an O(`n`) operation, where `n` is the of `array`. ## Examples - The following example determines whether the last character of each element in a string array is a number. It creates two string arrays. The first array includes both strings that end with alphabetic characters and strings that end with numeric characters. The second array consists only of strings that end with numeric characters. The example also defines an `EndWithANumber` method whose signature matches the delegate. The example passes each array to the method along with a delegate that represents the `EndsWithANumber` method. + The following example determines whether the last character of each element in a string array is a number. It creates two string arrays. The first array includes both strings that end with alphabetic characters and strings that end with numeric characters. The second array consists only of strings that end with numeric characters. The example also defines an `EndWithANumber` method whose signature matches the delegate. The example passes each array to the method along with a delegate that represents the `EndsWithANumber` method. :::code language="csharp" source="~/snippets/csharp/System/Array/TrueForAllT/trueforall2.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.array.trueforall/fs/trueforall2.fs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System/Array/TrueForAllT/trueforall2.vb" id="Snippet2"::: - The following example is similar to the first, except that it passes the string array to the method along with a lambda expression that determines whether a particular array element ends with the string representation of a number. + The following example is similar to the first, except that it passes the string array to the method along with a lambda expression that determines whether a particular array element ends with the string representation of a number. :::code language="csharp" source="~/snippets/csharp/System/Array/TrueForAllT/trueforall1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.array.trueforall/fs/trueforall1.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/Array/TrueForAllT/trueforall1.vb" id="Snippet1"::: - In both cases, the method returns `false` as soon as it encounters the first array element that does not end in a number. Otherwise, it returns `true` after iterating all the elements in the array. + In both cases, the method returns `false` as soon as it encounters the first array element that does not end in a number. Otherwise, it returns `true` after iterating all the elements in the array. > [!NOTE] > As both examples show, in C# and Visual Basic, it is not necessary to create the `Predicate` delegate (`Predicate(Of String)` in Visual Basic) explicitly. These languages infer the correct delegate from context and create it automatically. diff --git a/xml/System/ArraySegment`1+Enumerator.xml b/xml/System/ArraySegment`1+Enumerator.xml index a0a9eabb65e..44a99b2241b 100644 --- a/xml/System/ArraySegment`1+Enumerator.xml +++ b/xml/System/ArraySegment`1+Enumerator.xml @@ -58,18 +58,18 @@ Provides an enumerator for the elements of an . - . At this position, is undefined. You must call to advance the enumerator to the first item in the before reading the value of . +Initially, the enumerator is positioned before the first element in the . At this position, is undefined. You must call to advance the enumerator to the first item in the before reading the value of . - returns the same value until is called. sets to the next item in the . + returns the same value until is called. sets to the next item in the . + +If passes the end of the , returns `false`. When the enumerator is at this state, subsequent calls to also return `false` and is undefined. You cannot set to the first item in the again; you must create a new enumerator instance instead. -If passes the end of the , returns `false`. When the enumerator is at this state, subsequent calls to also return `false` and is undefined. You cannot set to the first item in the again; you must create a new enumerator instance instead. - ]]> @@ -115,17 +115,17 @@ If passes the end of the < Gets a reference to the item at the current position of the enumerator. The element of the at the current position of the enumerator. - must be called to advance the enumerator to the first element of the array segment before reading the value of `Current`. +- Immediately after the enumerator is created, the enumerator is positioned before the first element in the array segment. must be called to advance the enumerator to the first element of the array segment before reading the value of `Current`. -- The last call to returned `false`, which indicates the end of the array segment. +- The last call to returned `false`, which indicates the end of the array segment. -`Current` returns the same value until is called. sets `Current` to the next item in the array segment. +`Current` returns the same value until is called. sets `Current` to the next item in the array segment. ]]> @@ -205,11 +205,11 @@ If passes the end of the < if the enumerator was successfully advanced to the next element; if the enumerator has passed the end of the array segment. - is a wrapper around an array that delimits a range of elements in that array. Multiple instances can refer to the same original array and can overlap. The original array must be one-dimensional and must have zero-based indexing. + is a wrapper around an array that delimits a range of elements in that array. Multiple instances can refer to the same original array and can overlap. The original array must be one-dimensional and must have zero-based indexing. > [!NOTE] -> implements the interface starting with the .NET Framework 4.6; in previous versions of the .NET Framework, the structure did not implement this interface. +> implements the interface starting with the .NET Framework 4.6; in previous versions of the .NET Framework, the structure did not implement this interface. - The structure is useful whenever the elements of an array will be manipulated in distinct segments. For example: + The structure is useful whenever the elements of an array will be manipulated in distinct segments. For example: -- You can pass an object that represents only a portion of an array as an argument to a method, rather than call a relatively expensive method like to pass a copy of a portion of an array. +- You can pass an object that represents only a portion of an array as an argument to a method, rather than call a relatively expensive method like to pass a copy of a portion of an array. -- In a multithreaded app, you can use the structure to have each thread operate on only a portion of the array. +- In a multithreaded app, you can use the structure to have each thread operate on only a portion of the array. -- For task-based asynchronous operations, you can use an object to ensure that each task operates on a distinct segment of the array. The following example divides an array into individual segments with up to ten elements. Each element in the segment is multiplied by its segment number. The result shows that using the class to manipulate elements in this way changes the values of its underlying array. +- For task-based asynchronous operations, you can use an object to ensure that each task operates on a distinct segment of the array. The following example divides an array into individual segments with up to ten elements. Each element in the segment is multiplied by its segment number. The result shows that using the class to manipulate elements in this way changes the values of its underlying array. :::code language="csharp" source="~/snippets/csharp/System/ArraySegmentT/Overview/segmentexample.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.ArraySegment/FS/segmentexample.fs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System/ArraySegmentT/Overview/segmentexample.vb" id="Snippet2"::: - Note, however, that although the structure can be used to divide an array into distinct segments, the segments are not completely independent of one another. The property returns the entire original array, not a copy of the array; therefore, changes made to the array returned by the property are made to the original array. If this is undesirable, you should perform operations on a copy of the array, rather than an object that represents a portion of the array. + Note, however, that although the structure can be used to divide an array into distinct segments, the segments are not completely independent of one another. The property returns the entire original array, not a copy of the array; therefore, changes made to the array returned by the property are made to the original array. If this is undesirable, you should perform operations on a copy of the array, rather than an object that represents a portion of the array. - The method and the equality and inequality operators test for reference equality when they compare two objects. For two objects to be considered equal, they must meet all of the following conditions: + The method and the equality and inequality operators test for reference equality when they compare two objects. For two objects to be considered equal, they must meet all of the following conditions: - Reference the same array. @@ -133,7 +133,7 @@ - Have the same number of elements. - If you want to retrieve an element by its index in the object, you must cast it to an object and retrieve it or modify it by using the property. Note that this is not necessary in F#. The following example retrieves the element in an object that delimits a section of a string array. + If you want to retrieve an element by its index in the object, you must cast it to an object and retrieve it or modify it by using the property. Note that this is not necessary in F#. The following example retrieves the element in an object that delimits a section of a string array. :::code language="csharp" source="~/snippets/csharp/System/ArraySegmentT/Overview/example1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.arraysegment.class/fs/example1.fs" id="Snippet1"::: @@ -142,7 +142,7 @@ ## Examples - The following code example passes an structure to a method. + The following code example passes an structure to a method. :::code language="csharp" source="~/snippets/csharp/System/ArraySegmentT/Overview/arraysegment.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.ArraySegment/FS/arraysegment.fs" id="Snippet1"::: @@ -168,7 +168,7 @@ structure to a method. + The following code example passes an structure to a method. :::code language="csharp" source="~/snippets/csharp/System/ArraySegmentT/Overview/arraysegment.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.ArraySegment/FS/arraysegment.fs" id="Snippet1"::: @@ -224,11 +224,11 @@ that delimits all the elements of `array`. That is, the property of the is 0 and its property is the length of `array`. To create an that delimits only part of an array, use the constructor. + This constructor creates an that delimits all the elements of `array`. That is, the property of the is 0 and its property is the length of `array`. To create an that delimits only part of an array, use the constructor. The original array must be one-dimensional and must have zero-based indexing. - Multiple instances can refer to the same original array and can overlap. + Multiple instances can refer to the same original array and can overlap. ]]> @@ -289,7 +289,7 @@ ## Remarks The original array must be one-dimensional and must have zero-based indexing. - Multiple instances can refer to the same original array and can overlap. + Multiple instances can refer to the same original array and can overlap. ]]> @@ -355,12 +355,12 @@ property returns the original array, not a copy of the array; therefore, changes made through the property are made directly to the original array. + The property returns the original array, not a copy of the array; therefore, changes made through the property are made directly to the original array. ## Examples - The following code example passes an to a method. + The following code example passes an to a method. :::code language="csharp" source="~/snippets/csharp/System/ArraySegmentT/Overview/arraysegment.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.ArraySegment/FS/arraysegment.fs" id="Snippet1"::: @@ -565,7 +565,7 @@ The underlying array of is structure to a method. + The following code example passes an structure to a method. :::code language="csharp" source="~/snippets/csharp/System/ArraySegmentT/Overview/arraysegment.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.ArraySegment/FS/arraysegment.fs" id="Snippet1"::: @@ -691,7 +691,7 @@ The underlying array of is objects are considered to be equal if all the following conditions are met: + Two objects are considered to be equal if all the following conditions are met: - They reference the same array. @@ -762,7 +762,7 @@ The underlying array of is objects are considered to be equal if all the following conditions are met: + Two objects are considered to be equal if all the following conditions are met: - They reference the same array. @@ -957,7 +957,7 @@ The underlying array of is structure to a method. + The following code example passes an structure to a method. :::code language="csharp" source="~/snippets/csharp/System/ArraySegmentT/Overview/arraysegment.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.ArraySegment/FS/arraysegment.fs" id="Snippet1"::: @@ -1036,7 +1036,7 @@ The underlying array of is objects are considered to be equal if all the following conditions are met: + Two objects are considered to be equal if all the following conditions are met: - They reference the same array. @@ -1044,7 +1044,7 @@ The underlying array of is ]]> + The equivalent method for this operator is ]]> @@ -1162,7 +1162,7 @@ The underlying array of is objects are considered to be unequal if they are of the same closed generic type but any of the following conditions is true: + Two objects are considered to be unequal if they are of the same closed generic type but any of the following conditions is true: - They do not reference the same array. @@ -1170,7 +1170,7 @@ The underlying array of is ]]> + The equivalent method for this operator is ]]> @@ -1432,7 +1432,7 @@ The underlying array of is instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -1482,7 +1482,7 @@ The underlying array of is instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -1552,7 +1552,7 @@ The underlying array of is instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -1659,7 +1659,7 @@ The underlying array of is instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -1718,7 +1718,7 @@ The underlying array of is instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -1830,7 +1830,7 @@ The underlying array of is instance is cast to an interface, as the following example shows. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface, as the following example shows. :::code language="csharp" source="~/snippets/csharp/System/ArraySegmentT/Overview/example1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.arraysegment.class/fs/example1.fs" id="Snippet1"::: @@ -1946,7 +1946,7 @@ The underlying array of is instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -2005,7 +2005,7 @@ The underlying array of is instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> diff --git a/xml/System/ArrayTypeMismatchException.xml b/xml/System/ArrayTypeMismatchException.xml index 351fe99b748..6c95c63fb83 100644 --- a/xml/System/ArrayTypeMismatchException.xml +++ b/xml/System/ArrayTypeMismatchException.xml @@ -164,8 +164,8 @@ |Property|Value| |--------------|-----------| -||A null reference (`Nothing` in Visual Basic).| -||The localized error message string.| +||A null reference (`Nothing` in Visual Basic).| +||The localized error message string.| @@ -234,8 +234,8 @@ |Property|Value| |--------------|-----------| -||A null reference (`Nothing` in Visual Basic).| -||The error message string.| +||A null reference (`Nothing` in Visual Basic).| +||The error message string.| @@ -372,13 +372,13 @@ |Property|Value| |--------------|-----------| -||The inner exception reference.| -||The error message string.| +||The inner exception reference.| +||The error message string.| ## Examples - The following code example demonstrates the constructor of the class. It contains a function that takes two arrays as arguments and checks whether the two arrays are of the same type. If the arrays are of different types, a new is thrown and then caught in the calling method. + The following code example demonstrates the constructor of the class. It contains a function that takes two arrays as arguments and checks whether the two arrays are of the same type. If the arrays are of different types, a new is thrown and then caught in the calling method. :::code language="csharp" source="~/snippets/csharp/System/ArrayTypeMismatchException/.ctor/arraytypemismatch_constructor3.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/ArrayTypeMisMatch_Constructor3/FS/arraytypemismatch_constructor3.fs" id="Snippet1"::: diff --git a/xml/System/Attribute.xml b/xml/System/Attribute.xml index 4cad2b20342..c78da8b74a2 100644 --- a/xml/System/Attribute.xml +++ b/xml/System/Attribute.xml @@ -236,12 +236,12 @@ ## Remarks -The method uses reflection to retrieve field information for the current instance and the `obj` argument. It then compares field values. +The method uses reflection to retrieve field information for the current instance and the `obj` argument. It then compares field values. -When implementing your own class derived from , you can override the method. Because it uses reflection, we recommend that you do so. However, your override should perform a standard test for reference equality (the two arguments represent the same object instance) or value equality (the two arguments are of the same type and have identical field values). If you want to perform a custom comparison to determine whether two attributes objects are equal, you can override the method. +When implementing your own class derived from , you can override the method. Because it uses reflection, we recommend that you do so. However, your override should perform a standard test for reference equality (the two arguments represent the same object instance) or value equality (the two arguments are of the same type and have identical field values). If you want to perform a custom comparison to determine whether two attributes objects are equal, you can override the method. ## Examples - The following example defines two custom parameter classes, then creates several objects of each class and uses the method to compare them. + The following example defines two custom parameter classes, then creates several objects of each class and uses the method to compare them. :::code language="csharp" source="~/snippets/csharp/System/Attribute/Equals/equals.cs" interactive="try-dotnet"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Attribute.Equals/FS/equals.fs"::: @@ -317,7 +317,7 @@ When implementing your own class derived from , you can o method if you expect more than one value to be returned, or will be thrown. + Use the method if you expect more than one value to be returned, or will be thrown. > [!NOTE] > Starting with the .NET Framework version 2.0, this method returns security attributes if the attributes are stored in the new metadata format. Assemblies compiled with version 2.0 or later use the new format. Dynamic assemblies and assemblies compiled with earlier versions of the .NET Framework use the old XML format. See [Emitting Declarative Security Attributes](/previous-versions/dotnet/netframework-4.0/ms404249(v=vs.100)). @@ -325,7 +325,7 @@ When implementing your own class derived from , you can o ## Examples - The following code example illustrates the use of the method taking an as a parameter. + The following code example illustrates the use of the method taking an as a parameter. :::code language="csharp" source="~/snippets/csharp/System/Attribute/GetCustomAttribute/id1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/IsDefined/FS/id1.fs" id="Snippet1"::: @@ -396,7 +396,7 @@ When implementing your own class derived from , you can o . + A match is determined in the same way described in the Return Value section of . > [!NOTE] > Starting with the .NET Framework version 2.0, this method returns security attributes on types, methods, and constructors if the attributes are stored in the new metadata format. Assemblies compiled with version 2.0 or later use the new format. Dynamic assemblies and assemblies compiled with earlier versions of the .NET Framework use the old XML format. See [Emitting Declarative Security Attributes](/previous-versions/dotnet/netframework-4.0/ms404249(v=vs.100)). @@ -404,7 +404,7 @@ When implementing your own class derived from , you can o ## Examples - The following code example illustrates the use of the method taking a as a parameter. + The following code example illustrates the use of the method taking a as a parameter. :::code language="csharp" source="~/snippets/csharp/System/Attribute/GetCustomAttribute/id4.cs" id="Snippet4"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/IsDefined/FS/id4.fs" id="Snippet4"::: @@ -478,7 +478,7 @@ When implementing your own class derived from , you can o method taking a as a parameter. + The following code example illustrates the use of the method taking a as a parameter. :::code language="csharp" source="~/snippets/csharp/System/Attribute/GetCustomAttribute/id2.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/IsDefined/FS/id2.fs" id="Snippet2"::: @@ -554,7 +554,7 @@ When implementing your own class derived from , you can o ## Examples - The following code example defines a custom parameter class and applies the custom attribute to a method in a derived class and the base of the derived class. The example shows the use of the method to return the attributes. + The following code example defines a custom parameter class and applies the custom attribute to a method in a derived class and the base of the derived class. The example shows the use of the method to return the attributes. :::code language="csharp" source="~/snippets/csharp/System/Attribute/.ctor/getcustattrparam.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Attribute.GetCustomAttribute/FS/getcustattrparam.fs" id="Snippet1"::: @@ -635,7 +635,7 @@ When implementing your own class derived from , you can o ## Examples - The following code example illustrates the use of the method taking an as a parameter. + The following code example illustrates the use of the method taking an as a parameter. :::code language="csharp" source="~/snippets/csharp/System/Attribute/GetCustomAttribute/id1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/IsDefined/FS/id1.fs" id="Snippet1"::: @@ -715,7 +715,7 @@ When implementing your own class derived from , you can o ## Examples - The following code example illustrates the use of the method taking a as a parameter. + The following code example illustrates the use of the method taking a as a parameter. :::code language="csharp" source="~/snippets/csharp/System/Attribute/GetCustomAttribute/id4.cs" id="Snippet4"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/IsDefined/FS/id4.fs" id="Snippet4"::: @@ -791,7 +791,7 @@ When implementing your own class derived from , you can o method taking a as a parameter. + The following code example illustrates the use of the method taking a as a parameter. :::code language="csharp" source="~/snippets/csharp/System/Attribute/GetCustomAttribute/id2.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/IsDefined/FS/id2.fs" id="Snippet2"::: @@ -869,7 +869,7 @@ When implementing your own class derived from , you can o ## Examples - The following code example defines a custom parameter class and applies the custom attribute to a method in a derived class and the base of the derived class. The example shows the use of the method to return the attributes. + The following code example defines a custom parameter class and applies the custom attribute to a method in a derived class and the base of the derived class. The example shows the use of the method to return the attributes. :::code language="csharp" source="~/snippets/csharp/System/Attribute/.ctor/getcustattrprminh.cs" id="Snippet3"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Attribute.GetCustomAttribute/FS/getcustattrprminh.fs" id="Snippet3"::: @@ -1016,7 +1016,7 @@ When implementing your own class derived from , you can o ## Examples - The following code example demonstrates the use of , taking a as a parameter. + The following code example demonstrates the use of , taking a as a parameter. :::code language="csharp" source="~/snippets/csharp/System/Attribute/GetCustomAttributes/ca4.cs" id="Snippet4"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/GetCustomAttributes/FS/ca4.fs" id="Snippet4"::: @@ -1078,7 +1078,7 @@ When implementing your own class derived from , you can o , taking a as a parameter. + The following code example demonstrates the use of , taking a as a parameter. :::code language="csharp" source="~/snippets/csharp/System/Attribute/GetCustomAttributes/ca2.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/GetCustomAttributes/FS/ca2.fs" id="Snippet2"::: @@ -1142,7 +1142,7 @@ When implementing your own class derived from , you can o ## Examples - The following code example demonstrates the use of , taking a as a parameter. + The following code example demonstrates the use of , taking a as a parameter. :::code language="csharp" source="~/snippets/csharp/System/Attribute/GetCustomAttributes/ca5.cs" id="Snippet5"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/GetCustomAttributes/FS/ca5.fs" id="Snippet5"::: @@ -1204,7 +1204,7 @@ When implementing your own class derived from , you can o , taking an as a parameter. + The following code example demonstrates the use of , taking an as a parameter. :::code language="csharp" source="~/snippets/csharp/System/Attribute/GetCustomAttributes/ca1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/GetCustomAttributes/FS/ca1.fs" id="Snippet1"::: @@ -1272,7 +1272,7 @@ When implementing your own class derived from , you can o ## Examples - The following code example demonstrates the use of , taking an as a parameter. + The following code example demonstrates the use of , taking an as a parameter. :::code language="csharp" source="~/snippets/csharp/System/Attribute/GetCustomAttributes/ca1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/GetCustomAttributes/FS/ca1.fs" id="Snippet1"::: @@ -1343,7 +1343,7 @@ When implementing your own class derived from , you can o ## Examples - The following code example demonstrates the use of , taking a as a parameter. + The following code example demonstrates the use of , taking a as a parameter. :::code language="csharp" source="~/snippets/csharp/System/Attribute/GetCustomAttributes/ca4.cs" id="Snippet4"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/GetCustomAttributes/FS/ca4.fs" id="Snippet4"::: @@ -1412,7 +1412,7 @@ When implementing your own class derived from , you can o ## Examples - The following code example demonstrates the use of , taking a as a parameter. + The following code example demonstrates the use of , taking a as a parameter. :::code language="csharp" source="~/snippets/csharp/System/Attribute/GetCustomAttributes/ca2.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/GetCustomAttributes/FS/ca2.fs" id="Snippet2"::: @@ -1473,7 +1473,7 @@ When implementing your own class derived from , you can o , taking a as a parameter. + The following code example demonstrates the use of , taking a as a parameter. :::code language="csharp" source="~/snippets/csharp/System/Attribute/GetCustomAttributes/ca2.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/GetCustomAttributes/FS/ca2.fs" id="Snippet2"::: @@ -1547,7 +1547,7 @@ When implementing your own class derived from , you can o ## Examples - The following code example demonstrates the use of , taking a as a parameter. + The following code example demonstrates the use of , taking a as a parameter. :::code language="csharp" source="~/snippets/csharp/System/Attribute/GetCustomAttributes/ca5.cs" id="Snippet5"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/GetCustomAttributes/FS/ca5.fs" id="Snippet5"::: @@ -1615,7 +1615,7 @@ When implementing your own class derived from , you can o ## Examples - The following code example demonstrates the use of , taking a as a parameter. + The following code example demonstrates the use of , taking a as a parameter. :::code language="csharp" source="~/snippets/csharp/System/Attribute/GetCustomAttributes/ca5.cs" id="Snippet5"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/GetCustomAttributes/FS/ca5.fs" id="Snippet5"::: @@ -1688,7 +1688,7 @@ When implementing your own class derived from , you can o ## Examples - The following code example demonstrates the use of , taking an as a parameter. + The following code example demonstrates the use of , taking an as a parameter. :::code language="csharp" source="~/snippets/csharp/System/Attribute/GetCustomAttributes/ca1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/GetCustomAttributes/FS/ca1.fs" id="Snippet1"::: @@ -1766,7 +1766,7 @@ When implementing your own class derived from , you can o ## Examples - The following code example demonstrates the use of , taking a as a parameter. + The following code example demonstrates the use of , taking a as a parameter. :::code language="csharp" source="~/snippets/csharp/System/Attribute/GetCustomAttributes/ca4.cs" id="Snippet4"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/GetCustomAttributes/FS/ca4.fs" id="Snippet4"::: @@ -1839,7 +1839,7 @@ When implementing your own class derived from , you can o ## Examples - The following code example demonstrates the use of , taking a as a parameter. + The following code example demonstrates the use of , taking a as a parameter. :::code language="csharp" source="~/snippets/csharp/System/Attribute/GetCustomAttributes/ca2.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/GetCustomAttributes/FS/ca2.fs" id="Snippet2"::: @@ -1915,7 +1915,7 @@ When implementing your own class derived from , you can o ## Examples - The following code example demonstrates the use of , taking a as a parameter. + The following code example demonstrates the use of , taking a as a parameter. :::code language="csharp" source="~/snippets/csharp/System/Attribute/GetCustomAttributes/ca5.cs" id="Snippet5"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/GetCustomAttributes/FS/ca5.fs" id="Snippet5"::: @@ -1996,7 +1996,7 @@ When implementing your own class derived from , you can o ## Examples - The following code example demonstrates the use of , taking a as a parameter. + The following code example demonstrates the use of , taking a as a parameter. :::code language="csharp" source="~/snippets/csharp/System/Attribute/GetCustomAttributes/ca4.cs" id="Snippet4"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/GetCustomAttributes/FS/ca4.fs" id="Snippet4"::: @@ -2067,7 +2067,7 @@ When implementing your own class derived from , you can o in the context of . + The following code example illustrates the use of in the context of . :::code language="csharp" source="~/snippets/csharp/System/Attribute/GetHashCode/hashcode.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/GetHashCode/FS/hashcode.fs" id="Snippet1"::: @@ -2129,7 +2129,7 @@ When implementing your own class derived from , you can o ## Examples - The following code example illustrates the use of . + The following code example illustrates the use of . :::code language="csharp" source="~/snippets/csharp/System/Attribute/IsDefaultAttribute/defattr.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/IsDefaultAttribute/FS/defattr.fs" id="Snippet1"::: @@ -2206,7 +2206,7 @@ When implementing your own class derived from , you can o ## Examples - The following code example illustrates the use of , taking an as a parameter. + The following code example illustrates the use of , taking an as a parameter. :::code language="csharp" source="~/snippets/csharp/System/Attribute/GetCustomAttribute/id1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/IsDefined/FS/id1.fs" id="Snippet1"::: @@ -2278,7 +2278,7 @@ When implementing your own class derived from , you can o ## Examples - The following code example illustrates the use of , taking a as a parameter. + The following code example illustrates the use of , taking a as a parameter. :::code language="csharp" source="~/snippets/csharp/System/Attribute/GetCustomAttribute/id4.cs" id="Snippet4"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/IsDefined/FS/id4.fs" id="Snippet4"::: @@ -2349,7 +2349,7 @@ When implementing your own class derived from , you can o ## Examples - The following code example illustrates the use of , taking a as a parameter. + The following code example illustrates the use of , taking a as a parameter. :::code language="csharp" source="~/snippets/csharp/System/Attribute/GetCustomAttribute/id2.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/IsDefined/FS/id2.fs" id="Snippet2"::: @@ -2418,7 +2418,7 @@ When implementing your own class derived from , you can o ## Examples - The following code example illustrates the use of , taking a as a parameter. + The following code example illustrates the use of , taking a as a parameter. :::code language="csharp" source="~/snippets/csharp/System/Attribute/GetCustomAttribute/id5.cs" id="Snippet5"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/IsDefined/FS/id5.fs" id="Snippet5"::: @@ -2491,7 +2491,7 @@ When implementing your own class derived from , you can o ## Examples - The following code example illustrates the use of , taking an as a parameter. + The following code example illustrates the use of , taking an as a parameter. :::code language="csharp" source="~/snippets/csharp/System/Attribute/GetCustomAttribute/id1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/IsDefined/FS/id1.fs" id="Snippet1"::: @@ -2564,7 +2564,7 @@ When implementing your own class derived from , you can o ## Examples - The following code example illustrates the use of , taking a as a parameter. + The following code example illustrates the use of , taking a as a parameter. :::code language="csharp" source="~/snippets/csharp/System/Attribute/GetCustomAttribute/id4.cs" id="Snippet4"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/IsDefined/FS/id4.fs" id="Snippet4"::: @@ -2643,7 +2643,7 @@ When implementing your own class derived from , you can o ## Examples - The following code example illustrates the use of , taking a as a parameter. + The following code example illustrates the use of , taking a as a parameter. :::code language="csharp" source="~/snippets/csharp/System/Attribute/GetCustomAttribute/id2.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/IsDefined/FS/id2.fs" id="Snippet2"::: @@ -2709,7 +2709,7 @@ When implementing your own class derived from , you can o , taking a as a parameter. + The following code example illustrates the use of , taking a as a parameter. :::code language="csharp" source="~/snippets/csharp/System/Attribute/GetCustomAttribute/id5.cs" id="Snippet5"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/IsDefined/FS/id5.fs" id="Snippet5"::: @@ -2774,17 +2774,17 @@ When implementing your own class derived from , you can o equals another. Its default implementation is the same as , which determines whether two attributes are of the same type and have the same field values. + This method determines if one equals another. Its default implementation is the same as , which determines whether two attributes are of the same type and have the same field values. - In general, the method is intended to perform a standard test for reference or value equality. You can override the method when you want to perform a custom comparison for equality that is based on some criteria other than that two attribute instances are of the same type and have identical values. For example, you can override the method to compare attributes in the following scenarios: + In general, the method is intended to perform a standard test for reference or value equality. You can override the method when you want to perform a custom comparison for equality that is based on some criteria other than that two attribute instances are of the same type and have identical values. For example, you can override the method to compare attributes in the following scenarios: - - An attribute includes a bit field, and you consider two attribute instances equal if a particular bit is set. For example, a `NumericDisplay` attribute might include a bit field that indicates what numeric formats (such as binary, octal, decimal, and hexadecimal) a client supports. The overridden method might consider two instances equal if they support the same numeric format. + - An attribute includes a bit field, and you consider two attribute instances equal if a particular bit is set. For example, a `NumericDisplay` attribute might include a bit field that indicates what numeric formats (such as binary, octal, decimal, and hexadecimal) a client supports. The overridden method might consider two instances equal if they support the same numeric format. - - An attribute includes multiple fields that contain the same kind of information, or it contains an array in which values can be in any order. For example, an `Author` attribute might include multiple fields for author names. The overridden method might consider two instances equal if they have the same authors regardless of whether each field is equal to the corresponding field. + - An attribute includes multiple fields that contain the same kind of information, or it contains an array in which values can be in any order. For example, an `Author` attribute might include multiple fields for author names. The overridden method might consider two instances equal if they have the same authors regardless of whether each field is equal to the corresponding field. ## Example - The following example illustrates the use of to create a custom comparison method for attribute values. If defines an `AuthorsAttribute` that internally contains a `List` that stores authors' names. Because the names can occur in any order in the list, it overrides the method to compare author names regardless of their position in the list. Note the method, which performs a test for value equality, returns different results from the method. + The following example illustrates the use of to create a custom comparison method for attribute values. If defines an `AuthorsAttribute` that internally contains a `List` that stores authors' names. Because the names can occur in any order in the list, it overrides the method to compare author names regardless of their position in the list. Note the method, which performs a test for value equality, returns different results from the method. :::code language="csharp" source="~/snippets/csharp/System/Attribute/Match/match.cs" interactive="try-dotnet"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/Match/FS/match.fs"::: diff --git a/xml/System/AttributeUsageAttribute.xml b/xml/System/AttributeUsageAttribute.xml index 2d5c1f04791..567b2a5ed7e 100644 --- a/xml/System/AttributeUsageAttribute.xml +++ b/xml/System/AttributeUsageAttribute.xml @@ -75,15 +75,15 @@ The three properties of are set by defining the following parameters: -- +- This positional parameter specifies the program elements that the indicated attribute can be placed on. The set of all possible elements that you can place an attribute on is listed in the enumeration. You can combine several values using a bitwise OR operation to get the desired combination of valid program elements. -- +- This named parameter specifies whether the indicated attribute can be specified more than once for a given program element. -- +- This named parameter specifies whether the indicated attribute can be inherited by derived classes and overriding members. @@ -145,7 +145,7 @@ ## Remarks You can combine several values using a bitwise OR operation to get the desired combination of valid program elements. - For default property values, see the , , and properties. + For default property values, see the , , and properties. ## Examples The definition of the DispId attribute illustrates the use of a bitwise OR operation to combine several values. diff --git a/xml/System/BadImageFormatException.xml b/xml/System/BadImageFormatException.xml index 86a6b6a9dbb..91fb5808b34 100644 --- a/xml/System/BadImageFormatException.xml +++ b/xml/System/BadImageFormatException.xml @@ -81,7 +81,7 @@ To address this exception, use the version of the tool that corresponds to the version of .NET that was used to develop the assembly. This may require modifying the `Path` environment variable or providing a fully qualified path to the correct executable. -- You are trying to load an unmanaged dynamic link library or executable (such as a Windows system DLL) as if it were a .NET assembly. The following example illustrates this by using the method to load Kernel32.dll. +- You are trying to load an unmanaged dynamic link library or executable (such as a Windows system DLL) as if it were a .NET assembly. The following example illustrates this by using the method to load Kernel32.dll. :::code language="csharp" source="~/snippets/csharp/System/BadImageFormatException/Overview/condition1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.badimageformatexception.class/fs/condition1.fs" id="Snippet1"::: @@ -92,7 +92,7 @@ - You are trying to load a reference assembly in a context other than the reflection-only context. You can address this issue in either of two ways: - You can load the implementation assembly rather than the reference assembly. - - You can load the reference assembly in the reflection-only context by calling the method. + - You can load the reference assembly in the reflection-only context by calling the method. - A DLL or executable is loaded as a 64-bit assembly, but it contains 32-bit features or resources. For example, it relies on COM interop or calls methods in a 32-bit dynamic link library. @@ -104,7 +104,7 @@ :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.badimageformatexception.class/fs/stringlib.fs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System/BadImageFormatException/Overview/stringlib.vb" id="Snippet2"::: - The following example uses reflection to load an assembly named StringLib.dll. If the source code is compiled with a .NET Framework 1.1 compiler, a is thrown by the method. + The following example uses reflection to load an assembly named StringLib.dll. If the source code is compiled with a .NET Framework 1.1 compiler, a is thrown by the method. :::code language="csharp" source="~/snippets/csharp/System/BadImageFormatException/Overview/loadstringlib.cs" id="Snippet3"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.badimageformatexception.class/fs/loadstringlib.fs" id="Snippet3"::: @@ -192,8 +192,8 @@ |Property|Value| |--------------|-----------| -||A null reference (`Nothing` in Visual Basic).| -||The localized error message string.| +||A null reference (`Nothing` in Visual Basic).| +||The localized error message string.| ]]> @@ -253,8 +253,8 @@ |Property|Value| |--------------|-----------| -||A null reference (`Nothing` in Visual Basic).| -||The error message string.| +||A null reference (`Nothing` in Visual Basic).| +||The error message string.| ]]> @@ -381,8 +381,8 @@ |Property|Value| |--------------|-----------| -||The inner exception reference.| -||The error message string.| +||The inner exception reference.| +||The error message string.| ]]> @@ -444,8 +444,8 @@ |Property|Value| |--------------|-----------| -||The full name of the file with the invalid image.| -||The error message string.| +||The full name of the file with the invalid image.| +||The error message string.| ]]> @@ -509,9 +509,9 @@ |Property|Value| |--------------|-----------| -||The inner exception reference.| -||The full name of the file with the invalid image.| -||The error message string.| +||The inner exception reference.| +||The full name of the file with the invalid image.| +||The error message string.| ]]> @@ -799,7 +799,7 @@ property, the result of calling `ToString` on the inner exception, the value of the property, and the result of calling . If any of these members is a null reference (`Nothing` in Visual Basic), its value is not included in the returned string. + The string representation returned by this method includes the name of the exception, the value of the property, the result of calling `ToString` on the inner exception, the value of the property, and the result of calling . If any of these members is a null reference (`Nothing` in Visual Basic), its value is not included in the returned string. ]]> diff --git a/xml/System/Base64FormattingOptions.xml b/xml/System/Base64FormattingOptions.xml index 9678282e69f..e2b8f33c5f7 100644 --- a/xml/System/Base64FormattingOptions.xml +++ b/xml/System/Base64FormattingOptions.xml @@ -60,24 +60,24 @@ Specifies whether relevant and methods insert line breaks in their output. - and methods convert the value of an array of 8-bit unsigned integers to an equivalent string representation that consists of base 64 digits. The string representation can contain one or more line breaks, where a line break is defined as a carriage return character (U+000D) followed by a line feed character (U+000A). Because line breaks are considered white-space characters in a base-64 encoding, they are ignored when converting a base-64 encoded string back to a byte array. The line breaks are simply convenient when displaying the encoded string to a control or a device such as a console window. - - The `None` and `InsertLineBreaks` values are mutually exclusive. Therefore, although the `Base64FormattingOptions` enumeration is marked with the attribute, it makes no sense to perform a bitwise combination of these two values. - - - -## Examples - The following example calls the method with a `InsertLineBreaks` argument to insert line breaks in the string that is produced by encoding a 100-element byte array: - + and methods convert the value of an array of 8-bit unsigned integers to an equivalent string representation that consists of base 64 digits. The string representation can contain one or more line breaks, where a line break is defined as a carriage return character (U+000D) followed by a line feed character (U+000A). Because line breaks are considered white-space characters in a base-64 encoding, they are ignored when converting a base-64 encoded string back to a byte array. The line breaks are simply convenient when displaying the encoded string to a control or a device such as a console window. + + The `None` and `InsertLineBreaks` values are mutually exclusive. Therefore, although the `Base64FormattingOptions` enumeration is marked with the attribute, it makes no sense to perform a bitwise combination of these two values. + + + +## Examples + The following example calls the method with a `InsertLineBreaks` argument to insert line breaks in the string that is produced by encoding a 100-element byte array: + :::code language="csharp" source="~/snippets/csharp/System/Base64FormattingOptions/Overview/ToBase64String3.cs" id="Snippet3"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/System.Convert.ToBase64String/fs/ToBase64String3.fs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/System/Base64FormattingOptions/Overview/ToBase64String3.vb" id="Snippet3"::: - - As the output from the example shows, the succeeds in restoring the original byte array; the line break characters are ignored during the conversion. - + :::code language="vb" source="~/snippets/visualbasic/System/Base64FormattingOptions/Overview/ToBase64String3.vb" id="Snippet3"::: + + As the output from the example shows, the succeeds in restoring the original byte array; the line break characters are ignored during the conversion. + ]]> diff --git a/xml/System/BitConverter.xml b/xml/System/BitConverter.xml index 80dcf080c58..78a1ceecd2d 100644 --- a/xml/System/BitConverter.xml +++ b/xml/System/BitConverter.xml @@ -77,25 +77,25 @@ | Type | To byte conversion | From byte conversion | |-----------------------|--------------------------------------------------------|-----------------------------------------| -| | | | -| | | | -| |
-or-

-or-
|
-or-

-or-
| -| |
-or-

-or-
|
-or-

-or-
| -| | | | -| | | | -| | | | -| |
-or-

-or-
|
-or-

-or-
| -| | | | -| | | | -| | | | +| | | | +| | | | +| |
-or-

-or-
|
-or-

-or-
| +| |
-or-

-or-
|
-or-

-or-
| +| | | | +| | | | +| | | | +| |
-or-

-or-
|
-or-

-or-
| +| | | | +| | | | +| | | | - If you use methods to round-trip data, make sure that the overload and the `To`*Type* method specify the same type. As the following example illustrates, restoring an array that represents a signed integer by calling the method can result in a value that is different from the original. For more information, see [Working with Signed Non-Decimal and Bitwise Values](/archive/blogs/bclteam/working-with-signed-non-decimal-and-bitwise-values-ron-petrusha). + If you use methods to round-trip data, make sure that the overload and the `To`*Type* method specify the same type. As the following example illustrates, restoring an array that represents a signed integer by calling the method can result in a value that is different from the original. For more information, see [Working with Signed Non-Decimal and Bitwise Values](/archive/blogs/bclteam/working-with-signed-non-decimal-and-bitwise-values-ron-petrusha). :::code language="csharp" source="~/snippets/csharp/System/BitConverter/Overview/example1.cs" id="Snippet3"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.BitConverter.Class/FS/example1.fs" id="Snippet3"::: :::code language="vb" source="~/snippets/visualbasic/System/BitConverter/Overview/example1.vb" id="Snippet3"::: - The order of bytes in the array returned by the method overloads (as well as the order of bits in the integer returned by the method) depends on whether the computer architecture is little-endian or big-endian. Similarly, the order of bytes in the array and returned by the `To`*IntegerValue* methods and the method depends on whether the computer architecture is little-endian or big-endian. The endianness of an architecture is indicated by the property, which returns `true` on little-endian systems and `false` on big-endian systems. On little-endian systems, lower-order bytes precede higher-order bytes. On big-endian system, higher-order bytes precede lower-order bytes. The following table illustrates the difference in the byte arrays that result from passing the integer 1,234,567,890 (0x499602D2) to the method. The bytes are listed in order from the byte at index 0 to the byte at index 3. + The order of bytes in the array returned by the method overloads (as well as the order of bits in the integer returned by the method) depends on whether the computer architecture is little-endian or big-endian. Similarly, the order of bytes in the array and returned by the `To`*IntegerValue* methods and the method depends on whether the computer architecture is little-endian or big-endian. The endianness of an architecture is indicated by the property, which returns `true` on little-endian systems and `false` on big-endian systems. On little-endian systems, lower-order bytes precede higher-order bytes. On big-endian system, higher-order bytes precede lower-order bytes. The following table illustrates the difference in the byte arrays that result from passing the integer 1,234,567,890 (0x499602D2) to the method. The bytes are listed in order from the byte at index 0 to the byte at index 3. | Architecture | Byte array | |---------------|-------------| @@ -112,7 +112,7 @@ :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.BitConverter.Class/FS/networkorder1.fs" id="Snippet4"::: :::code language="vb" source="~/snippets/visualbasic/System/BitConverter/Overview/networkorder1.vb" id="Snippet4"::: -- If systems sending and receiving data can have different endianness and the data to be transmitted consists of signed integers, call the method to convert the data to network byte order and the method to convert it to the order required by the recipient. +- If systems sending and receiving data can have different endianness and the data to be transmitted consists of signed integers, call the method to convert the data to network byte order and the method to convert it to the order required by the recipient. ## Examples The following code example illustrates the use of several class methods. @@ -259,7 +259,7 @@ method depends on whether the computer architecture is little-endian or big-endian. + The order of bits in the integer returned by the method depends on whether the computer architecture is little-endian or big-endian. ## Examples The following code example converts the bit patterns of several values to values with the `DoubleToInt64Bits` method. @@ -383,7 +383,7 @@ value by calling the method. + You can convert a byte array back to a value by calling the method. ## Examples The following example converts the bit patterns of values to arrays with the `GetBytes` method. @@ -450,7 +450,7 @@ method depends on whether the computer architecture is little-endian or big-endian. + The order of bytes in the array returned by the method depends on whether the computer architecture is little-endian or big-endian. ## Examples The following code example converts the bit patterns of values (Unicode characters) to arrays with the `GetBytes` method. @@ -523,7 +523,7 @@ method depends on whether the computer architecture is little-endian or big-endian. + The order of bytes in the array returned by the method depends on whether the computer architecture is little-endian or big-endian. ## Examples The following code example converts the bit patterns of values to arrays with the `GetBytes` method. @@ -671,7 +671,7 @@ method depends on whether the computer architecture is little-endian or big-endian. + The order of bytes in the array returned by the method depends on whether the computer architecture is little-endian or big-endian. ## Examples The following code example converts the bit patterns of values to arrays with the `GetBytes` method. @@ -744,7 +744,7 @@ method depends on whether the computer architecture is little-endian or big-endian. + The order of bytes in the array returned by the method depends on whether the computer architecture is little-endian or big-endian. ## Examples The following code example converts the bit patterns of values to arrays with the `GetBytes` method. @@ -817,10 +817,10 @@ method depends on whether the computer architecture is little-endian or big-endian. + The order of bytes in the array returned by the method depends on whether the computer architecture is little-endian or big-endian. ## Examples - The following example calls the method to convert each element in an array to a arrays. + The following example calls the method to convert each element in an array to a arrays. :::code language="csharp" source="~/snippets/csharp/System/BitConverter/GetBytes/bytesint64.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.BitConverter.GetBytes.SInts/FS/bytesint64.fs" id="Snippet1"::: @@ -924,7 +924,7 @@ method depends on whether the computer architecture is little-endian or big-endian. + The order of bytes in the array returned by the method depends on whether the computer architecture is little-endian or big-endian. ## Examples The following code example converts the bit patterns of values to arrays with the `GetBytes` method. @@ -1039,7 +1039,7 @@ method depends on whether the computer architecture is little-endian or big-endian. + The order of bytes in the array returned by the method depends on whether the computer architecture is little-endian or big-endian. ## Examples The following code example converts the bit patterns of values to arrays with the `GetBytes` method. @@ -1112,7 +1112,7 @@ method depends on whether the computer architecture is little-endian or big-endian. + The order of bytes in the array returned by the method depends on whether the computer architecture is little-endian or big-endian. ## Examples The following code example converts the bit patterns of values to arrays with the `GetBytes` method. @@ -1185,7 +1185,7 @@ method depends on whether the computer architecture is little-endian or big-endian. + The order of bytes in the array returned by the method depends on whether the computer architecture is little-endian or big-endian. ## Examples The following code example converts the bit patterns of values to arrays with the `GetBytes` method. @@ -1459,7 +1459,7 @@ method. + Typically, `value` is an integer that is returned by the method. ## Examples The following code example converts the bit patterns of several values to values with the `Int64BitsToDouble` method. @@ -1524,7 +1524,7 @@ Different computer architectures store data using different byte orders. "Big-endian" means the most significant byte is on the left end of a word. "Little-endian" means the most significant byte is on the right end of a word. > [!NOTE] -> You can convert from network byte order to the byte order of the host computer without retrieving the value of the field by passing a 16-bit, 32-bit, or 64 bit integer to the method. +> You can convert from network byte order to the byte order of the host computer without retrieving the value of the field by passing a 16-bit, 32-bit, or 64 bit integer to the method. ## Examples The following code example illustrates the use of the `IsLittleEndian` field. @@ -1913,7 +1913,7 @@ method converts the bytes from index `startIndex` to `startIndex` + 1 to a value. The order of bytes in the array must reflect the endianness of the computer system's architecture. For more information, see the Remarks section of the class topic. + The method converts the bytes from index `startIndex` to `startIndex` + 1 to a value. The order of bytes in the array must reflect the endianness of the computer system's architecture. For more information, see the Remarks section of the class topic. ## Examples The following code example converts elements of arrays to values (Unicode characters) with the `ToChar` method. @@ -2038,7 +2038,7 @@ method converts the bytes from index `startIndex` to `startIndex` + 7 to a value. The order of bytes in the array must reflect the endianness of the computer system's architecture. For more information, see the Remarks section of the class topic. + The method converts the bytes from index `startIndex` to `startIndex` + 7 to a value. The order of bytes in the array must reflect the endianness of the computer system's architecture. For more information, see the Remarks section of the class topic. ## Examples The following code example converts elements of arrays to values with the `ToDouble` method. @@ -2332,7 +2332,7 @@ method converts the bytes from index `startIndex` to `startIndex` + 1 to an value. The order of bytes in the array must reflect the endianness of the computer system's architecture. For more information, see the Remarks section of the class topic. + The method converts the bytes from index `startIndex` to `startIndex` + 1 to an value. The order of bytes in the array must reflect the endianness of the computer system's architecture. For more information, see the Remarks section of the class topic. ## Examples The following code example converts elements of arrays to values with the `ToInt16` method. @@ -2457,10 +2457,10 @@ method converts the bytes from index `startIndex` to `startIndex` + 3 to an value. The order of bytes in the array must reflect the endianness of the computer system's architecture. For more information, see the Remarks section of . + The method converts the bytes from index `startIndex` to `startIndex` + 3 to an value. The order of bytes in the array must reflect the endianness of the computer system's architecture. For more information, see the Remarks section of . ## Examples - The following example uses the method to create values from a four-byte array and from the upper four bytes of an eight-byte array. It also uses the and methods to round-trip an value. + The following example uses the method to create values from a four-byte array and from the upper four bytes of an eight-byte array. It also uses the and methods to round-trip an value. :::code language="csharp" source="~/snippets/csharp/System/BitConverter/ToInt32/toint32.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.bitconverter.toint32/fs/toint32.fs" id="Snippet1"::: @@ -2582,7 +2582,7 @@ method converts the bytes from index `startIndex` to `startIndex` + 7 to a value. The order of bytes in the array must reflect the endianness of the computer system's architecture. For more information, see the Remarks section of the class topic. + The method converts the bytes from index `startIndex` to `startIndex` + 7 to a value. The order of bytes in the array must reflect the endianness of the computer system's architecture. For more information, see the Remarks section of the class topic. ## Examples The following code example converts elements of arrays to values with the `ToInt64` method. @@ -2707,7 +2707,7 @@ method converts the bytes from index `startIndex` to `startIndex` + 3 to a value. The order of bytes in the array must reflect the endianness of the computer system's architecture. For more information, see the Remarks section of . + The method converts the bytes from index `startIndex` to `startIndex` + 3 to a value. The order of bytes in the array must reflect the endianness of the computer system's architecture. For more information, see the Remarks section of . ## Examples The following code example converts elements of arrays to values with the `ToSingle` method. @@ -2939,7 +2939,7 @@ The `length` elements from array position `startIndex` are converted. If `length` equals zero, the method returns . ## Examples - The following example uses the method to convert part of a byte array, starting at the specified `startIndex` and with the specified `length`, to a string. + The following example uses the method to convert part of a byte array, starting at the specified `startIndex` and with the specified `length`, to a string. :::code language="csharp" source="~/snippets/csharp/System/BitConverter/ToString/batostringii.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.BitConverter.ToString/FS/batostringii.fs" id="Snippet2"::: @@ -3163,7 +3163,7 @@ method converts the bytes from index `startIndex` to `startIndex` + 1 to a value. The order of bytes in the array must reflect the endianness of the computer system's architecture. For more information, see the Remarks section of the class topic. + The method converts the bytes from index `startIndex` to `startIndex` + 1 to a value. The order of bytes in the array must reflect the endianness of the computer system's architecture. For more information, see the Remarks section of the class topic. ## Examples The following code example converts elements of arrays to values with the `ToUInt16` method. @@ -3294,7 +3294,7 @@ method converts the bytes from index `startIndex` to `startIndex` + 3 to a value. The order of bytes in the array must reflect the endianness of the computer system's architecture. For more information, see the Remarks section of the class topic. + The method converts the bytes from index `startIndex` to `startIndex` + 3 to a value. The order of bytes in the array must reflect the endianness of the computer system's architecture. For more information, see the Remarks section of the class topic. ## Examples The following code example converts elements of arrays to values with the `ToUInt32` method. @@ -3425,7 +3425,7 @@ method converts the bytes from index `startIndex` to `startIndex` + 7 to a value. The order of bytes in the array must reflect the endianness of the computer system's architecture. For more information, see the Remarks section of the class topic. + The method converts the bytes from index `startIndex` to `startIndex` + 7 to a value. The order of bytes in the array must reflect the endianness of the computer system's architecture. For more information, see the Remarks section of the class topic. ## Examples The following code example converts elements of arrays to values with the `ToUInt64` method. diff --git a/xml/System/Boolean.xml b/xml/System/Boolean.xml index 0bba276a6af..8ce6d1b3d8d 100644 --- a/xml/System/Boolean.xml +++ b/xml/System/Boolean.xml @@ -191,17 +191,17 @@ ## Remarks -This method implements the interface and performs slightly better than the method because it does not have to convert the `value` parameter to an object. +This method implements the interface and performs slightly better than the method because it does not have to convert the `value` parameter to an object. If `value` has fewer bits (is narrower) than the instance type, some programming languages perform an implicit widening conversion that transforms the value of the parameter into a value with more bits. - For example, suppose the instance type is and the parameter type is . The Microsoft C# compiler generates instructions to represent the value of the parameter as an object, then generates a method to compare the instance and parameter representation. + For example, suppose the instance type is and the parameter type is . The Microsoft C# compiler generates instructions to represent the value of the parameter as an object, then generates a method to compare the instance and parameter representation. Consult your programming language's documentation to determine whether its compiler performs implicit widening conversions on numeric types. ## Examples -The following code example demonstrates generic and nongeneric versions of the method for several value and reference types. +The following code example demonstrates generic and nongeneric versions of the method for several value and reference types. :::code language="csharp" source="~/snippets/csharp/System/Boolean/CompareTo/cat.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Boolean/CompareTo/cat.fs" id="Snippet1"::: @@ -367,7 +367,7 @@ The following code example demonstrates generic and nongeneric versions of the < ## Remarks -This method implements the interface, and performs slightly better than because it does not have to convert the `obj` parameter to an object. +This method implements the interface, and performs slightly better than because it does not have to convert the `obj` parameter to an object. ]]> @@ -436,7 +436,7 @@ This method implements the . +This method overrides . ]]> @@ -707,7 +707,7 @@ The `value` parameter, optionally preceded or trailed by white space, must conta ## Examples -The following code example illustrates the use of method. +The following code example illustrates the use of method. :::code language="csharp" source="~/snippets/csharp/System/Boolean/Parse/booleanmembers.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/Boolean/Parse/booleanmembers.fs" id="Snippet2"::: @@ -930,7 +930,7 @@ This member is an explicit interface member implementation. It can be used only ## Remarks -This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. +This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -1094,7 +1094,7 @@ This member is an explicit interface member implementation. It can be used only ## Remarks -This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. +This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -1153,7 +1153,7 @@ This member is an explicit interface member implementation. It can be used only ## Remarks -This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. +This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -1212,7 +1212,7 @@ This member is an explicit interface member implementation. It can be used only ## Remarks -This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. +This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -1271,7 +1271,7 @@ This member is an explicit interface member implementation. It can be used only ## Remarks -This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. +This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -1330,7 +1330,7 @@ This member is an explicit interface member implementation. It can be used only ## Remarks -This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. +This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -1395,7 +1395,7 @@ This member is an explicit interface member implementation. It can be used only ## Remarks -This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. +This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -1454,7 +1454,7 @@ This member is an explicit interface member implementation. It can be used only ## Remarks -This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. +This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -1558,7 +1558,7 @@ This member is an explicit interface member implementation. It can be used only ## Remarks -This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. +This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -1627,7 +1627,7 @@ This member is an explicit interface member implementation. It can be used only ## Remarks -This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. +This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -1694,7 +1694,7 @@ This member is an explicit interface member implementation. It can be used only ## Remarks -This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. +This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -1761,7 +1761,7 @@ This member is an explicit interface member implementation. It can be used only ## Remarks -This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. +This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -1994,11 +1994,11 @@ This member is an explicit interface member implementation. It can be used only This method returns the constants "True" or "False". - Note that XML is case-sensitive, and that the XML specification recognizes "true" and "false" as the valid set of Boolean values. If the string returned by the method is to be written to an XML file, its method should be called first to convert it to lowercase. + Note that XML is case-sensitive, and that the XML specification recognizes "true" and "false" as the valid set of Boolean values. If the string returned by the method is to be written to an XML file, its method should be called first to convert it to lowercase. ## Examples -The following example illustrates the method. +The following example illustrates the method. :::code language="csharp" source="~/snippets/csharp/System/Boolean/Parse/booleanmembers.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Boolean/Parse/booleanmembers.fs" id="Snippet1"::: @@ -2068,9 +2068,9 @@ The following example illustrates the method. ## Remarks -The `provider` parameter is reserved. It does not participate in the execution of this method. This means that the method, unlike most methods with a `provider` parameter, does not reflect culture-specific settings. +The `provider` parameter is reserved. It does not participate in the execution of this method. This means that the method, unlike most methods with a `provider` parameter, does not reflect culture-specific settings. - This method returns the constants "True" or "False". Note that XML is case-sensitive, and that the XML specification recognizes "true" and "false" as the valid set of Boolean values. If the object returned by the method is to be written to an XML file, its method should be called first to convert it to lowercase. + This method returns the constants "True" or "False". Note that XML is case-sensitive, and that the XML specification recognizes "true" and "false" as the valid set of Boolean values. If the object returned by the method is to be written to an XML file, its method should be called first to convert it to lowercase. ]]> @@ -2287,13 +2287,13 @@ The property defines the string representation ## Remarks -The method is like the method, except the method does not throw an exception if the conversion fails. +The method is like the method, except the method does not throw an exception if the conversion fails. The `value` parameter can be preceded or followed by white space. The comparison is ordinal and case-insensitive. ## Examples -The following example calls the method to parse an array of strings. Note that the parse operation succeeds only if the string to be parsed is "True" (the value of the field) or "False" (the value of the field) in a case-insensitive comparison. +The following example calls the method to parse an array of strings. Note that the parse operation succeeds only if the string to be parsed is "True" (the value of the field) or "False" (the value of the field) in a case-insensitive comparison. :::code language="csharp" source="~/snippets/csharp/System/Boolean/TryParse/tryparseex.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Boolean/TryParse/tryparseex.fs" id="Snippet1"::: diff --git a/xml/System/Buffer.xml b/xml/System/Buffer.xml index f71f4cc511e..274ad9dd456 100644 --- a/xml/System/Buffer.xml +++ b/xml/System/Buffer.xml @@ -151,9 +151,9 @@ ## Remarks This method copies `count` bytes from `src`, beginning at `srcOffset`, to `dst`, beginning at `dstOffset`. Both `srcOffset` and `dstOffset` are zero-based; that is, the first byte in each buffer is at position 0, not position 1. - The method accesses the bytes in the `src` parameter array using offsets into memory, not programming constructs such as indexes or upper and lower array bounds. For example, if in the programming language of your application you declare an array with a zero-based lower bound of -50, and then pass the array and an offset of 5 to the method, the first array element the method will access is the second element of the array, which is at index -49. Furthermore, which byte of array element -49 is accessed first depends on the endianness of the computer that is executing your application. + The method accesses the bytes in the `src` parameter array using offsets into memory, not programming constructs such as indexes or upper and lower array bounds. For example, if in the programming language of your application you declare an array with a zero-based lower bound of -50, and then pass the array and an offset of 5 to the method, the first array element the method will access is the second element of the array, which is at index -49. Furthermore, which byte of array element -49 is accessed first depends on the endianness of the computer that is executing your application. - As its name suggests, the method copies a block of bytes as a whole, rather than copying one byte at a time. Therefore, if `src` and `dst` reference the same array, and the range from `srcOffset` + `count` -1 overlaps the range from `dstOffset` + `count` - 1, the values of the overlapping bytes are not overwritten before they are copied to the destination. In the following example, the values of bytes 0-16 in an array named `arr` are copied to bytes 12-28. Despite the overlapping range, the values of the source bytes are successfully copied. + As its name suggests, the method copies a block of bytes as a whole, rather than copying one byte at a time. Therefore, if `src` and `dst` reference the same array, and the range from `srcOffset` + `count` -1 overlaps the range from `dstOffset` + `count` - 1, the values of the overlapping bytes are not overwritten before they are copied to the destination. In the following example, the values of bytes 0-16 in an array named `arr` are copied to bytes 12-28. Despite the overlapping range, the values of the source bytes are successfully copied. :::code language="csharp" source="~/snippets/csharp/System/Buffer/Overview/overlap1.cs" id="Snippet3"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Buffer.BlockCopy/FS/overlap1.fs" id="Snippet3"::: @@ -166,7 +166,7 @@ :::code language="vb" source="~/snippets/visualbasic/System/Buffer/Overview/overlap1.vb" id="Snippet4"::: ## Examples - The following example copies regions of arrays by using the method. For each operation, it lists the source and destination arrays as both an array of values and as a sequence of bytes. The example illustrates the importance of considering a system's endianness when working with the method: Because Windows systems are little-endian, the lower-order bytes of a primitive data type's value precede the higher-order bytes. + The following example copies regions of arrays by using the method. For each operation, it lists the source and destination arrays as both an array of values and as a sequence of bytes. The example illustrates the importance of considering a system's endianness when working with the method: Because Windows systems are little-endian, the lower-order bytes of a primitive data type's value precede the higher-order bytes. :::code language="csharp" source="~/snippets/csharp/System/Buffer/Overview/bcopy.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Buffer.BlockCopy/FS/bcopy.fs" id="Snippet2"::: diff --git a/xml/System/Byte.xml b/xml/System/Byte.xml index 6572b2116f4..5effb818eb1 100644 --- a/xml/System/Byte.xml +++ b/xml/System/Byte.xml @@ -395,11 +395,11 @@ interface and performs slightly better than the method because it does not have to convert the `value` parameter to an object. + This method implements the interface and performs slightly better than the method because it does not have to convert the `value` parameter to an object. - Depending on your programming language, it might be possible to code a method where the parameter type has fewer bits (is narrower) than the instance type. This is possible because some programming languages perform an implicit widening conversion that represents the parameter as a type with as many bits as the instance. + Depending on your programming language, it might be possible to code a method where the parameter type has fewer bits (is narrower) than the instance type. This is possible because some programming languages perform an implicit widening conversion that represents the parameter as a type with as many bits as the instance. - For example, suppose the instance type is and the parameter type is . The Microsoft C# compiler generates instructions to represent the value of the parameter as an , then generates a method that compares the values of the instance and the parameter representation. + For example, suppose the instance type is and the parameter type is . The Microsoft C# compiler generates instructions to represent the value of the parameter as an , then generates a method that compares the values of the instance and the parameter representation. Consult your programming language's documentation to determine whether its compiler performs implicit widening conversions on numeric types. @@ -491,7 +491,7 @@ ## Examples - The following code example demonstrates the method. + The following code example demonstrates the method. :::code language="csharp" source="~/snippets/csharp/System/Byte/CompareTo/systembyte.cs" id="Snippet3"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Byte Examples/FS/systembyte.fs" id="Snippet3"::: @@ -793,7 +793,7 @@ interface, and performs slightly better than because it does not have to convert the `obj` parameter to an object. + This method implements the interface, and performs slightly better than because it does not have to convert the `obj` parameter to an object. ]]> @@ -1001,7 +1001,7 @@ This method correctly handles floating-point values and so `2.0` will return `true` while `2.2` will return `false`. -A return value of `false` does not imply that will return `true`. A number with a fractional portion, for example, `3.3`, is not even or odd. +A return value of `false` does not imply that will return `true`. A number with a fractional portion, for example, `3.3`, is not even or odd. ]]> @@ -1051,7 +1051,7 @@ A return value of `false` does not imply that will return `true`. A number with a fractional portion, for example, `3.3`, is not even or odd. +A return value of `false` does not imply that will return `true`. A number with a fractional portion, for example, `3.3`, is not even or odd. ]]> @@ -1219,7 +1219,7 @@ A return value of `false` does not imply that , this method matches the IEEE 754:2019 `maximum` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. +For , this method matches the IEEE 754:2019 `maximum` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. ]]> @@ -1332,7 +1332,7 @@ For , this method matches the IEEE 754: ## Remarks -For , this method matches the IEEE 754:2019 `minimum` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. +For , this method matches the IEEE 754:2019 `minimum` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. ]]> @@ -1479,14 +1479,14 @@ For , this method matches the IEEE 754: |*sign*|An optional positive or negative sign.| |*digits*|A sequence of digits ranging from 0 to 9.| - The `s` parameter is interpreted using the style. In addition to the byte value's decimal digits, only leading and trailing spaces together with a leading sign are allowed. (If the sign is present, it must be a positive sign or the method throws an .) To explicitly define the style elements that can be present in `s`, use either the or the method. + The `s` parameter is interpreted using the style. In addition to the byte value's decimal digits, only leading and trailing spaces together with a leading sign are allowed. (If the sign is present, it must be a positive sign or the method throws an .) To explicitly define the style elements that can be present in `s`, use either the or the method. - The `s` parameter is parsed using the formatting information in a object that is initialized for the current system culture. For more information, see . To parse a string using the formatting information of some other culture, use the method. + The `s` parameter is parsed using the formatting information in a object that is initialized for the current system culture. For more information, see . To parse a string using the formatting information of some other culture, use the method. ## Examples - The following example demonstrates how to convert a string value into a byte value using the method. The resulting byte value is then displayed to the console. + The following example demonstrates how to convert a string value into a byte value using the method. The resulting byte value is then displayed to the console. :::code language="csharp" source="~/snippets/csharp/System/Byte/Parse/parse.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Byte.Parse/FS/parse.fs" id="Snippet1"::: @@ -1698,12 +1698,12 @@ For , this method matches the IEEE 754: If the flag is used, `s` must be a hexadecimal value without a prefix. For example, "F3" parses successfully, but "0xF3" does not. The only other flags that can be combined with it are and . (The enumeration includes a composite number style, , that includes both white space flags.) - The `s` parameter is parsed using the formatting information in a object that is initialized for the current system culture. To use the formatting information of some other culture, call the overload. + The `s` parameter is parsed using the formatting information in a object that is initialized for the current system culture. To use the formatting information of some other culture, call the overload. ## Examples - The following example parses string representations of `Byte` values with the method. The current culture for the example is en-US. + The following example parses string representations of `Byte` values with the method. The current culture for the example is en-US. :::code language="csharp" source="~/snippets/csharp/System/Byte/Parse/parse.cs" id="Snippet3"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Byte.Parse/FS/parse.fs" id="Snippet3"::: @@ -1814,14 +1814,14 @@ For , this method matches the IEEE 754: |*sign*|An optional positive sign.| |*digits*|A sequence of digits ranging from 0 to 9.| - The `s` parameter is interpreted using the style. In addition to the byte value's decimal digits, only leading and trailing spaces together with a leading sign are allowed. (If the sign is present, it must be a positive sign or the method throws an .) To explicitly define the style elements together with the culture-specific formatting information that can be present in `s`, use the method. + The `s` parameter is interpreted using the style. In addition to the byte value's decimal digits, only leading and trailing spaces together with a leading sign are allowed. (If the sign is present, it must be a positive sign or the method throws an .) To explicitly define the style elements together with the culture-specific formatting information that can be present in `s`, use the method. The `s` parameter is parsed using the formatting information in a object supplied by `provider`. The `provider` parameter is an implementation such as a or object. The `provider` parameter supplies culture-specific information used in parsing. If `provider` is `null`, the thread current culture is used. ## Examples - The following example parses string representations of `Byte` values with the method. + The following example parses string representations of `Byte` values with the method. :::code language="csharp" source="~/snippets/csharp/System/Byte/Parse/parse.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Byte.Parse/FS/parse.fs" id="Snippet2"::: @@ -2027,7 +2027,7 @@ For , this method matches the IEEE 754: |Element|Description| |-------------|-----------------| |*ws*|Optional white space. White space can appear at the beginning of `s` if `style` includes the flag, or at the end of `s` if `style` includes the flag.| -|*$*|A culture-specific currency symbol. Its position in the string is defined by the property of the object returned by the method of the `provider` parameter. The currency symbol can appear in `s` if `style` includes the flag.| +|*$*|A culture-specific currency symbol. Its position in the string is defined by the property of the object returned by the method of the `provider` parameter. The currency symbol can appear in `s` if `style` includes the flag.| |*sign*|An optional positive sign. (The method throws an if a negative sign is present in `s`.) The sign can appear at the beginning of `s` if `style` includes the flag, or at the end of `s` if `style` includes the flag.| |*digits*|A sequence of digits from 0 through 9.| |*.*|A culture-specific decimal point symbol. The decimal point symbol of the culture specified by `provider` can appear in `s` if `style` includes the flag.| @@ -2060,7 +2060,7 @@ For , this method matches the IEEE 754: ## Examples - The following code example parses string representations of `Byte` values with this overload of the method. + The following code example parses string representations of `Byte` values with this overload of the method. :::code language="csharp" source="~/snippets/csharp/System/Byte/Parse/parse.cs" id="Snippet4"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Byte.Parse/FS/parse.fs" id="Snippet4"::: @@ -2407,7 +2407,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -2523,7 +2523,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -2633,7 +2633,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -2691,7 +2691,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -2749,7 +2749,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -2807,7 +2807,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -2865,7 +2865,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -2929,7 +2929,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -2987,7 +2987,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -3047,7 +3047,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the `static` (`Shared` in Visual Basic) method instead. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the `static` (`Shared` in Visual Basic) method instead. ]]> @@ -3114,7 +3114,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -3178,7 +3178,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -3242,7 +3242,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -6182,7 +6182,7 @@ This member is an explicit interface member implementation. It can be used only object for the thread current culture. To define the formatting of the value's string representation, call the method. To define both the format specifiers and culture used to create the string representation of a value, call the method. + The return value is formatted with the general numeric format specifier ("G") and the object for the thread current culture. To define the formatting of the value's string representation, call the method. To define both the format specifiers and culture used to create the string representation of a value, call the method. .NET provides extensive formatting support, which is described in greater detail in the following formatting topics: @@ -6190,7 +6190,7 @@ This member is an explicit interface member implementation. It can be used only - For more information about formatting, see [Formatting Types](/dotnet/standard/base-types/formatting-types). - For information about the thread current culture, see . + For information about the thread current culture, see . @@ -6277,7 +6277,7 @@ This member is an explicit interface member implementation. It can be used only ## Remarks The return value is formatted with the general numeric format specifier ("G"). - The `provider` parameter is an object that implements the interface. Its method returns a object that provides culture-specific information about the format of the string that is returned by this method. The object that implements can be any of the following: + The `provider` parameter is an object that implements the interface. Its method returns a object that provides culture-specific information about the format of the string that is returned by this method. The object that implements can be any of the following: - A object that represents the culture whose formatting rules are to be used. @@ -6285,7 +6285,7 @@ This member is an explicit interface member implementation. It can be used only - A custom object that implements . - If `provider` is `null` or a object cannot be obtained from `provider`, the return value is formatted using the object for the thread current culture. For information about the thread current culture, see . + If `provider` is `null` or a object cannot be obtained from `provider`, the return value is formatted using the object for the thread current culture. For information about the thread current culture, see . .NET provides extensive formatting support, which is described in greater detail in the following formatting topics: @@ -6296,7 +6296,7 @@ This member is an explicit interface member implementation. It can be used only ## Examples - The following example iterates an array of byte values and displays each of them to the console by calling the method with different format providers. + The following example iterates an array of byte values and displays each of them to the console by calling the method with different format providers. :::code language="csharp" source="~/snippets/csharp/System/Byte/ToString/NewByteMembers.cs" id="Snippet3"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Byte.ToString/FS/NewByteMembers.fs" id="Snippet3"::: @@ -6381,7 +6381,7 @@ This member is an explicit interface member implementation. It can be used only ## Remarks The `format` parameter can be either a standard or a custom numeric format string. All standard numeric format strings other than "R" (or "r") are supported, as are all custom numeric format characters. If `format` is `null` or an empty string (""), the return value is formatted with the general numeric format specifier ("G"). - The return value of this function is formatted using the object for the thread current culture. For information about the thread current culture, see . To provide formatting information for cultures other than the current culture, call the method. + The return value of this function is formatted using the object for the thread current culture. For information about the thread current culture, see . To provide formatting information for cultures other than the current culture, call the method. .NET provides extensive formatting support, which is described in greater detail in the following formatting topics: @@ -6475,11 +6475,11 @@ This member is an explicit interface member implementation. It can be used only method formats a value in a specified format of a specified culture. To format a number by using the default ("G") format of the current culture, call the method. To format a number by using a specified format of the current culture, call the method. + The method formats a value in a specified format of a specified culture. To format a number by using the default ("G") format of the current culture, call the method. To format a number by using a specified format of the current culture, call the method. The `format` parameter can be either a standard or a custom numeric format string. All standard numeric format strings other than "R" (or "r") are supported, as are all custom numeric format characters. If `format` is `null` or an empty string (""), the return value of this method is formatted with the general numeric format specifier ("G"). - The `provider` parameter is an object that implements the interface. Its method returns a object that provides culture-specific information about the format of the string that is returned by this method. The object that implements can be any of the following: + The `provider` parameter is an object that implements the interface. Its method returns a object that provides culture-specific information about the format of the string that is returned by this method. The object that implements can be any of the following: - A object that represents the culture whose formatting rules are to be used. @@ -6487,7 +6487,7 @@ This member is an explicit interface member implementation. It can be used only - A custom object that implements . - If `provider` is `null` or a object cannot be obtained from `provider`, the return value is formatted using the object for the thread current culture. For information about the thread current culture, see . + If `provider` is `null` or a object cannot be obtained from `provider`, the return value is formatted using the object for the thread current culture. For information about the thread current culture, see . .NET provides extensive formatting support, which is described in greater detail in the following formatting topics: @@ -6842,7 +6842,7 @@ This member is an explicit interface member implementation. It can be used only ## Remarks The conversion fails and the method returns `false` if the `s` parameter is not in the correct format, if it is `null` or , or if it represents a number less than or greater than . - The method is similar to the method, except that does not throw an exception if the conversion fails. + The method is similar to the method, except that does not throw an exception if the conversion fails. The `s` parameter should be the string representation of a number in the following form: @@ -6858,16 +6858,16 @@ This member is an explicit interface member implementation. It can be used only |*sign*|An optional positive sign, as specified by the property of the current culture.| |*digits*|A sequence of decimal digits that range from 0 to 9.| - The `s` parameter is interpreted using the style. In addition to the byte value's decimal digits, only leading and trailing spaces together with a leading sign are allowed. (If the sign is present, it must be a positive sign or the method throws an .) To explicitly define the style elements together with the culture-specific formatting information that can be present in `s`, use the method. + The `s` parameter is interpreted using the style. In addition to the byte value's decimal digits, only leading and trailing spaces together with a leading sign are allowed. (If the sign is present, it must be a positive sign or the method throws an .) To explicitly define the style elements together with the culture-specific formatting information that can be present in `s`, use the method. - The `s` parameter is parsed using the formatting information in a object for the current culture. For more information, see . + The `s` parameter is parsed using the formatting information in a object for the current culture. For more information, see . - This overload of the method interprets all digits in the `s` parameter as decimal digits. To parse the string representation of a hexadecimal number, call the overload. + This overload of the method interprets all digits in the `s` parameter as decimal digits. To parse the string representation of a hexadecimal number, call the overload. ## Examples - The following example calls the method with a number of different string values. + The following example calls the method with a number of different string values. :::code language="csharp" source="~/snippets/csharp/System/Byte/TryParse/TryParse.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Byte.TryParse/fs/TryParse.fs" id="Snippet1"::: @@ -7193,7 +7193,7 @@ This member is an explicit interface member implementation. It can be used only method is like the method, except the method does not throw an exception if the conversion fails. + The method is like the method, except the method does not throw an exception if the conversion fails. The `s` parameter is parsed using the formatting information in a object supplied by the `provider` parameter. @@ -7210,7 +7210,7 @@ This member is an explicit interface member implementation. It can be used only |Element|Description| |-------------|-----------------| |*ws*|Optional white space. White space can appear at the beginning of `s` if `style` includes the flag, or at the end of s if style includes the flag.| -|*$*|A culture-specific currency symbol. Its position in the string is defined by the property of the object returned by the method of the `provider` parameter. The currency symbol can appear in `s` if `style` includes the flag.| +|*$*|A culture-specific currency symbol. Its position in the string is defined by the property of the object returned by the method of the `provider` parameter. The currency symbol can appear in `s` if `style` includes the flag.| |*sign*|An optional positive sign. (The parse operation fails if a negative sign is present in `s`.) The sign can appear at the beginning of `s` if `style` includes the flag, or at the end of `s` if `style` includes the flag.| |*digits*|A sequence of digits from 0 through 9.| |*.*|A culture-specific decimal point symbol. The decimal point symbol of the culture specified by `provider` can appear in `s` if `style` includes the flag.| @@ -7238,12 +7238,12 @@ This member is an explicit interface member implementation. It can be used only If the flag is used, `s` must be a hexadecimal value without a prefix. For example, "F3" parses successfully, but "0xF3" does not. The only other flags that can be present in `style` are and . (The enumeration has a composite number style, , that includes both white space flags.) - The `provider` parameter is an implementation, such as a object or a object, whose method returns a object. The object provides culture-specific information about the format of `s`. + The `provider` parameter is an implementation, such as a object or a object, whose method returns a object. The object provides culture-specific information about the format of `s`. ## Examples - The following example calls the method with a number of different string values. + The following example calls the method with a number of different string values. :::code language="csharp" source="~/snippets/csharp/System/Byte/TryParse/TryParse2.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Byte.TryParse/fs/TryParse2.fs" id="Snippet2"::: diff --git a/xml/System/CannotUnloadAppDomainException.xml b/xml/System/CannotUnloadAppDomainException.xml index 0748986631b..9db70693623 100644 --- a/xml/System/CannotUnloadAppDomainException.xml +++ b/xml/System/CannotUnloadAppDomainException.xml @@ -84,7 +84,7 @@ uses the HRESULT COR_E_CANNOTUNLOADAPPDOMAIN, which has the value 0x80131015. - For a list of initial property values for an instance of , see the constructors. + For a list of initial property values for an instance of , see the constructors. ]]> @@ -153,8 +153,8 @@ |Property|Value| |--------------|-----------| -||A null reference (`Nothing` in Visual Basic).| -||The localized error message string.| +||A null reference (`Nothing` in Visual Basic).| +||The localized error message string.| ]]> @@ -213,8 +213,8 @@ |Property|Value| |--------------|-----------| -||A null reference (`Nothing` in Visual Basic).| -||The error message string.| +||A null reference (`Nothing` in Visual Basic).| +||The error message string.| ]]> @@ -344,8 +344,8 @@ |Property|Value| |--------------|-----------| -||The inner exception reference.| -||The error message string.| +||The inner exception reference.| +||The error message string.| ]]> diff --git a/xml/System/Char.xml b/xml/System/Char.xml index b6b10ba0358..c518208921b 100644 --- a/xml/System/Char.xml +++ b/xml/System/Char.xml @@ -357,15 +357,15 @@ The following code example demonstrates some of the methods in interface and performs slightly better than the method because it does not have to convert the `value` parameter to an object. + This method implements the interface and performs slightly better than the method because it does not have to convert the `value` parameter to an object. The comparison performed by this method is based on the encoded values of this instance and `value`, not their lexicographical characteristics. - If the method parameter type has fewer bits (is narrower) than the instance type, some programming languages perform an implicit widening conversion that transforms the value of the parameter into a value with more bits. + If the method parameter type has fewer bits (is narrower) than the instance type, some programming languages perform an implicit widening conversion that transforms the value of the parameter into a value with more bits. - For example, suppose the instance type is and the parameter type is . The Microsoft C# compiler generates instructions to represent the value of the parameter as an object, then generates a method that compares the values of the instance and the parameter representation. + For example, suppose the instance type is and the parameter type is . The Microsoft C# compiler generates instructions to represent the value of the parameter as an object, then generates a method that compares the values of the instance and the parameter representation. - Typically, implicit widening conversions are performed on numeric types. Consult your programming language's documentation to determine if its compiler performs widening conversions. If the instance and parameter types mismatch and a suitable conversion is not available, the compiler generates instructions to box the parameter and invoke the overload that takes an parameter. + Typically, implicit widening conversions are performed on numeric types. Consult your programming language's documentation to determine if its compiler performs widening conversions. If the instance and parameter types mismatch and a suitable conversion is not available, the compiler generates instructions to box the parameter and invoke the overload that takes an parameter. @@ -454,7 +454,7 @@ The following code example demonstrates some of the methods in method implements the interface. + The method implements the interface. The `value` parameter must be `null` or an instance of ; otherwise, an exception is thrown. @@ -463,7 +463,7 @@ The following code example demonstrates some of the methods in . + The following code example demonstrates . :::code language="csharp" source="~/snippets/csharp/System/Char/CompareTo/compareto.cs" id="Snippet19"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Char.CompareTo/FS/compareto.fs" id="Snippet19"::: @@ -527,14 +527,14 @@ The following code example demonstrates some of the methods in and . + Use this method to convert a 21-bit Unicode code point to a UTF-16 encoded string before testing the string with methods such as and . A valid code point outside the Basic Multilingual Plane (BMP) always yields a valid surrogate pair. However, a valid code point within the BMP might not yield a valid result according to the Unicode standard because no linguistic processing is used in the conversion. For that reason, use the class to convert bulk UTF-32 data into bulk UTF-16 data. ## Examples - The following code example demonstrates the and methods. + The following code example demonstrates the and methods. :::code language="csharp" source="~/snippets/csharp/System/Char/ConvertFromUtf32/utf.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/char.cvtutf32/FS/utf.fs" id="Snippet1"::: @@ -564,7 +564,7 @@ The following code example demonstrates some of the methods in and methods. + The following code example demonstrates the and methods. :::code language="csharp" source="~/snippets/csharp/System/Char/ConvertFromUtf32/utf.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/char.cvtutf32/FS/utf.fs" id="Snippet1"::: @@ -772,7 +772,7 @@ The following code example demonstrates some of the methods in interface, and performs slightly better than because it does not need to unbox the `obj` parameter. + This method implements the interface, and performs slightly better than because it does not need to unbox the `obj` parameter. ]]> @@ -844,7 +844,7 @@ The following code example demonstrates some of the methods in . + The following code example demonstrates . :::code language="csharp" source="~/snippets/csharp/System/Char/Equals/equals.cs" id="Snippet20"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Char.Equals/FS/equals.fs" id="Snippet20"::: @@ -1003,7 +1003,7 @@ The following code example demonstrates some of the methods in categories: `DecimalDigitNumber`, `LetterNumber`, or `OtherNumber`. - The method assumes that `c` corresponds to a single linguistic character and checks whether that character can be converted to a decimal digit. However, some numbers in the Unicode standard are represented by two objects that form a surrogate pair. For example, the Aegean numbering system consists of code points U+10107 through U+10133. The following example uses the method to instantiate a string that represents AEGEAN NUMBER ONE. As the output from the example shows, the method returns -1 if it is passed either a high surrogate or a low surrogate of this character. + The method assumes that `c` corresponds to a single linguistic character and checks whether that character can be converted to a decimal digit. However, some numbers in the Unicode standard are represented by two objects that form a surrogate pair. For example, the Aegean numbering system consists of code points U+10107 through U+10133. The following example uses the method to instantiate a string that represents AEGEAN NUMBER ONE. As the output from the example shows, the method returns -1 if it is passed either a high surrogate or a low surrogate of this character. :::code language="csharp" source="~/snippets/csharp/System/Char/GetNumericValue/getnumericvalue1.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Char.GetNumericValue/FS/getnumericvalue1.fs" id="Snippet2"::: @@ -1012,7 +1012,7 @@ The following code example demonstrates some of the methods in . + The following example demonstrates . :::code language="csharp" source="~/snippets/csharp/System/Char/GetNumericValue/getnumericvalue.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Char.GetNumericValue/FS/getnumericvalue.fs" id="Snippet1"::: @@ -1088,7 +1088,7 @@ The following code example demonstrates some of the methods in categories: `DecimalDigitNumber`, `LetterNumber`, or `OtherNumber`. - If the object at position `index` is the first character of a valid surrogate pair, the method determines whether the surrogate pair forms a numeric digit. For example, the Aegean numbering system consists of code points U+10107 through U+10133. The following example uses the method to instantiate a string that represents each Aegean number. As the output from the example shows, the method returns the correct numeric value if it is passed the high surrogate of an Aegean number. However, if it is passed the low surrogate, it considers only the low surrogate in isolation and returns -1. + If the object at position `index` is the first character of a valid surrogate pair, the method determines whether the surrogate pair forms a numeric digit. For example, the Aegean numbering system consists of code points U+10107 through U+10133. The following example uses the method to instantiate a string that represents each Aegean number. As the output from the example shows, the method returns the correct numeric value if it is passed the high surrogate of an Aegean number. However, if it is passed the low surrogate, it considers only the low surrogate in isolation and returns -1. :::code language="csharp" source="~/snippets/csharp/System/Char/GetNumericValue/getnumericvalue1.cs" id="Snippet3"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Char.GetNumericValue/FS/getnumericvalue1.fs" id="Snippet3"::: @@ -1097,7 +1097,7 @@ The following code example demonstrates some of the methods in . + The following code example demonstrates . :::code language="csharp" source="~/snippets/csharp/System/Char/GetNumericValue/getnumericvalue.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Char.GetNumericValue/FS/getnumericvalue.fs" id="Snippet1"::: @@ -1170,7 +1170,7 @@ The following code example demonstrates some of the methods in . + The following code example demonstrates . :::code language="csharp" source="~/snippets/csharp/System/Char/GetUnicodeCategory/getunicodecategory.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Char.GetUnicodeCategory/FS/getunicodecategory.fs" id="Snippet1"::: @@ -1237,7 +1237,7 @@ The following code example demonstrates some of the methods in method does not always return the same value as the method when it is passed a particular character as a parameter. The method is designed to reflect the current version of the Unicode standard. In contrast, although the method usually reflects the current version of the Unicode standard, it may return a character's category based on a previous version of the standard or it may return a category that differs from the current standard in order to preserve backward compatibility. As a result, we recommend that you use the method instead of . + The method does not always return the same value as the method when it is passed a particular character as a parameter. The method is designed to reflect the current version of the Unicode standard. In contrast, although the method usually reflects the current version of the Unicode standard, it may return a character's category based on a previous version of the standard or it may return a category that differs from the current standard in order to preserve backward compatibility. As a result, we recommend that you use the method instead of . Starting with .NET Framework 4.6.2, Unicode characters are classified based on [The Unicode Standard, Version 8.0.0](https://www.unicode.org/versions/Unicode8.0.0/). In versions of the .NET Framework from the .NET Framework 4 to the .NET Framework 4.6.1, they are classified based on [The Unicode Standard, Version 6.3.0](https://www.unicode.org/versions/Unicode6.3.0/). @@ -1304,7 +1304,7 @@ The following code example demonstrates some of the methods in method does not always return the same value as the method when it is passed a particular character as a parameter. The method is designed to reflect the current version of the Unicode standard. In contrast, although the method usually reflects the current version of the Unicode standard, it may return a character's category based on a previous version of the standard or it may return a category that differs from the current standard in order to preserve backward compatibility. As a result, we recommend that you use the method instead of . + The method does not always return the same value as the method when it is passed a particular character as a parameter. The method is designed to reflect the current version of the Unicode standard. In contrast, although the method usually reflects the current version of the Unicode standard, it may return a character's category based on a previous version of the standard or it may return a category that differs from the current standard in order to preserve backward compatibility. As a result, we recommend that you use the method instead of . Starting with .NET Framework 4.6.2, Unicode characters are classified based on [The Unicode Standard, Version 8.0.0](https://www.unicode.org/versions/Unicode8.0.0/). In versions of the .NET Framework from the .NET Framework 4 to the .NET Framework 4.6.1, they are classified based on [The Unicode Standard, Version 6.3.0](https://www.unicode.org/versions/Unicode6.3.0/). @@ -1944,7 +1944,7 @@ The method does not validate that `maxInclusive` is greater than or equal Valid digits are members of the category. ## Examples - The following code example demonstrates . + The following code example demonstrates . :::code language="csharp" source="~/snippets/csharp/System/Char/IsDigit/isdigit.cs" id="Snippet4"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Char.IsDigit/FS/isdigit.fs" id="Snippet4"::: @@ -2006,7 +2006,7 @@ The method does not validate that `maxInclusive` is greater than or equal is a radix-10 digit. This contrasts with , which determines whether a `Char` is of any numeric Unicode category. Numbers include characters such as fractions, subscripts, superscripts, Roman numerals, currency numerators, encircled numbers, and script-specific digits. + This method determines whether a is a radix-10 digit. This contrasts with , which determines whether a `Char` is of any numeric Unicode category. Numbers include characters such as fractions, subscripts, superscripts, Roman numerals, currency numerators, encircled numbers, and script-specific digits. Valid digits are members of the category. @@ -2077,7 +2077,7 @@ The method does not validate that `maxInclusive` is greater than or equal is a radix-10 digit. This contrasts with , which determines whether a is of any numeric Unicode category. Numbers include characters such as fractions, subscripts, superscripts, Roman numerals, currency numerators, encircled numbers, and script-specific digits. + This method determines whether a is a radix-10 digit. This contrasts with , which determines whether a is of any numeric Unicode category. Numbers include characters such as fractions, subscripts, superscripts, Roman numerals, currency numerators, encircled numbers, and script-specific digits. Character positions in a string are indexed starting from zero. @@ -2108,7 +2108,7 @@ The method does not validate that `maxInclusive` is greater than or equal , , and methods. + The following code example demonstrates the , , and methods. :::code language="csharp" source="~/snippets/csharp/System/Char/IsHighSurrogate/sur.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/char.surrogate/FS/sur.fs" id="Snippet1"::: @@ -2270,7 +2270,7 @@ The method does not validate that `maxInclusive` is greater than or equal ## Examples -The following code example demonstrates . +The following code example demonstrates . :::code language="csharp" source="~/snippets/csharp/System/Char/IsLetter/isletter.cs" id="Snippet5"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Char.IsLetter/FS/isletter.fs" id="Snippet5"::: @@ -2450,7 +2450,7 @@ The following code example demonstrates . Valid letters and decimal digits are members of the following categories in : `UppercaseLetter`, `LowercaseLetter`, `TitlecaseLetter`, `ModifierLetter`, `OtherLetter`, or `DecimalDigitNumber`. ## Examples - The following code example demonstrates . + The following code example demonstrates . :::code language="csharp" source="~/snippets/csharp/System/Char/IsLetterOrDigit/isletterordigit.cs" id="Snippet6"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Char.IsLetterOrDigit/FS/isletterordigit.fs" id="Snippet6"::: @@ -2614,7 +2614,7 @@ The following code example demonstrates . . + The following code example demonstrates . :::code language="csharp" source="~/snippets/csharp/System/Char/IsLower/islower.cs" id="Snippet7"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Char.IsLower/FS/islower.fs" id="Snippet7"::: @@ -2776,7 +2776,7 @@ The following code example demonstrates . , , and methods. + The following code example demonstrates the , , and methods. :::code language="csharp" source="~/snippets/csharp/System/Char/IsHighSurrogate/sur.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/char.surrogate/FS/sur.fs" id="Snippet1"::: @@ -2975,14 +2975,14 @@ The following code example demonstrates . is of any numeric Unicode category. In addition to including digits, numbers include characters, fractions, subscripts, superscripts, Roman numerals, currency numerators, and encircled numbers. This method contrasts with the method, which determines whether a is a radix-10 digit. + This method determines whether a is of any numeric Unicode category. In addition to including digits, numbers include characters, fractions, subscripts, superscripts, Roman numerals, currency numerators, and encircled numbers. This method contrasts with the method, which determines whether a is a radix-10 digit. > [!IMPORTANT] -> The method is not intended to determine whether a string consists of numeric characters (for example, by calling the method for each character in a string). To determine whether a string consists of numeric characters, call one of the overloads of the `TryParse` method (such as or of an integral or floating point type. +> The method is not intended to determine whether a string consists of numeric characters (for example, by calling the method for each character in a string). To determine whether a string consists of numeric characters, call one of the overloads of the `TryParse` method (such as or of an integral or floating point type. Valid numbers are members of the , , or category. - The method assumes that `c` corresponds to a single linguistic character and checks whether that character represents a number. However, some numbers in the Unicode standard are represented by two objects that form a surrogate pair. For example, the Aegean numbering system consists of code points U+10107 through U+10133. The following example uses the method to instantiate a string that represents AEGEAN NUMBER ONE. As the output from the example shows, the method returns `false` if it is passed either a high surrogate or a low surrogate of this character. + The method assumes that `c` corresponds to a single linguistic character and checks whether that character represents a number. However, some numbers in the Unicode standard are represented by two objects that form a surrogate pair. For example, the Aegean numbering system consists of code points U+10107 through U+10133. The following example uses the method to instantiate a string that represents AEGEAN NUMBER ONE. As the output from the example shows, the method returns `false` if it is passed either a high surrogate or a low surrogate of this character. :::code language="csharp" source="~/snippets/csharp/System/Char/IsNumber/isnumber1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Char.IsNumber/FS/isnumber1.fs" id="Snippet1"::: @@ -2991,7 +2991,7 @@ The following code example demonstrates . ## Examples - The following example demonstrates . + The following example demonstrates . :::code language="csharp" source="~/snippets/csharp/System/Char/IsNumber/isnumber.cs" id="Snippet8"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Char.IsNumber/FS/isnumber.fs" id="Snippet8"::: @@ -3064,16 +3064,16 @@ The following code example demonstrates . is of any numeric Unicode category. In addition to including digits, numbers include characters, fractions, subscripts, superscripts, Roman numerals, currency numerators, and encircled numbers. This method contrasts with the method, which determines whether a is a radix-10 digit. + This method determines whether a is of any numeric Unicode category. In addition to including digits, numbers include characters, fractions, subscripts, superscripts, Roman numerals, currency numerators, and encircled numbers. This method contrasts with the method, which determines whether a is a radix-10 digit. Character positions in a string are indexed starting from zero. > [!IMPORTANT] -> The method is not intended to determine whether a string consists of numeric characters (for example, by calling the method for each character in a string). To determine whether a string consists of numeric characters, call one of the overloads of the `TryParse` method (such as or of an integral or floating point type. +> The method is not intended to determine whether a string consists of numeric characters (for example, by calling the method for each character in a string). To determine whether a string consists of numeric characters, call one of the overloads of the `TryParse` method (such as or of an integral or floating point type. Valid numbers are members of the , , or category. - If the object at position `index` is the first character of a valid surrogate pair, the method determines whether the surrogate pair forms a numeric digit. For example, the Aegean numbering system consists of code points U+10107 through U+10133. The following example uses the method to instantiate a string that represents AEGEAN NUMBER ONE. As the output from the example shows, the method returns `true` if it is passed the high surrogate of AEGEAN NUMBER ONE. However, if it is passed the low surrogate, it considers only the category of the low surrogate and returns `false`. + If the object at position `index` is the first character of a valid surrogate pair, the method determines whether the surrogate pair forms a numeric digit. For example, the Aegean numbering system consists of code points U+10107 through U+10133. The following example uses the method to instantiate a string that represents AEGEAN NUMBER ONE. As the output from the example shows, the method returns `true` if it is passed the high surrogate of AEGEAN NUMBER ONE. However, if it is passed the low surrogate, it considers only the category of the low surrogate and returns `false`. :::code language="csharp" source="~/snippets/csharp/System/Char/IsNumber/isnumber1.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Char.IsNumber/FS/isnumber1.fs" id="Snippet2"::: @@ -3082,7 +3082,7 @@ The following code example demonstrates . ## Examples - The following example demonstrates . + The following example demonstrates . :::code language="csharp" source="~/snippets/csharp/System/Char/IsNumber/isnumber.cs" id="Snippet8"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Char.IsNumber/FS/isnumber.fs" id="Snippet8"::: @@ -3212,7 +3212,7 @@ The following code example demonstrates . - U+3008 to U+3011 ## Examples - The following code example demonstrates . + The following code example demonstrates . :::code language="csharp" source="~/snippets/csharp/System/Char/IsPunctuation/ispunctuation.cs" id="Snippet9"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Char.IsPunctuation/FS/ispunctuation.fs" id="Snippet9"::: @@ -3731,7 +3731,7 @@ The following code example demonstrates . ## Examples - The following example demonstrates . + The following example demonstrates . :::code language="csharp" source="~/snippets/csharp/System/Char/IsSeparator/isseparator.cs" id="Snippet10"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Char.IsSeparator/FS/isseparator.fs" id="Snippet10"::: @@ -3762,7 +3762,7 @@ The following code example demonstrates . method. + The following example demonstrates the method. :::code language="csharp" source="~/snippets/csharp/System/Char/IsSurrogate/issurrogate.cs" id="Snippet11"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Char.IsSurrogate/FS/issurrogate.fs" id="Snippet11"::: @@ -3919,7 +3919,7 @@ The following code example demonstrates . , , and methods. + The following code example demonstrates the , , and methods. :::code language="csharp" source="~/snippets/csharp/System/Char/IsHighSurrogate/sur.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/char.surrogate/FS/sur.fs" id="Snippet1"::: @@ -4092,7 +4092,7 @@ The following code example demonstrates . - Dingbats. ## Examples - The following code example demonstrates . + The following code example demonstrates . :::code language="csharp" source="~/snippets/csharp/System/Char/IsSymbol/issymbol.cs" id="Snippet12"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Char.IsSymbol/FS/issymbol.fs" id="Snippet12"::: @@ -4446,7 +4446,7 @@ The following code example demonstrates . - The characters CHARACTER TABULATION (U+0009), LINE FEED (U+000A), LINE TABULATION (U+000B), FORM FEED (U+000C), CARRIAGE RETURN (U+000D), and NEXT LINE (U+0085). ## Examples - The following example demonstrates the method. + The following example demonstrates the method. :::code language="csharp" source="~/snippets/csharp/System/Char/IsWhiteSpace/iswhitespace.cs" id="Snippet14"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Char.IsWhiteSpace/FS/iswhitespace.fs" id="Snippet14"::: @@ -4769,7 +4769,7 @@ The following code example demonstrates . . + The following code example demonstrates . :::code language="csharp" source="~/snippets/csharp/System/Char/Parse/parse.cs" id="Snippet15"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Char.Parse/FS/parse.fs" id="Snippet15"::: @@ -4979,7 +4979,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method instead. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method instead. ]]> @@ -5251,7 +5251,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method instead. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method instead. ]]> @@ -5309,7 +5309,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method instead. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method instead. ]]> @@ -5367,7 +5367,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method instead. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method instead. ]]> @@ -5431,7 +5431,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method instead. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method instead. ]]> @@ -5586,7 +5586,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method instead. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method instead. ]]> @@ -5653,7 +5653,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method instead. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method instead. ]]> @@ -5717,7 +5717,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method instead. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method instead. ]]> @@ -5781,7 +5781,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method instead. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method instead. ]]> @@ -9444,7 +9444,7 @@ This member is an explicit interface member implementation. It can be used only . + The following example demonstrates . :::code language="csharp" source="~/snippets/csharp/System/Char/ToLower/tolower.cs" id="Snippet16"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Char.ToLower/FS/tolower.fs" id="Snippet16"::: @@ -9507,7 +9507,7 @@ This member is an explicit interface member implementation. It can be used only ## Remarks Casing rules are obtained from the current culture. - Use to convert a string to lowercase. + Use to convert a string to lowercase. ]]> @@ -9575,7 +9575,7 @@ This member is an explicit interface member implementation. It can be used only to convert a string to lowercase. + Use to convert a string to lowercase. ]]> @@ -9644,9 +9644,9 @@ This member is an explicit interface member implementation. It can be used only method. The method is equivalent to `ToLower(Char, CultureInfo.InvariantCulture)`. + If your application is unaffected by the current culture and depends on the case of a character changing in a predictable way, then use the method. The method is equivalent to `ToLower(Char, CultureInfo.InvariantCulture)`. - Use to convert a string to lowercase. + Use to convert a string to lowercase. ]]> @@ -9671,7 +9671,7 @@ This member is an explicit interface member implementation. It can be used only . + The following code example demonstrates . :::code language="csharp" source="~/snippets/csharp/System/Char/ToString/tostring.cs" id="Snippet17"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Char.ToString/FS/tostring.fs" id="Snippet17"::: @@ -9928,7 +9928,7 @@ This member is an explicit interface member implementation. It can be used only ## Remarks Casing rules are obtained from the current culture. - Use to convert a string to uppercase. + Use to convert a string to uppercase. @@ -10005,7 +10005,7 @@ This member is an explicit interface member implementation. It can be used only to convert a string to uppercase. + Use to convert a string to uppercase. @@ -10083,9 +10083,9 @@ This member is an explicit interface member implementation. It can be used only method. The method is equivalent to `ToUpper(Char, CultureInfo.InvariantCulture)`. + If your application is unaffected by the current culture and depends on the case of a character changing in a predictable way, use the method. The method is equivalent to `ToUpper(Char, CultureInfo.InvariantCulture)`. - Use to convert a string to uppercase. + Use to convert a string to uppercase. ]]> @@ -10156,12 +10156,12 @@ This member is an explicit interface member implementation. It can be used only method is like the method, except the method does not throw an exception if the conversion fails. + The method is like the method, except the method does not throw an exception if the conversion fails. ## Examples - The following code example demonstrates overloads of the method for several base types, and the method for the base type. + The following code example demonstrates overloads of the method for several base types, and the method for the base type. :::code language="csharp" source="~/snippets/csharp/System/Char/TryParse/tp.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/T.TryParse/FS/tp.fs" id="Snippet1"::: diff --git a/xml/System/CharEnumerator.xml b/xml/System/CharEnumerator.xml index ccc0c936e20..872f32ec826 100644 --- a/xml/System/CharEnumerator.xml +++ b/xml/System/CharEnumerator.xml @@ -86,11 +86,11 @@ > [!IMPORTANT] > The `CharEnumerator` class enumerates individual 16-bit instances. It does not consider graphemes (that is, a character followed by one or more combiding characters) or surrogate pairs (that is, characters outside the Unicode Basic Multilingual Plane) as single characters. For an enumerator that handles these types of characters as a single unit, use the class. - There is no public constructor for . Instead, call a object's method to obtain a that is initialized to reference the string. + There is no public constructor for . Instead, call a object's method to obtain a that is initialized to reference the string. A maintains an internal index to the characters in the string the references. The state of the index is invalid when it references a character position logically before the first character or after the last character in the string, and valid when it references a character within the string. The index is initialized to a position logically before the first character, and is set to a position after the last character when the iteration is complete. An exception is thrown if you attempt to access a character while the index is invalid. - The method increments the index by one, so the first and subsequent characters are accessed in turn. The method sets the index to a position logically before the first character. The property retrieves the character currently referenced by index. The method creates a copy of the . + The method increments the index by one, so the first and subsequent characters are accessed in turn. The method sets the index to a position logically before the first character. The property retrieves the character currently referenced by index. The method creates a copy of the . > [!NOTE] > Several independent instances of across one or more threads can have access to a single instance of . This class is implemented to support the interface. For more information regarding the use of an enumerator, see the topic. @@ -98,7 +98,7 @@ ## Examples - The following example uses the class to enumerate the individual characters in a string. It instantiates a object by calling the method, moves from one character to the next by calling the method, and displays the current character by retrieving the value of the property. + The following example uses the class to enumerate the individual characters in a string. It instantiates a object by calling the method, moves from one character to the next by calling the method, and displays the current character by retrieving the value of the property. :::code language="csharp" source="~/snippets/csharp/System/CharEnumerator/Overview/CharEnumerator1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.CharEnumerator.Class/fs/CharEnumerator1.fs" id="Snippet1"::: @@ -173,7 +173,7 @@ ## Remarks The return value is a copy of this instance of and its current state. This is useful for saving your state while iterating through a object. - For example, suppose your application uses an original instance of to iterate through each character in a . When some unique character is encountered, your application pauses processing and invokes the method. In effect, this saves the object's index in the . + For example, suppose your application uses an original instance of to iterate through each character in a . When some unique character is encountered, your application pauses processing and invokes the method. In effect, this saves the object's index in the . Your application uses the clone to navigate to another part of the `String` to perform some auxiliary processing. The side-effect of this navigation is the clone loses track of the position where processing stopped. However, when the auxiliary processing is complete, your application discards the clone and uses the original instance to resume working on the where the original processing stopped. @@ -232,14 +232,14 @@ ## Remarks The class maintains an internal index to the enumerated string, and the property returns the character that is currently referenced by the index. This property should be invoked only when the index is valid; otherwise, an exception is thrown. - The index is always invalid for an empty string (""). The index is also invalid after the or method is called. After either of these methods is called, invoke the method to adjust the index to the first character in the enumerated string. The index is valid whenever the method returns `true`. + The index is always invalid for an empty string (""). The index is also invalid after the or method is called. After either of these methods is called, invoke the method to adjust the index to the first character in the enumerated string. The index is valid whenever the method returns `true`. - does not move the index, and consecutive calls to return the same character until , , or is called. + does not move the index, and consecutive calls to return the same character until , , or is called. ## Examples - The following example uses the class to enumerate the individual characters in a string. It instantiates a object by calling the method, moves from one character to the next by calling the method, and displays the current character by retrieving the value of the property. + The following example uses the class to enumerate the individual characters in a string. It instantiates a object by calling the method, moves from one character to the next by calling the method, and displays the current character by retrieving the value of the property. :::code language="csharp" source="~/snippets/csharp/System/CharEnumerator/Overview/CharEnumerator1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.CharEnumerator.Class/fs/CharEnumerator1.fs" id="Snippet1"::: @@ -300,12 +300,12 @@ when you are finished using the . The method leaves the in an unusable state. After calling , you must release all references to the so the garbage collector can reclaim the memory that the was occupying. + Call when you are finished using the . The method leaves the in an unusable state. After calling , you must release all references to the so the garbage collector can reclaim the memory that the was occupying. For more information, see [Cleaning Up Unmanaged Resources](/dotnet/standard/garbage-collection/unmanaged) and [Implementing a Dispose Method](/dotnet/standard/garbage-collection/implementing-dispose). > [!NOTE] -> Always call before you release your last reference to the . Otherwise, the resources it is using will not be freed until the garbage collector calls the object's `Finalize` method. +> Always call before you release your last reference to the . Otherwise, the resources it is using will not be freed until the garbage collector calls the object's `Finalize` method. ]]> @@ -359,14 +359,14 @@ class maintains an internal index to the enumerated string, and the method increments the index by one. Call after calling or to increment the current character position to the first character in the enumerated string. Check that the return value is `true` to determine that the current character position is valid. + The class maintains an internal index to the enumerated string, and the method increments the index by one. Call after calling or to increment the current character position to the first character in the enumerated string. Check that the return value is `true` to determine that the current character position is valid. If the index is already beyond the last character of the enumerated string, the index is not changed and `false` is returned. - Notice that if the enumerated string is empty (""), the state of the is always invalid. This is because the internal index for the is initially before the first character of the enumerated string and is therefore invalid. logically sets the index after the last (nonexistent) character of the enumerated string, which is also invalid. + Notice that if the enumerated string is empty (""), the state of the is always invalid. This is because the internal index for the is initially before the first character of the enumerated string and is therefore invalid. logically sets the index after the last (nonexistent) character of the enumerated string, which is also invalid. ## Examples - The following example uses the class to enumerate the individual characters in a string. It instantiates a object by calling the method, moves from one character to the next by calling the method, and displays the current character by retrieving the value of the property. + The following example uses the class to enumerate the individual characters in a string. It instantiates a object by calling the method, moves from one character to the next by calling the method, and displays the current character by retrieving the value of the property. :::code language="csharp" source="~/snippets/csharp/System/CharEnumerator/Overview/CharEnumerator1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.CharEnumerator.Class/fs/CharEnumerator1.fs" id="Snippet1"::: @@ -428,7 +428,7 @@ class maintains an internal index to the enumerated string, and the method sets the index to the invalid state. + The class maintains an internal index to the enumerated string, and the method sets the index to the invalid state. ]]> diff --git a/xml/System/Comparison`1.xml b/xml/System/Comparison`1.xml index c57350e99c2..2a4545ea09c 100644 --- a/xml/System/Comparison`1.xml +++ b/xml/System/Comparison`1.xml @@ -98,22 +98,22 @@ method overload of the class and the method overload of the class to sort the elements of an array or list. + This delegate is used by the method overload of the class and the method overload of the class to sort the elements of an array or list. ## Examples - The following code example demonstrates the use of the delegate with the method overload. + The following code example demonstrates the use of the delegate with the method overload. The code example defines an alternative comparison method for strings, named `CompareDinosByLength`. This method works as follows: First, the comparands are tested for `null`, and a null reference is treated as less than a non-null. Second, the string lengths are compared, and the longer string is deemed to be greater. Third, if the lengths are equal, ordinary string comparison is used. - A of strings is created and populated with four strings, in no particular order. The list also includes an empty string and a null reference. The list is displayed, sorted using a generic delegate representing the `CompareDinosByLength` method, and displayed again. - + A of strings is created and populated with four strings, in no particular order. The list also includes an empty string and a null reference. The list is displayed, sorted using a generic delegate representing the `CompareDinosByLength` method, and displayed again. + :::code language="csharp" source="~/snippets/csharp/System/ComparisonT/Overview/source.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/List`1_SortComparison/fs/source.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/ComparisonT/Overview/source.vb" id="Snippet1"::: - The following example uses the delegate to sort the elements of a collection of `CityInfo` objects. `CityInfo` is an application-defined class that contains information about a city and its population. The example defines three methods, `CompareByName`, `CompareByPopulation`, and `CompareByNames`, that offer three different ways of ordering the `CityInfo` objects. Each method is assigned to the `comparison` argument of the method. + The following example uses the delegate to sort the elements of a collection of `CityInfo` objects. `CityInfo` is an application-defined class that contains information about a city and its population. The example defines three methods, `CompareByName`, `CompareByPopulation`, and `CompareByNames`, that offer three different ways of ordering the `CityInfo` objects. Each method is assigned to the `comparison` argument of the method. :::code language="csharp" source="~/snippets/csharp/System/ComparisonT/Overview/comparisont1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.comparison`1/fs/comparisont1.fs" id="Snippet1"::: diff --git a/xml/System/Console.xml b/xml/System/Console.xml index 6d4ee510ec6..467c5f2a5d5 100644 --- a/xml/System/Console.xml +++ b/xml/System/Console.xml @@ -129,18 +129,18 @@ property affects only output that is written to individual character cells after the background color is changed. To change the background color of the console window as a whole, set the property and call the method. The following example provides an illustration. + A change to the property affects only output that is written to individual character cells after the background color is changed. To change the background color of the console window as a whole, set the property and call the method. The following example provides an illustration. :::code language="csharp" source="~/snippets/csharp/System/Console/BackgroundColor/backgroundcolor1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.console.backgroundcolor/fs/backgroundcolor1.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/Console/BackgroundColor/backgroundcolor1.vb" id="Snippet1"::: A get operation for a Windows-based application, in which a console does not exist, returns . - Unix systems don't provide any general mechanism to fetch the current console colors. Because of that, returns `(ConsoleColor)-1` until it is set in explicit way (using the setter). + Unix systems don't provide any general mechanism to fetch the current console colors. Because of that, returns `(ConsoleColor)-1` until it is set in explicit way (using the setter). ## Examples - The following example saves the values of the enumeration to an array and stores the current values of the and properties to variables. It then changes the foreground color to each color in the enumeration except to the color that matches the current background, and it changes the background color to each color in the enumeration except to the color that matches the current foreground. (If the foreground color is the same as the background color, the text isn't visible.) Finally, it calls the method to restore the original console colors. + The following example saves the values of the enumeration to an array and stores the current values of the and properties to variables. It then changes the foreground color to each color in the enumeration except to the color that matches the current background, and it changes the background color to each color in the enumeration except to the color that matches the current foreground. (If the foreground color is the same as the background color, the text isn't visible.) Finally, it calls the method to restore the original console colors. :::code language="csharp" source="~/snippets/csharp/System/Console/BackgroundColor/foregroundcolor3.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.consolecolor/fs/foregroundcolor3.fs" id="Snippet1"::: @@ -226,10 +226,10 @@ ## Remarks By default, the beep plays at a frequency of 800 hertz for a duration of 200 milliseconds. - wraps a call to the Windows [Beep function](/windows/win32/api/utilapiset/nf-utilapiset-beep). Whether produces a sound on versions of Windows before Windows 7 depends on the presence of a 8254 programmable interval timer chip. Starting with Windows 7, it depends on the default sound device. + wraps a call to the Windows [Beep function](/windows/win32/api/utilapiset/nf-utilapiset-beep). Whether produces a sound on versions of Windows before Windows 7 depends on the presence of a 8254 programmable interval timer chip. Starting with Windows 7, it depends on the default sound device. ## Examples - The following example demonstrates the method. The example accepts a number from 1 through 9 as a command line argument, and plays the beep that number of times. + The following example demonstrates the method. The example accepts a number from 1 through 9 as a command line argument, and plays the beep that number of times. :::code language="csharp" source="~/snippets/csharp/System/Console/Beep/beep.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/console.beep/FS/beep.fs" id="Snippet1"::: @@ -298,11 +298,11 @@ wraps a call to the Windows [Beep function](/windows/win32/api/utilapiset/nf-utilapiset-beep). Whether produces a sound on versions of Windows before Windows 7 depends on the presence of a 8254 programmable interval timer chip. Starting with Windows 7, it depends on the default sound device. + wraps a call to the Windows [Beep function](/windows/win32/api/utilapiset/nf-utilapiset-beep). Whether produces a sound on versions of Windows before Windows 7 depends on the presence of a 8254 programmable interval timer chip. Starting with Windows 7, it depends on the default sound device. ## Examples - This example demonstrates the method by playing the first few notes of a song through the console speaker. + This example demonstrates the method by playing the first few notes of a song through the console speaker. :::code language="csharp" source="~/snippets/csharp/System/Console/Beep/b2.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/console.beep2/FS/b2.fs" id="Snippet1"::: @@ -399,7 +399,7 @@ ## Examples - This example demonstrates the and properties. The example reports the dimensions of an operating system window set to a buffer size of 300 rows and 85 columns. + This example demonstrates the and properties. The example reports the dimensions of an operating system window set to a buffer size of 300 rows and 85 columns. :::code language="csharp" source="~/snippets/csharp/System/Console/BufferHeight/hw.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/console.bufferHW/FS/hw.fs" id="Snippet1"::: @@ -499,7 +499,7 @@ ## Examples - This example demonstrates the and properties. The example reports the dimensions of an operating system window set to a buffer size of 300 rows and 85 columns. + This example demonstrates the and properties. The example reports the dimensions of an operating system window set to a buffer size of 300 rows and 85 columns. :::code language="csharp" source="~/snippets/csharp/System/Console/BufferHeight/hw.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/console.bufferHW/FS/hw.fs" id="Snippet1"::: @@ -598,9 +598,9 @@ When the user presses either Ctrl+C or Ctrl+Break, the event is fired and the application's event handler is executed. The event handler is passed a object that has two useful properties: -- , which allows you to determine whether the handler was invoked as a result of the user pressing Ctrl+C (the property value is ) or Ctrl+Break (the property value is ). +- , which allows you to determine whether the handler was invoked as a result of the user pressing Ctrl+C (the property value is ) or Ctrl+Break (the property value is ). -- , which allows you to determine how your application should respond to the user pressing Ctrl+C or Ctrl+Break. By default, the property is `false`, which causes program execution to terminate when the event handler exits. Changing its property to `true` specifies that the application should continue to execute. +- , which allows you to determine how your application should respond to the user pressing Ctrl+C or Ctrl+Break. By default, the property is `false`, which causes program execution to terminate when the event handler exits. Changing its property to `true` specifies that the application should continue to execute. > [!TIP] > If your application has simple requirements, you can use the property instead of this event. By setting this property to `false`, you can ensure that your application always exits if the user presses Ctrl+C. By setting it to `true`, you can ensure that pressing Ctrl+C will not terminate the application. @@ -738,15 +738,15 @@ method is equivalent invoking the MS-DOS `cls` command in the command prompt window. When the method is called, the cursor automatically scrolls to the top-left corner of the window and the contents of the screen buffer are set to blanks using the current foreground background colors. + Using the method is equivalent invoking the MS-DOS `cls` command in the command prompt window. When the method is called, the cursor automatically scrolls to the top-left corner of the window and the contents of the screen buffer are set to blanks using the current foreground background colors. > [!NOTE] -> Attempting to call the method when a console application's output is redirected to a file throws a . To prevent this, always wrap a call to the method in a `try`…`catch` block. +> Attempting to call the method when a console application's output is redirected to a file throws a . To prevent this, always wrap a call to the method in a `try`…`catch` block. ## Examples - The following example uses the method to clear the console before it executes a loop, prompts the user to select a foreground and background color and to enter a string to display. If the user chooses not to exit the program, the console's original foreground and background colors are restored and the method is called again before re-executing the loop. + The following example uses the method to clear the console before it executes a loop, prompts the user to select a foreground and background color and to enter a string to display. If the user chooses not to exit the program, the console's original foreground and background colors are restored and the method is called again before re-executing the loop. :::code language="csharp" source="~/snippets/csharp/System/Console/Clear/clear1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.console.clear/fs/clear1.fs" id="Snippet1"::: @@ -754,7 +754,7 @@ The example relies on a `GetKeyPress` method to validate the user's selection of a foreground and background color. - This example demonstrates the and properties, and the and methods. The example positions the cursor, which determines where the next write will occur, to draw a 5 character by 5 character rectangle using a combination of "+", "|", and "-" strings. Note that the rectangle could be drawn with fewer steps using a combination of other strings. + This example demonstrates the and properties, and the and methods. The example positions the cursor, which determines where the next write will occur, to draw a 5 character by 5 character rectangle using a combination of "+", "|", and "-" strings. Note that the rectangle could be drawn with fewer steps using a combination of other strings. :::code language="csharp" source="~/snippets/csharp/System/Console/Clear/lts.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/console.cursorLTS/FS/lts.fs" id="Snippet1"::: @@ -834,7 +834,7 @@ and properties, and the and methods. The example positions the cursor, which determines where the next write will occur, to draw a 5 character by 5 character rectangle using a combination of "+", "|", and "-" strings. Note that the rectangle could be drawn with fewer steps using a combination of other strings. + This example demonstrates the and properties, and the and methods. The example positions the cursor, which determines where the next write will occur, to draw a 5 character by 5 character rectangle using a combination of "+", "|", and "-" strings. Note that the rectangle could be drawn with fewer steps using a combination of other strings. :::code language="csharp" source="~/snippets/csharp/System/Console/Clear/lts.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/console.cursorLTS/FS/lts.fs" id="Snippet1"::: @@ -1012,7 +1012,7 @@ and properties, and the and methods. The example positions the cursor, which determines where the next write will occur, to draw a 5 character by 5 character rectangle using a combination of "+", "|", and "-" strings. Note that the rectangle could be drawn with fewer steps using a combination of other strings. + This example demonstrates the and properties, and the and methods. The example positions the cursor, which determines where the next write will occur, to draw a 5 character by 5 character rectangle using a combination of "+", "|", and "-" strings. Note that the rectangle could be drawn with fewer steps using a combination of other strings. :::code language="csharp" source="~/snippets/csharp/System/Console/Clear/lts.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/console.cursorLTS/FS/lts.fs" id="Snippet1"::: @@ -1166,7 +1166,7 @@ method. After the standard error stream is redirected, it can be reacquired by calling the method. + This standard error stream is set to the console by default. It can be set to another stream with the method. After the standard error stream is redirected, it can be reacquired by calling the method. In console applications whose informational output is often redirected to a file, the standard error stream available through the property can be used to display information to the console even if output is redirected. The following example displays product tables for 10 numbers at a time starting with 1. After every set of 10 numbers, the property is used to ask the user whether to display the next set. If the standard output is redirected to a file, the user is still asked whether the routine should generate the next set of products. @@ -1183,7 +1183,7 @@ :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/Console-EXPANDTABSEX/FS/expandtabsex.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/Console/Error/expandtabsex.vb" id="Snippet1"::: - The following example is a simple text file viewer that displays the contents of one or more text files to the console. If there are no command line arguments, or if any files passed as command line arguments do not exist, the example calls the method to redirect error information to a file, calls the method in the process of reacquiring the standard error stream, and indicates that error information was written to a file. + The following example is a simple text file viewer that displays the contents of one or more text files to the console. If there are no command line arguments, or if any files passed as command line arguments do not exist, the example calls the method to redirect error information to a file, calls the method in the process of reacquiring the standard error stream, and indicates that error information was written to a file. :::code language="csharp" source="~/snippets/csharp/System/Console/Error/viewtextfile.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.console.openstandarderror/fs/viewtextfile.fs" id="Snippet1"::: @@ -1269,7 +1269,7 @@ ## Remarks A get operation for a Windows-based application, in which a console does not exist, returns . - Unix systems don't provide any general mechanism to fetch the current console colors. Because of that, returns `(ConsoleColor)-1` until it is set in explicit way (using the setter). + Unix systems don't provide any general mechanism to fetch the current console colors. Because of that, returns `(ConsoleColor)-1` until it is set in explicit way (using the setter). @@ -1280,7 +1280,7 @@ :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.consolecolor/fs/Example2.fs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System/Console/BackgroundColor/Example2.vb" id="Snippet2"::: - The following example saves the values of the enumeration to an array and stores the current values of the and properties to variables. It then changes the foreground color to each color in the enumeration except to the color that matches the current background, and it changes the background color to each color in the enumeration except to the color that matches the current foreground. (If the foreground color is the same as the background color, the text isn't visible.) Finally, it calls the method to restore the original console colors. + The following example saves the values of the enumeration to an array and stores the current values of the and properties to variables. It then changes the foreground color to each color in the enumeration except to the color that matches the current background, and it changes the background color to each color in the enumeration except to the color that matches the current foreground. (If the foreground color is the same as the background color, the text isn't visible.) Finally, it calls the method to restore the original console colors. :::code language="csharp" source="~/snippets/csharp/System/Console/BackgroundColor/foregroundcolor3.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.consolecolor/fs/foregroundcolor3.fs" id="Snippet1"::: @@ -1422,9 +1422,9 @@ Columns are numbered from left to right starting at 0. Rows are numbered from to method. + This property is set to the standard input stream by default. This property can be set to another stream with the method. - Read operations on the standard input stream execute synchronously. That is, they block until the specified read operation has completed. This is true even if an asynchronous method, such as , is called on the object returned by the property. + Read operations on the standard input stream execute synchronously. That is, they block until the specified read operation has completed. This is true even if an asynchronous method, such as , is called on the object returned by the property. @@ -1730,7 +1730,7 @@ Columns are numbered from left to right starting at 0. Rows are numbered from to ## Remarks The property value is returned immediately; that is, the property does not block input until a key press is available. - Use the property in conjunction with only the method, not the or methods. + Use the property in conjunction with only the method, not the or methods. @@ -1953,7 +1953,7 @@ Columns are numbered from left to right starting at 0. Rows are numbered from to ## Remarks If the destination and source parameters specify a position located outside the boundaries of the current screen buffer, only the portion of the source area that fits within the destination area is copied. That is, the source area is clipped to fit the current screen buffer. - The method copies the source area to the destination area. If the destination area does not intersect the source area, the source area is filled with blanks using the current foreground and background colors. Otherwise, the intersected portion of the source area is not filled. + The method copies the source area to the destination area. If the destination area does not intersect the source area, the source area is filled with blanks using the current foreground and background colors. Otherwise, the intersected portion of the source area is not filled. ]]> @@ -2053,9 +2053,9 @@ Columns are numbered from left to right starting at 0. Rows are numbered from to ## Remarks If the destination and source parameters specify a position located beyond the boundaries of the current screen buffer, only the portion of the source area that fits within the destination area is copied. That is, the source area is clipped to fit the current screen buffer. - The method copies the source area to the destination area. If the destination area does not intersect the source area, the source area is filled with the character specified by `sourceChar`, using the colors specified by `sourceForeColor` and `sourceBackColor`. Otherwise, the intersected portion of the source area is not filled. + The method copies the source area to the destination area. If the destination area does not intersect the source area, the source area is filled with the character specified by `sourceChar`, using the colors specified by `sourceForeColor` and `sourceBackColor`. Otherwise, the intersected portion of the source area is not filled. - The method performs no operation if `sourceWidth` or `sourceHeight` is zero. + The method performs no operation if `sourceWidth` or `sourceHeight` is zero. ]]> @@ -2191,12 +2191,12 @@ Columns are numbered from left to right starting at 0. Rows are numbered from to method. + This method can be used to reacquire the standard error stream after it has been changed by the method. ## Examples - The following example is a simple text file viewer that displays the contents of one or more text files to the console. If there are no command line arguments, or if any files passed as command line arguments do not exist, the example calls the method to redirect error information to a file, calls the method in the process of reacquiring the standard error stream, and indicates that error information was written to a file. + The following example is a simple text file viewer that displays the contents of one or more text files to the console. If there are no command line arguments, or if any files passed as command line arguments do not exist, the example calls the method to redirect error information to a file, calls the method in the process of reacquiring the standard error stream, and indicates that error information was written to a file. :::code language="csharp" source="~/snippets/csharp/System/Console/Error/viewtextfile.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.console.openstandarderror/fs/viewtextfile.fs" id="Snippet1"::: @@ -2258,7 +2258,7 @@ Columns are numbered from left to right starting at 0. Rows are numbered from to method. + This method can be used to reacquire the standard error stream after it has been changed by the method. ]]> @@ -2382,7 +2382,7 @@ Columns are numbered from left to right starting at 0. Rows are numbered from to ## Remarks -This method can be used to reacquire the standard input stream after it has been changed by the method. +This method can be used to reacquire the standard input stream after it has been changed by the method. ## Examples @@ -2457,7 +2457,7 @@ The following example illustrates the use of the `OpenStandardInput` method. ## Remarks -This method can be used to reacquire the standard output stream after it has been changed by the method. +This method can be used to reacquire the standard output stream after it has been changed by the method. ]]> @@ -2566,12 +2566,12 @@ This method can be used to reacquire the standard output stream after it has bee method. + This method can be used to reacquire the standard output stream after it has been changed by the method. ## Examples - The following example illustrates the use of the method. It replaces four consecutive space characters in a string with a tab character. To run it, you must supply two command-line arguments. The first is the name of an existing text file to redirect the standard input stream to. The second is the name of a file to redirect the standard output stream to. This file need not exist. If it does, its contents will be overwritten. + The following example illustrates the use of the method. It replaces four consecutive space characters in a string with a tab character. To run it, you must supply two command-line arguments. The first is the name of an existing text file to redirect the standard input stream to. The second is the name of a file to redirect the standard output stream to. This file need not exist. If it does, its contents will be overwritten. :::code language="csharp" source="~/snippets/csharp/System/Console/OpenStandardOutput/inserttabs.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Console-INSERTTABS/FS/inserttabs.fs" id="Snippet1"::: @@ -2631,12 +2631,12 @@ This method can be used to reacquire the standard output stream after it has bee method. + This method can be used to reacquire the standard output stream after it has been changed by the method. ## Examples - The following example illustrates the use of the method. It replaces four consecutive space characters in a string with a tab character. To run it, you must supply two command line arguments. The first is the name of an existing text file to redirect the standard input stream to. The second is the name of a file to redirect the standard output stream to. This file need not exist. If it does, its contents will be overwritten. + The following example illustrates the use of the method. It replaces four consecutive space characters in a string with a tab character. To run it, you must supply two command line arguments. The first is the name of an existing text file to redirect the standard input stream to. The second is the name of a file to redirect the standard output stream to. This file need not exist. If it does, its contents will be overwritten. :::code language="csharp" source="~/snippets/csharp/System/Console/OpenStandardOutput/inserttabs.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Console-INSERTTABS/FS/inserttabs.fs" id="Snippet1"::: @@ -2740,9 +2740,9 @@ This method can be used to reacquire the standard output stream after it has bee method. + This property is set to the standard output stream by default. This property can be set to another stream with the method. - Note that calls to `Console.Out.WriteLine` methods are equivalent to calls to the corresponding methods. + Note that calls to `Console.Out.WriteLine` methods are equivalent to calls to the corresponding methods. @@ -2902,10 +2902,10 @@ This method can be used to reacquire the standard output stream after it has bee method blocks its return while you type input characters; it terminates when you press the key. Pressing Enter appends a platform-dependent line termination sequence to your input (for example, Windows appends a carriage return-linefeed sequence). Subsequent calls to the method retrieve your input one character at a time. After the final character is retrieved, blocks its return again and the cycle repeats. + The method blocks its return while you type input characters; it terminates when you press the key. Pressing Enter appends a platform-dependent line termination sequence to your input (for example, Windows appends a carriage return-linefeed sequence). Subsequent calls to the method retrieve your input one character at a time. After the final character is retrieved, blocks its return again and the cycle repeats. > [!IMPORTANT] -> The method, or the property and method are preferable to using the method. +> The method, or the property and method are preferable to using the method. Note that the method does not return -1 unless you perform one of the following actions: @@ -2916,7 +2916,7 @@ This method can be used to reacquire the standard output stream after it has bee - Redirect the input stream to a source, such as a text file, that has an actual end-of-file character. ## Examples - The following example demonstrates the method. + The following example demonstrates the method. :::code language="csharp" source="~/snippets/csharp/System/Console/Read/read.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/console.read/FS/read.fs" id="Snippet1"::: @@ -3002,11 +3002,11 @@ This method can be used to reacquire the standard output stream after it has bee method waits, that is, blocks on the thread issuing the method, until a character or function key is pressed. A character or function key can be pressed in combination with one or more Alt, Ctrl, or Shift modifier keys. However, pressing a modifier key by itself will not cause the method to return. + The method waits, that is, blocks on the thread issuing the method, until a character or function key is pressed. A character or function key can be pressed in combination with one or more Alt, Ctrl, or Shift modifier keys. However, pressing a modifier key by itself will not cause the method to return. - Depending on your application, you might want to use the method in conjunction with the property. + Depending on your application, you might want to use the method in conjunction with the property. - The method reads from the keyboard even if the standard input is redirected to a file with the method. + The method reads from the keyboard even if the standard input is redirected to a file with the method. ## Examples One of the most common uses of the method is to halt program execution until the user presses a key and the app either terminates or displays an additional window of information. The following example uses the method to wait for the user to press the Enter key before terminating the app. @@ -3015,7 +3015,7 @@ This method can be used to reacquire the standard output stream after it has bee :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/System.Console.ReadKey/fs/ReadKey1.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/Console/ReadKey/ReadKey1.vb" id="Snippet1"::: - Note that this overload of the method by default echoes any displayable keys that the user presses to the console. To suppress them, call the method with an `intercept` argument of `true`. + Note that this overload of the method by default echoes any displayable keys that the user presses to the console. To suppress them, call the method with an `intercept` argument of `true`. The following example uses the method to display information about which key the user pressed. @@ -3101,22 +3101,22 @@ This method can be used to reacquire the standard output stream after it has bee method waits, that is, blocks on the thread issuing the method, until a character or function key is pressed. A character or function key can be pressed in combination with one or more Alt, Ctrl, or Shift modifier keys. However, pressing a modifier key by itself will not cause the method to return. + The method waits, that is, blocks on the thread issuing the method, until a character or function key is pressed. A character or function key can be pressed in combination with one or more Alt, Ctrl, or Shift modifier keys. However, pressing a modifier key by itself will not cause the method to return. If the `intercept` parameter is `true`, the pressed key is intercepted and not displayed in the console window; otherwise, the pressed key is displayed. - Depending on your application, you might want to use the method in conjunction with the property. + Depending on your application, you might want to use the method in conjunction with the property. - The method reads from the keyboard even if the standard input is redirected to a file with the method. + The method reads from the keyboard even if the standard input is redirected to a file with the method. ## Examples - One of the most common uses of the method is to halt program execution until the user presses a key and the app either terminates or displays an additional window of information. The following example uses the method to wait for the user to press the Enter key before terminating the app. Note that, if the user presses any other key, it is not echoed to the console. + One of the most common uses of the method is to halt program execution until the user presses a key and the app either terminates or displays an additional window of information. The following example uses the method to wait for the user to press the Enter key before terminating the app. Note that, if the user presses any other key, it is not echoed to the console. :::code language="csharp" source="~/snippets/csharp/System/Console/ReadKey/ReadKey2.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/System.Console.ReadKey/fs/ReadKey2.fs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System/Console/ReadKey/ReadKey2.vb" id="Snippet2"::: - The following example uses the method to display information about the key pressed by a user without echoing that key to the console. + The following example uses the method to display information about the key pressed by a user without echoing that key to the console. :::code language="csharp" source="~/snippets/csharp/System/Console/ReadKey/rkbool.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/console.readkey2/FS/rkbool.fs" id="Snippet1"::: @@ -3187,17 +3187,17 @@ This method can be used to reacquire the standard output stream after it has bee method reads a line from the standard input stream. (For the definition of a line, see the paragraph after the following list.) This means that: + The method reads a line from the standard input stream. (For the definition of a line, see the paragraph after the following list.) This means that: -- If the standard input device is the keyboard, the method blocks until the user presses the **Enter** key. +- If the standard input device is the keyboard, the method blocks until the user presses the **Enter** key. - One of the most common uses of the method is to pause program execution before clearing the console and displaying new information to it, or to prompt the user to press the Enter key before terminating the application. The following example illustrates this. + One of the most common uses of the method is to pause program execution before clearing the console and displaying new information to it, or to prompt the user to press the Enter key before terminating the application. The following example illustrates this. :::code language="csharp" source="~/snippets/csharp/System/Console/ReadLine/ReadLineSimple.cs" id="Snippet6"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Console.ReadLine/fs/ReadLineSimple.fs" id="Snippet6"::: :::code language="vb" source="~/snippets/visualbasic/System/Console/ReadLine/ReadLineSimple.vb" id="Snippet6"::: -- If standard input is redirected to a file, the method reads a line of text from a file. For example, the following is a text file named ReadLine1.txt: +- If standard input is redirected to a file, the method reads a line of text from a file. For example, the following is a text file named ReadLine1.txt: ``` @@ -3208,7 +3208,7 @@ This method can be used to reacquire the standard output stream after it has bee ``` - The following example uses the method to read input that is redirected from a file. The read operation terminates when the method returns `null`, which indicates that no lines remain to be read. + The following example uses the method to read input that is redirected from a file. The read operation terminates when the method returns `null`, which indicates that no lines remain to be read. :::code language="csharp" source="~/snippets/csharp/System/Console/ReadLine/ReadLine3.cs" id="Snippet3"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Console.ReadLine/fs/ReadLine3.fs" id="Snippet3"::: @@ -3220,20 +3220,20 @@ This method can be used to reacquire the standard output stream after it has bee ReadLine1 < ReadLine1.txt ``` - A line is defined as a sequence of characters followed by a carriage return (hexadecimal 0x000d), a line feed (hexadecimal 0x000a), or the value of the property. The returned string does not contain the terminating character(s). By default, the method reads input from a 256-character input buffer. Because this includes the character(s), the method can read lines that contain up to 254 characters. To read longer lines, call the method. + A line is defined as a sequence of characters followed by a carriage return (hexadecimal 0x000d), a line feed (hexadecimal 0x000a), or the value of the property. The returned string does not contain the terminating character(s). By default, the method reads input from a 256-character input buffer. Because this includes the character(s), the method can read lines that contain up to 254 characters. To read longer lines, call the method. - The method executes synchronously. That is, it blocks until a line is read or the Ctrl+Z keyboard combination (followed by Enter on Windows), is pressed. The property returns a object that represents the standard input stream and that has both a synchronous method and an asynchronous method. However, when used as the console's standard input stream, the executes synchronously rather than asynchronously and returns a `Task` only after the read operation has completed. + The method executes synchronously. That is, it blocks until a line is read or the Ctrl+Z keyboard combination (followed by Enter on Windows), is pressed. The property returns a object that represents the standard input stream and that has both a synchronous method and an asynchronous method. However, when used as the console's standard input stream, the executes synchronously rather than asynchronously and returns a `Task` only after the read operation has completed. - If this method throws an exception, the reader's position in the underlying object is advanced by the number of characters the method was able to read, but the characters already read into the internal buffer are discarded. Since the position of the reader in the stream cannot be changed, the characters already read are unrecoverable, and can be accessed only by reinitializing the . If the initial position within the stream is unknown or the stream does not support seeking, the underlying also needs to be reinitialized. To avoid such a situation and to produce robust code, you should use the property and method and store the read characters in a pre-allocated buffer. + If this method throws an exception, the reader's position in the underlying object is advanced by the number of characters the method was able to read, but the characters already read into the internal buffer are discarded. Since the position of the reader in the stream cannot be changed, the characters already read are unrecoverable, and can be accessed only by reinitializing the . If the initial position within the stream is unknown or the stream does not support seeking, the underlying also needs to be reinitialized. To avoid such a situation and to produce robust code, you should use the property and method and store the read characters in a pre-allocated buffer. - If the Ctrl+Z key combination (followed by Enter on Windows) is pressed when the method is reading input from the console, the method returns `null`. This enables the user to prevent further keyboard input when the method is called in a loop. The following example illustrates this scenario. + If the Ctrl+Z key combination (followed by Enter on Windows) is pressed when the method is reading input from the console, the method returns `null`. This enables the user to prevent further keyboard input when the method is called in a loop. The following example illustrates this scenario. :::code language="csharp" source="~/snippets/csharp/System/Console/ReadLine/ReadLine2.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Console.ReadLine/fs/ReadLine2.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/Console/ReadLine/ReadLine2.vb" id="Snippet1"::: ## Examples - The following example requires two command line arguments: the name of an existing text file, and the name of a file to write the output to. It opens the existing text file and redirects the standard input from the keyboard to that file. It also redirects the standard output from the console to the output file. It then uses the method to read each line in the file, replaces every sequence of four spaces with a tab character, and uses the method to write the result to the output file. + The following example requires two command line arguments: the name of an existing text file, and the name of a file to write the output to. It opens the existing text file and redirects the standard input from the keyboard to that file. It also redirects the standard output from the console to the output file. It then uses the method to read each line in the file, replaces every sequence of four spaces with a tab character, and uses the method to write the result to the output file. :::code language="csharp" source="~/snippets/csharp/System/Console/OpenStandardOutput/inserttabs.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Console-INSERTTABS/FS/inserttabs.fs" id="Snippet1"::: @@ -3314,12 +3314,12 @@ This method can be used to reacquire the standard output stream after it has bee and properties. + The foreground and background colors are restored to the colors that existed when the current process began. For more information, see the and properties. ## Examples - The following example saves the values of the enumeration to an array and stores the current values of the and properties to variables. It then changes the foreground color to each color in the enumeration except to the color that matches the current background, and it changes the background color to each color in the enumeration except to the color that matches the current foreground. (If the foreground color is the same as the background color, the text isn't visible.) Finally, it calls the method to restore the original console colors. + The following example saves the values of the enumeration to an array and stores the current values of the and properties to variables. It then changes the foreground color to each color in the enumeration except to the color that matches the current background, and it changes the background color to each color in the enumeration except to the color that matches the current foreground. (If the foreground color is the same as the background color, the text isn't visible.) Finally, it calls the method to restore the original console colors. :::code language="csharp" source="~/snippets/csharp/System/Console/BackgroundColor/foregroundcolor3.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.consolecolor/fs/foregroundcolor3.fs" id="Snippet1"::: @@ -3389,7 +3389,7 @@ This method can be used to reacquire the standard output stream after it has bee , , , , , , and properties; and the , , and methods. The example draws a grid pattern in the screen buffer based on the screen buffer width. Then the example moves the console window in response to which of the UP ARROW, DOWN ARROW, LEFT ARROW, or RIGHT ARROW console keys is pressed. The grid pattern helps you see the movement of the console window relative to the screen buffer. + The following example demonstrates the , , , , , , and properties; and the , , and methods. The example draws a grid pattern in the screen buffer based on the screen buffer width. Then the example moves the console window in response to which of the UP ARROW, DOWN ARROW, LEFT ARROW, or RIGHT ARROW console keys is pressed. The grid pattern helps you see the movement of the console window relative to the screen buffer. :::code language="csharp" source="~/snippets/csharp/System/Console/SetBufferSize/wlt.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/Console/SetBufferSize/wlt.vb" id="Snippet1"::: @@ -3486,14 +3486,14 @@ This method can be used to reacquire the standard output stream after it has bee method to specify where the next write operation in the console window is to begin. If the specified cursor position is outside the area that is currently visible in the console window, the window origin changes automatically to make the cursor visible. + Use the method to specify where the next write operation in the console window is to begin. If the specified cursor position is outside the area that is currently visible in the console window, the window origin changes automatically to make the cursor visible. - The cursor automatically moves to the next character position each time a character is written to the console window. If the cursor is at the bottom right character position of the console window, the next write operation causes the console window to scroll so the cursor remains visible. If you want to write a character to the bottom right character position without causing the console window to scroll, use the method to move a character to that position. + The cursor automatically moves to the next character position each time a character is written to the console window. If the cursor is at the bottom right character position of the console window, the next write operation causes the console window to scroll so the cursor remains visible. If you want to write a character to the bottom right character position without causing the console window to scroll, use the method to move a character to that position. ## Examples - This example demonstrates the and properties, and the and methods. The example positions the cursor, which determines where the next write will occur, to draw a 5 character by 5 character rectangle using a combination of "+", "|", and "-" strings. Note that the rectangle could be drawn with fewer steps using a combination of other strings. + This example demonstrates the and properties, and the and methods. The example positions the cursor, which determines where the next write will occur, to draw a 5 character by 5 character rectangle using a combination of "+", "|", and "-" strings. Note that the rectangle could be drawn with fewer steps using a combination of other strings. :::code language="csharp" source="~/snippets/csharp/System/Console/Clear/lts.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/console.cursorLTS/FS/lts.fs" id="Snippet1"::: @@ -3666,7 +3666,7 @@ This method can be used to reacquire the standard output stream after it has bee ## Examples - The following example illustrates the use of the method. It replaces four consecutive space characters in a string with a tab character. To run it, you must supply two command line arguments. The first is the name of an existing text file to redirect the standard input stream to. The second is the name of a file to redirect the standard output stream to. This file need not exist. If it does, its contents will be overwritten. + The following example illustrates the use of the method. It replaces four consecutive space characters in a string with a tab character. To run it, you must supply two command line arguments. The first is the name of an existing text file to redirect the standard input stream to. The second is the name of a file to redirect the standard output stream to. This file need not exist. If it does, its contents will be overwritten. :::code language="csharp" source="~/snippets/csharp/System/Console/OpenStandardOutput/inserttabs.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Console-INSERTTABS/FS/inserttabs.fs" id="Snippet1"::: @@ -3742,10 +3742,10 @@ This method can be used to reacquire the standard output stream after it has bee :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.console.setout/fs/source.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/Console/SetOut/source.vb" id="Snippet1"::: - The actual object returned by may be a synchronized wrapper around the provided text writer. + The actual object returned by may be a synchronized wrapper around the provided text writer. ## Examples - The following example illustrates the use of the method. It replaces four consecutive space characters in a string with a tab character. To run it, you must supply two command line arguments. The first is the name of an existing text file to redirect the standard input stream to. The second is the name of a file to redirect the standard output stream to. This file need not exist. If it does, its contents will be overwritten. + The following example illustrates the use of the method. It replaces four consecutive space characters in a string with a tab character. To run it, you must supply two command line arguments. The first is the name of an existing text file to redirect the standard input stream to. The second is the name of a file to redirect the standard output stream to. This file need not exist. If it does, its contents will be overwritten. :::code language="csharp" source="~/snippets/csharp/System/Console/OpenStandardOutput/inserttabs.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Console-INSERTTABS/FS/inserttabs.fs" id="Snippet1"::: @@ -3818,14 +3818,14 @@ This method can be used to reacquire the standard output stream after it has bee method affects the position of the console window relative to the screen buffer, but does not affect the position of the operating system window relative to the desktop. + The operating system window displays the console window, and the console window displays a portion of the screen buffer. The method affects the position of the console window relative to the screen buffer, but does not affect the position of the operating system window relative to the desktop. - The console and operating system windows generally do not affect each other. However, if the screen buffer cannot be displayed in the current boundaries of the console window, the operating system automatically appends scroll bars to the operating system window. In that case, moving the operating system window scroll bars affects the position of the console window, and moving the console window with the method affects the position of the operating system window scroll bars. + The console and operating system windows generally do not affect each other. However, if the screen buffer cannot be displayed in the current boundaries of the console window, the operating system automatically appends scroll bars to the operating system window. In that case, moving the operating system window scroll bars affects the position of the console window, and moving the console window with the method affects the position of the operating system window scroll bars. ## Examples - The following example demonstrates the , , , , , , and properties; and the , , and methods. The example draws a grid pattern in the screen buffer based on the screen buffer width. Then the example moves the console window in response to which of the UP ARROW, DOWN ARROW, LEFT ARROW, or RIGHT ARROW console keys is pressed. The grid pattern helps you see the movement of the console window relative to the screen buffer. + The following example demonstrates the , , , , , , and properties; and the , , and methods. The example draws a grid pattern in the screen buffer based on the screen buffer width. Then the example moves the console window in response to which of the UP ARROW, DOWN ARROW, LEFT ARROW, or RIGHT ARROW console keys is pressed. The grid pattern helps you see the movement of the console window relative to the screen buffer. :::code language="csharp" source="~/snippets/csharp/System/Console/SetBufferSize/wlt.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/Console/SetBufferSize/wlt.vb" id="Snippet1"::: @@ -3922,7 +3922,7 @@ This method can be used to reacquire the standard output stream after it has bee method, and the and properties. You must run the example to see the full effect of changing the console window size. + This example demonstrates the method, and the and properties. You must run the example to see the full effect of changing the console window size. The example reports the dimensions of a console window set to 85 columns and 43 rows, then waits for a key to be pressed. When any key is pressed, the dimensions of the console window are halved, the new dimensions are reported, and the example waits for another key press. Finally, when any key is pressed, the console window is restored to its original dimensions and the example terminates. @@ -4221,7 +4221,7 @@ This method can be used to reacquire the standard output stream after it has bee ## Examples - This example demonstrates the method, and the and properties. You must run the example to see the full effect of changing the console window size. + This example demonstrates the method, and the and properties. You must run the example to see the full effect of changing the console window size. The example reports the dimensions of a console window set to 85 columns and 43 rows, then waits for a key press. When any key is pressed, the dimensions of the console window are halved, the new dimensions are reported, and the example waits for another key press. Finally, when any key is pressed the console window is restored to its original dimensions and the example terminates. @@ -4301,7 +4301,7 @@ This method can be used to reacquire the standard output stream after it has bee and properties. The dimensions of the console area are defined by the and properties. The property determines which column of the buffer area is displayed in the first column of the console window. The value of the property can range from 0 to - . Attempting to set it to a value outside that range throws an . + The console represents a rectangular window into a larger rectangular buffer area. Both the window and the buffer are measured vertically by their number of rows and horizontally by their number of columns. The dimensions of the buffer area are defined by the and properties. The dimensions of the console area are defined by the and properties. The property determines which column of the buffer area is displayed in the first column of the console window. The value of the property can range from 0 to - . Attempting to set it to a value outside that range throws an . When a console window first opens, the default value of the property is zero, which indicates that the first column shown by the console corresponds to the first column (the column at position zero) in the buffer area. The default width of both the console window and the buffer area is 80 columns. This means that the property can be modified only if the console window is made narrower or the buffer area is made wider. @@ -4312,7 +4312,7 @@ This method can be used to reacquire the standard output stream after it has bee ## Examples - The following example opens an 80-column console window and defines a buffer area that is 120 columns wide. It displays information on window and buffer size, and then waits for the user to press either the LEFT ARROW key or the RIGHT ARROW key. In the former case, it decrements the value of the property by one if the result is a legal value. In the latter case, it increases the value of the property by one if the result would be legal. Note that the example does not have to handle an , because it checks that the value to be assigned to the property is not negative and does not cause the sum of the and properties to exceed the property value. + The following example opens an 80-column console window and defines a buffer area that is 120 columns wide. It displays information on window and buffer size, and then waits for the user to press either the LEFT ARROW key or the RIGHT ARROW key. In the former case, it decrements the value of the property by one if the result is a legal value. In the latter case, it increases the value of the property by one if the result would be legal. Note that the example does not have to handle an , because it checks that the value to be assigned to the property is not negative and does not cause the sum of the and properties to exceed the property value. :::code language="csharp" source="~/snippets/csharp/System/Console/WindowLeft/windowleft1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.console.windowleft/fs/windowleft1.fs" id="Snippet1"::: @@ -4386,14 +4386,14 @@ This method can be used to reacquire the standard output stream after it has bee and properties. The dimensions of the console area are defined by the and properties. The property determines which row of the buffer area is displayed in the first column of the console window. The value of the property can range from 0 to - . Attempting to set it to a value outside that range throws an . + The console represents a rectangular window into a larger rectangular buffer area. Both the window and the buffer are measured vertically by their number of rows and horizontally by their number of columns. The dimensions of the buffer area are defined by the and properties. The dimensions of the console area are defined by the and properties. The property determines which row of the buffer area is displayed in the first column of the console window. The value of the property can range from 0 to - . Attempting to set it to a value outside that range throws an . Attempting to set the value of the property when output is redirected throws an exception. To prevent the exception, you can set the value of this property only if the property returns `false`. ## Examples - The following example demonstrates the , , , , , , and properties; and the , , and methods. The example draws a grid pattern in the screen buffer based on the screen buffer width. Then the example moves the console window in response to which of the UP ARROW, DOWN ARROW, LEFT ARROW, or RIGHT ARROW console keys is pressed. The grid pattern helps you see the movement of the console window relative to the screen buffer. + The following example demonstrates the , , , , , , and properties; and the , , and methods. The example draws a grid pattern in the screen buffer based on the screen buffer width. Then the example moves the console window in response to which of the UP ARROW, DOWN ARROW, LEFT ARROW, or RIGHT ARROW console keys is pressed. The grid pattern helps you see the movement of the console window relative to the screen buffer. :::code language="csharp" source="~/snippets/csharp/System/Console/SetBufferSize/wlt.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/Console/SetBufferSize/wlt.vb" id="Snippet1"::: @@ -4504,7 +4504,7 @@ This method can be used to reacquire the standard output stream after it has bee ## Examples - This example demonstrates the method, and the and properties. You must run the example to see the full effect of changing the console window size. + This example demonstrates the method, and the and properties. You must run the example to see the full effect of changing the console window size. The example reports the dimensions of a console window set to 85 columns and 43 rows, then waits for a key press. When any key is pressed, the dimensions of the console window are halved, the new dimensions are reported, and the example waits for another key press. Finally, when any key is pressed the console window is restored to its original dimensions and the example terminates. @@ -4584,7 +4584,7 @@ This method can be used to reacquire the standard output stream after it has bee , which outputs either or . + The text representation of `value` is produced by calling , which outputs either or . @@ -4762,7 +4762,7 @@ This method can be used to reacquire the standard output stream after it has bee . + The text representation of `value` is produced by calling . @@ -4828,7 +4828,7 @@ This method can be used to reacquire the standard output stream after it has bee method. + The text representation of `value` is produced by calling the method. @@ -4894,7 +4894,7 @@ This method can be used to reacquire the standard output stream after it has bee method. + The text representation of `value` is produced by calling the method. @@ -4960,7 +4960,7 @@ This method can be used to reacquire the standard output stream after it has bee method. + The text representation of `value` is produced by calling the method. @@ -5121,7 +5121,7 @@ This method can be used to reacquire the standard output stream after it has bee method. + The text representation of `value` is produced by calling the method. @@ -5260,7 +5260,7 @@ This method can be used to reacquire the standard output stream after it has bee method. + The text representation of `value` is produced by calling the method. @@ -5332,7 +5332,7 @@ This method can be used to reacquire the standard output stream after it has bee method. + The text representation of `value` is produced by calling the method. @@ -5423,7 +5423,7 @@ This method can be used to reacquire the standard output stream after it has bee .NET provides extensive formatting support, which is described in greater detail in the following formatting topics. -- For more information about the composite formatting feature supported by methods such as , , and some overloads of , see [Composite Formatting](/dotnet/standard/base-types/composite-formatting). +- For more information about the composite formatting feature supported by methods such as , , and some overloads of , see [Composite Formatting](/dotnet/standard/base-types/composite-formatting). - For more information about numeric format specifiers, see [Standard Numeric Format Strings](/dotnet/standard/base-types/standard-numeric-format-strings) and [Custom Numeric Format Strings](/dotnet/standard/base-types/custom-numeric-format-strings). @@ -5442,7 +5442,7 @@ This method can be used to reacquire the standard output stream after it has bee :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/console.writelineFmt1/fs/wl.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/Console/Write/wl.vb" id="Snippet1"::: - The following example illustrates the use of the method. + The following example illustrates the use of the method. :::code language="csharp" source="~/snippets/csharp/System/Console/Write/reformat.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Console-REFORMAT/FS/reformat.fs" id="Snippet1"::: @@ -5537,7 +5537,7 @@ This method can be used to reacquire the standard output stream after it has bee .NET provides extensive formatting support, which is described in greater detail in the following formatting topics. -- For more information about the composite formatting feature supported by methods such as , , and some overloads of , see [Composite Formatting](/dotnet/standard/base-types/composite-formatting). +- For more information about the composite formatting feature supported by methods such as , , and some overloads of , see [Composite Formatting](/dotnet/standard/base-types/composite-formatting). - For more information about numeric format specifiers, see [Standard Numeric Format Strings](/dotnet/standard/base-types/standard-numeric-format-strings) and [Custom Numeric Format Strings](/dotnet/standard/base-types/custom-numeric-format-strings). @@ -5558,7 +5558,7 @@ This method can be used to reacquire the standard output stream after it has bee :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.console.write/fs/WriteParams1.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/Console/Write/WriteParams1.vb" id="Snippet1"::: - Note that the example calls the method rather than the method because it attempts to display the value of the `Person.Remarks` property on the same line. To do this, it examines the value of the and properties to determine whether there is enough space for the remark to fit. If there is, it displays the line. If not, it writes a line, indents three spaces, and displays the remark. + Note that the example calls the method rather than the method because it attempts to display the value of the `Person.Remarks` property on the same line. To do this, it examines the value of the and properties to determine whether there is enough space for the remark to fit. If there is, it displays the line. If not, it writes a line, indents three spaces, and displays the remark. The following example is identical to the first, except that it supplies a five-item list as the `arg` argument instead of a parameter array. @@ -5773,7 +5773,7 @@ This method can be used to reacquire the standard output stream after it has bee .NET provides extensive formatting support, which is described in greater detail in the following formatting topics. -- For more information about the composite formatting feature supported by methods such as , , and some overloads of , see [Composite Formatting](/dotnet/standard/base-types/composite-formatting). +- For more information about the composite formatting feature supported by methods such as , , and some overloads of , see [Composite Formatting](/dotnet/standard/base-types/composite-formatting). - For more information about numeric format specifiers, see [Standard Numeric Format Strings](/dotnet/standard/base-types/standard-numeric-format-strings) and [Custom Numeric Format Strings](/dotnet/standard/base-types/custom-numeric-format-strings). @@ -5884,7 +5884,7 @@ This method can be used to reacquire the standard output stream after it has bee .NET provides extensive formatting support, which is described in greater detail in the following formatting topics. -- For more information about the composite formatting feature supported by methods such as , , and some overloads of , see [Composite Formatting](/dotnet/standard/base-types/composite-formatting). +- For more information about the composite formatting feature supported by methods such as , , and some overloads of , see [Composite Formatting](/dotnet/standard/base-types/composite-formatting). - For more information about numeric format specifiers, see [Standard Numeric Format Strings](/dotnet/standard/base-types/standard-numeric-format-strings) and [Custom Numeric Format Strings](/dotnet/standard/base-types/custom-numeric-format-strings). @@ -5976,7 +5976,7 @@ This method can be used to reacquire the standard output stream after it has bee ## Remarks > [!NOTE] -> This API is not CLS-compliant. The CLS-compliant alternative is . The C# and Visual Basic compilers automatically resolve a call to this method as a call to . +> This API is not CLS-compliant. The CLS-compliant alternative is . The C# and Visual Basic compilers automatically resolve a call to this method as a call to . This method uses the [composite formatting feature](/dotnet/standard/base-types/composite-formatting) of .NET to convert the value of an object to its text representation and embed that representation in a string. The resulting string is written to the output stream. @@ -5986,7 +5986,7 @@ This method can be used to reacquire the standard output stream after it has bee .NET provides extensive formatting support, which is described in greater detail in the following formatting topics. -- For more information about the composite formatting feature supported by methods such as , , and some overloads of , see [Composite Formatting](/dotnet/standard/base-types/composite-formatting). +- For more information about the composite formatting feature supported by methods such as , , and some overloads of , see [Composite Formatting](/dotnet/standard/base-types/composite-formatting). - For more information about numeric format specifiers, see [Standard Numeric Format Strings](/dotnet/standard/base-types/standard-numeric-format-strings) and [Custom Numeric Format Strings](/dotnet/standard/base-types/custom-numeric-format-strings). @@ -5999,7 +5999,7 @@ This method can be used to reacquire the standard output stream after it has bee ## Examples - The following example illustrates the use of variable parameters with the method. The method is called with a composite format string and five format items. + The following example illustrates the use of variable parameters with the method. The method is called with a composite format string and five format items. ]]> @@ -6084,7 +6084,7 @@ This method can be used to reacquire the standard output stream after it has bee ## Examples - The example changes the line terminator from its default value of "\r\n" or `vbCrLf` to "\r\n\r\n" or `vbCrLf` + `vbCrLf`. It then calls the and methods to display output to the console. + The example changes the line terminator from its default value of "\r\n" or `vbCrLf` to "\r\n\r\n" or `vbCrLf` + `vbCrLf`. It then calls the and methods to display output to the console. :::code language="csharp" source="~/snippets/csharp/System/Console/WriteLine/newline1.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Console.WriteLine/FS/newline1.fs" id="Snippet2"::: @@ -6147,14 +6147,14 @@ This method can be used to reacquire the standard output stream after it has bee method. + The text representation of `value` is produced by calling the method. - For more information about the line terminator, see the Remarks section of the method that takes no parameters. + For more information about the line terminator, see the Remarks section of the method that takes no parameters. ## Examples - The following example generates ten random integers and uses the method to indicate whether they are even. + The following example generates ten random integers and uses the method to indicate whether they are even. :::code language="csharp" source="~/snippets/csharp/System/Console/WriteLine/writeline_boolean1.cs" id="Snippet4"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Console.WriteLine/FS/writeline_boolean1.fs" id="Snippet4"::: @@ -6215,12 +6215,12 @@ This method can be used to reacquire the standard output stream after it has bee method that takes no parameters. + For more information about the line terminator, see the Remarks section of the method that takes no parameters. ## Examples - The following example is a tip calculator that calculates an 18% tip and uses the method to display the amount of the original charge, the amount of the tip, and the total amount. The example is a console application that requires the user to supply the amount of the original charge as a command-line parameter. + The following example is a tip calculator that calculates an 18% tip and uses the method to display the amount of the original charge, the amount of the tip, and the total amount. The example is a console application that requires the user to supply the amount of the original charge as a command-line parameter. :::code language="csharp" source="~/snippets/csharp/System/Console/WriteLine/tipcalc.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Console.WriteLine/FS/tipcalc.fs" id="Snippet1"::: @@ -6282,7 +6282,7 @@ This method can be used to reacquire the standard output stream after it has bee method that takes no parameters. + For more information about the line terminator, see the Remarks section of the method that takes no parameters. ]]> @@ -6339,14 +6339,14 @@ This method can be used to reacquire the standard output stream after it has bee method. + The text representation of `value` is produced by calling the method. - For more information about the line terminator, see the Remarks section of the method that takes no parameters. + For more information about the line terminator, see the Remarks section of the method that takes no parameters. ## Examples - The following example is a tip calculator that calculates an 18% tip and uses the method to display the amount of the original charge, the amount of the tip, and the total amount. The example is a console application that requires the user to supply the amount of the original charge as a command-line parameter. + The following example is a tip calculator that calculates an 18% tip and uses the method to display the amount of the original charge, the amount of the tip, and the total amount. The example is a console application that requires the user to supply the amount of the original charge as a command-line parameter. :::code language="csharp" source="~/snippets/csharp/System/Console/WriteLine/tipcalc.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Console.WriteLine/FS/tipcalc.fs" id="Snippet1"::: @@ -6407,14 +6407,14 @@ This method can be used to reacquire the standard output stream after it has bee method. + The text representation of `value` is produced by calling the method. - For more information about the line terminator, see the Remarks section of the method that takes no parameters. + For more information about the line terminator, see the Remarks section of the method that takes no parameters. ## Examples - The following example is a tip calculator that calculates an 18% tip and uses the method to display the amount of the original charge, the amount of the tip, and the total amount. The example is a console application that requires the user to supply the amount of the original charge as a command-line parameter. + The following example is a tip calculator that calculates an 18% tip and uses the method to display the amount of the original charge, the amount of the tip, and the total amount. The example is a console application that requires the user to supply the amount of the original charge as a command-line parameter. :::code language="csharp" source="~/snippets/csharp/System/Console/WriteLine/tipcalc.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Console.WriteLine/FS/tipcalc.fs" id="Snippet1"::: @@ -6475,14 +6475,14 @@ This method can be used to reacquire the standard output stream after it has bee method. + The text representation of `value` is produced by calling the method. - For more information about the line terminator, see the Remarks section of the method that takes no parameters. + For more information about the line terminator, see the Remarks section of the method that takes no parameters. ## Examples - The following example is a tip calculator that calculates an 18% tip and uses the method to display the amount of the original charge, the amount of the tip, and the total amount. The example is a console application that requires the user to supply the amount of the original charge as a command-line parameter. + The following example is a tip calculator that calculates an 18% tip and uses the method to display the amount of the original charge, the amount of the tip, and the total amount. The example is a console application that requires the user to supply the amount of the original charge as a command-line parameter. :::code language="csharp" source="~/snippets/csharp/System/Console/WriteLine/tipcalc.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Console.WriteLine/FS/tipcalc.fs" id="Snippet1"::: @@ -6543,14 +6543,14 @@ This method can be used to reacquire the standard output stream after it has bee method. + The text representation of `value` is produced by calling the method. - For more information about the line terminator, see the Remarks section of the method that takes no parameters. + For more information about the line terminator, see the Remarks section of the method that takes no parameters. ## Examples - The following example is a tip calculator that calculates an 18% tip and uses the method to display the amount of the original charge, the amount of the tip, and the total amount. The example is a console application that requires the user to supply the amount of the original charge as a command-line parameter. + The following example is a tip calculator that calculates an 18% tip and uses the method to display the amount of the original charge, the amount of the tip, and the total amount. The example is a console application that requires the user to supply the amount of the original charge as a command-line parameter. :::code language="csharp" source="~/snippets/csharp/System/Console/WriteLine/tipcalc.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Console.WriteLine/FS/tipcalc.fs" id="Snippet1"::: @@ -6614,12 +6614,12 @@ This method can be used to reacquire the standard output stream after it has bee ## Remarks If `value` is `null`, only the line terminator is written. Otherwise, the `ToString` method of `value` is called to produce its string representation, and the resulting string is written to the standard output stream. - For more information about the line terminator, see the Remarks section of the method that takes no parameters. + For more information about the line terminator, see the Remarks section of the method that takes no parameters. ## Examples - The following example uses the method to display each value in an object array to the console. + The following example uses the method to display each value in an object array to the console. :::code language="csharp" source="~/snippets/csharp/System/Console/WriteLine/writeline_obj1.cs" id="Snippet3"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Console.WriteLine/FS/writeline_obj1.fs" id="Snippet3"::: @@ -6708,14 +6708,14 @@ This method can be used to reacquire the standard output stream after it has bee method. + The text representation of `value` is produced by calling the method. - For more information about the line terminator, see the Remarks section of the method that takes no parameters. + For more information about the line terminator, see the Remarks section of the method that takes no parameters. ## Examples - The following example is a tip calculator that calculates an 18% tip and uses the method to display the amount of the original charge, the amount of the tip, and the total amount. The example is a console application that requires the user to supply the amount of the original charge as a command-line parameter. + The following example is a tip calculator that calculates an 18% tip and uses the method to display the amount of the original charge, the amount of the tip, and the total amount. The example is a console application that requires the user to supply the amount of the original charge as a command-line parameter. :::code language="csharp" source="~/snippets/csharp/System/Console/WriteLine/tipcalc.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Console.WriteLine/FS/tipcalc.fs" id="Snippet1"::: @@ -6784,7 +6784,7 @@ This method can be used to reacquire the standard output stream after it has bee ## Examples - The example changes the line terminator from its default value of "\r\n" or `vbCrLf` to "\r\n\r\n" or `vbCrLf` + `vbCrLf`. It then calls the and methods to display output to the console. + The example changes the line terminator from its default value of "\r\n" or `vbCrLf` to "\r\n\r\n" or `vbCrLf` + `vbCrLf`. It then calls the and methods to display output to the console. :::code language="csharp" source="~/snippets/csharp/System/Console/WriteLine/newline1.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Console.WriteLine/FS/newline1.fs" id="Snippet2"::: @@ -6851,14 +6851,14 @@ This method can be used to reacquire the standard output stream after it has bee method. + The text representation of `value` is produced by calling the method. - For more information about the line terminator, see the Remarks section of the method that takes no parameters. + For more information about the line terminator, see the Remarks section of the method that takes no parameters. ## Examples - The following example is a tip calculator that calculates an 18% tip and uses the method to display the amount of the original charge, the amount of the tip, and the total amount. The example is a console application that requires the user to supply the amount of the original charge as a command-line parameter. + The following example is a tip calculator that calculates an 18% tip and uses the method to display the amount of the original charge, the amount of the tip, and the total amount. The example is a console application that requires the user to supply the amount of the original charge as a command-line parameter. :::code language="csharp" source="~/snippets/csharp/System/Console/WriteLine/tipcalc.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Console.WriteLine/FS/tipcalc.fs" id="Snippet1"::: @@ -6925,14 +6925,14 @@ This method can be used to reacquire the standard output stream after it has bee method. + The text representation of `value` is produced by calling the method. - For more information about the line terminator, see the Remarks section of the method that takes no parameters. + For more information about the line terminator, see the Remarks section of the method that takes no parameters. ## Examples - The following example is a tip calculator that calculates an 18% tip and uses the method to display the amount of the original charge, the amount of the tip, and the total amount. The example is a console application that requires the user to supply the amount of the original charge as a command-line parameter. + The following example is a tip calculator that calculates an 18% tip and uses the method to display the amount of the original charge, the amount of the tip, and the total amount. The example is a console application that requires the user to supply the amount of the original charge as a command-line parameter. :::code language="csharp" source="~/snippets/csharp/System/Console/WriteLine/tipcalc.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Console.WriteLine/FS/tipcalc.fs" id="Snippet1"::: @@ -7018,7 +7018,7 @@ This method can be used to reacquire the standard output stream after it has bee .NET provides extensive formatting support, which is described in greater detail in the following formatting topics. -- For more information about the composite formatting feature supported by methods such as , , and some overloads of , see [Composite Formatting](/dotnet/standard/base-types/composite-formatting). +- For more information about the composite formatting feature supported by methods such as , , and some overloads of , see [Composite Formatting](/dotnet/standard/base-types/composite-formatting). - For more information about numeric format specifiers, see [Standard Numeric Format Strings](/dotnet/standard/base-types/standard-numeric-format-strings) and [Custom Numeric Format Strings](/dotnet/standard/base-types/custom-numeric-format-strings). @@ -7028,18 +7028,18 @@ This method can be used to reacquire the standard output stream after it has bee - For more information about formatting, see [Formatting Types](/dotnet/standard/base-types/formatting-types). - For more information about the line terminator, see the Remarks section of the method that takes no parameters. + For more information about the line terminator, see the Remarks section of the method that takes no parameters. ## Examples - The following example calls the method to display five randomly generated values. + The following example calls the method to display five randomly generated values. :::code language="csharp" source="~/snippets/csharp/System/Console/WriteLine/WriteLine6.cs" id="Snippet6"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Console.WriteLine/FS/WriteLine6.fs" id="Snippet6"::: :::code language="vb" source="~/snippets/visualbasic/System/Console/WriteLine/WriteLine6.vb" id="Snippet6"::: - The following example calls the method to display the current date. Note that the format item in the `format` argument uses the "D" [standard date and time format string](/dotnet/standard/base-types/standard-date-and-time-format-strings) to display the date in the long date format of the current culture. + The following example calls the method to display the current date. Note that the format item in the `format` argument uses the "D" [standard date and time format string](/dotnet/standard/base-types/standard-date-and-time-format-strings) to display the date in the long date format of the current culture. :::code language="csharp" source="~/snippets/csharp/System/Console/WriteLine/WriteLine7.cs" id="Snippet7"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Console.WriteLine/FS/WriteLine7.fs" id="Snippet7"::: @@ -7134,7 +7134,7 @@ This method can be used to reacquire the standard output stream after it has bee .NET provides extensive formatting support, which is described in greater detail in the following formatting topics. -- For more information about the composite formatting feature supported by methods such as , , and some overloads of , see [Composite Formatting](/dotnet/standard/base-types/composite-formatting). +- For more information about the composite formatting feature supported by methods such as , , and some overloads of , see [Composite Formatting](/dotnet/standard/base-types/composite-formatting). - For more information about numeric format specifiers, see [Standard Numeric Format Strings](/dotnet/standard/base-types/standard-numeric-format-strings) and [Custom Numeric Format Strings](/dotnet/standard/base-types/custom-numeric-format-strings). @@ -7144,7 +7144,7 @@ This method can be used to reacquire the standard output stream after it has bee - For more information about formatting, see [Formatting Types](/dotnet/standard/base-types/formatting-types). - For more information about the line terminator, see the Remarks section of the method that takes no parameters. + For more information about the line terminator, see the Remarks section of the method that takes no parameters. @@ -7155,7 +7155,7 @@ This method can be used to reacquire the standard output stream after it has bee :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/console.writelineFmt1/fs/wl.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/Console/Write/wl.vb" id="Snippet1"::: - The following example is a tip calculator that calculates an 18% tip and uses the method to display the amount of the original charge, the amount of the tip, and the total amount. The example is a console application that requires the user to supply the amount of the original charge as a command-line parameter. + The following example is a tip calculator that calculates an 18% tip and uses the method to display the amount of the original charge, the amount of the tip, and the total amount. The example is a console application that requires the user to supply the amount of the original charge as a command-line parameter. :::code language="csharp" source="~/snippets/csharp/System/Console/WriteLine/tipcalc.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Console.WriteLine/FS/tipcalc.fs" id="Snippet1"::: @@ -7283,7 +7283,7 @@ This method can be used to reacquire the standard output stream after it has bee ## Remarks This method writes `count` characters starting at position `index` of `buffer` to the standard output stream. - For more information about the line terminator, see the Remarks section of the method that takes no parameters. + For more information about the line terminator, see the Remarks section of the method that takes no parameters. ]]> @@ -7370,7 +7370,7 @@ This method can be used to reacquire the standard output stream after it has bee .NET provides extensive formatting support, which is described in greater detail in the following formatting topics. -- For more information about the composite formatting feature supported by methods such as , , and some overloads of , see [Composite Formatting](/dotnet/standard/base-types/composite-formatting). +- For more information about the composite formatting feature supported by methods such as , , and some overloads of , see [Composite Formatting](/dotnet/standard/base-types/composite-formatting). - For more information about numeric format specifiers, see [Standard Numeric Format Strings](/dotnet/standard/base-types/standard-numeric-format-strings) and [Custom Numeric Format Strings](/dotnet/standard/base-types/custom-numeric-format-strings). @@ -7380,7 +7380,7 @@ This method can be used to reacquire the standard output stream after it has bee - For more information about formatting, see [Formatting Types](/dotnet/standard/base-types/formatting-types). - For more information about the line terminator, see the Remarks section of the method that takes no parameters. + For more information about the line terminator, see the Remarks section of the method that takes no parameters. @@ -7391,7 +7391,7 @@ This method can be used to reacquire the standard output stream after it has bee :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/console.writelineFmt1/fs/wl.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/Console/Write/wl.vb" id="Snippet1"::: - The following example is a tip calculator that calculates an 18% tip and uses the method to display the amount of the original charge, the amount of the tip, and the total amount. The example is a console application that requires the user to supply the amount of the original charge as a command-line parameter. + The following example is a tip calculator that calculates an 18% tip and uses the method to display the amount of the original charge, the amount of the tip, and the total amount. The example is a console application that requires the user to supply the amount of the original charge as a command-line parameter. :::code language="csharp" source="~/snippets/csharp/System/Console/WriteLine/tipcalc.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Console.WriteLine/FS/tipcalc.fs" id="Snippet1"::: @@ -7483,7 +7483,7 @@ This method can be used to reacquire the standard output stream after it has bee .NET provides extensive formatting support, which is described in greater detail in the following formatting topics. -- For more information about the composite formatting feature supported by methods such as , , and some overloads of , see [Composite Formatting](/dotnet/standard/base-types/composite-formatting). +- For more information about the composite formatting feature supported by methods such as , , and some overloads of , see [Composite Formatting](/dotnet/standard/base-types/composite-formatting). - For more information about numeric format specifiers, see [Standard Numeric Format Strings](/dotnet/standard/base-types/standard-numeric-format-strings) and [Custom Numeric Format Strings](/dotnet/standard/base-types/custom-numeric-format-strings). @@ -7493,7 +7493,7 @@ This method can be used to reacquire the standard output stream after it has bee - For more information about formatting, see [Formatting Types](/dotnet/standard/base-types/formatting-types). - For more information about the line terminator, see the Remarks section of the method that takes no parameters. + For more information about the line terminator, see the Remarks section of the method that takes no parameters. @@ -7504,7 +7504,7 @@ This method can be used to reacquire the standard output stream after it has bee :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/console.writelineFmt1/fs/wl.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/Console/Write/wl.vb" id="Snippet1"::: - The following example is a tip calculator that calculates an 18% tip and uses the method to display the amount of the original charge, the amount of the tip, and the total amount. The example is a console application that requires the user to supply the amount of the original charge as a command-line parameter. + The following example is a tip calculator that calculates an 18% tip and uses the method to display the amount of the original charge, the amount of the tip, and the total amount. The example is a console application that requires the user to supply the amount of the original charge as a command-line parameter. :::code language="csharp" source="~/snippets/csharp/System/Console/WriteLine/tipcalc.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Console.WriteLine/FS/tipcalc.fs" id="Snippet1"::: @@ -7577,7 +7577,7 @@ This method can be used to reacquire the standard output stream after it has bee ## Remarks > [!NOTE] -> This API is not CLS-compliant. The CLS-compliant alternative is . The C# and Visual Basic compilers automatically resolve a call to this method as a call to . +> This API is not CLS-compliant. The CLS-compliant alternative is . The C# and Visual Basic compilers automatically resolve a call to this method as a call to . This method uses the [composite formatting feature](/dotnet/standard/base-types/composite-formatting) of .NET to convert the value of an object to its text representation and embed that representation in a string. The resulting string is written to the output stream. @@ -7587,7 +7587,7 @@ This method can be used to reacquire the standard output stream after it has bee .NET provides extensive formatting support, which is described in greater detail in the following formatting topics. -- For more information about the composite formatting feature supported by methods such as , , and some overloads of , see [Composite Formatting](/dotnet/standard/base-types/composite-formatting). +- For more information about the composite formatting feature supported by methods such as , , and some overloads of , see [Composite Formatting](/dotnet/standard/base-types/composite-formatting). - For more information about numeric format specifiers, see [Standard Numeric Format Strings](/dotnet/standard/base-types/standard-numeric-format-strings) and [Custom Numeric Format Strings](/dotnet/standard/base-types/custom-numeric-format-strings). @@ -7597,10 +7597,10 @@ This method can be used to reacquire the standard output stream after it has bee - For more information about formatting, see [Formatting Types](/dotnet/standard/base-types/formatting-types). - For more information about the line terminator, see the Remarks section of the method that takes no parameters. + For more information about the line terminator, see the Remarks section of the method that takes no parameters. ## Examples - The following example illustrates the use of variable arguments with the method. The method is called with a composite format string and five format items. + The following example illustrates the use of variable arguments with the method. The method is called with a composite format string and five format items. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR_System/system.Console.WriteLine/CPP/writeline_vararg.cpp" id="Snippet5"::: diff --git a/xml/System/ConsoleColor.xml b/xml/System/ConsoleColor.xml index 40b0563873c..922ab2998e6 100644 --- a/xml/System/ConsoleColor.xml +++ b/xml/System/ConsoleColor.xml @@ -52,15 +52,15 @@ Specifies constants that define foreground and background colors for the console. - enumeration to an array and stores the current values of the and properties to variables. It then changes the foreground color to each color in the enumeration except to the color that matches the current background, and it changes the background color to each color in the enumeration except to the color that matches the current foreground. (If the foreground color is the same as the background color, the text isn't visible.) Finally, it calls the method to restore the original console colors. - + enumeration to an array and stores the current values of the and properties to variables. It then changes the foreground color to each color in the enumeration except to the color that matches the current background, and it changes the background color to each color in the enumeration except to the color that matches the current foreground. (If the foreground color is the same as the background color, the text isn't visible.) Finally, it calls the method to restore the original console colors. + :::code language="csharp" source="~/snippets/csharp/System/Console/BackgroundColor/foregroundcolor3.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.consolecolor/fs/foregroundcolor3.fs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System/Console/BackgroundColor/foregroundcolor3.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System/Console/BackgroundColor/foregroundcolor3.vb" id="Snippet1"::: + ]]> diff --git a/xml/System/ConsoleKey.xml b/xml/System/ConsoleKey.xml index a0b8a9d9d42..5e69c8c30fe 100644 --- a/xml/System/ConsoleKey.xml +++ b/xml/System/ConsoleKey.xml @@ -55,7 +55,7 @@ enumeration is typically used in the nfo structure, which is returned by the method to indicate which key on the console has been pressed. + The enumeration is typically used in the nfo structure, which is returned by the method to indicate which key on the console has been pressed. ## Examples The following example uses the enumeration to indicate to the user which key the user had pressed. diff --git a/xml/System/ConsoleKeyInfo.xml b/xml/System/ConsoleKeyInfo.xml index ebbd5f9f9a5..9101b5b1216 100644 --- a/xml/System/ConsoleKeyInfo.xml +++ b/xml/System/ConsoleKeyInfo.xml @@ -69,7 +69,7 @@ type is not intended to be created by users. Instead, it is returned to the user in response to calling the method. + The type is not intended to be created by users. Instead, it is returned to the user in response to calling the method. The object describes the constant and Unicode character, if any, that correspond to the pressed console key. The object also describes, in a bitwise combination of values, whether one or more SHIFT, ALT, or CTRL modifier keys was pressed simultaneously with the console key. @@ -142,7 +142,7 @@ method. + This type is not intended to be created by users. Instead, it is returned to the user in response to calling the method. The type does not specify whether the left or right SHIFT, ALT, or CTRL modifier key was pressed. @@ -214,9 +214,9 @@ objects are equal if their corresponding , , and properties are equal. + Two objects are equal if their corresponding , , and properties are equal. - The method performs slightly better than the method because it does not have to convert `obj` to an object. + The method performs slightly better than the method because it does not have to convert `obj` to an object. ]]> @@ -278,12 +278,12 @@ objects are equal if their corresponding , , and properties are equal. + Two objects are equal if their corresponding , , and properties are equal. ## Examples - The following example demonstrates the method. + The following example demonstrates the method. :::code language="csharp" source="~/snippets/csharp/System/ConsoleKeyInfo/Equals/equals.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.ConsoleKeyInfo.Equals/fs/equals.fs" id="Snippet1"::: @@ -337,12 +337,12 @@ method is not suitable for distinguishing one object from another. If your application needs a unique hash code, override the method with your own method. + The value returned by the method is not suitable for distinguishing one object from another. If your application needs a unique hash code, override the method with your own method. ## Examples - The following example demonstrates the method. + The following example demonstrates the method. :::code language="csharp" source="~/snippets/csharp/System/ConsoleKeyInfo/GetHashCode/hash.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.ConsoleKeyInfo.GetHashcode/fs/hash.fs" id="Snippet1"::: @@ -566,9 +566,9 @@ objects are equal if their corresponding , , and properties are equal. + Two objects are equal if their corresponding , , and properties are equal. - The equivalent method for this operator is .]]> + The equivalent method for this operator is .]]> @@ -622,7 +622,7 @@ objects are equal if their corresponding , , and properties are equal. + Two objects are equal if their corresponding , , and properties are equal. ]]> diff --git a/xml/System/ContextMarshalException.xml b/xml/System/ContextMarshalException.xml index fa7fc577b2a..863398d7288 100644 --- a/xml/System/ContextMarshalException.xml +++ b/xml/System/ContextMarshalException.xml @@ -82,9 +82,9 @@ uses the HRESULT COR_E_CONTEXTMARSHAL, which has the value 0x80131504L. - uses the default implementation, which supports reference equality. + uses the default implementation, which supports reference equality. - For a list of initial property values for an instance of , see the constructors. + For a list of initial property values for an instance of , see the constructors. ]]> @@ -148,8 +148,8 @@ |Property|Value| |--------------|-----------| -||`null`.| -||The empty string ("").| +||`null`.| +||The empty string ("").| ]]> @@ -206,8 +206,8 @@ |Property|Value| |--------------|-----------| -||`null`.| -||The error message string.| +||`null`.| +||The error message string.| ]]> @@ -329,8 +329,8 @@ |Property|Value| |--------------|-----------| -||The inner exception reference.| -||The error message string.| +||The inner exception reference.| +||The error message string.| ]]> diff --git a/xml/System/Convert.xml b/xml/System/Convert.xml index 967cebd1952..c81482b8bc3 100644 --- a/xml/System/Convert.xml +++ b/xml/System/Convert.xml @@ -168,12 +168,12 @@ is a general-purpose conversion method that converts the object specified by `value` to `conversionType`. The `value` parameter can be an object of any type, and `conversionType` can also be a object that represents any base or custom type. For the conversion to succeed, `value` must implement the interface, because the method simply wraps a call to an appropriate method. The method requires that conversion of `value` to `conversionType` be supported. + is a general-purpose conversion method that converts the object specified by `value` to `conversionType`. The `value` parameter can be an object of any type, and `conversionType` can also be a object that represents any base or custom type. For the conversion to succeed, `value` must implement the interface, because the method simply wraps a call to an appropriate method. The method requires that conversion of `value` to `conversionType` be supported. This method uses the current thread's culture for the conversion. ## Examples - The following example illustrates the use of the method. + The following example illustrates the use of the method. :::code language="csharp" source="~/snippets/csharp/System/Convert/ChangeType/convertchangetype.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Convert/ChangeType/convertchangetype.fs" id="Snippet1"::: @@ -274,14 +274,14 @@ is a general-purpose conversion method that converts the object specified by `value` to a predefined type specified by `typeCode`. The `value` parameter can be an object of any type. For the conversion to succeed, `value` must implement the interface, because the method simply wraps a call to an appropriate method. The method also requires that conversion of `value` to `typeCode` be supported. + is a general-purpose conversion method that converts the object specified by `value` to a predefined type specified by `typeCode`. The `value` parameter can be an object of any type. For the conversion to succeed, `value` must implement the interface, because the method simply wraps a call to an appropriate method. The method also requires that conversion of `value` to `typeCode` be supported. - The method does not support the conversion of `value` to a custom type. To perform such a conversion, call the method. + The method does not support the conversion of `value` to a custom type. To perform such a conversion, call the method. ## Examples - The following example illustrates how to use the method to change an to the type specified by the parameter, if possible. + The following example illustrates how to use the method to change an to the type specified by the parameter, if possible. :::code language="csharp" source="~/snippets/csharp/System/Convert/ChangeType/changetype01.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/Convert/ChangeType/changetype01.fs" id="Snippet2"::: @@ -379,11 +379,11 @@ is a general-purpose conversion method that converts the object specified by `value` to `conversionType`. The `value` parameter can be an object of any type, and `conversionType` can also be a object that represents any base or custom type. For the conversion to succeed, `value` must implement the interface, because the method simply wraps a call to an appropriate method. The method requires that conversion of `value` to `conversionType` be supported. + is a general-purpose conversion method that converts the object specified by `value` to `conversionType`. The `value` parameter can be an object of any type, and `conversionType` can also be a object that represents any base or custom type. For the conversion to succeed, `value` must implement the interface, because the method simply wraps a call to an appropriate method. The method requires that conversion of `value` to `conversionType` be supported. The `provider` parameter is an implementation that supplies formatting information for the conversion. Whether and how this parameter is used depends on the underlying implementation. If `value` is a base data type, `provider` is used only for the following conversions: -- Conversion from a number to a string, or from a string to a number. `provider` must be a object, a object, or a custom implementation that returns a object. However, because the method performs the conversion using the default "G" format specifier, the `provider` parameter has no effect if `value` or the target type is an unsigned integer. If `provider` is `null`, the object that represents the current culture is used. +- Conversion from a number to a string, or from a string to a number. `provider` must be a object, a object, or a custom implementation that returns a object. However, because the method performs the conversion using the default "G" format specifier, the `provider` parameter has no effect if `value` or the target type is an unsigned integer. If `provider` is `null`, the object that represents the current culture is used. - Conversion from a value to a string, or from a string to a value. `provider` must be a or object. If `provider` is `null`, the object that represents the current culture is used. @@ -396,7 +396,7 @@ :::code language="fsharp" source="~/snippets/fsharp/System/Convert/ChangeType/changetype03.fs" id="Snippet3"::: :::code language="vb" source="~/snippets/visualbasic/System/Convert/ChangeType/changetype03.vb" id="Snippet3"::: - The following example creates an instance of the `Temperature` class and calls the method to convert it to the basic numeric types supported by .NET and to a . It illustrates that the method wraps a call to the source type's implementation. + The following example creates an instance of the `Temperature` class and calls the method to convert it to the basic numeric types supported by .NET and to a . It illustrates that the method wraps a call to the source type's implementation. :::code language="csharp" source="~/snippets/csharp/System/Convert/ChangeType/changetype03.cs" id="Snippet4"::: :::code language="fsharp" source="~/snippets/fsharp/System/Convert/ChangeType/changetype03.fs" id="Snippet4"::: @@ -495,20 +495,20 @@ is a general-purpose conversion method that converts the object specified by `value` to a predefined type specified by `typeCode`. The `value` parameter can be an object of any type. For the conversion to succeed, `value` must implement the interface, because the method simply wraps a call to an appropriate method. The method also requires that conversion of `value` to `typeCode` be supported. + is a general-purpose conversion method that converts the object specified by `value` to a predefined type specified by `typeCode`. The `value` parameter can be an object of any type. For the conversion to succeed, `value` must implement the interface, because the method simply wraps a call to an appropriate method. The method also requires that conversion of `value` to `typeCode` be supported. - The method does not support the conversion of `value` to a custom type. To perform such a conversion, call the method. + The method does not support the conversion of `value` to a custom type. To perform such a conversion, call the method. The `provider` parameter is an implementation that supplies formatting information for the conversion. Whether and how this parameter is used depends on the underlying implementation. If `value` is a base data type, `provider` is used only for the following conversions. If a `null` argument is passed to these methods, the object that represents the current culture is used. -- Conversion from a number to a string, or from a string to a number. `provider` must be a object, a object, or a custom implementation that returns a object. However, because the method performs the conversion using the default "G" format specifier, the `provider` parameter has no effect if `value` or the target type is an unsigned integer. +- Conversion from a number to a string, or from a string to a number. `provider` must be a object, a object, or a custom implementation that returns a object. However, because the method performs the conversion using the default "G" format specifier, the `provider` parameter has no effect if `value` or the target type is an unsigned integer. - Conversion from a value to a string, or from a string to a value. `provider` must be a or object. If `value` is an application-defined type, its implementation may use the `provider` parameter. ## Examples - The following example defines a custom format provider named `InterceptProvider` that indicates when its method is called and returns a for the fr-FR culture and a object for the en-US culture. This format provider is used in all calls to the method. The example then creates an array with a and a value and makes repeated calls to with each value and each member of the enumeration. The example illustrates when the method uses the parameter and also illustrates the use of the `provider` parameter to perform culture-sensitive formatting. + The following example defines a custom format provider named `InterceptProvider` that indicates when its method is called and returns a for the fr-FR culture and a object for the en-US culture. This format provider is used in all calls to the method. The example then creates an array with a and a value and makes repeated calls to with each value and each member of the enumeration. The example illustrates when the method uses the parameter and also illustrates the use of the `provider` parameter to perform culture-sensitive formatting. :::code language="csharp" source="~/snippets/csharp/System/Convert/ChangeType/changetype00.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Convert/ChangeType/changetype00.fs" id="Snippet1"::: @@ -666,18 +666,18 @@ The valueless character, "=", is used for trailing padding. The end of `inArray` can consist of zero, one, or two padding characters. > [!IMPORTANT] -> The method is designed to process a single character array that contains all the data to be decoded. To decode base-64 character data from a stream, use the class. +> The method is designed to process a single character array that contains all the data to be decoded. To decode base-64 character data from a stream, use the class. ## Examples - The following example demonstrates the use of the method to decode UUencoded (base-64) data and save it as binary output. + The following example demonstrates the use of the method to decode UUencoded (base-64) data and save it as binary output. :::code language="csharp" source="~/snippets/csharp/System/Convert/FromBase64CharArray/class1.cs" id="Snippet3"::: :::code language="fsharp" source="~/snippets/fsharp/System/Convert/FromBase64CharArray/class1.fs" id="Snippet3"::: :::code language="vb" source="~/snippets/visualbasic/System/Convert/FromBase64CharArray/class1.vb" id="Snippet3"::: - The following example demonstrates the and methods. The input is divided into groups of three bytes (24 bits) each. Consequently, each group consists of four 6-bit numbers where each number ranges from decimal 0 to 63. In this example, there are 85 3-byte groups with one byte remaining. The first group consists of the hexadecimal values 00, 01, and 02, which yield four 6-bit values equal to decimal 0, 0, 4, and 2. Those four values correspond to the base-64 digits, "A", "A", "E", and "C", at the beginning of the output. + The following example demonstrates the and methods. The input is divided into groups of three bytes (24 bits) each. Consequently, each group consists of four 6-bit numbers where each number ranges from decimal 0 to 63. In this example, there are 85 3-byte groups with one byte remaining. The first group consists of the hexadecimal values 00, 01, and 02, which yield four 6-bit values equal to decimal 0, 0, 4, and 2. Those four values correspond to the base-64 digits, "A", "A", "E", and "C", at the beginning of the output. If an integral number of 3-byte groups does not exist, the remaining bytes are effectively padded with zeros to form a complete group. In this example, the value of the last byte is hexadecimal FF. The first 6 bits are equal to decimal 63, which corresponds to the base-64 digit "/" at the end of the output, and the next 2 bits are padded with zeros to yield decimal 48, which corresponds to the base-64 digit, "w". The last two 6-bit values are padding and correspond to the valueless padding character, "=". @@ -770,18 +770,18 @@ The valueless character, "=", is used for trailing padding. The end of `s` can consist of zero, one, or two padding characters. > [!IMPORTANT] -> The method is designed to process a single string that contains all the data to be decoded. To decode base-64 character data from a stream, use the class. +> The method is designed to process a single string that contains all the data to be decoded. To decode base-64 character data from a stream, use the class. ## Examples - The following example uses the method to convert a byte array to a UUencoded (base-64) string, and then calls the method to restore the original byte array. + The following example uses the method to convert a byte array to a UUencoded (base-64) string, and then calls the method to restore the original byte array. :::code language="csharp" source="~/snippets/csharp/System/Base64FormattingOptions/Overview/ToBase64String2.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Base64FormattingOptions/Overview/ToBase64String2.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/Base64FormattingOptions/Overview/ToBase64String2.vb" id="Snippet1"::: - The following is a more complex example that creates a 20-element array of 32-bit integers. It then uses the method to convert each element into a byte array, which it stores in the appropriate position in a buffer by calling the method. This buffer is then passed to the method to create a UUencoded (base-64) string. It then calls the method to decode the UUencoded string, and calls the method to convert each set of four bytes (the size of a 32-bit integer) to an integer. The output from the example shows that the original array has been successfully restored. + The following is a more complex example that creates a 20-element array of 32-bit integers. It then uses the method to convert each element into a byte array, which it stores in the appropriate position in a buffer by calling the method. This buffer is then passed to the method to create a UUencoded (base-64) string. It then calls the method to decode the UUencoded string, and calls the method to convert each set of four bytes (the size of a 32-bit integer) to an integer. The output from the example shows that the original array has been successfully restored. :::code language="csharp" source="~/snippets/csharp/System/Base64FormattingOptions/Overview/ToBase64String.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/Base64FormattingOptions/Overview/ToBase64String.fs" id="Snippet2"::: @@ -1181,7 +1181,7 @@ method tests whether the `value` parameter is equal to . It is equivalent to the following code: + The method tests whether the `value` parameter is equal to . It is equivalent to the following code: :::code language="csharp" source="~/snippets/csharp/System/Convert/IsDBNull/Form1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Convert/IsDBNull/Form1.fs" id="Snippet1"::: @@ -1193,7 +1193,7 @@ ## Examples - The following example uses a object to retrieve survey data from a database. It assigns each row's field values to an array, and then passes each array element to the method. If the method returns `true`, the example assigns the string "NA" to the array element. The array is then added to the collection of a control. + The following example uses a object to retrieve survey data from a database. It assigns each row's field values to an array, and then passes each array element to the method. If the method returns `true`, the example assigns the string "NA" to the array element. The array is then added to the collection of a control. :::code language="csharp" source="~/snippets/csharp/System/Convert/IsDBNull/Form1.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/Convert/IsDBNull/Form1.fs" id="Snippet2"::: @@ -1286,12 +1286,12 @@ The `offset` and `length` parameters are 32-bit signed numbers. The `offsetIn` and `offsetOut` parameters are zero-based array positions. > [!IMPORTANT] -> The method is designed to process a single byte array that contains all the data to be encoded. To create a base-64 character array from a byte stream, use the class. +> The method is designed to process a single byte array that contains all the data to be encoded. To create a base-64 character array from a byte stream, use the class. ## Examples - The following example demonstrates using the method to UUencode (encode in base 64) a binary stream, then save the encoding to a file. + The following example demonstrates using the method to UUencode (encode in base 64) a binary stream, then save the encoding to a file. :::code language="csharp" source="~/snippets/csharp/System/Convert/FromBase64CharArray/class1.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/Convert/FromBase64CharArray/class1.fs" id="Snippet2"::: @@ -1392,14 +1392,14 @@ The `offset` and `length` parameters are 32-bit signed numbers. The `offsetIn` and `offsetOut` parameters are zero-based array positions. > [!IMPORTANT] -> The method is designed to process a single byte array that contains all the data to be encoded. To create a base-64 character array from a byte stream, use the class. +> The method is designed to process a single byte array that contains all the data to be encoded. To create a base-64 character array from a byte stream, use the class. If the `options` parameter is set to and the output of the conversion is longer than 76 characters, a line break is inserted every 76 characters. A line break is defined as a carriage return character (U+000D) followed by a line feed character (U+000A). For more information, see RFC 2045, "Multipurpose Internet Mail Extensions", at [https://www.rfc-editor.org/](https://www.rfc-editor.org/). ## Examples - The following example demonstrates the method. The input is divided into groups of three bytes (24 bits) each. Consequently, each group consists of four 6-bit numbers where each number ranges from decimal 0 to 63. In this example, there are 85 3-byte groups with one byte remaining. The first group consists of the hexadecimal values 00, 01, and 02, which yield four 6-bit values equal to decimal 0, 0, 4, and 2. Those four values correspond to the base-64 digits "A", "A", "E", and "C" at the beginning of the output. + The following example demonstrates the method. The input is divided into groups of three bytes (24 bits) each. Consequently, each group consists of four 6-bit numbers where each number ranges from decimal 0 to 63. In this example, there are 85 3-byte groups with one byte remaining. The first group consists of the hexadecimal values 00, 01, and 02, which yield four 6-bit values equal to decimal 0, 0, 4, and 2. Those four values correspond to the base-64 digits "A", "A", "E", and "C" at the beginning of the output. If an integral number of 3-byte groups does not exist, the remaining bytes are effectively padded with zeros to form a complete group. In this example, the value of the last byte is hexadecimal FF. The first 6 bits are equal to decimal 63, which corresponds to the base-64 digit "/" at the end of the output, and the next 2 bits are padded with zeros to yield decimal 48, which corresponds to the base-64 digit, "w". The last two 6-bit values are padding and correspond to the valueless padding character, "=". @@ -1499,20 +1499,20 @@ The base-64 digits in ascending order from zero are the uppercase characters "A" to "Z", the lowercase characters "a" to "z", the numerals "0" to "9", and the symbols "+" and "/". The valueless character, "=", is used for trailing padding. > [!IMPORTANT] -> The method is designed to process a single byte array that contains all the data to be encoded. To encode data from a stream, use the class. +> The method is designed to process a single byte array that contains all the data to be encoded. To encode data from a stream, use the class. - Ordinarily, the method is not used to round-trip a UUEncoded (base-64 encoded) string. That is, if you decode a string by calling the method, then encode the returned byte array by calling the method, the resulting string will not necessarily be identical to the original string. The string will round-trip only if the original string is a valid base-64 encoded string. + Ordinarily, the method is not used to round-trip a UUEncoded (base-64 encoded) string. That is, if you decode a string by calling the method, then encode the returned byte array by calling the method, the resulting string will not necessarily be identical to the original string. The string will round-trip only if the original string is a valid base-64 encoded string. ## Examples - The following example uses the method to convert a byte array to a UUencoded (base-64) string, and then calls the method to restore the original byte array. + The following example uses the method to convert a byte array to a UUencoded (base-64) string, and then calls the method to restore the original byte array. :::code language="csharp" source="~/snippets/csharp/System/Base64FormattingOptions/Overview/ToBase64String2.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Base64FormattingOptions/Overview/ToBase64String2.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/Base64FormattingOptions/Overview/ToBase64String2.vb" id="Snippet1"::: - The following is a more complex example that creates a 20-element array of 32-bit integers. It then uses the method to convert each element into a byte array, which it stores in the appropriate position in a buffer by calling the method. This buffer is then passed to the method to create a UUencoded (base-64) string. It then calls the method to decode the UUencoded string, and calls the method to convert each set of four bytes (the size of a 32-bit integer) to an integer. The output from the example shows that the original array has been successfully restored. + The following is a more complex example that creates a 20-element array of 32-bit integers. It then uses the method to convert each element into a byte array, which it stores in the appropriate position in a buffer by calling the method. This buffer is then passed to the method to create a UUencoded (base-64) string. It then calls the method to decode the UUencoded string, and calls the method to convert each set of four bytes (the size of a 32-bit integer) to an integer. The output from the example shows that the original array has been successfully restored. :::code language="csharp" source="~/snippets/csharp/System/Base64FormattingOptions/Overview/ToBase64String.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/Base64FormattingOptions/Overview/ToBase64String.fs" id="Snippet2"::: @@ -1589,20 +1589,20 @@ The base-64 digits in ascending order from zero are the uppercase characters "A" to "Z", the lowercase characters "a" to "z", the numerals "0" to "9", and the symbols "+" and "/". The valueless character "=" is used for trailing padding. > [!IMPORTANT] -> The method is designed to process a single byte array that contains all the data to be encoded. To encode data from a stream, use the class. +> The method is designed to process a single byte array that contains all the data to be encoded. To encode data from a stream, use the class. If the `options` parameter is set to and the output of the conversion is longer than 76 characters, a line break is inserted every 76 characters. A line break is defined as a carriage return character (U+000D) followed by a line feed character (U+000A). Because line breaks are considered white-space characters in a base-64 encoding, they are ignored when converting a base-64 encoded string back to a byte array. The line breaks are simply convenient when displaying the encoded string to a control or a device such as a console window. For more information, see RFC 2045, "Multipurpose Internet Mail Extensions", at [https://www.rfc-editor.org/](https://www.rfc-editor.org/). ## Examples - The following example calls the with a argument to insert line breaks in the string that is produced by encoding a 100-element byte array. + The following example calls the with a argument to insert line breaks in the string that is produced by encoding a 100-element byte array. :::code language="csharp" source="~/snippets/csharp/System/Base64FormattingOptions/Overview/ToBase64String3.cs" id="Snippet3"::: :::code language="fsharp" source="~/snippets/fsharp/System/Base64FormattingOptions/Overview/ToBase64String3.fs" id="Snippet3"::: :::code language="vb" source="~/snippets/visualbasic/System/Base64FormattingOptions/Overview/ToBase64String3.vb" id="Snippet3"::: - As the output from the example shows, the succeeds in restoring the original byte array; the line break characters are ignored during the conversion. + As the output from the example shows, the succeeds in restoring the original byte array; the line break characters are ignored during the conversion. ]]> @@ -1731,7 +1731,7 @@ The `offset` and `length` parameters are 32-bit signed numbers. The `offset` parameter is zero-based. > [!IMPORTANT] -> The method is designed to process a single byte array that contains all the data to be encoded. To encode data from a stream, use the class. +> The method is designed to process a single byte array that contains all the data to be encoded. To encode data from a stream, use the class. ]]> @@ -1820,14 +1820,14 @@ The `offset` and `length` parameters are 32-bit signed numbers. The `offset` parameter is zero-based. > [!IMPORTANT] -> The method is designed to process a single byte array that contains all the data to be encoded. To encode data from a stream, use the class. +> The method is designed to process a single byte array that contains all the data to be encoded. To encode data from a stream, use the class. If the `options` parameter is set to and the output of the conversion is longer than 76 characters, a line break is inserted every 76 characters. A line break is defined as a carriage return character (U+000D) followed by a line feed character (U+000A). For more information, see RFC 2045, "Multipurpose Internet Mail Extensions", at [https://www.rfc-editor.org/](https://www.rfc-editor.org/). ## Examples - The following example demonstrates the method. The input is divided into groups of three bytes (24 bits) each. Consequently, each group consists of four 6-bit numbers where each number ranges from decimal 0 to 63. In this example, there are 85 3-byte groups with one byte remaining. The first group consists of the hexadecimal values 00, 01, and 02, which yield four 6-bit values equal to decimal 0, 0, 4, and 2. Those four values correspond to the base-64 digits "A", "A", "E", and "C" at the beginning of the output. + The following example demonstrates the method. The input is divided into groups of three bytes (24 bits) each. Consequently, each group consists of four 6-bit numbers where each number ranges from decimal 0 to 63. In this example, there are 85 3-byte groups with one byte remaining. The first group consists of the hexadecimal values 00, 01, and 02, which yield four 6-bit values equal to decimal 0, 0, 4, and 2. Those four values correspond to the base-64 digits "A", "A", "E", and "C" at the beginning of the output. If an integral number of 3-byte groups does not exist, the remaining bytes are effectively padded with zeros to form a complete group. In this example, the value of the last byte is hexadecimal FF. The first 6 bits are equal to decimal 63, which corresponds to the base-64 digit "/" at the end of the output, and the next 2 bits are padded with zeros to yield decimal 48, which corresponds to the base-64 digit, "w". The last two 6-bit values are padding and correspond to the valueless padding character, "=". @@ -2700,12 +2700,12 @@ ## Remarks For a successful conversion to occur, the `value` parameter must equal either , a constant whose value is `True`, , a constant whose value is `False`, or it must be `null`. In comparing `value` with and , the method ignores case as well as leading and trailing white space. - If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed. + If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed. ## Examples - The following example uses the method to convert various strings to Boolean values. + The following example uses the method to convert various strings to Boolean values. :::code language="csharp" source="~/snippets/csharp/System/Convert/ToBoolean/ToBoolean1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Convert/ToBoolean/ToBoolean1.fs" id="Snippet1"::: @@ -3000,7 +3000,7 @@ ## Examples - The following example defines a class that implements and a class that implements . Objects of the class that implements hold an array of values. An object of each class is passed to the method. This method returns `true` if any of the non-discarded array values are non-zero. The object determines how elements are discarded for this calculation. + The following example defines a class that implements and a class that implements . Objects of the class that implements hold an array of values. An object of each class is passed to the method. This method returns `true` if any of the non-discarded array values are non-zero. The object determines how elements are discarded for this calculation. :::code language="csharp" source="~/snippets/csharp/System/Convert/ToBoolean/objectifp.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Convert/ToBoolean/objectifp.fs" id="Snippet1"::: @@ -3083,7 +3083,7 @@ method instead. It returns a value that indicates whether the conversion succeeded or failed. + If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed. ]]> @@ -3719,12 +3719,12 @@ implementation of the underlying type of `value`. + If `value` is not `null`, this method wraps a call to the implementation of the underlying type of `value`. ## Examples - The following example uses the method to convert an array of objects to values. + The following example uses the method to convert an array of objects to values. :::code language="csharp" source="~/snippets/csharp/System/Byte/Overview/tobyte1.cs" id="Snippet6"::: :::code language="fsharp" source="~/snippets/fsharp/System/Byte/Overview/tobyte1.fs" id="Snippet6"::: @@ -3936,9 +3936,9 @@ method is equivalent to passing `value` to the method. `value` is interpreted by using the formatting conventions of the current culture. + Using the method is equivalent to passing `value` to the method. `value` is interpreted by using the formatting conventions of the current culture. - If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed. + If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed. ## Examples The following example defines a string array and attempts to convert each string to a . Note that while a `null` string parses to zero, throws a . Also note that while leading and trailing spaces parse successfully, formatting symbols, such as currency symbols, group separators, or decimal separators, do not. @@ -4236,7 +4236,7 @@ :::code language="fsharp" source="~/snippets/fsharp/System/Byte/Overview/tobyte3.fs" id="Snippet12"::: :::code language="vb" source="~/snippets/visualbasic/System/Convert/ToByte/tobyte3.vb" id="Snippet12"::: - The following example instantiates several `ByteString` objects and calls the method to convert them to byte values. It illustrates that the method wraps a call to the method of the object to be converted. + The following example instantiates several `ByteString` objects and calls the method to convert them to byte values. It illustrates that the method wraps a call to the method of the object to be converted. :::code language="csharp" source="~/snippets/csharp/System/Byte/Overview/tobyte3.cs" id="Snippet13"::: :::code language="fsharp" source="~/snippets/fsharp/System/Byte/Overview/tobyte3.fs" id="Snippet13"::: @@ -4314,12 +4314,12 @@ ## Remarks `provider` is an instance that obtains a object. The object provides culture-specific information about the format of `value`. If `provider` is `null`, the object for the current culture is used. - If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed. + If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed. ## Examples - The following example creates a custom object that defines the positive sign as "pos" and the negative sign as "neg", which it uses in calls to the method. It then calls the method repeatedly to convert each element in a string array to a value. + The following example creates a custom object that defines the positive sign as "pos" and the negative sign as "neg", which it uses in calls to the method. It then calls the method repeatedly to convert each element in a string array to a value. :::code language="csharp" source="~/snippets/csharp/System/Byte/Overview/tobyte4.cs" id="Snippet14"::: :::code language="fsharp" source="~/snippets/fsharp/System/Byte/Overview/tobyte4.fs" id="Snippet14"::: @@ -4392,7 +4392,7 @@ ## Remarks If `fromBase` is 16, you can prefix the number specified by the `value` parameter with "0x" or "0X". - Because the data type supports unsigned values only, the method assumes that `value` is expressed using unsigned binary representation. In other words, all eight bits are used to represent the numeric value, and a sign bit is absent. As a result, it is possible to write code in which a signed byte value that is out of the range of the data type is converted to a value without the method throwing an exception. The following example converts to its hexadecimal string representation, and then calls the method. Instead of throwing an exception, the method displays the message, "0x80 converts to 128." + Because the data type supports unsigned values only, the method assumes that `value` is expressed using unsigned binary representation. In other words, all eight bits are used to represent the numeric value, and a sign bit is absent. As a result, it is possible to write code in which a signed byte value that is out of the range of the data type is converted to a value without the method throwing an exception. The following example converts to its hexadecimal string representation, and then calls the method. Instead of throwing an exception, the method displays the message, "0x80 converts to 128." :::code language="csharp" source="~/snippets/csharp/System/Convert/ToByte/Conversion.cs" id="Snippet3"::: :::code language="fsharp" source="~/snippets/fsharp/System/Convert/ToByte/Conversion.fs" id="Snippet3"::: @@ -5016,7 +5016,7 @@ implementation of the underlying type of `value`. + If `value` is not `null`, this method wraps a call to the implementation of the underlying type of `value`. @@ -5217,7 +5217,7 @@ ## Remarks `value` must be a string that contains a single character. - If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed. + If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed. @@ -5502,7 +5502,7 @@ method of the underlying type of `value`. + The return value is the result of invoking the method of the underlying type of `value`. `provider` enables the user to specify culture-specific conversion information about the contents of `value`. The base types ignore `provider`; however, the parameter may be used if `value` is a user-defined type that implements the interface. @@ -5594,7 +5594,7 @@ ## Remarks `value` must be a string that contains a single character. - If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed. + If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed. @@ -6135,12 +6135,12 @@ ## Remarks For the conversion to succeed, the runtime type of the `value` parameter must be either a or a , or `value` must be `null`. Otherwise, the method throws an . In addition, if `value` is a string, it must contain a valid representation of a date and time value in the current culture or a is thrown. - The return value is the result of invoking the method of the underlying type of `value`. + The return value is the result of invoking the method of the underlying type of `value`. ## Examples - The following example calls the method with a variety of variables. + The following example calls the method with a variety of variables. :::code language="csharp" source="~/snippets/csharp/System/Convert/ToDateTime/ToDateTime1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Convert/ToDateTime/ToDateTime1.fs" id="Snippet1"::: @@ -6320,16 +6320,16 @@ method on `value` using the formatting information in a object that is initialized for the current culture. The `value` argument must contain the representation of a date and time in one of the formats described in the topic. If `value` is `null`, the method returns . + If `value` is not `null`, the return value is the result of invoking the method on `value` using the formatting information in a object that is initialized for the current culture. The `value` argument must contain the representation of a date and time in one of the formats described in the topic. If `value` is `null`, the method returns . This method tries to parse `value` completely and avoid throwing a . It completes missing month, day, and year information with the current date. If `value` contains only a date and no time, this method assumes a time of midnight. Any leading, inner, or trailing white-space characters in `value` are ignored. - If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed. + If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed. ## Examples - The following example uses the method to convert various string representations of dates and times to values. + The following example uses the method to convert various string representations of dates and times to values. :::code language="csharp" source="~/snippets/csharp/System/Convert/ToDateTime/ToDateTime2.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/Convert/ToDateTime/ToDateTime2.fs" id="Snippet2"::: @@ -6570,12 +6570,12 @@ method of the underlying type of `value`. + The return value is the result of invoking the method of the underlying type of `value`. - `provider` enables the user to specify culture-specific conversion information about the contents of `value`. For example, if `value` is a that represents a date, `provider` could supply culture-specific information about the notation used to represent that date. `provider` is involved in the conversion of `value` if the runtime type of `value` is a , or if `value` is a user-defined type whose implementation makes use of `provider`. If the runtime type of `value` is and `provider` is `null`, the object that represents the current culture is used. + `provider` enables the user to specify culture-specific conversion information about the contents of `value`. For example, if `value` is a that represents a date, `provider` could supply culture-specific information about the notation used to represent that date. `provider` is involved in the conversion of `value` if the runtime type of `value` is a , or if `value` is a user-defined type whose implementation makes use of `provider`. If the runtime type of `value` is and `provider` is `null`, the object that represents the current culture is used. ## Examples - The following example defines a custom format provider, `CustomProvider`, whose method outputs a message to the console that it has been invoked, and then returns the object of the culture whose name was passed as a parameter to its class constructor. Each of these `CustomProvider` objects is used to convert the elements in an object array to date and time values. The output indicates that the `CustomProvider` object is used in the conversion only when the type of the `value` parameter is a . + The following example defines a custom format provider, `CustomProvider`, whose method outputs a message to the console that it has been invoked, and then returns the object of the culture whose name was passed as a parameter to its class constructor. Each of these `CustomProvider` objects is used to convert the elements in an object array to date and time values. The output indicates that the `CustomProvider` object is used in the conversion only when the type of the `value` parameter is a . :::code language="csharp" source="~/snippets/csharp/System/Convert/ToDateTime/todatetime4.cs" id="Snippet4"::: :::code language="fsharp" source="~/snippets/fsharp/System/Convert/ToDateTime/todatetime4.fs" id="Snippet4"::: @@ -6650,11 +6650,11 @@ method on `value`. + The return value is the result of invoking the method on `value`. `provider` is an instance that obtains a object. The object provides culture-specific information about the format of `value`. If `provider` is `null`, the for the current culture is used. - If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed. + If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed. @@ -7030,7 +7030,7 @@ value returned by this method contains a maximum of 15 significant digits. If the `value` parameter contains more than 15 significant digits, it is rounded using rounding to nearest. The following example illustrates how the method uses rounding to nearest to return a value with 15 significant digits. + The value returned by this method contains a maximum of 15 significant digits. If the `value` parameter contains more than 15 significant digits, it is rounded using rounding to nearest. The following example illustrates how the method uses rounding to nearest to return a value with 15 significant digits. :::code language="csharp" source="~/snippets/csharp/System/Convert/ToDecimal/ToDecimal1.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/Convert/ToDecimal/ToDecimal1.fs" id="Snippet2"::: @@ -7299,7 +7299,7 @@ method of the underlying type of `value`. + The return value is the result of invoking the method of the underlying type of `value`. @@ -7448,7 +7448,7 @@ value returned by this method contains a maximum of seven significant digits. If the `value` parameter contains more than seven significant digits, it is rounded using rounding to nearest. The following example illustrates how the method uses rounding to nearest to return a value with seven significant digits. + The value returned by this method contains a maximum of seven significant digits. If the `value` parameter contains more than seven significant digits, it is rounded using rounding to nearest. The following example illustrates how the method uses rounding to nearest to return a value with seven significant digits. :::code language="csharp" source="~/snippets/csharp/System/Convert/ToDecimal/ToDecimal1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Convert/ToDecimal/ToDecimal1.fs" id="Snippet1"::: @@ -7524,9 +7524,9 @@ method is equivalent to passing `value` to the method. `value` is interpreted by using the formatting conventions of the current culture. + Using the method is equivalent to passing `value` to the method. `value` is interpreted by using the formatting conventions of the current culture. - If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed. + If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed. ## Examples The following example illustrates the use of `ToDecimal`. It attempts to convert a to a , and throws the possible exceptions that may arise during the conversion. @@ -7809,7 +7809,7 @@ method of the underlying type of `value`. + The return value is the result of invoking the method of the underlying type of `value`. `provider` enables the user to specify culture-specific conversion information about the contents of `value`. The base types ignore `provider`; however, the parameter may be used if `value` is a user-defined type that implements the interface. @@ -7822,7 +7822,7 @@ :::code language="fsharp" source="~/snippets/fsharp/System/Convert/ToDecimal/todecimal2.fs" id="Snippet10"::: :::code language="vb" source="~/snippets/visualbasic/System/Convert/ToDecimal/todecimal2.vb" id="Snippet10"::: - The following example shows that when a `Temperature` object is passed as a parameter to the method, the implementation of the `Temperature` class is called to perform the conversion. + The following example shows that when a `Temperature` object is passed as a parameter to the method, the implementation of the `Temperature` class is called to perform the conversion. :::code language="csharp" source="~/snippets/csharp/System/Convert/ToDecimal/todecimal2.cs" id="Snippet11"::: :::code language="fsharp" source="~/snippets/fsharp/System/Convert/ToDecimal/todecimal2.fs" id="Snippet11"::: @@ -7899,11 +7899,11 @@ method on `value`. + The return value is the result of invoking the method on `value`. `provider` is an instance that obtains a object. The object provides culture-specific information about the format of `value`. If `provider` is `null`, the for the current culture is used. - If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed. + If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed. @@ -8521,7 +8521,7 @@ implementation of the underlying type of `value`. + If `value` is not `null`, this method wraps a call to the implementation of the underlying type of `value`. @@ -8733,9 +8733,9 @@ method is equivalent to passing `value` to the method. `value` is interpreted by using the formatting conventions of the current culture. + Using the method is equivalent to passing `value` to the method. `value` is interpreted by using the formatting conventions of the current culture. - If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed. + If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed. @@ -9017,7 +9017,7 @@ method of the underlying type of `value`. + The return value is the result of invoking the method of the underlying type of `value`. `provider` enables the user to specify culture-specific conversion information about the contents of `value`. For example, if `value` is a that represents a number, `provider` could supply culture-specific information about the notation used to represent that number. @@ -9098,11 +9098,11 @@ method on `value`. + The return value is the result of invoking the method on `value`. `provider` is an instance that obtains a object. The object provides culture-specific information about the format of `value`. If `provider` is `null`, the for the current culture is used. - If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed. + If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed. @@ -10028,7 +10028,7 @@ implementation of the underlying type of `value`. + If `value` is not `null`, this method wraps a call to the implementation of the underlying type of `value`. @@ -10244,9 +10244,9 @@ method is equivalent to passing `value` to the method. `value` is interpreted by using the formatting conventions of the current culture. + Using the method is equivalent to passing `value` to the method. `value` is interpreted by using the formatting conventions of the current culture. - If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed. + If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed. @@ -10616,7 +10616,7 @@ ## Remarks `provider` is an instance that obtains a object. The object provides culture-specific information about the format of `value`. If `provider` is `null`, the for the current culture is used. - If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed. + If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed. @@ -10694,7 +10694,7 @@ ## Remarks If `fromBase` is 16, you can prefix the number specified by the `value` parameter with "0x" or "0X". - Because the negative sign is not supported for non-base 10 numeric representations, the method assumes that negative numbers use two's complement representation. In other words, the method always interprets the highest-order binary bit of an integer (bit 15) as its sign bit. As a result, it is possible to write code in which a non-base 10 number that is out of the range of the data type is converted to an value without the method throwing an exception. The following example increments by one, converts the resulting number to its hexadecimal string representation, and then calls the method. Instead of throwing an exception, the method displays the message, "0x8000 converts to -32768." + Because the negative sign is not supported for non-base 10 numeric representations, the method assumes that negative numbers use two's complement representation. In other words, the method always interprets the highest-order binary bit of an integer (bit 15) as its sign bit. As a result, it is possible to write code in which a non-base 10 number that is out of the range of the data type is converted to an value without the method throwing an exception. The following example increments by one, converts the resulting number to its hexadecimal string representation, and then calls the method. Instead of throwing an exception, the method displays the message, "0x8000 converts to -32768." :::code language="csharp" source="~/snippets/csharp/System/Convert/ToByte/Conversion.cs" id="Snippet5"::: :::code language="fsharp" source="~/snippets/fsharp/System/Convert/ToByte/Conversion.fs" id="Snippet5"::: @@ -10926,7 +10926,7 @@ method returns a 32-bit signed integer that represents the UTF-16 encoded code unit of the `value` argument. If `value` is not a low surrogate or a high surrogate, this return value also represents the Unicode code point of value. + The method returns a 32-bit signed integer that represents the UTF-16 encoded code unit of the `value` argument. If `value` is not a low surrogate or a high surrogate, this return value also represents the Unicode code point of value. @@ -11367,7 +11367,7 @@ implementation of the underlying type of `value`. + If`value` is not `null`, this method wraps a call to the implementation of the underlying type of `value`. @@ -11583,9 +11583,9 @@ method is equivalent to passing `value` to the method.`value` is interpreted by using the formatting conventions of the current culture. + Using the method is equivalent to passing `value` to the method.`value` is interpreted by using the formatting conventions of the current culture. - If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed. + If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed. @@ -11871,7 +11871,7 @@ method of the underlying type of `value`. + The return value is the result of invoking the method of the underlying type of `value`. `provider` enables the user to specify culture-specific conversion information about the contents of `value`. For example, if `value` is a that represents a number, `provider` could supply culture-specific information about the notation used to represent that number. @@ -11952,11 +11952,11 @@ method on `value`. + The return value is the result of invoking the method on `value`. `provider` is an instance that obtains a object. The object provides culture-specific information about the format of `value`. If `provider` is `null`, the for the current culture is used. - If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed. + If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed. @@ -12033,7 +12033,7 @@ ## Remarks If `fromBase` is 16, you can prefix the number specified by the `value` parameter with "0x" or "0X". - Because the negative sign is not supported for non-base 10 numeric representations, the method assumes that negative numbers use two's complement representation. In other words, the method always interprets the highest-order binary bit of an integer (bit 31) as its sign bit. As a result, it is possible to write code in which a non-base 10 number that is out of the range of the data type is converted to an value without the method throwing an exception. The following example increments by one, converts the resulting number to its hexadecimal string representation, and then calls the method. Instead of throwing an exception, the method displays the message, "0x80000000 converts to -2147483648." + Because the negative sign is not supported for non-base 10 numeric representations, the method assumes that negative numbers use two's complement representation. In other words, the method always interprets the highest-order binary bit of an integer (bit 31) as its sign bit. As a result, it is possible to write code in which a non-base 10 number that is out of the range of the data type is converted to an value without the method throwing an exception. The following example increments by one, converts the resulting number to its hexadecimal string representation, and then calls the method. Instead of throwing an exception, the method displays the message, "0x80000000 converts to -2147483648." :::code language="csharp" source="~/snippets/csharp/System/Convert/ToByte/Conversion.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Convert/ToByte/Conversion.fs" id="Snippet1"::: @@ -12690,7 +12690,7 @@ implementation of the underlying type of `value`. + If `value` is not `null`, this method wraps a call to the implementation of the underlying type of `value`. @@ -12906,9 +12906,9 @@ method is equivalent to passing `value` to the method. `value` is interpreted by using the formatting conventions of the current culture. + Using the method is equivalent to passing `value` to the method. `value` is interpreted by using the formatting conventions of the current culture. - If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed. + If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed. @@ -13192,7 +13192,7 @@ method of the underlying type of `value`. + The return value is the result of invoking the method of the underlying type of `value`. `provider` enables the user to specify culture-specific conversion information about the contents of `value`. For example, if `value` is a that represents a number, `provider` could supply culture-specific information about the notation used to represent that number. @@ -13277,11 +13277,11 @@ method on `value`. + The return value is the result of invoking the method on `value`. `provider` is an `IFormatProvider` instance that obtains a object. The `NumberFormatInfo` object provides culture-specific information about the format of `value`. If `provider` is `null`, the `NumberFormatInfo` for the current culture is used. - If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed. + If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed. @@ -13358,7 +13358,7 @@ ## Remarks If `fromBase` is 16, you can prefix the number specified by the `value` parameter with "0x" or "0X". - Because the negative sign is not supported for non-base 10 numeric representations, the method assumes that negative numbers use two's complement representation. In other words, the method always interprets the highest-order binary bit of a long integer (bit 63) as its sign bit. As a result, it is possible to write code in which a non-base 10 number that is out of the range of the data type is converted to an value without the method throwing an exception. The following example converts to its hexadecimal string representation, and then calls the method. Instead of throwing an exception, the method displays the message, "0xFFFFFFFFFFFFFFFF converts to -1." + Because the negative sign is not supported for non-base 10 numeric representations, the method assumes that negative numbers use two's complement representation. In other words, the method always interprets the highest-order binary bit of a long integer (bit 63) as its sign bit. As a result, it is possible to write code in which a non-base 10 number that is out of the range of the data type is converted to an value without the method throwing an exception. The following example converts to its hexadecimal string representation, and then calls the method. Instead of throwing an exception, the method displays the message, "0xFFFFFFFFFFFFFFFF converts to -1." :::code language="csharp" source="~/snippets/csharp/System/Convert/ToByte/Conversion.cs" id="Snippet7"::: :::code language="fsharp" source="~/snippets/fsharp/System/Convert/ToByte/Conversion.fs" id="Snippet7"::: @@ -14095,7 +14095,7 @@ method of the underlying type of `value`. + The return value is the result of invoking the method of the underlying type of `value`. @@ -14313,9 +14313,9 @@ method is equivalent to passing `value` to the method. `value` is interpreted by using the formatting conventions of the current culture. + Using the method is equivalent to passing `value` to the method. `value` is interpreted by using the formatting conventions of the current culture. - If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed. + If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed. @@ -14617,13 +14617,13 @@ ## Examples - The following example defines a `ByteString` class that stores both signed and unsigned bytes as hexadecimal strings along with a field that indicates the sign of the byte. The `ByteString` class implements the interface. Its method calls the method to perform the conversion. If it fails, it throws an . + The following example defines a `ByteString` class that stores both signed and unsigned bytes as hexadecimal strings along with a field that indicates the sign of the byte. The `ByteString` class implements the interface. Its method calls the method to perform the conversion. If it fails, it throws an . :::code language="csharp" source="~/snippets/csharp/System/Convert/ToSByte/tosbyte2.cs" id="Snippet14"::: :::code language="fsharp" source="~/snippets/fsharp/System/Convert/ToSByte/tosbyte2.fs" id="Snippet14"::: :::code language="vb" source="~/snippets/visualbasic/System/Convert/ToSByte/tosbyte2.vb" id="Snippet14"::: - The following example shows how the implementation of the `ByteString` class is called by the method. + The following example shows how the implementation of the `ByteString` class is called by the method. :::code language="csharp" source="~/snippets/csharp/System/Convert/ToSByte/tosbyte2.cs" id="Snippet15"::: :::code language="fsharp" source="~/snippets/fsharp/System/Convert/ToSByte/tosbyte2.fs" id="Snippet15"::: @@ -14714,7 +14714,7 @@ ## Remarks `provider` is an instance that obtains a object. The object provides culture-specific information about the format of `value`. If `provider` is `null`, the for the current culture is used. - If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed. + If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed. @@ -14800,7 +14800,7 @@ ## Remarks If `fromBase` is 16, you can prefix the number specified by the `value` parameter with "0x" or "0X". - Because the negative sign is not supported for non-base 10 numeric representations, the method assumes that negative numbers use two's complement representation. In other words, the method always interprets the high-order bit of a byte (bit 7) as its sign bit. As a result, it is possible to write code in which a non-base 10 number that is out of the range of the data type is converted to an value without the method throwing an exception. The following example converts to its hexadecimal string representation, and then calls the method. Instead of throwing an exception, the method displays the message, "0xff converts to -1." + Because the negative sign is not supported for non-base 10 numeric representations, the method assumes that negative numbers use two's complement representation. In other words, the method always interprets the high-order bit of a byte (bit 7) as its sign bit. As a result, it is possible to write code in which a non-base 10 number that is out of the range of the data type is converted to an value without the method throwing an exception. The following example converts to its hexadecimal string representation, and then calls the method. Instead of throwing an exception, the method displays the message, "0xff converts to -1." :::code language="csharp" source="~/snippets/csharp/System/Convert/ToByte/Conversion.cs" id="Snippet9"::: :::code language="fsharp" source="~/snippets/fsharp/System/Convert/ToByte/Conversion.fs" id="Snippet9"::: @@ -15456,7 +15456,7 @@ method of the underlying type of `value`. + The return value is the result of invoking the method of the underlying type of `value`. @@ -15658,9 +15658,9 @@ method is equivalent to passing `value` to the method. `value` is interpreted by using the formatting conventions of the current culture. + Using the method is equivalent to passing `value` to the method. `value` is interpreted by using the formatting conventions of the current culture. - If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed. + If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed. @@ -15942,7 +15942,7 @@ method of the underlying type of `value`. + The return value is the result of invoking the method of the underlying type of `value`. `provider` enables the user to specify culture-specific conversion information about the contents of `value`. For example, if `value` is a that represents a number, `provider` could supply culture-specific information about the notation used to represent that number. @@ -15951,13 +15951,13 @@ ## Examples - The following example defines a `Temperature` class that implements the interface. Its implementation of the method returns the internal value of a private variable that represents the temperature. + The following example defines a `Temperature` class that implements the interface. Its implementation of the method returns the internal value of a private variable that represents the temperature. :::code language="csharp" source="~/snippets/csharp/System/Convert/ToSingle/tosingle2.cs" id="Snippet14"::: :::code language="fsharp" source="~/snippets/fsharp/System/Convert/ToSingle/tosingle2.fs" id="Snippet14"::: :::code language="vb" source="~/snippets/visualbasic/System/Convert/ToSingle/tosingle2.vb" id="Snippet14"::: - The following example illustrates how a call to the method, in turn, calls the implementation of the `Temperature` class. + The following example illustrates how a call to the method, in turn, calls the implementation of the `Temperature` class. :::code language="csharp" source="~/snippets/csharp/System/Convert/ToSingle/tosingle2.cs" id="Snippet15"::: :::code language="fsharp" source="~/snippets/fsharp/System/Convert/ToSingle/tosingle2.fs" id="Snippet15"::: @@ -16029,11 +16029,11 @@ method on `value`. + The return value is the result of invoking the method on `value`. `provider` is an instance that obtains a object. The object provides culture-specific information about the format of `value`. If `provider` is `null`, the for the current culture is used. - If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed. + If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed. @@ -16117,7 +16117,7 @@ . It returns for `true` values and for `false` values. + This implementation is identical to . It returns for `true` values and for `false` values. @@ -16255,7 +16255,7 @@ . + This implementation is identical to . @@ -16598,7 +16598,7 @@ This implementation is identical to . It formats `value` by using the formatting conventions of the current culture. ## Examples - The following example compares the method with the method. It defines a custom object that uses the sting "minus" to represent the negative sign. It converts each element in an integer array to its equivalent string representation using default formatting (the formatting conventions of the current culture) and the custom format provider. + The following example compares the method with the method. It defines a custom object that uses the sting "minus" to represent the negative sign. It converts each element in an integer array to its equivalent string representation using default formatting (the formatting conventions of the current culture) and the custom format provider. :::code language="csharp" source="~/snippets/csharp/System/Convert/ToString/tostring7.cs" id="Snippet27"::: :::code language="fsharp" source="~/snippets/fsharp/System/Convert/ToString/tostring7.fs" id="Snippet27"::: @@ -16730,7 +16730,7 @@ implementation of `value`. If `value` does not implement the interface, the method tries to call the implementation of `value`. If value does not implement the interface, the method calls the `ToString` method of the underlying type of `value`. + To convert `value` to its string representation, the method tries to call the implementation of `value`. If `value` does not implement the interface, the method tries to call the implementation of `value`. If value does not implement the interface, the method calls the `ToString` method of the underlying type of `value`. @@ -16945,7 +16945,7 @@ method and calls the method to confirm that the method returns the original string. The example also calls the method to ensure that the two strings are not identical because the original string is interned. + The following example passes a string to the method and calls the method to confirm that the method returns the original string. The example also calls the method to ensure that the two strings are not identical because the original string is interned. :::code language="csharp" source="~/snippets/csharp/System/Convert/ToString/tostring_string1.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/Convert/ToString/tostring_string1.fs" id="Snippet2"::: @@ -17240,7 +17240,7 @@ . It returns for `true` values and for `false` values. + This implementation is identical to . It returns for `true` values and for `false` values. @@ -17318,7 +17318,7 @@ . + This implementation is identical to . @@ -17394,7 +17394,7 @@ method represents `value` by its magnitude only. If the method is called to create a string that will later be converted back to a number, a corresponding method that assumes a magnitude-only numeric representation should be called to perform the conversion. Such methods include or . + If `toBase` does not equal 10, the string that is returned by the method represents `value` by its magnitude only. If the method is called to create a string that will later be converted back to a number, a corresponding method that assumes a magnitude-only numeric representation should be called to perform the conversion. Such methods include or . @@ -17553,7 +17553,7 @@ . + This implementation is identical to . @@ -17631,7 +17631,7 @@ . + This implementation is identical to . @@ -17709,7 +17709,7 @@ + This implementation is identical to @@ -17787,12 +17787,12 @@ . + This implementation is identical to . ## Examples - The following example defines a custom class that defines its negative sign as the string "~" and its positive sign as the string "!". It then calls the method to convert each element in an array of 16-bit integers to its equivalent string representation. The conversion uses the invariant culture as well as the custom object. + The following example defines a custom class that defines its negative sign as the string "~" and its positive sign as the string "!". It then calls the method to convert each element in an array of 16-bit integers to its equivalent string representation. The conversion uses the invariant culture as well as the custom object. :::code language="csharp" source="~/snippets/csharp/System/Convert/ToString/tostring3.cs" id="Snippet19"::: :::code language="fsharp" source="~/snippets/fsharp/System/Convert/ToString/tostring3.fs" id="Snippet19"::: @@ -17863,7 +17863,7 @@ method is called to create a string that will later be converted back to a number, a corresponding method that assumes a similar numeric representation should be called to perform the conversion. Such methods include and . + If `value` is positive and `toBase` is 2, 8, or 16, the returned string uses sign-and-magnitude representation. If `value` is negative and `toBase` is 2, 8, or 16, the returned string uses two's complement representation. This means that the high-order bit of the high-order byte (bit 15) is interpreted as the sign bit. If the method is called to create a string that will later be converted back to a number, a corresponding method that assumes a similar numeric representation should be called to perform the conversion. Such methods include and . @@ -17944,12 +17944,12 @@ . + This implementation is identical to . ## Examples - The following example defines a custom class that defines its negative sign as the string "~" and its positive sign as the string "!". It then calls the method to convert each element in an array of integers to its equivalent string representation. The conversion uses the invariant culture as well as the custom object. + The following example defines a custom class that defines its negative sign as the string "~" and its positive sign as the string "!". It then calls the method to convert each element in an array of integers to its equivalent string representation. The conversion uses the invariant culture as well as the custom object. :::code language="csharp" source="~/snippets/csharp/System/Convert/ToString/tostring3.cs" id="Snippet20"::: :::code language="fsharp" source="~/snippets/fsharp/System/Convert/ToString/tostring3.fs" id="Snippet20"::: @@ -18020,7 +18020,7 @@ method is called to create a string that will later be converted back to a number, a corresponding method that assumes a similar numeric representation should be called to perform the conversion. Such methods include and . + If `value` is positive and `toBase` is 2, 8, or 16, the returned string uses sign-and-magnitude representation. If `value` is negative and `toBase` is 2, 8, or 16, the returned string uses two's complement representation. This means that the high-order bit of the highest-order byte (bit 31) is interpreted as the sign bit. If the method is called to create a string that will later be converted back to a number, a corresponding method that assumes a similar numeric representation should be called to perform the conversion. Such methods include and . @@ -18101,12 +18101,12 @@ . + This implementation is identical to . ## Examples - The following example defines a custom class that defines its negative sign as the string "~" and its positive sign as the string "!". It then calls the method to convert each element in a long integer array to its equivalent string representation. The conversion uses the invariant culture as well as the custom object. + The following example defines a custom class that defines its negative sign as the string "~" and its positive sign as the string "!". It then calls the method to convert each element in a long integer array to its equivalent string representation. The conversion uses the invariant culture as well as the custom object. :::code language="csharp" source="~/snippets/csharp/System/Convert/ToString/tostring3.cs" id="Snippet21"::: :::code language="fsharp" source="~/snippets/fsharp/System/Convert/ToString/tostring3.fs" id="Snippet21"::: @@ -18177,7 +18177,7 @@ method is called to create a string that will later be converted back to a number, a corresponding method that assumes a similar numeric representation should be called to perform the conversion. Such methods include and . + If `value` is positive and `toBase` is not 10, the returned string uses sign-and-magnitude representation. If `value` is negative and `toBase` is not 10, the returned string uses two's complement representation. This means that the high-order bit of the highest-order byte (bit 63) is interpreted as the sign bit. If the method is called to create a string that will later be converted back to a number, a corresponding method that assumes a similar numeric representation should be called to perform the conversion. Such methods include and . @@ -18251,20 +18251,20 @@ interface, the method calls the implementation of `value`. Otherwise, if the `value` parameter implements the interface, the method calls its implementation. If `value` implements neither interface, the method calls the `value` parameter's `ToString()` method, and the `provider` parameter is ignored. + If the `value` parameter implements the interface, the method calls the implementation of `value`. Otherwise, if the `value` parameter implements the interface, the method calls its implementation. If `value` implements neither interface, the method calls the `value` parameter's `ToString()` method, and the `provider` parameter is ignored. The `provider` parameter is used if the `value` parameter implements the or interface. The most common use of the `provider` parameter is to specify culture-specific information used in the conversion of `value`. For example, if the `value` parameter is a negative decimal number, the `provider` parameter can supply culture-specific information about the notation used for the negative sign and decimal separator. The second example in the next section illustrates a format provider that does not supply culture-sensitive formatting information. ## Examples - The following example defines a `Temperature` class that overrides the method but does not implement the interface. The example illustrates how calls to the method, in turn, call the `Temperature.ToString` method. + The following example defines a `Temperature` class that overrides the method but does not implement the interface. The example illustrates how calls to the method, in turn, call the `Temperature.ToString` method. :::code language="csharp" source="~/snippets/csharp/System/Convert/ToString/tostring5.cs" id="Snippet26"::: :::code language="fsharp" source="~/snippets/fsharp/System/Convert/ToString/tostring5.fs" id="Snippet26"::: :::code language="vb" source="~/snippets/visualbasic/System/Convert/ToString/tostring5.vb" id="Snippet26"::: - The following example defines a `Temperature` class that implements the interface but does not implement the interface. Its implementation represents the `Temperature` value in Celsius, Fahrenheit, or Kelvin, depending on the format string. The example also defines a `TemperatureProvider` class that implements and provides a randomly generated format string that is used by the implementation of the `Temperature` class. + The following example defines a `Temperature` class that implements the interface but does not implement the interface. Its implementation represents the `Temperature` value in Celsius, Fahrenheit, or Kelvin, depending on the format string. The example also defines a `TemperatureProvider` class that implements and provides a randomly generated format string that is used by the implementation of the `Temperature` class. :::code language="csharp" source="~/snippets/csharp/System/Convert/ToString/tostring_obj30.cs" id="Snippet30"::: :::code language="fsharp" source="~/snippets/fsharp/System/Convert/ToString/tostring_obj30.fs" id="Snippet30"::: @@ -18343,12 +18343,12 @@ . + This implementation is identical to . ## Examples - The following example defines a custom class that defines its negative sign as the string "~" and its positive sign as the string "!". It then calls the method to convert each element in signed byte array to its equivalent string representation. The conversion uses the invariant culture as well as the custom object. + The following example defines a custom class that defines its negative sign as the string "~" and its positive sign as the string "!". It then calls the method to convert each element in signed byte array to its equivalent string representation. The conversion uses the invariant culture as well as the custom object. :::code language="csharp" source="~/snippets/csharp/System/Convert/ToString/tostring3.cs" id="Snippet17"::: :::code language="fsharp" source="~/snippets/fsharp/System/Convert/ToString/tostring3.fs" id="Snippet17"::: @@ -18421,7 +18421,7 @@ . + This implementation is identical to . @@ -18575,12 +18575,12 @@ . + This implementation is identical to . ## Examples - The following example defines a custom class that defines its negative sign as the string "~" and its positive sign as the string "!". It then calls the method to convert a 16-bit unsigned integer value to its equivalent string representation. The conversion uses both the invariant culture and the custom object. The output indicates that this formatting information is not used, because by default the "G" format specifier does not include a positive sign with positive values. + The following example defines a custom class that defines its negative sign as the string "~" and its positive sign as the string "!". It then calls the method to convert a 16-bit unsigned integer value to its equivalent string representation. The conversion uses both the invariant culture and the custom object. The output indicates that this formatting information is not used, because by default the "G" format specifier does not include a positive sign with positive values. :::code language="csharp" source="~/snippets/csharp/System/Convert/ToString/tostring3.cs" id="Snippet22"::: :::code language="fsharp" source="~/snippets/fsharp/System/Convert/ToString/tostring3.fs" id="Snippet22"::: @@ -18659,12 +18659,12 @@ . + This implementation is identical to . ## Examples - The following example defines a custom class that defines its negative sign as the string "~" and its positive sign as the string "!". It then calls the method to convert an unsigned integer value to its equivalent string representation. The conversion uses both the invariant culture and the custom object. The output indicates that this formatting information is not used, because by default the "G" format specifier does not include a positive sign with positive values. + The following example defines a custom class that defines its negative sign as the string "~" and its positive sign as the string "!". It then calls the method to convert an unsigned integer value to its equivalent string representation. The conversion uses both the invariant culture and the custom object. The output indicates that this formatting information is not used, because by default the "G" format specifier does not include a positive sign with positive values. :::code language="csharp" source="~/snippets/csharp/System/Convert/ToString/tostring3.cs" id="Snippet23"::: :::code language="fsharp" source="~/snippets/fsharp/System/Convert/ToString/tostring3.fs" id="Snippet23"::: @@ -18743,12 +18743,12 @@ . + This implementation is identical to . ## Examples - The following example defines a custom class that defines its negative sign as the string "~" and its positive sign as the string "!". It then calls the method to convert an unsigned long integer value to its equivalent string representation. The conversion uses both the invariant culture and the custom object. The output indicates that this formatting information is not used, because by default the "G" format specifier does not include a positive sign with positive values. + The following example defines a custom class that defines its negative sign as the string "~" and its positive sign as the string "!". It then calls the method to convert an unsigned long integer value to its equivalent string representation. The conversion uses both the invariant culture and the custom object. The output indicates that this formatting information is not used, because by default the "G" format specifier does not include a positive sign with positive values. :::code language="csharp" source="~/snippets/csharp/System/Convert/ToString/tostring3.cs" id="Snippet24"::: :::code language="fsharp" source="~/snippets/fsharp/System/Convert/ToString/tostring3.fs" id="Snippet24"::: @@ -19453,7 +19453,7 @@ method of the underlying type of `value`. + The return value is the result of invoking the method of the underlying type of `value`. @@ -19683,9 +19683,9 @@ method is equivalent to passing `value` to the method. `value` is interpreted by using the formatting conventions of the current culture. + Using the method is equivalent to passing `value` to the method. `value` is interpreted by using the formatting conventions of the current culture. - If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed. + If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed. @@ -19967,7 +19967,7 @@ method of the underlying type of `value`. + The return value is the result of invoking the method of the underlying type of `value`. `provider` enables the user to specify culture-specific conversion information about the contents of `value`. For example, if `value` is a that represents a number, `provider` could supply culture-specific information about the notation used to represent that number. @@ -19982,7 +19982,7 @@ :::code language="fsharp" source="~/snippets/fsharp/System/Convert/ToUInt16/touint16_3.fs" id="Snippet16"::: :::code language="vb" source="~/snippets/visualbasic/System/Convert/ToUInt16/touint16_3.vb" id="Snippet16"::: - The following example shows that a call to the method that passes a `HexString` object as a parameter, in turn, calls the implementation of the `HexString` class. + The following example shows that a call to the method that passes a `HexString` object as a parameter, in turn, calls the implementation of the `HexString` class. :::code language="csharp" source="~/snippets/csharp/System/Convert/ToUInt16/touint16_3.cs" id="Snippet17"::: :::code language="fsharp" source="~/snippets/fsharp/System/Convert/ToUInt16/touint16_3.fs" id="Snippet17"::: @@ -20064,11 +20064,11 @@ on `value`. + The return value is the result of invoking on `value`. `provider` is an instance that obtains a object. The object provides culture-specific information about the format of `value`. If `provider` is `null`, the for the current culture is used. - If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed. + If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed. @@ -20151,7 +20151,7 @@ ## Remarks If `fromBase` is 16, you can prefix the number specified by the `value` parameter with "0x" or "0X". - Because the data type supports unsigned values only, the method assumes that `value` is expressed using unsigned binary representation. In other words, all 16 bits are used to represent the numeric value, and a sign bit is absent. As a result, it is possible to write code in which a signed integer value that is out of the range of the data type is converted to a value without the method throwing an exception. The following example converts to its hexadecimal string representation, and then calls the method. Instead of throwing an exception, the method displays the message, "0x8000 converts to 32768." + Because the data type supports unsigned values only, the method assumes that `value` is expressed using unsigned binary representation. In other words, all 16 bits are used to represent the numeric value, and a sign bit is absent. As a result, it is possible to write code in which a signed integer value that is out of the range of the data type is converted to a value without the method throwing an exception. The following example converts to its hexadecimal string representation, and then calls the method. Instead of throwing an exception, the method displays the message, "0x8000 converts to 32768." :::code language="csharp" source="~/snippets/csharp/System/Convert/ToByte/Conversion.cs" id="Snippet11"::: :::code language="fsharp" source="~/snippets/fsharp/System/Convert/ToByte/Conversion.fs" id="Snippet11"::: @@ -20887,7 +20887,7 @@ method of the underlying type of `value`. + The return value is the result of invoking the method of the underlying type of `value`. @@ -21117,9 +21117,9 @@ method is equivalent to passing `value` to the method. `value` is interpreted by using the formatting conventions of the current culture. + Using the method is equivalent to passing `value` to the method. `value` is interpreted by using the formatting conventions of the current culture. - If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed. + If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed. @@ -21399,7 +21399,7 @@ method of the underlying type of `value`. + The return value is the result of invoking the method of the underlying type of `value`. `provider` enables the user to specify culture-specific conversion information about the contents of `value`. For example, if `value` is a that represents a number, `provider` could supply culture-specific information about the notation used to represent that number. @@ -21414,7 +21414,7 @@ :::code language="fsharp" source="~/snippets/fsharp/System/Convert/ToUInt32/touint32_4.fs" id="Snippet17"::: :::code language="vb" source="~/snippets/visualbasic/System/Convert/ToUInt32/touint32_4.vb" id="Snippet17"::: - The following example shows that a call to the method that passes a `HexString` object as a parameter, in turn, calls the implementation of the `HexString` class. + The following example shows that a call to the method that passes a `HexString` object as a parameter, in turn, calls the implementation of the `HexString` class. :::code language="csharp" source="~/snippets/csharp/System/Convert/ToUInt32/touint32_4.cs" id="Snippet18"::: :::code language="fsharp" source="~/snippets/fsharp/System/Convert/ToUInt32/touint32_4.fs" id="Snippet18"::: @@ -21496,11 +21496,11 @@ on `value`. + The return value is the result of invoking on `value`. `provider` is an instance that obtains a object. The object provides culture-specific information about the format of `value`. If `provider` is `null`, the for the current culture is used. - If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed. + If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed. @@ -21583,7 +21583,7 @@ ## Remarks If `fromBase` is 16, you can prefix the number specified by the `value` parameter with "0x" or "0X". - Because the data type supports unsigned values only, the method assumes that `value` is expressed using unsigned binary representation. In other words, all 32 bits are used to represent the numeric value, and a sign bit is absent. As a result, it is possible to write code in which a signed integer value that is out of the range of the data type is converted to a value without the method throwing an exception. The following example converts to its hexadecimal string representation, and then calls the method. Instead of throwing an exception, the method displays the message, "0x80000000 converts to 2147483648." + Because the data type supports unsigned values only, the method assumes that `value` is expressed using unsigned binary representation. In other words, all 32 bits are used to represent the numeric value, and a sign bit is absent. As a result, it is possible to write code in which a signed integer value that is out of the range of the data type is converted to a value without the method throwing an exception. The following example converts to its hexadecimal string representation, and then calls the method. Instead of throwing an exception, the method displays the message, "0x80000000 converts to 2147483648." :::code language="csharp" source="~/snippets/csharp/System/Convert/ToByte/Conversion.cs" id="Snippet13"::: :::code language="fsharp" source="~/snippets/fsharp/System/Convert/ToByte/Conversion.fs" id="Snippet13"::: @@ -22323,7 +22323,7 @@ method of the underlying type of `value`. + The return value is the result of invoking the method of the underlying type of `value`. @@ -22553,9 +22553,9 @@ method is equivalent to passing `value` to the method. `value` is interpreted by using the formatting conventions of the current culture. + Using the method is equivalent to passing `value` to the method. `value` is interpreted by using the formatting conventions of the current culture. - If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed. + If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed. @@ -22833,7 +22833,7 @@ method of the underlying type of `value`. + The return value is the result of invoking the method of the underlying type of `value`. `provider` enables the user to specify culture-specific conversion information about the contents of `value`. For example, if `value` is a that represents a number, `provider` could supply culture-specific information about the notation used to represent that number. @@ -22848,7 +22848,7 @@ :::code language="fsharp" source="~/snippets/fsharp/System/Convert/ToUInt64/touint64_4.fs" id="Snippet17"::: :::code language="vb" source="~/snippets/visualbasic/System/Convert/ToUInt64/touint64_4.vb" id="Snippet17"::: - The following example shows that a call to the method that passes a `HexString` object as a parameter, in turn, calls the implementation of the `HexString` class. + The following example shows that a call to the method that passes a `HexString` object as a parameter, in turn, calls the implementation of the `HexString` class. :::code language="csharp" source="~/snippets/csharp/System/Convert/ToUInt64/touint64_4.cs" id="Snippet18"::: :::code language="fsharp" source="~/snippets/fsharp/System/Convert/ToUInt64/touint64_4.fs" id="Snippet18"::: @@ -22930,11 +22930,11 @@ on `value`. + The return value is the result of invoking on `value`. `provider` is an implementation that obtains a object. The object provides culture-specific information about the format of `value`. If `provider` is `null`, the object for the current culture is used. - If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed. + If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed. @@ -23017,7 +23017,7 @@ ## Remarks If `fromBase` is 16, you can prefix the number specified by the `value` parameter with "0x" or "0X". - Because the data type supports unsigned values only, the method assumes that `value` is expressed using unsigned binary representation. In other words, all 64 bits are used to represent the numeric value, and a sign bit is absent. As a result, it is possible to write code in which a signed long integer value that is out of the range of the data type is converted to a value without the method throwing an exception. The following example converts to its hexadecimal string representation, and then calls the method. Instead of throwing an exception, the method displays the message, "0x8000000000000000 converts to 9223372036854775808." + Because the data type supports unsigned values only, the method assumes that `value` is expressed using unsigned binary representation. In other words, all 64 bits are used to represent the numeric value, and a sign bit is absent. As a result, it is possible to write code in which a signed long integer value that is out of the range of the data type is converted to a value without the method throwing an exception. The following example converts to its hexadecimal string representation, and then calls the method. Instead of throwing an exception, the method displays the message, "0x8000000000000000 converts to 9223372036854775808." :::code language="csharp" source="~/snippets/csharp/System/Convert/ToByte/Conversion.cs" id="Snippet15"::: :::code language="fsharp" source="~/snippets/fsharp/System/Convert/ToByte/Conversion.fs" id="Snippet15"::: diff --git a/xml/System/Converter`2.xml b/xml/System/Converter`2.xml index 97bf4a433b9..db1c5ff4c52 100644 --- a/xml/System/Converter`2.xml +++ b/xml/System/Converter`2.xml @@ -87,23 +87,23 @@ method of the class and the method of the class to convert each element of the collection from one type to another. + This delegate is used by the method of the class and the method of the class to convert each element of the collection from one type to another. ## Examples - This section contains two code examples. The first demonstrates the delegate with the method of the class, and the second demonstrates the delegate with the method of the generic class. + This section contains two code examples. The first demonstrates the delegate with the method of the class, and the second demonstrates the delegate with the method of the generic class. Example 1 - The following code example defines a method named `PointFToPoint` that converts a structure to a structure. The example then creates an array of structures, creates a `Converter` delegate (`Converter(Of PointF, Point)` in Visual Basic) to represent the `PointFToPoint` method, and passes the delegate to the method. The method passes each element of the input list to the `PointFToPoint` method and puts the converted elements into a new list of structures. Both lists are displayed. - + The following code example defines a method named `PointFToPoint` that converts a structure to a structure. The example then creates an array of structures, creates a `Converter` delegate (`Converter(Of PointF, Point)` in Visual Basic) to represent the `PointFToPoint` method, and passes the delegate to the method. The method passes each element of the input list to the `PointFToPoint` method and puts the converted elements into a new list of structures. Both lists are displayed. + :::code language="csharp" source="~/snippets/csharp/System/Array/ConvertAllTInput,TOutput/source.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/Array/ConvertAllTInput,TOutput/source.vb" id="Snippet1"::: Example 2 - The following code example defines a method named `PointFToPoint` that converts a structure to a structure. The example then creates a of structures, creates a `Converter` delegate (`Converter(Of PointF, Point)` in Visual Basic) to represent the `PointFToPoint` method, and passes the delegate to the method. The method passes each element of the input list to the `PointFToPoint` method and puts the converted elements into a new list of structures. Both lists are displayed. + The following code example defines a method named `PointFToPoint` that converts a structure to a structure. The example then creates a of structures, creates a `Converter` delegate (`Converter(Of PointF, Point)` in Visual Basic) to represent the `PointFToPoint` method, and passes the delegate to the method. The method passes each element of the input list to the `PointFToPoint` method and puts the converted elements into a new list of structures. Both lists are displayed. :::code language="csharp" source="~/snippets/csharp/System/ConverterTInput,TOutput/Overview/source.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/ConverterTInput,TOutput/Overview/source.vb" id="Snippet1"::: diff --git a/xml/System/DBNull.xml b/xml/System/DBNull.xml index 5bc35efc03b..add54050b85 100644 --- a/xml/System/DBNull.xml +++ b/xml/System/DBNull.xml @@ -94,7 +94,7 @@ ## Remarks The class represents a nonexistent value. In a database, for example, a column in a row of a table might not contain any data whatsoever. That is, the column is considered to not exist at all instead of merely not having a value. A object represents the nonexistent column. Additionally, COM interop uses the class to distinguish between a VT_NULL variant, which indicates a nonexistent value, and a VT_EMPTY variant, which indicates an unspecified value. - The type is a singleton class, which means only one object exists. The member represents the sole object. can be used to explicitly assign a nonexistent value to a database field, although most ADO.NET data providers automatically assign values of when a field does not have a valid value. You can determine whether a value retrieved from a database field is a value by passing the value of that field to the `DBNull.Value.Equals` method. However, some languages and database objects supply methods that make it easier to determine whether the value of a database field is . These include the Visual Basic `IsDBNull` function, the method, the method, and the method. + The type is a singleton class, which means only one object exists. The member represents the sole object. can be used to explicitly assign a nonexistent value to a database field, although most ADO.NET data providers automatically assign values of when a field does not have a valid value. You can determine whether a value retrieved from a database field is a value by passing the value of that field to the `DBNull.Value.Equals` method. However, some languages and database objects supply methods that make it easier to determine whether the value of a database field is . These include the Visual Basic `IsDBNull` function, the method, the method, and the method. Do not confuse the notion of `null` in an object-oriented programming language with a object. In an object-oriented programming language, `null` means the absence of a reference to an object. represents an uninitialized variant or nonexistent database column. @@ -891,7 +891,7 @@ or , the return value is the current object itself. If the `type` parameter specifies , the return value is the string returned by the method. + Three conversions are supported: If the `type` parameter specifies or , the return value is the current object itself. If the `type` parameter specifies , the return value is the string returned by the method. ]]> @@ -1260,7 +1260,7 @@ If a database field has missing data, you can use the property to explicitly assign a object value to the field. However, most data providers do this automatically. - To evaluate database fields to determine whether their values are , you can pass the field value to the `DBNull.Value.Equals` method. However, this method is rarely used because there are a number of other ways to evaluate a database field for missing data. These include the Visual Basic `IsDBNull` function, the method, the method, the method, and several other methods. + To evaluate database fields to determine whether their values are , you can pass the field value to the `DBNull.Value.Equals` method. However, this method is rarely used because there are a number of other ways to evaluate a database field for missing data. These include the Visual Basic `IsDBNull` function, the method, the method, the method, and several other methods. diff --git a/xml/System/DateOnly.xml b/xml/System/DateOnly.xml index 7d622ad86f4..0fdb96d8694 100644 --- a/xml/System/DateOnly.xml +++ b/xml/System/DateOnly.xml @@ -1154,7 +1154,7 @@ method parses the string representation of a date, which must be in the format defined by the `format` parameter. It also requires that the \ element of the string representation of a date appear in the order specified by `format`, and that `s` have no white space other than that permitted by `format`. + The method parses the string representation of a date, which must be in the format defined by the `format` parameter. It also requires that the \ element of the string representation of a date appear in the order specified by `format`, and that `s` have no white space other than that permitted by `format`. The `format` parameter is a string that contains either a single standard format specifier, or one or more custom format specifiers that define the required format of `s`. For details about valid formatting codes, see [Standard Date and Time Format Strings](/dotnet/standard/base-types/standard-date-and-time-format-strings) or [Custom Date and Time Format Strings](/dotnet/standard/base-types/custom-date-and-time-format-strings). > [!NOTE] > If `format` is a custom format pattern that does not include date separators (such as "yyyyMMdd"), use the widest form of each custom format specifier. For example, if you want to specify months in the format pattern, specify the wider form, "MM", instead of the narrower form, "M". @@ -1457,7 +1457,7 @@ ## Remarks The property of the resulting is initialized to . - + ]]> diff --git a/xml/System/DateTime.xml b/xml/System/DateTime.xml index d0e548c9f0e..4ea7ac2d898 100644 --- a/xml/System/DateTime.xml +++ b/xml/System/DateTime.xml @@ -399,14 +399,14 @@ value by using the year, month, and day in another calendar, call the constructor. + This constructor interprets `year`, `month`, and `day` as a year, month, and day in the Gregorian calendar. To instantiate a value by using the year, month, and day in another calendar, call the constructor. The time of day for the resulting is midnight (00:00:00). The property is initialized to . ## Examples - The following example uses the constructor to instantiate a value. The example also illustrates that this overload creates a value whose time component equals midnight (or 0:00). + The following example uses the constructor to instantiate a value. The example also illustrates that this overload creates a value whose time component equals midnight (or 0:00). :::code language="csharp" source="~/snippets/csharp/System/DateTime/.ctor/ctorexample1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.datetime.constructor/fs/ctorexample1.fs" id="Snippet1"::: @@ -486,7 +486,7 @@ ## Examples - The following example calls the constructor twice to instantiate two values. The first call instantiates a value by using a object. Because the Persian calendar cannot be designated as the default calendar for a culture, displaying a date in the Persian calendar requires individual calls to its , , and methods. The second call to the constructor instantiates a value by using a object. The example changes the current culture to Arabic (Syria) and changes the current culture's default calendar to the Hijri calendar. Because Hijri is the current culture's default calendar, the method uses it to format the date. When the previous current culture (which is English (United States) in this case) is restored, the method uses the current culture's default Gregorian calendar to format the date. + The following example calls the constructor twice to instantiate two values. The first call instantiates a value by using a object. Because the Persian calendar cannot be designated as the default calendar for a culture, displaying a date in the Persian calendar requires individual calls to its , , and methods. The second call to the constructor instantiates a value by using a object. The example changes the current culture to Arabic (Syria) and changes the current culture's default calendar to the Hijri calendar. Because Hijri is the current culture's default calendar, the method uses it to format the date. When the previous current culture (which is English (United States) in this case) is restored, the method uses the current culture's default Gregorian calendar to format the date. :::code language="csharp" source="~/snippets/csharp/System/DateTime/.ctor/ctorexample2.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.datetime.constructor/fs/ctorexample2.fs" id="Snippet2"::: @@ -569,14 +569,14 @@ ## Remarks The property is initialized to . - This constructor interprets`year`, `month`, and `day` as a year, month, and day in the Gregorian calendar. To instantiate a value by using the year, month, and day in another calendar, call the constructor. + This constructor interprets`year`, `month`, and `day` as a year, month, and day in the Gregorian calendar. To instantiate a value by using the year, month, and day in another calendar, call the constructor. For applications in which portability of date and time data or a limited degree of time zone awareness is important, you can use the corresponding constructor. ## Examples - The following example uses the constructor to instantiate a value. + The following example uses the constructor to instantiate a value. :::code language="csharp" source="~/snippets/csharp/System/DateTime/.ctor/ctorexample1.cs" id="Snippet3"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.datetime.constructor/fs/ctorexample1.fs" id="Snippet3"::: @@ -666,14 +666,14 @@ value by using the year, month, and day in another calendar, call the constructor. + This constructor interprets`year`, `month`, and `day` as a year, month, and day in the Gregorian calendar. To instantiate a value by using the year, month, and day in another calendar, call the constructor. For applications in which portability of date and time data or a limited degree of time zone awareness is important, you can use the corresponding constructor. ## Examples - The following example uses the constructor to instantiate a value. + The following example uses the constructor to instantiate a value. :::code language="csharp" source="~/snippets/csharp/System/DateTime/.ctor/ctorexample1.cs" id="Snippet7"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.datetime.constructor/fs/ctorexample1.fs" id="Snippet7"::: @@ -773,7 +773,7 @@ ## Examples - The following example calls the constructor twice to instantiate two values. The first call instantiates a value by using a object. Because the Persian calendar cannot be designated as the default calendar for a culture, displaying a date in the Persian calendar requires individual calls to its , , and methods. The second call to the constructor instantiates a value by using a object. The example changes the current culture to Arabic (Syria) and changes the current culture's default calendar to the Hijri calendar. Because Hijri is the current culture's default calendar, the method uses it to format the date. When the previous current culture (which is English (United States) in this case) is restored, the method uses the current culture's default Gregorian calendar to format the date. + The following example calls the constructor twice to instantiate two values. The first call instantiates a value by using a object. Because the Persian calendar cannot be designated as the default calendar for a culture, displaying a date in the Persian calendar requires individual calls to its , , and methods. The second call to the constructor instantiates a value by using a object. The example changes the current culture to Arabic (Syria) and changes the current culture's default calendar to the Hijri calendar. Because Hijri is the current culture's default calendar, the method uses it to format the date. When the previous current culture (which is English (United States) in this case) is restored, the method uses the current culture's default Gregorian calendar to format the date. :::code language="csharp" source="~/snippets/csharp/System/DateTime/.ctor/ctorexample4.cs" id="Snippet4"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.datetime.constructor/fs/ctorexample4.fs" id="Snippet4"::: @@ -868,7 +868,7 @@ value by using the year, month, and day in another calendar, call the constructor. + This constructor interprets`year`, `month`, and `day` as a year, month, and day in the Gregorian calendar. To instantiate a value by using the year, month, and day in another calendar, call the constructor. The property is initialized to . @@ -877,7 +877,7 @@ ## Examples - The following example uses the constructor to instantiate a value. + The following example uses the constructor to instantiate a value. :::code language="csharp" source="~/snippets/csharp/System/DateTime/.ctor/ctorexample1.cs" id="Snippet5"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.datetime.constructor/fs/ctorexample1.fs" id="Snippet5"::: @@ -974,14 +974,14 @@ value by using the year, month, and day in another calendar, call the constructor. + This constructor interprets`year`, `month`, and `day` as a year, month, and day in the Gregorian calendar. To instantiate a value by using the year, month, and day in another calendar, call the constructor. For applications in which portability of date and time data or a limited degree of time zone awareness is important, you can use the corresponding constructor. ## Examples - The following example uses the constructor to instantiate a value. + The following example uses the constructor to instantiate a value. :::code language="csharp" source="~/snippets/csharp/System/DateTime/.ctor/ctorexample1.cs" id="Snippet8"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.datetime.constructor/fs/ctorexample1.fs" id="Snippet8"::: @@ -1089,7 +1089,7 @@ ## Examples - The following example calls the constructor twice to instantiate two values. The first call instantiates a value by using a object. Because the Persian calendar cannot be designated as the default calendar for a culture, displaying a date in the Persian calendar requires individual calls to its , , and methods. The second call to the constructor instantiates a value by using a object. The example changes the current culture to Arabic (Syria) and changes the current culture's default calendar to the Hijri calendar. Because Hijri is the current culture's default calendar, the method uses it to format the date. When the previous current culture (which is English (United States) in this case) is restored, the method uses the current culture's default Gregorian calendar to format the date. + The following example calls the constructor twice to instantiate two values. The first call instantiates a value by using a object. Because the Persian calendar cannot be designated as the default calendar for a culture, displaying a date in the Persian calendar requires individual calls to its , , and methods. The second call to the constructor instantiates a value by using a object. The example changes the current culture to Arabic (Syria) and changes the current culture's default calendar to the Hijri calendar. Because Hijri is the current culture's default calendar, the method uses it to format the date. When the previous current culture (which is English (United States) in this case) is restored, the method uses the current culture's default Gregorian calendar to format the date. :::code language="csharp" source="~/snippets/csharp/System/DateTime/.ctor/ctorexample6.cs" id="Snippet6"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.datetime.constructor/fs/ctorexample6.fs" id="Snippet6"::: @@ -1288,7 +1288,7 @@ For applications in which portability of date and time data or a limited degree ## Examples - The following example calls the constructor twice to instantiate two values. The first call instantiates a value by using a object. Because the Persian calendar cannot be designated as the default calendar for a culture, displaying a date in the Persian calendar requires individual calls to its , , and methods. The second call to the constructor instantiates a value by using a object. The example changes the current culture to Arabic (Syria) and changes the current culture's default calendar to the Hijri calendar. Because Hijri is the current culture's default calendar, the method uses it to format the date. When the previous current culture (which is English (United States) in this case) is restored, the method uses the current culture's default Gregorian calendar to format the date. + The following example calls the constructor twice to instantiate two values. The first call instantiates a value by using a object. Because the Persian calendar cannot be designated as the default calendar for a culture, displaying a date in the Persian calendar requires individual calls to its , , and methods. The second call to the constructor instantiates a value by using a object. The example changes the current culture to Arabic (Syria) and changes the current culture's default calendar to the Hijri calendar. Because Hijri is the current culture's default calendar, the method uses it to format the date. When the previous current culture (which is English (United States) in this case) is restored, the method uses the current culture's default Gregorian calendar to format the date. :::code language="csharp" source="~/snippets/csharp/System/DateTime/.ctor/ctorexample9.cs" id="Snippet9"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.datetime.constructor/fs/ctorexample9.fs" id="Snippet9"::: @@ -1659,16 +1659,16 @@ For applications in which portability of date and time data or a limited degree method to add more than one kind of time interval (days, hours, minutes, seconds, or milliseconds) in a single operation. This method's behavior is identical to that of the addition operator. The structure also supports specialized addition methods (such as , , and ) for each time interval. + You can use the method to add more than one kind of time interval (days, hours, minutes, seconds, or milliseconds) in a single operation. This method's behavior is identical to that of the addition operator. The structure also supports specialized addition methods (such as , , and ) for each time interval. - The method takes into account leap years and the number of days in a month when performing date arithmetic. + The method takes into account leap years and the number of days in a month when performing date arithmetic. This method does not change the value of this . Instead, it returns a new whose value is the result of this operation. The property of the new instance is the same as that of the current instance. ## Examples - The following example demonstrates the method. It calculates the day of the week that is 36 days (864 hours) from this moment. + The following example demonstrates the method. It calculates the day of the week that is 36 days (864 hours) from this moment. :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/DateTime.Add/FS/class1.fs" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System/DateTime/Add/class1.cs" id="Snippet1"::: @@ -1739,10 +1739,10 @@ For applications in which portability of date and time data or a limited degree In .NET Framework, the `value` parameter is rounded to the nearest millisecond. In .NET 7 and later versions, the full precision of the `value` parameter is used. However, due to the inherent imprecision of floating point math, the resulting precision will vary. - The method takes into account leap years and the number of days in a month when performing date arithmetic. + The method takes into account leap years and the number of days in a month when performing date arithmetic. ## Examples - The following example uses the method to determine the day of the week 36 days after the current date. + The following example uses the method to determine the day of the week 36 days after the current date. :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/DateTime.AddDays/FS/class1.fs" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System/DateTime/AddDays/class1.cs" id="Snippet1"::: @@ -1811,10 +1811,10 @@ For applications in which portability of date and time data or a limited degree In .NET Framework, the `value` parameter is rounded to the nearest millisecond. In .NET 7 and later versions, the full precision of the `value` parameter is used. However, due to the inherent imprecision of floating point math, the resulting precision will vary. - Converting time intervals of less than an hour to a fraction can involve a loss of precision if the result is a non-terminating repeating decimal. (For example, one minute is 0.016667 of an hour.) If this is problematic, you can use the method, which enables you to specify more than one kind of time interval in a single method call and eliminates the need to convert time intervals to fractional parts of an hour. + Converting time intervals of less than an hour to a fraction can involve a loss of precision if the result is a non-terminating repeating decimal. (For example, one minute is 0.016667 of an hour.) If this is problematic, you can use the method, which enables you to specify more than one kind of time interval in a single method call and eliminates the need to convert time intervals to fractional parts of an hour. ## Examples - The following example uses the method to add a number of whole and fractional values to a date and time. It also illustrates the loss of precision caused by passing the method a value that includes a fractional component. + The following example uses the method to add a number of whole and fractional values to a date and time. It also illustrates the loss of precision caused by passing the method a value that includes a fractional component. :::code language="csharp" source="~/snippets/csharp/System/DateTime/AddHours/AddHours1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.DateTime.AddHours/fs/AddHours1.fs" id="Snippet1"::: @@ -1937,7 +1937,7 @@ The value parameter is rounded to the nearest integer. In .NET Framework, the `value` parameter is rounded to the nearest millisecond. In .NET 7 and later versions, the full precision of the `value` parameter is used. However, due to the inherent imprecision of floating point math, the resulting precision will vary. ## Examples - The following example uses the method to add one millisecond and 1.5 milliseconds to a value. It then displays each new value and displays the difference between it and the original value. The difference is displayed both as a time span and as a number of ticks. The example makes it clear that one millisecond equals 10,000 ticks. It also shows that fractional milliseconds are rounded before performing the addition; the value that results from adding 1.5 milliseconds to the original date is 2 milliseconds greater than the original date. + The following example uses the method to add one millisecond and 1.5 milliseconds to a value. It then displays each new value and displays the difference between it and the original value. The difference is displayed both as a time span and as a number of ticks. The example makes it clear that one millisecond equals 10,000 ticks. It also shows that fractional milliseconds are rounded before performing the addition; the value that results from adding 1.5 milliseconds to the original date is 2 milliseconds greater than the original date. :::code language="csharp" source="~/snippets/csharp/System/DateTime/AddMilliseconds/addmilliseconds2.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.datetime.addmilliseconds/fs/addmilliseconds2.fs" id="Snippet1"::: @@ -2008,7 +2008,7 @@ The value parameter is rounded to the nearest integer. In .NET Framework, the `value` parameter is rounded to the nearest millisecond. In .NET 7 and later versions, the full precision of the `value` parameter is used. However, due to the inherent imprecision of floating point math, the resulting precision will vary. ## Examples - The following example uses the method to add a number of whole and fractional values to a date and time. + The following example uses the method to add a number of whole and fractional values to a date and time. :::code language="csharp" source="~/snippets/csharp/System/DateTime/AddMinutes/addminutes1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.datetime.addminutes/fs/addminutes1.fs" id="Snippet1"::: @@ -2074,7 +2074,7 @@ The value parameter is rounded to the nearest integer. ## Remarks This method does not change the value of this object. Instead, it returns a new object whose value is the result of this operation. - The method calculates the resulting month and year, taking into account leap years and the number of days in a month, then adjusts the day part of the resulting object. If the resulting day is not a valid day in the resulting month, the last valid day of the resulting month is used. For example, March 31st + 1 month = April 30th, and March 31st - 1 month = February 28 for a non-leap year and February 29 for a leap year. + The method calculates the resulting month and year, taking into account leap years and the number of days in a month, then adjusts the day part of the resulting object. If the resulting day is not a valid day in the resulting month, the last valid day of the resulting month is used. For example, March 31st + 1 month = April 30th, and March 31st - 1 month = February 28 for a non-leap year and February 29 for a leap year. The time-of-day part of the resulting object remains the same as this instance. @@ -2154,7 +2154,7 @@ The value parameter is rounded to the nearest integer. In .NET Framework, the `value` parameter is rounded to the nearest millisecond. In .NET 7 and later versions, the full precision of the `value` parameter is used. However, due to the inherent imprecision of floating point math, the resulting precision will vary. ## Examples - The following example uses the method to add 30 seconds and the number of seconds in one day to a value. It then displays each new value and displays the difference between it and the original value. The difference is displayed both as a time span and as a number of ticks. + The following example uses the method to add 30 seconds and the number of seconds in one day to a value. It then displays each new value and displays the difference between it and the original value. The difference is displayed both as a time span and as a number of ticks. :::code language="csharp" source="~/snippets/csharp/System/DateTime/AddSeconds/addseconds1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.datetime.addseconds/fs/addseconds1.fs" id="Snippet1"::: @@ -2281,15 +2281,15 @@ The value parameter is rounded to the nearest integer. ## Remarks This method does not change the value of this object. Instead, it returns a new object whose value is the result of this operation. - The method calculates the resulting year taking into account leap years. The month and time-of-day part of the resulting object remains the same as this instance. + The method calculates the resulting year taking into account leap years. The month and time-of-day part of the resulting object remains the same as this instance. If the current instance represents the leap day in a leap year, the return value depends on the target date: -- If `value` + is also a leap year, the return value represents the leap day in that year. For example, if four years is added to February 29, 2012, the date returned is February 29, 2016. +- If `value` + is also a leap year, the return value represents the leap day in that year. For example, if four years is added to February 29, 2012, the date returned is February 29, 2016. -- If `value` + is not a leap year, the return value represents the day before the leap day in that year. For example, if one year is added to February 29, 2012, the date returned is February 28, 2013. +- If `value` + is not a leap year, the return value represents the day before the leap day in that year. For example, if one year is added to February 29, 2012, the date returned is February 28, 2013. - The following example illustrates using the method with a value that represents a leap year day. It displays the date for the fifteen years prior to and the fifteen years that follow February 29, 2000. + The following example illustrates using the method with a value that represents a leap year day. It displays the date for the fifteen years prior to and the fifteen years that follow February 29, 2000. :::code language="csharp" source="~/snippets/csharp/System/DateTime/AddYears/addyears1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.datetime.addyears/fs/addyears1.fs" id="Snippet1"::: @@ -2372,13 +2372,13 @@ The value parameter is rounded to the nearest integer. method compares the property of `t1` and `t2` but ignores their property. Before comparing objects, ensure that the objects represent times in the same time zone. + To determine the relationship of `t1` to `t2`, the method compares the property of `t1` and `t2` but ignores their property. Before comparing objects, ensure that the objects represent times in the same time zone. ## Examples - The following example demonstrates the method. + The following example demonstrates the method. :::code language="csharp" source="~/snippets/csharp/System/DateTime/Compare/compare1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.datetime.compare/fs/compare1.fs" id="Snippet1"::: @@ -2404,7 +2404,7 @@ The value parameter is rounded to the nearest integer. method return a signed number that indicates the relative value of this instance and the `value` argument, as shown in the following table. + The two overloads of the method return a signed number that indicates the relative value of this instance and the `value` argument, as shown in the following table. |Value|Description| |-----------|-----------------| @@ -2487,12 +2487,12 @@ The value parameter is rounded to the nearest integer. method compares the property of the current instance and `value` but ignores their property. Before comparing objects, make sure that the objects represent times in the same time zone. You can do this by comparing the values of their properties. + To determine the relationship of the current instance to `value`, the method compares the property of the current instance and `value` but ignores their property. Before comparing objects, make sure that the objects represent times in the same time zone. You can do this by comparing the values of their properties. - This method implements the interface and performs slightly better than the method overload because it does not have to convert the `value` parameter to an object. + This method implements the interface and performs slightly better than the method overload because it does not have to convert the `value` parameter to an object. ## Examples - The following example instantiates three objects, one that represents today's date, another that represents the date one year previously, and a third that represents the date one year in the future. It then calls the method and displays the result of the comparison. + The following example instantiates three objects, one that represents today's date, another that represents the date one year previously, and a third that represents the date one year in the future. It then calls the method and displays the result of the comparison. :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/DateTime.CompareTo.2/FS/CompareTo_CS1_24564.fs" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System/DateTime/CompareTo/CompareTo_CS1_24564.cs" id="Snippet1"::: @@ -2576,14 +2576,14 @@ The value parameter is rounded to the nearest integer. method compares the property of the current instance and `value` but ignores their property. Before comparing objects, make sure that the objects represent times in the same time zone. You can do this by comparing the values of their properties. + To determine the relationship of the current instance to `value`, the method compares the property of the current instance and `value` but ignores their property. Before comparing objects, make sure that the objects represent times in the same time zone. You can do this by comparing the values of their properties. Any instance of , regardless of its value, is considered greater than `null`. ## Examples - The following example demonstrates the method. + The following example demonstrates the method. :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/DateTime.CompareTo/FS/class1.fs" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System/DateTime/CompareTo/class1.cs" id="Snippet1"::: @@ -2714,13 +2714,13 @@ The value parameter is rounded to the nearest integer. property always returns the day of the month in the Gregorian calendar, even if the current value was instantiated using some other calendar or if the current culture's default calendar is not the Gregorian calendar. To retrieve the day of the month of a particular date using some other calendar, call that calendar's method. The following example uses both the property and the method to retrieve the day of the month for a value that is instantiated using the Hijri calendar. + The property always returns the day of the month in the Gregorian calendar, even if the current value was instantiated using some other calendar or if the current culture's default calendar is not the Gregorian calendar. To retrieve the day of the month of a particular date using some other calendar, call that calendar's method. The following example uses both the property and the method to retrieve the day of the month for a value that is instantiated using the Hijri calendar. :::code language="csharp" source="~/snippets/csharp/System/DateTime/Day/Day1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.DateTime.Day/fs/Day1.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/DateTime/Day/Day1.vb" id="Snippet1"::: - Similarly, the following example uses both the property and the method to retrieve the day of the month when the current culture is ar-SA, which uses Hijri as its default calendar. + Similarly, the following example uses both the property and the method to retrieve the day of the month when the current culture is ar-SA, which uses Hijri as its default calendar. :::code language="csharp" source="~/snippets/csharp/System/DateTime/Day/Day2.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.DateTime.Day/fs/Day2.fs" id="Snippet2"::: @@ -2792,7 +2792,7 @@ The value parameter is rounded to the nearest integer. ## Remarks The value of the constants in the enumeration ranges from to . If cast to an integer, its value ranges from zero (which indicates ) to six (which indicates ). - The property returns an enumerated constant; it does not reflect a system's regional and language settings. To retrieve a string representing a localized weekday name for a particular date, call one of the overloads of the method that includes a `format` parameter and pass it either the `ddd` or `dddd` custom format strings. For details, see [How to: Extract the Day of the Week from a Specific Date](/dotnet/standard/base-types/how-to-extract-the-day-of-the-week-from-a-specific-date). + The property returns an enumerated constant; it does not reflect a system's regional and language settings. To retrieve a string representing a localized weekday name for a particular date, call one of the overloads of the method that includes a `format` parameter and pass it either the `ddd` or `dddd` custom format strings. For details, see [How to: Extract the Day of the Week from a Specific Date](/dotnet/standard/base-types/how-to-extract-the-day-of-the-week-from-a-specific-date). @@ -2856,7 +2856,7 @@ The value parameter is rounded to the nearest integer. property takes leap years into account when it calculates the day of the year. The property value always reflects the day of the year in the Gregorian calendar, regardless of the current culture's current calendar. To retrieve the day of the year in a different calendar, call the method of that calendar. + The property takes leap years into account when it calculates the day of the year. The property value always reflects the day of the year in the Gregorian calendar, regardless of the current culture's current calendar. To retrieve the day of the year in a different calendar, call the method of that calendar. ## Examples The following example displays the day of the year of December 31 for the years 2010-2020 in the Gregorian calendar. Note that the example shows that December 31 is the 366th day of the year in leap years. @@ -2925,12 +2925,12 @@ The value parameter is rounded to the nearest integer. method always interprets `month` and `year` as the month and year of the Gregorian calendar even if the Gregorian calendar is not the current culture's current calendar. To get the number of days in a specified month of a particular calendar, call that calendar's method. + The method always interprets `month` and `year` as the month and year of the Gregorian calendar even if the Gregorian calendar is not the current culture's current calendar. To get the number of days in a specified month of a particular calendar, call that calendar's method. ## Examples - The following example demonstrates how to use the method to determine the number of days in July 2001, February 1998 (a non-leap year), and February 1996 (a leap year). + The following example demonstrates how to use the method to determine the number of days in July 2001, February 1998 (a non-leap year), and February 1996 (a leap year). :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/DateTime.DaysInMonth/FS/class1.fs" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System/DateTime/DaysInMonth/class1.cs" id="Snippet1"::: @@ -3105,10 +3105,10 @@ The value parameter is rounded to the nearest integer. ## Remarks The current instance and `value` are equal if their property values are equal. Their property values are not considered in the test for equality. - This method implements the interface, and performs slightly better than the method because the `value` parameter does not have to be converted to an object. + This method implements the interface, and performs slightly better than the method because the `value` parameter does not have to be converted to an object. ## Examples - The following example demonstrates the method. + The following example demonstrates the method. :::code language="csharp" source="~/snippets/csharp/System/DateTime/Equals/sample.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.DateTime.Equals-Instance/fs/sample.fs" id="Snippet1"::: @@ -3186,7 +3186,7 @@ The value parameter is rounded to the nearest integer. ## Examples - The following example demonstrates the method. + The following example demonstrates the method. :::code language="csharp" source="~/snippets/csharp/System/DateTime/Equals/sample.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.DateTime.Equals-Instance/fs/sample.fs" id="Snippet1"::: @@ -3257,7 +3257,7 @@ The value parameter is rounded to the nearest integer. ## Examples - The following example demonstrates the method. + The following example demonstrates the method. :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/DateTime.Equals/FS/class1.fs" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System/DateTime/Equals/class1.cs" id="Snippet1"::: @@ -3382,7 +3382,7 @@ The value parameter is rounded to the nearest integer. ## Examples - The following example demonstrates the method. + The following example demonstrates the method. :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/DateTime.FromFileTime/FS/class1.fs" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System/DateTime/FromFileTime/class1.cs" id="Snippet1"::: @@ -3526,7 +3526,7 @@ The value parameter is rounded to the nearest integer. Note that because of the way dates are encoded, there are two ways of representing any time of day on 30 December 1899. For example, -0.5 and 0.5 both mean noon on 30 December 1899 because a day displacement of plus or minus zero days from the base date is still the base date, and a half day displacement from midnight is noon. - See for more information on OLE Automation. + See for more information on OLE Automation. ]]> @@ -3550,7 +3550,7 @@ The value parameter is rounded to the nearest integer. ## Remarks > [!IMPORTANT] -> You should not assume that multiple calls to the overloads will return identical data. Depending on the specific overload, the data returned by this method can change if the current culture changes, the user overrides individual cultural settings, or an update occurs to the system's cultural data. +> You should not assume that multiple calls to the overloads will return identical data. Depending on the specific overload, the data returned by this method can change if the current culture changes, the user overrides individual cultural settings, or an update occurs to the system's cultural data. ]]> @@ -3605,9 +3605,9 @@ The value parameter is rounded to the nearest integer. method is equivalent to combining the string arrays returned by separate calls to the method with the "d", "D", "f", "F", "g", "G", "m", "o", "r", "s", "t", "T", "u", "U", and "y" standard format strings. For more information about standard format specifiers, see [Standard Date and Time Format Strings](/dotnet/standard/base-types/standard-date-and-time-format-strings). + The string array returned by the method is equivalent to combining the string arrays returned by separate calls to the method with the "d", "D", "f", "F", "g", "G", "m", "o", "r", "s", "t", "T", "u", "U", and "y" standard format strings. For more information about standard format specifiers, see [Standard Date and Time Format Strings](/dotnet/standard/base-types/standard-date-and-time-format-strings). - Each element of the return value is formatted using information from the current culture. For more information about culture-specific formatting information for the current culture, see . + Each element of the return value is formatted using information from the current culture. For more information about culture-specific formatting information for the current culture, see . > [!IMPORTANT] > Because this method uses culture-sensitive data, you should not assume that multiple calls to the method will return identical data. The data returned by this method can change if the current culture changes, the user overrides individual cultural settings, or an update occurs to the system's cultural data. @@ -3817,7 +3817,7 @@ July, 2009 ## Remarks The `format` parameter can be any of the standard date and time format specifiers. These include d, D, f, F, g, G, M (or m), O (or o), R (or r), s, t, T, u, U, and Y (or y). For more information, see [Standard Date and Time Format Strings](/dotnet/standard/base-types/standard-date-and-time-format-strings). - Each element of the return value is formatted using information from the current culture. For more information about culture-specific formatting information for the current culture, see . + Each element of the return value is formatted using information from the current culture. For more information about culture-specific formatting information for the current culture, see . > [!IMPORTANT] > Because this method uses culture-sensitive data, you should not assume that multiple calls to the method will return identical data. The data returned by this method can change if the current culture changes, the user overrides individual cultural settings, or an update occurs to the system's cultural data. @@ -3825,7 +3825,7 @@ July, 2009 ## Examples - The following example demonstrates the method. It displays the string representation of a date using the long date format specifier ("D") for the current culture. + The following example demonstrates the method. It displays the string representation of a date using the long date format specifier ("D") for the current culture. :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/DateTime.GetDateTimeFormats/FS/class1.fs" id="Snippet3"::: :::code language="csharp" source="~/snippets/csharp/System/DateTime/GetDateTimeFormats/class1.cs" id="Snippet3"::: @@ -3897,7 +3897,7 @@ July, 2009 method is equivalent to combining the string arrays returned by separate calls to the method with the "d", "D", "f", "F", "g", "G", "m", "o", "r", "s", "t", "T", "u", "U", and "y" standard format strings. For more information about standard format specifiers, see [Standard Date and Time Format Strings](/dotnet/standard/base-types/standard-date-and-time-format-strings). + The string array returned by the method is equivalent to combining the string arrays returned by separate calls to the method with the "d", "D", "f", "F", "g", "G", "m", "o", "r", "s", "t", "T", "u", "U", and "y" standard format strings. For more information about standard format specifiers, see [Standard Date and Time Format Strings](/dotnet/standard/base-types/standard-date-and-time-format-strings). Each element of the return value is formatted using culture-specific information supplied by `provider`. @@ -3907,7 +3907,7 @@ July, 2009 ## Examples - The following example demonstrates the method. It displays the string representation of a date using all possible standard date and time formats for the fr-FR culture. + The following example demonstrates the method. It displays the string representation of a date using all possible standard date and time formats for the fr-FR culture. :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/DateTime.GetDateTimeFormats/FS/class1.fs" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System/DateTime/GetDateTimeFormats/class1.cs" id="Snippet2"::: @@ -4096,7 +4096,7 @@ juillet 2009 ## Examples - The following example demonstrates the method. It displays the string representations of a date using the short date format specifier ("d") for the fr-FR culture. + The following example demonstrates the method. It displays the string representations of a date using the short date format specifier ("d") for the fr-FR culture. :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/DateTime.GetDateTimeFormats/FS/class1.fs" id="Snippet4"::: :::code language="csharp" source="~/snippets/csharp/System/DateTime/GetDateTimeFormats/class1.cs" id="Snippet4"::: @@ -4270,7 +4270,7 @@ juillet 2009 property is always expressed using a 24-hour clock. To retrieve a string that represents the hour of a date and time using a 12-hour clock, call the or method with the "h" custom format specifier. For example: + The value of the property is always expressed using a 24-hour clock. To retrieve a string that represents the hour of a date and time using a 12-hour clock, call the or method with the "h" custom format specifier. For example: :::code language="csharp" source="~/snippets/csharp/System/DateTime/Hour/Hour1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.DateTime.Hour/fs/Hour1.fs" id="Snippet1"::: @@ -4341,7 +4341,7 @@ juillet 2009 If the current value represents either an ambiguous or an invalid time in the local time zone, the method returns `false`. - On Windows XP systems, the method recognizes only the current adjustment rule when determining whether the current instance is a daylight saving time. As a result, the method may not accurately report whether the current instance is a daylight saving time for periods before the current adjustment rule came into effect. + On Windows XP systems, the method recognizes only the current adjustment rule when determining whether the current instance is a daylight saving time. As a result, the method may not accurately report whether the current instance is a daylight saving time for periods before the current adjustment rule came into effect. ]]> @@ -4407,7 +4407,7 @@ juillet 2009 ## Examples - The following example uses the method to determine which years between 1994 and 2014 are leap years. The example also illustrates the result when the method is used to add a year to a leap day. + The following example uses the method to determine which years between 1994 and 2014 are leap years. The example also illustrates the result when the method is used to add a year to a leap day. :::code language="csharp" source="~/snippets/csharp/System/DateTime/IsLeapYear/IsLeapYear1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.DateTime.IsLeapYear/fs/IsLeapYear1.fs" id="Snippet1"::: @@ -4471,14 +4471,14 @@ juillet 2009 property of a new value to a particular value by calling the method. + You can explicitly set the property of a new value to a particular value by calling the method. The property allows a value to clearly reflect either Coordinated Universal Time (UTC) or the local time. In contrast, the structure can unambiguously reflect any time in any time zone as a single point in time. ## Examples - The following example uses the method to demonstrate how the property influences the and conversion methods. + The following example uses the method to demonstrate how the property influences the and conversion methods. :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/DateTime.Kind_Suite/fs/ks.fs" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System/DateTime/Kind/ks.cs" id="Snippet1"::: @@ -4935,7 +4935,7 @@ juillet 2009 property returns a value that represents the current date and time on the local computer. Note that there is a difference between a value, which represents the number of ticks that have elapsed since midnight of January 1, 0001, and the string representation of that value, which expresses a date and time value in a culture-specific-specific format. For information on formatting date and time values, see the method. The following example displays the short date and time string in a number of culture-specific formats. + The property returns a value that represents the current date and time on the local computer. Note that there is a difference between a value, which represents the number of ticks that have elapsed since midnight of January 1, 0001, and the string representation of that value, which expresses a date and time value in a culture-specific-specific format. For information on formatting date and time values, see the method. The following example displays the short date and time string in a number of culture-specific formats. :::code language="csharp" source="~/snippets/csharp/System/DateTime/Now/now1.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.datetime.now/fs/now1.fs" id="Snippet2"::: @@ -4953,7 +4953,7 @@ juillet 2009 ## Examples - The following example uses the and properties to retrieve the current local date and time and the current universal coordinated (UTC) date and time. It then uses the formatting conventions of a number of cultures to display the strings, along with the values of their properties. + The following example uses the and properties to retrieve the current local date and time and the current universal coordinated (UTC) date and time. It then uses the formatting conventions of a number of cultures to display the strings, along with the values of their properties. :::code language="csharp" source="~/snippets/csharp/System/DateTime/Now/now2.cs" id="Snippet3"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.datetime.now/fs/now2.fs" id="Snippet3"::: @@ -5015,7 +5015,7 @@ juillet 2009 Adds a specified time interval to a specified date and time, yielding a new date and time. An object that is the sum of the values of and . - + ## Examples The following example demonstrates the addition operator. @@ -5093,9 +5093,9 @@ juillet 2009 operator determines whether two values are equal by comparing their number of ticks. Before comparing objects, make sure that the objects represent times in the same time zone. You can do this by comparing the values of their property. + The operator determines whether two values are equal by comparing their number of ticks. Before comparing objects, make sure that the objects represent times in the same time zone. You can do this by comparing the values of their property. - The equivalent method for this operator is + The equivalent method for this operator is ## Examples The following example demonstrates the equality operator. @@ -5169,9 +5169,9 @@ juillet 2009 operator determines the relationship between two values by comparing their number of ticks. Before comparing objects, make sure that the objects represent times in the same time zone. You can do this by comparing the values of their property. + The operator determines the relationship between two values by comparing their number of ticks. Before comparing objects, make sure that the objects represent times in the same time zone. You can do this by comparing the values of their property. - The equivalent method for this operator is ]]> + The equivalent method for this operator is ]]> @@ -5237,9 +5237,9 @@ juillet 2009 operator determines the relationship between two values by comparing their number of ticks. Before comparing objects, make sure that the objects represent times in the same time zone. You can do this by comparing the values of their property. + The operator determines the relationship between two values by comparing their number of ticks. Before comparing objects, make sure that the objects represent times in the same time zone. You can do this by comparing the values of their property. - The equivalent method for this operator is ]]> + The equivalent method for this operator is ]]> @@ -5305,9 +5305,9 @@ juillet 2009 operator determines whether two values are not equal by comparing their number of ticks. Before comparing objects, make sure that the objects represent times in the same time zone. You can do this by comparing the values of their property. + The operator determines whether two values are not equal by comparing their number of ticks. Before comparing objects, make sure that the objects represent times in the same time zone. You can do this by comparing the values of their property. - The equivalent method for this operator is ]]> + The equivalent method for this operator is ]]> @@ -5372,9 +5372,9 @@ juillet 2009 operator determines the relationship between two values by comparing their number of ticks. Before comparing objects, make sure that the objects represent times in the same time zone. You can do this by comparing the values of their property. + The operator determines the relationship between two values by comparing their number of ticks. Before comparing objects, make sure that the objects represent times in the same time zone. You can do this by comparing the values of their property. - The equivalent method for this operator is ]]> + The equivalent method for this operator is ]]> @@ -5440,9 +5440,9 @@ juillet 2009 operator determines the relationship between two values by comparing their number of ticks. Before comparing objects, make sure that the objects represent times in the same time zone. You can do this by comparing the values of their property. + The operator determines the relationship between two values by comparing their number of ticks. Before comparing objects, make sure that the objects represent times in the same time zone. You can do this by comparing the values of their property. - The equivalent method for this operator is ]]> + The equivalent method for this operator is ]]> @@ -5521,15 +5521,15 @@ juillet 2009 method does not consider the value of the property of the two values when performing the subtraction. Before subtracting objects, ensure that the objects represent times in the same time zone. Otherwise, the result will include the difference between time zones. + The method does not consider the value of the property of the two values when performing the subtraction. Before subtracting objects, ensure that the objects represent times in the same time zone. Otherwise, the result will include the difference between time zones. > [!NOTE] -> The method does consider the difference between time zones when performing the subtraction. +> The method does consider the difference between time zones when performing the subtraction. - The equivalent method for this operator is + The equivalent method for this operator is ## Examples - The following example demonstrates the method and the subtraction operator. + The following example demonstrates the method and the subtraction operator. :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/DateTime.Subtraction/FS/class1.fs" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System/DateTime/op_Subtraction/class1.cs" id="Snippet1"::: @@ -5597,10 +5597,10 @@ juillet 2009 ## Remarks This method subtracts the ticks value of `t` from the ticks value of `d`. - The equivalent method for this operator is + The equivalent method for this operator is ## Examples - The following example demonstrates the method and the subtraction operator. + The following example demonstrates the method and the subtraction operator. :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/DateTime.Subtraction/FS/class1.fs" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System/DateTime/op_Subtraction/class1.cs" id="Snippet1"::: @@ -5642,35 +5642,35 @@ juillet 2009 |To|Call| |--------|----------| -|Parse a date and time string by using the conventions of the current culture.| overload| -|Parse a date and time string by using the conventions of a specific culture.| overload (see [Parsing and Cultural Conventions](#Culture))| -|Parse a date and time string with special style elements (such as white space or no white space).| overload| -|Parse a date and time string that must be in a particular format.| or | -|Parse a date and time string and perform a conversion to UTC or local time.| overload| -|Parse a date and time string without handling exceptions.| method| -|Restore (round-trip) a date and time value created by a formatting operation.|Pass the "o" or "r" standard format string to the method, and call the overload with | -|Parse a date and time string in a fixed format across machine (and possibly cultural) boundaries.| or method| +|Parse a date and time string by using the conventions of the current culture.| overload| +|Parse a date and time string by using the conventions of a specific culture.| overload (see [Parsing and Cultural Conventions](#Culture))| +|Parse a date and time string with special style elements (such as white space or no white space).| overload| +|Parse a date and time string that must be in a particular format.| or | +|Parse a date and time string and perform a conversion to UTC or local time.| overload| +|Parse a date and time string without handling exceptions.| method| +|Restore (round-trip) a date and time value created by a formatting operation.|Pass the "o" or "r" standard format string to the method, and call the overload with | +|Parse a date and time string in a fixed format across machine (and possibly cultural) boundaries.| or method| ### The string to parse - The method tries to convert the string representation of a date and time value to its equivalent. It tries to parse the input string completely without throwing a exception. When using overloads that accept an object, it will be used to parse `StringToParse`. If no such object is provided, will be used instead. + The method tries to convert the string representation of a date and time value to its equivalent. It tries to parse the input string completely without throwing a exception. When using overloads that accept an object, it will be used to parse `StringToParse`. If no such object is provided, will be used instead. > [!IMPORTANT] -> If the parsing operation fails because of an unrecognized string format, the method throws a , whereas the method returns `false`. Because exception handling can be expensive, you should use when the parsing operation is expected to succeed because the input source is trusted. is preferable when parsing failures are likely, particularly because an input source is not trusted, or you have reasonable default values to substitute for strings that do not parse successfully. +> If the parsing operation fails because of an unrecognized string format, the method throws a , whereas the method returns `false`. Because exception handling can be expensive, you should use when the parsing operation is expected to succeed because the input source is trusted. is preferable when parsing failures are likely, particularly because an input source is not trusted, or you have reasonable default values to substitute for strings that do not parse successfully. The string to be parsed can take any of the following forms: - A string with a date and a time component. -- A string with a date but no time component. If the time component is absent, the method assumes 12:00 midnight. If the date component has a two-digit year, it is converted to a year based on the of the current culture's current calendar or the specified culture's current calendar (if you use an overload with a non-null `provider` argument). +- A string with a date but no time component. If the time component is absent, the method assumes 12:00 midnight. If the date component has a two-digit year, it is converted to a year based on the of the current culture's current calendar or the specified culture's current calendar (if you use an overload with a non-null `provider` argument). - A string with a date component that includes only the month and the year but no day component. The method assumes the first day of the month. - A string with a date component that includes only the month and the day but no year component. The method assumes the current year. -- A string with a time but no date component. The method assumes the current date unless you call the overload and include in the `styles` argument, in which case the method assumes a date of January 1, 0001. +- A string with a time but no date component. The method assumes the current date unless you call the overload and include in the `styles` argument, in which case the method assumes a date of January 1, 0001. -- A string with a time component that includes only the hour and an AM/PM designator, with no date component. The method assumes the current date and a time with no minutes and no seconds. You can change this behavior by calling the overload and include in the `styles` argument, in which case the method assumes a date of January 1, 0001. +- A string with a time component that includes only the hour and an AM/PM designator, with no date component. The method assumes the current date and a time with no minutes and no seconds. You can change this behavior by calling the overload and include in the `styles` argument, in which case the method assumes a date of January 1, 0001. - A string that includes time zone information and conforms to ISO 8601. In the following examples, the first string designates Coordinated Universal Time (UTC), and the second designates the time in a time zone that's seven hours earlier than UTC: @@ -5691,27 +5691,27 @@ The following example parses strings in each of these formats by using the forma :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.DateTime.Parse/fs/Parse6.fs"::: :::code language="vb" source="~/snippets/visualbasic/System/DateTime/Parse/Parse6.vb"::: - If the input string represents a leap day in a leap year in the calendar used by the parsing method (see [Parsing and cultural conventions](#Culture)), the method parses the string successfully. If the input string represents a leap day in a non-leap year, the method throws a . + If the input string represents a leap day in a leap year in the calendar used by the parsing method (see [Parsing and cultural conventions](#Culture)), the method parses the string successfully. If the input string represents a leap day in a non-leap year, the method throws a . - Because the method tries to parse the string representation of a date and time by using the formatting rules of the current or a specified culture, trying to parse a string across different cultures can fail. To parse a specific date and time format across different locales, use one of the overloads of the method and provide a format specifier. + Because the method tries to parse the string representation of a date and time by using the formatting rules of the current or a specified culture, trying to parse a string across different cultures can fail. To parse a specific date and time format across different locales, use one of the overloads of the method and provide a format specifier. ### Parsing and cultural conventions - All overloads of the method are culture-sensitive unless the string to be parsed (which is represented by `s` in the following table) conforms to the ISO 8601 pattern. The parsing operation uses the formatting information in a object that is derived as follows: + All overloads of the method are culture-sensitive unless the string to be parsed (which is represented by `s` in the following table) conforms to the ISO 8601 pattern. The parsing operation uses the formatting information in a object that is derived as follows: [!INCLUDE[japanese-era-note](~/includes/calendar-era.md)] |If you call|And `provider` is|Formatting information is derived from| |-----------------|-----------------------|--------------------------------------------| -||-|The current culture ( property)| -| or |a object|The specified object| -| or |`null`|The current culture ( property)| -| or |a object|The property| -| or |Custom implementation|The method| +||-|The current culture ( property)| +| or |a object|The specified object| +| or |`null`|The current culture ( property)| +| or |a object|The property| +| or |Custom implementation|The method| When formatting information is derived from a object, the property defines the calendar used in the parsing operation. - If you parse a date and time string by using a object with customized settings that are different from those of a standard culture, use the method instead of the method to improve the chances for a successful conversion. A non-standard date and time string can be complicated and difficult to parse. The method tries to parse a string with several implicit parse patterns, all of which might fail. In contrast, the method requires you to explicitly designate one or more exact parse patterns that are likely to succeed. For more information, see the "DateTimeFormatInfo and Dynamic Data" section in the topic. + If you parse a date and time string by using a object with customized settings that are different from those of a standard culture, use the method instead of the method to improve the chances for a successful conversion. A non-standard date and time string can be complicated and difficult to parse. The method tries to parse a string with several implicit parse patterns, all of which might fail. In contrast, the method requires you to explicitly designate one or more exact parse patterns that are likely to succeed. For more information, see the "DateTimeFormatInfo and Dynamic Data" section in the topic. > [!IMPORTANT] > Note that the formatting conventions for a particular culture are dynamic and can be subject to change. This means that parsing operations that depend on the formatting conventions of the default (current) culture or that specify an object that represents a culture other than the invariant culture can unexpectedly fail if any of the following occurs: @@ -5720,19 +5720,19 @@ The following example parses strings in each of these formats by using the forma > - The culture-specific data reflects user preferences, which can vary from machine to machine or session to session. > - The culture-specific data represents a replacement culture that overrides the settings of a standard culture or a custom culture. > -> To prevent the difficulties in parsing data and time strings that are associated with changes in cultural data, you can parse date and time strings by using the invariant culture, or you can call the or method and specify the exact format of the string to be parsed. If you are serializing and deserializing date and time data, you can either use the formatting conventions of the invariant culture, or you can serialize and deserialize the value in a binary format. +> To prevent the difficulties in parsing data and time strings that are associated with changes in cultural data, you can parse date and time strings by using the invariant culture, or you can call the or method and specify the exact format of the string to be parsed. If you are serializing and deserializing date and time data, you can either use the formatting conventions of the invariant culture, or you can serialize and deserialize the value in a binary format. > > For more information see the "Dynamic culture data" section in the topic and the "Persisting DateTime values" section in the topic. ### Parsing and style elements - All overloads ignore leading, inner, or trailing white-space characters in the input string (which is represented by `s` in the following table). The date and time can be bracketed with a pair of leading and trailing NUMBER SIGN characters ("#", U+0023), and can be trailed with one or more NULL characters (U+0000). + All overloads ignore leading, inner, or trailing white-space characters in the input string (which is represented by `s` in the following table). The date and time can be bracketed with a pair of leading and trailing NUMBER SIGN characters ("#", U+0023), and can be trailed with one or more NULL characters (U+0000). - In addition, the overload has a `styles` parameter that consists of one or more members of the enumeration. This parameter defines how `s` should be interpreted and how the parse operation should convert `s` to a date and time. The following table describes the effect of each member on the parse operation. + In addition, the overload has a `styles` parameter that consists of one or more members of the enumeration. This parameter defines how `s` should be interpreted and how the parse operation should convert `s` to a date and time. The following table describes the effect of each member on the parse operation. |DateTimeStyles member|Effect on conversion| |---------------------------|--------------------------| -||Parses `s` and, if necessary, converts it to UTC, as follows:

- If `s` includes a time zone offset, or if `s` contains no time zone information but `styles` includes the flag, the method parses the string, calls to convert the returned value to UTC, and sets the property to .
- If `s` indicates that it represents UTC, or if `s` does not contain time zone information but `styles` includes the flag, the method parses the string, performs no time zone conversion on the returned value, and sets the property to .
- In all other cases, the flag has no effect.| +||Parses `s` and, if necessary, converts it to UTC, as follows:

- If `s` includes a time zone offset, or if `s` contains no time zone information but `styles` includes the flag, the method parses the string, calls to convert the returned value to UTC, and sets the property to .
- If `s` indicates that it represents UTC, or if `s` does not contain time zone information but `styles` includes the flag, the method parses the string, performs no time zone conversion on the returned value, and sets the property to .
- In all other cases, the flag has no effect.| ||This value is ignored. Inner white space is always permitted in the date and time elements of `s`.| ||This value is ignored. Leading white space is always permitted in the date and time elements of `s`.| ||This value is ignored. Trailing white space is always permitted in the date and time elements of `s`.| @@ -5740,7 +5740,7 @@ The following example parses strings in each of these formats by using the forma ||Specifies that if `s` lacks any time zone information, local time is assumed. Unless the flag is present, the property of the returned value is set to .| ||Specifies that if `s` lacks any time zone information, UTC is assumed. Unless the flag is present, the method converts the returned value from UTC to local time and sets its property to .| ||Although valid, this value is ignored.| -||For strings that contain time zone information, tries to prevent the conversion of a date and time string to a value that represents a local time with its property set to . Typically, such a string is created by calling the method and by using the "o", "r", or "u" standard format specifier.| +||For strings that contain time zone information, tries to prevent the conversion of a date and time string to a value that represents a local time with its property set to . Typically, such a string is created by calling the method and by using the "o", "r", or "u" standard format specifier.| ### The return value and DateTime.Kind @@ -5751,7 +5751,7 @@ The `DateTime.Parse` overloads return a value whose ). - The time in an unknown time zone (). - Generally, the method returns a object whose property is . However, the method may also perform time zone conversion and set the value of the property differently, depending on the values of the `s` and `styles` parameters: + Generally, the method returns a object whose property is . However, the method may also perform time zone conversion and set the value of the property differently, depending on the values of the `s` and `styles` parameters: |If|Time zone conversion|Kind property| |--------|--------------------------|-------------------| @@ -6157,7 +6157,7 @@ This method overload converts the date and time in `s` and sets the method and displays the value of the property of the resulting values. +The following example demonstrates the method and displays the value of the property of the resulting values. :::code language="csharp" source="~/snippets/csharp/System/DateTime/Parse/Parse4.cs" id="Snippet4"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.DateTime.Parse/fs/Parse4.fs" id="Snippet4"::: @@ -6271,7 +6271,7 @@ The following example demonstrates the method parses the string representation of a date, which must be in the format defined by the `format` parameter. It also requires that the \ and \
@@ -8491,34 +8491,34 @@ In general, the ticks represent the time according to the time zone specified by . The conversion also takes into account the daylight saving time rule that applies to the time represented by the current object. + The local time is equal to the Coordinated Universal Time (UTC) time plus the UTC offset. For more information about the UTC offset, see . The conversion also takes into account the daylight saving time rule that applies to the time represented by the current object. > [!IMPORTANT] -> On Windows XP systems, the method recognizes only the current adjustment rule when converting from UTC to local time. As a result, conversions for periods before the current adjustment rule came into effect may not accurately reflect the difference between UTC and local time. +> On Windows XP systems, the method recognizes only the current adjustment rule when converting from UTC to local time. As a result, conversions for periods before the current adjustment rule came into effect may not accurately reflect the difference between UTC and local time. - Starting with the .NET Framework version 2.0, the value returned by the method is determined by the property of the current object. The following table describes the possible results. + Starting with the .NET Framework version 2.0, the value returned by the method is determined by the property of the current object. The following table describes the possible results. |Kind|Results| |----------|-------------| ||This instance of is converted to local time.| ||No conversion is performed.| -||This instance of is assumed to be a UTC time, and the conversion is performed as if were .| +||This instance of is assumed to be a UTC time, and the conversion is performed as if were .| > [!NOTE] -> The method converts a value from UTC to local time. To convert the time in any designated time zone to local time, use the method. +> The method converts a value from UTC to local time. To convert the time in any designated time zone to local time, use the method. - The value returned by the conversion is a whose property always returns . Consequently, a valid result is returned even if is applied repeatedly to the same . + The value returned by the conversion is a whose property always returns . Consequently, a valid result is returned even if is applied repeatedly to the same . ## Examples - The following example demonstrates the method. Note that the exact output depends on the current culture and the local time zone of the system on which it is run. + The following example demonstrates the method. Note that the exact output depends on the current culture and the local time zone of the system on which it is run. :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/DateTime.ToLocalTime ToUniversalTime/FS/class1.fs" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System/DateTime/ToLocalTime/class1.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/DateTime/ToLocalTime/class1.vb" id="Snippet1"::: - The following example uses the method to demonstrate how the property influences the and conversion methods. + The following example uses the method to demonstrate how the property influences the and conversion methods. :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/DateTime.Kind_Suite/fs/ks.fs" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System/DateTime/Kind/ks.cs" id="Snippet1"::: @@ -8591,16 +8591,16 @@ In general, the ticks represent the time according to the time zone specified by object is formatted using the pattern defined by the property associated with the current culture. The return value is identical to the value returned by specifying the "D" [standard DateTime format string](/dotnet/standard/base-types/standard-date-and-time-format-strings) with the method. + The value of the current object is formatted using the pattern defined by the property associated with the current culture. The return value is identical to the value returned by specifying the "D" [standard DateTime format string](/dotnet/standard/base-types/standard-date-and-time-format-strings) with the method. > [!NOTE] -> The string returned by the method is culture-sensitive. It reflects the pattern defined by the current culture's property. For example, for the en-US culture, the standard long date pattern is commonly "dddd, MMMM dd, yyyy"; for the de-DE culture, it is "dddd, d. MMMM yyyy"; for the ja-JP culture, it is "yyyy'年'M'月'd'日'". Note that its value can vary depending on the .NET implementation and its version, the operating system and its version, and user customization. +> The string returned by the method is culture-sensitive. It reflects the pattern defined by the current culture's property. For example, for the en-US culture, the standard long date pattern is commonly "dddd, MMMM dd, yyyy"; for the de-DE culture, it is "dddd, d. MMMM yyyy"; for the ja-JP culture, it is "yyyy'年'M'月'd'日'". Note that its value can vary depending on the .NET implementation and its version, the operating system and its version, and user customization. [!INCLUDE[culture-sensitive formatting](~/includes/thread-formatting.md)] ## Examples -The following example demonstrates the method. +The following example demonstrates the method. :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/DateTime.ToShortLongString/fs/sls.fs" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System/DateTime/ToLongDateString/sls.cs" id="Snippet1"::: @@ -8667,15 +8667,15 @@ The following example demonstrates the object is formatted using the pattern defined by the property associated with the current culture. The return value is identical to the value returned by specifying the "T" [standard date and time format string](/dotnet/standard/base-types/standard-date-and-time-format-strings) with the method. +The value of the current object is formatted using the pattern defined by the property associated with the current culture. The return value is identical to the value returned by specifying the "T" [standard date and time format string](/dotnet/standard/base-types/standard-date-and-time-format-strings) with the method. > [!NOTE] -> The string returned by the method is culture-sensitive. It reflects the pattern defined by the current culture's property. For example, for the en-US culture, the standard long time pattern is "h:mm:ss tt"; for the de-DE culture, it is "HH:mm:ss"; for the ja-JP culture, it is "H:mm:ss". Note that its value can vary depending on the .NET implementation and its version, the operating system and its version, and user customization. +> The string returned by the method is culture-sensitive. It reflects the pattern defined by the current culture's property. For example, for the en-US culture, the standard long time pattern is "h:mm:ss tt"; for the de-DE culture, it is "HH:mm:ss"; for the ja-JP culture, it is "H:mm:ss". Note that its value can vary depending on the .NET implementation and its version, the operating system and its version, and user customization. [!INCLUDE[culture-sensitive-formatting](~/includes/thread-formatting.md)] ## Examples - The following example demonstrates the method. + The following example demonstrates the method. :::code language="csharp" source="~/snippets/csharp/System/DateTime/ToLongTimeString/sls.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.datetime.tolongtimestring/fs/sls.fs" id="Snippet1"::: @@ -8739,7 +8739,7 @@ The value of the current object is formatted using the pa The base OLE Automation Date is midnight, 30 December 1899. The minimum OLE Automation date is midnight, 1 January 0100. The maximum OLE Automation Date is the same as , the last moment of 31 December 9999. - The method throws an if the current instance represents a date that is later than and earlier than midnight on January1, 0100. However, if the value of the current instance is , the method returns 0. + The method throws an if the current instance represents a date that is later than and earlier than midnight on January1, 0100. However, if the value of the current instance is , the method returns 0. For more information, see [Automation](/cpp/mfc/automation). @@ -8800,15 +8800,15 @@ The value of the current object is formatted using the pa object is formatted using the pattern defined by the property associated with the current culture. The return value is identical to the value returned by specifying the "d" [standard DateTime format string](/dotnet/standard/base-types/standard-date-and-time-format-strings) with the method. + The value of the current object is formatted using the pattern defined by the property associated with the current culture. The return value is identical to the value returned by specifying the "d" [standard DateTime format string](/dotnet/standard/base-types/standard-date-and-time-format-strings) with the method. > [!NOTE] -> The string returned by the method is culture-sensitive. It reflects the pattern defined by the current culture's property. For example, for the en-US culture, the standard short date pattern is "M/d/yyyy"; for the de-DE culture, it is "dd.MM.yyyy"; for the ja-JP culture, it is "yyyy/MM/dd". Note that its value can vary depending on the .NET implementation and its version, the operating system and its version, and user customization. +> The string returned by the method is culture-sensitive. It reflects the pattern defined by the current culture's property. For example, for the en-US culture, the standard short date pattern is "M/d/yyyy"; for the de-DE culture, it is "dd.MM.yyyy"; for the ja-JP culture, it is "yyyy/MM/dd". Note that its value can vary depending on the .NET implementation and its version, the operating system and its version, and user customization. [!INCLUDE[culture-sensitive formatting](~/includes/thread-formatting.md)] ## Examples - The following example demonstrates the method. It also shows that the result of calling the method is identical to calling the method with "d" as the format parameter. + The following example demonstrates the method. It also shows that the result of calling the method is identical to calling the method with "d" as the format parameter. :::code language="csharp" source="~/snippets/csharp/System/DateTime/ToShortDateString/ToShortDateString.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.DateTime.ToShortDateString/fs/ToShortDateString.fs" id="Snippet1"::: @@ -8875,15 +8875,15 @@ The value of the current object is formatted using the pa ## Remarks -The value of the current object is formatted using the pattern defined by the property associated with the current culture. The return value is identical to the value returned by specifying the "t" [standard DateTime format string](/dotnet/standard/base-types/standard-date-and-time-format-strings) with the method. +The value of the current object is formatted using the pattern defined by the property associated with the current culture. The return value is identical to the value returned by specifying the "t" [standard DateTime format string](/dotnet/standard/base-types/standard-date-and-time-format-strings) with the method. > [!NOTE] -> The string returned by the method is culture-sensitive. It reflects the pattern defined by the current culture's property. For example, for the en-US culture, the standard short time pattern is "h:mm tt"; for the de-DE culture, it is "HH:mm"; for the ja-JP culture, it is "H:mm". Note that its value can vary depending on the .NET implementation and its version, the operating system and its version, and user customization. +> The string returned by the method is culture-sensitive. It reflects the pattern defined by the current culture's property. For example, for the en-US culture, the standard short time pattern is "h:mm tt"; for the de-DE culture, it is "HH:mm"; for the ja-JP culture, it is "H:mm". Note that its value can vary depending on the .NET implementation and its version, the operating system and its version, and user customization. [!INCLUDE[culture-sensitive formatting](~/includes/thread-formatting.md)] ## Examples - The following example demonstrates the method. + The following example demonstrates the method. :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/DateTime.ToShortLongString/fs/sls.fs" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System/DateTime/ToLongDateString/sls.cs" id="Snippet1"::: @@ -8966,9 +8966,9 @@ The value of the current object is formatted using the pa object is formatted using the general date and time format specifier ('G'). To format it using a specific date and time format specifier, call the method. To format it using the general date and time format specifier ('G') for a specific culture, call the method. To format it using a specific date and time format specifier and the conventions of a specific culture, call the method. + The value of the current object is formatted using the general date and time format specifier ('G'). To format it using a specific date and time format specifier, call the method. To format it using the general date and time format specifier ('G') for a specific culture, call the method. To format it using a specific date and time format specifier and the conventions of a specific culture, call the method. - This method uses formatting information derived from the current culture. In particular, it combines the custom format strings returned by the and properties of the object returned by the `Thread.CurrentThread.CurrentCulture.DateTimeFormat` property. For more information, see . Other overloads of the method enable you to specify the culture whose formatting to use and to define the output pattern of the value. + This method uses formatting information derived from the current culture. In particular, it combines the custom format strings returned by the and properties of the object returned by the `Thread.CurrentThread.CurrentCulture.DateTimeFormat` property. For more information, see . Other overloads of the method enable you to specify the culture whose formatting to use and to define the output pattern of the value. ## Examples @@ -9076,9 +9076,9 @@ The following example illustrates how the string representation of a object that defines the format of date and time data. -- A custom object that implements the interface. Its method returns a object that provides formatting information. +- A custom object that implements the interface. Its method returns a object that provides formatting information. - If `provider` is `null`, the object associated with the current culture is used. For more information, see . + If `provider` is `null`, the object associated with the current culture is used. For more information, see . @@ -9174,7 +9174,7 @@ The following example illustrates how the string representation of a method returns the string representation of a date and time value in a specific format that uses the formatting conventions of the current culture; for more information, see . + The method returns the string representation of a date and time value in a specific format that uses the formatting conventions of the current culture; for more information, see . The `format` parameter should contain either a single format specifier character (see [Standard Date and Time Format Strings](/dotnet/standard/base-types/standard-date-and-time-format-strings)) or a custom format pattern (see [Custom Date and Time Format Strings](/dotnet/standard/base-types/custom-date-and-time-format-strings)) that defines the format of the returned string. If `format` is `null` or an empty string, the general format specifier, 'G', is used. @@ -9303,9 +9303,9 @@ The following example illustrates how the string representation of a object that defines the format of date and time data. -- A custom object that implements the interface. Its method returns a object that provides formatting information. +- A custom object that implements the interface. Its method returns a object that provides formatting information. - If `provider` is `null`, the associated with the current culture is used. For more information, see . + If `provider` is `null`, the associated with the current culture is used. For more information, see . @@ -9396,34 +9396,34 @@ The following example illustrates how the string representation of a . The conversion also takes into account the daylight saving time rule that applies to the time represented by the current object. + The Coordinated Universal Time (UTC) is equal to the local time minus the UTC offset. For more information about the UTC offset, see . The conversion also takes into account the daylight saving time rule that applies to the time represented by the current object. > [!IMPORTANT] -> On Windows XP systems, the method recognizes only the current adjustment rule when converting from local time to UTC. As a result, conversions for periods before the current adjustment rule came into effect may not accurately reflect the difference between local time and UTC. +> On Windows XP systems, the method recognizes only the current adjustment rule when converting from local time to UTC. As a result, conversions for periods before the current adjustment rule came into effect may not accurately reflect the difference between local time and UTC. - Starting with the .NET Framework version 2.0, the value returned by the method is determined by the property of the current object. The following table describes the possible results. + Starting with the .NET Framework version 2.0, the value returned by the method is determined by the property of the current object. The following table describes the possible results. |Kind|Results| |----------|-------------| ||No conversion is performed.| ||The current object is converted to UTC.| -||The current object is assumed to be a local time, and the conversion is performed as if were .| +||The current object is assumed to be a local time, and the conversion is performed as if were .| > [!NOTE] -> The method converts a value from local time to UTC. To convert the time in a non-local time zone to UTC, use the method. To convert a time whose offset from UTC is known, use the method. +> The method converts a value from local time to UTC. To convert the time in a non-local time zone to UTC, use the method. To convert a time whose offset from UTC is known, use the method. If the date and time instance value is an ambiguous time, this method assumes that it is a standard time. (An ambiguous time is one that can map either to a standard time or to a daylight saving time in the local time zone) If the date and time instance value is an invalid time, this method simply subtracts the local time from the local time zone's UTC offset to return UTC. (An invalid time is one that does not exist because of the application of daylight saving time adjustment rules.) ## Examples - The following example demonstrates the method. + The following example demonstrates the method. :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/DateTime.ToLocalTime ToUniversalTime/FS/class1.fs" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System/DateTime/ToLocalTime/class1.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/DateTime/ToLocalTime/class1.vb" id="Snippet1"::: - The following example uses the method to demonstrate how the property influences the and conversion methods. + The following example uses the method to demonstrate how the property influences the and conversion methods. :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/DateTime.Kind_Suite/fs/ks.fs" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System/DateTime/Kind/ks.cs" id="Snippet1"::: @@ -9700,20 +9700,20 @@ The following example illustrates how the string representation of a method is similar to the method, except that the method does not throw an exception if the conversion fails. + The method is similar to the method, except that the method does not throw an exception if the conversion fails. The string `s` is parsed using formatting information in the current object, which is supplied implicitly by the current culture. This method tries to ignore unrecognized data, if possible, and fills in missing month, day, and year information with the current date. If `s` contains only a date and no time, this method assumes the time is 12:00 midnight. If `s` includes a date component with a two-digit year, it is converted to a year in the current culture's current calendar based on the value of the property. Any leading, inner, or trailing white space character in `s` is ignored. The date and time can be bracketed with a pair of leading and trailing NUMBER SIGN characters ('#', U+0023), and can be trailed with one or more NULL characters (U+0000). - Because the method tries to parse the string representation of a date and time using the formatting rules of the current culture, trying to parse a particular string across different cultures can either fail or return different results. If a specific date and time format will be parsed across different locales, use the method or one of the overloads of the method and provide a format specifier. + Because the method tries to parse the string representation of a date and time using the formatting rules of the current culture, trying to parse a particular string across different cultures can either fail or return different results. If a specific date and time format will be parsed across different locales, use the method or one of the overloads of the method and provide a format specifier. If `s` is the string representation of a leap day in a leap year in the current calendar, the method parses `s` successfully. If `s` is the string representation of a leap day in a non-leap year in the current culture's current calendar, the parse operation fails and the method returns `false`. If `s` contains no time zone information, `result` contains a value whose property is when the method returns. If the string to be parsed contains time zone information, `result` contains a value whose property is when the method returns. ## Examples - The following example passes a number of date and time strings to the method. + The following example passes a number of date and time strings to the method. :::code language="csharp" source="~/snippets/csharp/System/DateTime/TryParse/TryParse1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.DateTime.TryParse/fs/TryParse1.fs" id="Snippet1"::: @@ -9955,7 +9955,7 @@ The following example illustrates how the string representation of a For more information about this API, see Supplemental API remarks for DateTime.TryParse. method. +The following example illustrates the method. :::code language="csharp" source="~/snippets/csharp/System/DateTime/TryParse/tryparse2.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.DateTime.TryParse/fs/tryparse2.fs" id="Snippet2"::: @@ -10230,7 +10230,7 @@ The following example illustrates the method parses the string representation of a date, which must be in the format defined by the `format` parameter. It is similar to the method, except that the method does not throw an exception if the conversion fails. + The method parses the string representation of a date, which must be in the format defined by the `format` parameter. It is similar to the method, except that the method does not throw an exception if the conversion fails. The `s` parameter contains the date and time to parse and must be in a format defined by the `format` parameter. If date, time, and time zone elements are present in `s`, they must also appear in the order specified by `format`. If `format` defines a date with no time element and the parse operation succeeds, the resulting value has a time of midnight (00:00:00). If `format` defines a time with no date element and the parse operation succeeds, the resulting value by default has a date of `DateTime.Now.Date`, or it has a date of `DateTime.MinValue.Date` if `styles` includes the flag. The `style` parameter determines whether the `s` parameter can contain leading, inner, or trailing white space characters. @@ -10241,7 +10241,7 @@ The following example illustrates the [!NOTE] -> Rather than requiring that `s` conform to a single format for the parse operation to succeed, you can call the method and specify multiple permitted formats. This makes the parse operation more likely to succeed. +> Rather than requiring that `s` conform to a single format for the parse operation to succeed, you can call the method and specify multiple permitted formats. This makes the parse operation more likely to succeed. The particular date and time symbols and strings (such as the names of the days of the week in a particular language) used in `s` are defined by the `provider` parameter, as is the precise format of `s` if `format` is a standard format specifier string. The `provider` parameter can be any of the following: @@ -10249,15 +10249,15 @@ The following example illustrates the object that defines the format of date and time data. -- A custom implementation whose method returns either the object or the object that provides formatting information. +- A custom implementation whose method returns either the object or the object that provides formatting information. If `provider` is `null`, the object that corresponds to the current culture is used. - The `styles` parameter includes one or more members of the enumeration that determine whether and where white space not defined by `format` can appear in `s` and that control the precise behavior of the parse operation. The following table describes how each member of the enumeration affects the operation of the method. + The `styles` parameter includes one or more members of the enumeration that determine whether and where white space not defined by `format` can appear in `s` and that control the precise behavior of the parse operation. The following table describes how each member of the enumeration affects the operation of the method. |DateTimeStyles member|Description| |---------------------------|-----------------| -||Parses `s` and, if necessary, converts it to UTC. If `s` includes a time zone offset, or if `s` contains no time zone information but `styles` includes the flag, the method parses the string, calls to convert the returned value to UTC, and sets the property to . If `s` indicates that it represents UTC, or if `s` does not contain time zone information but `styles` includes the flag, the method parses the string, performs no time zone conversion on the returned value, and sets the property to . In all other cases, the flag has no effect.| +||Parses `s` and, if necessary, converts it to UTC. If `s` includes a time zone offset, or if `s` contains no time zone information but `styles` includes the flag, the method parses the string, calls to convert the returned value to UTC, and sets the property to . If `s` indicates that it represents UTC, or if `s` does not contain time zone information but `styles` includes the flag, the method parses the string, performs no time zone conversion on the returned value, and sets the property to . In all other cases, the flag has no effect.| ||Specifies that white space not defined by `format` can appear between any individual date or time element.| ||Specifies that white space not defined by `format` can appear at the beginning of `s`.| ||Specifies that white space not defined by `format` can appear at the end of `s`.| @@ -10271,7 +10271,7 @@ The following example illustrates the method. Note that the string " 5/01/2009 8:30 AM" cannot be parsed successfully when the `styles` parameter equals because leading spaces are not allowed by `format`. Additionally, the string "5/01/2009 09:00" cannot be parsed successfully with a `format` of "MM/dd/yyyyhh:mm" because the date string does not precede the month number with a leading zero, as `format` requires. + The following example demonstrates the method. Note that the string " 5/01/2009 8:30 AM" cannot be parsed successfully when the `styles` parameter equals because leading spaces are not allowed by `format`. Additionally, the string "5/01/2009 09:00" cannot be parsed successfully with a `format` of "MM/dd/yyyyhh:mm" because the date string does not precede the month number with a leading zero, as `format` requires. :::code language="csharp" source="~/snippets/csharp/System/DateTime/TryParseExact/TryParseExact1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.DateTime.TryParseExact/fs/TryParseExact1.fs" id="Snippet1"::: @@ -10379,7 +10379,7 @@ The following example illustrates the method parses the string representation of a date that matches any one of the patterns assigned to the `formats` parameter. It is like the method, except the method does not throw an exception if the conversion fails. + The method parses the string representation of a date that matches any one of the patterns assigned to the `formats` parameter. It is like the method, except the method does not throw an exception if the conversion fails. The `s` parameter contains the date and time to parse. If the `s` parameter contains only a time and no date, the current date is used unless the `style` parameter includes the flag, in which case the default date (`DateTime.Date.MinValue`) is used. If the `s` parameter contains only a date and no time, midnight (00:00:00) is used. The `style` parameter also determines whether the `s` parameter can contain leading, inner, or trailing white space characters other than those permitted by one of the format strings in `formats`. @@ -10395,15 +10395,15 @@ The following example illustrates the object that defines the format of date and time data. -- A custom implementation whose method returns either the object or the object that provides formatting information. +- A custom implementation whose method returns either the object or the object that provides formatting information. If `provider` is `null`, the object that corresponds to the current culture is used. - The `styles` parameter includes one or more members of the enumeration that determine whether and where white space not defined by `format` can appear in `s` and that control the precise behavior of the parse operation. The following table describes how each member of the enumeration affects the operation of the method. + The `styles` parameter includes one or more members of the enumeration that determine whether and where white space not defined by `format` can appear in `s` and that control the precise behavior of the parse operation. The following table describes how each member of the enumeration affects the operation of the method. |DateTimeStyles member|Description| |---------------------------|-----------------| -||Parses `s` and, if necessary, converts it to UTC. If `s` includes a time zone offset, or if `s` contains no time zone information but `styles` includes the flag, the method parses the string, calls to convert the returned value to UTC, and sets the property to . If `s` indicates that it represents UTC, or if `s` does not contain time zone information but `styles` includes the flag, the method parses the string, performs no time zone conversion on the returned value, and sets the property to . In all other cases, the flag has no effect.| +||Parses `s` and, if necessary, converts it to UTC. If `s` includes a time zone offset, or if `s` contains no time zone information but `styles` includes the flag, the method parses the string, calls to convert the returned value to UTC, and sets the property to . If `s` indicates that it represents UTC, or if `s` does not contain time zone information but `styles` includes the flag, the method parses the string, performs no time zone conversion on the returned value, and sets the property to . In all other cases, the flag has no effect.| ||Specifies that white space not defined by `format` can appear between any individual date or time element.| ||Specifies that white space not defined by `format` can appear at the beginning of `s`.| ||Specifies that white space not defined by `format` can appear at the end of `s`.| @@ -10417,7 +10417,7 @@ The following example illustrates the method to ensure that a string in a number of possible formats can be successfully parsed . + The following example uses the method to ensure that a string in a number of possible formats can be successfully parsed . :::code language="csharp" source="~/snippets/csharp/System/DateTime/TryParseExact/TryParseExact2.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.DateTime.TryParseExact/fs/TryParseExact2.fs" id="Snippet2"::: @@ -10539,10 +10539,10 @@ The following example illustrates the whose property returns . - An alternative to using is . While the former indicates that a date and time value is Coordinated Universal Time (UTC) by assigning to its property, the latter assigns the date and time value the UTC time's offset (equal to ). + An alternative to using is . While the former indicates that a date and time value is Coordinated Universal Time (UTC) by assigning to its property, the latter assigns the date and time value the UTC time's offset (equal to ). ## Examples - The following example uses the method to demonstrate how the property influences the and conversion methods. + The following example uses the method to demonstrate how the property influences the and conversion methods. :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR/DateTime.Kind_Suite/fs/ks.fs" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System/DateTime/Kind/ks.cs" id="Snippet1"::: diff --git a/xml/System/DateTimeOffset.xml b/xml/System/DateTimeOffset.xml index de78587cbb5..b69adeefb60 100644 --- a/xml/System/DateTimeOffset.xml +++ b/xml/System/DateTimeOffset.xml @@ -131,7 +131,7 @@ Because is a structure, a object that has been declared but not otherwise initialized contains the default values for each of its member fields. This means that its property is set to and its property is set to . - You can create a new value by calling any of the overloads of its constructor, which are similar to the overloaded constructors for the structure. You can also create a new value by assigning it a value. This is an implicit conversion; it does not require a casting operator (in C#) or call to a conversion method (in Visual Basic). You can also initialize a value from the string representation of a date and time by calling a number of static string parsing methods, which include , , , and . + You can create a new value by calling any of the overloads of its constructor, which are similar to the overloaded constructors for the structure. You can also create a new value by assigning it a value. This is an implicit conversion; it does not require a casting operator (in C#) or call to a conversion method (in Visual Basic). You can also initialize a value from the string representation of a date and time by calling a number of static string parsing methods, which include , , , and . The members of the structure provide functionality in the following areas: @@ -152,12 +152,12 @@ You can extract either the date or the time of a value. You can also retrieve the value of a particular component, such as its year or its month. > [!NOTE] - > If you are working with a ticks value that you want to convert to some other time interval, such as minutes or seconds, you should use the , , , , or constant to perform the conversion. For example, to add the number of seconds represented by a specified number of ticks to the component of a value, you can use the expression `dateValue.Second + nTicks/Timespan.TicksPerSecond`. + > If you are working with a ticks value that you want to convert to some other time interval, such as minutes or seconds, you should use the , , , , or constant to perform the conversion. For example, to add the number of seconds represented by a specified number of ticks to the component of a value, you can use the expression `dateValue.Second + nTicks/Timespan.TicksPerSecond`. - Date and time conversion. - You can convert any value to another value that represents the same point in time in another time zone. However, a time zone's adjustment rules are applied only in the case of the method, which converts a value to the date and time in the local system zone. + You can convert any value to another value that represents the same point in time in another time zone. However, a time zone's adjustment rules are applied only in the case of the method, which converts a value to the date and time in the local system zone. - Date and time comparison. @@ -231,9 +231,9 @@ ## Remarks This constructor's behavior depends on the value of the property of the `dateTime` parameter: -- If the value of is , the property of the new instance is set equal to `dateTime`, and the property is set equal to . +- If the value of is , the property of the new instance is set equal to `dateTime`, and the property is set equal to . -- If the value of is or , the property of the new instance is set equal to `dateTime`, and the property is set equal to the offset of the local system's current time zone. +- If the value of is or , the property of the new instance is set equal to `dateTime`, and the property is set equal to the offset of the local system's current time zone. @@ -304,11 +304,11 @@ ## Remarks This constructor's behavior depends in part on the value of the property of the `dateTime` parameter: -- If the value of is , the value of the `offset` parameter must be 0 or an is thrown. +- If the value of is , the value of the `offset` parameter must be 0 or an is thrown. -- If the value of is , the value of the `offset` parameter must be equal to the local time zone's offset from Coordinated Universal Time (UTC) for that particular date or an is thrown. +- If the value of is , the value of the `offset` parameter must be equal to the local time zone's offset from Coordinated Universal Time (UTC) for that particular date or an is thrown. -- If the value of is , the `offset` parameter can have any valid value. +- If the value of is , the `offset` parameter can have any valid value. @@ -388,7 +388,7 @@ constructor to instantiate a value with a local time and an offset other than that of the local time zone throws an . You can use this overload of the constructor to work around this limitation. The following example uses the local time's number of ticks to instantiate a value whose offset does not necessarily represent that of the local time: + Ordinarily, trying to call the constructor to instantiate a value with a local time and an offset other than that of the local time zone throws an . You can use this overload of the constructor to work around this limitation. The following example uses the local time's number of ticks to instantiate a value whose offset does not necessarily represent that of the local time: :::code language="csharp" source="~/snippets/csharp/System/DateTimeOffset/.ctor/Constructors.cs" id="Snippet4"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.DateTimeOffset.Constructors/fs/Constructors.fs" id="Snippet4"::: @@ -511,12 +511,12 @@ value by using the year, month, and day in another calendar, call the constructor. + This constructor interprets `year`, `month`, and `day` as a year, month, and day in the Gregorian calendar. To instantiate a value by using the year, month, and day in another calendar, call the constructor. ## Examples - The following example instantiates a object by using the constructor overload. + The following example instantiates a object by using the constructor overload. :::code language="csharp" source="~/snippets/csharp/System/DateTimeOffset/.ctor/Constructors.cs" id="Snippet5"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.DateTimeOffset.Constructors/fs/Constructors.fs" id="Snippet5"::: @@ -619,12 +619,12 @@ value by using the year, month, and day in another calendar, call the constructor. + This constructor interprets `year`, `month`, and `day` as a year, month, and day in the Gregorian calendar. To instantiate a value by using the year, month, and day in another calendar, call the constructor. ## Examples - The following example instantiates a object by using the constructor overload. + The following example instantiates a object by using the constructor overload. :::code language="csharp" source="~/snippets/csharp/System/DateTimeOffset/.ctor/Constructors.cs" id="Snippet7"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.DateTimeOffset.Constructors/fs/Constructors.fs" id="Snippet7"::: @@ -1030,21 +1030,21 @@ The property is earlier than method to add more than one kind of time interval (days, hours, minutes, seconds, or milliseconds) in a single operation. This method's behavior is identical to the addition operator. The structure also supports specialized addition methods (such as , , and ) for each time interval. + You can use the method to add more than one kind of time interval (days, hours, minutes, seconds, or milliseconds) in a single operation. This method's behavior is identical to the addition operator. The structure also supports specialized addition methods (such as , , and ) for each time interval. > [!NOTE] > This method returns a new object. It does not modify the value of the current object by adding `timeSpan` to its date and time. - The method does not affect the value of the current object's property. + The method does not affect the value of the current object's property. - Because a object does not represent the date and time in a specific time zone, the method does not consider a particular time zone's adjustment rules when it performs date and time arithmetic. + Because a object does not represent the date and time in a specific time zone, the method does not consider a particular time zone's adjustment rules when it performs date and time arithmetic. If the `timeSpan` parameter is `null`, this method returns the value of the original object unchanged. ## Examples - The following example creates an array of objects that represent the flight times between destinations. The method then adds these times to a object that represents a flight's initial takeoff time. The result reflects the scheduled arrival time at each destination. + The following example creates an array of objects that represent the flight times between destinations. The method then adds these times to a object that represents a flight's initial takeoff time. The result reflects the scheduled arrival time at each destination. :::code language="csharp" source="~/snippets/csharp/System/DateTimeOffset/Add/Methods.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.DateTimeOffset.Methods/fs/Methods.fs" id="Snippet1"::: @@ -1119,14 +1119,14 @@ In .NET Framework, the `days` parameter is rounded to the nearest millisecond. I > [!NOTE] > This method returns a new object. It does not modify the value of the current object by adding `days` to its date and time. - Because a object does not represent the date and time in a specific time zone, the method does not consider a particular time zone's adjustment rules when it performs date and time arithmetic. + Because a object does not represent the date and time in a specific time zone, the method does not consider a particular time zone's adjustment rules when it performs date and time arithmetic. - Converting time intervals of less than a day to a fraction can involve a loss of precision. If this is problematic, you can use the method, which enables you to specify more than one kind of time interval in a single method call and eliminates the need to convert time intervals to fractional parts of a day. + Converting time intervals of less than a day to a fraction can involve a loss of precision. If this is problematic, you can use the method, which enables you to specify more than one kind of time interval in a single method call and eliminates the need to convert time intervals to fractional parts of a day. ## Examples - The following example uses the method to list the dates that fall on Monday, the start of the work week, in March 2008. + The following example uses the method to list the dates that fall on Monday, the start of the work week, in March 2008. :::code language="csharp" source="~/snippets/csharp/System/DateTimeOffset/Add/Methods.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.DateTimeOffset.Methods/fs/Methods.fs" id="Snippet2"::: @@ -1199,12 +1199,12 @@ In .NET Framework, the `hours` parameter is rounded to the nearest millisecond. > [!NOTE] > This method returns a new object. It does not modify the value of the current object by adding `hours` to its date and time. - Because a object does not represent the date and time in a specific time zone, the method does not consider a particular time zone's adjustment rules when it performs date and time arithmetic. + Because a object does not represent the date and time in a specific time zone, the method does not consider a particular time zone's adjustment rules when it performs date and time arithmetic. - Converting time intervals of less than an hour to a fraction can involve a loss of precision. (For example, one minute is 0.01666 of an hour.) If this is problematic, you can use the method, which enables you to specify more than one kind of time interval in a single method call and eliminates the need to convert time intervals to fractional parts of an hour. + Converting time intervals of less than an hour to a fraction can involve a loss of precision. (For example, one minute is 0.01666 of an hour.) If this is problematic, you can use the method, which enables you to specify more than one kind of time interval in a single method call and eliminates the need to convert time intervals to fractional parts of an hour. ## Examples - The following example uses the method to list the start times of work shifts for a particular week at an office that has two eight-hour shifts per day. + The following example uses the method to list the start times of work shifts for a particular week at an office that has two eight-hour shifts per day. :::code language="csharp" source="~/snippets/csharp/System/DateTimeOffset/Add/Methods.cs" id="Snippet3"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.DateTimeOffset.Methods/fs/Methods.fs" id="Snippet3"::: @@ -1330,7 +1330,7 @@ The fractional part of the `milliseconds` parameter is the fractional part of a > [!NOTE] > This method returns a new object. It does not modify the value of the current object by adding `milliseconds` to its date and time. - Because a object does not represent the date and time in a specific time zone, the method does not consider a particular time zone's adjustment rules when it performs date and time arithmetic. + Because a object does not represent the date and time in a specific time zone, the method does not consider a particular time zone's adjustment rules when it performs date and time arithmetic. ]]> @@ -1400,9 +1400,9 @@ In .NET Framework, the `minutes` parameter is rounded to the nearest millisecond > [!NOTE] > This method returns a new object. It does not modify the value of the current object by adding `minutes` to its date and time. - Because a object does not represent the date and time in a specific time zone, the method does not consider a particular time zone's adjustment rules when it performs date and time arithmetic. + Because a object does not represent the date and time in a specific time zone, the method does not consider a particular time zone's adjustment rules when it performs date and time arithmetic. - Converting time intervals of less than a minute to a fraction can involve a loss of precision. (For example, one second is 0.01666 of a minute.) If this is problematic, you can use the method, which enables you to specify more than one kind of time interval in a single method call and eliminates the need to convert time intervals to fractional parts of a minute. + Converting time intervals of less than a minute to a fraction can involve a loss of precision. (For example, one second is 0.01666 of a minute.) If this is problematic, you can use the method, which enables you to specify more than one kind of time interval in a single method call and eliminates the need to convert time intervals to fractional parts of a minute. ]]> @@ -1464,7 +1464,7 @@ In .NET Framework, the `minutes` parameter is rounded to the nearest millisecond does not enable you to add fractional parts of a month. To add a time that consists of other time units in addition to months to a object, use the method. + Unlike most of the other methods that add a single time interval unit (such as minutes or days) to a date and time value, does not enable you to add fractional parts of a month. To add a time that consists of other time units in addition to months to a object, use the method. > [!NOTE] > This method returns a new object. It does not modify the value of the current object by adding `months` to its date and time. @@ -1472,7 +1472,7 @@ In .NET Framework, the `minutes` parameter is rounded to the nearest millisecond ## Examples - The following example uses the method to display the start date of each quarter of the year 2007. + The following example uses the method to display the start date of each quarter of the year 2007. :::code language="csharp" source="~/snippets/csharp/System/DateTimeOffset/Add/Methods.cs" id="Snippet4"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.DateTimeOffset.Methods/fs/Methods.fs" id="Snippet4"::: @@ -1550,7 +1550,7 @@ In .NET Framework, the `seconds` parameter is rounded to the nearest millisecond > [!NOTE] > This method returns a new object. It does not modify the value of the current object by adding `seconds` to its date and time. - Because a object does not represent the date and time in a specific time zone, the method does not consider a particular time zone's adjustment rules when it performs date and time arithmetic. + Because a object does not represent the date and time in a specific time zone, the method does not consider a particular time zone's adjustment rules when it performs date and time arithmetic. ]]> @@ -1630,7 +1630,7 @@ In .NET Framework, the `seconds` parameter is rounded to the nearest millisecond |Non-leap year|315,360,000,000,000| |Leap year|316,224,000,000,000| - Because a object does not represent the date and time in a specific time zone, the method does not consider a particular time zone's adjustment rules when it performs date and time arithmetic. + Because a object does not represent the date and time in a specific time zone, the method does not consider a particular time zone's adjustment rules when it performs date and time arithmetic. ]]> @@ -1692,7 +1692,7 @@ In .NET Framework, the `seconds` parameter is rounded to the nearest millisecond does not enable you to add fractional parts of a year. To add a time that consists of other time units in addition to years to a object, use the method. + Unlike most of the other methods that add a single time interval unit (such as minutes or days) to a date and time value, does not enable you to add fractional parts of a year. To add a time that consists of other time units in addition to years to a object, use the method. > [!NOTE] > This method returns a new object. It does not modify the value of the current object by adding `years` to its date and time. @@ -1789,12 +1789,12 @@ In .NET Framework, the `seconds` parameter is rounded to the nearest millisecond :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.DateTimeOffset.Syntax/fs/Syntax.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/DateTimeOffset/Compare/Syntax.vb" id="Snippet1"::: - In other words, the method determines whether two objects represent a single point in time. It directly compares neither dates and times nor offsets. + In other words, the method determines whether two objects represent a single point in time. It directly compares neither dates and times nor offsets. ## Examples - The following example illustrates calls to the method to compare objects. + The following example illustrates calls to the method to compare objects. :::code language="csharp" source="~/snippets/csharp/System/DateTimeOffset/Add/Methods2.cs" id="Snippet7"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.DateTimeOffset.Methods/fs/Methods2.fs" id="Snippet7"::: @@ -1875,12 +1875,12 @@ In .NET Framework, the `seconds` parameter is rounded to the nearest millisecond objects by comparing their values; that is, it determines whether the two objects represent a single point in time, and indicates whether the current object is earlier than, later than, or the same as the `other` parameter. + This method compares objects by comparing their values; that is, it determines whether the two objects represent a single point in time, and indicates whether the current object is earlier than, later than, or the same as the `other` parameter. ## Examples - The following example illustrates calls to the method to compare objects. + The following example illustrates calls to the method to compare objects. :::code language="csharp" source="~/snippets/csharp/System/DateTimeOffset/Add/Methods3.cs" id="Snippet8"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.DateTimeOffset.Methods/fs/Methods3.fs" id="Snippet8"::: @@ -2012,7 +2012,7 @@ In .NET Framework, the `seconds` parameter is rounded to the nearest millisecond ## Examples - The following example illustrates the use of the property to convert the time returned by the and properties to values. + The following example illustrates the use of the property to convert the time returned by the and properties to values. :::code language="csharp" source="~/snippets/csharp/System/DateTimeOffset/Date/Properties.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.DateTimeOffset.Properties/fs/Properties.fs" id="Snippet2"::: @@ -2072,7 +2072,7 @@ In .NET Framework, the `seconds` parameter is rounded to the nearest millisecond ## Remarks The property is not affected by the value of the property. - You can also create a string representation of a object's day component by calling the method with the "d" or "dd" custom format specifiers. + You can also create a string representation of a object's day component by calling the method with the "d" or "dd" custom format specifiers. @@ -2081,9 +2081,9 @@ In .NET Framework, the `seconds` parameter is rounded to the nearest millisecond - By retrieving the value of the property. -- By calling the method with the "d" format specifier. +- By calling the method with the "d" format specifier. -- By calling the method with the "dd" format specifier. +- By calling the method with the "dd" format specifier. :::code language="csharp" source="~/snippets/csharp/System/DateTimeOffset/Date/Properties.cs" id="Snippet10"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.DateTimeOffset.Properties/fs/Properties.fs" id="Snippet10"::: @@ -2147,7 +2147,7 @@ In .NET Framework, the `seconds` parameter is rounded to the nearest millisecond :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.DateTimeOffset.Properties/fs/Properties.fs" id="Snippet4"::: :::code language="vb" source="~/snippets/visualbasic/System/DateTimeOffset/Date/Properties.vb" id="Snippet4"::: - Note that the string returned by calling the `ToString` method of the enumeration member that is returned by this property is not localized. To extract a string that contains the weekday name of the current culture or of a specific culture, call the method with the "dddd" custom format specifier. For example, the following code displays the weekday name for a date using the `fr-fr` culture. + Note that the string returned by calling the `ToString` method of the enumeration member that is returned by this property is not localized. To extract a string that contains the weekday name of the current culture or of a specific culture, call the method with the "dddd" custom format specifier. For example, the following code displays the weekday name for a date using the `fr-fr` culture. :::code language="csharp" source="~/snippets/csharp/System/DateTimeOffset/Date/Properties.cs" id="Snippet5"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.DateTimeOffset.Properties/fs/Properties.fs" id="Snippet5"::: @@ -2327,16 +2327,16 @@ In .NET Framework, the `seconds` parameter is rounded to the nearest millisecond :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.DateTimeOffset.Syntax/fs/Syntax.fs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System/DateTimeOffset/Compare/Syntax.vb" id="Snippet2"::: - In other words, the method determines whether two objects represent a single point in time. It directly compares neither dates and times nor offsets. To determine whether two objects represent the same time and have the same offset value, use the method. + In other words, the method determines whether two objects represent a single point in time. It directly compares neither dates and times nor offsets. To determine whether two objects represent the same time and have the same offset value, use the method. A object that is not `null` is considered to be later (or greater) than one that is `null`. - This overload of the method implements the method. It offers slightly better performance than the overload because the `other` parameter does not have to be converted from an object. + This overload of the method implements the method. It offers slightly better performance than the overload because the `other` parameter does not have to be converted from an object. ## Examples - The following example illustrates calls to the method to test objects for equality with the current object. + The following example illustrates calls to the method to test objects for equality with the current object. :::code language="csharp" source="~/snippets/csharp/System/DateTimeOffset/Add/Methods.cs" id="Snippet9"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.DateTimeOffset.Methods/fs/Methods.fs" id="Snippet9"::: @@ -2412,7 +2412,7 @@ In .NET Framework, the `seconds` parameter is rounded to the nearest millisecond :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.DateTimeOffset.Syntax/fs/Syntax.fs" id="Snippet3"::: :::code language="vb" source="~/snippets/visualbasic/System/DateTimeOffset/Compare/Syntax.vb" id="Snippet3"::: - In other words, the method determines whether the current object and a specified object represent a single point in time. It directly compares neither dates and times nor offsets. To determine whether two objects represent the same time and have the same offset value, use the method. + In other words, the method determines whether the current object and a specified object represent a single point in time. It directly compares neither dates and times nor offsets. To determine whether two objects represent the same time and have the same offset value, use the method. If `obj` is `null`, or if the run-time type of `obj` is not , the method returns `false`. @@ -2489,12 +2489,12 @@ In .NET Framework, the `seconds` parameter is rounded to the nearest millisecond :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.DateTimeOffset.Syntax/fs/Syntax.fs" id="Snippet4"::: :::code language="vb" source="~/snippets/visualbasic/System/DateTimeOffset/Compare/Syntax.vb" id="Snippet4"::: - In other words, the method determines whether the two objects represent a single point in time. It directly compares neither dates and times nor offsets. To determine whether two objects represent the same time and have the same offset value, use the method. + In other words, the method determines whether the two objects represent a single point in time. It directly compares neither dates and times nor offsets. To determine whether two objects represent the same time and have the same offset value, use the method. ## Examples - The following example illustrates calls to the method to test various pairs of objects for equality. + The following example illustrates calls to the method to test various pairs of objects for equality. :::code language="csharp" source="~/snippets/csharp/System/DateTimeOffset/Add/Methods.cs" id="Snippet11"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.DateTimeOffset.Methods/fs/Methods.fs" id="Snippet11"::: @@ -2558,12 +2558,12 @@ In .NET Framework, the `seconds` parameter is rounded to the nearest millisecond ## Remarks Because multiple time zones share a single offset, a return value of `true` does not guarantee that the current and the `other` object represent times in the same time zone. - Unlike the method, the overloads of the method determine only whether two values represent a single point in time. They do not indicate that two values have the same date and time as well as the same offset. + Unlike the method, the overloads of the method determine only whether two values represent a single point in time. They do not indicate that two values have the same date and time as well as the same offset. ## Examples - The following example illustrates the use of the method to compare similar objects. + The following example illustrates the use of the method to compare similar objects. :::code language="csharp" source="~/snippets/csharp/System/DateTimeOffset/Add/Methods.cs" id="Snippet12"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.DateTimeOffset.Methods/fs/Methods.fs" id="Snippet12"::: @@ -2628,7 +2628,7 @@ In .NET Framework, the `seconds` parameter is rounded to the nearest millisecond A Windows file time is directly accessible through the Windows API by calling the `GetFileTime` function, which returns a `FILETIME` structure. The single function parameter is the handle of the file whose file time information is to be retrieved. The file handle is retrieved by calling the `CreateFile` function. The `FILETIME` structure's `dwHighDateTime` member contains the four high-order bytes of the file time, and its `dwLowDateTime` member contains the four low-order bytes. The example that follows illustrates how to retrieve Windows file time values and convert them to values. - Windows file time values can also be created from values by calling the and methods, and from values by calling the method. + Windows file time values can also be created from values by calling the and methods, and from values by calling the method. @@ -2696,7 +2696,7 @@ In .NET Framework, the `seconds` parameter is rounded to the nearest millisecond property value of the returned instance is , which represents Coordinated Universal Time. You can convert it to the time in a specific time zone by calling the method. + The property value of the returned instance is , which represents Coordinated Universal Time. You can convert it to the time in a specific time zone by calling the method. ]]> @@ -2757,7 +2757,7 @@ In .NET Framework, the `seconds` parameter is rounded to the nearest millisecond property value of the returned instance is , which represents Coordinated Universal Time. You can convert it to the time in a specific time zone by calling the method. + The property value of the returned instance is , which represents Coordinated Universal Time. You can convert it to the time in a specific time zone by calling the method. ]]> @@ -2865,7 +2865,7 @@ In .NET Framework, the `seconds` parameter is rounded to the nearest millisecond ## Remarks The property is not affected by the value of the property. - You can also create a string representation of a object's hour component by calling the method with the "H", or "HH" custom format specifiers. + You can also create a string representation of a object's hour component by calling the method with the "H", or "HH" custom format specifiers. @@ -2874,9 +2874,9 @@ In .NET Framework, the `seconds` parameter is rounded to the nearest millisecond - By retrieving the value of the property. -- By calling the method with the "H" format specifier. +- By calling the method with the "H" format specifier. -- By calling the method with the "HH" format specifier. +- By calling the method with the "HH" format specifier. :::code language="csharp" source="~/snippets/csharp/System/DateTimeOffset/Date/Properties.cs" id="Snippet6"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.DateTimeOffset.Properties/fs/Properties.fs" id="Snippet6"::: @@ -3100,9 +3100,9 @@ If you rely on properties such as or object's millisecond component by calling the method with the "fff" custom format specifier. + You can also create a string representation of a object's millisecond component by calling the method with the "fff" custom format specifier. - If you rely on properties such as or to accurately track the number of elapsed milliseconds, the precision of the time's millisecond component depends on the resolution of the system clock. On Windows NT 3.5 and later, and Windows Vista operating systems, the clock's resolution is approximately 10-15 milliseconds. + If you rely on properties such as or to accurately track the number of elapsed milliseconds, the precision of the time's millisecond component depends on the resolution of the system clock. On Windows NT 3.5 and later, and Windows Vista operating systems, the clock's resolution is approximately 10-15 milliseconds. @@ -3165,7 +3165,7 @@ If you rely on properties such as or property is not affected by the value of the property. - You can also create a string representation of a object's minute component by calling the method with the "m", or "mm" custom format specifiers. + You can also create a string representation of a object's minute component by calling the method with the "m", or "mm" custom format specifiers. @@ -3174,9 +3174,9 @@ If you rely on properties such as or property. -- By calling the method with the "m" format specifier. +- By calling the method with the "m" format specifier. -- By calling the method with the "mm" format specifier. +- By calling the method with the "mm" format specifier. :::code language="csharp" source="~/snippets/csharp/System/DateTimeOffset/Date/Properties.cs" id="Snippet8"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.DateTimeOffset.Properties/fs/Properties.fs" id="Snippet8"::: @@ -3288,7 +3288,7 @@ If you rely on properties such as or property is not affected by the value of the property. - You can also create a string representation of a object's month component by calling the method with the "M" or "MM" custom format specifiers. + You can also create a string representation of a object's month component by calling the method with the "M" or "MM" custom format specifiers. @@ -3297,9 +3297,9 @@ If you rely on properties such as or property. -- By calling the method with the "M" format specifier. +- By calling the method with the "M" format specifier. -- By calling the method with the "MM" format specifier. +- By calling the method with the "MM" format specifier. :::code language="csharp" source="~/snippets/csharp/System/DateTimeOffset/Date/Properties.cs" id="Snippet9"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.DateTimeOffset.Properties/fs/Properties.fs" id="Snippet9"::: @@ -3407,7 +3407,7 @@ If you rely on properties such as or and properties to determine the resolution of the system clock. It displays the time only when the value of its millisecond component has changed. + The following example uses the and properties to determine the resolution of the system clock. It displays the time only when the value of its millisecond component has changed. :::code language="csharp" source="~/snippets/csharp/System/DateTimeOffset/Date/Properties.cs" id="Snippet11"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.DateTimeOffset.Properties/fs/Properties.fs" id="Snippet11"::: @@ -3540,15 +3540,15 @@ If you rely on properties such as or method defines the addition operation for values. It enables code such as the following: + The method defines the addition operation for values. It enables code such as the following: :::code language="csharp" source="~/snippets/csharp/System/DateTimeOffset/op_Addition/Operators.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.DateTimeOffset.Operators/fs/Operators.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/DateTimeOffset/op_Addition/Operators.vb" id="Snippet1"::: - Languages that do not support custom operators and operator overloading can call the method instead. + Languages that do not support custom operators and operator overloading can call the method instead. - The equivalent method for this operator is .]]> + The equivalent method for this operator is .]]> The resulting value is less than DateTimeOffset.MinValue. @@ -3612,7 +3612,7 @@ If you rely on properties such as or method defines the operation of the equality operator for objects. It enables code such as the following: + The method defines the operation of the equality operator for objects. It enables code such as the following: :::code language="csharp" source="~/snippets/csharp/System/DateTimeOffset/op_Addition/Operators.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.DateTimeOffset.Operators/fs/Operators.fs" id="Snippet2"::: @@ -3624,9 +3624,9 @@ If you rely on properties such as or method determines whether the two objects represent a single point in time. It directly compares neither dates and times nor offsets. To determine whether two objects represent the same time and have the same offset value, use the method. + In other words, the method determines whether the two objects represent a single point in time. It directly compares neither dates and times nor offsets. To determine whether two objects represent the same time and have the same offset value, use the method. - The equivalent method for this operator is ]]> + The equivalent method for this operator is ]]> @@ -3684,13 +3684,13 @@ If you rely on properties such as or method defines the operation of the greater than operator for objects. It enables code such as the following: + The method defines the operation of the greater than operator for objects. It enables code such as the following: :::code language="csharp" source="~/snippets/csharp/System/DateTimeOffset/op_Addition/Operators.cs" id="Snippet3"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.DateTimeOffset.Operators/fs/Operators.fs" id="Snippet3"::: :::code language="vb" source="~/snippets/visualbasic/System/DateTimeOffset/op_Addition/Operators.vb" id="Snippet3"::: - Languages that do not support custom operators can call the method instead. They can also call the method directly, as the following example shows. + Languages that do not support custom operators can call the method instead. They can also call the method directly, as the following example shows. :::code language="vb" source="~/snippets/visualbasic/System/DateTimeOffset/op_Addition/Operators.vb" id="Snippet4"::: @@ -3700,7 +3700,7 @@ If you rely on properties such as or ]]> + The equivalent method for this operator is ]]> @@ -3758,13 +3758,13 @@ If you rely on properties such as or method defines the operation of the greater than or equal to operator for objects. It enables code such as the following: + The method defines the operation of the greater than or equal to operator for objects. It enables code such as the following: :::code language="csharp" source="~/snippets/csharp/System/DateTimeOffset/op_Addition/Operators.cs" id="Snippet5"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.DateTimeOffset.Operators/fs/Operators.fs" id="Snippet5"::: :::code language="vb" source="~/snippets/visualbasic/System/DateTimeOffset/op_Addition/Operators.vb" id="Snippet5"::: - Languages that do not support custom operators can call the method instead. Some languages can also call the method directly, as the following example shows. + Languages that do not support custom operators can call the method instead. Some languages can also call the method directly, as the following example shows. :::code language="vb" source="~/snippets/visualbasic/System/DateTimeOffset/op_Addition/Operators.vb" id="Snippet6"::: @@ -3774,7 +3774,7 @@ If you rely on properties such as or ]]> + The equivalent method for this operator is ]]> @@ -3829,19 +3829,19 @@ If you rely on properties such as or method enables the compiler to automatically convert a object to a object without an explicit casting operator (in C#) or a call to a conversion function (in Visual Basic). It defines a widening conversion that does not involve data loss and does not throw an . The method makes code such as the following possible: + The method enables the compiler to automatically convert a object to a object without an explicit casting operator (in C#) or a call to a conversion function (in Visual Basic). It defines a widening conversion that does not involve data loss and does not throw an . The method makes code such as the following possible: :::code language="csharp" source="~/snippets/csharp/System/DateTimeOffset/op_Addition/Operators.cs" id="Snippet7"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.DateTimeOffset.Operators/fs/Operators.fs" id="Snippet7"::: :::code language="vb" source="~/snippets/visualbasic/System/DateTimeOffset/op_Addition/Operators.vb" id="Snippet7"::: - This method is equivalent to the constructor. The offset of the resulting object depends on the value of the property of the `dateTime` parameter: + This method is equivalent to the constructor. The offset of the resulting object depends on the value of the property of the `dateTime` parameter: - If the value of the property is , the date and time of the object is set equal to `dateTime`, and its property is set equal to 0. - If the value of the property is or , the date and time of the object is set equal to `dateTime`, and its property is set equal to the offset of the local system's current time zone. - The equivalent method for this operator is ]]>
+ The equivalent method for this operator is ]]>
The Coordinated Universal Time (UTC) date and time that results from applying the offset is earlier than DateTimeOffset.MinValue. @@ -3903,7 +3903,7 @@ If you rely on properties such as or method defines the operation of the inequality operator for objects. It always returns the opposite result from . The method enables code such as the following: + The method defines the operation of the inequality operator for objects. It always returns the opposite result from . The method enables code such as the following: :::code language="csharp" source="~/snippets/csharp/System/DateTimeOffset/op_Addition/Operators.cs" id="Snippet8"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.DateTimeOffset.Operators/fs/Operators.fs" id="Snippet8"::: @@ -3915,13 +3915,13 @@ If you rely on properties such as or method determines whether the two objects represent different points in time. It directly compares neither dates and times nor offsets. + In other words, the method determines whether the two objects represent different points in time. It directly compares neither dates and times nor offsets. - Languages that do not support custom operators can call the method instead. In addition, some languages can also call the method directly, as the following example shows. + Languages that do not support custom operators can call the method instead. In addition, some languages can also call the method directly, as the following example shows. :::code language="vb" source="~/snippets/visualbasic/System/DateTimeOffset/op_Addition/Operators.vb" id="Snippet9"::: - The equivalent method for this operator is ]]>
+ The equivalent method for this operator is ]]>
@@ -3978,7 +3978,7 @@ If you rely on properties such as or method defines the operation of the less than operator for objects. It enables code such as the following: + The method defines the operation of the less than operator for objects. It enables code such as the following: :::code language="csharp" source="~/snippets/csharp/System/DateTimeOffset/op_Addition/Operators.cs" id="Snippet10"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.DateTimeOffset.Operators/fs/Operators.fs" id="Snippet10"::: @@ -3990,11 +3990,11 @@ If you rely on properties such as or method instead. In addition, some languages can also call the method directly, as the following example shows. + Languages that do not support custom operators can call the method instead. In addition, some languages can also call the method directly, as the following example shows. :::code language="vb" source="~/snippets/visualbasic/System/DateTimeOffset/op_Addition/Operators.vb" id="Snippet11"::: - The equivalent method for this operator is ]]>
+ The equivalent method for this operator is ]]>
@@ -4052,13 +4052,13 @@ If you rely on properties such as or method defines the operation of the less than or equal to operator for objects. It enables code such as the following: + The method defines the operation of the less than or equal to operator for objects. It enables code such as the following: :::code language="csharp" source="~/snippets/csharp/System/DateTimeOffset/op_Addition/Operators.cs" id="Snippet12"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.DateTimeOffset.Operators/fs/Operators.fs" id="Snippet12"::: :::code language="vb" source="~/snippets/visualbasic/System/DateTimeOffset/op_Addition/Operators.vb" id="Snippet12"::: - Languages that do not support custom operators can call the method instead. Some languages can also call the method directly, as the following example shows. + Languages that do not support custom operators can call the method instead. Some languages can also call the method directly, as the following example shows. :::code language="vb" source="~/snippets/visualbasic/System/DateTimeOffset/op_Addition/Operators.vb" id="Snippet13"::: @@ -4068,7 +4068,7 @@ If you rely on properties such as or ]]>
+ The equivalent method for this operator is ]]>
@@ -4138,15 +4138,15 @@ If you rely on properties such as or method defines the subtraction operation for objects. It enables code such as the following: + The method defines the subtraction operation for objects. It enables code such as the following: :::code language="csharp" source="~/snippets/csharp/System/DateTimeOffset/op_Addition/Operators.cs" id="Snippet14"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.DateTimeOffset.Operators/fs/Operators.fs" id="Snippet14"::: :::code language="vb" source="~/snippets/visualbasic/System/DateTimeOffset/op_Addition/Operators.vb" id="Snippet14"::: - Languages that do not support custom operators and operator overloading can call the method instead. + Languages that do not support custom operators and operator overloading can call the method instead. - The equivalent method for this operator is .]]>
+ The equivalent method for this operator is .]]>
Performing Arithmetic Operations with Dates and Times @@ -4211,15 +4211,15 @@ If you rely on properties such as or method defines the subtraction operation for objects. It enables code such as the following: + The method defines the subtraction operation for objects. It enables code such as the following: :::code language="csharp" source="~/snippets/csharp/System/DateTimeOffset/op_Addition/Operators.cs" id="Snippet15"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.DateTimeOffset.Operators/fs/Operators.fs" id="Snippet15"::: :::code language="vb" source="~/snippets/visualbasic/System/DateTimeOffset/op_Addition/Operators.vb" id="Snippet15"::: - Languages that do not support custom operators and operator overloading can call the method instead. + Languages that do not support custom operators and operator overloading can call the method instead. - The equivalent method for this operator is .]]>
+ The equivalent method for this operator is .]]>
The resulting value is less than DateTimeOffset.MinValue or greater than DateTimeOffset.MaxValue. @@ -4302,7 +4302,7 @@ If you rely on properties such as or parses a string with three elements that can appear in any order and are delimited by white space. These three elements are as shown in the following table. + parses a string with three elements that can appear in any order and are delimited by white space. These three elements are as shown in the following table. |Element|Example| |-------------|-------------| @@ -4312,12 +4312,12 @@ If you rely on properties such as or cannot appear by itself. It must be provided together with either \ or \
diff --git a/xml/System/Enum.xml b/xml/System/Enum.xml index 83c88ae85da..dda081bcc72 100644 --- a/xml/System/Enum.xml +++ b/xml/System/Enum.xml @@ -297,18 +297,18 @@ method overrides to define how enumeration members are evaluated for equality. + The method overrides to define how enumeration members are evaluated for equality. ## Examples - The following example illustrates the use of the method. + The following example illustrates the use of the method. :::code language="csharp" source="~/snippets/csharp/System/Enum/Equals/EnumEquals.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Enum/Equals/EnumEquals.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/Enum/Equals/EnumEquals.vb" id="Snippet1"::: - The following example defines two enumeration types, `SledDog` and `WorkDog`. The `SledDog` enumeration has two members, `SledDog.AlaskanMalamute` and `SledDog.Malamute`, that have the same underlying value. The call to the method indicates that these values are equal because their underlying values are the same. The `SledDog.Malamute` and `WorkDog.Newfoundland` members have the same underlying value, although they represent different enumeration types. A call to the method indicates that these values are not equal. + The following example defines two enumeration types, `SledDog` and `WorkDog`. The `SledDog` enumeration has two members, `SledDog.AlaskanMalamute` and `SledDog.Malamute`, that have the same underlying value. The call to the method indicates that these values are equal because their underlying values are the same. The `SledDog.Malamute` and `WorkDog.Newfoundland` members have the same underlying value, although they represent different enumeration types. A call to the method indicates that these values are not equal. :::code language="csharp" source="~/snippets/csharp/System/Enum/Equals/enumequals1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Enum/Equals/enumequals1.fs" id="Snippet1"::: @@ -542,7 +542,7 @@ method guarantees that it will return the name of one of those enumeration members. However, it does not guarantee that it will always return the name of the same enumeration member. As a result, when multiple enumeration members have the same value, your application code should never depend on the method returning a particular member's name. + If multiple enumeration members have the same underlying value, the method guarantees that it will return the name of one of those enumeration members. However, it does not guarantee that it will always return the name of the same enumeration member. As a result, when multiple enumeration members have the same value, your application code should never depend on the method returning a particular member's name. ## Examples The following example illustrates the use of `GetName`. @@ -676,7 +676,7 @@ method for an enumeration that includes a negative, zero, and a positive value. + The elements of the return value array are sorted by the binary values of the enumerated constants (that is, by their unsigned magnitude). The following example provides displays information about the array returned by the method for an enumeration that includes a negative, zero, and a positive value. :::code language="csharp" source="~/snippets/csharp/System/Enum/GetNames/getnames1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Enum/GetNames/getnames1.fs" id="Snippet1"::: @@ -685,7 +685,7 @@ If there are enumerated constants with same value, the order of their corresponding names is unspecified. ## Examples - The following example illustrates the use of the method. + The following example illustrates the use of the method. :::code language="csharp" source="~/snippets/csharp/System/Enum/GetNames/EnumGetNames.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Enum/GetNames/EnumGetNames.fs" id="Snippet1"::: @@ -869,7 +869,7 @@ ## Examples - The following example calls the method to display the underlying type of some enumeration members. + The following example calls the method to display the underlying type of some enumeration members. :::code language="csharp" source="~/snippets/csharp/System/Enum/GetUnderlyingType/getunderlyingtype1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Enum/GetUnderlyingType/getunderlyingtype1.fs" id="Snippet1"::: @@ -945,15 +945,15 @@ method for an enumeration that includes a negative value, zero, and a positive value. + The elements of the array are sorted by the binary values of the enumeration constants (that is, by their unsigned magnitude). The following example displays information about the array returned by the method for an enumeration that includes a negative value, zero, and a positive value. :::code language="csharp" source="~/snippets/csharp/System/Enum/GetValues/getvalues1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Enum/GetValues/getvalues1.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/Enum/GetValues/getvalues1.vb" id="Snippet1"::: - The method returns an array that contains a value for each member of the `enumType` enumeration. If multiple members have the same value, the returned array includes duplicate values. In this case, calling the method with each value in the returned array does not restore the unique names assigned to members that have duplicate values. To retrieve all the names of enumeration members successfully, call the method. + The method returns an array that contains a value for each member of the `enumType` enumeration. If multiple members have the same value, the returned array includes duplicate values. In this case, calling the method with each value in the returned array does not restore the unique names assigned to members that have duplicate values. To retrieve all the names of enumeration members successfully, call the method. - The method cannot be invoked by using reflection in a reflection-only context. Instead, you can retrieve the value of all enumeration members by using the method to get an array of objects that represent enumeration members and then call the method on each element of the array. The following example illustrates this technique. It requires that you define the following enumeration in an assembly named Enumerations.dll: + The method cannot be invoked by using reflection in a reflection-only context. Instead, you can retrieve the value of all enumeration members by using the method to get an array of objects that represent enumeration members and then call the method on each element of the array. The following example illustrates this technique. It requires that you define the following enumeration in an assembly named Enumerations.dll: :::code language="csharp" source="~/snippets/csharp/System/Enum/GetValues/getvalues_reflectiononly.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/Enum/GetValues/getvalues_reflectiononly.fs" id="Snippet2"::: @@ -966,7 +966,7 @@ :::code language="vb" source="~/snippets/visualbasic/System/Enum/GetValues/getvalues_reflectiononly.vb" id="Snippet3"::: ## Examples - The following example illustrates the use of . + The following example illustrates the use of . :::code language="csharp" source="~/snippets/csharp/System/Enum/GetValues/EnumGetValues.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Enum/GetValues/EnumGetValues.fs" id="Snippet1"::: @@ -1188,19 +1188,19 @@ method returns the result of the following Boolean expression. + The method returns the result of the following Boolean expression. ```csharp (thisInstance & flag) == flag ``` - If the underlying value of `flag` is zero, the method returns `true`. If this behavior is not desirable, you can use the method to test for equality with zero and call only if the underlying value of `flag` is non-zero, as the following example illustrates. + If the underlying value of `flag` is zero, the method returns `true`. If this behavior is not desirable, you can use the method to test for equality with zero and call only if the underlying value of `flag` is non-zero, as the following example illustrates. :::code language="csharp" source="~/snippets/csharp/System/Enum/HasFlag/hasflag0.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Enum/HasFlag/hasflag0.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/Enum/HasFlag/hasflag0.vb" id="Snippet1"::: - The method is designed to be used with enumeration types that are marked with the attribute and can be used to determine whether multiple bit fields are set. For enumeration types that are not marked with the attribute, call either the method or the method. + The method is designed to be used with enumeration types that are marked with the attribute and can be used to determine whether multiple bit fields are set. For enumeration types that are not marked with the attribute, call either the method or the method. @@ -1289,12 +1289,12 @@ - A value of the underlying type of `enumType`. - If the constants in `enumType` define a set of bit fields and `value` contains the values, names, or underlying values of multiple bit fields, the method returns `false`. In other words, for enumerations that define a set of bit fields, the method determines only whether a single bit field belongs to the enumeration. To determine whether multiple bit fields are set in an enumeration type that is tagged with the attribute, you can call the method. + If the constants in `enumType` define a set of bit fields and `value` contains the values, names, or underlying values of multiple bit fields, the method returns `false`. In other words, for enumerations that define a set of bit fields, the method determines only whether a single bit field belongs to the enumeration. To determine whether multiple bit fields are set in an enumeration type that is tagged with the attribute, you can call the method. ## Examples - The following example defines an enumeration named `PetType` that consists of individual bit fields. It then calls the method with possible underlying enumeration values, string names, and composite values that result from setting multiple bit fields. + The following example defines an enumeration named `PetType` that consists of individual bit fields. It then calls the method with possible underlying enumeration values, string names, and composite values that result from setting multiple bit fields. :::code language="csharp" source="~/snippets/csharp/System/Enum/IsDefined/isdefined1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Enum/IsDefined/isdefined1.fs" id="Snippet1"::: @@ -1511,7 +1511,7 @@ ## Remarks The `value` parameter contains the string representation of an enumeration member's underlying value or named constant, or a list of named constants delimited by commas (,). One or more blank spaces can precede or follow each value, name, or comma in `value`. If `value` is a list, the return value is the value of the specified names combined with a bitwise `OR` operation. - If `value` is a name that does not correspond to a named constant of `enumType`, the method throws an . If `value` is the string representation of an integer that does not represent an underlying value of the `enumType` enumeration, the method returns an enumeration member whose underlying value is `value` converted to an integral type. If this behavior is undesirable, call the method to ensure that a particular string representation of an integer is actually a member of `enumType`. The following example defines a `Colors` enumeration, calls the method to convert strings to their corresponding enumeration values, and calls the method to ensure that particular integral values are underlying values in the `Colors` enumeration. + If `value` is a name that does not correspond to a named constant of `enumType`, the method throws an . If `value` is the string representation of an integer that does not represent an underlying value of the `enumType` enumeration, the method returns an enumeration member whose underlying value is `value` converted to an integral type. If this behavior is undesirable, call the method to ensure that a particular string representation of an integer is actually a member of `enumType`. The following example defines a `Colors` enumeration, calls the method to convert strings to their corresponding enumeration values, and calls the method to ensure that particular integral values are underlying values in the `Colors` enumeration. :::code language="csharp" source="~/snippets/csharp/System/Enum/Parse/ParseExample1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Enum/Parse/ParseExample1.fs" id="Snippet1"::: @@ -1520,7 +1520,7 @@ This operation is case-sensitive. ## Examples - The following example uses the method to parse an array of strings that are created by calling the method. It also uses the method to parse an enumeration value that consists of a bit field. + The following example uses the method to parse an array of strings that are created by calling the method. It also uses the method to parse an enumeration value that consists of a bit field. :::code language="csharp" source="~/snippets/csharp/System/Enum/Parse/EnumParse.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Enum/Parse/EnumParse.fs" id="Snippet1"::: @@ -1669,12 +1669,12 @@ ## Remarks The `value` parameter contains the string representation of an enumeration member's underlying value or named constant, or a list of named constants delimited by commas (,). One or more blank spaces can precede or follow each value, name, or comma in `value`. If `value` is a list, the return value is the value of the specified names combined with a bitwise `OR` operation. - If `value` is a name that does not correspond to a named constant of `enumType`, the method throws an . If `value` is the string representation of an integer that does not represent an underlying value of the `enumType` enumeration, the method returns an enumeration member whose underlying value is `value` converted to an integral type. If this behavior is undesirable, call the method to ensure that a particular string representation of an integer is actually a member of `enumType`. The following example defines a `Colors` enumeration, calls the method to convert strings to their corresponding enumeration values, and calls the method to ensure that particular integral values are underlying values in the `Colors` enumeration. + If `value` is a name that does not correspond to a named constant of `enumType`, the method throws an . If `value` is the string representation of an integer that does not represent an underlying value of the `enumType` enumeration, the method returns an enumeration member whose underlying value is `value` converted to an integral type. If this behavior is undesirable, call the method to ensure that a particular string representation of an integer is actually a member of `enumType`. The following example defines a `Colors` enumeration, calls the method to convert strings to their corresponding enumeration values, and calls the method to ensure that particular integral values are underlying values in the `Colors` enumeration. The `ignoreCase` parameter specifies whether this operation is case-sensitive. ## Examples - The following example uses the method to parse an array of strings that are created by calling the method. It also uses the method to parse an enumeration value that consists of a bit field. + The following example uses the method to parse an array of strings that are created by calling the method. It also uses the method to parse an enumeration value that consists of a bit field. :::code language="csharp" source="~/snippets/csharp/System/Enum/Parse/ParseExample2.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/Enum/Parse/ParseExample2.fs" id="Snippet2"::: @@ -3079,7 +3079,7 @@ method converts `value` to an enumeration member whose underlying value is `value`. Note that the conversion succeeds even if value is outside the bounds of `enumType` members. To ensure that `value` is a valid underlying value of the `enumType` enumeration, pass it to the method. + The method converts `value` to an enumeration member whose underlying value is `value`. Note that the conversion succeeds even if value is outside the bounds of `enumType` members. To ensure that `value` is a valid underlying value of the `enumType` enumeration, pass it to the method. This conversion method returns a value of type . You can then cast it or convert it to an object of type `enumType`. @@ -3152,7 +3152,7 @@ method converts `value` to an enumeration member whose underlying value is `value`. Note that the conversion succeeds even if value is outside the bounds of `enumType` members. To ensure that `value` is a valid underlying value of the `enumType` enumeration, pass it to the method. + The method converts `value` to an enumeration member whose underlying value is `value`. Note that the conversion succeeds even if value is outside the bounds of `enumType` members. To ensure that `value` is a valid underlying value of the `enumType` enumeration, pass it to the method. This conversion method returns a value of type . You can then cast it or convert it to an object of type `enumType`. @@ -3225,7 +3225,7 @@ method converts `value` to an enumeration member whose underlying value is `value`. Note that the conversion succeeds even if value is outside the bounds of `enumType` members. To ensure that `value` is a valid underlying value of the `enumType` enumeration, pass it to the method. + The method converts `value` to an enumeration member whose underlying value is `value`. Note that the conversion succeeds even if value is outside the bounds of `enumType` members. To ensure that `value` is a valid underlying value of the `enumType` enumeration, pass it to the method. This conversion method returns a value of type . You can then cast it or convert it to an object of type `enumType`. @@ -3298,7 +3298,7 @@ method converts `value` to an enumeration member whose underlying value is `value`. Note that the conversion succeeds even if value is outside the bounds of `enumType` members. To ensure that `value` is a valid underlying value of the `enumType` enumeration, pass it to the method. + The method converts `value` to an enumeration member whose underlying value is `value`. Note that the conversion succeeds even if value is outside the bounds of `enumType` members. To ensure that `value` is a valid underlying value of the `enumType` enumeration, pass it to the method. This conversion method returns a value of type . You can then cast it or convert it to an object of type `enumType`. @@ -3371,7 +3371,7 @@ method converts the integral value `value` to an enumeration member whose underlying value is `value`. Note that the conversion succeeds even if value is outside the bounds of `enumType` members. To ensure that `value` is a valid underlying value of the `enumType` enumeration, pass it to the method. + The method converts the integral value `value` to an enumeration member whose underlying value is `value`. Note that the conversion succeeds even if value is outside the bounds of `enumType` members. To ensure that `value` is a valid underlying value of the `enumType` enumeration, pass it to the method. This conversion method returns a value of type . You can then cast it or convert it to an object of type `enumType`. @@ -3452,7 +3452,7 @@ method converts `value` to an enumeration member whose underlying value is `value`. Note that the conversion succeeds even if value is outside the bounds of `enumType` members. To ensure that `value` is a valid underlying value of the `enumType` enumeration, pass it to the method. + The method converts `value` to an enumeration member whose underlying value is `value`. Note that the conversion succeeds even if value is outside the bounds of `enumType` members. To ensure that `value` is a valid underlying value of the `enumType` enumeration, pass it to the method. This conversion method returns a value of type . You can then cast it or convert it to an object of type `enumType`. @@ -3529,7 +3529,7 @@ method converts `value` to an enumeration member whose underlying value is `value`. Note that the conversion succeeds even if value is outside the bounds of `enumType` members. To ensure that `value` is a valid underlying value of the `enumType` enumeration, pass it to the method. + The method converts `value` to an enumeration member whose underlying value is `value`. Note that the conversion succeeds even if value is outside the bounds of `enumType` members. To ensure that `value` is a valid underlying value of the `enumType` enumeration, pass it to the method. This conversion method returns a value of type . You can then cast it or convert it to an object of type `enumType`. @@ -3606,7 +3606,7 @@ method converts `value` to an enumeration member whose underlying value is `value`. Note that the conversion succeeds even if value is outside the bounds of `enumType` members. To ensure that `value` is a valid underlying value of the `enumType` enumeration, pass it to the method. + The method converts `value` to an enumeration member whose underlying value is `value`. Note that the conversion succeeds even if value is outside the bounds of `enumType` members. To ensure that `value` is a valid underlying value of the `enumType` enumeration, pass it to the method. This conversion method returns a value of type . You can then cast it or convert it to an object of type `enumType`. @@ -3683,7 +3683,7 @@ method converts `value` to an enumeration member whose underlying value is `value`. Note that the conversion succeeds even if value is outside the bounds of `enumType` members. To ensure that `value` is a valid underlying value of the `enumType` enumeration, pass it to the method. + The method converts `value` to an enumeration member whose underlying value is `value`. Note that the conversion succeeds even if value is outside the bounds of `enumType` members. To ensure that `value` is a valid underlying value of the `enumType` enumeration, pass it to the method. This conversion method returns a value of type . You can then cast it or convert it to an object of type `enumType`. @@ -4504,16 +4504,16 @@ ## Remarks - is identical to the method, except that instead of throwing an exception, it returns `false` if the conversion fails. It eliminates the need for exception handling when parsing the string representation of an enumeration value. + is identical to the method, except that instead of throwing an exception, it returns `false` if the conversion fails. It eliminates the need for exception handling when parsing the string representation of an enumeration value. The `value` parameter contains the string representation of an enumeration member's underlying value or named constant, or a list of named constants or underlying values delimited by commas (,). If `value` includes multiple named constants or values, one or more blank spaces can precede or follow each value, name, or comma in `value`. If `value` is a list, `result` reflects the value of the specified names or underlying values combined with a bitwise `OR` operation. If `value` is the string representation of the name of an enumeration value, the comparison of `value` with enumeration names is case-sensitive. -If `value` is a name that does not correspond to a named constant of `TEnum`, the method returns `false`. If `value` is the string representation of an integer that does not represent an underlying value of the `TEnum` enumeration, the method returns an enumeration member whose underlying value is `value` converted to an integral type. If this behavior is undesirable, call the method to ensure that a particular string representation of an integer is actually a member of `TEnum`. +If `value` is a name that does not correspond to a named constant of `TEnum`, the method returns `false`. If `value` is the string representation of an integer that does not represent an underlying value of the `TEnum` enumeration, the method returns an enumeration member whose underlying value is `value` converted to an integral type. If this behavior is undesirable, call the method to ensure that a particular string representation of an integer is actually a member of `TEnum`. If the parse operation fails, the `result` parameter contains the default value of 0, which may not be a member of the underlying `TEnum` enumeration. If no values are assigned to the named constants in `TEnum`, the default is equal to the first member of the `TEnum`. Otherwise, the default is equal to the member in the enumeration with an assigned value of 0. ## Examples - The following example defines a `Colors` enumeration, calls the method to convert strings to their corresponding enumeration values, and calls the method to ensure that particular integral values are underlying values in the `Colors` enumeration. + The following example defines a `Colors` enumeration, calls the method to convert strings to their corresponding enumeration values, and calls the method to ensure that particular integral values are underlying values in the `Colors` enumeration. :::code language="csharp" source="~/snippets/csharp/System/Enum/TryParseTEnum/tryparse1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Enum/TryParseTEnum/tryparse1.fs" id="Snippet1"::: @@ -4666,16 +4666,16 @@ If the parse operation fails, the `result` parameter contains the default value ## Remarks - is identical to the method, except that instead of throwing an exception, it returns `false` if the conversion fails. It eliminates the need for exception handling when parsing the string representation of an enumeration value. + is identical to the method, except that instead of throwing an exception, it returns `false` if the conversion fails. It eliminates the need for exception handling when parsing the string representation of an enumeration value. The `value` parameter contains the string representation of an enumeration member's underlying value or named constant, or a list of named constants or underlying values delimited by commas (,). If `value` includes multiple named constants or values, one or more blank spaces can precede or follow each value, name, or comma in `value`. If `value` is a list, `result` reflects the value of the specified names or underlying values combined with a bitwise `OR` operation. If `value` is the string representation of the name of an enumeration value, the comparison of `value` with enumeration names depends on the `ignoreCase` parameter. If `true`, the comparison is case-insensitive; if `false`, it is case-sensitive. -If `value` is a name that does not correspond to a named constant of `TEnum`, the method returns `false`. If `value` is the string representation of an integer that does not represent an underlying value of the `TEnum` enumeration, the method returns an enumeration member whose underlying value is `value` converted to an integral type. If this behavior is undesirable, call the method to ensure that a particular string representation of an integer is actually a member of `TEnum`. +If `value` is a name that does not correspond to a named constant of `TEnum`, the method returns `false`. If `value` is the string representation of an integer that does not represent an underlying value of the `TEnum` enumeration, the method returns an enumeration member whose underlying value is `value` converted to an integral type. If this behavior is undesirable, call the method to ensure that a particular string representation of an integer is actually a member of `TEnum`. If the parse operation fails, the `result` parameter contains the default value of 0, which may not be a member of the underlying `TEnum` enumeration. If no values are assigned to the named constants in `TEnum`, the default is equal to the first member of the `TEnum`. Otherwise, the default is equal to the member in the enumeration with an assigned value of 0. ## Examples - The following example defines a `Colors` enumeration, calls the method to convert strings to their corresponding enumeration values, and calls the method to ensure that particular integral values are underlying values in the `Colors` enumeration. The method uses case-insensitive comparison when trying to convert the string representations of named constants to their equivalent enumeration values. + The following example defines a `Colors` enumeration, calls the method to convert strings to their corresponding enumeration values, and calls the method to ensure that particular integral values are underlying values in the `Colors` enumeration. The method uses case-insensitive comparison when trying to convert the string representations of named constants to their equivalent enumeration values. :::code language="csharp" source="~/snippets/csharp/System/Enum/TryParseTEnum/tryparse2.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/Enum/TryParseTEnum/tryparse2.fs" id="Snippet2"::: diff --git a/xml/System/Environment+SpecialFolder.xml b/xml/System/Environment+SpecialFolder.xml index 5719c93136c..31a6ebabb3d 100644 --- a/xml/System/Environment+SpecialFolder.xml +++ b/xml/System/Environment+SpecialFolder.xml @@ -66,15 +66,15 @@ ## Remarks The system special folders are folders such as **Program Files**, **Programs**, **System**, or **Startup**, which contain common information. Special folders are set by default by the system, or explicitly by the user, when installing a version of Windows. - The method returns the locations associated with this enumeration. The locations of these folders can have different values on different operating systems, the user can change some of the locations, and the locations are localized. + The method returns the locations associated with this enumeration. The locations of these folders can have different values on different operating systems, the user can change some of the locations, and the locations are localized. For more information about special folders, see the [KNOWNFOLDERID](/windows/desktop/shell/knownfolderid) constants in the Windows documentation. ## Examples - The following example shows how to use with the method to get the System directory. - + The following example shows how to use with the method to get the System directory. + :::code language="csharp" source="~/snippets/csharp/System/Environment+SpecialFolder/Overview/getfolderpath.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Environment+SpecialFolder/Overview/getfolderpath.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/Environment+SpecialFolder/Overview/getfolderpath.vb" id="Snippet1"::: diff --git a/xml/System/Environment+SpecialFolderOption.xml b/xml/System/Environment+SpecialFolderOption.xml index 25594eddb61..de3e4004371 100644 --- a/xml/System/Environment+SpecialFolderOption.xml +++ b/xml/System/Environment+SpecialFolderOption.xml @@ -53,11 +53,11 @@ Specifies options to use for getting the path to a special folder. - enumeration is used to define the precise behavior of the method. - + enumeration is used to define the precise behavior of the method. + ]]> diff --git a/xml/System/Environment.xml b/xml/System/Environment.xml index 933727dbc4a..9da8fdd8dfe 100644 --- a/xml/System/Environment.xml +++ b/xml/System/Environment.xml @@ -144,7 +144,7 @@ ## Remarks This property provides access to the program name and any arguments specified on the command line when the current process was started. - The program name can include path information, but is not required to do so. Use the method to retrieve the command-line information parsed and stored in an array of strings. + The program name can include path information, but is not required to do so. Use the method to retrieve the command-line information parsed and stored in an array of strings. The maximum size of the command-line buffer is not set to a specific number of characters; it varies depending on the Windows operating system that is running on the computer. @@ -394,17 +394,17 @@ ## Remarks For the `exitCode` parameter, use a non-zero number to indicate an error. In your application, you can define your own error codes in an enumeration, and return the appropriate error code based on the scenario. For example, return a value of 1 to indicate that the required file is not present, and a value of 2 to indicate that the file is in the wrong format. For a list of exit codes used by the Windows operating system, see [System Error Codes](/windows/win32/debug/system-error-codes) in the Windows documentation. - Calling the method differs from using your programming language's `return` statement in the following ways: + Calling the method differs from using your programming language's `return` statement in the following ways: -- always terminates an application. Using the `return` statement may terminate an application only if it is used in the application entry point, such as in the `Main` method. +- always terminates an application. Using the `return` statement may terminate an application only if it is used in the application entry point, such as in the `Main` method. -- terminates an application immediately, even if other threads are running. If the `return` statement is called in the application entry point, it causes an application to terminate only after all foreground threads have terminated. +- terminates an application immediately, even if other threads are running. If the `return` statement is called in the application entry point, it causes an application to terminate only after all foreground threads have terminated. -- requires the caller to have permission to call unmanaged code. The `return` statement does not. +- requires the caller to have permission to call unmanaged code. The `return` statement does not. -- If is called from a `try` or `catch` block, the code in any `finally` block does not execute. If the `return` statement is used, the code in the `finally` block does execute. +- If is called from a `try` or `catch` block, the code in any `finally` block does not execute. If the `return` statement is used, the code in the `finally` block does execute. -- If is called when code in a [constrained execution region](/dotnet/framework/performance/constrained-execution-regions) (CER) is running, the CER will not complete execution. If the `return` statement is used, the CER completes execution. +- If is called when code in a [constrained execution region](/dotnet/framework/performance/constrained-execution-regions) (CER) is running, the CER will not complete execution. If the `return` statement is used, the CER completes execution. ]]> @@ -590,7 +590,7 @@ Invalid argument method. + COM interop is used to retrieve the environment variables from the operating system. If the environment variables cannot be retrieved due to a COM error, the HRESULT that explains the cause of the failure is used to generate one of several possible exceptions; that is, the exception depends on the HRESULT. For more information about how the HRESULT is processed, see the Remarks section of the method. Replacement only occurs for environment variables that are set. For example, suppose `name` is "MyENV = %MyENV%". If the environment variable, MyENV, is set to 42, this method returns "MyENV = 42". If MyENV is not set, no change occurs; this method returns "MyENV = %MyENV%". @@ -689,7 +689,7 @@ Invalid argument On Unix-like systems, the message is written to the standard error stream, alongside the stack trace information. - Use the `Environment.FailFast` method instead of the method to terminate your application if the state of your application is damaged beyond repair, and executing your application's `try`/`finally` blocks and finalizers will corrupt program resources. + Use the `Environment.FailFast` method instead of the method to terminate your application if the state of your application is damaged beyond repair, and executing your application's `try`/`finally` blocks and finalizers will corrupt program resources. Calling the `Environment.FailFast` method to terminate execution of an application running in the Visual Studio debugger throws an and automatically triggers the [fatalExecutionEngineError managed debugging assistant (MDA)](/dotnet/framework/debug-trace-profile/fatalexecutionengineerror-mda). @@ -775,9 +775,9 @@ Calling the `Environment.FailFast` method to terminate execution of an applicati On Unix-like systems, the message is written to the standard error stream, alongside the stack trace information. - If `exception` is `null`, or if `exception` is not thrown, this method operates the same as the method overload. + If `exception` is `null`, or if `exception` is not thrown, this method operates the same as the method overload. - Use the `Environment.FailFast` method instead of the method to terminate your application if the state of your application is damaged beyond repair, and executing your application's `try`/`finally` blocks and finalizers will corrupt program resources. + Use the `Environment.FailFast` method instead of the method to terminate your application if the state of your application is damaged beyond repair, and executing your application's `try`/`finally` blocks and finalizers will corrupt program resources. Calling the `Environment.FailFast` method to terminate execution of an application running in the Visual Studio debugger throws an and automatically triggers the [fatalExecutionEngineError managed debugging assistant (MDA)](/dotnet/framework/debug-trace-profile/fatalexecutionengineerror-mda). @@ -944,13 +944,13 @@ In .NET 5 and later versions, for single-file publishing, the first element is t For more information about this API, see Supplemental API remarks for Environment.GetEnvironmentVariable. method to retrieve the `windir` environment variable, which contains the path of the Windows directory. +The following example uses the method to retrieve the `windir` environment variable, which contains the path of the Windows directory. :::code language="csharp" source="~/snippets/csharp/System/Environment/CurrentDirectory/Vars1.cs" id="Snippet4"::: :::code language="fsharp" source="~/snippets/fsharp/System/Environment/CurrentDirectory/Vars1.fs" id="Snippet4"::: :::code language="vb" source="~/snippets/visualbasic/System/Environment/CurrentDirectory/Vars1.vb" id="Snippet4"::: -The following example attempts to retrieve the value of an environment variable named `Test1` from the process environment block. If the variable doesn't exist, the example creates it and retrieves its value. The example displays the value of the variable. If the example created the variable, it also calls the method with each member of the enumeration to establish that the variable can be retrieved only from the current process environment block. Finally, if the example created the variable, it deletes it. +The following example attempts to retrieve the value of an environment variable named `Test1` from the process environment block. If the variable doesn't exist, the example creates it and retrieves its value. The example displays the value of the variable. If the example created the variable, it also calls the method with each member of the enumeration to establish that the variable can be retrieved only from the current process environment block. Finally, if the example created the variable, it deletes it. :::code language="csharp" source="~/snippets/csharp/System/Environment/GetEnvironmentVariable/getenvironmentvariableex1.cs"::: :::code language="fsharp" source="~/snippets/fsharp/System/Environment/GetEnvironmentVariable/getenvironmentvariableex1.fs"::: @@ -1120,7 +1120,7 @@ On Windows systems, the `GetEnvironmentVariables` method returns the following e - All per-machine environment variables that are defined at the time the process is created, along with their values. - All per-user environment variables that are defined at the time the process is created, along with their values. -- Any variables inherited from the parent process from which the .NET application was launched or added to the process block while the process is running. Environment variables are added while the process is running by calling either the method or the method with a `target` value of . +- Any variables inherited from the parent process from which the .NET application was launched or added to the process block while the process is running. Environment variables are added while the process is running by calling either the method or the method with a `target` value of . ### On Unix-like systems @@ -1133,7 +1133,7 @@ On Unix-like systems, the `GetEnvironmentVariables` method retrieves the name an ## Examples -The following example demonstrates the method. +The following example demonstrates the method. :::code language="csharp" source="~/snippets/csharp/System/Environment/GetEnvironmentVariables/getenvironmentvariables.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Environment/GetEnvironmentVariables/getenvironmentvariables.fs" id="Snippet1"::: @@ -1309,7 +1309,7 @@ The following example creates environment variables for the method to return and display the path associated with the `folder` parameter. + The following example demonstrates how to use the method to return and display the path associated with the `folder` parameter. :::code language="csharp" source="~/snippets/csharp/System/Environment+SpecialFolder/Overview/getfolderpath.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Environment+SpecialFolder/Overview/getfolderpath.fs" id="Snippet1"::: @@ -1455,7 +1455,7 @@ The following example creates environment variables for the :\\" (for example, "C:\\"). On Unix, it returns the paths of all filesystem mount points mounted on a particular machine (for example, "/home/user", "/media/usb"). ## Examples - The following example shows how to display the logical drives of the current computer using the method. + The following example shows how to display the logical drives of the current computer using the method. :::code language="csharp" source="~/snippets/csharp/System/Environment/GetLogicalDrives/getlogicaldrives.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Environment/GetLogicalDrives/getlogicaldrives.fs" id="Snippet1"::: @@ -1523,7 +1523,7 @@ The following example creates environment variables for the property returns `true` only after the finalizer thread has been started. When the property returns `true`, you can determine whether an application domain is being unloaded or the CLR itself is shutting down by calling the method. This method returns `true` if finalizers are called because the application domain is unloading or `false` if the CLR is shutting down. + **.NET Framework only**: When the CLR unloads an application domain, it runs the finalizers on all objects that have a finalizer method in that application domain. When the CLR shuts down, it starts the finalizer thread on all objects that have a finalizer method. The property returns `true` only after the finalizer thread has been started. When the property returns `true`, you can determine whether an application domain is being unloaded or the CLR itself is shutting down by calling the method. This method returns `true` if finalizers are called because the application domain is unloading or `false` if the CLR is shutting down. The property returns `false` if the finalizer thread has not been started. @@ -1778,13 +1778,13 @@ The following example creates environment variables for the is a constant customized specifically for the current platform and implementation of the .NET Framework. For more information about the escape characters in the property value, see [Character Escapes](/dotnet/standard/base-types/character-escapes-in-regular-expressions). + The property value of is a constant customized specifically for the current platform and implementation of the .NET Framework. For more information about the escape characters in the property value, see [Character Escapes](/dotnet/standard/base-types/character-escapes-in-regular-expressions). - The functionality provided by is often what is meant by the terms newline, line feed, line break, carriage return, CRLF, and end of line. + The functionality provided by is often what is meant by the terms newline, line feed, line break, carriage return, CRLF, and end of line. - can be used in conjunction with language-specific newline support such as the escape characters '\r' and '\n' in Microsoft C# and C/C++, or `vbCrLf` in Microsoft Visual Basic. + can be used in conjunction with language-specific newline support such as the escape characters '\r' and '\n' in Microsoft C# and C/C++, or `vbCrLf` in Microsoft Visual Basic. - is automatically appended to text processed by the and methods. + is automatically appended to text processed by the and methods. ## Examples The following example displays two lines separated by a newline. @@ -1854,7 +1854,7 @@ The following example creates environment variables for the returns the actual OS version in compatibility modes specified by the [application manifest](/windows/win32/sysinfo/targeting-your-application-at-windows-8-1). For more information, see [Environment.OSVersion returns the correct operating system version](/dotnet/core/compatibility/core-libraries/5.0/environment-osversion-returns-correct-version). -To identify the operating system platform, for example, Linux or Windows, you can use the method. +To identify the operating system platform, for example, Linux or Windows, you can use the method. ]]> @@ -2102,9 +2102,9 @@ If the executable is renamed or deleted before this property is first accessed, ## Remarks - Calling this method is equivalent to calling the overload with a value of for the `target` argument. + Calling this method is equivalent to calling the overload with a value of for the `target` argument. - On Unix-like systems, calls to the method have no effect on any native libraries that are, or will be, loaded. (Conversely, in-process environment modifications made by native libraries aren't seen by managed callers.) + On Unix-like systems, calls to the method have no effect on any native libraries that are, or will be, loaded. (Conversely, in-process environment modifications made by native libraries aren't seen by managed callers.) If the `value` argument is not `null` and the environment variable named by the `variable` parameter doesn't exist, the environment variable is created and assigned the contents of `value`. If it does exist, its value is modified. Because the environment variable is defined in the environment block of the current process only, it does not persist after the process has ended. @@ -2119,7 +2119,7 @@ If the executable is renamed or deleted before this property is first accessed, ## Examples -The following example attempts to retrieve the value of an environment variable named `Test1` from the process environment block. If the variable doesn't exist, the example creates the variable and retrieves its value. The example displays the value of the variable. For .NET implementations running on Windows systems, it also calls the method with each member of the enumeration to establish that the variable can be retrieved only from the current process environment block. (.NET implementations on Unix-like systems only support variables in the process environment block.) Finally, if the example created the variable, it deletes it. +The following example attempts to retrieve the value of an environment variable named `Test1` from the process environment block. If the variable doesn't exist, the example creates the variable and retrieves its value. The example displays the value of the variable. For .NET implementations running on Windows systems, it also calls the method with each member of the enumeration to establish that the variable can be retrieved only from the current process environment block. (.NET implementations on Unix-like systems only support variables in the process environment block.) Finally, if the example created the variable, it deletes it. :::code language="csharp" source="~/snippets/csharp/System/Environment/GetEnvironmentVariable/getenvironmentvariableex1.cs"::: :::code language="fsharp" source="~/snippets/fsharp/System/Environment/GetEnvironmentVariable/getenvironmentvariableex1.fs"::: @@ -2211,13 +2211,13 @@ The following example attempts to retrieve the value of an environment variable ## Remarks -The method lets you define an environment variable that is available to the current process (the value). Environment variables that are unique to the current process environment block persist only until the process ends. +The method lets you define an environment variable that is available to the current process (the value). Environment variables that are unique to the current process environment block persist only until the process ends. -In addition, on Windows systems only, the method lets you define an environment variable that is available to all processes that run on a machine (the value) and to all processes run by a user (the value). Per-machine and per-user environment variables are copied into the environment block of the current process. +In addition, on Windows systems only, the method lets you define an environment variable that is available to all processes that run on a machine (the value) and to all processes run by a user (the value). Per-machine and per-user environment variables are copied into the environment block of the current process. -On Unix-like systems, calls to the method with a value of or are ignored. +On Unix-like systems, calls to the method with a value of or are ignored. -On Unix-like systems, calls to the method with a value of have no effect on any native libraries that are, or will be, loaded. (Conversely, in-process environment modifications made by native libraries aren't seen by managed callers.) +On Unix-like systems, calls to the method with a value of have no effect on any native libraries that are, or will be, loaded. (Conversely, in-process environment modifications made by native libraries aren't seen by managed callers.) If the `value` argument is not `null` and the environment variable named by the `variable` argument doesn't exist, the environment variable is created and assigned the contents of `value`. If it does exist, its value is modified. @@ -2362,7 +2362,7 @@ The following example creates environment variables for the string terminates each line of the stack trace. + The string terminates each line of the stack trace. ## Examples The following example demonstrates the property. diff --git a/xml/System/EnvironmentVariableTarget.xml b/xml/System/EnvironmentVariableTarget.xml index 849a3d10a7c..d79b2e6d566 100644 --- a/xml/System/EnvironmentVariableTarget.xml +++ b/xml/System/EnvironmentVariableTarget.xml @@ -60,38 +60,38 @@ Specifies the location where an environment variable is stored or retrieved in a set or get operation. - enumeration is used by certain overloads of the , , and methods to specify the location, or target, where the name and value of an environment variable is stored or retrieved. - -The target can be one of three locations: - +The enumeration is used by certain overloads of the , , and methods to specify the location, or target, where the name and value of an environment variable is stored or retrieved. + +The target can be one of three locations: + - The environment block associated with the current process (`EnvironmentVariableTarget.Process`). The user creates the environment variable in a set operation. When the process terminates, the operating system destroys the environment variable in that process. - The Windows operating system registry key reserved for environment variables associated with the current user (`EnvironmentVariableTarget.User`). - - On Windows systems, when the user creates the environment variable in a set operation, the operating system stores the environment variable in the system registry, but not in the current process. If the user starts a new process, the operating system copies the environment variable from the registry to that process. When the process terminates, the operating system destroys the environment variable in that process. However, the environment variable in the registry persists until the user removes it programmatically or by means of an operating system tool. + + On Windows systems, when the user creates the environment variable in a set operation, the operating system stores the environment variable in the system registry, but not in the current process. If the user starts a new process, the operating system copies the environment variable from the registry to that process. When the process terminates, the operating system destroys the environment variable in that process. However, the environment variable in the registry persists until the user removes it programmatically or by means of an operating system tool. On Unix-based systems, an attempt to create an enviroment variable with `EnvironmentVariable.User` has no effect, and an attempt to retrieve an enviroment variable using `EnvironmentVariable.User` returns `null` (in C#) or `Nothing` (in Visual Basic). -- The registry key reserved for environment variables associated with all users on the local machine (`EnvironmentVariableTarget.Machine`). +- The registry key reserved for environment variables associated with all users on the local machine (`EnvironmentVariableTarget.Machine`). When a user creates the environment variable in a set operation, the operating system stores the environment variable in the system registry, but not in the current process. If any user on the local machine starts a new process, the operating system copies the environment variable from the registry to that process. When the process terminates, the operating system destroys the environment variable in that process. However, the environment variable in the registry persists until a user removes it programmatically or by means of an operating system tool. On Unix-based systems, an attempt to create an enviroment variable with `EnvironmentVariable.Machine` has no effect, and an attempt to retrieve an enviroment variable using `EnvironmentVariable.Machine` returns `null` (in C#) or `Nothing` (in Visual Basic). -## Examples +## Examples + +The following example uses the enumeration in methods that create, retrieve, and delete environment variables. The output from the example shows that environmnent variables stored and retrieved without specifying a `EnvironmentVariableTarget` value are stored in the environment block associated with the current process (`EnvironmentVariableTarget.Process`). The example output from Unix-based systems also shows that attempts to define an environment variable with a value other than `EnvironmentVariableTarget.Process` is ignored. -The following example uses the enumeration in methods that create, retrieve, and delete environment variables. The output from the example shows that environmnent variables stored and retrieved without specifying a `EnvironmentVariableTarget` value are stored in the environment block associated with the current process (`EnvironmentVariableTarget.Process`). The example output from Unix-based systems also shows that attempts to define an environment variable with a value other than `EnvironmentVariableTarget.Process` is ignored. - :::code language="csharp" source="~/snippets/csharp/System/Environment/GetEnvironmentVariable/gsev.cs"::: :::code language="fsharp" source="~/snippets/fsharp/System/Environment/GetEnvironmentVariable/gsev.fs"::: -:::code language="vb" source="~/snippets/visualbasic/System/Environment/GetEnvironmentVariables/gsev.vb"::: - +:::code language="vb" source="~/snippets/visualbasic/System/Environment/GetEnvironmentVariables/gsev.vb"::: + ]]> diff --git a/xml/System/Exception.xml b/xml/System/Exception.xml index 487b043924b..6be3534212f 100644 --- a/xml/System/Exception.xml +++ b/xml/System/Exception.xml @@ -162,8 +162,8 @@ |Property|Value| |--------------|-----------| -||A null reference (`Nothing` in Visual Basic).| -||A system-supplied localized description.| +||A null reference (`Nothing` in Visual Basic).| +||A system-supplied localized description.| @@ -226,14 +226,14 @@ property of the new instance by using the `message` parameter. If the `message` parameter is `null`, this is the same as calling the constructor. + This constructor initializes the property of the new instance by using the `message` parameter. If the `message` parameter is `null`, this is the same as calling the constructor. The following table shows the initial property values for an instance of . |Property|Value| |--------------|-----------| -||A null reference (`Nothing` in Visual Basic).| -||The error message string.| +||A null reference (`Nothing` in Visual Basic).| +||The error message string.| @@ -384,8 +384,8 @@ |Property|Value| |--------------|-----------| -||The inner exception reference.| -||The error message string.| +||The inner exception reference.| +||The error message string.| @@ -670,7 +670,7 @@ The following example demonstrates how to add and retrieve information using the method exists to support the .NET Framework infrastructure, and internally invokes the fundamental method, . + The method exists to support the .NET Framework infrastructure, and internally invokes the fundamental method, . ]]> @@ -954,7 +954,7 @@ Error messages target the developer who is handling the exception. The text of t > [!IMPORTANT] > Do not disclose sensitive information in exception messages without checking for the appropriate permissions. -The value of the property is included in the information returned by . The property is set only when creating an . If no message was supplied to the constructor for the current instance, the system supplies a default message that is formatted using the current system culture. +The value of the property is included in the information returned by . The property is set only when creating an . If no message was supplied to the constructor for the current instance, the system supplies a default message that is formatted using the current system culture. ## Examples @@ -1028,13 +1028,13 @@ The following code example throws and then catches an ex ## Remarks The exception state object implements the interface. - When the event is subscribed to, the exception is deserialized and created as an empty exception. The exception's constructor is not run, and the exception state is also deserialized. The callback method of the exception state object is then notified so that it can push deserialized data into the empty exception. + When the event is subscribed to, the exception is deserialized and created as an empty exception. The exception's constructor is not run, and the exception state is also deserialized. The callback method of the exception state object is then notified so that it can push deserialized data into the empty exception. The event enables transparent exception types to serialize and deserialize exception data. Transparent code can execute commands within the bounds of the permission set it is operating within, but cannot execute, call, derive from, or contain critical code. - If the event is not subscribed to, deserialization occurs as usual using the constructor. + If the event is not subscribed to, deserialization occurs as usual using the constructor. - Typically, a handler for the event is added in the exception's constructor to provide for its serialization. But because the constructor is not executed when the event handler executes, serializing a deserialized exception can throw a exception when you try to deserialize the exception. To avoid this, you should also add the handler for the event in the method. See the Examples section for an illustration. + Typically, a handler for the event is added in the exception's constructor to provide for its serialization. But because the constructor is not executed when the event handler executes, serializing a deserialized exception can throw a exception when you try to deserialize the exception. To avoid this, you should also add the handler for the event in the method. See the Examples section for an illustration. ]]> @@ -1175,7 +1175,7 @@ The following code example throws and then catches an ex ## Remarks The execution stack keeps track of all the methods that are in execution at a given instant. A trace of the method calls is called a stack trace. The stack trace listing provides a way to follow the call stack to the line number in the method where the exception occurs. - The property returns the frames of the call stack that originate at the location where the exception was thrown. You can obtain information about additional frames in the call stack by creating a new instance of the class and using its method. + The property returns the frames of the call stack that originate at the location where the exception was thrown. You can obtain information about additional frames in the call stack by creating a new instance of the class and using its method. The common language runtime (CLR) updates the stack trace whenever an exception is thrown in application code (by using the `throw` keyword). If the exception was rethrown in a method that is different than the method where it was originally thrown, the stack trace contains both the location in the method where the exception was originally thrown, and the location in the method where the exception was rethrown. If the exception is thrown, and later rethrown, in the same method, the stack trace only contains the location where the exception was rethrown and does not include the location where the exception was originally thrown. @@ -1257,7 +1257,7 @@ The following code example throws and then catches an ex obtains the method from the stack trace. If the stack trace is a null reference, also returns a null reference. + If the method that throws this exception is not available and the stack trace is not a null reference (`Nothing` in Visual Basic), obtains the method from the stack trace. If the stack trace is a null reference, also returns a null reference. > [!NOTE] > The property may not accurately report the name of the method in which an exception was thrown if the exception handler handles an exception across application domain boundaries. @@ -1332,18 +1332,18 @@ The following code example throws and then catches an ex returns a representation of the current exception that is intended to be understood by humans. Where the exception contains culture-sensitive data, the string representation returned by `ToString` is required to take into account the current system culture. Although there are no exact requirements for the format of the returned string, it should attempt to reflect the value of the object as perceived by the user. + returns a representation of the current exception that is intended to be understood by humans. Where the exception contains culture-sensitive data, the string representation returned by `ToString` is required to take into account the current system culture. Although there are no exact requirements for the format of the returned string, it should attempt to reflect the value of the object as perceived by the user. - The default implementation of obtains the name of the class that threw the current exception, the message, the result of calling on the inner exception, and the result of calling . If any of these members is `null`, its value is not included in the returned string. + The default implementation of obtains the name of the class that threw the current exception, the message, the result of calling on the inner exception, and the result of calling . If any of these members is `null`, its value is not included in the returned string. If there is no error message or if it is an empty string (""), then no error message is returned. The name of the inner exception and the stack trace are returned only if they are not `null`. - This method overrides . + This method overrides . ## Examples - The following example causes an exception and displays the result of calling on that exception. Note that the method is called implicitly when the Exception class instance appears in the argument list of the method. + The following example causes an exception and displays the result of calling on that exception. Note that the method is called implicitly when the Exception class instance appears in the argument list of the method. :::code language="csharp" source="~/snippets/csharp/System/Exception/ToString/ToStringEx1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Exception/ToString/ToStringEx1.fs" id="Snippet1"::: diff --git a/xml/System/ExecutionEngineException.xml b/xml/System/ExecutionEngineException.xml index d0b5e0d4a23..561d8298f2f 100644 --- a/xml/System/ExecutionEngineException.xml +++ b/xml/System/ExecutionEngineException.xml @@ -72,7 +72,7 @@ . If further execution of your application cannot be sustained, use the method. + There is no non-obsolete alternative to . If further execution of your application cannot be sustained, use the method. ]]> @@ -134,8 +134,8 @@ |Property|Value| |--------------|-----------| -||A null reference (`Nothing` in Visual Basic).| -||The localized error message string.| +||A null reference (`Nothing` in Visual Basic).| +||The localized error message string.| ]]> @@ -191,8 +191,8 @@ |Property|Value| |--------------|-----------| -||A null reference (`Nothing` in Visual Basic).| -||The error message string.| +||A null reference (`Nothing` in Visual Basic).| +||The error message string.| ]]> @@ -250,8 +250,8 @@ |Property|Value| |--------------|-----------| -||The inner exception reference.| -||The error message string.| +||The inner exception reference.| +||The error message string.| ]]> diff --git a/xml/System/FieldAccessException.xml b/xml/System/FieldAccessException.xml index 82465e34c25..93d32d46a83 100644 --- a/xml/System/FieldAccessException.xml +++ b/xml/System/FieldAccessException.xml @@ -71,7 +71,7 @@ uses the HRESULT COR_E_FIELDACCESS, which has the value 0x80131507. - For a list of initial property values for an instance of , see the constructors. + For a list of initial property values for an instance of , see the constructors. > [!NOTE] > This exception is not included in the [.NET for Windows Store apps](https://go.microsoft.com/fwlink/?LinkID=247912) or the [Portable Class Library](/dotnet/standard/cross-platform/cross-platform-development-with-the-portable-class-library), but it is thrown by some members that are. To catch the exception in that case, write a `catch` statement for instead. @@ -140,8 +140,8 @@ |Property|Value| |--------------|-----------| -||A null reference (`Nothing` in Visual Basic).| -||The localized error message string.| +||A null reference (`Nothing` in Visual Basic).| +||The localized error message string.| ]]> @@ -199,8 +199,8 @@ |Property|Value| |--------------|-----------| -||A null reference (`Nothing` in Visual Basic).| -||The localized error message string.| +||A null reference (`Nothing` in Visual Basic).| +||The localized error message string.| ]]> @@ -325,8 +325,8 @@ |Property|Value| |--------------|-----------| -||The inner exception reference.| -||The localized error message string.| +||The inner exception reference.| +||The localized error message string.| ]]> diff --git a/xml/System/FileStyleUriParser.xml b/xml/System/FileStyleUriParser.xml index 6f2ab54242b..0858b7df655 100644 --- a/xml/System/FileStyleUriParser.xml +++ b/xml/System/FileStyleUriParser.xml @@ -82,11 +82,11 @@ Creates a customizable parser based on the File scheme. - - + + ]]> diff --git a/xml/System/FlagsAttribute.xml b/xml/System/FlagsAttribute.xml index 953963574d9..e673c58e1e3 100644 --- a/xml/System/FlagsAttribute.xml +++ b/xml/System/FlagsAttribute.xml @@ -111,13 +111,13 @@ method to display the types of service provided to each household. + The following example defines a `PhoneService` enumeration that represents forms of communication provided by a telephone company. It initializes three variables representing the service provided to three different households, and then indicates which households have no service, which households have only cell phone service, and which households have both cell phone and land line service. Finally, it implicitly calls the method to display the types of service provided to each household. :::code language="csharp" source="~/snippets/csharp/System/FlagsAttribute/Overview/flags1.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/FlagsAttribute/Overview/flags1.fs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System/FlagsAttribute/.ctor/flags1.vb" id="Snippet2"::: - The following example illustrates the use of the `FlagsAttribute` attribute and shows the effect on the method of using `FlagsAttribute` on an declaration. + The following example illustrates the use of the `FlagsAttribute` attribute and shows the effect on the method of using `FlagsAttribute` on an declaration. :::code language="csharp" source="~/snippets/csharp/System/FlagsAttribute/Overview/flags.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/FlagsAttribute/Overview/flags.fs" id="Snippet1"::: diff --git a/xml/System/FormatException.xml b/xml/System/FormatException.xml index 4a30fe3e320..12297a75ae2 100644 --- a/xml/System/FormatException.xml +++ b/xml/System/FormatException.xml @@ -83,13 +83,13 @@ The conversion of a string to the following types in the namespace can throw a exception: - - . The and methods require the string to be converted to be "True", "true", "False", or "false". Any other value throws a exception. + - . The and methods require the string to be converted to be "True", "true", "False", or "false". Any other value throws a exception. - - and . All date and time data is interpreted based on the formatting conventions of a particular culture: either the current culture (or, in some cases, the current application domain culture), the invariant culture, or a specified culture. When you call the and methods, date and time data must also conform *exactly* to a pattern specified by one or more [standard format strings](/dotnet/standard/base-types/standard-date-and-time-format-strings) or [custom format strings](/dotnet/standard/base-types/custom-date-and-time-format-strings) that are provided as arguments in the method call. If it doesn't conform to an expected culture-specific pattern, a exception is thrown. This means that date and time data saved in a culture-specific format on one system might not parse successfully on another system. + - and . All date and time data is interpreted based on the formatting conventions of a particular culture: either the current culture (or, in some cases, the current application domain culture), the invariant culture, or a specified culture. When you call the and methods, date and time data must also conform *exactly* to a pattern specified by one or more [standard format strings](/dotnet/standard/base-types/standard-date-and-time-format-strings) or [custom format strings](/dotnet/standard/base-types/custom-date-and-time-format-strings) that are provided as arguments in the method call. If it doesn't conform to an expected culture-specific pattern, a exception is thrown. This means that date and time data saved in a culture-specific format on one system might not parse successfully on another system. For more information about parsing dates and times, see [Parsing Date and Time Strings](/dotnet/standard/base-types/parsing-datetime) and the documentation for the method that threw the exception. - - **GUIDs.** The string representation of a GUID must consist of 32 hexadecimal digits (0-F), and must be in one of the five formats output by the method. For more information, see the method. + - **GUIDs.** The string representation of a GUID must consist of 32 hexadecimal digits (0-F), and must be in one of the five formats output by the method. For more information, see the method. - **Numeric types, including all signed integers, unsigned integers, and floating-point types.** The string to be parsed must consist of the Latin digits 0-9. A positive or negative sign, decimal separator, group separators, and currency symbol may also be permitted. Trying to parse a string that contains any other character always throws a exception. @@ -111,13 +111,13 @@ :::code language="fsharp" source="~/snippets/fsharp/System/FormatException/Overview/iformattable2.fs" id="Snippet8"::: :::code language="vb" source="~/snippets/visualbasic/System/FormatException/Overview/iformattable2.vb" id="Snippet8"::: - A exception can also be thrown by parsing methods, such as and , that require the string to be parsed to conform exactly to the pattern specified by a format string. In the following example, the string representation of a GUID is expected to conform to the pattern specified by the "G" standard format string. However, the structure's implementation of does not support the "G" format string. + A exception can also be thrown by parsing methods, such as and , that require the string to be parsed to conform exactly to the pattern specified by a format string. In the following example, the string representation of a GUID is expected to conform to the pattern specified by the "G" standard format string. However, the structure's implementation of does not support the "G" format string. :::code language="csharp" source="~/snippets/csharp/System/FormatException/Overview/iformattable3.cs" id="Snippet9"::: :::code language="fsharp" source="~/snippets/fsharp/System/FormatException/Overview/iformattable3.fs" id="Snippet9"::: :::code language="vb" source="~/snippets/visualbasic/System/FormatException/Overview/iformattable3.vb" id="Snippet9"::: - This exception also results from a coding error. To correct it, call a parsing method that doesn't require a precise format, such as or , or substitute a valid format string. The following example corrects the error by calling the method. + This exception also results from a coding error. To correct it, call a parsing method that doesn't require a precise format, such as or , or substitute a valid format string. The following example corrects the error by calling the method. :::code language="csharp" source="~/snippets/csharp/System/FormatException/Overview/iformattable4.cs" id="Snippet10"::: :::code language="fsharp" source="~/snippets/fsharp/System/FormatException/Overview/iformattable4.fs" id="Snippet10"::: @@ -149,7 +149,7 @@ :::code language="fsharp" source="~/snippets/fsharp/System/FormatException/Overview/qa3.fs" id="Snippet24"::: :::code language="vb" source="~/snippets/visualbasic/System/FormatException/Overview/qa3.vb" id="Snippet24"::: - The exception is also thrown if your format string contains a typo. The following call to the method omits a closing brace and pairs an opening brace with a closing bracket. + The exception is also thrown if your format string contains a typo. The following call to the method omits a closing brace and pairs an opening brace with a closing bracket. :::code language="csharp" source="~/snippets/csharp/System/FormatException/Overview/example3.cs" id="Snippet3"::: :::code language="fsharp" source="~/snippets/fsharp/System/FormatException/Overview/example3.fs" id="Snippet3"::: @@ -161,7 +161,7 @@ :::code language="fsharp" source="~/snippets/fsharp/System/FormatException/Overview/example3.fs" id="Snippet4"::: :::code language="vb" source="~/snippets/visualbasic/System/FormatException/Overview/example3.vb" id="Snippet4"::: -- You've supplied the object list in a composite formatting method as a strongly typed parameter array, and the exception indicates that the index of one or more format items exceeds the number of arguments in the object list. This occurs because no explicit conversion between array types exists, so instead the compiler treats the array as a single argument rather than as a parameter array. For example, the following call to the method throws a exception, although the highest index of the format items is 3, and the parameter array of type has four elements. +- You've supplied the object list in a composite formatting method as a strongly typed parameter array, and the exception indicates that the index of one or more format items exceeds the number of arguments in the object list. This occurs because no explicit conversion between array types exists, so instead the compiler treats the array as a single argument rather than as a parameter array. For example, the following call to the method throws a exception, although the highest index of the format items is 3, and the parameter array of type has four elements. :::code language="csharp" source="~/snippets/csharp/System/FormatException/Overview/qa1.cs" id="Snippet5"::: :::code language="fsharp" source="~/snippets/fsharp/System/FormatException/Overview/qa1.fs" id="Snippet5"::: @@ -175,7 +175,7 @@ uses the HRESULT COR_E_FORMAT, which has the value 0x80131537. - The class derives from and adds no unique members. For a list of initial property values for an instance of , see the constructors. + The class derives from and adds no unique members. For a list of initial property values for an instance of , see the constructors. ]]> @@ -245,8 +245,8 @@ |Property|Value| |--------------|-----------| -||A null reference (`Nothing` in Visual Basic).| -||The localized error message string.| +||A null reference (`Nothing` in Visual Basic).| +||The localized error message string.| ]]> @@ -306,8 +306,8 @@ |Property|Value| |--------------|-----------| -||A null reference (`Nothing` in Visual Basic).| -||The error message string.| +||A null reference (`Nothing` in Visual Basic).| +||The error message string.| ]]> @@ -434,8 +434,8 @@ |Property|Value| |--------------|-----------| -||The inner exception reference.| -||The error message string.| +||The inner exception reference.| +||The error message string.| ]]> diff --git a/xml/System/FormattableString.xml b/xml/System/FormattableString.xml index d4b45cd5135..6a0f18179f0 100644 --- a/xml/System/FormattableString.xml +++ b/xml/System/FormattableString.xml @@ -56,13 +56,13 @@ Represents a composite format string, along with the arguments to be formatted. - , , and . For more information on composite formatting, see [Composite Formatting](/dotnet/standard/base-types/composite-formatting). - - A instance may result from an interpolated string in C# or Visual Basic. - + , , and . For more information on composite formatting, see [Composite Formatting](/dotnet/standard/base-types/composite-formatting). + + A instance may result from an interpolated string in C# or Visual Basic. + ]]> Composite Formatting @@ -147,11 +147,11 @@ Gets the number of arguments to be formatted. The number of arguments to be formatted. - method, or they can be retrieved individually by index number from the method. The indexes of individual arguments range from zero to - 1. - + method, or they can be retrieved individually by index number from the method. The indexes of individual arguments range from zero to - 1. + ]]> @@ -267,17 +267,17 @@ Within the scope of that import directive, an interpolated string may be formatt Returns the composite format string. The composite format string. - Composite Formatting @@ -372,11 +372,11 @@ Within the scope of that import directive, an interpolated string may be formatt Returns an object array that contains one or more objects to format. An object array that contains one or more objects to format. - @@ -425,21 +425,21 @@ Within the scope of that import directive, an interpolated string may be formatt Returns a result string in which arguments are formatted by using the conventions of the invariant culture. The string that results from formatting the current instance by using the conventions of the invariant culture. - @@ -495,13 +495,13 @@ Invariant($"{{ lat = {latitude}; lon = {longitude} }}") Returns the string that results from formatting the format string along with its arguments by using the formatting conventions of a specified culture. A string formatted using the conventions of the parameter. - implementation. - - This member is an explicit interface implementation. It can be used only when the instance is cast to an interface. - + implementation. + + This member is an explicit interface implementation. It can be used only when the instance is cast to an interface. + ]]> diff --git a/xml/System/FtpStyleUriParser.xml b/xml/System/FtpStyleUriParser.xml index 92bb2a4509a..e81d5c20cdf 100644 --- a/xml/System/FtpStyleUriParser.xml +++ b/xml/System/FtpStyleUriParser.xml @@ -82,11 +82,11 @@ Creates a customizable parser based on the File Transfer Protocol (FTP) scheme. - - + + ]]> diff --git a/xml/System/Func`1.xml b/xml/System/Func`1.xml index 70516aae793..75d28e019d2 100644 --- a/xml/System/Func`1.xml +++ b/xml/System/Func`1.xml @@ -83,51 +83,51 @@ Encapsulates a method that has no parameters and returns a value of the type specified by the parameter. The return value of the method that this delegate encapsulates. - [!NOTE] -> To reference a method that has no parameters and returns `void` (`unit`, in F#) (or in Visual Basic, that is declared as a `Sub` rather than as a `Function`), use the delegate instead. - - When you use the delegate, you do not have to explicitly define a delegate that encapsulates a parameterless method. For example, the following code explicitly declares a delegate named `WriteMethod` and assigns a reference to the `OutputTarget.SendToFile` instance method to its delegate instance. - +> To reference a method that has no parameters and returns `void` (`unit`, in F#) (or in Visual Basic, that is declared as a `Sub` rather than as a `Function`), use the delegate instead. + + When you use the delegate, you do not have to explicitly define a delegate that encapsulates a parameterless method. For example, the following code explicitly declares a delegate named `WriteMethod` and assigns a reference to the `OutputTarget.SendToFile` instance method to its delegate instance. + :::code language="csharp" source="~/snippets/csharp/System/FuncTResult/Overview/Delegate.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Func~1/fs/Delegate.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/FuncTResult/Overview/Delegate.vb" id="Snippet1"::: - - The following example simplifies this code by instantiating the delegate instead of explicitly defining a new delegate and assigning a named method to it. - + + The following example simplifies this code by instantiating the delegate instead of explicitly defining a new delegate and assigning a named method to it. + :::code language="csharp" source="~/snippets/csharp/System/FuncTResult/Overview/Func1.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Func~1/fs/Func1.fs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System/FuncTResult/Overview/Func1.vb" id="Snippet2"::: - - You can use the 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).) - + + You can use the 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/FuncTResult/Overview/Anon.cs" id="Snippet3"::: - - You can also assign a lambda expression to a delegate, as the following example illustrates. (For an introduction to lambda expressions, see [Lambda Expressions (VB)](/dotnet/visual-basic/programming-guide/language-features/procedures/lambda-expressions), [Lambda Expressions (C#)](/dotnet/csharp/programming-guide/statements-expressions-operators/lambda-expressions), and [Lambda Expressions (F#)](/dotnet/fsharp/language-reference/functions/lambda-expressions-the-fun-keyword/).) - + + You can also assign a lambda expression to a delegate, as the following example illustrates. (For an introduction to lambda expressions, see [Lambda Expressions (VB)](/dotnet/visual-basic/programming-guide/language-features/procedures/lambda-expressions), [Lambda Expressions (C#)](/dotnet/csharp/programming-guide/statements-expressions-operators/lambda-expressions), and [Lambda Expressions (F#)](/dotnet/fsharp/language-reference/functions/lambda-expressions-the-fun-keyword/).) + :::code language="csharp" source="~/snippets/csharp/System/FuncTResult/Overview/Lambda.cs" id="Snippet4"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Func~1/fs/Lambda.fs" id="Snippet4"::: :::code language="vb" source="~/snippets/visualbasic/System/FuncTResult/Overview/Lambda.vb" id="Snippet4"::: - - The underlying type of a lambda expression is one of the generic `Func` delegates. This makes it possible to pass a lambda expression as a parameter without explicitly assigning it to a delegate. In particular, because many methods of types in the namespace have `Func` parameters, you can pass these methods a lambda expression without explicitly instantiating a `Func` delegate. - - If you have an expensive computation that you want to execute only if the result is actually needed, you can assign the expensive function to a delegate. The execution of the function can then be delayed until a property that accesses the value is used in an expression. The example in the next section demonstrates how to do this. - - - -## Examples - The following example demonstrates how to use a delegate that takes no parameters. This code creates a generic class named `LazyValue` that has a field of type . This delegate field can store a reference to any function that returns a value of the type that corresponds to the type parameter of the `LazyValue` object. The `LazyValue` type also has a `Value` property that executes the function (if it has not already been executed) and returns the resulting value. - - The example creates two methods and instantiates two `LazyValue` objects with lambda expressions that call these methods. The lambda expressions do not take parameters because they just need to call a method. As the output shows, the two methods are executed only when the value of each `LazyValue` object is retrieved. - + + The underlying type of a lambda expression is one of the generic `Func` delegates. This makes it possible to pass a lambda expression as a parameter without explicitly assigning it to a delegate. In particular, because many methods of types in the namespace have `Func` parameters, you can pass these methods a lambda expression without explicitly instantiating a `Func` delegate. + + If you have an expensive computation that you want to execute only if the result is actually needed, you can assign the expensive function to a delegate. The execution of the function can then be delayed until a property that accesses the value is used in an expression. The example in the next section demonstrates how to do this. + + + +## Examples + The following example demonstrates how to use a delegate that takes no parameters. This code creates a generic class named `LazyValue` that has a field of type . This delegate field can store a reference to any function that returns a value of the type that corresponds to the type parameter of the `LazyValue` object. The `LazyValue` type also has a `Value` property that executes the function (if it has not already been executed) and returns the resulting value. + + The example creates two methods and instantiates two `LazyValue` objects with lambda expressions that call these methods. The lambda expressions do not take parameters because they just need to call a method. As the output shows, the two methods are executed only when the value of each `LazyValue` object is retrieved. + :::code language="csharp" source="~/snippets/csharp/System/FuncTResult/Overview/Example.cs" id="Snippet5"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Func~1/fs/Example.fs" id="Snippet5"::: :::code language="vb" source="~/snippets/visualbasic/System/FuncTResult/Overview/Example.vb" id="Snippet5"::: - + ]]> Lambda Expressions (C# Programming Guide) diff --git a/xml/System/Func`10.xml b/xml/System/Func`10.xml index 1eccb056996..b2109b9355f 100644 --- a/xml/System/Func`10.xml +++ b/xml/System/Func`10.xml @@ -141,18 +141,18 @@ Encapsulates a method that has nine parameters and returns a value of the type specified by the parameter. The return value of the method that this delegate encapsulates. - [!NOTE] -> To reference a method that has nine parameters and returns `void` (or in Visual Basic, that is declared as a `Sub` rather than as a `Function`), use the generic delegate instead. - - You can also use the delegate with anonymous methods and lambda expressions. - - The underlying type of a lambda expression is one of the generic `Func` delegates. This makes it possible to pass a lambda expression as a parameter without explicitly assigning it to a delegate. - +> To reference a method that has nine parameters and returns `void` (or in Visual Basic, that is declared as a `Sub` rather than as a `Function`), use the generic delegate instead. + + You can also use the delegate with anonymous methods and lambda expressions. + + The underlying type of a lambda expression is one of the generic `Func` delegates. This makes it possible to pass a lambda expression as a parameter without explicitly assigning it to a delegate. + ]]> diff --git a/xml/System/Func`11.xml b/xml/System/Func`11.xml index 3848326c6a3..a13934dbbd6 100644 --- a/xml/System/Func`11.xml +++ b/xml/System/Func`11.xml @@ -149,18 +149,18 @@ Encapsulates a method that has 10 parameters and returns a value of the type specified by the parameter. The return value of the method that this delegate encapsulates. - [!NOTE] -> To reference a method that has 10 parameters and returns `void` (or in Visual Basic, that is declared as a `Sub` rather than as a `Function`), use the generic delegate instead. - - You can also use the delegate with anonymous methods and lambda expressions. - - The underlying type of a lambda expression is one of the generic `Func` delegates. This makes it possible to pass a lambda expression as a parameter without explicitly assigning it to a delegate. - +> To reference a method that has 10 parameters and returns `void` (or in Visual Basic, that is declared as a `Sub` rather than as a `Function`), use the generic delegate instead. + + You can also use the delegate with anonymous methods and lambda expressions. + + The underlying type of a lambda expression is one of the generic `Func` delegates. This makes it possible to pass a lambda expression as a parameter without explicitly assigning it to a delegate. + ]]> diff --git a/xml/System/Func`12.xml b/xml/System/Func`12.xml index 6e0858258d2..c07eeb46fac 100644 --- a/xml/System/Func`12.xml +++ b/xml/System/Func`12.xml @@ -157,18 +157,18 @@ Encapsulates a method that has 11 parameters and returns a value of the type specified by the parameter. The return value of the method that this delegate encapsulates. - [!NOTE] -> To reference a method that has 11 parameters and returns `void` (or in Visual Basic, that is declared as a `Sub` rather than as a `Function`), use the generic delegate instead. - - You can also use the delegate with anonymous methods and lambda expressions. - - The underlying type of a lambda expression is one of the generic `Func` delegates. This makes it possible to pass a lambda expression as a parameter without explicitly assigning it to a delegate. - +> To reference a method that has 11 parameters and returns `void` (or in Visual Basic, that is declared as a `Sub` rather than as a `Function`), use the generic delegate instead. + + You can also use the delegate with anonymous methods and lambda expressions. + + The underlying type of a lambda expression is one of the generic `Func` delegates. This makes it possible to pass a lambda expression as a parameter without explicitly assigning it to a delegate. + ]]> diff --git a/xml/System/Func`13.xml b/xml/System/Func`13.xml index 0bf3d00e4ef..d28429e1c18 100644 --- a/xml/System/Func`13.xml +++ b/xml/System/Func`13.xml @@ -165,18 +165,18 @@ Encapsulates a method that has 12 parameters and returns a value of the type specified by the parameter. The return value of the method that this delegate encapsulates. - [!NOTE] -> To reference a method that has 12 parameters and returns `void` (or in Visual Basic, that is declared as a `Sub` rather than as a `Function`), use the generic delegate instead. - - You can also use the delegate with anonymous methods and lambda expressions. - - The underlying type of a lambda expression is one of the generic `Func` delegates. This makes it possible to pass a lambda expression as a parameter without explicitly assigning it to a delegate. - +> To reference a method that has 12 parameters and returns `void` (or in Visual Basic, that is declared as a `Sub` rather than as a `Function`), use the generic delegate instead. + + You can also use the delegate with anonymous methods and lambda expressions. + + The underlying type of a lambda expression is one of the generic `Func` delegates. This makes it possible to pass a lambda expression as a parameter without explicitly assigning it to a delegate. + ]]> diff --git a/xml/System/Func`14.xml b/xml/System/Func`14.xml index 3ff27e871fc..f411894b831 100644 --- a/xml/System/Func`14.xml +++ b/xml/System/Func`14.xml @@ -173,18 +173,18 @@ Encapsulates a method that has 13 parameters and returns a value of the type specified by the parameter. The return value of the method that this delegate encapsulates. - [!NOTE] -> To reference a method that has 13 parameters and returns `void` (or in Visual Basic, that is declared as a `Sub` rather than as a `Function`), use the generic delegate instead. - - You can also use the delegate with anonymous methods and lambda expressions. - - The underlying type of a lambda expression is one of the generic `Func` delegates. This makes it possible to pass a lambda expression as a parameter without explicitly assigning it to a delegate. - +> To reference a method that has 13 parameters and returns `void` (or in Visual Basic, that is declared as a `Sub` rather than as a `Function`), use the generic delegate instead. + + You can also use the delegate with anonymous methods and lambda expressions. + + The underlying type of a lambda expression is one of the generic `Func` delegates. This makes it possible to pass a lambda expression as a parameter without explicitly assigning it to a delegate. + ]]> diff --git a/xml/System/Func`15.xml b/xml/System/Func`15.xml index 690d0b39d60..917ab43c8b7 100644 --- a/xml/System/Func`15.xml +++ b/xml/System/Func`15.xml @@ -181,18 +181,18 @@ Encapsulates a method that has 14 parameters and returns a value of the type specified by the parameter. The return value of the method that this delegate encapsulates. - [!NOTE] -> To reference a method that has 14 parameters and returns `void` (or in Visual Basic, that is declared as a `Sub` rather than as a `Function`), use the generic delegate instead. - - You can also use the delegate with anonymous methods and lambda expressions. - - The underlying type of a lambda expression is one of the generic `Func` delegates. This makes it possible to pass a lambda expression as a parameter without explicitly assigning it to a delegate. - +> To reference a method that has 14 parameters and returns `void` (or in Visual Basic, that is declared as a `Sub` rather than as a `Function`), use the generic delegate instead. + + You can also use the delegate with anonymous methods and lambda expressions. + + The underlying type of a lambda expression is one of the generic `Func` delegates. This makes it possible to pass a lambda expression as a parameter without explicitly assigning it to a delegate. + ]]> diff --git a/xml/System/Func`16.xml b/xml/System/Func`16.xml index 6e1e6fe0cec..08565e21a47 100644 --- a/xml/System/Func`16.xml +++ b/xml/System/Func`16.xml @@ -189,18 +189,18 @@ Encapsulates a method that has 15 parameters and returns a value of the type specified by the parameter. The return value of the method that this delegate encapsulates. - [!NOTE] -> To reference a method that has 15 parameters and returns `void` (or in Visual Basic, that is declared as a `Sub` rather than as a `Function`), use the generic delegate instead. - - You can also use the delegate with anonymous methods and lambda expressions. - - The underlying type of a lambda expression is one of the generic `Func` delegates. This makes it possible to pass a lambda expression as a parameter without explicitly assigning it to a delegate. - +> To reference a method that has 15 parameters and returns `void` (or in Visual Basic, that is declared as a `Sub` rather than as a `Function`), use the generic delegate instead. + + You can also use the delegate with anonymous methods and lambda expressions. + + The underlying type of a lambda expression is one of the generic `Func` delegates. This makes it possible to pass a lambda expression as a parameter without explicitly assigning it to a delegate. + ]]> diff --git a/xml/System/Func`17.xml b/xml/System/Func`17.xml index 0b16de7c2fd..c2e56036da6 100644 --- a/xml/System/Func`17.xml +++ b/xml/System/Func`17.xml @@ -197,18 +197,18 @@ Encapsulates a method that has 16 parameters and returns a value of the type specified by the parameter. The return value of the method that this delegate encapsulates. - [!NOTE] -> To reference a method that has 16 parameters and returns `void` (or in Visual Basic, that is declared as a `Sub` rather than as a `Function`), use the generic delegate instead. - - You can also use the delegate with anonymous methods and lambda expressions. - - The underlying type of a lambda expression is one of the generic `Func` delegates. This makes it possible to pass a lambda expression as a parameter without explicitly assigning it to a delegate. - +> To reference a method that has 16 parameters and returns `void` (or in Visual Basic, that is declared as a `Sub` rather than as a `Function`), use the generic delegate instead. + + You can also use the delegate with anonymous methods and lambda expressions. + + The underlying type of a lambda expression is one of the generic `Func` delegates. This makes it possible to pass a lambda expression as a parameter without explicitly assigning it to a delegate. + ]]> diff --git a/xml/System/Func`2.xml b/xml/System/Func`2.xml index 65ee934e1d8..e042d8f498a 100644 --- a/xml/System/Func`2.xml +++ b/xml/System/Func`2.xml @@ -104,36 +104,36 @@ You can use this delegate to represent a method that can be passed 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 that it must return a value. > [!NOTE] -> To reference a method that has one parameter and returns `void` (or in Visual Basic, that is declared as a `Sub` rather than as a `Function`), use the generic delegate instead. +> To reference a method that has one parameter and returns `void` (or in Visual Basic, that is declared as a `Sub` rather than as a `Function`), use the generic delegate instead. - When you use the 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 `ConvertMethod` and assigns a reference to the `UppercaseString` method to its delegate instance. + When you use the 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 `ConvertMethod` and assigns a reference to the `UppercaseString` method to its delegate instance. :::code language="csharp" source="~/snippets/csharp/System/FuncT,TResult/Overview/Delegate.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Func~2/fs/Delegate.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/FuncT,TResult/Overview/Delegate.vb" id="Snippet1"::: - The following example simplifies this code by instantiating the delegate instead of explicitly defining a new delegate and assigning a named method to it. + The following example simplifies this code by instantiating the delegate instead of explicitly defining a new delegate and assigning a named method to it. :::code language="csharp" source="~/snippets/csharp/System/FuncT,TResult/Overview/Func2_1.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Func~2/fs/Func2_1.fs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System/FuncT,TResult/Overview/Func2_1.vb" id="Snippet2"::: - You can also use the 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).) + You can also use the 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/FuncT,TResult/Overview/Anon.cs" id="Snippet3"::: - You can also assign a lambda expression to a delegate, as the following example illustrates. (For an introduction to lambda expressions, see [Lambda Expressions (VB)](/dotnet/visual-basic/programming-guide/language-features/procedures/lambda-expressions), [Lambda Expressions (C#)](/dotnet/csharp/programming-guide/statements-expressions-operators/lambda-expressions) and [Lambda Expressions (F#)](/dotnet/fsharp/language-reference/functions/lambda-expressions-the-fun-keyword).) + You can also assign a lambda expression to a delegate, as the following example illustrates. (For an introduction to lambda expressions, see [Lambda Expressions (VB)](/dotnet/visual-basic/programming-guide/language-features/procedures/lambda-expressions), [Lambda Expressions (C#)](/dotnet/csharp/programming-guide/statements-expressions-operators/lambda-expressions) and [Lambda Expressions (F#)](/dotnet/fsharp/language-reference/functions/lambda-expressions-the-fun-keyword).) :::code language="csharp" source="~/snippets/csharp/System/FuncT,TResult/Overview/Lambda.cs" id="Snippet4"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Func~2/fs/Lambda.fs" id="Snippet4"::: :::code language="vb" source="~/snippets/visualbasic/System/FuncT,TResult/Overview/Lambda.vb" id="Snippet4"::: - The underlying type of a lambda expression is one of the generic `Func` delegates. This makes it possible to pass a lambda expression as a parameter without explicitly assigning it to a delegate. In particular, because many methods of types in the namespace have parameters, you can pass these methods a lambda expression without explicitly instantiating a delegate. + The underlying type of a lambda expression is one of the generic `Func` delegates. This makes it possible to pass a lambda expression as a parameter without explicitly assigning it to a delegate. In particular, because many methods of types in the namespace have parameters, you can pass these methods a lambda expression without explicitly instantiating a delegate. ## Examples - The following example demonstrates how to declare and use a delegate. This example declares a variable and assigns it a lambda expression that converts the characters in a string to uppercase. The delegate that encapsulates this method is subsequently passed to the method to change the strings in an array of strings to uppercase. + The following example demonstrates how to declare and use a delegate. This example declares a variable and assigns it a lambda expression that converts the characters in a string to uppercase. The delegate that encapsulates this method is subsequently passed to the method to change the strings in an array of strings to uppercase. :::code language="csharp" source="~/snippets/csharp/System/FuncT,TResult/Overview/Example.cs" id="Snippet5"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Func~2/fs/Example.fs" id="Snippet5"::: diff --git a/xml/System/Func`3.xml b/xml/System/Func`3.xml index 86d9afa32bf..691039c8c41 100644 --- a/xml/System/Func`3.xml +++ b/xml/System/Func`3.xml @@ -112,43 +112,43 @@ Encapsulates a method that has two parameters and returns a value of the type specified by the parameter. The return value of the method that this delegate encapsulates. - [!NOTE] -> To reference a method that has two parameters and returns `void` (`unit` in F#) (or in Visual Basic, that is declared as a `Sub` rather than as a `Function`), use the generic delegate instead. - - When you use the delegate you do not have to explicitly define a delegate that encapsulates a method with two parameters. For example, the following code explicitly declares a delegate named `ExtractMethod` and assigns a reference to the `ExtractWords` method to its delegate instance. - +> To reference a method that has two parameters and returns `void` (`unit` in F#) (or in Visual Basic, that is declared as a `Sub` rather than as a `Function`), use the generic delegate instead. + + When you use the delegate you do not have to explicitly define a delegate that encapsulates a method with two parameters. For example, the following code explicitly declares a delegate named `ExtractMethod` and assigns a reference to the `ExtractWords` method to its delegate instance. + :::code language="csharp" source="~/snippets/csharp/System/FuncT1,T2,TResult/Overview/Delegate.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Func~3/fs/Delegate.fs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System/FuncT1,T2,TResult/Overview/Delegate.vb" id="Snippet1"::: - - The following example simplifies this code by instantiating a delegate instead of explicitly defining a new delegate and assigning a named method to it. - + :::code language="vb" source="~/snippets/visualbasic/System/FuncT1,T2,TResult/Overview/Delegate.vb" id="Snippet1"::: + + The following example simplifies this code by instantiating a delegate instead of explicitly defining a new delegate and assigning a named method to it. + :::code language="csharp" source="~/snippets/csharp/System/FuncT1,T2,TResult/Overview/Func3.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Func~3/fs/Func3.fs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/System/FuncT1,T2,TResult/Overview/Func3.vb" id="Snippet2"::: - - You can use the 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="vb" source="~/snippets/visualbasic/System/FuncT1,T2,TResult/Overview/Func3.vb" id="Snippet2"::: + + You can use the 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/FuncT1,T2,TResult/Overview/Anon.cs" id="Snippet3"::: - - You can also assign a lambda expression to a delegate, as the following example illustrates. (For an introduction to lambda expressions, see [Lambda Expressions (VB)](/dotnet/visual-basic/programming-guide/language-features/procedures/lambda-expressions), [Lambda Expressions (C#)](/dotnet/csharp/programming-guide/statements-expressions-operators/lambda-expressions) and [Lambda Expressions (F#)](/dotnet/fsharp/language-reference/functions/lambda-expressions-the-fun-keyword).) - + + You can also assign a lambda expression to a delegate, as the following example illustrates. (For an introduction to lambda expressions, see [Lambda Expressions (VB)](/dotnet/visual-basic/programming-guide/language-features/procedures/lambda-expressions), [Lambda Expressions (C#)](/dotnet/csharp/programming-guide/statements-expressions-operators/lambda-expressions) and [Lambda Expressions (F#)](/dotnet/fsharp/language-reference/functions/lambda-expressions-the-fun-keyword).) + :::code language="csharp" source="~/snippets/csharp/System/FuncT1,T2,TResult/Overview/Lambda.cs" id="Snippet4"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Func~3/fs/Lambda.fs" id="Snippet4"::: :::code language="vb" source="~/snippets/visualbasic/System/FuncT1,T2,TResult/Overview/lambda.vb" id="Snippet4"::: - The underlying type of a lambda expression is one of the generic `Func` delegates. This makes it possible to pass a lambda expression as a parameter without explicitly assigning it to a delegate. In particular, because many methods of types in the namespace have parameters, you can pass these methods a lambda expression without explicitly instantiating a delegate. - - - -## Examples - The following example demonstrates how to declare and use a delegate. This example declares a variable and assigns it a lambda expression that takes a value and an value as parameters. The lambda expression returns `true` if the length of the parameter is equal to the value of the parameter. The delegate that encapsulates this method is subsequently used in a query to filter strings in an array of strings. - + The underlying type of a lambda expression is one of the generic `Func` delegates. This makes it possible to pass a lambda expression as a parameter without explicitly assigning it to a delegate. In particular, because many methods of types in the namespace have parameters, you can pass these methods a lambda expression without explicitly instantiating a delegate. + + + +## Examples + The following example demonstrates how to declare and use a delegate. This example declares a variable and assigns it a lambda expression that takes a value and an value as parameters. The lambda expression returns `true` if the length of the parameter is equal to the value of the parameter. The delegate that encapsulates this method is subsequently used in a query to filter strings in an array of strings. + :::code language="csharp" source="~/snippets/csharp/System/FuncT1,T2,TResult/Overview/Example.cs" id="Snippet5"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Func~3/fs/Example.fs" id="Snippet5"::: :::code language="vb" source="~/snippets/visualbasic/System/FuncT1,T2,TResult/Overview/Example.vb" id="Snippet5"::: diff --git a/xml/System/Func`4.xml b/xml/System/Func`4.xml index fdd3b8d0185..b873794c255 100644 --- a/xml/System/Func`4.xml +++ b/xml/System/Func`4.xml @@ -126,47 +126,47 @@ Encapsulates a method that has three parameters and returns a value of the type specified by the parameter. The return value of the method that this delegate encapsulates. - [!NOTE] -> To reference a method that has three parameters and returns `void` (`unit` in F#) (or in Visual Basic, that is declared as a `Sub` rather than as a `Function`), use the generic delegate instead. - - When you use the delegate, you do not have to explicitly define a delegate that encapsulates a method with three parameters. For example, the following code explicitly declares a generic delegate named `ParseNumber` and assigns a reference to the method to its delegate instance. - +> To reference a method that has three parameters and returns `void` (`unit` in F#) (or in Visual Basic, that is declared as a `Sub` rather than as a `Function`), use the generic delegate instead. + + When you use the delegate, you do not have to explicitly define a delegate that encapsulates a method with three parameters. For example, the following code explicitly declares a generic delegate named `ParseNumber` and assigns a reference to the method to its delegate instance. + :::code language="csharp" source="~/snippets/csharp/System/FuncT1,T2,T3,TResult/Overview/Delegate.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/FuncT1,T2,T3,TResult/Overview/Delegate.fs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System/FuncT1,T2,T3,TResult/Overview/Delegate.vb" id="Snippet1"::: - - The following example simplifies this code by instantiating the delegate instead of explicitly defining a new delegate and assigning a named method to it. - + :::code language="vb" source="~/snippets/visualbasic/System/FuncT1,T2,T3,TResult/Overview/Delegate.vb" id="Snippet1"::: + + The following example simplifies this code by instantiating the delegate instead of explicitly defining a new delegate and assigning a named method to it. + :::code language="csharp" source="~/snippets/csharp/System/FuncT1,T2,T3,TResult/Overview/Func4.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/FuncT1,T2,T3,TResult/Overview/Func4.fs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/System/FuncT1,T2,T3,TResult/Overview/Func4.vb" id="Snippet2"::: - - You can use the 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="vb" source="~/snippets/visualbasic/System/FuncT1,T2,T3,TResult/Overview/Func4.vb" id="Snippet2"::: + + You can use the 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/FuncT1,T2,T3,TResult/Overview/Anon.cs" id="Snippet3"::: - - You can also assign a lambda expression to a delegate, as the following example illustrates. (For an introduction to lambda expressions, see [Lambda Expressions (VB)](/dotnet/visual-basic/programming-guide/language-features/procedures/lambda-expressions), [Lambda Expressions (C#)](/dotnet/csharp/programming-guide/statements-expressions-operators/lambda-expressions) and [Lambda Expressions (F#)](/dotnet/fsharp/language-reference/functions/lambda-expressions-the-fun-keyword).) - + + You can also assign a lambda expression to a delegate, as the following example illustrates. (For an introduction to lambda expressions, see [Lambda Expressions (VB)](/dotnet/visual-basic/programming-guide/language-features/procedures/lambda-expressions), [Lambda Expressions (C#)](/dotnet/csharp/programming-guide/statements-expressions-operators/lambda-expressions) and [Lambda Expressions (F#)](/dotnet/fsharp/language-reference/functions/lambda-expressions-the-fun-keyword).) + :::code language="csharp" source="~/snippets/csharp/System/FuncT1,T2,T3,TResult/Overview/Lambda.cs" id="Snippet4"::: :::code language="fsharp" source="~/snippets/fsharp/System/FuncT1,T2,T3,TResult/Overview/Lambda.fs" id="Snippet4"::: :::code language="vb" source="~/snippets/visualbasic/System/FuncT1,T2,T3,TResult/Overview/Lambda.vb" id="Snippet4"::: - - The underlying type of a lambda expression is one of the generic `Func` delegates. This makes it possible to pass a lambda expression as a parameter without explicitly assigning it to a delegate. In particular, because many methods of types in the namespace have `Func` parameters, you can pass these methods a lambda expression without explicitly instantiating a `Func` delegate. - - - -## Examples - The following example demonstrates how to declare and use a delegate. This example declares a variable and assigns it a lambda expression that takes a value and an value as parameters. The lambda expression returns `true` if the length of the parameter is equal to the value of the parameter. The delegate that encapsulates this method is subsequently used in a query to filter strings in an array of strings. - + + The underlying type of a lambda expression is one of the generic `Func` delegates. This makes it possible to pass a lambda expression as a parameter without explicitly assigning it to a delegate. In particular, because many methods of types in the namespace have `Func` parameters, you can pass these methods a lambda expression without explicitly instantiating a `Func` delegate. + + + +## Examples + The following example demonstrates how to declare and use a delegate. This example declares a variable and assigns it a lambda expression that takes a value and an value as parameters. The lambda expression returns `true` if the length of the parameter is equal to the value of the parameter. The delegate that encapsulates this method is subsequently used in a query to filter strings in an array of strings. + :::code language="csharp" source="~/snippets/csharp/System/FuncT1,T2,TResult/Overview/Example.cs" id="Snippet5"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Func~3/fs/Example.fs" id="Snippet5"::: :::code language="vb" source="~/snippets/visualbasic/System/FuncT1,T2,TResult/Overview/Example.vb" id="Snippet5"::: - + ]]> Lambda Expressions (C# Programming Guide) diff --git a/xml/System/Func`5.xml b/xml/System/Func`5.xml index 984e1e91dc3..f1660bafdcd 100644 --- a/xml/System/Func`5.xml +++ b/xml/System/Func`5.xml @@ -114,47 +114,47 @@ Encapsulates a method that has four parameters and returns a value of the type specified by the parameter. The return value of the method that this delegate encapsulates. - [!NOTE] -> To reference a method that has four parameters and returns `void` (`unit` in F#) (or in Visual Basic, that is declared as a `Sub` rather than as a `Function`), use the generic delegate instead. - - When you use the delegate, you do not have to explicitly define a delegate that encapsulates a method with four parameters. For example, the following code explicitly declares a generic delegate named `Searcher` and assigns a reference to the method to its delegate instance. - +> To reference a method that has four parameters and returns `void` (`unit` in F#) (or in Visual Basic, that is declared as a `Sub` rather than as a `Function`), use the generic delegate instead. + + When you use the delegate, you do not have to explicitly define a delegate that encapsulates a method with four parameters. For example, the following code explicitly declares a generic delegate named `Searcher` and assigns a reference to the method to its delegate instance. + :::code language="csharp" source="~/snippets/csharp/System/FuncT1,T2,T3,T4,TResult/Overview/Delegate.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/FuncT1,T2,T3,T4,TResult/Overview/Delegate.fs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System/FuncT1,T2,T3,T4,TResult/Overview/Delegate.vb" id="Snippet1"::: - - The following example simplifies this code by instantiating the delegate instead of explicitly defining a new delegate and assigning a named method to it. - + :::code language="vb" source="~/snippets/visualbasic/System/FuncT1,T2,T3,T4,TResult/Overview/Delegate.vb" id="Snippet1"::: + + The following example simplifies this code by instantiating the delegate instead of explicitly defining a new delegate and assigning a named method to it. + :::code language="csharp" source="~/snippets/csharp/System/FuncT1,T2,T3,T4,TResult/Overview/Func5.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/FuncT1,T2,T3,T4,TResult/Overview/Func5.fs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/System/FuncT1,T2,T3,T4,TResult/Overview/Func5.vb" id="Snippet2"::: - - You can use the 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/FuncT1,T2,T3,T4,TResult/Overview/Anon.cs" id="Snippet3"::: - - You can also assign a lambda expression to a delegate, as the following example illustrates. (For an introduction to lambda expressions, see [Lambda Expressions (VB)](/dotnet/visual-basic/programming-guide/language-features/procedures/lambda-expressions), [Lambda Expressions (C#)](/dotnet/csharp/programming-guide/statements-expressions-operators/lambda-expressions) and [Lambda Expressions (F#)](/dotnet/fsharp/language-reference/functions/lambda-expressions-the-fun-keyword).) - + :::code language="vb" source="~/snippets/visualbasic/System/FuncT1,T2,T3,T4,TResult/Overview/Func5.vb" id="Snippet2"::: + + You can use the 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/FuncT1,T2,T3,T4,TResult/Overview/Anon.cs" id="Snippet3"::: + + You can also assign a lambda expression to a delegate, as the following example illustrates. (For an introduction to lambda expressions, see [Lambda Expressions (VB)](/dotnet/visual-basic/programming-guide/language-features/procedures/lambda-expressions), [Lambda Expressions (C#)](/dotnet/csharp/programming-guide/statements-expressions-operators/lambda-expressions) and [Lambda Expressions (F#)](/dotnet/fsharp/language-reference/functions/lambda-expressions-the-fun-keyword).) + :::code language="csharp" source="~/snippets/csharp/System/FuncT1,T2,T3,T4,TResult/Overview/Lambda.cs" id="Snippet4"::: :::code language="fsharp" source="~/snippets/fsharp/System/FuncT1,T2,T3,T4,TResult/Overview/Lambda.fs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/System/FuncT1,T2,T3,T4,TResult/Overview/Lambda.vb" id="Snippet4"::: - - The underlying type of a lambda expression is one of the generic `Func` delegates. This makes it possible to pass a lambda expression as a parameter without explicitly assigning it to a delegate. In particular, because many methods of types in the namespace have `Func` parameters, you can pass these methods a lambda expression without explicitly instantiating a `Func` delegate. - - - -## Examples - The following example demonstrates how to declare and use a delegate. This example declares a variable and assigns it a lambda expression that takes a value and an value as parameters. The lambda expression returns `true` if the length of the parameter is equal to the value of the parameter. The delegate that encapsulates this method is subsequently used in a query to filter strings in an array of strings. - + :::code language="vb" source="~/snippets/visualbasic/System/FuncT1,T2,T3,T4,TResult/Overview/Lambda.vb" id="Snippet4"::: + + The underlying type of a lambda expression is one of the generic `Func` delegates. This makes it possible to pass a lambda expression as a parameter without explicitly assigning it to a delegate. In particular, because many methods of types in the namespace have `Func` parameters, you can pass these methods a lambda expression without explicitly instantiating a `Func` delegate. + + + +## Examples + The following example demonstrates how to declare and use a delegate. This example declares a variable and assigns it a lambda expression that takes a value and an value as parameters. The lambda expression returns `true` if the length of the parameter is equal to the value of the parameter. The delegate that encapsulates this method is subsequently used in a query to filter strings in an array of strings. + :::code language="csharp" source="~/snippets/csharp/System/FuncT1,T2,TResult/Overview/Example.cs" id="Snippet5"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Func~3/fs/Example.fs" id="Snippet5"::: - :::code language="vb" source="~/snippets/visualbasic/System/FuncT1,T2,TResult/Overview/Example.vb" id="Snippet5"::: - + :::code language="vb" source="~/snippets/visualbasic/System/FuncT1,T2,TResult/Overview/Example.vb" id="Snippet5"::: + ]]> Lambda Expressions (C# Programming Guide) diff --git a/xml/System/Func`6.xml b/xml/System/Func`6.xml index be4b5c00539..8423e103138 100644 --- a/xml/System/Func`6.xml +++ b/xml/System/Func`6.xml @@ -109,18 +109,18 @@ Encapsulates a method that has five parameters and returns a value of the type specified by the parameter. The return value of the method that this delegate encapsulates. - [!NOTE] -> To reference a method that has five parameters and returns `void` (or in Visual Basic, that is declared as a `Sub` rather than as a `Function`), use the generic delegate instead. - - You can also use the delegate with anonymous methods and lambda expressions. - - The underlying type of a lambda expression is one of the generic `Func` delegates. This makes it possible to pass a lambda expression as a parameter without explicitly assigning it to a delegate. - +> To reference a method that has five parameters and returns `void` (or in Visual Basic, that is declared as a `Sub` rather than as a `Function`), use the generic delegate instead. + + You can also use the delegate with anonymous methods and lambda expressions. + + The underlying type of a lambda expression is one of the generic `Func` delegates. This makes it possible to pass a lambda expression as a parameter without explicitly assigning it to a delegate. + ]]> diff --git a/xml/System/Func`7.xml b/xml/System/Func`7.xml index 97c55aaf5c0..9c3df3e3a04 100644 --- a/xml/System/Func`7.xml +++ b/xml/System/Func`7.xml @@ -117,18 +117,18 @@ Encapsulates a method that has six parameters and returns a value of the type specified by the parameter. The return value of the method that this delegate encapsulates. - [!NOTE] -> To reference a method that has six parameters and returns `void` (or in Visual Basic, that is declared as a `Sub` rather than as a `Function`), use the generic delegate instead. - - You can also use the delegate with anonymous methods and lambda expressions. - - The underlying type of a lambda expression is one of the generic `Func` delegates. This makes it possible to pass a lambda expression as a parameter without explicitly assigning it to a delegate. - +> To reference a method that has six parameters and returns `void` (or in Visual Basic, that is declared as a `Sub` rather than as a `Function`), use the generic delegate instead. + + You can also use the delegate with anonymous methods and lambda expressions. + + The underlying type of a lambda expression is one of the generic `Func` delegates. This makes it possible to pass a lambda expression as a parameter without explicitly assigning it to a delegate. + ]]> diff --git a/xml/System/Func`8.xml b/xml/System/Func`8.xml index dd671654293..48d3ea2477f 100644 --- a/xml/System/Func`8.xml +++ b/xml/System/Func`8.xml @@ -125,18 +125,18 @@ Encapsulates a method that has seven parameters and returns a value of the type specified by the parameter. The return value of the method that this delegate encapsulates. - [!NOTE] -> To reference a method that has seven parameters and returns `void` (or in Visual Basic, that is declared as a `Sub` rather than as a `Function`), use the generic delegate instead. - - You can also use the delegate with anonymous methods and lambda expressions. - - The underlying type of a lambda expression is one of the generic `Func` delegates. This makes it possible to pass a lambda expression as a parameter without explicitly assigning it to a delegate. - +> To reference a method that has seven parameters and returns `void` (or in Visual Basic, that is declared as a `Sub` rather than as a `Function`), use the generic delegate instead. + + You can also use the delegate with anonymous methods and lambda expressions. + + The underlying type of a lambda expression is one of the generic `Func` delegates. This makes it possible to pass a lambda expression as a parameter without explicitly assigning it to a delegate. + ]]> diff --git a/xml/System/Func`9.xml b/xml/System/Func`9.xml index 19f62651946..1ee18694976 100644 --- a/xml/System/Func`9.xml +++ b/xml/System/Func`9.xml @@ -133,18 +133,18 @@ Encapsulates a method that has eight parameters and returns a value of the type specified by the parameter. The return value of the method that this delegate encapsulates. - [!NOTE] -> To reference a method that has eight parameters and returns `void` (or in Visual Basic, that is declared as a `Sub` rather than as a `Function`), use the generic delegate instead. - - You can also use the delegate with anonymous methods and lambda expressions. - - The underlying type of a lambda expression is one of the generic `Func` delegates. This makes it possible to pass a lambda expression as a parameter without explicitly assigning it to a delegate. - +> To reference a method that has eight parameters and returns `void` (or in Visual Basic, that is declared as a `Sub` rather than as a `Function`), use the generic delegate instead. + + You can also use the delegate with anonymous methods and lambda expressions. + + The underlying type of a lambda expression is one of the generic `Func` delegates. This makes it possible to pass a lambda expression as a parameter without explicitly assigning it to a delegate. + ]]> diff --git a/xml/System/GC.xml b/xml/System/GC.xml index d913f75b4ce..a489570a01b 100644 --- a/xml/System/GC.xml +++ b/xml/System/GC.xml @@ -481,7 +481,7 @@ Skipping zero-initialization using this API only has a material performance bene Use the property to determine the maximum valid value of the `generation` parameter. - To have the garbage collector consider all objects regardless of their generation, use the version of this method that takes no parameters. To have the garbage collector reclaim objects based on a setting, use the method overload. + To have the garbage collector consider all objects regardless of their generation, use the version of this method that takes no parameters. To have the garbage collector reclaim objects based on a setting, use the method overload. @@ -564,7 +564,7 @@ Skipping zero-initialization using this API only has a material performance bene To have the garbage collector consider all objects regardless of their generation, use the version of this method that takes no parameters. - To have the garbage collector reclaim objects up to a specified generation of objects, use the method overload. When you specify the maximum generation, all objects are collected. + To have the garbage collector reclaim objects up to a specified generation of objects, use the method overload. When you specify the maximum generation, all objects are collected. @@ -649,10 +649,10 @@ Skipping zero-initialization using this API only has a material performance bene |`mode`|`blocking` is `true`|`blocking` is `false`| |-|-|-| -| or |A blocking collection is performed as soon as possible. If a background collection is in progress and `generation` is 0 or 1, the method immediately triggers a blocking collection and returns when the collection is finished. If a background collection is in progress and `generation` is 2, the method waits until the background collection is finished, triggers a blocking generation 2 collection, and then returns.|A collection is performed as soon as possible. The method requests a background collection, but this is not guaranteed; depending on the circumstances, a blocking collection may still be performed. If a background collection is already in progress, the method returns immediately.| -||A blocking collection may be performed, depending on the state of the garbage collector and the `generation` parameter. The garbage collector tries to provide optimal performance.|A collection may be performed, depending on the state of the garbage collector. The method requests a background collection, but this is not guaranteed; depending on the circumstances, a blocking collection may still be performed. The garbage collector tries to provide optimal performance. If a background collection is already in progress, the method returns immediately.| +| or |A blocking collection is performed as soon as possible. If a background collection is in progress and `generation` is 0 or 1, the method immediately triggers a blocking collection and returns when the collection is finished. If a background collection is in progress and `generation` is 2, the method waits until the background collection is finished, triggers a blocking generation 2 collection, and then returns.|A collection is performed as soon as possible. The method requests a background collection, but this is not guaranteed; depending on the circumstances, a blocking collection may still be performed. If a background collection is already in progress, the method returns immediately.| +||A blocking collection may be performed, depending on the state of the garbage collector and the `generation` parameter. The garbage collector tries to provide optimal performance.|A collection may be performed, depending on the state of the garbage collector. The method requests a background collection, but this is not guaranteed; depending on the circumstances, a blocking collection may still be performed. The garbage collector tries to provide optimal performance. If a background collection is already in progress, the method returns immediately.| - If a call to the method performs a full blocking garbage collection, you can also compact the large object heap by setting the property to before calling the method. +If a call to the method performs a full blocking garbage collection, you can also compact the large object heap by setting the property to before calling the method. ]]> @@ -726,7 +726,7 @@ Skipping zero-initialization using this API only has a material performance bene If `compacting` is `true`, the runtime compacts the small object heap (SOH). The large object heap (LOH) is not compacted unless the property is set to . Note that this includes all blocking garbage collections, not just full blocking garbage collections. - You can call the method to reduce the managed heap to the smallest size possible, as the following code fragment illustrates. + You can call the method to reduce the managed heap to the smallest size possible, as the following code fragment illustrates. :::code language="csharp" source="~/snippets/csharp/System/GC/Collect/collect4.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/GC/Collect/collect4.fs" id="Snippet1"::: @@ -1483,7 +1483,7 @@ The following example demonstrates the use of the property is guaranteed to remain constant for the lifetime of an executing application. - Use the property to determine the maximum value you can specify when calling the method that takes a generation parameter. + Use the property to determine the maximum value you can specify when calling the method that takes a generation parameter. ## Examples @@ -2008,7 +2008,7 @@ If `obj` does not have a finalizer or the GC has already signaled the finalizer method attempts to place the garbage collector in no GC region latency mode, which disallows garbage collection while an app executes a critical region of code. If the runtime is unable to initially allocate the requested amount of memory, the garbage collector performs a full blocking garbage collection in an attempt to free additional memory. The garbage collector enters no GC region latency mode if it is able to allocate the required amount of memory, which in this case is actually 2 * `totalSize` bytes (it attempts to allocate `totalSize` bytes for the small object heap and `totalSize` bytes for the large object heap). + The method attempts to place the garbage collector in no GC region latency mode, which disallows garbage collection while an app executes a critical region of code. If the runtime is unable to initially allocate the requested amount of memory, the garbage collector performs a full blocking garbage collection in an attempt to free additional memory. The garbage collector enters no GC region latency mode if it is able to allocate the required amount of memory, which in this case is actually 2 * `totalSize` bytes (it attempts to allocate `totalSize` bytes for the small object heap and `totalSize` bytes for the large object heap). `totalSize` must be large enough to handle all memory allocations that occur in the critical path. This includes allocations by the app, as well as allocations that the runtime makes on the app's behalf. @@ -2082,11 +2082,11 @@ If `obj` does not have a finalizer or the GC has already signaled the finalizer method attempts to place the garbage collector in no GC region latency mode, which disallows garbage collection while an app executes a critical region of code. If the runtime is unable to initially allocate the requested amount of memory and the `disallowFullBlockingGC` argument is `false`, the garbage collector performs a full blocking garbage collection in an attempt to free additional memory; otherwise, the allocation fails, and the method returns `false`. The garbage collector enters no GC region latency mode if it is able to allocate the required amount of memory, which in this case is actually 2 * `totalSize` (it attempts to allocate `totalSize` for the small object heap and `totalSize` for the large object heap). + The method attempts to place the garbage collector in no GC region latency mode, which disallows garbage collection while an app executes a critical region of code. If the runtime is unable to initially allocate the requested amount of memory and the `disallowFullBlockingGC` argument is `false`, the garbage collector performs a full blocking garbage collection in an attempt to free additional memory; otherwise, the allocation fails, and the method returns `false`. The garbage collector enters no GC region latency mode if it is able to allocate the required amount of memory, which in this case is actually 2 * `totalSize` (it attempts to allocate `totalSize` for the small object heap and `totalSize` for the large object heap). `totalSize` must be large enough to handle all memory allocations that occur in the critical path. This includes allocations by the app, as well as allocations that the runtime makes on the app's behalf. - Setting `disallowFullBlockingGC` to `true` to prevent a full blocking garbage collection if not enough memory is initially available is most useful in load balancing scenarios: one system can call this method and report itself as ready to accept requests if it returns `true`, and have the load balancer redirect requests to other systems if it returns `false`. It can then do a full blocking garbage collection when it's not handling requests by calling the method. + Setting `disallowFullBlockingGC` to `true` to prevent a full blocking garbage collection if not enough memory is initially available is most useful in load balancing scenarios: one system can call this method and report itself as ready to accept requests if it returns `true`, and have the load balancer redirect requests to other systems if it returns `false`. It can then do a full blocking garbage collection when it's not handling requests by calling the method. > [!IMPORTANT] > You cannot nest calls to the method, and you should only call the method if the runtime is currently in no GC region latency mode. In other words, you should not call multiple times (after the first method call, subsequent calls will not succeed), and you should not expect calls to to succeed just because the first call to succeeded. @@ -2157,7 +2157,7 @@ If `obj` does not have a finalizer or the GC has already signaled the finalizer method attempts to place the garbage collector in no GC region latency mode, which disallows garbage collection while an app executes a critical region of code. If the runtime is unable to initially allocate the requested amount of memory, the garbage collector performs a full blocking garbage collection in an attempt to free additional memory. The garbage collector enters no GC region latency mode if it is able to allocate `lohSize` for the LOH and `totalSize` - `lohSize` for the small object heap (SOH). + The method attempts to place the garbage collector in no GC region latency mode, which disallows garbage collection while an app executes a critical region of code. If the runtime is unable to initially allocate the requested amount of memory, the garbage collector performs a full blocking garbage collection in an attempt to free additional memory. The garbage collector enters no GC region latency mode if it is able to allocate `lohSize` for the LOH and `totalSize` - `lohSize` for the small object heap (SOH). `lohSize` must be large enough to handle all memory allocations that occur in the critical path for the LOH, and `totalSize` - `lohSize` must be large enough to handle all memory allocations that occur in the critical path for the SOH. This includes allocations by the app, as well as allocations that the runtime makes on the app's behalf. @@ -2233,11 +2233,11 @@ If `obj` does not have a finalizer or the GC has already signaled the finalizer method attempts to place the garbage collector in no GC region latency mode, which disallows garbage collection while an app executes a critical region of code. If the runtime is unable to initially allocate the requested amount of memory and the `disallowFullBlockingGC` argument is `false`, the garbage collector performs a full blocking garbage collection in an attempt to free additional memory; otherwise, the allocation fails, and the method returns `false`. The garbage collector enters no GC region latency mode if it is able to allocate `lohSize` for the LOH and `totalSize` - `lohSize` for the small object heap (SOH). + The method attempts to place the garbage collector in no GC region latency mode, which disallows garbage collection while an app executes a critical region of code. If the runtime is unable to initially allocate the requested amount of memory and the `disallowFullBlockingGC` argument is `false`, the garbage collector performs a full blocking garbage collection in an attempt to free additional memory; otherwise, the allocation fails, and the method returns `false`. The garbage collector enters no GC region latency mode if it is able to allocate `lohSize` for the LOH and `totalSize` - `lohSize` for the small object heap (SOH). `lohSize` must be large enough to handle all memory allocations that occur in the critical path for the LOH, and `totalSize` - `lohSize` must be large enough to handle all memory allocations that occur in the critical path for the SOH. This includes allocations by the app, as well as allocations that the runtime makes on the app's behalf. - Setting `disallowFullBlockingGC` to `true` to prevent a full blocking garbage collection if not enough memory is initially available is most useful in load balancing scenarios: one system can call this method and report itself as ready to accept requests if it returns `true`, and have the load balancer redirect requests to other systems if it returns `false`. It can then do a full blocking garbage collection when it's not handling requests by calling the method. + Setting `disallowFullBlockingGC` to `true` to prevent a full blocking garbage collection if not enough memory is initially available is most useful in load balancing scenarios: one system can call this method and report itself as ready to accept requests if it returns `true`, and have the load balancer redirect requests to other systems if it returns `false`. It can then do a full blocking garbage collection when it's not handling requests by calling the method. > [!IMPORTANT] > You cannot nest calls to the method, and you should only call the method if the runtime is currently in no GC region latency mode. In other words, you should not call multiple times (after the first method call, subsequent calls will not succeed), and you should not expect calls to to succeed just because the first call to succeeded. @@ -2317,7 +2317,7 @@ If `obj` does not have a finalizer or the GC has already signaled the finalizer When the enumeration returns , you can do tasks such as preventing additional objects from being allocated and inducing a collection yourself with the method. Note that the notification does not guarantee that a full garbage collection will occur, only that conditions have reached the threshold that are favorable for a full garbage collection to occur. - This method waits indefinitely for a garbage collection notification to be obtained. If you want to specify a time-out period for the method to return if the notification cannot be obtained, use the method overload. If you call this method without specifying a time-out, you can call the method if you are waiting longer than preferred. + This method waits indefinitely for a garbage collection notification to be obtained. If you want to specify a time-out period for the method to return if the notification cannot be obtained, use the method overload. If you call this method without specifying a time-out, you can call the method if you are waiting longer than preferred. You should follow this method with a call to the method to make sure that you have had a full garbage collection. Calling this method alone causes indeterminate results. @@ -2502,7 +2502,7 @@ If `obj` does not have a finalizer or the GC has already signaled the finalizer When the enumeration returns , you can do tasks such as resuming work and obtaining a collection count with the method. - This method waits indefinitely for a garbage collection notification to be obtained. If you want to specify a time-out period for the method to return if the notification cannot be obtained, use the method overload. If you call this method without specifying a time-out, you can call the method if you are waiting longer than preferred. + This method waits indefinitely for a garbage collection notification to be obtained. If you want to specify a time-out period for the method to return if the notification cannot be obtained, use the method overload. If you call this method without specifying a time-out, you can call the method if you are waiting longer than preferred. This method call should be preceded with a call to the method to make sure that you have had a full garbage collection. Calling this method alone can produce indeterminate results. diff --git a/xml/System/GCCollectionMode.xml b/xml/System/GCCollectionMode.xml index a8c6723af3e..9fc25a8c665 100644 --- a/xml/System/GCCollectionMode.xml +++ b/xml/System/GCCollectionMode.xml @@ -56,20 +56,20 @@ Specifies the behavior for a forced garbage collection. - method overload to specify the value. - - - -## Examples - The following example forces a garbage collection for generation 2 objects with the Optimized setting. - + method overload to specify the value. + + + +## Examples + The following example forces a garbage collection for generation 2 objects with the Optimized setting. + :::code language="csharp" source="~/snippets/csharp/System/GC/Collect/Program.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/GC/Collect/Program.fs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System/GC/Collect/program.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/System/GC/Collect/program.vb" id="Snippet1"::: + ]]> Induced Collections diff --git a/xml/System/GCMemoryInfo.xml b/xml/System/GCMemoryInfo.xml index 0bc95f2c125..22ac33b00e9 100644 --- a/xml/System/GCMemoryInfo.xml +++ b/xml/System/GCMemoryInfo.xml @@ -34,7 +34,7 @@ ## Remarks -A garbage collection (GC) is identified by its , which starts from 1 and increases with each GC. If you ask for a GC that doesn't exist, you'll get all 0's in the info, including the . For example, you'll get 0's if you call the method before a GC has happened, or you ask for a GC of and no full blocking GCs have happened. You can use index 0 to detect that no GCs, or no GCs of the kind you specified, have occurred. +A garbage collection (GC) is identified by its , which starts from 1 and increases with each GC. If you ask for a GC that doesn't exist, you'll get all 0's in the info, including the . For example, you'll get 0's if you call the method before a GC has happened, or you ask for a GC of and no full blocking GCs have happened. You can use index 0 to detect that no GCs, or no GCs of the kind you specified, have occurred. ]]> diff --git a/xml/System/GCNotificationStatus.xml b/xml/System/GCNotificationStatus.xml index 9dd2ef3c140..afb887bdf33 100644 --- a/xml/System/GCNotificationStatus.xml +++ b/xml/System/GCNotificationStatus.xml @@ -54,13 +54,13 @@ method to register for a full garbage collection notification. Then use the method or the method to return a enumeration that contains the status of the notification. + Use the method to register for a full garbage collection notification. Then use the method or the method to return a enumeration that contains the status of the notification. ## Examples - The following example obtains a enumeration from the method. If the enumeration returns Succeeded, it calls the custom method `OnFullGCApproachNotify` to perform actions in response to the approaching full garbage collection. This code example is part of a larger example provided for [Garbage Collection Notifications](/dotnet/standard/garbage-collection/notifications) topic. - + The following example obtains a enumeration from the method. If the enumeration returns Succeeded, it calls the custom method `OnFullGCApproachNotify` to perform actions in response to the approaching full garbage collection. This code example is part of a larger example provided for [Garbage Collection Notifications](/dotnet/standard/garbage-collection/notifications) topic. + :::code language="csharp" source="~/snippets/csharp/System/GC/CancelFullGCNotification/Program.cs" id="Snippet8"::: :::code language="fsharp" source="~/snippets/fsharp/System/GC/CancelFullGCNotification/Program.fs" id="Snippet8"::: :::code language="vb" source="~/snippets/visualbasic/System/GC/CancelFullGCNotification/program.vb" id="Snippet8"::: diff --git a/xml/System/GenericUriParser.xml b/xml/System/GenericUriParser.xml index 97bd304cd45..363b21fd28c 100644 --- a/xml/System/GenericUriParser.xml +++ b/xml/System/GenericUriParser.xml @@ -102,7 +102,7 @@ + Use this constructor as an argument to If you want to create a parser based on a well-known scheme, use , , , , or . diff --git a/xml/System/GenericUriParserOptions.xml b/xml/System/GenericUriParserOptions.xml index 2fc893f410a..80c71a74fa8 100644 --- a/xml/System/GenericUriParserOptions.xml +++ b/xml/System/GenericUriParserOptions.xml @@ -53,7 +53,7 @@ constructor. + You can combine any of these options to configure a generic URI parser by passing the options as a parameter to the constructor. The existing class has been extended to provide support for International Resource Identifiers (IRI) based on RFC 3987. Users upgrading from .NET Framework 2.0 won't see any behavior change unless they specifically enable IRI. This ensures application compatibility with prior versions of the .NET Framework. diff --git a/xml/System/GopherStyleUriParser.xml b/xml/System/GopherStyleUriParser.xml index ba153428742..67bf7397c29 100644 --- a/xml/System/GopherStyleUriParser.xml +++ b/xml/System/GopherStyleUriParser.xml @@ -82,11 +82,11 @@ Creates a customizable parser based on the Gopher scheme. - - + + ]]> diff --git a/xml/System/Guid.xml b/xml/System/Guid.xml index 0417846bba1..be72a06ba7e 100644 --- a/xml/System/Guid.xml +++ b/xml/System/Guid.xml @@ -320,7 +320,7 @@ ## Examples - The following example passes each string listed in the Remarks section to the constructor. + The following example passes each string listed in the Remarks section to the constructor. :::code language="csharp" source="~/snippets/csharp/System/Guid/.ctor/ctor1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Guid/.ctor/ctor1.fs" id="Snippet1"::: @@ -701,7 +701,7 @@ method compares the GUIDs as if they were values provided to the constructor, as follows: + The method compares the GUIDs as if they were values provided to the constructor, as follows: - It compares the values, and returns a result if they are unequal. If they are equal, it performs the next comparison. @@ -715,12 +715,12 @@ If two GUIDs have equal values for a component, the method compares the next component. When it finds a component whose values are unequal, it returns the result. - This method implements the interface and performs slightly better than the method because it does not have to convert the `value` parameter to a value. + This method implements the interface and performs slightly better than the method because it does not have to convert the `value` parameter to a value. ## Examples - The following example calls the method to compare a GUID value with two similar GUID values. + The following example calls the method to compare a GUID value with two similar GUID values. :::code language="csharp" source="~/snippets/csharp/System/Guid/CompareTo/compareto2.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Guid/CompareTo/compareto2.fs" id="Snippet1"::: @@ -801,7 +801,7 @@ ## Remarks The `value` parameter must be `null` or an instance of ; otherwise, an exception is thrown. Any instance of , regardless of its value, is considered greater than `null`. - The method compares the GUIDs as if they were values provided to the constructor, as follows: + The method compares the GUIDs as if they were values provided to the constructor, as follows: - It compares the values, and returns a result if they are unequal. If they are equal, it performs the next comparison. @@ -818,7 +818,7 @@ ## Examples - The following example uses the attribute to assign a GUID to a class. It retrieves the value of this GUID by calling the method and passing the property of the returned object to the method. Then it compares that GUID with an array of values. + The following example uses the attribute to assign a GUID to a class. It retrieves the value of this GUID by calling the method and passing the property of the returned object to the method. Then it compares that GUID with an array of values. :::code language="csharp" source="~/snippets/csharp/System/Guid/CompareTo/compareto1.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/Guid/CompareTo/compareto1.fs" id="Snippet2"::: @@ -946,7 +946,7 @@ field to determine whether a GUID is non-zero. The following example uses the operator to compare two GUID values with to determine whether they consist exclusively of zeros. + You can compare a GUID with the value of the field to determine whether a GUID is non-zero. The following example uses the operator to compare two GUID values with to determine whether they consist exclusively of zeros. :::code language="csharp" source="~/snippets/csharp/System/Guid/Empty/empty.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Guid/Empty/empty.fs" id="Snippet1"::: @@ -1025,7 +1025,7 @@ ## Remarks Two objects are equal if they have identical byte values. - This method performs slightly better than the method because it does not have to box the `g` parameter. + This method performs slightly better than the method because it does not have to box the `g` parameter. ]]> @@ -1272,10 +1272,10 @@ if and are equal; otherwise, . - + ## Examples - The following example uses the operator to compare two GUID values with to determine whether they consist exclusively of zeros. + The following example uses the operator to compare two GUID values with to determine whether they consist exclusively of zeros. :::code language="csharp" source="~/snippets/csharp/System/Guid/Empty/empty.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Guid/Empty/empty.fs" id="Snippet1"::: @@ -1414,7 +1414,7 @@ if and are not equal; otherwise, . - ]]> + ]]> @@ -1570,7 +1570,7 @@ ## Remarks -The method trims any leading or trailing white space characters from `input` and converts the remaining characters in `input` to a value. This method can convert a character span that represents any of the five formats produced by the methods, as shown in the following table. +The method trims any leading or trailing white space characters from `input` and converts the remaining characters in `input` to a value. This method can convert a character span that represents any of the five formats produced by the methods, as shown in the following table. |Specifier|Description|Format| |---------------|-----------------|------------| @@ -1586,9 +1586,9 @@ The method throws a if it is unable to successfull - `input` has too many or too few characters. -- `input` is not in one of the formats recognized by the method and listed in the previous table. +- `input` is not in one of the formats recognized by the method and listed in the previous table. -Use the method to catch any unsuccessful parse operations without having to handle an exception. +Use the method to catch any unsuccessful parse operations without having to handle an exception. ]]> @@ -1649,7 +1649,7 @@ After trimming, the length of the read-only character span is 0. method trims any leading or trailing white space from `input` and converts the string representation of a GUID to a value. This method can convert strings in any of the five formats produced by the and methods, as shown in the following table. + The method trims any leading or trailing white space from `input` and converts the string representation of a GUID to a value. This method can convert strings in any of the five formats produced by the and methods, as shown in the following table. |Specifier|Description|Format| |---------------|-----------------|------------| @@ -1665,12 +1665,12 @@ After trimming, the length of the read-only character span is 0. - `input` has too many or too few characters. -- `input` is not in one of the formats recognized by the method and listed in the previous table. +- `input` is not in one of the formats recognized by the method and listed in the previous table. - Use the method to catch any unsuccessful parse operations without having to handle an exception. + Use the method to catch any unsuccessful parse operations without having to handle an exception. ## Examples - The following example creates a new GUID, converts it to three separate string representations by calling the method with the "B", "D", and "X" format specifiers, and then calls the method to convert the strings back to values. + The following example creates a new GUID, converts it to three separate string representations by calling the method with the "B", "D", and "X" format specifiers, and then calls the method to convert the strings back to values. :::code language="csharp" source="~/snippets/csharp/System/Guid/Parse/parseex1.cs" id="Snippet3"::: :::code language="fsharp" source="~/snippets/fsharp/System/Guid/Parse/parseex1.fs" id="Snippet3"::: @@ -1878,7 +1878,7 @@ After trimming, the length of the read-only character span is 0. ## Remarks -The method requires the read-only character span to convert to be exactly in the format specified by the `format` parameter, after leading and trailing white-space characters are removed. The following table shows the accepted format specifiers for the `format` parameter. "0" represents a digit; hyphens ("-"), braces ("{", "}"), and parentheses ("(", ")") appear as shown. +The method requires the read-only character span to convert to be exactly in the format specified by the `format` parameter, after leading and trailing white-space characters are removed. The following table shows the accepted format specifiers for the `format` parameter. "0" represents a digit; hyphens ("-"), braces ("{", "}"), and parentheses ("(", ")") appear as shown. |Specifier|Format of the `input` parameter| |---------------|-------------------------------------| @@ -1950,7 +1950,7 @@ The method requires the read-only character spa method requires the string to convert to be exactly in the format specified by the `format` parameter, after leading and trailing white-space characters are removed. The following table shows the accepted format specifiers for the `format` parameter. "0" represents a digit; hyphens ("-"), braces ("{", "}"), and parentheses ("(", ")") appear as shown. + The method requires the string to convert to be exactly in the format specified by the `format` parameter, after leading and trailing white-space characters are removed. The following table shows the accepted format specifiers for the `format` parameter. "0" represents a digit; hyphens ("-"), braces ("{", "}"), and parentheses ("(", ")") appear as shown. |Specifier|Format of the `input` parameter| |---------------|-------------------------------------| @@ -1961,7 +1961,7 @@ The method requires the read-only character spa |X|Four hexadecimal values enclosed in braces, where the fourth value is a subset of eight hexadecimal values that is also enclosed in braces:

{0x00000000,0x0000,0x0000,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}| ## Examples - The following example calls the method with each of the supported format specifiers to generate an array of strings that represent a single GUID. These are then passed to the method, which successfully parses only the string that conforms to the "B" format specifier. + The following example calls the method with each of the supported format specifiers to generate an array of strings that represent a single GUID. These are then passed to the method, which successfully parses only the string that conforms to the "B" format specifier. :::code language="csharp" source="~/snippets/csharp/System/Guid/Parse/parseexactex1.cs" id="Snippet4"::: :::code language="fsharp" source="~/snippets/fsharp/System/Guid/Parse/parseexactex1.fs" id="Snippet4"::: @@ -2018,7 +2018,7 @@ The method requires the read-only character spa This member is an explicit interface member implementation. It can only be used when the instance is cast to an interface. -The `CompareTo` method compares the GUIDs as if they were values provided to the constructor, as follows: +The `CompareTo` method compares the GUIDs as if they were values provided to the constructor, as follows: - It compares the values, and returns a result if they are unequal. If they are equal, it performs the next comparison. - It compares the first values, and returns a result if they are unequal. If they are equal, it performs the next comparison. @@ -2029,7 +2029,7 @@ Note that the final eight bytes appear in the string representation of a interface and performs slightly better than the method because it does not have to convert the `value` parameter to a value. +This method implements the interface and performs slightly better than the method because it does not have to convert the `value` parameter to a value. ]]>
@@ -2088,9 +2088,9 @@ The following table shows the accepted format specifiers for the `format` parame |`P`|32 digits separated by hyphens, enclosed in parentheses:

(00000000-0000-0000-0000-000000000000)| |`X`|Four hexadecimal values enclosed in braces, where the fourth value is a subset of eight hexadecimal values that is also enclosed in braces:

{0x00000000,0x0000,0x0000,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}| -The hexadecimal digits a through f are lowercase in the returned string. To convert them to uppercase, call the method on the returned string. +The hexadecimal digits a through f are lowercase in the returned string. To convert them to uppercase, call the method on the returned string. -Because the `provider` parameter is ignored, you cannot use it to provide a custom formatting solution. To represent a value as a string in a format that isn't supported by the standard GUID format strings, call the method with a `provider` object that implements both the and interfaces. For more information, see the ["Custom Formatting with ICustomFormatter"](/dotnet/standard/base-types/formatting-types#custom-formatting-with-icustomformatter) section in the [Formatting Types](/dotnet/standard/base-types/formatting-types) article. +Because the `provider` parameter is ignored, you cannot use it to provide a custom formatting solution. To represent a value as a string in a format that isn't supported by the standard GUID format strings, call the method with a `provider` object that implements both the and interfaces. For more information, see the ["Custom Formatting with ICustomFormatter"](/dotnet/standard/base-types/formatting-types#custom-formatting-with-icustomformatter) section in the [Formatting Types](/dotnet/standard/base-types/formatting-types) article. ]]>
@@ -2249,14 +2249,14 @@ Because the `provider` parameter is ignored, you cannot use it to provide a cust value by calling the constructor. + You can use the byte array returned by this method to round-trip a value by calling the constructor. Note that the order of bytes in the returned byte array is different from the string representation of a value. The order of the beginning four-byte group and the next two two-byte groups is reversed, whereas the order of the last two-byte group and the closing six-byte group is the same. The example provides an illustration. ## Examples - The following example calls the method to create a value, and then calls the method to represent the value as a byte array. It then displays both values to the console. Finally, it instantiates a new value from the byte array and calls its method to show that the two values are identical. + The following example calls the method to create a value, and then calls the method to represent the value as a byte array. It then displays both values to the console. Finally, it instantiates a new value from the byte array and calls its method to show that the two values are identical. :::code language="csharp" source="~/snippets/csharp/System/Guid/ToByteArray/tobytearray3.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Guid/ToByteArray/tobytearray3.fs" id="Snippet1"::: @@ -2444,7 +2444,7 @@ Because the `provider` parameter is ignored, you cannot use it to provide a cust |`P`|32 digits separated by hyphens, enclosed in parentheses:

(00000000-0000-0000-0000-000000000000)| |`X`|Four hexadecimal values enclosed in braces, where the fourth value is a subset of eight hexadecimal values that is also enclosed in braces:

{0x00000000,0x0000,0x0000,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}| - The hexadecimal digits a through f are lowercase in the returned string. To convert them to uppercase, call the method on the returned string. + The hexadecimal digits a through f are lowercase in the returned string. To convert them to uppercase, call the method on the returned string. ]]>
@@ -2535,9 +2535,9 @@ Because the `provider` parameter is ignored, you cannot use it to provide a cust |`P`|32 digits separated by hyphens, enclosed in parentheses:

(00000000-0000-0000-0000-000000000000)| |`X`|Four hexadecimal values enclosed in braces, where the fourth value is a subset of eight hexadecimal values that is also enclosed in braces:

{0x00000000,0x0000,0x0000,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}| - The hexadecimal digits a through f are lowercase in the returned string. To convert them to uppercase, call the method on the returned string. + The hexadecimal digits a through f are lowercase in the returned string. To convert them to uppercase, call the method on the returned string. - Because the `provider` parameter is ignored, you cannot use it to provide a custom formatting solution. To represent a value as a string in a format that isn't supported by the standard GUID format strings, call the method with a `provider` object that implements both the and interfaces. For more information, see the "Custom Formatting with ICustomFormatter" section in the [Formatting Types](/dotnet/standard/base-types/formatting-types) article. + Because the `provider` parameter is ignored, you cannot use it to provide a custom formatting solution. To represent a value as a string in a format that isn't supported by the standard GUID format strings, call the method with a `provider` object that implements both the and interfaces. For more information, see the "Custom Formatting with ICustomFormatter" section in the [Formatting Types](/dotnet/standard/base-types/formatting-types) article. ]]>
@@ -2776,7 +2776,7 @@ Because the `provider` parameter is ignored, you cannot use it to provide a cust method, except that instead of returning the parsed GUID, it returns `false` if `input` is `null` or not in a recognized format, and doesn't throw an exception. It trims any leading or trailing white space from `input` and converts strings in any of the five formats recognized by the and methods, as shown in the following table. + This method is like the method, except that instead of returning the parsed GUID, it returns `false` if `input` is `null` or not in a recognized format, and doesn't throw an exception. It trims any leading or trailing white space from `input` and converts strings in any of the five formats recognized by the and methods, as shown in the following table. |Specifier|Description|Format| |---------------|-----------------|------------| @@ -2787,7 +2787,7 @@ Because the `provider` parameter is ignored, you cannot use it to provide a cust |`X`|Four hexadecimal values enclosed in braces, where the fourth value is a subset of eight hexadecimal values that is also enclosed in braces|{0x00000000,0x0000,0x0000,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}| ## Examples - The following example creates a new GUID, converts it to three separate string representations by calling the method with the "B", "D", and "X" format specifiers, and then calls the method to convert the strings back to values. + The following example creates a new GUID, converts it to three separate string representations by calling the method with the "B", "D", and "X" format specifiers, and then calls the method to convert the strings back to values. :::code language="csharp" source="~/snippets/csharp/System/Guid/Parse/tryparseex1.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/Guid/Parse/tryparseex1.fs" id="Snippet2"::: @@ -3076,7 +3076,7 @@ Because the `provider` parameter is ignored, you cannot use it to provide a cust |X|Four hexadecimal values enclosed in braces, where the fourth value is a subset of eight hexadecimal values that is also enclosed in braces:

{0x00000000,0x0000,0x0000,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}| ## Examples - The following example calls the method with each of the supported format specifiers to generate an array of strings that represent a single GUID. These are then passed to the method, which successfully parses the string that conforms to the "B" format specifier. + The following example calls the method with each of the supported format specifiers to generate an array of strings that represent a single GUID. These are then passed to the method, which successfully parses the string that conforms to the "B" format specifier. :::code language="csharp" source="~/snippets/csharp/System/Guid/Parse/tryparseexactex1.cs" id="Snippet5"::: :::code language="fsharp" source="~/snippets/fsharp/System/Guid/Parse/tryparseexactex1.fs" id="Snippet5"::: diff --git a/xml/System/Half.xml b/xml/System/Half.xml index 8dc24da46a2..e66b4563998 100644 --- a/xml/System/Half.xml +++ b/xml/System/Half.xml @@ -2012,7 +2012,7 @@ This computes `cos(x * π)`. This method correctly handles floating-point values and so `2.0` will return `true` while `2.2` will return `false`. -A return value of `false` does not imply that will return `true`. A number with a fractional portion, for example, `3.3`, is not even or odd. +A return value of `false` does not imply that will return `true`. A number with a fractional portion, for example, `3.3`, is not even or odd. ]]>
@@ -2314,7 +2314,7 @@ This method correctly handles floating-point values and so `2.0` and `3.0` will This method correctly handles floating-point values and so `3.0` will return `true` while `3.3` will return `false`. -A return value of `false` does not imply that will return `true`. A number with a fractional portion, for example, `3.3`, is not even or odd. +A return value of `false` does not imply that will return `true`. A number with a fractional portion, for example, `3.3`, is not even or odd. ]]>
@@ -2356,7 +2356,7 @@ A return value of `false` does not imply that will return `true`. A complex number, `a + bi` for non-zero `b`, is not positive or negative +A return value of `false` does not imply that will return `true`. A complex number, `a + bi` for non-zero `b`, is not positive or negative ]]>
@@ -2825,7 +2825,7 @@ This function checks values against the extended real number line, thus returns ## Remarks -For this method matches the IEEE 754:2019 `maximum` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. +For this method matches the IEEE 754:2019 `maximum` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. ]]>
@@ -2869,7 +2869,7 @@ For this method matches the IEEE 754:2 ## Remarks -For this method matches the IEEE 754:2019 `maximumMagnitude` function. This requires NaN inputs to not be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. +For this method matches the IEEE 754:2019 `maximumMagnitude` function. This requires NaN inputs to not be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. ]]>
@@ -2913,7 +2913,7 @@ For this method matches the IEE ## Remarks -For this method matches the IEEE 754:2019 `maximumMagnitudeNumber` function. This requires NaN inputs to not be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. +For this method matches the IEEE 754:2019 `maximumMagnitudeNumber` function. This requires NaN inputs to not be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. ]]>
@@ -2989,7 +2989,7 @@ For this method matches the IEE ## Remarks -For this method matches the IEEE 754:2019 `maximumNumber` function. This requires NaN inputs to not be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. +For this method matches the IEEE 754:2019 `maximumNumber` function. This requires NaN inputs to not be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. ]]>
@@ -3065,7 +3065,7 @@ For this method matches the IEEE 754:2 ## Remarks -For this method matches the IEEE 754:2019 `minimum` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. +For this method matches the IEEE 754:2019 `minimum` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. ]]>
@@ -3109,7 +3109,7 @@ For this method matches the IEEE 754:2 ## Remarks -For this method matches the IEEE 754:2019 `minimumMagnitude` function. This requires NaN inputs to not be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. +For this method matches the IEEE 754:2019 `minimumMagnitude` function. This requires NaN inputs to not be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. ]]>
@@ -3153,7 +3153,7 @@ For this method matches the IEE ## Remarks -For this method matches the IEEE 754:2019 `minimumMagnitudeNumber` function. This requires NaN inputs to not be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. +For this method matches the IEEE 754:2019 `minimumMagnitudeNumber` function. This requires NaN inputs to not be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. ]]>
@@ -3229,7 +3229,7 @@ For this method matches the IEE ## Remarks -For this method matches the IEEE 754:2019 `minimumNumber` function. This requires NaN inputs to not be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. +For this method matches the IEEE 754:2019 `minimumNumber` function. This requires NaN inputs to not be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. ]]>
diff --git a/xml/System/HashCode.xml b/xml/System/HashCode.xml index 512943c0098..d86e933df93 100644 --- a/xml/System/HashCode.xml +++ b/xml/System/HashCode.xml @@ -76,7 +76,7 @@ The instance methods in this class combine the hash codes of *more than eight* v :::code language="vb" source="~/snippets/visualbasic/System/HashCode/Overview/example2.vb" id="Snippet1"::: The instance methods also combine the hash codes produced by a specific - implementation. + implementation. :::code language="csharp" source="~/snippets/csharp/System/HashCode/Overview/example3.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/HashCode/Overview/example3.fs" id="Snippet1"::: diff --git a/xml/System/HttpStyleUriParser.xml b/xml/System/HttpStyleUriParser.xml index 8f1bac54930..4494dded530 100644 --- a/xml/System/HttpStyleUriParser.xml +++ b/xml/System/HttpStyleUriParser.xml @@ -82,11 +82,11 @@ Create a customizable parser based on the HTTP scheme. - - + + ]]> diff --git a/xml/System/IAppDomainSetup.xml b/xml/System/IAppDomainSetup.xml index eb55506a8f4..bb707d4de66 100644 --- a/xml/System/IAppDomainSetup.xml +++ b/xml/System/IAppDomainSetup.xml @@ -30,11 +30,11 @@ Represents assembly binding information that can be added to an instance of . - and methods to identify the data to use. - + and methods to identify the data to use. + ]]> @@ -60,11 +60,11 @@ Gets or sets the name of the directory containing the application. A containing the name of the application base directory. - has finished its first bind. - + has finished its first bind. + ]]> @@ -138,15 +138,15 @@ Gets or sets the name of the configuration file for an application domain. A that specifies the name of the configuration file. - has finished its first bind. - + has finished its first bind. + ]]> @@ -172,13 +172,13 @@ Gets or sets the directory where dynamically generated files are stored and accessed. A that specifies the directory containing dynamic assemblies. - is created, a directory called the Dynamic Directory can be specified to store dynamic assemblies. This directory is logically located under the , although it can reside in another part of the directory. - - This property cannot be changed after the has finished its first bind. - + is created, a directory called the Dynamic Directory can be specified to store dynamic assemblies. This directory is logically located under the , although it can reside in another part of the directory. + + This property cannot be changed after the has finished its first bind. + ]]> @@ -227,11 +227,11 @@ Gets or sets the list of directories that is combined with the directory to probe for private assemblies. A containing a list of directory names, where each name is separated by a semicolon. - @@ -257,13 +257,13 @@ Gets or sets the private binary directory path used to locate an application. A containing a list of directory names, where each name is separated by a semicolon. - has finished its first bind. - + has finished its first bind. + ]]> @@ -289,15 +289,15 @@ Gets or sets the names of the directories containing assemblies to be shadow copied. A containing a list of directory names, where each name is separated by a semicolon. - , including the directory specified by , are shadow copied by default if this property is not set. - - If an executable file is in use, updates to the executable file are stored in a shadow copy directory. Existing users continue using the original executable file until it terminates, while new users use the shadow copied executable file. - - This property cannot be changed after the has finished its first bind. - + , including the directory specified by , are shadow copied by default if this property is not set. + + If an executable file is in use, updates to the executable file are stored in a shadow copy directory. Existing users continue using the original executable file until it terminates, while new users use the shadow copied executable file. + + This property cannot be changed after the has finished its first bind. + ]]> @@ -323,11 +323,11 @@ Gets or sets a string that indicates whether shadow copying is turned on or off. A containing the value "true" to indicate that shadow copying is turned on; or "false" to indicate that shadow copying is turned off. - has finished its first bind. - + has finished its first bind. + ]]> diff --git a/xml/System/IAsyncDisposable.xml b/xml/System/IAsyncDisposable.xml index 4c595fcbf50..d1d12af5b9c 100644 --- a/xml/System/IAsyncDisposable.xml +++ b/xml/System/IAsyncDisposable.xml @@ -97,7 +97,7 @@ ## Remarks -Use this method to asynchronously close or release unmanaged resources such as files, streams, and handles held by an instance of the class that implements this interface. Using this method instead of enables you to perform a resource-intensive dispose operation without blocking the main thread of a GUI application for a long time. +Use this method to asynchronously close or release unmanaged resources such as files, streams, and handles held by an instance of the class that implements this interface. Using this method instead of enables you to perform a resource-intensive dispose operation without blocking the main thread of a GUI application for a long time. > [!WARNING] > If you are using a class that implements the interface, you should call its `DisposeAsync` implementation when you are finished using the class. For more information, see the "Using an object that implements IAsyncDisposable" section in the topic. diff --git a/xml/System/IAsyncResult.xml b/xml/System/IAsyncResult.xml index dd27ba7ef6e..5879790334a 100644 --- a/xml/System/IAsyncResult.xml +++ b/xml/System/IAsyncResult.xml @@ -58,7 +58,7 @@ interface is implemented by classes containing methods that can operate asynchronously. It is the return type of methods that initiate an asynchronous operation, such as , and it is passed to methods that conclude an asynchronous operation, such as . objects are also passed to methods invoked by delegates when an asynchronous operation completes. + The interface is implemented by classes containing methods that can operate asynchronously. It is the return type of methods that initiate an asynchronous operation, such as , and it is passed to methods that conclude an asynchronous operation, such as . objects are also passed to methods invoked by delegates when an asynchronous operation completes. An object that supports the interface stores state information for an asynchronous operation and provides a synchronization object to allow threads to be signaled when the operation completes. @@ -70,7 +70,7 @@ ## Examples - The following example demonstrates how to use the property to get a , and how to wait for an asynchronous call on a delegate. The is signaled when the asynchronous call completes, and you can wait for it by calling the method. + The following example demonstrates how to use the property to get a , and how to wait for an asynchronous call on a delegate. The is signaled when the asynchronous call completes, and you can wait for it by calling the method. The example consists of two classes: the class that contains the method that is called asynchronously, and the class that contains the `Main` method that makes the call. @@ -214,14 +214,14 @@ until the operation concludes. The return value can be used to perform a , , or operation. + The return value allows the client to wait for an asynchronous operation to complete instead of polling until the operation concludes. The return value can be used to perform a , , or operation. The common language runtime supplies a number of waitable objects, such as , , and , all of which mirror Win32 synchronization primitives. ## Examples - The following example demonstrates how to use the property to get a , and how to wait for an asynchronous call on a delegate. The is signaled when the asynchronous call completes, and you can wait for it by calling the method. + The following example demonstrates how to use the property to get a , and how to wait for an asynchronous call on a delegate. The is signaled when the asynchronous call completes, and you can wait for it by calling the method. The example consists of two classes: the class that contains the method that is called asynchronously, and the class that contains the `Main` method that makes the call. diff --git a/xml/System/ICloneable.xml b/xml/System/ICloneable.xml index fa159c91823..e11552cb4c3 100644 --- a/xml/System/ICloneable.xml +++ b/xml/System/ICloneable.xml @@ -50,11 +50,11 @@ Supports cloning, which creates a new instance of a class with the same value as an existing instance. - interface enables you to provide a customized implementation that creates a copy of an existing object. The interface contains one member, the method, which is intended to provide cloning support beyond that supplied by . For more information about cloning, deep versus shallow copies, and examples, see the method. - + interface enables you to provide a customized implementation that creates a copy of an existing object. The interface contains one member, the method, which is intended to provide cloning support beyond that supplied by . For more information about cloning, deep versus shallow copies, and examples, see the method. + ]]> @@ -104,15 +104,15 @@ Creates a new object that is a copy of the current instance. A new object that is a copy of this instance. - can perform either a deep copy or a shallow copy. In a deep copy, all objects are duplicated; in a shallow copy, only the top-level objects are duplicated and the lower levels contain references. Because callers of cannot depend on the method performing a predictable cloning operation, we recommend that not be implemented in public APIs. - - See for more information on cloning, deep versus shallow copies, and examples. - + can perform either a deep copy or a shallow copy. In a deep copy, all objects are duplicated; in a shallow copy, only the top-level objects are duplicated and the lower levels contain references. Because callers of cannot depend on the method performing a predictable cloning operation, we recommend that not be implemented in public APIs. + + See for more information on cloning, deep versus shallow copies, and examples. + ]]> diff --git a/xml/System/IComparable.xml b/xml/System/IComparable.xml index 98358d2018d..3ae77eb79e7 100644 --- a/xml/System/IComparable.xml +++ b/xml/System/IComparable.xml @@ -58,22 +58,22 @@ , that indicates whether the position of the current instance in the sort order is before, after, or the same as a second object of the same type. The instance's implementation is called automatically by methods such as and . + This interface is implemented by types whose values can be ordered or sorted. It requires that implementing types define a single method, , that indicates whether the position of the current instance in the sort order is before, after, or the same as a second object of the same type. The instance's implementation is called automatically by methods such as and . - The implementation of the method must return an that has one of three values, as shown in the following table. + The implementation of the method must return an that has one of three values, as shown in the following table. |Value|Meaning| |-----------|-------------| -|Less than zero|The current instance precedes the object specified by the method in the sort order.| -|Zero|This current instance occurs in the same position in the sort order as the object specified by the method.| -|Greater than zero|This current instance follows the object specified by the method in the sort order.| +|Less than zero|The current instance precedes the object specified by the method in the sort order.| +|Zero|This current instance occurs in the same position in the sort order as the object specified by the method.| +|Greater than zero|This current instance follows the object specified by the method in the sort order.| All numeric types (such as and ) implement , as do , , and . Custom types should also provide their own implementation of to enable object instances to be ordered or sorted. ## Examples - The following example illustrates the implementation of and the requisite method. + The following example illustrates the implementation of and the requisite method. :::code language="csharp" source="~/snippets/csharp/System/IComparable/Overview/source.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/IComparable/Overview/source.fs" id="Snippet1"::: @@ -153,7 +153,7 @@ method is implemented by types whose values can be ordered or sorted. It is called automatically by methods of non-generic collection objects, such as , to order each member of the array. If a custom class or structure does not implement , its members cannot be ordered and the sort operation can throw an . + The method is implemented by types whose values can be ordered or sorted. It is called automatically by methods of non-generic collection objects, such as , to order each member of the array. If a custom class or structure does not implement , its members cannot be ordered and the sort operation can throw an . This method is only a definition and must be implemented by a specific class or value type to have effect. The meaning of the comparisons specified in the Return Value section ("precedes", "occurs in the same position as", and "follows") depends on the particular implementation. @@ -164,7 +164,7 @@ ## Examples - The following example illustrates the use of to compare a `Temperature` object implementing with another object. The `Temperature` object implements by simply wrapping a call to the method. + The following example illustrates the use of to compare a `Temperature` object implementing with another object. The `Temperature` object implements by simply wrapping a call to the method. :::code language="csharp" source="~/snippets/csharp/System/IComparable/Overview/source.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/IComparable/Overview/source.fs" id="Snippet1"::: diff --git a/xml/System/IComparable`1.xml b/xml/System/IComparable`1.xml index 98901240401..90043a400f1 100644 --- a/xml/System/IComparable`1.xml +++ b/xml/System/IComparable`1.xml @@ -63,24 +63,24 @@ , that indicates whether the position of the current instance in the sort order is before, after, or the same as a second object of the same type. Typically, the method is not called directly from developer code. Instead, it is called automatically by methods such as and . + This interface is implemented by types whose values can be ordered or sorted and provides a strongly typed comparison method for ordering members of a generic collection object. For example, one number can be larger than a second number, and one string can appear in alphabetical order before another. It requires that implementing types define a single method, , that indicates whether the position of the current instance in the sort order is before, after, or the same as a second object of the same type. Typically, the method is not called directly from developer code. Instead, it is called automatically by methods such as and . - Typically, types that provide an implementation also implement the interface. The interface defines the method, which determines the equality of instances of the implementing type. + Typically, types that provide an implementation also implement the interface. The interface defines the method, which determines the equality of instances of the implementing type. - The implementation of the method must return an that has one of three values, as shown in the following table. + The implementation of the method must return an that has one of three values, as shown in the following table. |Value|Meaning| |-----------|-------------| -|Less than zero|This object precedes the object specified by the method in the sort order.| -|Zero|This current instance occurs in the same position in the sort order as the object specified by the method argument.| -|Greater than zero|This current instance follows the object specified by the method argument in the sort order.| +|Less than zero|This object precedes the object specified by the method in the sort order.| +|Zero|This current instance occurs in the same position in the sort order as the object specified by the method argument.| +|Greater than zero|This current instance follows the object specified by the method argument in the sort order.| - All numeric types (such as and ) implement , as do , , and . Custom types should also provide their own implementation of to enable object instances to be ordered or sorted. + All numeric types (such as and ) implement , as do , , and . Custom types should also provide their own implementation of to enable object instances to be ordered or sorted. ## Examples - The following example illustrates the implementation of for a simple `Temperature` object. The example creates a collection of strings with `Temperature` object keys, and adds several pairs of temperatures and strings to the list out of sequence. In the call to the method, the collection uses the implementation to sort the list entries, which are then displayed in order of increasing temperature. + The following example illustrates the implementation of for a simple `Temperature` object. The example creates a collection of strings with `Temperature` object keys, and adds several pairs of temperatures and strings to the list out of sequence. In the call to the method, the collection uses the implementation to sort the list entries, which are then displayed in order of increasing temperature. :::code language="csharp" source="~/snippets/csharp/System/IComparableT/Overview/source.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/IComparableT/Overview/source.fs" id="Snippet1"::: @@ -173,7 +173,7 @@ provides a strongly typed comparison method for ordering members of a generic collection object. Because of this, it is usually not called directly from developer code. Instead, it is called automatically by methods such as and . + provides a strongly typed comparison method for ordering members of a generic collection object. Because of this, it is usually not called directly from developer code. Instead, it is called automatically by methods such as and . This method is only a definition and must be implemented by a specific class or value type to have effect. The meaning of the comparisons specified in the Return Values section ("precedes", "occurs in the same position as", and "follows) depends on the particular implementation. @@ -182,7 +182,7 @@ ## Examples - The following code example illustrates the implementation of for a simple `Temperature` object. The example creates a collection of strings with `Temperature` object keys, and adds several pairs of temperatures and strings to the list out of sequence. In the call to the method, the collection uses the implementation to sort the list entries, which are then displayed in order of increasing temperature. + The following code example illustrates the implementation of for a simple `Temperature` object. The example creates a collection of strings with `Temperature` object keys, and adds several pairs of temperatures and strings to the list out of sequence. In the call to the method, the collection uses the implementation to sort the list entries, which are then displayed in order of increasing temperature. :::code language="csharp" source="~/snippets/csharp/System/IComparableT/Overview/source.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/IComparableT/Overview/source.fs" id="Snippet1"::: diff --git a/xml/System/IConvertible.xml b/xml/System/IConvertible.xml index a3ab5f35bc6..3384149a900 100644 --- a/xml/System/IConvertible.xml +++ b/xml/System/IConvertible.xml @@ -62,7 +62,7 @@ ## Remarks This interface provides methods to convert the value of an instance of an implementing type to a common language runtime type that has an equivalent value. The common language runtime types are , , , , , , , , , , , , , , and . - If there is no meaningful conversion to a common language runtime type, then a particular interface method implementation throws . For example, if this interface is implemented on a Boolean type, the implementation of the method throws an exception because there is no meaningful equivalent to a Boolean type. + If there is no meaningful conversion to a common language runtime type, then a particular interface method implementation throws . For example, if this interface is implemented on a Boolean type, the implementation of the method throws an exception because there is no meaningful equivalent to a Boolean type. The common language runtime typically exposes the interface through the class. The common language runtime also uses the interface internally, in explicit interface implementations, to simplify the code used to support conversions in the class and basic common language runtime types. @@ -72,7 +72,7 @@ ## Examples The following code sample demonstrates an implementation of for a Complex number class, allowing it to be cast first as a and then calling the static members on that . - + :::code language="csharp" source="~/snippets/csharp/System/IConvertible/Overview/iconvertible.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/IConvertible/Overview/iconvertible.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/IConvertible/Overview/iconvertible.vb" id="Snippet1"::: diff --git a/xml/System/ICustomFormatter.xml b/xml/System/ICustomFormatter.xml index 0132a2aad0e..c0bc79f4f2c 100644 --- a/xml/System/ICustomFormatter.xml +++ b/xml/System/ICustomFormatter.xml @@ -58,29 +58,29 @@ interface includes a single method, . When this interface is implemented by a reference or value type, the method returns a custom-formatted string representation of an object's value. + The interface includes a single method, . When this interface is implemented by a reference or value type, the method returns a custom-formatted string representation of an object's value. - Typically, the interface is implemented with the interface to customize the behavior of two .NET Framework composite string formatting methods that include an parameter. Specifically, the interface can provide custom formatting of the value of an object passed to the and methods. + Typically, the interface is implemented with the interface to customize the behavior of two .NET Framework composite string formatting methods that include an parameter. Specifically, the interface can provide custom formatting of the value of an object passed to the and methods. Providing a custom representation of an object's value requires that you do the following: -1. Define a class that implements the interface and its single member, the method. +1. Define a class that implements the interface and its single member, the method. -2. Define a class that implements the interface and its single member, the method. The method returns an instance of your implementation. Often, a single class implements both and . In that case, the class's `GetFormat` implementation just returns an instance of itself. +2. Define a class that implements the interface and its single member, the method. The method returns an instance of your implementation. Often, a single class implements both and . In that case, the class's `GetFormat` implementation just returns an instance of itself. -3. Pass the implementation as the `provider` argument of the method or a comparable method. +3. Pass the implementation as the `provider` argument of the method or a comparable method. The .NET library method will then use your custom formatting instead of its own. ## Examples - The following example implements to allow binary, octal, and hexadecimal formatting of integral values. In this example, a single class, `MyFormatter`, implements both and . Its method determines whether the `formatType` parameter represents an type. If it does, `MyFormatter` returns an instance of itself; otherwise, it returns `null`. Its implementation determines whether the format parameter is one of the three supported format strings ("B" for binary, "O" for octal, and "H" for hexadecimal) and formats the `arg` parameter appropriately. Otherwise, if `arg` is not `null`, it calls the `arg` parameter's implementation, if one exists, or its parameterless `ToString` method, if one does not. If `arg` is `null`, the method returns . + The following example implements to allow binary, octal, and hexadecimal formatting of integral values. In this example, a single class, `MyFormatter`, implements both and . Its method determines whether the `formatType` parameter represents an type. If it does, `MyFormatter` returns an instance of itself; otherwise, it returns `null`. Its implementation determines whether the format parameter is one of the three supported format strings ("B" for binary, "O" for octal, and "H" for hexadecimal) and formats the `arg` parameter appropriately. Otherwise, if `arg` is not `null`, it calls the `arg` parameter's implementation, if one exists, or its parameterless `ToString` method, if one does not. If `arg` is `null`, the method returns . :::code language="csharp" source="~/snippets/csharp/System/ICustomFormatter/Overview/myformatter.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/ICustomFormatter/Overview/myformatter.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/ICustomFormatter/Overview/myformatter.vb" id="Snippet1"::: - `MyFormatter` can then be used to provide custom formatting by passing a `MyFormatter` object as the `provider` parameter of the method, as the following example shows. + `MyFormatter` can then be used to provide custom formatting by passing a `MyFormatter` object as the `provider` parameter of the method, as the following example shows. :::code language="csharp" source="~/snippets/csharp/System/ICustomFormatter/Overview/myformatter.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/ICustomFormatter/Overview/myformatter.fs" id="Snippet2"::: @@ -174,7 +174,7 @@ is a callback method. It is called by a method that supports custom formatting, such as or . The implementation is called once for each format item in a [composite format string](/dotnet/standard/base-types/composite-formatting). For example, in the following statement, the method is called three times. + is a callback method. It is called by a method that supports custom formatting, such as or . The implementation is called once for each format item in a [composite format string](/dotnet/standard/base-types/composite-formatting). For example, in the following statement, the method is called three times. :::code language="csharp" source="~/snippets/csharp/System/ICustomFormatter/Overview/myformatter.cs" id="Snippet4"::: :::code language="fsharp" source="~/snippets/fsharp/System/ICustomFormatter/Overview/myformatter.fs" id="Snippet4"::: @@ -186,7 +186,7 @@ The `formatProvider` parameter is the implementation that provides formatting for `arg`. Typically, it is an instance of your implementation. If `formatProvider` is `null`, ignore that parameter. - Your implementation of the method must include the following functionality so the .NET Framework can provide formatting you do not support. If your format method does not support a format, determine whether the object being formatted implements the interface. If it does, invoke the method of that interface. Otherwise, invoke the default method of the underlying object. The following code illustrates this pattern. + Your implementation of the method must include the following functionality so the .NET Framework can provide formatting you do not support. If your format method does not support a format, determine whether the object being formatted implements the interface. If it does, invoke the method of that interface. Otherwise, invoke the default method of the underlying object. The following code illustrates this pattern. :::code language="csharp" source="~/snippets/csharp/System/ICustomFormatter/Overview/myformatter.cs" id="Snippet3"::: :::code language="fsharp" source="~/snippets/fsharp/System/ICustomFormatter/Overview/myformatter.fs" id="Snippet3"::: @@ -195,13 +195,13 @@ ## Examples - The following example implements to allow binary, octal, and hexadecimal formatting of integral values. Its implementation determines whether the format parameter is one of the three supported format strings ("B" for binary, "O" for octal, and "H" for hexadecimal) and formats the `arg` parameter appropriately. Otherwise, if `arg` is not `null`, it calls the `arg` parameter's implementation, if one exists, or its parameterless `ToString` method, if one does not. If `arg` is `null`, the method returns . + The following example implements to allow binary, octal, and hexadecimal formatting of integral values. Its implementation determines whether the format parameter is one of the three supported format strings ("B" for binary, "O" for octal, and "H" for hexadecimal) and formats the `arg` parameter appropriately. Otherwise, if `arg` is not `null`, it calls the `arg` parameter's implementation, if one exists, or its parameterless `ToString` method, if one does not. If `arg` is `null`, the method returns . :::code language="csharp" source="~/snippets/csharp/System/ICustomFormatter/Overview/myformatter.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/ICustomFormatter/Overview/myformatter.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/ICustomFormatter/Overview/myformatter.vb" id="Snippet1"::: - `MyFormatter` can then be used to provide custom formatting by passing a `MyFormatter` object as the `provider` parameter of the method, as the following example shows. + `MyFormatter` can then be used to provide custom formatting by passing a `MyFormatter` object as the `provider` parameter of the method, as the following example shows. :::code language="csharp" source="~/snippets/csharp/System/ICustomFormatter/Overview/myformatter.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/ICustomFormatter/Overview/myformatter.fs" id="Snippet2"::: diff --git a/xml/System/IDisposable.xml b/xml/System/IDisposable.xml index 590b4f7b608..31dd0a78382 100644 --- a/xml/System/IDisposable.xml +++ b/xml/System/IDisposable.xml @@ -118,31 +118,31 @@ Use this method to close or release unmanaged resources such as files, streams, and handles held by an instance of the class that implements this interface. By convention, this method is used for all tasks associated with freeing resources held by an object, or preparing an object for reuse. > [!WARNING] -> If you are using a class that implements the interface, you should call its implementation when you are finished using the class. For more information, see the "Using an object that implements IDisposable" section in the topic. +> If you are using a class that implements the interface, you should call its implementation when you are finished using the class. For more information, see the "Using an object that implements IDisposable" section in the topic. - When implementing this method, ensure that all held resources are freed by propagating the call through the containment hierarchy. For example, if an object A allocates an object B, and object B allocates an object C, then A's implementation must call on B, which must in turn call on C. + When implementing this method, ensure that all held resources are freed by propagating the call through the containment hierarchy. For example, if an object A allocates an object B, and object B allocates an object C, then A's implementation must call on B, which must in turn call on C. > [!IMPORTANT] -> The C++ compiler supports deterministic disposal of resources and doesn't allow direct implementation of the method. +> The C++ compiler supports deterministic disposal of resources and doesn't allow direct implementation of the method. - An object must also call the method of its base class if the base class implements . For more information about implementing on a base class and its subclasses, see the "IDisposable and the inheritance hierarchy" section in the topic. + An object must also call the method of its base class if the base class implements . For more information about implementing on a base class and its subclasses, see the "IDisposable and the inheritance hierarchy" section in the topic. - If an object's method is called more than once, the object must ignore all calls after the first one. The object must not throw an exception if its method is called multiple times. Instance methods other than can throw an when resources are already disposed. + If an object's method is called more than once, the object must ignore all calls after the first one. The object must not throw an exception if its method is called multiple times. Instance methods other than can throw an when resources are already disposed. - Users might expect a resource type to use a particular convention to denote an allocated state versus a freed state. An example of this is stream classes, which are traditionally thought of as open or closed. The implementer of a class that has such a convention might choose to implement a public method with a customized name, such as `Close`, that calls the method. + Users might expect a resource type to use a particular convention to denote an allocated state versus a freed state. An example of this is stream classes, which are traditionally thought of as open or closed. The implementer of a class that has such a convention might choose to implement a public method with a customized name, such as `Close`, that calls the method. - Because the method must be called explicitly, there is always a danger that the unmanaged resources will not be released, because the consumer of an object fails to call its method. There are two ways to avoid this: + Because the method must be called explicitly, there is always a danger that the unmanaged resources will not be released, because the consumer of an object fails to call its method. There are two ways to avoid this: -- Wrap the managed resource in an object derived from . Your implementation then calls the method of the instances. For more information, see "The SafeHandle alternative" section in the topic. +- Wrap the managed resource in an object derived from . Your implementation then calls the method of the instances. For more information, see "The SafeHandle alternative" section in the topic. -- Implement a finalizer to free resources when is not called. By default, the garbage collector automatically calls an object's finalizer before reclaiming its memory. However, if the method has been called, it is typically unnecessary for the garbage collector to call the disposed object's finalizer. To prevent automatic finalization, implementations can call the method. +- Implement a finalizer to free resources when is not called. By default, the garbage collector automatically calls an object's finalizer before reclaiming its memory. However, if the method has been called, it is typically unnecessary for the garbage collector to call the disposed object's finalizer. To prevent automatic finalization, implementations can call the method. - When you use an object that accesses unmanaged resources, such as a , a good practice is to create the instance with a `using` statement. The `using` statement automatically closes the stream and calls on the object when the code that is using it has completed. For an example, see the class. + When you use an object that accesses unmanaged resources, such as a , a good practice is to create the instance with a `using` statement. The `using` statement automatically closes the stream and calls on the object when the code that is using it has completed. For an example, see the class. ## Examples - The following example shows how you can implement the method. + The following example shows how you can implement the method. :::code language="csharp" source="~/snippets/csharp/System/IDisposable/Overview/idisposabledispose.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/IDisposable/Overview/idisposabledispose.fs" id="Snippet1"::: diff --git a/xml/System/IEquatable`1.xml b/xml/System/IEquatable`1.xml index effb6028ce3..bac48735d93 100644 --- a/xml/System/IEquatable`1.xml +++ b/xml/System/IEquatable`1.xml @@ -56,17 +56,17 @@ method to create a type-specific method suitable for determining equality of instances. + This interface is implemented by types whose values can be equated (for example, the numeric and string classes). A value type or class implements the method to create a type-specific method suitable for determining equality of instances. > [!NOTE] -> The interface defines the method, which determines the sort order of instances of the implementing type. The interface defines the method, which determines the equality of instances of the implementing type. +> The interface defines the method, which determines the sort order of instances of the implementing type. The interface defines the method, which determines the equality of instances of the implementing type. - The interface is used by generic collection objects such as , , and when testing for equality in such methods as `Contains`, `IndexOf`, `LastIndexOf`, and `Remove`. It should be implemented for any object that might be stored in a generic collection. + The interface is used by generic collection objects such as , , and when testing for equality in such methods as `Contains`, `IndexOf`, `LastIndexOf`, and `Remove`. It should be implemented for any object that might be stored in a generic collection. -For more information about implementing the interface, see remarks on the method. +For more information about implementing the interface, see remarks on the method. ## Examples - The following example shows the partial implementation of a `Person` class that implements and has two properties, `LastName` and `NationalId`. `NationalId` is considered to be a unique identifier, therefore the method returns `True` if the `NationalId` property of two `Person` objects is identical; otherwise, it returns `False`. + The following example shows the partial implementation of a `Person` class that implements and has two properties, `LastName` and `NationalId`. `NationalId` is considered to be a unique identifier, therefore the method returns `True` if the `NationalId` property of two `Person` objects is identical; otherwise, it returns `False`. (Note that the F# example does not handle `null` values for `Person` instances.) :::code language="csharp" source="~/snippets/csharp/System/IEquatableT/Equals/EqualsExample.cs" id="Person"::: @@ -150,35 +150,35 @@ For more information about implementing the interfa method is intended to perform a test for equality with another object of type `T`, the same type as the current object. The method is called in the following circumstances: + The implementation of the method is intended to perform a test for equality with another object of type `T`, the same type as the current object. The method is called in the following circumstances: -- When the `Equals` method is called and the `other` argument is a strongly-typed object of type `T`. (If `other` is not of type `T`, the base method is called. Of the two methods, offers slightly better performance.) +- When the `Equals` method is called and the `other` argument is a strongly-typed object of type `T`. (If `other` is not of type `T`, the base method is called. Of the two methods, offers slightly better performance.) - When the search methods of a number of generic collection objects are called. Some of these types and their methods include the following: - - Some of the generic overloads of the method. + - Some of the generic overloads of the method. - - The search methods of the class, including , , , and . + - The search methods of the class, including , , , and . - - The search methods of the class, including and . + - The search methods of the class, including and . - - The search methods of the generic class, including and . + - The search methods of the generic class, including and . - In other words, to handle the possibility that objects of a class will be stored in an array or a generic collection object, it is a good idea to implement so that the object can be easily identified and manipulated. + In other words, to handle the possibility that objects of a class will be stored in an array or a generic collection object, it is a good idea to implement so that the object can be easily identified and manipulated. - When implementing the method, define equality appropriately for the type specified by the generic type argument. For example, if the type argument is , define equality appropriately for the comparison of two 32-bit signed integers. + When implementing the method, define equality appropriately for the type specified by the generic type argument. For example, if the type argument is , define equality appropriately for the comparison of two 32-bit signed integers. ## Examples - The following example shows the partial implementation of a `Person` class that implements and has two properties, `LastName` and `NationalId`. `NationalId` is considered to be a unique identifier, therefore the method returns `True` if the `NationalId` property of two `Person` objects is identical; otherwise, it returns `False`. + The following example shows the partial implementation of a `Person` class that implements and has two properties, `LastName` and `NationalId`. `NationalId` is considered to be a unique identifier, therefore the method returns `True` if the `NationalId` property of two `Person` objects is identical; otherwise, it returns `False`. (Note that the F# example does not handle `null` values for `Person` instances.) :::code language="csharp" source="~/snippets/csharp/System/IEquatableT/Equals/EqualsExample.cs" id="Person"::: :::code language="fsharp" source="~/snippets/fsharp/System/IEquatableT/Equals/EqualsExample.fs" id="Person"::: :::code language="vb" source="~/snippets/visualbasic/System/IEquatableT/Overview/EqualsExample.vb" id="Person"::: - When a `Person` is stored in a , `Contains` uses its implementation to search for a match. + When a `Person` is stored in a , `Contains` uses its implementation to search for a match. :::code language="csharp" source="~/snippets/csharp/System/IEquatableT/Equals/EqualsExample.cs" id="PersonSample"::: :::code language="fsharp" source="~/snippets/fsharp/System/IEquatableT/Equals/EqualsExample.fs" id="PersonSample"::: diff --git a/xml/System/IFormatProvider.xml b/xml/System/IFormatProvider.xml index a553a0750f7..0324cfd49c5 100644 --- a/xml/System/IFormatProvider.xml +++ b/xml/System/IFormatProvider.xml @@ -58,11 +58,11 @@ interface supplies an object that provides formatting information for formatting and parsing operations. Formatting operations convert the value of a type to the string representation of that value. Typical formatting methods are the `ToString` methods of a type, as well as . Parsing operations convert the string representation of a value to a type with that value. Typical parsing methods are `Parse` and `TryParse`. + The interface supplies an object that provides formatting information for formatting and parsing operations. Formatting operations convert the value of a type to the string representation of that value. Typical formatting methods are the `ToString` methods of a type, as well as . Parsing operations convert the string representation of a value to a type with that value. Typical parsing methods are `Parse` and `TryParse`. - The interface consists of a single method, . is a callback method: The parsing or formatting method calls it and passes it a object that represents the type of object that the formatting or parsing method expects will provide formatting information. The method is responsible for returning an object of that type. + The interface consists of a single method, . is a callback method: The parsing or formatting method calls it and passes it a object that represents the type of object that the formatting or parsing method expects will provide formatting information. The method is responsible for returning an object of that type. - implementations are often used implicitly by formatting and parsing methods. For example, the method implicitly uses an implementation that represents the system's current culture. implementations can also be specified explicitly by methods that have a parameter of type , such as and . + implementations are often used implicitly by formatting and parsing methods. For example, the method implicitly uses an implementation that represents the system's current culture. implementations can also be specified explicitly by methods that have a parameter of type , such as and . The .NET Framework includes the following three predefined implementations to provide culture-specific information that is used in formatting or parsing numeric and date and time values: @@ -70,9 +70,9 @@ - The class, which provides information that is used to format dates and times, such as the date and time separator symbols for a particular culture or the order and format of a date's year, month, and day components. For information about the predefined format strings recognized by a object and used in numeric formatting operations, see [Standard Date and Time Format Strings](/dotnet/standard/base-types/standard-date-and-time-format-strings) and [Custom Date and Time Format Strings](/dotnet/standard/base-types/custom-date-and-time-format-strings). -- The class, which represents a particular culture. Its method returns a culture-specific or object, depending on whether the object is used in a formatting or parsing operation that involves numbers or dates and times. +- The class, which represents a particular culture. Its method returns a culture-specific or object, depending on whether the object is used in a formatting or parsing operation that involves numbers or dates and times. - The .NET Framework also supports custom formatting. This typically involves the creation of a formatting class that implements both and . An instance of this class is then passed as a parameter to a method that performs a custom formatting operation, such as The example provides an illustration of such a custom implementation that formats a number as a 12-digit account number. + The .NET Framework also supports custom formatting. This typically involves the creation of a formatting class that implements both and . An instance of this class is then passed as a parameter to a method that performs a custom formatting operation, such as The example provides an illustration of such a custom implementation that formats a number as a 12-digit account number. @@ -83,13 +83,13 @@ :::code language="fsharp" source="~/snippets/fsharp/System/IFormatProvider/Overview/provider2.fs" id="Snippet3"::: :::code language="vb" source="~/snippets/visualbasic/System/IFormatProvider/Overview/provider2.vb" id="Snippet3"::: - The following example illustrates the use of a class that implements the interface and the method. The `AcctNumberFormat` class converts an value that represents an account number to a formatted 12-digit account number. Its `GetFormat` method returns a reference to the current `AcctNumberFormat` instance if the `formatType` parameter refers to a class that implements ; otherwise, `GetFormat` returns `null`. + The following example illustrates the use of a class that implements the interface and the method. The `AcctNumberFormat` class converts an value that represents an account number to a formatted 12-digit account number. Its `GetFormat` method returns a reference to the current `AcctNumberFormat` instance if the `formatType` parameter refers to a class that implements ; otherwise, `GetFormat` returns `null`. :::code language="csharp" source="~/snippets/csharp/System/IFormatProvider/Overview/Provider.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/IFormatProvider/Overview/Provider.fs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System/IFormatProvider/Overview/Provider.vb" id="Snippet2"::: - The class that implements can then be used in a call to a formatting and parsing operation. For example, the following code calls the method to generate a string that contains a formatted 12-digit account number. + The class that implements can then be used in a call to a formatting and parsing operation. For example, the following code calls the method to generate a string that contains a formatted 12-digit account number. :::code language="csharp" source="~/snippets/csharp/System/IFormatProvider/Overview/Provider.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/IFormatProvider/Overview/Provider.fs" id="Snippet1"::: @@ -155,22 +155,22 @@ is a callback method that formatting and parsing methods invoke to retrieve information about the format of the input string in parsing operations or the format of the output string in formatting operations. In the `formatType` parameter, the formatting or parsing method passes the type of object it requires to perform its operation. If the implementation can supply this formatting or parsing object, it returns that object. If not, it returns `null`. + is a callback method that formatting and parsing methods invoke to retrieve information about the format of the input string in parsing operations or the format of the output string in formatting operations. In the `formatType` parameter, the formatting or parsing method passes the type of object it requires to perform its operation. If the implementation can supply this formatting or parsing object, it returns that object. If not, it returns `null`. - For example, in the call to the method, the method argument is an object that provides information about how the string representation of the current integer instance might be formatted. When the runtime executes the method, it calls the object's method and passes it a object that represents the type. If the object can supply a object, it returns that object. If it cannot supply an object of that type, it returns `null`. + For example, in the call to the method, the method argument is an object that provides information about how the string representation of the current integer instance might be formatted. When the runtime executes the method, it calls the object's method and passes it a object that represents the type. If the object can supply a object, it returns that object. If it cannot supply an object of that type, it returns `null`. - You can implement the interface and the method in classes that provide custom formatting or parsing services. The implementation is then passed as an argument to any overload of a parsing or formatting method that has a parameter of type , such as , , or . + You can implement the interface and the method in classes that provide custom formatting or parsing services. The implementation is then passed as an argument to any overload of a parsing or formatting method that has a parameter of type , such as , , or . ## Examples - The following example illustrates the use of a class that implements the interface and the method. The `AcctNumberFormat` class converts an value that represents an account number to a formatted 12-digit account number. Its `GetFormat` method returns a reference to itself if the `formatType` parameter refers to a class that implements ; otherwise, `GetFormat` returns `null`. + The following example illustrates the use of a class that implements the interface and the method. The `AcctNumberFormat` class converts an value that represents an account number to a formatted 12-digit account number. Its `GetFormat` method returns a reference to itself if the `formatType` parameter refers to a class that implements ; otherwise, `GetFormat` returns `null`. :::code language="csharp" source="~/snippets/csharp/System/IFormatProvider/Overview/Provider.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/IFormatProvider/Overview/Provider.fs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System/IFormatProvider/Overview/Provider.vb" id="Snippet2"::: - An instance of the `AcctNumberFormat` class can then be passed as an argument to a method that provides formatting or parsing services. For example, the following code passes an `AcctNumberFormat` class to the method to generate a formatted 12-digit account number. + An instance of the `AcctNumberFormat` class can then be passed as an argument to a method that provides formatting or parsing services. For example, the following code passes an `AcctNumberFormat` class to the method to generate a formatted 12-digit account number. :::code language="csharp" source="~/snippets/csharp/System/IFormatProvider/Overview/Provider.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/IFormatProvider/Overview/Provider.fs" id="Snippet1"::: diff --git a/xml/System/IFormattable.xml b/xml/System/IFormattable.xml index beab64aca94..1d6fc112dc8 100644 --- a/xml/System/IFormattable.xml +++ b/xml/System/IFormattable.xml @@ -82,20 +82,20 @@ In addition, you can define your own custom format providers to supply culture-specific, profession-specific, or industry-specific information used in formatting. For more information about implementing custom formatting by using a custom format provider, see . - The interface defines a single method, , that supplies formatting services for the implementing type. The method can be called directly. In addition, it is called automatically by the and methods, and by methods that use the [composite formatting feature](/dotnet/standard/base-types/composite-formatting) in the .NET Framework. Such methods include , , and , among others. The method is called for each format item in the method's format string. + The interface defines a single method, , that supplies formatting services for the implementing type. The method can be called directly. In addition, it is called automatically by the and methods, and by methods that use the [composite formatting feature](/dotnet/standard/base-types/composite-formatting) in the .NET Framework. Such methods include , , and , among others. The method is called for each format item in the method's format string. The interface is implemented by the base data types. ## Examples - The following example defines a `Temperature` class that implements the interface. The class supports four format specifiers: "G" and "C", which indicate that the temperature is to be displayed in Celsius; "F", which indicates that the temperature is to be displayed in Fahrenheit; and "K", which indicates that the temperature is to be displayed in Kelvin. In addition, the implementation also can handle a format string that is `null` or empty. The other two `ToString` methods defined by the `Temperature` class simply wrap a call to the implementation. + The following example defines a `Temperature` class that implements the interface. The class supports four format specifiers: "G" and "C", which indicate that the temperature is to be displayed in Celsius; "F", which indicates that the temperature is to be displayed in Fahrenheit; and "K", which indicates that the temperature is to be displayed in Kelvin. In addition, the implementation also can handle a format string that is `null` or empty. The other two `ToString` methods defined by the `Temperature` class simply wrap a call to the implementation. :::code language="csharp" source="~/snippets/csharp/System/IFormattable/Overview/example1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/IFormattable/Overview/example1.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/IFormattable/Overview/example1.vb" id="Snippet1"::: - The following example then calls the implementation either directly or by using a composite format string. + The following example then calls the implementation either directly or by using a composite format string. :::code language="csharp" source="~/snippets/csharp/System/IFormattable/Overview/example1.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/IFormattable/Overview/example1.fs" id="Snippet2"::: @@ -176,20 +176,20 @@ method converts a value to a string representation that can be expressed in multiple ways. Its precise format depends on specific symbols or a specified order defined by specific cultures, professions, or industries. You can call the method directly. It is also called automatically by the and methods, and by methods that use the composite formatting feature in the .NET Framework, such as , , and . (For more information, see [Composite Formatting](/dotnet/standard/base-types/composite-formatting).) + The method converts a value to a string representation that can be expressed in multiple ways. Its precise format depends on specific symbols or a specified order defined by specific cultures, professions, or industries. You can call the method directly. It is also called automatically by the and methods, and by methods that use the composite formatting feature in the .NET Framework, such as , , and . (For more information, see [Composite Formatting](/dotnet/standard/base-types/composite-formatting).) - Composite formatting methods call the method once for each format item in a format string. The parameters passed to the method depend on the specific formatting method that is called and on the content of the format item, as follows: + Composite formatting methods call the method once for each format item in a format string. The parameters passed to the method depend on the specific formatting method that is called and on the content of the format item, as follows: - If the format item does not include a format string (for example, if the format item is simply `{0}`), it is passed `null` as the value of the parameter. - If the format item includes a format string (for example, `{0:G}`), that format string is passed as the value of the parameter. -- If the original method call does not include an parameter, is passed as the value of the parameter. +- If the original method call does not include an parameter, is passed as the value of the parameter. - If the original method call includes an parameter, the provider that is supplied in the method call is passed as the value of the parameter. > [!NOTE] -> An object's implementation is called by composite formatting methods only if they are not passed an format provider, or if the method of the custom format provider returns `null`. +> An object's implementation is called by composite formatting methods only if they are not passed an format provider, or if the method of the custom format provider returns `null`. The .NET Framework includes three format providers, all of which implement the interface: @@ -204,7 +204,7 @@ ## Examples - The following example demonstrates a `Temperature` class that implements the method. This code example is part of a larger example provided for the class. + The following example demonstrates a `Temperature` class that implements the method. This code example is part of a larger example provided for the class. :::code language="csharp" source="~/snippets/csharp/System/IFormattable/Overview/example1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/IFormattable/Overview/example1.fs" id="Snippet1"::: diff --git a/xml/System/IObservable`1.xml b/xml/System/IObservable`1.xml index 726767d0cf4..8988630b25c 100644 --- a/xml/System/IObservable`1.xml +++ b/xml/System/IObservable`1.xml @@ -64,19 +64,19 @@ and interfaces provide a generalized mechanism for push-based notification, also known as the observer design pattern. The interface represents the class that sends notifications (the provider); the interface represents the class that receives them (the observer). `T` represents the class that provides the notification information. In some push-based notifications, the implementation and `T` can represent the same type. + The and interfaces provide a generalized mechanism for push-based notification, also known as the observer design pattern. The interface represents the class that sends notifications (the provider); the interface represents the class that receives them (the observer). `T` represents the class that provides the notification information. In some push-based notifications, the implementation and `T` can represent the same type. - The provider must implement a single method, , that indicates that an observer wants to receive push-based notifications. Callers to the method pass an instance of the observer. The method returns an implementation that enables observers to cancel notifications at any time before the provider has stopped sending them. + The provider must implement a single method, , that indicates that an observer wants to receive push-based notifications. Callers to the method pass an instance of the observer. The method returns an implementation that enables observers to cancel notifications at any time before the provider has stopped sending them. - At any given time, a given provider may have zero, one, or multiple observers. The provider is responsible for storing references to observers and ensuring that they are valid before it sends notifications. The interface does not make any assumptions about the number of observers or the order in which notifications are sent. + At any given time, a given provider may have zero, one, or multiple observers. The provider is responsible for storing references to observers and ensuring that they are valid before it sends notifications. The interface does not make any assumptions about the number of observers or the order in which notifications are sent. - The provider sends the following three kinds of notifications to the observer by calling methods: + The provider sends the following three kinds of notifications to the observer by calling methods: -- The current data. The provider can call the method to pass the observer a `T` object that has current data, changed data, or fresh data. +- The current data. The provider can call the method to pass the observer a `T` object that has current data, changed data, or fresh data. -- An error condition. The provider can call the method to notify the observer that some error condition has occurred. +- An error condition. The provider can call the method to notify the observer that some error condition has occurred. -- No further data. The provider can call the method to notify the observer that it has finished sending notifications. +- No further data. The provider can call the method to notify the observer that it has finished sending notifications. @@ -87,21 +87,21 @@ :::code language="fsharp" source="~/snippets/fsharp/System/IObservableT/Overview/provider.fs" id="Snippet5"::: :::code language="vb" source="~/snippets/visualbasic/System/IObservableT/Overview/provider.vb" id="Snippet5"::: - The `LocationTracker` class provides the implementation. Its `TrackLocation` method is passed a nullable `Location` object that contains the latitude and longitude data. If the `Location` value is not `null`, the `TrackLocation` method calls the method of each observer. + The `LocationTracker` class provides the implementation. Its `TrackLocation` method is passed a nullable `Location` object that contains the latitude and longitude data. If the `Location` value is not `null`, the `TrackLocation` method calls the method of each observer. :::code language="csharp" source="~/snippets/csharp/System/IObservableT/Overview/provider.cs" id="Snippet6"::: :::code language="fsharp" source="~/snippets/fsharp/System/IObservableT/Overview/provider.fs" id="Snippet6"::: :::code language="vb" source="~/snippets/visualbasic/System/IObservableT/Overview/provider.vb" id="Snippet6"::: - If the `Location` value is `null`, the `TrackLocation` method instantiates a `LocationUnknownException` object, which is shown in the following example. It then calls each observer's method and passes it the `LocationUnknownException` object. Note that `LocationUnknownException` derives from , but does not add any new members. + If the `Location` value is `null`, the `TrackLocation` method instantiates a `LocationUnknownException` object, which is shown in the following example. It then calls each observer's method and passes it the `LocationUnknownException` object. Note that `LocationUnknownException` derives from , but does not add any new members. :::code language="csharp" source="~/snippets/csharp/System/IObservableT/Overview/provider.cs" id="Snippet7"::: :::code language="fsharp" source="~/snippets/fsharp/System/IObservableT/Overview/provider.fs" id="Snippet7"::: :::code language="vb" source="~/snippets/visualbasic/System/IObservableT/Overview/provider.vb" id="Snippet7"::: - Observers register to receive notifications from a `LocationTracker` object by calling its method, which assigns a reference to the observer object to a private generic object. The method returns an `Unsubscriber` object, which is an implementation that enables observers to stop receiving notifications. The `LocationTracker` class also includes an `EndTransmission` method. When no further location data is available, the method calls each observer's method and then clears the internal list of observers. + Observers register to receive notifications from a `LocationTracker` object by calling its method, which assigns a reference to the observer object to a private generic object. The method returns an `Unsubscriber` object, which is an implementation that enables observers to stop receiving notifications. The `LocationTracker` class also includes an `EndTransmission` method. When no further location data is available, the method calls each observer's method and then clears the internal list of observers. - In this example, the `LocationReporter` class provides the implementation. It displays information about the current location to the console. Its constructor includes a `name` parameter, which enables the `LocationReporter` instance to identify itself in its string output. It also includes a `Subscribe` method, which wraps a call to the provider's method. This allows the method to assign the returned reference to a private variable. The `LocationReporter` class also includes an `Unsubscribe` method, which calls the method of the object that is returned by the method. The following code defines the `LocationReporter` class. + In this example, the `LocationReporter` class provides the implementation. It displays information about the current location to the console. Its constructor includes a `name` parameter, which enables the `LocationReporter` instance to identify itself in its string output. It also includes a `Subscribe` method, which wraps a call to the provider's method. This allows the method to assign the returned reference to a private variable. The `LocationReporter` class also includes an `Unsubscribe` method, which calls the method of the object that is returned by the method. The following code defines the `LocationReporter` class. :::code language="csharp" source="~/snippets/csharp/System/IObservableT/Overview/observer.cs" id="Snippet8"::: :::code language="fsharp" source="~/snippets/fsharp/System/IObservableT/Overview/observer.fs" id="Snippet8"::: @@ -168,18 +168,18 @@ method must be called to register an observer for push-based notifications. A typical implementation of the method does the following: + The method must be called to register an observer for push-based notifications. A typical implementation of the method does the following: -- It stores a reference to the observer in a collection object, such as a object. +- It stores a reference to the observer in a collection object, such as a object. -- It returns a reference to an interface. This enables observers to unsubscribe (that is, to stop receiving notifications) before the provider has finished sending them and called the subscriber's method. +- It returns a reference to an interface. This enables observers to unsubscribe (that is, to stop receiving notifications) before the provider has finished sending them and called the subscriber's method. - At any given time, a particular instance of an implementation is responsible for handling all subscriptions and notifying all subscribers. Unless the documentation for a particular implementation indicates otherwise, observers should make no assumptions about the implementation, such as the order of notifications that multiple observers will receive. + At any given time, a particular instance of an implementation is responsible for handling all subscriptions and notifying all subscribers. Unless the documentation for a particular implementation indicates otherwise, observers should make no assumptions about the implementation, such as the order of notifications that multiple observers will receive. ## Examples - The following example illustrates the method for an application that reports latitude and longitude information. It defines an collection object that stores references to all observers. It also returns a private class named `Unsubscriber` that implements the interface and enables subscribers to stop receiving event notifications. See the Example section of the topic for the complete example. + The following example illustrates the method for an application that reports latitude and longitude information. It defines an collection object that stores references to all observers. It also returns a private class named `Unsubscriber` that implements the interface and enables subscribers to stop receiving event notifications. See the Example section of the topic for the complete example. :::code language="csharp" source="~/snippets/csharp/System/IObservableT/Overview/provider.cs" id="Snippet13"::: :::code language="fsharp" source="~/snippets/fsharp/System/IObservableT/Overview/provider.fs" id="Snippet13"::: diff --git a/xml/System/IObserver`1.xml b/xml/System/IObserver`1.xml index 1f55cd36d7d..492adc917db 100644 --- a/xml/System/IObserver`1.xml +++ b/xml/System/IObserver`1.xml @@ -64,17 +64,17 @@ and interfaces provide a generalized mechanism for push-based notification, also known as the observer design pattern. The interface represents the class that sends notifications (the provider); the interface represents the class that receives them (the observer). `T` represents the class that provides the notification information. + The and interfaces provide a generalized mechanism for push-based notification, also known as the observer design pattern. The interface represents the class that sends notifications (the provider); the interface represents the class that receives them (the observer). `T` represents the class that provides the notification information. - An implementation arranges to receive notifications from a provider (an implementation) by passing an instance of itself to the provider's method. This method returns an object that can be used to unsubscribe the observer before the provider finishes sending notifications. + An implementation arranges to receive notifications from a provider (an implementation) by passing an instance of itself to the provider's method. This method returns an object that can be used to unsubscribe the observer before the provider finishes sending notifications. - The interface defines the following three methods that the observer must implement: + The interface defines the following three methods that the observer must implement: -- The method, which is typically called by the provider to supply the observer with new data or state information. +- The method, which is typically called by the provider to supply the observer with new data or state information. -- The method, which is typically called by the provider to indicate that data is unavailable, inaccessible, or corrupted, or that the provider has experienced some other error condition. +- The method, which is typically called by the provider to indicate that data is unavailable, inaccessible, or corrupted, or that the provider has experienced some other error condition. -- The method, which is typically called by the provider to indicate that it has finished sending notifications to observers. +- The method, which is typically called by the provider to indicate that it has finished sending notifications to observers. @@ -85,25 +85,25 @@ :::code language="fsharp" source="~/snippets/fsharp/System/IObservableT/Overview/provider.fs" id="Snippet5"::: :::code language="vb" source="~/snippets/visualbasic/System/IObservableT/Overview/provider.vb" id="Snippet5"::: - The `LocationReporter` class provides the implementation. It displays information about the current location to the console. Its constructor includes a `name` parameter, which allows the `LocationReporter` instance to identify itself in its string output. It also includes a `Subscribe` method, which wraps a call to the provider's method. This enables the method to assign the returned reference to a private variable. The `LocationReporter` class also includes an `Unsubscribe` method, which calls the method of the object returned by the method. The following code defines the `LocationReporter` class. + The `LocationReporter` class provides the implementation. It displays information about the current location to the console. Its constructor includes a `name` parameter, which allows the `LocationReporter` instance to identify itself in its string output. It also includes a `Subscribe` method, which wraps a call to the provider's method. This enables the method to assign the returned reference to a private variable. The `LocationReporter` class also includes an `Unsubscribe` method, which calls the method of the object returned by the method. The following code defines the `LocationReporter` class. :::code language="csharp" source="~/snippets/csharp/System/IObservableT/Overview/observer.cs" id="Snippet8"::: :::code language="fsharp" source="~/snippets/fsharp/System/IObservableT/Overview/observer.fs" id="Snippet8"::: :::code language="vb" source="~/snippets/visualbasic/System/IObservableT/Overview/observer.vb" id="Snippet8"::: - The `LocationTracker` class provides the implementation. Its `TrackLocation` method is passed a nullable `Location` object that contains the latitude and longitude data. If the `Location` value is not `null`, the `TrackLocation` method calls the method of each observer. + The `LocationTracker` class provides the implementation. Its `TrackLocation` method is passed a nullable `Location` object that contains the latitude and longitude data. If the `Location` value is not `null`, the `TrackLocation` method calls the method of each observer. :::code language="csharp" source="~/snippets/csharp/System/IObservableT/Overview/provider.cs" id="Snippet6"::: :::code language="fsharp" source="~/snippets/fsharp/System/IObservableT/Overview/provider.fs" id="Snippet6"::: :::code language="vb" source="~/snippets/visualbasic/System/IObservableT/Overview/provider.vb" id="Snippet6"::: - If the `Location` value is `null`, the `TrackLocation` method instantiates a `LocationNotFoundException` object, which is shown in the following example. It then calls each observer's method and passes it the `LocationNotFoundException` object. Note that `LocationNotFoundException` derives from but does not add any new members. + If the `Location` value is `null`, the `TrackLocation` method instantiates a `LocationNotFoundException` object, which is shown in the following example. It then calls each observer's method and passes it the `LocationNotFoundException` object. Note that `LocationNotFoundException` derives from but does not add any new members. :::code language="csharp" source="~/snippets/csharp/System/IObservableT/Overview/provider.cs" id="Snippet7"::: :::code language="fsharp" source="~/snippets/fsharp/System/IObservableT/Overview/provider.fs" id="Snippet7"::: :::code language="vb" source="~/snippets/visualbasic/System/IObservableT/Overview/provider.vb" id="Snippet7"::: - Observers register to receive notifications from a `TrackLocation` object by calling its method, which assigns a reference to the observer object to a private generic object. The method returns an `Unsubscriber` object, which is an implementation that enables observers to stop receiving notifications. The `LocationTracker` class also includes an `EndTransmission` method. When no further location data is available, the method calls each observer's method and then clears the internal list of observers. + Observers register to receive notifications from a `TrackLocation` object by calling its method, which assigns a reference to the observer object to a private generic object. The method returns an `Unsubscriber` object, which is an implementation that enables observers to stop receiving notifications. The `LocationTracker` class also includes an `EndTransmission` method. When no further location data is available, the method calls each observer's method and then clears the internal list of observers. The following code then instantiates the provider and the observer. @@ -161,12 +161,12 @@ implementation is called, the method can optionally call the method of the object that was returned to the observer when it called the method. + When the observer's implementation is called, the method can optionally call the method of the object that was returned to the observer when it called the method. ## Examples - The following example provides an implementation of the method in a latitude/longitude tracking application. The method simply reports that no further data is available and calls the provider's implementation. See the Example section of the topic for the complete example. + The following example provides an implementation of the method in a latitude/longitude tracking application. The method simply reports that no further data is available and calls the provider's implementation. See the Example section of the topic for the complete example. :::code language="csharp" source="~/snippets/csharp/System/IObservableT/Overview/observer.cs" id="Snippet11"::: :::code language="fsharp" source="~/snippets/fsharp/System/IObservableT/Overview/observer.fs" id="Snippet11"::: @@ -224,12 +224,12 @@ , it does not necessarily represent an exception that is thrown by the provider. It can also represent a routine or expected error condition, such as data that is missing or unavailable. The method should be seen as informational, and the provider should not expect the observer to provide error handling. + Although `error` is an object that is derived from , it does not necessarily represent an exception that is thrown by the provider. It can also represent a routine or expected error condition, such as data that is missing or unavailable. The method should be seen as informational, and the provider should not expect the observer to provide error handling. ## Examples - The following example provides an implementation of the method in a latitude/longitude tracking application. The method simply reports that data is currently unavailable; it does not make use of the object passed to it as a parameter. See the Example section of the topic for the complete example. + The following example provides an implementation of the method in a latitude/longitude tracking application. The method simply reports that data is currently unavailable; it does not make use of the object passed to it as a parameter. See the Example section of the topic for the complete example. :::code language="csharp" source="~/snippets/csharp/System/IObservableT/Overview/observer.cs" id="Snippet10"::: :::code language="fsharp" source="~/snippets/fsharp/System/IObservableT/Overview/observer.fs" id="Snippet10"::: @@ -287,12 +287,12 @@ method, the provider calls the observer's method to provide notifications. + After an observer has called a provider's method, the provider calls the observer's method to provide notifications. ## Examples - The following example provides an implementation of the method in a latitude/longitude tracking application. See the Example section of the topic for the complete example. + The following example provides an implementation of the method in a latitude/longitude tracking application. See the Example section of the topic for the complete example. :::code language="csharp" source="~/snippets/csharp/System/IObservableT/Overview/observer.cs" id="Snippet12"::: :::code language="fsharp" source="~/snippets/fsharp/System/IObservableT/Overview/observer.fs" id="Snippet12"::: diff --git a/xml/System/IServiceProvider.xml b/xml/System/IServiceProvider.xml index 38cfaed9e87..ab75a335fe2 100644 --- a/xml/System/IServiceProvider.xml +++ b/xml/System/IServiceProvider.xml @@ -51,15 +51,15 @@ Defines a mechanism for retrieving a service object; that is, an object that provides custom support to other objects. - method of this interface obtains the object that provides the service. - - The interface is implemented by a number of types, including , , , and . - + method of this interface obtains the object that provides the service. + + The interface is implemented by a number of types, including , , , and . + ]]> @@ -108,10 +108,10 @@ An object that specifies the type of service object to get. Gets the service object of the specified type. - A service object of type . - - -or- - + A service object of type . + + -or- + if there is no service object of type . To be added. diff --git a/xml/System/IndexOutOfRangeException.xml b/xml/System/IndexOutOfRangeException.xml index 81cb2c7ed0b..0a3c2c95bc3 100644 --- a/xml/System/IndexOutOfRangeException.xml +++ b/xml/System/IndexOutOfRangeException.xml @@ -105,7 +105,7 @@ :::code language="fsharp" source="~/snippets/fsharp/System/IndexOutOfRangeException/Overview/negative1.fs" id="Snippet5"::: :::code language="vb" source="~/snippets/visualbasic/System/IndexOutOfRangeException/Overview/negative1.vb" id="Snippet5"::: - In this case, the method returns -1, which is an invalid index value, when it fails to find a match. To correct this error, check the search method's return value before iterating the array, as shown in this example. + In this case, the method returns -1, which is an invalid index value, when it fails to find a match. To correct this error, check the search method's return value before iterating the array, as shown in this example. :::code language="csharp" source="~/snippets/csharp/System/IndexOutOfRangeException/Overview/negative2.cs" id="Snippet6"::: :::code language="fsharp" source="~/snippets/fsharp/System/IndexOutOfRangeException/Overview/negative2.fs" id="Snippet6"::: @@ -115,9 +115,9 @@ - Using a computed value to define the starting index, the ending index, or the number of items to be iterated. If the result of the computation is unexpected, it might result in an exception. You should check your program's logic in calculating the index value and validate the value before iterating the array or collection. The following conditions must all be true; otherwise, an exception is thrown: - - The starting index must be greater than or equal to for the dimension of the array that you want to iterate, or greater than or equal to 0 for a collection. + - The starting index must be greater than or equal to for the dimension of the array that you want to iterate, or greater than or equal to 0 for a collection. - - The ending index cannot exceed for the dimension of the array that you want to iterate, or cannot be greater than or equal to the `Count` property of a collection. + - The ending index cannot exceed for the dimension of the array that you want to iterate, or cannot be greater than or equal to the `Count` property of a collection. - The following equation must be true for the dimension of the array that you want to iterate: @@ -134,19 +134,19 @@ > [!TIP] > The starting index of an array or collection can never be a negative number. -- Assuming that an array must be zero-based. Arrays that are not zero-based can be created by the method and can be returned by COM interop, although they aren't CLS-compliant. The following example illustrates the that is thrown when you try to iterate a non-zero-based array created by the method. +- Assuming that an array must be zero-based. Arrays that are not zero-based can be created by the method and can be returned by COM interop, although they aren't CLS-compliant. The following example illustrates the that is thrown when you try to iterate a non-zero-based array created by the method. :::code language="csharp" source="~/snippets/csharp/System/IndexOutOfRangeException/Overview/nonzero1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/IndexOutOfRangeException/Overview/nonzero1.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/IndexOutOfRangeException/Overview/nonzero1.vb" id="Snippet1"::: - To correct the error, as the following example does, you can call the method instead of making assumptions about the starting index of an array. + To correct the error, as the following example does, you can call the method instead of making assumptions about the starting index of an array. :::code language="csharp" source="~/snippets/csharp/System/IndexOutOfRangeException/Overview/nonzero2.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/IndexOutOfRangeException/Overview/nonzero2.fs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System/IndexOutOfRangeException/Overview/nonzero2.vb" id="Snippet2"::: - Note that when you call the method to get the starting index of an array, you should also call the method to get its ending index. + Note that when you call the method to get the starting index of an array, you should also call the method to get its ending index. - Confusing an index and the value at that index in a numeric array or collection. This issue usually occurs when using the `foreach` statement (in C#), the `for...in` statement (in F#), or the `For Each` statement (in Visual Basic). The following example illustrates the problem. @@ -168,9 +168,9 @@ - Iterate the elements of the array using the [foreach](/dotnet/csharp/language-reference/keywords/foreach-in) statement (in C#), the [for...in](/dotnet/fsharp/language-reference/loops-for-in-expression) statement (in F#), or the [For Each...Next](/dotnet/visual-basic/language-reference/statements/for-each-next-statement) construct (in Visual Basic) instead of iterating elements by index. -- Iterate the elements by index starting with the index returned by the method and ending with the index returned by the method. +- Iterate the elements by index starting with the index returned by the method and ending with the index returned by the method. -- If you are assigning elements in one array to another, ensure that the target array has at least as many elements as the source array by comparing their properties. +- If you are assigning elements in one array to another, ensure that the target array has at least as many elements as the source array by comparing their properties. For a list of initial property values for an instance of , see the constructors. @@ -252,8 +252,8 @@ |Property|Value| |--------------|-----------| -||A null reference (`Nothing` in Visual Basic).| -||The localized error message string.| +||A null reference (`Nothing` in Visual Basic).| +||The localized error message string.| ]]> @@ -313,8 +313,8 @@ |Property|Value| |--------------|-----------| -||A null reference (`Nothing` in Visual Basic).| -||The error message string.| +||A null reference (`Nothing` in Visual Basic).| +||The error message string.| ]]> @@ -376,8 +376,8 @@ |Property|Value| |--------------|-----------| -||The inner exception reference.| -||The error message string.| +||The inner exception reference.| +||The error message string.| ]]> diff --git a/xml/System/InsufficientMemoryException.xml b/xml/System/InsufficientMemoryException.xml index 7632fa3d866..4b967856fe8 100644 --- a/xml/System/InsufficientMemoryException.xml +++ b/xml/System/InsufficientMemoryException.xml @@ -61,7 +61,7 @@ ## Remarks Unlike , is thrown before starting an operation, and thus does not imply state corruption. An application can catch this exception, throttle back its memory usage, and avoid actual out of memory conditions and their potential for corrupting program state. - This exception is thrown by the constructor when you specify a projected memory allocation larger than the amount of currently available memory. Your program can catch the exception and either delay the task that needs the memory or execute it in smaller steps that require less memory. + This exception is thrown by the constructor when you specify a projected memory allocation larger than the amount of currently available memory. Your program can catch the exception and either delay the task that needs the memory or execute it in smaller steps that require less memory. See the class for a code example. @@ -127,8 +127,8 @@ |Property|Value| |--------------|-----------| -||`null`.| -||The localized error message string.| +||`null`.| +||The localized error message string.| ]]> @@ -182,8 +182,8 @@ |Property|Value| |--------------|-----------| -||`null`.| -||The error message string specified in `message`.| +||`null`.| +||The error message string specified in `message`.| ]]> @@ -241,8 +241,8 @@ |Property|Value| |--------------|-----------| -||`null`.| -||The error message string specified in `message`.| +||`null`.| +||The error message string specified in `message`.| ]]> diff --git a/xml/System/Int128.xml b/xml/System/Int128.xml index ea76c29004d..bdfa394ba88 100644 --- a/xml/System/Int128.xml +++ b/xml/System/Int128.xml @@ -793,7 +793,7 @@ This method correctly handles floating-point values and so `2.0` will return `true` while `2.2` will return `false`. -A return value of `false` does not imply that will return `true`. A number with a fractional portion, for example, `3.3`, is not even or odd. +A return value of `false` does not imply that will return `true`. A number with a fractional portion, for example, `3.3`, is not even or odd. ]]> @@ -835,7 +835,7 @@ A return value of `false` does not imply that will return `true`. A complex number, `a + bi` for non-zero `b`, is not positive or negative +A return value of `false` does not imply that will return `true`. A complex number, `a + bi` for non-zero `b`, is not positive or negative ]]> @@ -879,7 +879,7 @@ A return value of `false` does not imply that will return `true`. A number with a fractional portion, for example, `3.3`, is not even or odd. +A return value of `false` does not imply that will return `true`. A number with a fractional portion, for example, `3.3`, is not even or odd. ]]> @@ -921,7 +921,7 @@ A return value of `false` does not imply that will return `true`. A complex number, `a + bi` for non-zero `b`, is not positive or negative +A return value of `false` does not imply that will return `true`. A complex number, `a + bi` for non-zero `b`, is not positive or negative ]]> @@ -1065,7 +1065,7 @@ A return value of `false` does not imply that this method matches the IEEE 754:2019 `maximum` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. +For this method matches the IEEE 754:2019 `maximum` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. ]]> @@ -1109,7 +1109,7 @@ For this method matches the IEEE 754:2 ## Remarks -For this method matches the IEEE 754:2019 `maximumMagnitude` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. +For this method matches the IEEE 754:2019 `maximumMagnitude` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. ]]> @@ -1182,7 +1182,7 @@ For this method matches the IEE ## Remarks -For this method matches the IEEE 754:2019 `minimum` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. +For this method matches the IEEE 754:2019 `minimum` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. ]]> @@ -1226,7 +1226,7 @@ For this method matches the IEEE 754:2 ## Remarks -For this method matches the IEEE 754:2019 `minimumMagnitude` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. +For this method matches the IEEE 754:2019 `minimumMagnitude` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. ]]> diff --git a/xml/System/Int16.xml b/xml/System/Int16.xml index ae9458b5417..66db19e64f5 100644 --- a/xml/System/Int16.xml +++ b/xml/System/Int16.xml @@ -444,18 +444,18 @@ interface and performs slightly better than the method because it does not have to convert the `value` parameter to an object. + This method implements the interface and performs slightly better than the method because it does not have to convert the `value` parameter to an object. - Depending on your programming language, it might be possible to code a method where the parameter type has fewer bits (is narrower) than the instance type. This is possible because some programming languages perform an implicit widening conversion that represents the parameter as a type with as many bits as the instance. + Depending on your programming language, it might be possible to code a method where the parameter type has fewer bits (is narrower) than the instance type. This is possible because some programming languages perform an implicit widening conversion that represents the parameter as a type with as many bits as the instance. - For example, suppose the instance type is and the parameter type is . The Microsoft C# compiler generates instructions to represent the value of the parameter as an object, then generates a method that compares the values of the instance and the parameter representation. + For example, suppose the instance type is and the parameter type is . The Microsoft C# compiler generates instructions to represent the value of the parameter as an object, then generates a method that compares the values of the instance and the parameter representation. Consult your programming language's documentation to determine whether its compiler performs implicit widening conversions on numeric types. ## Examples - The following code example demonstrates generic and nongeneric versions of the method for several value and reference types. + The following code example demonstrates generic and nongeneric versions of the method for several value and reference types. :::code language="csharp" source="~/snippets/csharp/System/Boolean/CompareTo/cat.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/Boolean/CompareTo/cat.vb" id="Snippet1"::: @@ -862,7 +862,7 @@ interface, and performs slightly better than because it does not have to convert the `obj` parameter to an object. + This method implements the interface, and performs slightly better than because it does not have to convert the `obj` parameter to an object. ]]> @@ -1091,7 +1091,7 @@ This method correctly handles floating-point values and so `2.0` will return `true` while `2.2` will return `false`. -A return value of `false` does not imply that will return `true`. A number with a fractional portion, for example, `3.3`, is not even or odd. +A return value of `false` does not imply that will return `true`. A number with a fractional portion, for example, `3.3`, is not even or odd. ]]> @@ -1139,7 +1139,7 @@ A return value of `false` does not imply that will return `true`. A complex number, `a + bi` for non-zero `b`, is not positive or negative +A return value of `false` does not imply that will return `true`. A complex number, `a + bi` for non-zero `b`, is not positive or negative ]]> @@ -1189,7 +1189,7 @@ A return value of `false` does not imply that will return `true`. A number with a fractional portion, for example, `3.3`, is not even or odd. +A return value of `false` does not imply that will return `true`. A number with a fractional portion, for example, `3.3`, is not even or odd. ]]> @@ -1237,7 +1237,7 @@ A return value of `false` does not imply that will return `true`. A complex number, `a + bi` for non-zero `b`, is not positive or negative +A return value of `false` does not imply that will return `true`. A complex number, `a + bi` for non-zero `b`, is not positive or negative ]]> @@ -1405,7 +1405,7 @@ A return value of `false` does not imply that this method matches the IEEE 754:2019 `maximum` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. +For this method matches the IEEE 754:2019 `maximum` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. ]]> @@ -1455,7 +1455,7 @@ For this method matches the IEEE 754:2 ## Remarks -For this method matches the IEEE 754:2019 `maximumMagnitude` function. This requires NaN inputs to not be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. +For this method matches the IEEE 754:2019 `maximumMagnitude` function. This requires NaN inputs to not be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. ]]> @@ -1570,7 +1570,7 @@ For this method matches the IEE ## Remarks -For this method matches the IEEE 754:2019 `minimum` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. +For this method matches the IEEE 754:2019 `minimum` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. ]]>
@@ -1620,7 +1620,7 @@ For this method matches the IEEE 754:2 ## Remarks -For this method matches the IEEE 754:2019 `minimumMagnitude` function. This requires NaN inputs to not be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. +For this method matches the IEEE 754:2019 `minimumMagnitude` function. This requires NaN inputs to not be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. ]]>
@@ -1769,14 +1769,14 @@ For this method matches the IEE |*sign*|An optional sign.| |*digits*|A sequence of digits ranging from 0 to 9.| - The `s` parameter is interpreted using the style. In addition to the integer value's decimal digits, only leading and trailing spaces together with a leading sign are allowed. To explicitly define the style elements that can be present in `s`, use either the or the method. + The `s` parameter is interpreted using the style. In addition to the integer value's decimal digits, only leading and trailing spaces together with a leading sign are allowed. To explicitly define the style elements that can be present in `s`, use either the or the method. - The `s` parameter is parsed using the formatting information in a object that is initialized for the current system culture. For more information, see . To parse a string using the formatting information of some other culture, use the or the method. + The `s` parameter is parsed using the formatting information in a object that is initialized for the current system culture. For more information, see . To parse a string using the formatting information of some other culture, use the or the method. ## Examples - The following example demonstrates how to convert a string value into a 16-bit signed integer value using the method. The resulting integer value is then displayed to the console. + The following example demonstrates how to convert a string value into a 16-bit signed integer value using the method. The resulting integer value is then displayed to the console. :::code language="csharp" source="~/snippets/csharp/System/Int16/Parse/Parse.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Int16.Parse/fs/Parse.fs" id="Snippet1"::: @@ -1984,12 +1984,12 @@ For this method matches the IEE If the flag is used, `s` must be the string representation of a hexadecimal value without a prefix. For example, "9AF3" parses successfully, but "0x9AF3" does not. The only other flags that can be present in `style` are and . (The enumeration has a composite number style, , that includes both white space flags.) - The `s` parameter is parsed using the formatting information in a object that is initialized for the current system culture. For more information, see . To parse `s` using the formatting information of a specific culture, call the method. + The `s` parameter is parsed using the formatting information in a object that is initialized for the current system culture. For more information, see . To parse `s` using the formatting information of a specific culture, call the method. ## Examples - The following example uses the method to parse the string representations of values using the en-US culture. + The following example uses the method to parse the string representations of values using the en-US culture. :::code language="csharp" source="~/snippets/csharp/System/Int16/Parse/Parse2.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Int16.Parse/fs/Parse2.fs" id="Snippet2"::: @@ -2096,14 +2096,14 @@ For this method matches the IEE |sign|An optional sign.| |digits|A sequence of digits ranging from 0 to 9.| - The `s` parameter is interpreted using the style. In addition to decimal digits, only leading and trailing spaces together with a leading sign are allowed in `s`. To explicitly define the style elements together with the culture-specific formatting information that can be present in `s`, use the method. + The `s` parameter is interpreted using the style. In addition to decimal digits, only leading and trailing spaces together with a leading sign are allowed in `s`. To explicitly define the style elements together with the culture-specific formatting information that can be present in `s`, use the method. The `provider` parameter is an implementation that obtains a object. The provides culture-specific information about the format of `s`. If `provider` is `null`, the for the current culture is used. ## Examples - The following example parses string representations of values with the method. + The following example parses string representations of values with the method. :::code language="csharp" source="~/snippets/csharp/System/Int16/Parse/Parse.cs" id="Snippet4"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Int16.Parse/fs/Parse.fs" id="Snippet4"::: @@ -2333,7 +2333,7 @@ For this method matches the IEE If the flag is used, `s` must be the string representation of a hexadecimal value without a prefix. For example, "9AF3" parses successfully, but "0x9AF3" does not.. The only other flags that can be present in `style` are and . (The enumeration has a composite number style, , that includes both white space flags.) - The `provider` parameter is an implementation whose method obtains a object. The object provides culture-specific information about the format of `s`. If `provider` is `null`, the object for the current culture is used. + The `provider` parameter is an implementation whose method obtains a object. The object provides culture-specific information about the format of `s`. If `provider` is `null`, the object for the current culture is used. @@ -2678,7 +2678,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -2736,7 +2736,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method ]]> @@ -2794,7 +2794,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -2904,7 +2904,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -2962,7 +2962,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -3078,7 +3078,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -3136,7 +3136,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -3200,7 +3200,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -3258,7 +3258,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -3318,7 +3318,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the `static` (`Shared` in Visual Basic) method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the `static` (`Shared` in Visual Basic) method. ]]> @@ -3382,7 +3382,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -3446,7 +3446,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -3510,7 +3510,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -6246,13 +6246,13 @@ This member is an explicit interface member implementation. It can be used only method formats an value in the default ("G", or general) format by using the object of the current culture. If you want to specify a different format or culture, use the other overloads of the method, as follows: + The method formats an value in the default ("G", or general) format by using the object of the current culture. If you want to specify a different format or culture, use the other overloads of the method, as follows: |To use format|For culture|Use the overload| |-------------------|-----------------|----------------------| -|Default ("G") format|A specific culture|| -|A specific format|Default (current) culture|| -|A specific format|A specific culture|| +|Default ("G") format|A specific culture|| +|A specific format|Default (current) culture|| +|A specific format|A specific culture|| .NET provides extensive formatting support, which is described in greater detail in the following formatting topics: @@ -6346,13 +6346,13 @@ This member is an explicit interface member implementation. It can be used only method formats an value in the default ("G", or general) format by using the object of a specified culture. If you want to specify a different format or the current culture, use the other overloads of the method, as follows: + The method formats an value in the default ("G", or general) format by using the object of a specified culture. If you want to specify a different format or the current culture, use the other overloads of the method, as follows: |To use format|For culture|Use the overload| |-------------------|-----------------|----------------------| |Default ("G") format|Default (current) culture|| -|A specific format|Default (current) culture|| -|A specific format|A specific culture|| +|A specific format|Default (current) culture|| +|A specific format|A specific culture|| .NET provides extensive formatting support, which is described in greater detail in the following formatting topics: @@ -6360,12 +6360,12 @@ This member is an explicit interface member implementation. It can be used only - For more information about formatting, see [Formatting Types](/dotnet/standard/base-types/formatting-types). - The `provider` parameter is an implementation whose method returns a object. Typically, `provider` is a object or a object. The object provides culture-specific information about the format of the string returned by this method. If `provider` is `null`, this instance is formatted with the object for the current culture. + The `provider` parameter is an implementation whose method returns a object. Typically, `provider` is a object or a object. The object provides culture-specific information about the format of the string returned by this method. If `provider` is `null`, this instance is formatted with the object for the current culture. ## Examples - The following example iterates an array of values and displays each of them to the console by calling the method with different format providers. Because of the simple formatting defined by the default "G" format specifier, the formatted strings produced for each value are identical regardless of the value of the `provider` parameter. + The following example iterates an array of values and displays each of them to the console by calling the method with different format providers. Because of the simple formatting defined by the default "G" format specifier, the formatted strings produced for each value are identical regardless of the value of the `provider` parameter. :::code language="csharp" source="~/snippets/csharp/System/Int16/ToString/ToString1.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Int16.ToString/fs/ToString1.fs" id="Snippet2"::: @@ -6441,13 +6441,13 @@ This member is an explicit interface member implementation. It can be used only method formats an value in a specified format by using a object that represents the conventions of the current culture. If you want to use the default ("G", or general) format or specify a different culture, use the other overloads of the method, as follows: + The method formats an value in a specified format by using a object that represents the conventions of the current culture. If you want to use the default ("G", or general) format or specify a different culture, use the other overloads of the method, as follows: |To use format|For culture|Use the overload| |-------------------|-----------------|----------------------| |Default ("G") format|Default (current) culture|| -|Default ("G") format|A specific culture|| -|A specific format|A specific culture|| +|Default ("G") format|A specific culture|| +|A specific format|A specific culture|| The `format` parameter can be either a standard or a custom numeric format string. All standard numeric format strings other than "R" (or "r") are supported, as are all custom numeric format characters. If `format` is `null` or an empty string, the return value of this instance is formatted with the general numeric format specifier ("G"). @@ -6542,13 +6542,13 @@ This member is an explicit interface member implementation. It can be used only method formats an value in a specified format by using the object of a specified culture. If you want to use default format or culture settings, use the other overloads of the method, as follows: + The method formats an value in a specified format by using the object of a specified culture. If you want to use default format or culture settings, use the other overloads of the method, as follows: |To use format|For culture|Use the overload| |-------------------|-----------------|----------------------| |Default ("G") format|Default (current) culture|| -|Default ("G") format|A specific culture|| -|A specific format|Default (current) culture|| +|Default ("G") format|A specific culture|| +|A specific format|Default (current) culture|| The `format` parameter can be either a standard or a custom numeric format string. All standard numeric format strings other than "R" (or "r") are supported, as are all custom numeric format characters. If `format` is `null` or an empty string (""), the string returned by this method is formatted with the general numeric format specifier ("G"). @@ -6558,7 +6558,7 @@ This member is an explicit interface member implementation. It can be used only - For more information about formatting, see [Formatting Types](/dotnet/standard/base-types/formatting-types). - The `provider` parameter is an implementation. Its method returns a object that provides culture-specific information about the format of the string that is returned by this method. The object that implements can be any of the following: + The `provider` parameter is an implementation. Its method returns a object that provides culture-specific information about the format of the string that is returned by this method. The object that implements can be any of the following: - A object that represents the culture whose formatting rules are to be used. @@ -6909,7 +6909,7 @@ This member is an explicit interface member implementation. It can be used only method differs from the method by returning a Boolean value that indicates whether the parse operation succeeded instead of returning the parsed value. It eliminates the need to use exception handling to test for a in the event that `s` is invalid and cannot be successfully parsed. + The method differs from the method by returning a Boolean value that indicates whether the parse operation succeeded instead of returning the parsed value. It eliminates the need to use exception handling to test for a in the event that `s` is invalid and cannot be successfully parsed. The `s` parameter should be the string representation of a number in the form: @@ -6923,28 +6923,28 @@ This member is an explicit interface member implementation. It can be used only |*sign*|An optional sign.| |*digits*|A sequence of digits ranging from 0 to 9.| - The `s` parameter is interpreted using the style. In addition to the decimal digits, only leading and trailing spaces together with a leading sign are allowed. To explicitly define the style elements together with the culture-specific formatting information that can be present in `s`, use the method. + The `s` parameter is interpreted using the style. In addition to the decimal digits, only leading and trailing spaces together with a leading sign are allowed. To explicitly define the style elements together with the culture-specific formatting information that can be present in `s`, use the method. - The `s` parameter is parsed using the formatting information in a object that is initialized for the current system culture. For more information, see . + The `s` parameter is parsed using the formatting information in a object that is initialized for the current system culture. For more information, see . - This overload of the method interprets all digits in the `s` parameter as decimal digits. To parse the string representation of a hexadecimal number, call the overload. + This overload of the method interprets all digits in the `s` parameter as decimal digits. To parse the string representation of a hexadecimal number, call the overload. ## Examples - The following example calls the method with a number of different string values. + The following example calls the method with a number of different string values. :::code language="csharp" source="~/snippets/csharp/System/Int16/TryParse/TryParse1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Int16.TryParse/fs/TryParse1.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/Int16/TryParse/TryParse1.vb" id="Snippet1"::: - Some of the strings that the method is unable to convert in this example are: + Some of the strings that the method is unable to convert in this example are: - "9432.0". The conversion fails because the string cannot contain a decimal separator; it must contain integral digits only. - "16,667". The conversion fails because the string cannot contain group separators; it must contain integral digits only. -- "(100)". The conversion fails because the string cannot contain a negative sign other than the one defined by the current culture's and properties. +- "(100)". The conversion fails because the string cannot contain a negative sign other than the one defined by the current culture's and properties. - "01FA". The conversion fails because the string cannot contain hexadecimal digits; it must contain decimal digits only. @@ -7271,7 +7271,7 @@ This member is an explicit interface member implementation. It can be used only method differs from the method by returning a Boolean value that indicates whether the parse operation succeeded instead of returning the parsed value. It eliminates the need to use exception handling to test for a in the event that `s` is invalid and cannot be successfully parsed. + The method differs from the method by returning a Boolean value that indicates whether the parse operation succeeded instead of returning the parsed value. It eliminates the need to use exception handling to test for a in the event that `s` is invalid and cannot be successfully parsed. The `style` parameter defines the style elements (such as white space or a positive or negative sign) that are allowed in the `s` parameter for the parse operation to succeed. It must be a combination of bit flags from the enumeration. Depending on the value of style, the `s` parameter may include the following elements: @@ -7286,7 +7286,7 @@ This member is an explicit interface member implementation. It can be used only |Element|Description| |-------------|-----------------| |*ws*|Optional white space. White space can appear at the beginning of `s` if `style` includes the flag, or at the end of `s` if `style` includes the flag.| -|*$*|A culture-specific currency symbol. Its position in the string is defined by the property of the object returned by the method of the `provider` parameter. The currency symbol can appear in `s` if `style` includes the flag.| +|*$*|A culture-specific currency symbol. Its position in the string is defined by the property of the object returned by the method of the `provider` parameter. The currency symbol can appear in `s` if `style` includes the flag.| |*sign*|An optional sign.| |*digits*|A sequence of digits from 0 through 9.| |*,*|A culture-specific thousands separator. The thousands separator of the culture specified by `provider` can appear in `s` if `style` includes the flag.| @@ -7319,12 +7319,12 @@ This member is an explicit interface member implementation. It can be used only If the flag is used, `s` must be a hexadecimal value without a prefix. For example, "9AF3" parses successfully, but "0x9AF3" does not. The only other flags that can be present in `style` are and . (The enumeration has a composite style, , that includes both white space flags.) - The `provider` parameter is an implementation, such as a object or a object, whose method returns a object. The object provides culture-specific information about the format of `s`. If `provider` is `null`, the object for the current culture is used. + The `provider` parameter is an implementation, such as a object or a object, whose method returns a object. The object provides culture-specific information about the format of `s`. If `provider` is `null`, the object for the current culture is used. ## Examples - The following example calls the method with a number of different string values. + The following example calls the method with a number of different string values. :::code language="csharp" source="~/snippets/csharp/System/Int16/TryParse/TryParse2.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Int16.TryParse/fs/TryParse2.fs" id="Snippet2"::: diff --git a/xml/System/Int32.xml b/xml/System/Int32.xml index 149568b4d1e..210ea0817b8 100644 --- a/xml/System/Int32.xml +++ b/xml/System/Int32.xml @@ -472,18 +472,18 @@ interface and performs slightly better than the method because it does not have to convert the `value` parameter to an object. + This method implements the interface and performs slightly better than the method because it does not have to convert the `value` parameter to an object. - Depending on your programming language, it might be possible to code a method where the parameter type has fewer bits (is narrower) than the instance type. This is possible because some programming languages perform an implicit widening conversion that represents the parameter as a type with as many bits as the instance. + Depending on your programming language, it might be possible to code a method where the parameter type has fewer bits (is narrower) than the instance type. This is possible because some programming languages perform an implicit widening conversion that represents the parameter as a type with as many bits as the instance. - For example, suppose the instance type is and the parameter type is . The Microsoft C# compiler generates instructions to represent the value of the parameter as an , then generates a method that compares the values of the instance and the parameter representation. + For example, suppose the instance type is and the parameter type is . The Microsoft C# compiler generates instructions to represent the value of the parameter as an , then generates a method that compares the values of the instance and the parameter representation. Consult your programming language's documentation to determine whether its compiler performs implicit widening conversions on numeric types. ## Examples - The following example demonstrates the method. In addition to displaying the value returned by the method for four different comparisons, it converts the return value to a member of the custom `Comparison` enumeration, whose value it also displays. + The following example demonstrates the method. In addition to displaying the value returned by the method for four different comparisons, it converts the return value to a member of the custom `Comparison` enumeration, whose value it also displays. :::code language="csharp" source="~/snippets/csharp/System/Int32/CompareTo/CompareTo1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Int32.CompareTo/fs/CompareTo1.fs" id="Snippet1"::: @@ -900,7 +900,7 @@ interface, and performs slightly better than because it does not have to convert the `obj` parameter to an object. + This method implements the interface, and performs slightly better than because it does not have to convert the `obj` parameter to an object. ]]> @@ -1150,7 +1150,7 @@ This method correctly handles floating-point values and so `2.0` will return `true` while `2.2` will return `false`. -A return value of `false` does not imply that will return `true`. A number with a fractional portion, for example, `3.3`, is not even or odd. +A return value of `false` does not imply that will return `true`. A number with a fractional portion, for example, `3.3`, is not even or odd. ]]> @@ -1198,7 +1198,7 @@ A return value of `false` does not imply that will return `true`. A complex number, `a + bi` for non-zero `b`, is not positive or negative +A return value of `false` does not imply that will return `true`. A complex number, `a + bi` for non-zero `b`, is not positive or negative ]]> @@ -1248,7 +1248,7 @@ A return value of `false` does not imply that will return `true`. A number with a fractional portion, for example, `3.3`, is not even or odd. +A return value of `false` does not imply that will return `true`. A number with a fractional portion, for example, `3.3`, is not even or odd. ]]> @@ -1296,7 +1296,7 @@ A return value of `false` does not imply that will return `true`. A complex number, `a + bi` for non-zero `b`, is not positive or negative +A return value of `false` does not imply that will return `true`. A complex number, `a + bi` for non-zero `b`, is not positive or negative ]]> @@ -1464,7 +1464,7 @@ A return value of `false` does not imply that this method matches the IEEE 754:2019 `maximum` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. +For this method matches the IEEE 754:2019 `maximum` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. ]]> @@ -1514,7 +1514,7 @@ For this method matches the IEEE 754:2 ## Remarks -For this method matches the IEEE 754:2019 `maximumMagnitude` function. This requires NaN inputs to not be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. +For this method matches the IEEE 754:2019 `maximumMagnitude` function. This requires NaN inputs to not be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. ]]> @@ -1627,7 +1627,7 @@ For this method matches the IEE ## Remarks -For this method matches the IEEE 754:2019 `minimum` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. +For this method matches the IEEE 754:2019 `minimum` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. ]]> @@ -1677,7 +1677,7 @@ For this method matches the IEEE 754:2 ## Remarks -For this method matches the IEEE 754:2019 `minimumMagnitude` function. This requires NaN inputs to not be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. +For this method matches the IEEE 754:2019 `minimumMagnitude` function. This requires NaN inputs to not be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. ]]>
@@ -1824,14 +1824,14 @@ For this method matches the IEE |sign|An optional sign.| |digits|A sequence of digits ranging from 0 to 9.| - The `s` parameter is interpreted using the style. In addition to decimal digits, only leading and trailing spaces together with a leading sign are allowed. To explicitly define the style elements that can be present in `s`, use either the or the method. + The `s` parameter is interpreted using the style. In addition to decimal digits, only leading and trailing spaces together with a leading sign are allowed. To explicitly define the style elements that can be present in `s`, use either the or the method. - The `s` parameter is parsed using the formatting information in a object initialized for the current system culture. For more information, see . To parse a string using the formatting information of some other culture, use the method. + The `s` parameter is parsed using the formatting information in a object initialized for the current system culture. For more information, see . To parse a string using the formatting information of some other culture, use the method. ## Examples - The following example demonstrates how to convert a string value into a 32-bit signed integer value using the method. The resulting integer value is then displayed to the console. + The following example demonstrates how to convert a string value into a 32-bit signed integer value using the method. The resulting integer value is then displayed to the console. :::code language="csharp" source="~/snippets/csharp/System/Int32/Parse/Parse1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Int32.Parse/fs/Parse1.fs" id="Snippet1"::: @@ -2010,7 +2010,7 @@ For this method matches the IEE |Element|Description| |-------------|-----------------| |*ws*|Optional white space. White space can appear at the beginning of `s` if `style` includes the flag, and it can appear at the end of `s` if `style` includes the flag.| -|*$*|A culture-specific currency symbol. Its position in the string is defined by the and properties of the current culture. The current culture's currency symbol can appear in `s` if `style` includes the flag.| +|*$*|A culture-specific currency symbol. Its position in the string is defined by the and properties of the current culture. The current culture's currency symbol can appear in `s` if `style` includes the flag.| |*sign*|An optional sign. The sign can appear at the beginning of `s` if `style` includes the flag, and it can appear at the end of `s` if `style` includes the flag. Parentheses can be used in `s` to indicate a negative value if `style` includes the flag.| |*digits*

*fractional_digits*

*exponential_digits*|A sequence of digits from 0 through 9. For *fractional_digits*, only the digit 0 is valid.| |*,*|A culture-specific thousands separator symbol. The current culture's thousands separator can appear in `s` if `style` includes the flag.| @@ -2042,12 +2042,12 @@ For this method matches the IEE If the flag is used, `s` must be a hexadecimal value without a prefix. For example, "C9AF3" parses successfully, but "0xC9AF3" does not. The only other flags that can be combined with the `s` parameter it are and . (The enumeration includes a composite number style, , that includes both white space flags.) - The `s` parameter is parsed using the formatting information in a object that is initialized for the current system culture. To specify the culture whose formatting information is used for the parse operation, call the overload. + The `s` parameter is parsed using the formatting information in a object that is initialized for the current system culture. To specify the culture whose formatting information is used for the parse operation, call the overload. ## Examples - The following example uses the method to parse the string representations of several values. The current culture for the example is en-US. + The following example uses the method to parse the string representations of several values. The current culture for the example is en-US. :::code language="csharp" source="~/snippets/csharp/System/Int32/Parse/Parse2.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Int32.Parse/fs/Parse2.fs" id="Snippet2"::: @@ -2147,7 +2147,7 @@ For this method matches the IEE method is typically used to convert text that can be formatted in a variety of ways to an value. For example, it can be used to convert the text entered by a user into an HTML text box to a numeric value. + This overload of the method is typically used to convert text that can be formatted in a variety of ways to an value. For example, it can be used to convert the text entered by a user into an HTML text box to a numeric value. The `s` parameter contains a number of the form: @@ -2161,14 +2161,14 @@ For this method matches the IEE |*sign*|An optional sign.| |*digits*|A sequence of digits ranging from 0 to 9.| - The `s` parameter is interpreted using the style. In addition to decimal digits, only leading and trailing spaces together with a leading sign are allowed. To explicitly define the style elements that can be present in `s`, use the method. + The `s` parameter is interpreted using the style. In addition to decimal digits, only leading and trailing spaces together with a leading sign are allowed. To explicitly define the style elements that can be present in `s`, use the method. The `provider` parameter is an implementation, such as a or object. The `provider` parameter supplies culture-specific information about the format of `s`. If `provider` is `null`, the object for the current culture is used. ## Examples - The following example is the button click event handler of a Web form. It uses the array returned by the property to determine the user's locale. It then instantiates a object that corresponds to that locale. The object that belongs to that object is then passed to the method to convert the user's input to an value. + The following example is the button click event handler of a Web form. It uses the array returned by the property to determine the user's locale. It then instantiates a object that corresponds to that locale. The object that belongs to that object is then passed to the method to convert the user's input to an value. :::code language="csharp" source="~/snippets/csharp/System/Decimal/Parse/Default.aspx.cs" id="Snippet4"::: :::code language="vb" source="~/snippets/visualbasic/System/Decimal/Parse/Default.aspx.vb" id="Snippet4"::: @@ -2374,7 +2374,7 @@ For this method matches the IEE |Element|Description| |-------------|-----------------| |*ws*|Optional white space. White space can appear at the beginning of `s` if `style` includes the flag, and it can appear at the end of `s` if `style` includes the flag.| -|*$*|A culture-specific currency symbol. Its position in the string is defined by the property of the object returned by the method of the `provider` parameter. The currency symbol can appear in `s` if `style` includes the flag.| +|*$*|A culture-specific currency symbol. Its position in the string is defined by the property of the object returned by the method of the `provider` parameter. The currency symbol can appear in `s` if `style` includes the flag.| |*sign*|An optional sign. The sign can appear at the beginning of `s` if `style` includes the flag or at the end of `s` if `style` includes the flag. Parentheses can be used in `s` to indicate a negative value if `style` includes the flag.| |*digits*

*fractional_digits*

*exponential_digits*|A sequence of digits from 0 through 9. For *fractional_digits*, only the digit 0 is valid.| |*,*|A culture-specific thousands separator symbol. The thousands separator of the culture specified by `provider` can appear in `s` if `style` includes the flag.| @@ -2746,7 +2746,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -2804,7 +2804,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -2862,7 +2862,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -2972,7 +2972,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -3030,7 +3030,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -3088,7 +3088,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -3216,7 +3216,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -3280,7 +3280,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -3338,7 +3338,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -3398,7 +3398,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the `static` (`Shared` in Visual Basic) method instead. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the `static` (`Shared` in Visual Basic) method instead. ]]> @@ -3462,7 +3462,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -3526,7 +3526,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -3590,7 +3590,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -6330,13 +6330,13 @@ This member is an explicit interface member implementation. It can be used only method formats an value in the default ("G", or general) format by using the object of the current culture. If you want to specify a different format or culture, use the other overloads of the method, as follows: + The method formats an value in the default ("G", or general) format by using the object of the current culture. If you want to specify a different format or culture, use the other overloads of the method, as follows: |To use format|For culture|Use the overload| |-------------------|-----------------|----------------------| -|Default ("G") format|A specific culture|| -|A specific format|Default (current) culture|| -|A specific format|A specific culture|| +|Default ("G") format|A specific culture|| +|A specific format|Default (current) culture|| +|A specific format|A specific culture|| .NET provides extensive formatting support, which is described in greater detail in the following formatting topics: @@ -6434,23 +6434,23 @@ This member is an explicit interface member implementation. It can be used only method formats an value in the default ("G", or general) format by using the object of a specified culture. If you want to specify a different format or the current culture, use the other overloads of the method, as follows: + The method formats an value in the default ("G", or general) format by using the object of a specified culture. If you want to specify a different format or the current culture, use the other overloads of the method, as follows: |To use format|For culture|Use the overload| |-------------------|-----------------|----------------------| |Default ("G") format|Default (current) culture|| -|A specific format|Default (current) culture|| -|A specific format|A specific culture|| +|A specific format|Default (current) culture|| +|A specific format|A specific culture|| - The `provider` parameter is an object that implements the interface. Its method returns a object that provides culture-specific information about the format of the string that is returned by this method. The object that implements can be any of the following: + The `provider` parameter is an object that implements the interface. Its method returns a object that provides culture-specific information about the format of the string that is returned by this method. The object that implements can be any of the following: - A object that represents the culture whose formatting rules are to be used. - A object that contains specific numeric formatting information for this value. -- A custom object that implements and whose method returns a object that provides formatting information. +- A custom object that implements and whose method returns a object that provides formatting information. - If `provider` is `null` or a object cannot be obtained from `provider`, the return value is formatted using the object for the thread current culture. For information about the thread current culture, see . + If `provider` is `null` or a object cannot be obtained from `provider`, the return value is formatted using the object for the thread current culture. For information about the thread current culture, see . .NET provides extensive formatting support, which is described in greater detail in the following formatting topics: @@ -6547,13 +6547,13 @@ This member is an explicit interface member implementation. It can be used only method formats an value in a specified format by using a object that represents the conventions of the current culture. If you want to use the default ("G", or general) format or specify a different culture, use the other overloads of the method, as follows: + The method formats an value in a specified format by using a object that represents the conventions of the current culture. If you want to use the default ("G", or general) format or specify a different culture, use the other overloads of the method, as follows: |To use format|For culture|Use the overload| |-------------------|-----------------|----------------------| |Default ("G") format|Default (current) culture|| -|Default ("G") format|A specific culture|| -|A specific format|A specific culture|| +|Default ("G") format|A specific culture|| +|A specific format|A specific culture|| The `format` parameter can be any valid standard numeric format specifier except for "R", as well as any combination of custom numeric format specifiers. If `format` is `null` or an empty string (""), the return value of this instance is formatted with the general numeric format specifier ("G"). @@ -6656,23 +6656,23 @@ This member is an explicit interface member implementation. It can be used only method formats an value in a specified format by using the object of a specified culture. If you want to use default format or culture settings, use the other overloads of the method, as follows: + The method formats an value in a specified format by using the object of a specified culture. If you want to use default format or culture settings, use the other overloads of the method, as follows: |To use format|For culture|Use the overload| |-------------------|-----------------|----------------------| |Default ("G") format|Default (current) culture|| -|Default ("G") format|A specific culture|| -|A specific format|Default (current) culture|| +|Default ("G") format|A specific culture|| +|A specific format|Default (current) culture|| The `format` parameter can be either a standard or a custom numeric format string. All standard numeric format strings other than "R" (or "r") are supported, as are all custom numeric format characters. If `format` is `null` or an empty string (""), the return value for this instance is formatted with the general numeric format specifier ("G"). - The `provider` parameter is an object that implements the interface. Its method returns a object that provides culture-specific format information about the format of the string that is returned by this method. The object that implements can be any of the following: + The `provider` parameter is an object that implements the interface. Its method returns a object that provides culture-specific format information about the format of the string that is returned by this method. The object that implements can be any of the following: - A object that represents the culture whose formatting rules are to be used. - A object that contains specific numeric formatting information for this value. -- A custom object that implements and whose method returns a object that provides formatting information. +- A custom object that implements and whose method returns a object that provides formatting information. If `provider` is `null` or a object cannot be obtained from `provider`, the return value for this instance is formatted with the for the current culture. @@ -7025,7 +7025,7 @@ This member is an explicit interface member implementation. It can be used only method is like the method, except the method does not throw an exception if the conversion fails. It eliminates the need to use exception handling to test for a in the event that `s` is invalid and cannot be successfully parsed. + The method is like the method, except the method does not throw an exception if the conversion fails. It eliminates the need to use exception handling to test for a in the event that `s` is invalid and cannot be successfully parsed. The `s` parameter contains a number of the form: @@ -7039,28 +7039,28 @@ This member is an explicit interface member implementation. It can be used only |*sign*|An optional sign.| |*digits*|A sequence of digits ranging from 0 to 9.| - The `s` parameter is interpreted using the style. In addition to the decimal digits, only leading and trailing spaces together with a leading sign are allowed. To explicitly define the style elements together with the culture-specific formatting information that can be present in `s`, use the method. + The `s` parameter is interpreted using the style. In addition to the decimal digits, only leading and trailing spaces together with a leading sign are allowed. To explicitly define the style elements together with the culture-specific formatting information that can be present in `s`, use the method. - The `s` parameter is parsed using the formatting information in a object initialized for the current system culture. For more information, see . + The `s` parameter is parsed using the formatting information in a object initialized for the current system culture. For more information, see . - This overload of the method interprets all digits in the `s` parameter as decimal digits. To parse the string representation of a hexadecimal number, call the overload. + This overload of the method interprets all digits in the `s` parameter as decimal digits. To parse the string representation of a hexadecimal number, call the overload. ## Examples - The following example calls the method with a number of different string values. + The following example calls the method with a number of different string values. :::code language="csharp" source="~/snippets/csharp/System/Int32/TryParse/TryParse1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Int32.TryParse/fs/TryParse1.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/Int32/TryParse/TryParse1.vb" id="Snippet1"::: - Some of the strings that the method is unable to convert in this example are: + Some of the strings that the method is unable to convert in this example are: - "9432.0". The conversion fails because the string cannot contain a decimal separator; it must contain integral digits only. - "16,667". The conversion fails because the string cannot contain group separators; it must contain integral digits only. -- "(100)". The conversion fails because the string cannot contain a negative sign other than the one defined by the current culture's and properties. +- "(100)". The conversion fails because the string cannot contain a negative sign other than the one defined by the current culture's and properties. - "01FA". The conversion fails because the string cannot contain hexadecimal digits; it must contain decimal digits only. @@ -7393,7 +7393,7 @@ This member is an explicit interface member implementation. It can be used only method is like the method, except the method does not throw an exception if the conversion fails. It eliminates the need to use exception handling to test for a in the event that `s` is invalid and cannot be parsed successfully. + The method is like the method, except the method does not throw an exception if the conversion fails. It eliminates the need to use exception handling to test for a in the event that `s` is invalid and cannot be parsed successfully. The `style` parameter defines the style elements (such as white space or a positive or negative sign) that are allowed in the `s` parameter for the parse operation to succeed. It must be a combination of bit flags from the enumeration. Depending on the value of `style`, the `s` parameter may include the following elements: @@ -7408,7 +7408,7 @@ This member is an explicit interface member implementation. It can be used only |Element|Description| |-------------|-----------------| |*ws*|Optional white space. White space can appear at the beginning of `s` if `style` includes the flag, or at the end of `s` if `style` includes the flag.| -|*$*|A culture-specific currency symbol. Its position in the string is defined by the property of the object returned by the method of the `provider` parameter. The currency symbol can appear in `s` if `style` includes the flag.| +|*$*|A culture-specific currency symbol. Its position in the string is defined by the property of the object returned by the method of the `provider` parameter. The currency symbol can appear in `s` if `style` includes the flag.| |*sign*|An optional sign. A sign symbol can appear in `s` if `style` includes the or flags.| |*digits*|A sequence of digits from 0 through 9.| |*,*|A culture-specific thousands separator. The thousands separator of the culture specified by `provider` can appear in `s` if `style` includes the flag.| @@ -7441,12 +7441,12 @@ This member is an explicit interface member implementation. It can be used only If the flag is used, `s` must be a hexadecimal value without a prefix. For example, "C9AF3" parses successfully, but "0xC9AF3" does not. The only other flags that can be present in `style` are and . (The enumeration has a composite style, , that includes both white space flags.) - The `provider` parameter is an implementation, such as a object or a object, whose method returns a object. The object provides culture-specific information about the format of `s`. If `provider` is `null`, the object for the current culture is used. + The `provider` parameter is an implementation, such as a object or a object, whose method returns a object. The object provides culture-specific information about the format of `s`. If `provider` is `null`, the object for the current culture is used. ## Examples - The following example calls the method with a number of different string and values. + The following example calls the method with a number of different string and values. :::code language="csharp" source="~/snippets/csharp/System/Int32/TryParse/TryParse2.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Int32.TryParse/fs/TryParse2.fs" id="Snippet2"::: diff --git a/xml/System/Int64.xml b/xml/System/Int64.xml index 59e990d0bd3..1779891076b 100644 --- a/xml/System/Int64.xml +++ b/xml/System/Int64.xml @@ -466,18 +466,18 @@ interface and performs slightly better than the method because it does not have to convert the `value` parameter to an object. + This method implements the interface and performs slightly better than the method because it does not have to convert the `value` parameter to an object. - Depending on your programming language, it might be possible to code a method where the parameter type has fewer bits (is narrower) than the instance type. This is possible because some programming languages perform an implicit widening conversion that represents the parameter as a type with as many bits as the instance. + Depending on your programming language, it might be possible to code a method where the parameter type has fewer bits (is narrower) than the instance type. This is possible because some programming languages perform an implicit widening conversion that represents the parameter as a type with as many bits as the instance. - For example, suppose the instance type is and the parameter type is . The Microsoft C# compiler generates instructions to represent the value of the parameter as an object, then generates a method that compares the values of the instance and the parameter representation. + For example, suppose the instance type is and the parameter type is . The Microsoft C# compiler generates instructions to represent the value of the parameter as an object, then generates a method that compares the values of the instance and the parameter representation. Consult your programming language's documentation to determine whether its compiler performs implicit widening conversions on numeric types. ## Examples - The following code example demonstrates generic and nongeneric versions of the method for several value and reference types. + The following code example demonstrates generic and nongeneric versions of the method for several value and reference types. :::code language="csharp" source="~/snippets/csharp/System/Boolean/CompareTo/cat.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/Boolean/CompareTo/cat.vb" id="Snippet1"::: @@ -887,7 +887,7 @@ interface, and performs slightly better than because it does not have to convert the `obj` parameter to an object. + This method implements the interface, and performs slightly better than because it does not have to convert the `obj` parameter to an object. ]]> @@ -1115,7 +1115,7 @@ This method correctly handles floating-point values and so `2.0` will return `true` while `2.2` will return `false`. -A return value of `false` does not imply that will return `true`. A number with a fractional portion, for example, `3.3`, is not even or odd. +A return value of `false` does not imply that will return `true`. A number with a fractional portion, for example, `3.3`, is not even or odd. ]]> @@ -1163,7 +1163,7 @@ A return value of `false` does not imply that will return `true`. A complex number, `a + bi` for non-zero `b`, is not positive or negative +A return value of `false` does not imply that will return `true`. A complex number, `a + bi` for non-zero `b`, is not positive or negative ]]> @@ -1213,7 +1213,7 @@ A return value of `false` does not imply that will return `true`. A number with a fractional portion, for example, `3.3`, is not even or odd. +A return value of `false` does not imply that will return `true`. A number with a fractional portion, for example, `3.3`, is not even or odd. ]]> @@ -1261,7 +1261,7 @@ A return value of `false` does not imply that will return `true`. A complex number, `a + bi` for non-zero `b`, is not positive or negative +A return value of `false` does not imply that will return `true`. A complex number, `a + bi` for non-zero `b`, is not positive or negative ]]> @@ -1429,7 +1429,7 @@ A return value of `false` does not imply that this method matches the IEEE 754:2019 `maximum` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. +For this method matches the IEEE 754:2019 `maximum` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. ]]> @@ -1479,7 +1479,7 @@ For this method matches the IEEE 754:2 ## Remarks -For this method matches the IEEE 754:2019 `maximumMagnitude` function. This requires NaN inputs to not be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. +For this method matches the IEEE 754:2019 `maximumMagnitude` function. This requires NaN inputs to not be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. ]]> @@ -1583,7 +1583,7 @@ For this method matches the IEE ## Remarks -For this method matches the IEEE 754:2019 `minimum` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. +For this method matches the IEEE 754:2019 `minimum` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. ]]> @@ -1633,7 +1633,7 @@ For this method matches the IEEE 754:2 ## Remarks -For this method matches the IEEE 754:2019 `minimumMagnitude` function. This requires NaN inputs to not be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. +For this method matches the IEEE 754:2019 `minimumMagnitude` function. This requires NaN inputs to not be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. ]]>
@@ -1771,14 +1771,14 @@ For this method matches the IEE |sign|An optional sign.| |digits|A sequence of digits ranging from 0 to 9.| - The `s` parameter is interpreted using the style. In addition to decimal digits, only leading and trailing spaces together with a leading sign are allowed. To explicitly define the style elements that can be present in `s`, use either the or the method. + The `s` parameter is interpreted using the style. In addition to decimal digits, only leading and trailing spaces together with a leading sign are allowed. To explicitly define the style elements that can be present in `s`, use either the or the method. - The `s` parameter is parsed using the formatting information in a object that is initialized for the current system culture. To parse a string using the formatting information of some other culture, use the method. + The `s` parameter is parsed using the formatting information in a object that is initialized for the current system culture. To parse a string using the formatting information of some other culture, use the method. ## Examples - The following example demonstrates how to convert a string value into a 64-bit signed integer value using the method. It then displays the resulting long integer value. + The following example demonstrates how to convert a string value into a 64-bit signed integer value using the method. It then displays the resulting long integer value. :::code language="csharp" source="~/snippets/csharp/System/Int64/Parse/Parse1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.int64.parse/fs/Parse1.fs" id="Snippet1"::: @@ -1957,7 +1957,7 @@ For this method matches the IEE |Element|Description| |-------------|-----------------| |*ws*|Optional white space. White space can appear at the beginning of `s` if `style` includes the flag, and it can appear at the end of `s` if `style` includes the flag.| -|*$*|A culture-specific currency symbol. Its position in the string is defined by the and properties of the current culture. The current culture's currency symbol can appear in `s` if `style` includes the flag.| +|*$*|A culture-specific currency symbol. Its position in the string is defined by the and properties of the current culture. The current culture's currency symbol can appear in `s` if `style` includes the flag.| |*sign*|An optional sign. The sign can appear at the beginning of `s` if `style` includes the flag, and it can appear at the end of `s` if `style` includes the flag. Parentheses can be used in `s` to indicate a negative value if `style` includes the flag.| |*digits*

*fractional_digits*

*exponential_digits*|A sequence of digits from 0 through 9. For *fractional_digits*, only the digit 0 is valid.| |*,*|A culture-specific thousands separator symbol. The current culture's thousands separator can appear in `s` if `style` includes the flag.| @@ -1989,12 +1989,12 @@ For this method matches the IEE If the flag is used, `s` must be a hexadecimal value without a prefix. For example, "C9AF3" parses successfully, but "0xC9AF3" does not. The only other flags that can be combined with the `s` parameter are and . (The enumeration includes a composite number style, , that includes both white space flags.) - The `s` parameter is parsed using the formatting information in a object that is initialized for the current system culture. To specify the culture whose formatting information is used for the parse operation, call the overload. + The `s` parameter is parsed using the formatting information in a object that is initialized for the current system culture. To specify the culture whose formatting information is used for the parse operation, call the overload. ## Examples - The following example uses the method to parse the string representations of several values. The current culture for the example is en-US. + The following example uses the method to parse the string representations of several values. The current culture for the example is en-US. :::code language="csharp" source="~/snippets/csharp/System/Int64/Parse/Parse2.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.int64.parse/fs/Parse2.fs" id="Snippet2"::: @@ -2088,7 +2088,7 @@ For this method matches the IEE method is typically used to convert text that can be formatted in a variety of ways to an value. For example, it can be used to convert the text entered by a user into an HTML text box to a numeric value. + This overload of the method is typically used to convert text that can be formatted in a variety of ways to an value. For example, it can be used to convert the text entered by a user into an HTML text box to a numeric value. The `s` parameter contains a number of the form: @@ -2105,14 +2105,14 @@ For this method matches the IEE digits A sequence of digits ranging from 0 to 9. - The `s` parameter is interpreted using the style. In addition to decimal digits, only leading and trailing spaces together with a leading sign are allowed. To explicitly define the style elements that can be present in `s`, use the method. + The `s` parameter is interpreted using the style. In addition to decimal digits, only leading and trailing spaces together with a leading sign are allowed. To explicitly define the style elements that can be present in `s`, use the method. The `provider` parameter is an implementation, such as a or object. The `provider` parameter supplies culture-specific information about the format of `s`. If `provider` is `null`, the for the current culture is used. ## Examples - The following example is the button click event handler of a Web form. It uses the array returned by the property to determine the user's locale. It then instantiates a object that corresponds to that locale. The object that belongs to that object is then passed to the method to convert the user's input to an value. + The following example is the button click event handler of a Web form. It uses the array returned by the property to determine the user's locale. It then instantiates a object that corresponds to that locale. The object that belongs to that object is then passed to the method to convert the user's input to an value. :::code language="csharp" source="~/snippets/csharp/System/Decimal/Parse/Default.aspx.cs" id="Snippet5"::: :::code language="vb" source="~/snippets/visualbasic/System/Decimal/Parse/Default.aspx.vb" id="Snippet5"::: @@ -2312,7 +2312,7 @@ For this method matches the IEE |Element|Description| |-------------|-----------------| |*ws*|Optional white space. White space can appear at the beginning of `s` if `style` includes the flag, and it can appear at the end of `s` if `style` includes the flag.| -|*$*|A culture-specific currency symbol. Its position in the string is defined by the property of the object returned by the method of the `provider` parameter. The currency symbol can appear in `s` if `style` includes the flag.| +|*$*|A culture-specific currency symbol. Its position in the string is defined by the property of the object returned by the method of the `provider` parameter. The currency symbol can appear in `s` if `style` includes the flag.| |*sign*|An optional sign. The sign can appear at the beginning of `s` if `style` includes the flag or at the end of `s` if `style` includes the flag. Parentheses can be used in `s` to indicate a negative value if `style` includes the flag.| |*digits*

*fractional_digits*

*exponential_digits*|A sequence of digits from 0 through 9.| |*,*|A culture-specific thousands separator symbol. The thousands separator of the culture specified by `provider` can appear in `s` if `style` includes the flag.| @@ -2685,7 +2685,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -2743,7 +2743,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -2801,7 +2801,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -2911,7 +2911,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -2969,7 +2969,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -3027,7 +3027,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -3085,7 +3085,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -3207,7 +3207,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -3265,7 +3265,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -3325,7 +3325,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the `static` (`Shared` in Visual Basic) method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the `static` (`Shared` in Visual Basic) method. ]]> @@ -3389,7 +3389,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -3453,7 +3453,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -3517,7 +3517,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -6253,13 +6253,13 @@ This member is an explicit interface member implementation. It can be used only method formats an value in the default ("G", or general) format by using the object of the current culture. If you want to specify a different format or culture, use the other overloads of the method, as follows: + The method formats an value in the default ("G", or general) format by using the object of the current culture. If you want to specify a different format or culture, use the other overloads of the method, as follows: |To use format|For culture|Use the overload| |-------------------|-----------------|----------------------| -|Default ("G") format|A specific culture|| -|A specific format|Default (current) culture|| -|A specific format|A specific culture|| +|Default ("G") format|A specific culture|| +|A specific format|Default (current) culture|| +|A specific format|A specific culture|| .NET provides extensive formatting support, which is described in greater detail in the following formatting topics: @@ -6353,21 +6353,21 @@ This member is an explicit interface member implementation. It can be used only method formats an value in the default ("G", or general) format by using the object of a specified culture. If you want to specify a different format or the current culture, use the other overloads of the method, as follows: + The method formats an value in the default ("G", or general) format by using the object of a specified culture. If you want to specify a different format or the current culture, use the other overloads of the method, as follows: |To use format|For culture|Use the overload| |-------------------|-----------------|----------------------| |Default ("G") format|Default (current) culture|| -|A specific format|Default (current) culture|| -|A specific format|A specific culture|| +|A specific format|Default (current) culture|| +|A specific format|A specific culture|| - The `provider` parameter is an object that implements the interface. Its method returns a object that provides culture-specific information about the format of the string that is returned by this method. The object that implements can be any of the following: + The `provider` parameter is an object that implements the interface. Its method returns a object that provides culture-specific information about the format of the string that is returned by this method. The object that implements can be any of the following: - A object that represents the culture whose formatting rules are to be used. - A object that contains specific numeric formatting information for this value. -- A custom object that implements and whose method returns a object that provides formatting information. +- A custom object that implements and whose method returns a object that provides formatting information. If `provider` is `null` or a object cannot be obtained from `provider`, the return value is formatted with the object for the current culture. @@ -6462,13 +6462,13 @@ This member is an explicit interface member implementation. It can be used only method formats an value in a specified format by using a object that represents the conventions of the current culture. If you want to use the default ("G", or general) format or specify a different culture, use the other overloads of the method, as follows: + The method formats an value in a specified format by using a object that represents the conventions of the current culture. If you want to use the default ("G", or general) format or specify a different culture, use the other overloads of the method, as follows: |To use format|For culture|Use the overload| |-------------------|-----------------|----------------------| |Default ("G") format|Default (current) culture|| -|Default ("G") format|A specific culture|| -|A specific format|A specific culture|| +|Default ("G") format|A specific culture|| +|A specific format|A specific culture|| The `format` parameter can be any valid standard numeric format specifier except for "R", as well as any combination of custom numeric format specifiers. If `format` is `null` or an empty string (""), the return value of this instance is formatted with the general numeric format specifier ("G"). @@ -6571,23 +6571,23 @@ This member is an explicit interface member implementation. It can be used only method formats an value in a specified format by using the object of a specified culture. If you want to use default format or culture settings, use the other overloads of the method, as follows: + The method formats an value in a specified format by using the object of a specified culture. If you want to use default format or culture settings, use the other overloads of the method, as follows: |To use format|For culture|Use the overload| |-------------------|-----------------|----------------------| |Default ("G") format|Default (current) culture|| -|Default ("G") format|A specific culture|| -|A specific format|Default (current) culture|| +|Default ("G") format|A specific culture|| +|A specific format|Default (current) culture|| The `format` parameter can be either a standard or a custom numeric format string. All standard numeric format strings other than "R" (or "r") are supported, as are all custom numeric format characters. If `format` is `null` or an empty string (""), the return value for this instance is formatted with the general numeric format specifier ("G"). - The `provider` parameter is an object that implements the interface. Its method returns a object that provides culture-specific information about the format of the string that is returned by this method. The object that implements can be any of the following: + The `provider` parameter is an object that implements the interface. Its method returns a object that provides culture-specific information about the format of the string that is returned by this method. The object that implements can be any of the following: - A object that represents the culture whose formatting rules are to be used. - A object that contains specific numeric formatting information for this value. -- A custom object that implements and whose method returns a object that provides formatting information. +- A custom object that implements and whose method returns a object that provides formatting information. If `provider` is `null` or a object cannot be obtained from `provider`, the return value for this instance is formatted with the for the current culture. @@ -6946,7 +6946,7 @@ This member is an explicit interface member implementation. It can be used only method is like the method, except the method does not throw an exception if the conversion fails. It eliminates the need to use exception handling to test for a in the event that `s` is invalid and cannot be successfully parsed. + The method is like the method, except the method does not throw an exception if the conversion fails. It eliminates the need to use exception handling to test for a in the event that `s` is invalid and cannot be successfully parsed. The `s` parameter contains a number of the form: @@ -6960,28 +6960,28 @@ This member is an explicit interface member implementation. It can be used only |*sign*|An optional sign.| |*digits*|A sequence of digits ranging from 0 to 9.| - The `s` parameter is interpreted using the style. In addition to the decimal digits, only leading and trailing spaces together with a leading sign are allowed. To explicitly define the style elements together with the culture-specific formatting information that can be present in `s`, use the method. + The `s` parameter is interpreted using the style. In addition to the decimal digits, only leading and trailing spaces together with a leading sign are allowed. To explicitly define the style elements together with the culture-specific formatting information that can be present in `s`, use the method. - The `s` parameter is parsed using the formatting information in a object initialized for the current system culture. For more information, see . + The `s` parameter is parsed using the formatting information in a object initialized for the current system culture. For more information, see . - This overload of the method interprets all digits in the `s` parameter as decimal digits. To parse the string representation of a hexadecimal number, call the overload. + This overload of the method interprets all digits in the `s` parameter as decimal digits. To parse the string representation of a hexadecimal number, call the overload. ## Examples - The following example calls the method with a number of different string values. + The following example calls the method with a number of different string values. :::code language="csharp" source="~/snippets/csharp/System/Int64/TryParse/TryParse1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Int64.TryParse/fs/TryParse1.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/Int64/TryParse/TryParse1.vb" id="Snippet1"::: - Some of the strings that the method is unable to convert in this example are: + Some of the strings that the method is unable to convert in this example are: - "9432.0". The conversion fails because the string cannot contain a decimal separator; it must contain integral digits only. - "16,667". The conversion fails because the string cannot contain group separators; it must contain integral digits only. -- "(100)". The conversion fails because the string cannot contain a negative sign other than the one defined by the current culture's and properties. +- "(100)". The conversion fails because the string cannot contain a negative sign other than the one defined by the current culture's and properties. - "01FA". The conversion fails because the string cannot contain hexadecimal digits; it must contain decimal digits only. @@ -7314,7 +7314,7 @@ This member is an explicit interface member implementation. It can be used only method is like the method, except the method does not throw an exception if the conversion fails. It eliminates the need to use exception handling to test for a in the event that `s` is invalid and cannot be parsed successfully. + The method is like the method, except the method does not throw an exception if the conversion fails. It eliminates the need to use exception handling to test for a in the event that `s` is invalid and cannot be parsed successfully. The `style` parameter defines the style elements (such as white space or a positive or negative sign) that are allowed in the `s` parameter for the parse operation to succeed. It must be a combination of bit flags from the enumeration. Depending on the value of `style`,the `s` parameter may include the following elements: @@ -7329,7 +7329,7 @@ This member is an explicit interface member implementation. It can be used only |Element|Description| |-------------|-----------------| |*ws*|Optional white space. White space can appear at the beginning of `s` if `style` includes the flag, or at the end of `s` if `style` includes the flag.| -|*$*|A culture-specific currency symbol. Its position in the string is defined by the property of the object returned by the method of the `provider` parameter. The currency symbol can appear in `s` if `style` includes the flag.| +|*$*|A culture-specific currency symbol. Its position in the string is defined by the property of the object returned by the method of the `provider` parameter. The currency symbol can appear in `s` if `style` includes the flag.| |*sign*|An optional sign. A sign symbol can appear in `s` if `style` includes the or flags.| |*digits*

*fractional_digits*

*exponential_digits*|A sequence of digits from 0 through 9. For *fractional_digits*, only the digit 0 is valid.| |*,*|A culture-specific thousands separator. The thousands separator of the culture specified by `provider` can appear in `s` if `style` includes the flag.| @@ -7361,12 +7361,12 @@ This member is an explicit interface member implementation. It can be used only If the flag is used, `s` must be a hexadecimal value without a prefix. For example, "C9AF3" parses successfully, but "0xC9AF3" does not. The only other flags that can be present in `style` are and . (The enumeration has a composite style, , that includes both white space flags.) - The `provider` parameter is an implementation, such as a object or a object, whose method returns a object. The object provides culture-specific information about the format of `s`. If `provider` is `null`, the object for the current culture is used. + The `provider` parameter is an implementation, such as a object or a object, whose method returns a object. The object provides culture-specific information about the format of `s`. If `provider` is `null`, the object for the current culture is used. ## Examples - The following example calls the method with a number of different string and values. + The following example calls the method with a number of different string and values. :::code language="csharp" source="~/snippets/csharp/System/Int64/TryParse/TryParse2.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Int64.TryParse/fs/TryParse2.fs" id="Snippet2"::: diff --git a/xml/System/IntPtr.xml b/xml/System/IntPtr.xml index a30f8ea57f6..c32ec01b7b6 100644 --- a/xml/System/IntPtr.xml +++ b/xml/System/IntPtr.xml @@ -276,7 +276,7 @@ > [!NOTE] > Using as a pointer or a handle is error prone and unsafe. It is simply an integer type that can be used as an interchange format for pointers and handles due to being the same size. Outside of specific interchange requirements, such as for passing data to a language that doesn't support pointers, a correctly typed pointer should be used to represent pointers and should be used to represent handles. - This type implements the . In .NET 5 and later versions, this type also implements the interfaces. In .NET 7 and later versions, this type also implements the , , and interfaces. + This type implements the . In .NET 5 and later versions, this type also implements the interfaces. In .NET 7 and later versions, this type also implements the , , and interfaces. In C# starting from version 9.0, you can use the built-in `nint` type to define native-sized integers. This type is represented by the type internally and provides operations and conversions that are appropriate for integer types. For more information, see [nint and nuint types](/dotnet/csharp/language-reference/builtin-types/nint-nuint). @@ -286,23 +286,23 @@ The following example uses managed pointers to reverse the characters in an array. After it initializes a object and gets its length, it does the following: -1. Calls the method to copy the Unicode string to unmanaged memory as an ANSI (one-byte) character. The method returns an object that points to the beginning of the unmanaged string. The Visual Basic example uses this pointer directly; in the C++, F# and C# examples, it is cast to a pointer to a byte. +1. Calls the method to copy the Unicode string to unmanaged memory as an ANSI (one-byte) character. The method returns an object that points to the beginning of the unmanaged string. The Visual Basic example uses this pointer directly; in the C++, F# and C# examples, it is cast to a pointer to a byte. -2. Calls the method to allocate the same number of bytes as the unmanaged string occupies. The method returns an object that points to the beginning of the unmanaged block of memory. The Visual Basic example uses this pointer directly; in the C++, F# and C# examples, it is cast to a pointer to a byte. +2. Calls the method to allocate the same number of bytes as the unmanaged string occupies. The method returns an object that points to the beginning of the unmanaged block of memory. The Visual Basic example uses this pointer directly; in the C++, F# and C# examples, it is cast to a pointer to a byte. 3. The Visual Basic example defines a variable named `offset` that is equal to the length of the ANSI string. It is used to determine the offset into unmanaged memory to which the next character in the ANSI string is copied. Because its starting value is the length of the string, the copy operation will copy a character from the start of the string to the end of the memory block. - The C#, F# and C++ examples call the method to get an unmanaged pointer to the starting address of the string and the unmanaged block of memory, and they add one less than the length of the string to the starting address of the ANSI string. Because the unmanaged string pointer now points to the end of the string, the copy operation will copy a character from the end of the string to the start of the memory block. + The C#, F# and C++ examples call the method to get an unmanaged pointer to the starting address of the string and the unmanaged block of memory, and they add one less than the length of the string to the starting address of the ANSI string. Because the unmanaged string pointer now points to the end of the string, the copy operation will copy a character from the end of the string to the start of the memory block. 4. Uses a loop to copy each character from the string to the unmanaged block of memory. - The Visual Basic example calls the method to read the byte (or one-byte character) at a specified offset from the managed pointer to the ANSI string. The offset is incremented with each iteration of the loop. It then calls the method to write the byte to the memory address defined by the starting address of the unmanaged block of memory plus `offset`. It then decrements `offset`. + The Visual Basic example calls the method to read the byte (or one-byte character) at a specified offset from the managed pointer to the ANSI string. The offset is incremented with each iteration of the loop. It then calls the method to write the byte to the memory address defined by the starting address of the unmanaged block of memory plus `offset`. It then decrements `offset`. The C#, F# and C++ examples perform the copy operation, then decrement the pointer to the address of the next location in the unmanaged ANSI string and increment the pointer to the next address in the unmanaged block. -5. All examples call the to convert the unmanaged memory block containing the copied ANSI string to a managed Unicode object. +5. All examples call the to convert the unmanaged memory block containing the copied ANSI string to a managed Unicode object. -6. After displaying the original and reversed strings, all examples call the method to free the memory allocated for the unmanaged ANSI string and the unmanaged block of memory. +6. After displaying the original and reversed strings, all examples call the method to free the memory allocated for the unmanaged ANSI string and the unmanaged block of memory. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR_System/system.intptr/cpp/topointer.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System/IntPtr/ToPointer/topointer.cs" id="Snippet1"::: @@ -620,12 +620,12 @@ method does not throw an exception if the result is too large to represent as a signed integer in the executing process. Instead, the addition operation is performed in an unchecked context. + The method does not throw an exception if the result is too large to represent as a signed integer in the executing process. Instead, the addition operation is performed in an unchecked context. Languages that do not support operator overloading or custom operators can use this method to add an offset to the value of a pointer. ## Examples - The following example instantiates an object that points to the beginning of a ten-element array, and then calls the method to iterate the elements in the array. + The following example instantiates an object that points to the beginning of a ten-element array, and then calls the method to iterate the elements in the array. :::code language="csharp" source="~/snippets/csharp/System/IntPtr/Add/add1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/IntPtr/Add/add1.fs" id="Snippet1"::: @@ -1270,7 +1270,7 @@ This method correctly handles floating-point values and so `2.0` will return `true` while `2.2` will return `false`. -A return value of `false` does not imply that will return `true`. A number with a fractional portion, for example, `3.3`, is not even or odd. +A return value of `false` does not imply that will return `true`. A number with a fractional portion, for example, `3.3`, is not even or odd. ]]> @@ -1318,7 +1318,7 @@ A return value of `false` does not imply that will return `true`. A complex number, `a + bi` for non-zero `b`, is not positive or negative +A return value of `false` does not imply that will return `true`. A complex number, `a + bi` for non-zero `b`, is not positive or negative ]]>
@@ -1368,7 +1368,7 @@ A return value of `false` does not imply that will return `true`. A number with a fractional portion, for example, `3.3`, is not even or odd. +A return value of `false` does not imply that will return `true`. A number with a fractional portion, for example, `3.3`, is not even or odd. ]]>
@@ -1416,7 +1416,7 @@ A return value of `false` does not imply that will return `true`. A complex number, `a + bi` for non-zero `b`, is not positive or negative +A return value of `false` does not imply that will return `true`. A complex number, `a + bi` for non-zero `b`, is not positive or negative ]]>
@@ -1584,7 +1584,7 @@ A return value of `false` does not imply that this method matches the IEEE 754:2019 `maximum` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. +For this method matches the IEEE 754:2019 `maximum` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. ]]>
@@ -1634,7 +1634,7 @@ For this method matches the IEEE 754:2 ## Remarks -For this method matches the IEEE 754:2019 `maximumMagnitude` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. +For this method matches the IEEE 754:2019 `maximumMagnitude` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. ]]>
@@ -1721,7 +1721,7 @@ For this method matches the IEE ## Remarks -For this method matches the IEEE 754:2019 `minimum` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. +For this method matches the IEEE 754:2019 `minimum` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. ]]>
@@ -1771,7 +1771,7 @@ For this method matches the IEEE 754:2 ## Remarks -For this method matches the IEEE 754:2019 `minimumMagnitude` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. +For this method matches the IEEE 754:2019 `minimumMagnitude` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. ]]>
@@ -1880,19 +1880,19 @@ For this method matches the IEE method defines the addition operation for objects. It enables code such as the following. + The method defines the addition operation for objects. It enables code such as the following. :::code language="csharp" source="~/snippets/csharp/System/IntPtr/op_Addition/addition1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/IntPtr/op_Addition/addition1.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/IntPtr/op_Addition/addition1.vb" id="Snippet1"::: - Languages that do not support custom operators can call the method instead. + Languages that do not support custom operators can call the method instead. The addition operation does not throw an exception if the result is too large to represent as a signed integer in the executing process. Instead, it is performed in an unchecked context. In C# starting from version 11 and when targeting the .NET 7 or later runtime, this API is only accessible via reflection. The addition operator is directly recognized by the language and will follow the normal language behavior for addition operations, including overflowing in a `checked` context if the result is too large to represent. - The equivalent method for this operator is ]]> + The equivalent method for this operator is ]]>
@@ -1966,7 +1966,7 @@ For this method matches the IEE if equals ; otherwise, . - ]]> + ]]> @@ -2440,7 +2440,7 @@ For this method matches the IEE if does not equal ; otherwise, . - ]]> + ]]> @@ -2509,19 +2509,19 @@ For this method matches the IEE method defines the subtraction operation for objects. It enables code such as the following. + The method defines the subtraction operation for objects. It enables code such as the following. :::code language="csharp" source="~/snippets/csharp/System/IntPtr/op_Addition/op_subtraction1.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/IntPtr/op_Addition/op_subtraction1.fs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System/IntPtr/op_Addition/op_subtraction1.vb" id="Snippet2"::: - Languages that do not support custom operators can call the method instead. + Languages that do not support custom operators can call the method instead. The subtraction operation does not throw an exception if the result is too small to represent as a signed integer in the executing process. Instead, it is performed in an unchecked context. In C# starting from version 11 and when targeting the .NET 7 or later runtime, this API is only accessible via reflection. The subtraction operator is directly recognized by the language and will follow the normal language behavior for subtraction operations, including overflowing in a `checked` context if the result is too small to represent. - The equivalent method for this operator is ]]> + The equivalent method for this operator is ]]>
@@ -3218,12 +3218,12 @@ It is recommended that a function return `1`, `0`, and `-1`, respectively. method does not throw an exception if the result is too small to represent as a signed integer in the executing process. Instead, the subtraction operation is performed in an unchecked context. + The method does not throw an exception if the result is too small to represent as a signed integer in the executing process. Instead, the subtraction operation is performed in an unchecked context. Languages that do not support operator overloading or custom operators can use this method to subtract an offset from the value of a pointer. ## Examples - The following example instantiates an object that points to the end of a ten-element array, and then calls the method to iterate the elements in the array in reverse order. + The following example instantiates an object that points to the end of a ten-element array, and then calls the method to iterate the elements in the array in reverse order. :::code language="csharp" source="~/snippets/csharp/System/IntPtr/Subtract/subtract1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/IntPtr/Subtract/subtract1.fs" id="Snippet1"::: @@ -3274,7 +3274,7 @@ It is recommended that a function return `1`, `0`, and `-1`, respectively. ## Remarks -This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. +This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -6116,17 +6116,17 @@ This member is an explicit interface member implementation. It can be used only ## Examples The following example uses managed pointers to reverse the characters in an array. After it initializes a object and gets its length, it does the following: -- Calls the method to copy the Unicode string to unmanaged memory as ANSI (one-byte) characters. The method returns an object that points to the beginning of the unmanaged string. +- Calls the method to copy the Unicode string to unmanaged memory as ANSI (one-byte) characters. The method returns an object that points to the beginning of the unmanaged string. -- Calls the method to allocate the same number of bytes as the unmanaged string occupies. The method returns an object that points to the beginning of the unmanaged block of memory. +- Calls the method to allocate the same number of bytes as the unmanaged string occupies. The method returns an object that points to the beginning of the unmanaged block of memory. -- Calls the method to get an unmanaged pointer to the starting address of the string and the unmanaged block of memory, and adds one less than the length of the string to the starting address of the ANSI string. Because the unmanaged string pointer now points to the end of the string, the copy operation will copy a character from the end of the string to the start of the memory block. +- Calls the method to get an unmanaged pointer to the starting address of the string and the unmanaged block of memory, and adds one less than the length of the string to the starting address of the ANSI string. Because the unmanaged string pointer now points to the end of the string, the copy operation will copy a character from the end of the string to the start of the memory block. - Uses a loop to copy each character from the string to the unmanaged block of memory. After each copy operation, it decrements the pointer to the address of the next location in the unmanaged ANSI string and increments the pointer to the next address in the unmanaged block. -- Calls the to convert the unmanaged memory block containing the copied ANSI string to a managed Unicode object. +- Calls the to convert the unmanaged memory block containing the copied ANSI string to a managed Unicode object. -- After displaying the original and reversed strings, calls the method to free the memory allocated for the unmanaged ANSI string and the unmanaged block of memory. +- After displaying the original and reversed strings, calls the method to free the memory allocated for the unmanaged ANSI string and the unmanaged block of memory. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR_System/System.IntPtr.ToPointer/cpp/topointer.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System/IntPtr/Overview/topointer.cs" id="Snippet1"::: @@ -6203,7 +6203,7 @@ This member is an explicit interface member implementation. It can be used only property for this instance is 4, then this method is equivalent to ; otherwise, this method is equivalent to . + If the value of the property for this instance is 4, then this method is equivalent to ; otherwise, this method is equivalent to . ]]> diff --git a/xml/System/InvalidCastException.xml b/xml/System/InvalidCastException.xml index c61a2ec61dd..f9382857590 100644 --- a/xml/System/InvalidCastException.xml +++ b/xml/System/InvalidCastException.xml @@ -139,8 +139,8 @@ |Property|Value| |--------------|-----------| -||A null reference (`Nothing` in Visual Basic).| -||The localized error message string.| +||A null reference (`Nothing` in Visual Basic).| +||The localized error message string.| ]]>
@@ -200,8 +200,8 @@ |Property|Value| |--------------|-----------| -||A null reference (`Nothing` in Visual Basic).| -||The error message string.| +||A null reference (`Nothing` in Visual Basic).| +||The error message string.| ]]>
@@ -329,8 +329,8 @@ |Property|Value| |--------------|-----------| -||The inner exception reference.| -||The error message string.| +||The inner exception reference.| +||The error message string.| ]]>
@@ -395,8 +395,8 @@ |Property|Value| |--------------|-----------| -||A null reference (`Nothing` in Visual Basic).| -||The error message string.| +||A null reference (`Nothing` in Visual Basic).| +||The error message string.| ]]>
diff --git a/xml/System/InvalidOperationException.xml b/xml/System/InvalidOperationException.xml index 12109fb92a1..62d2edb2bcd 100644 --- a/xml/System/InvalidOperationException.xml +++ b/xml/System/InvalidOperationException.xml @@ -140,8 +140,8 @@ |Property|Value| |--------------|-----------| -||A null reference (`Nothing` in Visual Basic).| -||The localized error message string.| +||A null reference (`Nothing` in Visual Basic).| +||The localized error message string.| ]]>
@@ -201,8 +201,8 @@ |Property|Value| |--------------|-----------| -||A null reference (`Nothing` in Visual Basic).| -||The error message string.| +||A null reference (`Nothing` in Visual Basic).| +||The error message string.| ]]>
@@ -330,8 +330,8 @@ |Property|Value| |--------------|-----------| -||The inner exception reference.| -||The error message string.| +||The inner exception reference.| +||The error message string.| ]]>
diff --git a/xml/System/InvalidProgramException.xml b/xml/System/InvalidProgramException.xml index b8d14f7e611..7557d6acce5 100644 --- a/xml/System/InvalidProgramException.xml +++ b/xml/System/InvalidProgramException.xml @@ -141,8 +141,8 @@ |Property|Value| |--------------|-----------| -||A null reference (`Nothing` in Visual Basic).| -||The localized error message string.| +||A null reference (`Nothing` in Visual Basic).| +||The localized error message string.| ]]>
@@ -200,8 +200,8 @@ |Property|Value| |--------------|-----------| -||A null reference (`Nothing` in Visual Basic).| -||The error message string.| +||A null reference (`Nothing` in Visual Basic).| +||The error message string.| ]]>
@@ -261,8 +261,8 @@ |Property|Value| |--------------|-----------| -||The inner exception reference.| -||The error message string.| +||The inner exception reference.| +||The error message string.| ]]>
diff --git a/xml/System/InvalidTimeZoneException.xml b/xml/System/InvalidTimeZoneException.xml index 83f9061e4dc..114e4f10c6b 100644 --- a/xml/System/InvalidTimeZoneException.xml +++ b/xml/System/InvalidTimeZoneException.xml @@ -73,7 +73,7 @@ object contains invalid, incomplete, or missing data. It is thrown by the method when a time zone is found in the registry but contains corrupted data. It can also be thrown by the method under any of the following conditions: + This exception is thrown when a object contains invalid, incomplete, or missing data. It is thrown by the method when a time zone is found in the registry but contains corrupted data. It can also be thrown by the method under any of the following conditions: - The adjustment rules overlap. @@ -270,7 +270,7 @@ object. Instead, it is called by the object's method when deserializing the object from a stream. + This constructor is not called directly by your code to instantiate the object. Instead, it is called by the object's method when deserializing the object from a stream. ]]> diff --git a/xml/System/Lazy`1.xml b/xml/System/Lazy`1.xml index 28fd65259c1..de62b995af2 100644 --- a/xml/System/Lazy`1.xml +++ b/xml/System/Lazy`1.xml @@ -97,14 +97,14 @@ ## Remarks Use lazy initialization to defer the creation of a large or resource-intensive object, or the execution of a resource-intensive task, particularly when such creation or execution might not occur during the lifetime of the program. - To prepare for lazy initialization, you create an instance of . The type argument of the object that you create specifies the type of the object that you want to initialize lazily. The constructor that you use to create the object determines the characteristics of the initialization. Lazy initialization occurs the first time the property is accessed. + To prepare for lazy initialization, you create an instance of . The type argument of the object that you create specifies the type of the object that you want to initialize lazily. The constructor that you use to create the object determines the characteristics of the initialization. Lazy initialization occurs the first time the property is accessed. In most cases, choosing a constructor depends on your answers to two questions: -- Will the lazily initialized object be accessed from more than one thread? If so, the object might create it on any thread. You can use one of the simple constructors whose default behavior is to create a thread-safe object, so that only one instance of the lazily instantiated object is created no matter how many threads try to access it. To create a object that is not thread safe, you must use a constructor that enables you to specify no thread safety. +- Will the lazily initialized object be accessed from more than one thread? If so, the object might create it on any thread. You can use one of the simple constructors whose default behavior is to create a thread-safe object, so that only one instance of the lazily instantiated object is created no matter how many threads try to access it. To create a object that is not thread safe, you must use a constructor that enables you to specify no thread safety. > [!CAUTION] - > Making the object thread safe does not protect the lazily initialized object. If multiple threads can access the lazily initialized object, you must make its properties and methods safe for multithreaded access. + > Making the object thread safe does not protect the lazily initialized object. If multiple threads can access the lazily initialized object, you must make its properties and methods safe for multithreaded access. - Does lazy initialization require a lot of code, or does the lazily initialized object have a parameterless constructor that does everything you need and doesn't throw exceptions? If you need to write initialization code or if exceptions need to be handled, use one of the constructors that takes a factory method. Write your initialization code in the factory method. @@ -112,37 +112,37 @@ |Object will be accessed by|If no initialization code is required (parameterless constructor), use|If initialization code is required, use| |--------------------------------|------------------------------------------------------------------------|---------------------------------------------| -|Multiple threads||| -|One thread| with `isThreadSafe` set to `false`.| with `isThreadSafe` set to `false`.| +|Multiple threads||| +|One thread| with `isThreadSafe` set to `false`.| with `isThreadSafe` set to `false`.| You can use a lambda expression to specify the factory method. This keeps all the initialization code in one place. The lambda expression captures the context, including any arguments you pass to the lazily initialized object's constructor. - **Exception caching** When you use factory methods, exceptions are cached. That is, if the factory method throws an exception the first time a thread tries to access the property of the object, the same exception is thrown on every subsequent attempt. This ensures that every call to the property produces the same result and avoids subtle errors that might arise if different threads get different results. The stands in for an actual `T` that otherwise would have been initialized at some earlier point, usually during startup. A failure at that earlier point is usually fatal. If there is a potential for a recoverable failure, we recommend that you build the retry logic into the initialization routine (in this case, the factory method), just as you would if you weren't using lazy initialization. + **Exception caching** When you use factory methods, exceptions are cached. That is, if the factory method throws an exception the first time a thread tries to access the property of the object, the same exception is thrown on every subsequent attempt. This ensures that every call to the property produces the same result and avoids subtle errors that might arise if different threads get different results. The stands in for an actual `T` that otherwise would have been initialized at some earlier point, usually during startup. A failure at that earlier point is usually fatal. If there is a potential for a recoverable failure, we recommend that you build the retry logic into the initialization routine (in this case, the factory method), just as you would if you weren't using lazy initialization. - **Alternative to locking** In certain situations, you might want to avoid the overhead of the object's default locking behavior. In rare situations, there might be a potential for deadlocks. In such cases, you can use the or constructor, and specify . This enables the object to create a copy of the lazily initialized object on each of several threads if the threads call the property simultaneously. The object ensures that all threads use the same instance of the lazily initialized object and discards the instances that are not used. Thus, the cost of reducing the locking overhead is that your program might sometimes create and discard extra copies of an expensive object. In most cases, this is unlikely. The examples for the and constructors demonstrate this behavior. + **Alternative to locking** In certain situations, you might want to avoid the overhead of the object's default locking behavior. In rare situations, there might be a potential for deadlocks. In such cases, you can use the or constructor, and specify . This enables the object to create a copy of the lazily initialized object on each of several threads if the threads call the property simultaneously. The object ensures that all threads use the same instance of the lazily initialized object and discards the instances that are not used. Thus, the cost of reducing the locking overhead is that your program might sometimes create and discard extra copies of an expensive object. In most cases, this is unlikely. The examples for the and constructors demonstrate this behavior. > [!IMPORTANT] > When you specify , exceptions are never cached, even if you specify a factory method. - **Equivalent constructors** In addition to enabling the use of , the and constructors can duplicate the functionality of the other constructors. The following table shows the parameter values that produce equivalent behavior. + **Equivalent constructors** In addition to enabling the use of , the and constructors can duplicate the functionality of the other constructors. The following table shows the parameter values that produce equivalent behavior. -|To create a object that is|For constructors that have a `LazyThreadSafetyMode` `mode` parameter, set `mode` to|For constructors that have a Boolean `isThreadSafe` parameter, set `isThreadSafe` to|For constructors with no thread safety parameters| +|To create a object that is|For constructors that have a `LazyThreadSafetyMode` `mode` parameter, set `mode` to|For constructors that have a Boolean `isThreadSafe` parameter, set `isThreadSafe` to|For constructors with no thread safety parameters| |-------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------|-------------------------------------------------------| |Fully thread safe; uses locking to ensure that only one thread initializes the value.||`true`|All such constructors are fully thread safe.| |Not thread safe.||`false`|Not applicable.| |Fully thread safe; threads race to initialize the value.||Not applicable.|Not applicable.| - **Other capabilities** For information about the use of with thread-static fields, or as the backing store for properties, see [Lazy Initialization](/dotnet/framework/performance/lazy-initialization). + **Other capabilities** For information about the use of with thread-static fields, or as the backing store for properties, see [Lazy Initialization](/dotnet/framework/performance/lazy-initialization). ## Examples - The following example demonstrates the use of the class to provide lazy initialization with access from multiple threads. + The following example demonstrates the use of the class to provide lazy initialization with access from multiple threads. > [!NOTE] -> The example uses the constructor. It also demonstrates the use of the constructor (specifying `true` for `isThreadSafe`) and the constructor (specifying for `mode`). To switch to a different constructor, just change which constructors are commented out. +> The example uses the constructor. It also demonstrates the use of the constructor (specifying `true` for `isThreadSafe`) and the constructor (specifying for `mode`). To switch to a different constructor, just change which constructors are commented out. > -> For an example that demonstrates exception caching using the same constructors, see the constructor. +> For an example that demonstrates exception caching using the same constructors, see the constructor. The example defines a `LargeObject` class that will be initialized lazily by one of several threads. The four key sections of code illustrate the creation of the initializer, the factory method, the actual initialization, and the constructor of the `LargeObject` class, which displays a message when the object is created. At the beginning of the `Main` method, the example creates the thread-safe lazy initializer for `LargeObject`: @@ -162,7 +162,7 @@ :::code language="fsharp" source="~/snippets/fsharp/System/LazyT/Overview/lambda.fs" id="Snippetinitwithlambda"::: :::code language="vb" source="~/snippets/visualbasic/System/LazyT/Overview/lambda.vb" id="Snippetinitwithlambda"::: - The example pauses, to indicate that an indeterminate period may elapse before lazy initialization occurs. When you press the **Enter** key, the example creates and starts three threads. The `ThreadProc` method that's used by all three threads calls the property. The first time this happens, the `LargeObject` instance is created: + The example pauses, to indicate that an indeterminate period may elapse before lazy initialization occurs. When you press the **Enter** key, the example creates and starts three threads. The `ThreadProc` method that's used by all three threads calls the property. The first time this happens, the `LargeObject` instance is created: :::code language="csharp" source="~/snippets/csharp/System/LazyT/Overview/example.cs" id="Snippetvalueprop"::: :::code language="fsharp" source="~/snippets/fsharp/System/LazyT/Overview/example.fs" id="Snippetvalueprop"::: @@ -175,7 +175,7 @@ :::code language="vb" source="~/snippets/visualbasic/System/LazyT/Overview/example.vb" id="Snippetlargector"::: > [!NOTE] -> For simplicity, this example uses a global instance of , and all the methods are `static` (`Shared` in Visual Basic). These are not requirements for the use of lazy initialization. +> For simplicity, this example uses a global instance of , and all the methods are `static` (`Shared` in Visual Basic). These are not requirements for the use of lazy initialization. :::code language="csharp" source="~/snippets/csharp/System/LazyT/Overview/example.cs" id="Snippetall"::: :::code language="fsharp" source="~/snippets/fsharp/System/LazyT/Overview/example.fs" id="Snippetall"::: @@ -248,14 +248,14 @@ ## Remarks An instance that is created with this constructor may be used concurrently from multiple threads. - The thread safety mode of a instance that is initialized with this constructor is . The thread safety mode describes the behavior when multiple threads try to initialize the instance. + The thread safety mode of a instance that is initialized with this constructor is . The thread safety mode describes the behavior when multiple threads try to initialize the instance. - A instance that is created with this constructor does not cache exceptions. For more information, see the class or the enumeration. + A instance that is created with this constructor does not cache exceptions. For more information, see the class or the enumeration. ## Examples - The following example demonstrates the use of this constructor. It also illustrates the use of the constructor (specifying `true` for `isThreadSafe`) and the constructor (specifying for `mode`). To switch to a different constructor, just change which constructors are commented out. + The following example demonstrates the use of this constructor. It also illustrates the use of the constructor (specifying `true` for `isThreadSafe`) and the constructor (specifying for `mode`). To switch to a different constructor, just change which constructors are commented out. The example defines a `LargeObject` class that will be initialized lazily by one of several threads. The two key lines of code in this example are the creation of the initializer and the actual initialization. At the beginning of the `Main` method, the example creates the thread-safe lazy initializer for `LargeObject`: @@ -263,16 +263,16 @@ :::code language="fsharp" source="~/snippets/fsharp/System/LazyT/.ctor/example.fs" id="Snippetnewlazy"::: :::code language="vb" source="~/snippets/visualbasic/System/LazyT/.ctor/example.vb" id="Snippetnewlazy"::: - The example creates and starts three threads that block on a object, so that the example can release the threads all at once. The `ThreadProc` method that's used by all three threads calls the property to get the `LargeObject` instance: + The example creates and starts three threads that block on a object, so that the example can release the threads all at once. The `ThreadProc` method that's used by all three threads calls the property to get the `LargeObject` instance: :::code language="csharp" source="~/snippets/csharp/System/LazyT/.ctor/example.cs" id="Snippetvalueprop"::: :::code language="fsharp" source="~/snippets/fsharp/System/LazyT/.ctor/example.fs" id="Snippetvalueprop"::: :::code language="vb" source="~/snippets/visualbasic/System/LazyT/.ctor/example.vb" id="Snippetvalueprop"::: - The class provides locking, so that only one thread is allowed to create the `LargeObject` instance. The example demonstrates that the other threads all get the same instance. + The class provides locking, so that only one thread is allowed to create the `LargeObject` instance. The example demonstrates that the other threads all get the same instance. > [!NOTE] -> For simplicity, this example uses a global instance of , and all the methods are `static` (`Shared` in Visual Basic). These are not requirements for the use of lazy initialization. +> For simplicity, this example uses a global instance of , and all the methods are `static` (`Shared` in Visual Basic). These are not requirements for the use of lazy initialization. :::code language="csharp" source="~/snippets/csharp/System/LazyT/.ctor/example.cs" id="Snippetall"::: :::code language="fsharp" source="~/snippets/fsharp/System/LazyT/.ctor/example.fs" id="Snippetall"::: @@ -332,22 +332,22 @@ instance that is initialized with this constructor is if `isThreadSafe` is `true`; otherwise, the mode is . The thread safety mode describes the behavior when multiple threads try to initialize the instance. To specify the mode, use the or constructor. + The thread safety mode of a instance that is initialized with this constructor is if `isThreadSafe` is `true`; otherwise, the mode is . The thread safety mode describes the behavior when multiple threads try to initialize the instance. To specify the mode, use the or constructor. - A instance that is created with this constructor does not cache exceptions. For more information, see the class or the enumeration. + A instance that is created with this constructor does not cache exceptions. For more information, see the class or the enumeration. ## Examples - The following example demonstrates the use of this constructor to create a lazy initializer that is not thread safe, for scenarios where all access to the lazily initialized object occurs on the same thread. It also demonstrates the use of the constructor (specifying for `mode`. To switch to a different constructor, just change which constructor is commented out. + The following example demonstrates the use of this constructor to create a lazy initializer that is not thread safe, for scenarios where all access to the lazily initialized object occurs on the same thread. It also demonstrates the use of the constructor (specifying for `mode`. To switch to a different constructor, just change which constructor is commented out. > [!NOTE] -> For code that demonstrates how to use this constructor in multithreaded scenarios (specifying `true` for `isThreadSafe`), see the example for the constructor. +> For code that demonstrates how to use this constructor in multithreaded scenarios (specifying `true` for `isThreadSafe`), see the example for the constructor. - The example defines a `LargeObject` class that will be initialized lazily. In the `Main` method, the example creates a instance and then pauses. When you press the **Enter** key, the example accesses the property of the instance, which causes initialization to occur. The constructor of the `LargeObject` class displays a console message. + The example defines a `LargeObject` class that will be initialized lazily. In the `Main` method, the example creates a instance and then pauses. When you press the **Enter** key, the example accesses the property of the instance, which causes initialization to occur. The constructor of the `LargeObject` class displays a console message. > [!NOTE] -> For simplicity, this example uses a global instance of , and all the methods are `static` (`Shared` in Visual Basic). These are not requirements for the use of lazy initialization. +> For simplicity, this example uses a global instance of , and all the methods are `static` (`Shared` in Visual Basic). These are not requirements for the use of lazy initialization. :::code language="csharp" source="~/snippets/csharp/System/LazyT/.ctor/example1.cs" id="Snippetall"::: :::code language="fsharp" source="~/snippets/fsharp/System/LazyT/.ctor/example1.fs" id="Snippetall"::: @@ -408,14 +408,14 @@ ## Remarks An instance that is created with this constructor may be used concurrently from multiple threads. - The thread safety mode of a instance that is initialized with this constructor is . The thread safety mode describes the behavior when multiple threads try to initialize the instance. + The thread safety mode of a instance that is initialized with this constructor is . The thread safety mode describes the behavior when multiple threads try to initialize the instance. - Exceptions that are thrown by `valueFactory` are cached. For more information, see the class or the enumeration. + Exceptions that are thrown by `valueFactory` are cached. For more information, see the class or the enumeration. ## Examples - The following example demonstrates the use of this constructor to provide lazy initialization with exception caching. It also demonstrates the use of the constructor (specifying `true` for `isThreadSafe`) and the constructor (specifying for `mode`). To switch to a different constructor, just change which constructors are commented out. + The following example demonstrates the use of this constructor to provide lazy initialization with exception caching. It also demonstrates the use of the constructor (specifying `true` for `isThreadSafe`) and the constructor (specifying for `mode`). To switch to a different constructor, just change which constructors are commented out. The example defines a `LargeObject` class that will be initialized lazily by one of several threads. The three key sections of code illustrate the creation of the initializer, the actual initialization, and the constructor of the `LargeObject` class, which demonstrates exception caching. At the beginning of the `Main` method, the example creates the thread-safe lazy initializer for `LargeObject`: @@ -423,7 +423,7 @@ :::code language="fsharp" source="~/snippets/fsharp/System/LazyT/.ctor/example2.fs" id="Snippetnewlazy"::: :::code language="vb" source="~/snippets/visualbasic/System/LazyT/.ctor/example2.vb" id="Snippetnewlazy"::: - The example creates and starts three threads. The `ThreadProc` method that's used by all three threads calls the property to get the `LargeObject` instance: + The example creates and starts three threads. The `ThreadProc` method that's used by all three threads calls the property to get the `LargeObject` instance: :::code language="csharp" source="~/snippets/csharp/System/LazyT/.ctor/example2.cs" id="Snippetvalueprop"::: :::code language="fsharp" source="~/snippets/fsharp/System/LazyT/.ctor/example2.fs" id="Snippetvalueprop"::: @@ -435,10 +435,10 @@ :::code language="fsharp" source="~/snippets/fsharp/System/LazyT/.ctor/example2.fs" id="Snippetlargector"::: :::code language="vb" source="~/snippets/visualbasic/System/LazyT/.ctor/example2.vb" id="Snippetlargector"::: - When the example is run, the first thread that tries to create an instance of `LargeObject` fails, and the exception is caught. You might expect that the next thread would successfully create an instance, but the object has cached the exception. Because of this, all three threads throw the exception. + When the example is run, the first thread that tries to create an instance of `LargeObject` fails, and the exception is caught. You might expect that the next thread would successfully create an instance, but the object has cached the exception. Because of this, all three threads throw the exception. > [!NOTE] -> For simplicity, this example uses a global instance of , and all the methods are `static` (`Shared` in Visual Basic). These are not requirements for the use of lazy initialization. +> For simplicity, this example uses a global instance of , and all the methods are `static` (`Shared` in Visual Basic). These are not requirements for the use of lazy initialization. :::code language="csharp" source="~/snippets/csharp/System/LazyT/.ctor/example2.cs" id="Snippetall"::: :::code language="fsharp" source="~/snippets/fsharp/System/LazyT/.ctor/example2.fs" id="Snippetall"::: @@ -499,9 +499,9 @@ instance describes the behavior when multiple threads try to initialize the instance. + The thread safety mode of a instance describes the behavior when multiple threads try to initialize the instance. - A instance that is created with this constructor does not cache exceptions. For more information, see the class or the enumeration. + A instance that is created with this constructor does not cache exceptions. For more information, see the class or the enumeration. @@ -509,30 +509,30 @@ The following example demonstrates the use of this constructor to create a lazy initializer that enables multiple threads to race to create an object lazily. Multiple threads might succeed in creating instances, but all threads use the instance that was created first. > [!NOTE] -> For an example that demonstrates how to use this constructor in single-threaded scenarios (specifying for `mode`), see the constructor. For an example that demonstrates how to use this constructor to provide locking instead of race conditions in multithreaded scenarios (specifying for `mode`), see the constructor. +> For an example that demonstrates how to use this constructor in single-threaded scenarios (specifying for `mode`), see the constructor. For an example that demonstrates how to use this constructor to provide locking instead of race conditions in multithreaded scenarios (specifying for `mode`), see the constructor. - The example defines a `LargeObject` class that will be initialized lazily by any of several threads. The three key sections of code illustrate the creation of the initializer, the actual initialization, and the constructor and finalizer of the `LargeObject` class. At the beginning of the `Main` method, the example creates the object that performs lazy initialization of the `LargeObject`: + The example defines a `LargeObject` class that will be initialized lazily by any of several threads. The three key sections of code illustrate the creation of the initializer, the actual initialization, and the constructor and finalizer of the `LargeObject` class. At the beginning of the `Main` method, the example creates the object that performs lazy initialization of the `LargeObject`: :::code language="csharp" source="~/snippets/csharp/System/LazyT/.ctor/example5.cs" id="Snippetnewlazy"::: :::code language="fsharp" source="~/snippets/fsharp/System/LazyT/.ctor/example5.fs" id="Snippetnewlazy"::: :::code language="vb" source="~/snippets/visualbasic/System/LazyT/.ctor/example5.vb" id="Snippetnewlazy"::: - The example creates and starts three threads that block on a object, so that the example can release the threads all at once. In the `ThreadProc` method that's used by all three threads, calling the property creates the `LargeObject` instance: + The example creates and starts three threads that block on a object, so that the example can release the threads all at once. In the `ThreadProc` method that's used by all three threads, calling the property creates the `LargeObject` instance: :::code language="csharp" source="~/snippets/csharp/System/LazyT/.ctor/example5.cs" id="Snippetvalueprop"::: :::code language="fsharp" source="~/snippets/fsharp/System/LazyT/.ctor/example5.fs" id="Snippetvalueprop"::: :::code language="vb" source="~/snippets/visualbasic/System/LazyT/.ctor/example5.vb" id="Snippetvalueprop"::: - Because the constructor for the instance specified , all three threads are allowed to create `LargeObject` instances. The example demonstrates this by displaying console messages in the constructor and in the finalizer of the `LargeObject` class: + Because the constructor for the instance specified , all three threads are allowed to create `LargeObject` instances. The example demonstrates this by displaying console messages in the constructor and in the finalizer of the `LargeObject` class: :::code language="csharp" source="~/snippets/csharp/System/LazyT/.ctor/example5.cs" id="Snippetctorfinalizer"::: :::code language="fsharp" source="~/snippets/fsharp/System/LazyT/.ctor/example5.fs" id="Snippetctorfinalizer"::: :::code language="vb" source="~/snippets/visualbasic/System/LazyT/.ctor/example5.vb" id="Snippetctorfinalizer"::: - However, the object ensures that only one instance is used by all threads. The output from the example shows that all three threads use the same instance, and also shows that the other two instances can be reclaimed by garbage collection. + However, the object ensures that only one instance is used by all threads. The output from the example shows that all three threads use the same instance, and also shows that the other two instances can be reclaimed by garbage collection. > [!NOTE] -> For simplicity, this example uses a global instance of , and all the methods are `static` (`Shared` in Visual Basic). These are not requirements for the use of lazy initialization. +> For simplicity, this example uses a global instance of , and all the methods are `static` (`Shared` in Visual Basic). These are not requirements for the use of lazy initialization. :::code language="csharp" source="~/snippets/csharp/System/LazyT/.ctor/example5.cs" id="Snippetall"::: :::code language="fsharp" source="~/snippets/fsharp/System/LazyT/.ctor/example5.fs" id="Snippetall"::: @@ -642,19 +642,19 @@ An instance created with this constructor is usable by multiple threads concurre instance that is initialized with this constructor is if `isThreadSafe` is `true`; otherwise, the mode is . The thread safety mode describes the behavior when multiple threads try to initialize the instance. + The thread safety mode of a instance that is initialized with this constructor is if `isThreadSafe` is `true`; otherwise, the mode is . The thread safety mode describes the behavior when multiple threads try to initialize the instance. - To specify the mode, use the or constructor. + To specify the mode, use the or constructor. - Exceptions that are thrown by `valueFactory` are cached. For more information, see the class or the enumeration. + Exceptions that are thrown by `valueFactory` are cached. For more information, see the class or the enumeration. ## Examples - The following example demonstrates the use of this constructor to provide lazy initialization with exception caching, in a scenario with a single thread. It also demonstrates the use of the constructor (specifying for `mode`). To switch to that constructor, just change which constructor is commented out. + The following example demonstrates the use of this constructor to provide lazy initialization with exception caching, in a scenario with a single thread. It also demonstrates the use of the constructor (specifying for `mode`). To switch to that constructor, just change which constructor is commented out. > [!NOTE] -> For code that demonstrates how to use this constructor in multithreaded scenarios (specifying `true` for `isThreadSafe`), see the example for the constructor. +> For code that demonstrates how to use this constructor in multithreaded scenarios (specifying `true` for `isThreadSafe`), see the example for the constructor. The example defines a `LargeObject` class that will be initialized lazily by one of several threads. The three key sections of code illustrate the creation of the initializer, the actual initialization, and the constructor of the `LargeObject` class, which demonstrates exception caching. At the beginning of the `Main` method, the example creates the thread-safe lazy initializer for `LargeObject`: @@ -662,7 +662,7 @@ An instance created with this constructor is usable by multiple threads concurre :::code language="fsharp" source="~/snippets/fsharp/System/LazyT/.ctor/example3.fs" id="Snippetnewlazy"::: :::code language="vb" source="~/snippets/visualbasic/System/LazyT/.ctor/example3.vb" id="Snippetnewlazy"::: - In the call to the constructor, the `isThreadSafe` parameter is `false`, so the is not thread safe. Because it's not thread safe, the example calls the property three times on the same thread: + In the call to the constructor, the `isThreadSafe` parameter is `false`, so the is not thread safe. Because it's not thread safe, the example calls the property three times on the same thread: :::code language="csharp" source="~/snippets/csharp/System/LazyT/.ctor/example3.cs" id="Snippetvalueprop"::: :::code language="fsharp" source="~/snippets/fsharp/System/LazyT/.ctor/example3.fs" id="Snippetvalueprop"::: @@ -674,10 +674,10 @@ An instance created with this constructor is usable by multiple threads concurre :::code language="fsharp" source="~/snippets/fsharp/System/LazyT/.ctor/example3.fs" id="Snippetlargector"::: :::code language="vb" source="~/snippets/visualbasic/System/LazyT/.ctor/example3.vb" id="Snippetlargector"::: - When the example is run, the first attempt to create an instance of `LargeObject` fails, and the exception is caught. You might expect that the next attempt would succeed, but the object has cached the exception. Because of this, all three attempts throw the exception. + When the example is run, the first attempt to create an instance of `LargeObject` fails, and the exception is caught. You might expect that the next attempt would succeed, but the object has cached the exception. Because of this, all three attempts throw the exception. > [!NOTE] -> For simplicity, this example uses a global instance of , and all the methods are `static` (`Shared` in Visual Basic). These are not requirements for the use of lazy initialization. +> For simplicity, this example uses a global instance of , and all the methods are `static` (`Shared` in Visual Basic). These are not requirements for the use of lazy initialization. :::code language="csharp" source="~/snippets/csharp/System/LazyT/.ctor/example3.cs" id="Snippetall"::: :::code language="fsharp" source="~/snippets/fsharp/System/LazyT/.ctor/example3.fs" id="Snippetall"::: @@ -740,9 +740,9 @@ An instance created with this constructor is usable by multiple threads concurre instance describes the behavior when multiple threads try to initialize the instance. + The thread safety mode of a instance describes the behavior when multiple threads try to initialize the instance. - Exceptions that are thrown by `valueFactory` are cached, unless `mode` is . For more information, see the class or the enumeration. + Exceptions that are thrown by `valueFactory` are cached, unless `mode` is . For more information, see the class or the enumeration. @@ -750,9 +750,9 @@ An instance created with this constructor is usable by multiple threads concurre The following example demonstrates the use of this constructor to create a lazy initializer that enables multiple threads to race to create an object lazily. Multiple threads might succeed in creating instances, but all threads use the instance that was created first. In addition, the example demonstrates that exceptions are never cached when you specify , even if initialization is performed by a function instead of by the parameterless constructor of the lazily created type. > [!NOTE] -> For an example that demonstrates how to use this constructor in single-threaded scenarios (specifying for `mode`), see the constructor. For an example that demonstrates how to use this constructor to provide locking instead of race conditions in multithreaded scenarios (specifying for `mode`), see the constructor. +> For an example that demonstrates how to use this constructor in single-threaded scenarios (specifying for `mode`), see the constructor. For an example that demonstrates how to use this constructor to provide locking instead of race conditions in multithreaded scenarios (specifying for `mode`), see the constructor. - The example defines a `LargeObject` class that will be initialized lazily by any of several threads. The four key sections of code illustrate the creation of the initializer, the actual initialization, the initialization function, and the constructor and finalizer of the `LargeObject` class. At the beginning of the `Main` method, the example creates the object that performs lazy initialization of the `LargeObject`: + The example defines a `LargeObject` class that will be initialized lazily by any of several threads. The four key sections of code illustrate the creation of the initializer, the actual initialization, the initialization function, and the constructor and finalizer of the `LargeObject` class. At the beginning of the `Main` method, the example creates the object that performs lazy initialization of the `LargeObject`: :::code language="csharp" source="~/snippets/csharp/System/LazyT/.ctor/example4.cs" id="Snippetnewlazy"::: :::code language="fsharp" source="~/snippets/fsharp/System/LazyT/.ctor/example4.fs" id="Snippetnewlazy"::: @@ -760,7 +760,7 @@ An instance created with this constructor is usable by multiple threads concurre The lazy initializer uses a function to perform the initialization. In this case, a function is required because there is no parameterless constructor for the `LargeObject` class. - The example creates and starts three threads that block on a object, so that the example can release the threads all at once. In the `ThreadProc` method that's used by all three threads, calling the property creates the `LargeObject` instance: + The example creates and starts three threads that block on a object, so that the example can release the threads all at once. In the `ThreadProc` method that's used by all three threads, calling the property creates the `LargeObject` instance: :::code language="csharp" source="~/snippets/csharp/System/LazyT/.ctor/example4.cs" id="Snippetvalueprop"::: :::code language="fsharp" source="~/snippets/fsharp/System/LazyT/.ctor/example4.fs" id="Snippetvalueprop"::: @@ -777,16 +777,16 @@ An instance created with this constructor is usable by multiple threads concurre > [!NOTE] > The exception message usually appears after messages indicating that other threads have successfully initialized the object. This is because of the delay introduced by throwing and catching the exception. - Because the constructor for the instance specified , all three threads are allowed to create `LargeObject` instances. The example demonstrates this by displaying console messages in the constructor and in the finalizer of the `LargeObject` class: + Because the constructor for the instance specified , all three threads are allowed to create `LargeObject` instances. The example demonstrates this by displaying console messages in the constructor and in the finalizer of the `LargeObject` class: :::code language="csharp" source="~/snippets/csharp/System/LazyT/.ctor/example4.cs" id="Snippetctorfinalizer"::: :::code language="fsharp" source="~/snippets/fsharp/System/LazyT/.ctor/example4.fs" id="Snippetctorfinalizer"::: :::code language="vb" source="~/snippets/visualbasic/System/LazyT/.ctor/example4.vb" id="Snippetctorfinalizer"::: - The object ensures that only one instance is used by all threads (except the thread where the initialization function throws an exception). The output from the example shows this. + The object ensures that only one instance is used by all threads (except the thread where the initialization function throws an exception). The output from the example shows this. > [!NOTE] -> For simplicity, this example uses a global instance of , and all the methods are `static` (`Shared` in Visual Basic). These are not requirements for the use of lazy initialization. +> For simplicity, this example uses a global instance of , and all the methods are `static` (`Shared` in Visual Basic). These are not requirements for the use of lazy initialization. :::code language="csharp" source="~/snippets/csharp/System/LazyT/.ctor/example4.cs" id="Snippetall"::: :::code language="fsharp" source="~/snippets/fsharp/System/LazyT/.ctor/example4.fs" id="Snippetall"::: @@ -856,11 +856,11 @@ An instance created with this constructor is usable by multiple threads concurre instance, it may result in either a value being created or an exception being thrown. If an exception is thrown, subsequent behavior of the instance depends on whether exception caching is in effect. If the instance was created by using a constructor that does not specify an initialization function, then exception caching is not in effect. A subsequent attempt to initialize the might succeed, and after successful initialization the property returns `true`. If the instance was created with an initialization function (specified by the `valueFactory` parameter of the constructor), then exception caching is controlled by the thread safety mode. + When lazy initialization occurs for a instance, it may result in either a value being created or an exception being thrown. If an exception is thrown, subsequent behavior of the instance depends on whether exception caching is in effect. If the instance was created by using a constructor that does not specify an initialization function, then exception caching is not in effect. A subsequent attempt to initialize the might succeed, and after successful initialization the property returns `true`. If the instance was created with an initialization function (specified by the `valueFactory` parameter of the constructor), then exception caching is controlled by the thread safety mode. -- If the mode is or , there is no second chance to initialize the instance. If an exception occurs and is unhandled in the initialization function, that exception is cached and rethrown on subsequent accesses of the property. No value is created if an exception is thrown, so in such cases returns `false`. +- If the mode is or , there is no second chance to initialize the instance. If an exception occurs and is unhandled in the initialization function, that exception is cached and rethrown on subsequent accesses of the property. No value is created if an exception is thrown, so in such cases returns `false`. -- If the mode is , the first thread that succeeds in running the initialization function (or the parameterless constructor) creates the value for the instance. If the initialization function throws an exception on one thread, other threads can still try to initialize the instance. Until the value is created, the property returns `false`. +- If the mode is , the first thread that succeeds in running the initialization function (or the parameterless constructor) creates the value for the instance. If the initialization function throws an exception on one thread, other threads can still try to initialize the instance. Until the value is created, the property returns `false`. ]]> @@ -920,7 +920,7 @@ An instance created with this constructor is usable by multiple threads concurre ## Remarks Calling this method does not cause initialization. - The property can be `null` after lazy initialization if the factory method that was specified for the `valueFactory` parameter of the , , or constructor returns `null`. + The property can be `null` after lazy initialization if the factory method that was specified for the `valueFactory` parameter of the , , or constructor returns `null`. ]]> @@ -981,9 +981,9 @@ An instance created with this constructor is usable by multiple threads concurre property is `false`, accessing the property forces initialization. + If the property is `false`, accessing the property forces initialization. - In addition to the exceptions that are listed, the property can throw any unhandled exception that is thrown by the factory method that was passed to the `valueFactory` parameter of the , , or constructor. + In addition to the exceptions that are listed, the property can throw any unhandled exception that is thrown by the factory method that was passed to the `valueFactory` parameter of the , , or constructor. ]]> diff --git a/xml/System/Lazy`2.xml b/xml/System/Lazy`2.xml index b5ae13a8957..f46da250b78 100644 --- a/xml/System/Lazy`2.xml +++ b/xml/System/Lazy`2.xml @@ -308,11 +308,11 @@ The thread synchronization mode. Initializes a new instance of the class with the specified metadata and thread synchronization mode. - for more information on thread synchronization and . - + for more information on thread synchronization and . + ]]> @@ -423,11 +423,11 @@ The thread synchronization mode. Initializes a new instance of the class with the specified metadata and thread synchronization mode that uses the specified function to get the referenced object. - for more information on thread synchronization and . - + for more information on thread synchronization and . + ]]> diff --git a/xml/System/LdapStyleUriParser.xml b/xml/System/LdapStyleUriParser.xml index f3c647790ae..b5defe49c20 100644 --- a/xml/System/LdapStyleUriParser.xml +++ b/xml/System/LdapStyleUriParser.xml @@ -82,11 +82,11 @@ Creates a customizable parser based on the Lightweight Directory Access Protocol (LDAP) scheme. - - + + ]]> diff --git a/xml/System/LocalDataStoreSlot.xml b/xml/System/LocalDataStoreSlot.xml index fdc614d469c..84a7fc43430 100644 --- a/xml/System/LocalDataStoreSlot.xml +++ b/xml/System/LocalDataStoreSlot.xml @@ -69,7 +69,7 @@ The data slots are unique per thread or context; their values are not shared between the thread or context objects. Data slots can be allocated by a name or by an index number. - For more information about storing local data, see or . The class is used with methods such as , , , and ; it does not have any methods of its own that you need to use. + For more information about storing local data, see or . The class is used with methods such as , , , and ; it does not have any methods of its own that you need to use. ]]> @@ -118,7 +118,7 @@ when the current object is ready to be finalized. + The garbage collector calls when the current object is ready to be finalized. ]]> diff --git a/xml/System/MTAThreadAttribute.xml b/xml/System/MTAThreadAttribute.xml index c8b42a024df..156c4f845e4 100644 --- a/xml/System/MTAThreadAttribute.xml +++ b/xml/System/MTAThreadAttribute.xml @@ -64,7 +64,7 @@ or method before starting the thread. + Apply this attribute to the entry point method (the `Main()` method in C# and Visual Basic). It has no effect on other methods. To set the apartment state of threads you start in your code, use the or method before starting the thread. > [!NOTE] > For an overview of COM threading models, see [Understanding and Using COM Threading Models](https://learn.microsoft.com/previous-versions/ms809971(v=msdn.10)). @@ -79,7 +79,7 @@ |C++|Multithreaded apartment| |Visual Basic|Single-threaded apartment| - To change these defaults, you use the attribute to set the threading model for the application, or call the or method before starting the thread to set the threading model for a particular thread. In C++, you can also use the [/CLRTHREADATTRIBUTE (Set CLR Thread Attribute)](/cpp/build/reference/clrthreadattribute-set-clr-thread-attribute) linker option to specify the apartment model. + To change these defaults, you use the attribute to set the threading model for the application, or call the or method before starting the thread to set the threading model for a particular thread. In C++, you can also use the [/CLRTHREADATTRIBUTE (Set CLR Thread Attribute)](/cpp/build/reference/clrthreadattribute-set-clr-thread-attribute) linker option to specify the apartment model. Use the attribute to explicitly set the threading model to multithreaded apartment in the following cases: diff --git a/xml/System/MarshalByRefObject.xml b/xml/System/MarshalByRefObject.xml index f502d067cad..331d8cab882 100644 --- a/xml/System/MarshalByRefObject.xml +++ b/xml/System/MarshalByRefObject.xml @@ -182,7 +182,7 @@ method is called by remote object creation methods such as and . In most cases, there is no need to override this method. + The method is called by remote object creation methods such as and . In most cases, there is no need to override this method. ]]> @@ -388,11 +388,11 @@ For more information about lifetime services, see the method creates a shallow copy by creating a new object, and then copying the nonstatic fields of the current object to the new object. If a field is a value type, a bit-by-bit copy of the field is performed. If a field is a reference type, the reference is copied but the referred object is not; therefore, the original object and its clone refer to the same object. + The method creates a shallow copy by creating a new object, and then copying the nonstatic fields of the current object to the new object. If a field is a value type, a bit-by-bit copy of the field is performed. If a field is a reference type, the reference is copied but the referred object is not; therefore, the original object and its clone refer to the same object. For example, consider a object called X that references objects A and B. Object B, in turn, references object C. A shallow copy of X creates new object X2 that also references objects A and B. In contrast, a deep copy of X creates a new object X2 that references the new objects A2 and B2, which are copies of A and B. B2, in turn, references the new object C2, which is a copy C. Use a class that implements the interface to perform a deep or shallow copy of an object. - The identity of a object is defined as the remote server object that is the target of a remoting client call. By default, the memberwise clone of a object has the same identity as the original object, which is typically not the correct behavior for clones of server-side objects that are marshaled across a remoting boundary to the client side. Specify `false`, which is usually appropriate, to delete the identity of the clone and cause a new identity to be assigned when the clone is marshaled across a remoting boundary, or `true` to cause the clone to retain the identity of the original object. The method is intended to be used by developers implementing remote server objects. + The identity of a object is defined as the remote server object that is the target of a remoting client call. By default, the memberwise clone of a object has the same identity as the original object, which is typically not the correct behavior for clones of server-side objects that are marshaled across a remoting boundary to the client side. Specify `false`, which is usually appropriate, to delete the identity of the clone and cause a new identity to be assigned when the clone is marshaled across a remoting boundary, or `true` to cause the clone to retain the identity of the original object. The method is intended to be used by developers implementing remote server objects. ]]> diff --git a/xml/System/Math.xml b/xml/System/Math.xml index b954a21dc6d..84a53fe4994 100644 --- a/xml/System/Math.xml +++ b/xml/System/Math.xml @@ -153,7 +153,7 @@ ## Examples - The following example uses the method to get the absolute value of a number of values. + The following example uses the method to get the absolute value of a number of values. :::code language="csharp" source="~/snippets/csharp/System/Math/Abs/Abs1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Math/Abs/Abs1.fs" id="Snippet1"::: @@ -228,7 +228,7 @@ ## Examples - The following example uses the method to get the absolute value of a number of values. + The following example uses the method to get the absolute value of a number of values. :::code language="csharp" source="~/snippets/csharp/System/Math/Abs/abs2.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/Math/Abs/abs2.fs" id="Snippet2"::: @@ -302,7 +302,7 @@ ## Examples - The following example uses the method to get the absolute value of a number of values. + The following example uses the method to get the absolute value of a number of values. :::code language="csharp" source="~/snippets/csharp/System/Math/Abs/abs3.cs" id="Snippet3"::: :::code language="fsharp" source="~/snippets/fsharp/System/Math/Abs/abs3.fs" id="Snippet3"::: @@ -378,7 +378,7 @@ ## Examples - The following example uses the method to get the absolute value of a number of values. + The following example uses the method to get the absolute value of a number of values. :::code language="csharp" source="~/snippets/csharp/System/Math/Abs/abs4.cs" id="Snippet4"::: :::code language="fsharp" source="~/snippets/fsharp/System/Math/Abs/abs4.fs" id="Snippet4"::: @@ -454,7 +454,7 @@ ## Examples - The following example uses the method to get the absolute value of a number of values. + The following example uses the method to get the absolute value of a number of values. :::code language="csharp" source="~/snippets/csharp/System/Math/Abs/abs5.cs" id="Snippet5"::: :::code language="fsharp" source="~/snippets/fsharp/System/Math/Abs/abs5.fs" id="Snippet5"::: @@ -581,7 +581,7 @@ ## Examples - The following example uses the method to get the absolute value of a number of values. + The following example uses the method to get the absolute value of a number of values. :::code language="csharp" source="~/snippets/csharp/System/Math/Abs/abs6.cs" id="Snippet6"::: :::code language="fsharp" source="~/snippets/fsharp/System/Math/Abs/abs6.fs" id="Snippet6"::: @@ -659,7 +659,7 @@ ## Examples - The following example uses the method to get the absolute value of a number of values. + The following example uses the method to get the absolute value of a number of values. :::code language="csharp" source="~/snippets/csharp/System/Math/Abs/abs7.cs" id="Snippet7"::: :::code language="fsharp" source="~/snippets/fsharp/System/Math/Abs/abs7.fs" id="Snippet7"::: @@ -737,7 +737,7 @@ This method calls into the underlying C runtime, and the exact result or valid input range may differ between different operating systems or architectures. ## Examples - The following example uses the method to assist in the computation of the inner angles of a given trapezoid. + The following example uses the method to assist in the computation of the inner angles of a given trapezoid. :::code language="csharp" source="~/snippets/csharp/System/Math/Overview/mathsample.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Math/Overview/mathsample.fs" id="Snippet1"::: @@ -875,7 +875,7 @@ ## Examples - The following example uses to assist in the computation of the inner angles of a given trapezoid. + The following example uses to assist in the computation of the inner angles of a given trapezoid. :::code language="csharp" source="~/snippets/csharp/System/Math/Overview/mathsample.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Math/Overview/mathsample.fs" id="Snippet1"::: @@ -1237,7 +1237,7 @@ method to calculate the product of two integer values. + The following example demonstrates the use of the method to calculate the product of two integer values. :::code language="csharp" source="~/snippets/csharp/System/Math/BigMul/bigmul.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Math/BigMul/bigmul.fs" id="Snippet1"::: @@ -1693,10 +1693,10 @@ method, which supports rounding toward negative infinity. + The behavior of this method follows IEEE Standard 754, section 4. This kind of rounding is sometimes called rounding toward positive infinity. In other words, if `d` is positive, the presence of any fractional component causes `d` to be rounded to the next highest integer. If `d` is negative, the rounding operation causes any fractional component of `d` to be discarded. The operation of this method differs from the method, which supports rounding toward negative infinity. ## Examples - The following example illustrates the method and contrasts it with the method. + The following example illustrates the method and contrasts it with the method. :::code language="csharp" source="~/snippets/csharp/System/Math/Ceiling/Ceiling1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Math/Ceiling/Ceiling1.fs" id="Snippet1"::: @@ -1767,7 +1767,7 @@ method, which supports rounding toward negative infinity. + The behavior of this method follows IEEE Standard 754, section 4. This kind of rounding is sometimes called rounding toward positive infinity. In other words, if `a` is positive, the presence of any fractional component causes `a` to be rounded to the next highest integer. If `a` is negative, the rounding operation causes any fractional component of `a` to be discarded. The operation of this method differs from the method, which supports rounding toward negative infinity. Starting with Visual Basic 15.8, the performance of Double-to-integer conversion is optimized if you pass the value returned by the `Ceiling` method to the any of the [integral conversion functions](/dotnet/visual-basic/language-reference/functions/conversion-functions), or if the Double value returned by `Ceiling` is automatically converted to an integer with [Option Strict](/dotnet/visual-basic/language-reference/statements/option-strict-statement) set to Off. This optimization allows code to run faster -- up to twice as fast for code that does a large number of conversions to integer types. The following example illustrates such optimized conversions: @@ -1780,7 +1780,7 @@ Dim i2 As Integer = CInt(Math.Ceiling(d2)) ' Result: 7969 ``` ## Examples - The following example illustrates the method and contrasts it with the method. + The following example illustrates the method and contrasts it with the method. :::code language="csharp" source="~/snippets/csharp/System/Math/Ceiling/Ceiling1.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/Math/Ceiling/Ceiling1.fs" id="Snippet2"::: @@ -2741,7 +2741,7 @@ Dim i2 As Integer = CInt(Math.Ceiling(d2)) ' Result: 7969 ## Examples - The following example uses to evaluate certain trigonometric identities for selected angles. + The following example uses to evaluate certain trigonometric identities for selected angles. :::code language="csharp" source="~/snippets/csharp/System/Math/Cos/sincos.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Math/Cos/sincos.fs" id="Snippet1"::: @@ -2817,7 +2817,7 @@ Dim i2 As Integer = CInt(Math.Ceiling(d2)) ' Result: 7969 ## Examples - The following example uses to evaluate certain hyperbolic identities for selected values. + The following example uses to evaluate certain hyperbolic identities for selected values. :::code language="csharp" source="~/snippets/csharp/System/Math/Cosh/sinhcosh.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Math/Cosh/sinhcosh.fs" id="Snippet1"::: @@ -3454,7 +3454,7 @@ Dim i2 As Integer = CInt(Math.Ceiling(d2)) ' Result: 7969 The remainder value equals the result of the [remainder operator](/dotnet/csharp/language-reference/operators/remainder-operator). ## Examples - The following example demonstrates the method. + The following example demonstrates the method. :::code language="csharp" source="~/snippets/csharp/System/Math/DivRem/divrem1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Math/DivRem/divrem1.fs" id="Snippet1"::: @@ -3532,7 +3532,7 @@ Dim i2 As Integer = CInt(Math.Ceiling(d2)) ' Result: 7969 The remainder value equals the result of the [remainder operator](/dotnet/csharp/language-reference/operators/remainder-operator). ## Examples - The following example demonstrates the method. + The following example demonstrates the method. :::code language="csharp" source="~/snippets/csharp/System/Math/DivRem/divrem2.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/Math/DivRem/divrem2.fs" id="Snippet2"::: @@ -3672,16 +3672,16 @@ Dim i2 As Integer = CInt(Math.Ceiling(d2)) ' Result: 7969 ## Remarks `e` is a mathematical constant whose value is approximately 2.71828. - Use the method to calculate powers of other bases. + Use the method to calculate powers of other bases. - is the inverse of . + is the inverse of . This method calls into the underlying C runtime, and the exact result or valid input range may differ between different operating systems or architectures. ## Examples - The following example uses to evaluate certain exponential and logarithmic identities for selected values. + The following example uses to evaluate certain exponential and logarithmic identities for selected values. :::code language="csharp" source="~/snippets/csharp/System/Math/Exp/exp.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Math/Exp/exp.fs" id="Snippet1"::: @@ -3765,10 +3765,10 @@ Dim i2 As Integer = CInt(Math.Ceiling(d2)) ' Result: 7969 method, which supports rounding toward positive infinity. + The behavior of this method follows IEEE Standard 754, section 4. This kind of rounding is sometimes called rounding toward negative infinity. In other words, if `d` is positive, any fractional component is truncated. If `d` is negative, the presence of any fractional component causes it to be rounded to the smaller integer. The operation of this method differs from the method, which supports rounding toward positive infinity. ## Examples - The following example illustrates the method and contrasts it with the method. + The following example illustrates the method and contrasts it with the method. :::code language="csharp" source="~/snippets/csharp/System/Math/Ceiling/Ceiling1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Math/Ceiling/Ceiling1.fs" id="Snippet1"::: @@ -3840,7 +3840,7 @@ Dim i2 As Integer = CInt(Math.Ceiling(d2)) ' Result: 7969 method, which supports rounding toward positive infinity. + The behavior of this method follows IEEE Standard 754, section 4. This kind of rounding is sometimes called rounding toward negative infinity. In other words, if `d` is positive, any fractional component is truncated. If `d` is negative, the presence of any fractional component causes it to be rounded to the smaller integer. The operation of this method differs from the method, which supports rounding toward positive infinity. Starting with Visual Basic 15.8, the performance of Double-to-integer conversion is optimized if you pass the value returned by the `Floor` method to the any of the [integral conversion functions](/dotnet/visual-basic/language-reference/functions/conversion-functions), or if the Double value returned by `Floor` is automatically converted to an integer with [Option Strict](/dotnet/visual-basic/language-reference/statements/option-strict-statement) set to Off. This optimization allows code to run faster -- up to twice as fast for code that does a large number of conversions to integer types. The following example illustrates such optimized conversions: @@ -3853,7 +3853,7 @@ Dim i2 As Integer = CInt(Math.Floor(d2)) ' Result: 7968 ``` ## Examples - The following example illustrates the method and contrasts it with the method. + The following example illustrates the method and contrasts it with the method. :::code language="csharp" source="~/snippets/csharp/System/Math/Ceiling/Ceiling1.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/Math/Ceiling/Ceiling1.fs" id="Snippet2"::: @@ -3987,7 +3987,7 @@ Dim i2 As Integer = CInt(Math.Floor(d2)) ' Result: 7968 ## Remarks This operation complies with the remainder operation defined in Section 5.1 of ANSI/IEEE Std 754-1985; IEEE Standard for Binary Floating-Point Arithmetic; Institute of Electrical and Electronics Engineers, Inc; 1985. - The method is not the same as the [remainder operator](/dotnet/csharp/language-reference/operators/remainder-operator). Although both return the remainder after division, the formulas they use are different. The formula for the method is: + The method is not the same as the [remainder operator](/dotnet/csharp/language-reference/operators/remainder-operator). Although both return the remainder after division, the formulas they use are different. The formula for the method is: ```txt IEEERemainder = dividend - (divisor * Math.Round(dividend / divisor)) @@ -4004,7 +4004,7 @@ Remainder = (Math.Abs(dividend) - (Math.Abs(divisor) * ## Examples - The following example contrasts the remainder returned by the method with the remainder returned by the [remainder operator](/dotnet/csharp/language-reference/operators/remainder-operator). + The following example contrasts the remainder returned by the method with the remainder returned by the [remainder operator](/dotnet/csharp/language-reference/operators/remainder-operator). :::code language="csharp" source="~/snippets/csharp/System/Math/IEEERemainder/ieeeremainder1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Math/IEEERemainder/ieeeremainder1.fs" id="Snippet1"::: @@ -4165,7 +4165,7 @@ Remainder = (Math.Abs(dividend) - (Math.Abs(divisor) * This method calls into the underlying C runtime, and the exact result or valid input range may differ between different operating systems or architectures. ## Examples - The following example illustrates the method. + The following example illustrates the method. :::code language="csharp" source="~/snippets/csharp/System/Math/LogMethod/log1.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/Math/LogMethod/log1.fs" id="Snippet2"::: @@ -4323,7 +4323,7 @@ Remainder = (Math.Abs(dividend) - (Math.Abs(divisor) * This method calls into the underlying C runtime, and the exact result or valid input range may differ between different operating systems or architectures. ## Examples - The following example uses to evaluate certain logarithmic identities for selected values. + The following example uses to evaluate certain logarithmic identities for selected values. :::code language="csharp" source="~/snippets/csharp/System/Math/LogMethod/loggen.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Math/LogMethod/loggen.fs" id="Snippet1"::: @@ -4413,7 +4413,7 @@ Remainder = (Math.Abs(dividend) - (Math.Abs(divisor) * ## Examples - The following example uses the method to return the base 10 logarithm for selected values. + The following example uses the method to return the base 10 logarithm for selected values. :::code language="csharp" source="~/snippets/csharp/System/Math/Log10/log10.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Math/Log10/log10.fs" id="Snippet1"::: @@ -4503,7 +4503,7 @@ Remainder = (Math.Abs(dividend) - (Math.Abs(divisor) * ## Examples -The following example demonstrates how to use the method to return and display the greater of two variables: +The following example demonstrates how to use the method to return and display the greater of two variables: :::code language="csharp" source="~/snippets/csharp/System/Math/Max/max.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Math/Max/max.fs" id="Snippet1"::: @@ -5410,7 +5410,7 @@ The following example demonstrates how to use the meth ## Examples -The following example demonstrates how to use the method to return and display the smaller of two variables: +The following example demonstrates how to use the method to return and display the smaller of two variables: :::code language="csharp" source="~/snippets/csharp/System/Math/Min/min.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Math/Min/min.fs" id="Snippet1"::: @@ -6461,7 +6461,7 @@ This method calls into the underlying C runtime, and the exact result or valid i ## Examples -The following example uses the method to calculate the value that results from raising 2 to a power ranging from 0 to 32. +The following example uses the method to calculate the value that results from raising 2 to a power ranging from 0 to 32. :::code language="csharp" source="~/snippets/csharp/System/Math/Pow/pow1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Math/Pow/pow1.fs" id="Snippet1"::: @@ -6599,26 +6599,26 @@ In this section: ### Which method do I call? -You can use the following table to select an appropriate rounding method. In addition to the `Math.Round` methods, it also includes and . +You can use the following table to select an appropriate rounding method. In addition to the `Math.Round` methods, it also includes and . | To | Call | |--------|----------| -|Round a number to an integer by using the rounding-to-nearest convention.|
-or-
| -|Round a number to an integer by using a specified rounding convention.|
-or-
| -|Round a number to a specified number of fractional digits by using the rounding to nearest convention.|
-or-
| -|Round a number to a specified number of fractional digits by using a specified rounding convention.|
-or-
| -|Round a value to a specified number of fractional digits by using a specified rounding convention and minimizing the loss of precision.|Convert the to a and call .| +|Round a number to an integer by using the rounding-to-nearest convention.|
-or-
| +|Round a number to an integer by using a specified rounding convention.|
-or-
| +|Round a number to a specified number of fractional digits by using the rounding to nearest convention.|
-or-
| +|Round a number to a specified number of fractional digits by using a specified rounding convention.|
-or-
| +|Round a value to a specified number of fractional digits by using a specified rounding convention and minimizing the loss of precision.|Convert the to a and call .| |Round a number to a specified number of fractional digits while minimizing problems of precision in rounding midpoint values.|Call a rounding method that implements a "greater than or approximately equal to" comparison. See [Rounding and precision](#precision).| -|Round a fractional value to an integer that is greater than the fractional value. For example, round 3.1 to 4.|| -|Round a fractional value to an integer that is less than the fractional value. For example, round 3.9 to 3.|| +|Round a fractional value to an integer that is greater than the fractional value. For example, round 3.1 to 4.|| +|Round a fractional value to an integer that is less than the fractional value. For example, round 3.9 to 3.|| ### Midpoint values and rounding conventions -Rounding involves converting a numeric value with a specified precision to a value with less precision. For example, you can use the method to round a value of 3.4 to 3.0, and the method to round a value of 3.579 to 3.58. +Rounding involves converting a numeric value with a specified precision to a value with less precision. For example, you can use the method to round a value of 3.4 to 3.0, and the method to round a value of 3.579 to 3.58. In a midpoint value, the value after the least significant digit in the result is precisely half way between two numbers. For example, 3.47500 is a midpoint value if it is to be rounded to two decimal places, and 7.500 is a midpoint value if it is to be rounded to an integer. In these cases, if the round-to-nearest strategy is used, the nearest value can't be easily identified without a rounding convention. -The method supports two rounding conventions for handling midpoint values: +The method supports two rounding conventions for handling midpoint values: - **Rounding away from zero** @@ -6639,23 +6639,23 @@ The following example illustrates the bias that can result from consistently rou :::code language="fsharp" source="~/snippets/fsharp/System/Decimal/Round/mean1.fs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System/Decimal/Round/mean1.vb" id="Snippet2"::: -By default, the method uses the round to nearest even convention. The following table lists the overloads of the method and the rounding convention that each uses. +By default, the method uses the round to nearest even convention. The following table lists the overloads of the method and the rounding convention that each uses. | Overload | Rounding convention | | ------------------------------------------------------------------------------------- | ------------------------------------- | -| | | -| | | -| | | -| | | -| | Determined by `mode` parameter. | -| | Determined by `mode` parameter | -| | Determined by `mode` parameter | -| | Determined by `mode` parameter | +| | | +| | | +| | | +| | | +| | Determined by `mode` parameter. | +| | Determined by `mode` parameter | +| | Determined by `mode` parameter | +| | Determined by `mode` parameter | ### Rounding and precision -In order to determine whether a rounding operation involves a midpoint value, the method multiplies the original value to be rounded by 10n, where *n* is the desired number of fractional digits in the return value, and then determines whether the remaining fractional portion of the value is greater than or equal to .5. This is a slight variation on a test for equality, and as discussed in the "Testing for Equality" section of the reference topic, tests for equality with floating-point values are problematic because of the floating-point format's issues with binary representation and precision. This means that any fractional portion of a number that is slightly less than .5 (because of a loss of precision) will not be rounded upward. +In order to determine whether a rounding operation involves a midpoint value, the method multiplies the original value to be rounded by 10n, where *n* is the desired number of fractional digits in the return value, and then determines whether the remaining fractional portion of the value is greater than or equal to .5. This is a slight variation on a test for equality, and as discussed in the "Testing for Equality" section of the reference topic, tests for equality with floating-point values are problematic because of the floating-point format's issues with binary representation and precision. This means that any fractional portion of a number that is slightly less than .5 (because of a loss of precision) will not be rounded upward. The following example illustrates the problem. It repeatedly adds .1 to 11.0 and rounds the result to the nearest integer. 11.5 should round to 12 using either of the midpoint-rounding conventions (`ToEven` or `AwayFromZero`). However, as the output from the example shows, it does not. The example uses the "R" [standard numeric format string](/dotnet/standard/base-types/standard-numeric-format-strings) to display the floating point value's full precision, and shows that the value to be rounded has lost precision during repeated additions, and its value is actually 11.499999999999998. Because .499999999999998 is less than .5, the midpoint-rounding conventions don't come into play and the value is rounded down. As the example also shows, this problem does not occur if you assign the constant value 11.5 to a variable. @@ -6683,7 +6683,7 @@ Problems of precision in rounding midpoint values are most likely to arise in th #### Rounding and single-precision floating-point values -The method includes overloads that accept arguments of type and . There are no methods that round values of type . If you pass a value to one of the overloads of the method, it is cast (in C#) or converted (in Visual Basic) to a , and the corresponding overload with a parameter is called. Although this is a widening conversion, it often involves a loss of precision, as the following example illustrates. When a value of 16.325 is passed to the method and rounded to two decimal places using the rounding to nearest convention, the result is 16.33 and not the expected result of 16.32. +The method includes overloads that accept arguments of type and . There are no methods that round values of type . If you pass a value to one of the overloads of the method, it is cast (in C#) or converted (in Visual Basic) to a , and the corresponding overload with a parameter is called. Although this is a widening conversion, it often involves a loss of precision, as the following example illustrates. When a value of 16.325 is passed to the method and rounded to two decimal places using the rounding to nearest convention, the result is 16.33 and not the expected result of 16.32. :::code language="csharp" source="~/snippets/csharp/System/Decimal/Round/single1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Decimal/Round/single1.fs" id="Snippet1"::: @@ -6776,7 +6776,7 @@ This method uses the default rounding convention of ## Examples -The following example demonstrates the method. The value of 4.5 rounds to 4 rather than 5, because this overload uses the default convention. +The following example demonstrates the method. The value of 4.5 rounds to 4 rather than 5, because this overload uses the default convention. :::code language="csharp" source="~/snippets/csharp/System/Math/Round/rounddecimal1.cs" id="Snippet6"::: :::code language="fsharp" source="~/snippets/fsharp/System/Math/Round/rounddecimal1.fs" id="Snippet6"::: @@ -7040,7 +7040,7 @@ For information about rounding numbers with midpoint values, see [Midpoint value ## Example -The following example displays values returned by the method with different `mode` values. +The following example displays values returned by the method with different `mode` values. :::code language="csharp" source="~/snippets/csharp/System/Decimal/Round/midpoint1.cs" id="Snippet5"::: :::code language="fsharp" source="~/snippets/fsharp/System/Decimal/Round/midpoint1.fs" id="Snippet5"::: @@ -7211,7 +7211,7 @@ If the value of the `value` argument is ## Example -The following example displays values returned by the method with different `mode` values. +The following example displays values returned by the method with different `mode` values. :::code language="csharp" source="~/snippets/csharp/System/Decimal/Round/midpoint2.cs" id="Snippet6"::: :::code language="fsharp" source="~/snippets/fsharp/System/Decimal/Round/midpoint2.fs" id="Snippet6"::: @@ -7307,7 +7307,7 @@ The value of the `decimals` argument can range from 0 to 28. ## Example -The following example demonstrates how to use the method with the enumeration. +The following example demonstrates how to use the method with the enumeration. :::code language="csharp" source="~/snippets/csharp/System/Decimal/Round/mpr.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Decimal/Round/mpr.fs" id="Snippet1"::: @@ -7393,7 +7393,7 @@ If the value of the `value` argument is ## Example -The following example demonstrates how to use the method with the enumeration. +The following example demonstrates how to use the method with the enumeration. :::code language="csharp" source="~/snippets/csharp/System/Decimal/Round/mpr.cs" id="Snippet4"::: :::code language="fsharp" source="~/snippets/fsharp/System/Decimal/Round/mpr.fs" id="Snippet4"::: @@ -7559,7 +7559,7 @@ The following example demonstrates how to use the method to determine the sign of a value and display it to the console. + The following example demonstrates how to use the method to determine the sign of a value and display it to the console. :::code language="csharp" source="~/snippets/csharp/System/Math/Sign/sign.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Math/Sign/sign.fs" id="Snippet1"::: @@ -7646,7 +7646,7 @@ The following example demonstrates how to use the method to determine the sign of a value and display it to the console. + The following example demonstrates how to use the method to determine the sign of a value and display it to the console. :::code language="csharp" source="~/snippets/csharp/System/Math/Sign/sign.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Math/Sign/sign.fs" id="Snippet1"::: @@ -7735,7 +7735,7 @@ The following example demonstrates how to use the method to determine the sign of an value and display it to the console. + The following example demonstrates how to use the method to determine the sign of an value and display it to the console. :::code language="csharp" source="~/snippets/csharp/System/Math/Sign/sign.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Math/Sign/sign.fs" id="Snippet1"::: @@ -7822,7 +7822,7 @@ The following example demonstrates how to use the method to determine the sign of an value and display it to the console. + The following example demonstrates how to use the method to determine the sign of an value and display it to the console. :::code language="csharp" source="~/snippets/csharp/System/Math/Sign/sign.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Math/Sign/sign.fs" id="Snippet1"::: @@ -7909,7 +7909,7 @@ The following example demonstrates how to use the method to determine the sign of an value and display it to the console. + The following example demonstrates how to use the method to determine the sign of an value and display it to the console. :::code language="csharp" source="~/snippets/csharp/System/Math/Sign/sign.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Math/Sign/sign.fs" id="Snippet1"::: @@ -7985,7 +7985,7 @@ The following example demonstrates how to use the method to determine the sign of an value and display it to the console. + The following example demonstrates how to use the method to determine the sign of an value and display it to the console. :::code language="csharp" source="~/snippets/csharp/System/Math/Sign/sign.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Math/Sign/sign.fs" id="Snippet1"::: @@ -8075,7 +8075,7 @@ The following example demonstrates how to use the method to determine the sign of an value and display it to the console. + The following example demonstrates how to use the method to determine the sign of an value and display it to the console. :::code language="csharp" source="~/snippets/csharp/System/Math/Sign/sign.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Math/Sign/sign.fs" id="Snippet1"::: @@ -8162,7 +8162,7 @@ The following example demonstrates how to use the method to determine the sign of a value and display it to the console. + The following example demonstrates how to use the method to determine the sign of a value and display it to the console. :::code language="csharp" source="~/snippets/csharp/System/Math/Sign/sign.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Math/Sign/sign.fs" id="Snippet1"::: @@ -8240,7 +8240,7 @@ The following example demonstrates how to use the to evaluate certain trigonometric identities for selected angles. + The following example uses to evaluate certain trigonometric identities for selected angles. :::code language="csharp" source="~/snippets/csharp/System/Math/Cos/sincos.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Math/Cos/sincos.fs" id="Snippet1"::: @@ -8303,7 +8303,7 @@ The following example demonstrates how to use the to evaluate certain trigonometric identities for selected angles. + The following example uses to evaluate certain trigonometric identities for selected angles. :::code language="csharp" source="~/snippets/csharp/System/Math/Cos/sincos.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Math/Cos/sincos.fs" id="Snippet1"::: @@ -8378,7 +8378,7 @@ The following example demonstrates how to use the to evaluate certain hyperbolic identities for selected values. + The following example uses to evaluate certain hyperbolic identities for selected values. :::code language="csharp" source="~/snippets/csharp/System/Math/Cosh/sinhcosh.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Math/Cosh/sinhcosh.fs" id="Snippet1"::: @@ -8617,7 +8617,7 @@ The following example demonstrates how to use the to evaluate certain hyperbolic tangent identities for selected values. + The following example uses to evaluate certain hyperbolic tangent identities for selected values. :::code language="csharp" source="~/snippets/csharp/System/Math/Tanh/tanh.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Math/Tanh/tanh.fs" id="Snippet1"::: @@ -8734,12 +8734,12 @@ The following example demonstrates how to use the rounds `d` to the nearest integer towards zero. + rounds `d` to the nearest integer towards zero. ## Examples - The following example calls the method to truncate both a positive and a negative value. + The following example calls the method to truncate both a positive and a negative value. :::code language="csharp" source="~/snippets/csharp/System/Math/Truncate/Truncate1.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/Math/Truncate/Truncate1.fs" id="Snippet2"::: @@ -8809,7 +8809,7 @@ The following example demonstrates how to use the rounds `d` to the nearest integer towards zero. + rounds `d` to the nearest integer towards zero. Starting with Visual Basic 15.8, the performance of Double-to-integer conversion is optimized if you pass the value returned by the `Truncate` method to the any of the [integral conversion functions](/dotnet/visual-basic/language-reference/functions/conversion-functions), or if the Double value returned by `Truncate` is automatically converted to an integer with [Option Strict](/dotnet/visual-basic/language-reference/statements/option-strict-statement) set to Off. This optimization allows code to run faster -- up to twice as fast for code that does a large number of conversions to integer types. The following example illustrates such an optimized conversion: @@ -8819,7 +8819,7 @@ Dim i As Integer = CInt(Math.Truncate(d)) ' Result: 164 ``` ## Examples - The following example calls the method to truncate both a positive and a negative value. + The following example calls the method to truncate both a positive and a negative value. :::code language="csharp" source="~/snippets/csharp/System/Math/Truncate/Truncate1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Math/Truncate/Truncate1.fs" id="Snippet1"::: diff --git a/xml/System/MathF.xml b/xml/System/MathF.xml index 96aa71e0c41..266e229b472 100644 --- a/xml/System/MathF.xml +++ b/xml/System/MathF.xml @@ -762,7 +762,7 @@ The static fields and methods of the `MathF` class correspond to those of the method, which supports rounding toward negative infinity. + The behavior of this method follows IEEE Standard 754, section 4. This kind of rounding is sometimes called rounding toward positive infinity. In other words, if `x` is positive, the presence of any fractional component causes `x` to be rounded to the next highest integer. If `x` is negative, the rounding operation causes any fractional component of `x` to be discarded. The operation of this method differs from the method, which supports rounding toward negative infinity. ]]>
@@ -1049,9 +1049,9 @@ The value of this constant is 2.71828175. ## Remarks `e` is a mathematical constant whose value is approximately 2.71828. - Use the method to calculate powers of other bases. + Use the method to calculate powers of other bases. - is the inverse of . + is the inverse of . This method calls into the underlying C runtime, and the exact result or valid input range may differ between different operating systems or architectures. @@ -1116,7 +1116,7 @@ The value of this constant is 2.71828175. method, which supports rounding toward positive infinity. + The behavior of this method follows IEEE Standard 754, section 4. This kind of rounding is sometimes called rounding toward negative infinity. In other words, if `x` is positive, any fractional component is truncated. If `x` is negative, the presence of any fractional component causes it to be rounded to the smaller integer. The operation of this method differs from the method, which supports rounding toward positive infinity. ]]> @@ -1237,7 +1237,7 @@ The value of this constant is 2.71828175. ## Remarks This operation complies with the remainder operation defined in Section 5.1 of ANSI/IEEE Std 754-1985; IEEE Standard for Binary Floating-Point Arithmetic; Institute of Electrical and Electronics Engineers, Inc; 1985. - The method is not the same as the [remainder operator](/dotnet/csharp/language-reference/operators/remainder-operator). Although both return the remainder after division, the formulas they use are different. The formula for the method is: + The method is not the same as the [remainder operator](/dotnet/csharp/language-reference/operators/remainder-operator). Although both return the remainder after division, the formulas they use are different. The formula for the method is: ```txt IEEERemainder = dividend - (divisor * MathF.Round(dividend / divisor)) @@ -2866,7 +2866,7 @@ If the value of the `x` argument is rounds `x` to the nearest integer towards zero. + rounds `x` to the nearest integer towards zero. ]]>
diff --git a/xml/System/MemberAccessException.xml b/xml/System/MemberAccessException.xml index 3a3318b374c..25996af8b36 100644 --- a/xml/System/MemberAccessException.xml +++ b/xml/System/MemberAccessException.xml @@ -79,7 +79,7 @@ is thrown by the following methods: - of the classes, of the class, and of the class. + of the classes, of the class, and of the class. Apps compiled by using the .NET Native tool chain may throw a [MissingRuntimeArtifactException](/windows/uwp/dotnet-native/missingruntimeartifactexception-class-net-native) exception at run time. `MissingRuntimeArtifactException` is an internal-only exception type derived from . The exception indicates that metadata needed for the successful execution of an app is not present at run time. You should not use a `try`/`catch` block to handle the exception. Instead, you should determine what metadata is missing and modify your app's runtime directives file to ensure that it is present at run time. @@ -155,8 +155,8 @@ |Property|Value| |--------------|-----------| -||A null reference (`Nothing` in Visual Basic).| -||The localized error message string.| +||A null reference (`Nothing` in Visual Basic).| +||The localized error message string.| ]]>
@@ -216,8 +216,8 @@ |Property|Value| |--------------|-----------| -||A null reference (`Nothing` in Visual Basic).| -||The error message string.| +||A null reference (`Nothing` in Visual Basic).| +||The error message string.| ]]>
@@ -345,8 +345,8 @@ |Property|Value| |--------------|-----------| -||The inner exception reference.| -||The error message string.| +||The inner exception reference.| +||The error message string.| ]]>
diff --git a/xml/System/Memory`1.xml b/xml/System/Memory`1.xml index c6abab0e8f5..c4ddb1e1b41 100644 --- a/xml/System/Memory`1.xml +++ b/xml/System/Memory`1.xml @@ -87,13 +87,13 @@ ## Remarks -Like , `Memory` represents a contiguous region of memory. Unlike , however, `Memory` is not a [ref struct](/dotnet/csharp/language-reference/builtin-types/ref-struct). This means that `Memory` can be placed on the managed heap, whereas cannot. As a result, the `Memory` structure does not have the same restrictions as a instance. In particular: +Like , `Memory` represents a contiguous region of memory. Unlike , however, `Memory` is not a [ref struct](/dotnet/csharp/language-reference/builtin-types/ref-struct). This means that `Memory` can be placed on the managed heap, whereas cannot. As a result, the `Memory` structure does not have the same restrictions as a instance. In particular: - It can be used as a field in a class. - It can be used across `await` and `yield` boundaries. -In addition to `Memory`, you can use to represent immutable or read-only memory. +In addition to `Memory`, you can use to represent immutable or read-only memory. ]]>
@@ -149,7 +149,7 @@ In addition to `Memory`, you can use object with a `default` value. +If `array` is `null`, this constructor returns a object with a `default` value. ]]> @@ -213,7 +213,7 @@ The array is object with a `default` value. +If `array` is `null`, this constructor returns a object with a `default` value. ]]>
@@ -283,7 +283,7 @@ If `array` is `null`, this constructor returns a objec instance to `destination` even if the contents of the current instance and `destination` overlap. +This method copies all of the contents of the current instance to `destination` even if the contents of the current instance and `destination` overlap. ]]> @@ -395,11 +395,11 @@ This method copies all of the contents of the current i The two objects are equal if: - - `other` is a or object. + - `other` is a or object. - Both objects point to the same array and have the same length. -The `Equals(Memory)` method performs a test for reference equality; it does not compare the elements of for equality. +The `Equals(Memory)` method performs a test for reference equality; it does not compare the elements of for equality. ]]>
@@ -464,7 +464,7 @@ The `Equals(Memory)` method performs a test for reference equality; it does n objects are equal if both objects point to the same array and have the same length. Note that the test for equality does not check whether the contents are equal. +Two objects are equal if both objects point to the same array and have the same length. Note that the test for equality does not check whether the contents are equal. ]]> @@ -1064,7 +1064,7 @@ Each call to the `ToArray` method returns a new array. `, the `ToString` method returns a that contains the characters pointed to by the . Otherwise, it returns a with the name of the type and the number of elements that the contains. +For a `Memory`, the `ToString` method returns a that contains the characters pointed to by the . Otherwise, it returns a with the name of the type and the number of elements that the contains. ]]> @@ -1122,7 +1122,7 @@ For a `Memory`, the `ToString` method returns a that instance to `destination` even if the contents of the current instance and `destination` overlap. +This method copies all of the contents of the current instance to `destination` even if the contents of the current instance and `destination` overlap. ]]> diff --git a/xml/System/MethodAccessException.xml b/xml/System/MethodAccessException.xml index 9634deea434..fb1058a89c3 100644 --- a/xml/System/MethodAccessException.xml +++ b/xml/System/MethodAccessException.xml @@ -84,7 +84,7 @@ uses the HRESULT COR_E_METHODACCESS, that has the value 0x80131510. - For a list of initial property values for an instance of , see the constructors. + For a list of initial property values for an instance of , see the constructors. ]]>
@@ -148,8 +148,8 @@ |Property|Value| |--------------|-----------| -||A null reference (`Nothing` in Visual Basic).| -||The localized error message string.| +||A null reference (`Nothing` in Visual Basic).| +||The localized error message string.| ]]>
@@ -207,8 +207,8 @@ |Property|Value| |--------------|-----------| -||A null reference (`Nothing` in Visual Basic).| -||The error message string.| +||A null reference (`Nothing` in Visual Basic).| +||The error message string.| ]]>
@@ -334,8 +334,8 @@ |Property|Value| |--------------|-----------| -||The inner exception reference.| -||The error message string.| +||The inner exception reference.| +||The error message string.| ]]>
diff --git a/xml/System/MidpointRounding.xml b/xml/System/MidpointRounding.xml index eff6ac9516a..49c5c15c910 100644 --- a/xml/System/MidpointRounding.xml +++ b/xml/System/MidpointRounding.xml @@ -69,7 +69,7 @@ For more information about this API, see Supplemental API remarks for MidpointRounding. method in conjunction with the `MidpointRounding` enumeration: + The following example demonstrates the method in conjunction with the `MidpointRounding` enumeration: :::code language="csharp" source="~/snippets/csharp/System/Decimal/Round/mpr.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/Decimal/Round/mpr.vb" id="Snippet1"::: diff --git a/xml/System/MissingFieldException.xml b/xml/System/MissingFieldException.xml index d01eb1fb2d0..a84647945fb 100644 --- a/xml/System/MissingFieldException.xml +++ b/xml/System/MissingFieldException.xml @@ -77,7 +77,7 @@ uses the HRESULT COR_E_MISSINGFIELD, that has the value 0x80131511. - For a list of initial property values for an instance of , see the constructors. + For a list of initial property values for an instance of , see the constructors. @@ -152,8 +152,8 @@ |Property|Value| |--------------|-----------| -||A null reference (`Nothing` in Visual Basic).| -||The localized error message string.| +||A null reference (`Nothing` in Visual Basic).| +||The localized error message string.| ]]> @@ -211,8 +211,8 @@ |Property|Value| |--------------|-----------| -||A null reference (`Nothing` in Visual Basic).| -||The error message string.| +||A null reference (`Nothing` in Visual Basic).| +||The error message string.| ]]>
@@ -338,8 +338,8 @@ |Property|Value| |--------------|-----------| -||The inner exception reference.| -||The error message string.| +||The inner exception reference.| +||The error message string.| ]]>
@@ -442,7 +442,7 @@ . The error message should be localized. + If the class name is not specified when the object is constructed, the default text string inherited from the base class is returned. This property overrides . The error message should be localized. diff --git a/xml/System/MissingMemberException.xml b/xml/System/MissingMemberException.xml index 344216c19d3..90320e80b53 100644 --- a/xml/System/MissingMemberException.xml +++ b/xml/System/MissingMemberException.xml @@ -81,7 +81,7 @@ uses the HRESULT COR_E_MISSINGMEMBER, that has the value 0x80131512. - For a list of initial property values for an instance of , see the constructors. + For a list of initial property values for an instance of , see the constructors. @@ -162,8 +162,8 @@ |Property|Value| |--------------|-----------| -||A null reference (`Nothing` in Visual Basic).| -||The localized error message string.| +||A null reference (`Nothing` in Visual Basic).| +||The localized error message string.| ]]> @@ -223,8 +223,8 @@ |Property|Value| |--------------|-----------| -||A null reference (`Nothing` in Visual Basic).| -||The error message string.| +||A null reference (`Nothing` in Visual Basic).| +||The error message string.| ]]>
@@ -352,8 +352,8 @@ |Property|Value| |--------------|-----------| -||The inner exception reference.| -||The error message string.| +||The inner exception reference.| +||The error message string.| ]]>
@@ -513,7 +513,7 @@ sets a with all the exception object data targeted for serialization. During deserialization, the exception object is reconstituted from the transmitted over the stream. + sets a with all the exception object data targeted for serialization. During deserialization, the exception object is reconstituted from the transmitted over the stream. For more information, see . @@ -625,7 +625,7 @@ ## Remarks If the class name is not specified when the object is constructed, the default text string inherited from the base class is returned. - This property overrides . The error message should be localized. + This property overrides . The error message should be localized. This property is read-only. @@ -691,7 +691,7 @@ ## Remarks contains a value that represents the signature of the missing member. - is used to format the signature. For additional information, see , , and . + is used to format the signature. For additional information, see , , and . ]]> diff --git a/xml/System/MissingMethodException.xml b/xml/System/MissingMethodException.xml index 110bd4159e8..13f08f46439 100644 --- a/xml/System/MissingMethodException.xml +++ b/xml/System/MissingMethodException.xml @@ -77,7 +77,7 @@ uses the HRESULT COR_E_MISSINGMETHOD, that has the value 0x80131513. - For a list of initial property values for an instance of , see the constructors. + For a list of initial property values for an instance of , see the constructors. The exact timing of when statically referenced methods are loaded is unspecified. This exception may be thrown before the method that references the missing method starts executing. @@ -157,8 +157,8 @@ The exact timing of when statically referenced methods are loaded is unspecified |Property|Value| |--------------|-----------| -||A null reference (`Nothing` in Visual Basic).| -||The localized error message string.| +||A null reference (`Nothing` in Visual Basic).| +||The localized error message string.| ]]>
@@ -216,8 +216,8 @@ The exact timing of when statically referenced methods are loaded is unspecified |Property|Value| |--------------|-----------| -||A null reference (`Nothing` in Visual Basic).| -||The error message string.| +||A null reference (`Nothing` in Visual Basic).| +||The error message string.| ]]>
@@ -344,8 +344,8 @@ The exact timing of when statically referenced methods are loaded is unspecified |Property|Value| |--------------|-----------| -||The inner exception reference.| -||The error message string.| +||The inner exception reference.| +||The error message string.| ]]>
@@ -451,7 +451,7 @@ The exact timing of when statically referenced methods are loaded is unspecified ## Remarks If the class name is not specified when the object is constructed, the default text string inherited from the base class is returned. - This property overrides . The error message should be localized. + This property overrides . The error message should be localized. diff --git a/xml/System/ModuleHandle.xml b/xml/System/ModuleHandle.xml index cf39ed435c1..f5a9aa8d28b 100644 --- a/xml/System/ModuleHandle.xml +++ b/xml/System/ModuleHandle.xml @@ -66,7 +66,7 @@ , , and methods provide efficient resolution of metadata tokens to runtime handles for fields, methods, and types in the current module. + The , , and methods provide efficient resolution of metadata tokens to runtime handles for fields, methods, and types in the current module. ]]> @@ -538,7 +538,7 @@ if the structures are equal; otherwise, . - .]]> + .]]> @@ -588,7 +588,7 @@ if the structures are unequal; otherwise, . - .]]> + .]]> @@ -654,7 +654,7 @@ method overload, which allows you to supply the necessary context. + To resolve a metadata token that identifies a field whose parent `TypeSpec` has a signature containing element type `var` or `mvar`, use the method overload, which allows you to supply the necessary context. > [!NOTE] > Information about metadata tokens can be found in the [Common Language Infrastructure (CLI) documentation](https://www.ecma-international.org/publications-and-standards/standards/ecma-335/), especially "Partition II: Metadata Definition and Semantics". @@ -814,7 +814,7 @@ method overload, which allows you to supply the necessary context. + To resolve a metadata token for a `MethodSpec` whose signature contains element type `var` or `mvar`, use the method overload, which allows you to supply the necessary context. > [!NOTE] > Information about metadata tokens can be found in the [Common Language Infrastructure (CLI) documentation](https://www.ecma-international.org/publications-and-standards/standards/ecma-335/), especially "Partition II: Metadata Definition and Semantics". @@ -978,7 +978,7 @@ method overload, which allows you to supply the necessary context. + To resolve a metadata token for a `TypeSpec` whose signature contains element type `var` or `mvar`, use the method overload, which allows you to supply the necessary context. > [!NOTE] > Information about metadata tokens can be found in the [Common Language Infrastructure (CLI) documentation](https://www.ecma-international.org/publications-and-standards/standards/ecma-335/), especially "Partition II: Metadata Definition and Semantics". diff --git a/xml/System/MulticastDelegate.xml b/xml/System/MulticastDelegate.xml index 9d7b382416b..4ea11fb1c71 100644 --- a/xml/System/MulticastDelegate.xml +++ b/xml/System/MulticastDelegate.xml @@ -88,7 +88,7 @@ Note that both methods include a single string parameter and return `void`. In other words, both methods can be assigned to the `CheckAndDisplayDelegate` delegate. - The `Test.Main` method is the application entry point. It instantiates a `StringContainer` object, populates it with strings, and creates two `CheckAndDisplayDelegate` delegates, `conStart` and `vowelStart`, that invoke a single method. It then calls the method to create the `multipleDelegates` delegate, which initially contains the `ConStart` and `VowelStart` delegates. Note that when the `multipleDelegates` delegate is invoked, it displays all the strings in the collection in their original order. This is because each letter is passed separately to each delegate, and each letter meets the filtering criteria of only one of the two delegates. Finally, after calls to and , `multipleDelegates` contains two `conStart` delegates. When it is invoked, each string in the `StringContainer` object is displayed twice. + The `Test.Main` method is the application entry point. It instantiates a `StringContainer` object, populates it with strings, and creates two `CheckAndDisplayDelegate` delegates, `conStart` and `vowelStart`, that invoke a single method. It then calls the method to create the `multipleDelegates` delegate, which initially contains the `ConStart` and `VowelStart` delegates. Note that when the `multipleDelegates` delegate is invoked, it displays all the strings in the collection in their original order. This is because each letter is passed separately to each delegate, and each letter meets the filtering criteria of only one of the two delegates. Finally, after calls to and , `multipleDelegates` contains two `conStart` delegates. When it is invoked, each string in the `StringContainer` object is displayed twice. :::code language="csharp" source="~/snippets/csharp/System/MulticastDelegate/Overview/delegatestring.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/MulticastDelegate/Overview/delegatestring.fs" id="Snippet1"::: @@ -159,7 +159,7 @@ method that specifies a method name and a target object. For example, the method overload creates a delegate for an instance method with a specified name. + This constructor cannot be used in application code. To create a delegate by specifying the name of an instance method, use an overload of the method that specifies a method name and a target object. For example, the method overload creates a delegate for an instance method with a specified name. ]]> @@ -222,7 +222,7 @@ method that specifies a method name but does not specify a target object. For example, the method overload creates a static delegate for a method with a specified name. + This constructor cannot be used in application code. To create a delegate by specifying the name of a static method, use an overload of the method that specifies a method name but does not specify a target object. For example, the method overload creates a static delegate for a method with a specified name. ]]> @@ -712,7 +712,7 @@ Two invocation list elements are equal if they invoke the same instance method on the same target instance, or they invoke the same static method. - The equivalent method for this operator is ]]> + The equivalent method for this operator is ]]> Cannot create an instance of an abstract class, or this member was invoked with a late-binding mechanism. @@ -776,7 +776,7 @@ Two invocation list elements are equal if they invoke the same instance method on the same target instance, or they invoke the same static method. - The equivalent method for this operator is ]]> + The equivalent method for this operator is ]]>
Cannot create an instance of an abstract class, or this member was invoked with a late-binding mechanism. diff --git a/xml/System/MulticastNotSupportedException.xml b/xml/System/MulticastNotSupportedException.xml index 1fbda2fb440..6d5f8132cf9 100644 --- a/xml/System/MulticastNotSupportedException.xml +++ b/xml/System/MulticastNotSupportedException.xml @@ -64,11 +64,11 @@ type can be combined. Two multicast delegates can be combined using the method. + Only delegates based on the type can be combined. Two multicast delegates can be combined using the method. uses the HRESULT COR_E_MULTICASTNOTSUPPORTED, which has the value 0x80131514. - For a list of initial property values for an instance of , see the constructors. + For a list of initial property values for an instance of , see the constructors. ]]> @@ -132,8 +132,8 @@ |Property|Value| |--------------|-----------| -||A null reference (`Nothing` in Visual Basic).| -||The localized error message string.| +||A null reference (`Nothing` in Visual Basic).| +||The localized error message string.| ]]>
@@ -189,8 +189,8 @@ |Property|Value| |--------------|-----------| -||A null reference (`Nothing` in Visual Basic).| -||The error message string.| +||A null reference (`Nothing` in Visual Basic).| +||The error message string.| ]]>
@@ -248,8 +248,8 @@ |Property|Value| |--------------|-----------| -||The inner exception reference.| -||The error message string.| +||The inner exception reference.| +||The error message string.| ]]>
diff --git a/xml/System/NetPipeStyleUriParser.xml b/xml/System/NetPipeStyleUriParser.xml index 0957894c352..5e4e63014f7 100644 --- a/xml/System/NetPipeStyleUriParser.xml +++ b/xml/System/NetPipeStyleUriParser.xml @@ -45,11 +45,11 @@ A parser based on the NetPipe scheme for the "Indigo" system. - @@ -89,11 +89,11 @@ Create a parser based on the NetPipe scheme for the "Indigo" system. - . - + . + ]]> diff --git a/xml/System/NetTcpStyleUriParser.xml b/xml/System/NetTcpStyleUriParser.xml index 5a8fa2da32e..cf53b88eba8 100644 --- a/xml/System/NetTcpStyleUriParser.xml +++ b/xml/System/NetTcpStyleUriParser.xml @@ -45,11 +45,11 @@ A parser based on the NetTcp scheme for the "Indigo" system. - @@ -89,11 +89,11 @@ Create a parser based on the NetTcp scheme for the "Indigo" system. - . - + . + ]]> diff --git a/xml/System/NewsStyleUriParser.xml b/xml/System/NewsStyleUriParser.xml index fc1e3b05bff..34c7adc4be5 100644 --- a/xml/System/NewsStyleUriParser.xml +++ b/xml/System/NewsStyleUriParser.xml @@ -82,11 +82,11 @@ Create a customizable parser based on the news scheme using the Network News Transfer Protocol (NNTP). - - + + ]]> diff --git a/xml/System/NotFiniteNumberException.xml b/xml/System/NotFiniteNumberException.xml index 9f5db8ccf14..0a4d7409522 100644 --- a/xml/System/NotFiniteNumberException.xml +++ b/xml/System/NotFiniteNumberException.xml @@ -68,7 +68,7 @@ uses the HRESULT COR_E_NOTFINITENUMBER, which has the value 0x80131528. - For a list of initial property values for an instance of , see the constructors. + For a list of initial property values for an instance of , see the constructors. ]]>
@@ -133,8 +133,8 @@ |Property|Value| |--------------|-----------| -||A null reference (`Nothing` in Visual Basic).| -||The localized error message string.| +||A null reference (`Nothing` in Visual Basic).| +||The localized error message string.| ]]>
@@ -189,8 +189,8 @@ |Property|Value| |--------------|-----------| -||A null reference (`Nothing` in Visual Basic).| -||The invalid number.| +||A null reference (`Nothing` in Visual Basic).| +||The invalid number.| ]]>
@@ -246,8 +246,8 @@ |Property|Value| |--------------|-----------| -||A null reference (`Nothing` in Visual Basic).| -||The error message string.| +||A null reference (`Nothing` in Visual Basic).| +||The error message string.| ]]>
@@ -370,9 +370,9 @@ |Property|Value| |--------------|-----------| -||A null reference (`Nothing` in Visual Basic).| -||The error message string.| -||The invalid number.| +||A null reference (`Nothing` in Visual Basic).| +||The error message string.| +||The invalid number.| ]]>
@@ -429,8 +429,8 @@ |Property|Value| |--------------|-----------| -||The inner exception reference.| -||The error message string.| +||The inner exception reference.| +||The error message string.| ]]>
@@ -490,9 +490,9 @@ |Property|Value| |--------------|-----------| -||The inner exception reference.| -||The error message string.| -||The invalid number.| +||The inner exception reference.| +||The error message string.| +||The invalid number.| ]]>
@@ -562,7 +562,7 @@ sets a with all the exception object data targeted for serialization. During deserialization, the exception object is reconstituted from the transmitted over the stream. + sets a with all the exception object data targeted for serialization. During deserialization, the exception object is reconstituted from the transmitted over the stream. For more information, see . diff --git a/xml/System/NotImplementedException.xml b/xml/System/NotImplementedException.xml index a5278ac23b0..381f32ee65b 100644 --- a/xml/System/NotImplementedException.xml +++ b/xml/System/NotImplementedException.xml @@ -145,8 +145,8 @@ The following example throws this exception for a method that has not been devel |Property|Value| |--------------|-----------| -||`null`.| -||The empty string ("").| +||`null`.| +||The empty string ("").| ]]> @@ -204,8 +204,8 @@ The following example throws this exception for a method that has not been devel |Property|Value| |--------------|-----------| -||`null`.| -||The error message string.| +||`null`.| +||The error message string.| ]]>
@@ -325,8 +325,8 @@ The following example throws this exception for a method that has not been devel |Property|Value| |--------------|-----------| -||The inner exception reference.| -||The error message string.| +||The inner exception reference.| +||The error message string.| ]]>
diff --git a/xml/System/NotSupportedException.xml b/xml/System/NotSupportedException.xml index 06727ab6168..a90d1ee6fe9 100644 --- a/xml/System/NotSupportedException.xml +++ b/xml/System/NotSupportedException.xml @@ -137,8 +137,8 @@ |Property|Value| |--------------|-----------| -||`null`.| -||The localized error message string.| +||`null`.| +||The localized error message string.| ]]>
@@ -196,8 +196,8 @@ |Property|Value| |--------------|-----------| -||`null`.| -||The error message string.| +||`null`.| +||The error message string.| ]]>
@@ -325,8 +325,8 @@ |Property|Value| |--------------|-----------| -||The inner exception reference.| -||The error message string.| +||The inner exception reference.| +||The error message string.| ]]>
diff --git a/xml/System/NullReferenceException.xml b/xml/System/NullReferenceException.xml index f6e1f5ffd9d..1770c4f4a94 100644 --- a/xml/System/NullReferenceException.xml +++ b/xml/System/NullReferenceException.xml @@ -109,7 +109,7 @@ A exception is thrown when you try to acces - You get a **null** return value from a method, and then call a method on the returned type. This sometimes is the result of a documentation error; the documentation fails to note that a method call can return `null`. In other cases, your code erroneously assumes that the method will always return a non-null value. - The code in the following example assumes that the method always returns `Person` object whose `FirstName` field matches a search string. Because there is no match, the runtime throws a exception. + The code in the following example assumes that the method always returns `Person` object whose `FirstName` field matches a search string. Because there is no match, the runtime throws a exception. :::code language="csharp" source="~/snippets/csharp/System/NullReferenceException/Overview/nullreturn2.cs" id="Snippet4"::: :::code language="fsharp" source="~/snippets/fsharp/System/NullReferenceException/Overview/nullreturn2.fs" id="Snippet4"::: @@ -137,7 +137,7 @@ A exception is thrown when you try to acces - You're enumerating the elements of an array that contains reference types, and your attempt to process one of the elements throws a exception. - The following example defines a string array. A `for` statement enumerates the elements in the array and calls each string's method before displaying the string. + The following example defines a string array. A `for` statement enumerates the elements in the array and calls each string's method before displaying the string. :::code language="csharp" source="~/snippets/csharp/System/NullReferenceException/Overview/Array1.cs" id="Snippet8"::: :::code language="fsharp" source="~/snippets/fsharp/System/NullReferenceException/Overview/Array1.fs" id="Snippet8"::: @@ -249,8 +249,8 @@ However, there are many situations where handling the error can be useful: |Property|Value| |--------------|-----------| -||`null`.| -||The localized error message string.| +||`null`.| +||The localized error message string.| ]]>
@@ -308,8 +308,8 @@ However, there are many situations where handling the error can be useful: |Property|Value| |--------------|-----------| -||`null`.| -||The error message string.| +||`null`.| +||The error message string.| ]]>
@@ -437,8 +437,8 @@ However, there are many situations where handling the error can be useful: |Property|Value| |--------------|-----------| -||The inner exception reference.| -||The error message string.| +||The inner exception reference.| +||The error message string.| ]]>
diff --git a/xml/System/Nullable.xml b/xml/System/Nullable.xml index 796b8d2a450..fa955d47d1d 100644 --- a/xml/System/Nullable.xml +++ b/xml/System/Nullable.xml @@ -277,14 +277,14 @@ , that contains a type parameter list, and the type parameter list declares one or more type parameters. A closed generic type is a type declaration where a particular type is specified for a type parameter. + A generic type definition is a type declaration, such as , that contains a type parameter list, and the type parameter list declares one or more type parameters. A closed generic type is a type declaration where a particular type is specified for a type parameter. For example, if the `nullableType` parameter is the type of `Nullable` in C# (`Nullable(Of Int32)` in Visual Basic), the return value is the type of (that is, the type argument of the closed generic type). ## Examples - The following code example defines a method whose return value is of type of . The code example uses the method to display the type argument of the return value. + The following code example defines a method whose return value is of type of . The code example uses the method to display the type argument of the return value. :::code language="csharp" source="~/snippets/csharp/System/Nullable/GetUnderlyingType/gut.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Nullable/GetUnderlyingType/gut.fs" id="Snippet1"::: diff --git a/xml/System/Nullable`1.xml b/xml/System/Nullable`1.xml index a80c1bc67b0..ed170ec7b8b 100644 --- a/xml/System/Nullable`1.xml +++ b/xml/System/Nullable`1.xml @@ -133,7 +133,7 @@ The following code example defines three rows of a table in the Microsoft Pubs s constructor initializes the property of the new object to `true`, and the property to the value of the `value` parameter. + The constructor initializes the property of the new object to `true`, and the property to the value of the `value` parameter. ]]> @@ -203,10 +203,10 @@ The following code example defines three rows of a table in the Microsoft Pubs s property of the current structure is `true` and the `other` argument is not `null`, equality is determined by passing the `other` parameter to the `Equals` method of the underlying value of the current structure. + If the property of the current structure is `true` and the `other` argument is not `null`, equality is determined by passing the `other` parameter to the `Equals` method of the underlying value of the current structure. ## Examples - The following code example determines whether an object and a object are equal to the current object. + The following code example determines whether an object and a object are equal to the current object. :::code language="csharp" source="~/snippets/csharp/System/NullableT/Equals/eq.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/NullableT/Equals/eq.fs" id="Snippet1"::: @@ -277,7 +277,7 @@ The following code example defines three rows of a table in the Microsoft Pubs s object if that value is defined; otherwise, it retrieves the default value or a specific default value. + The following code example retrieves the value of a object if that value is defined; otherwise, it retrieves the default value or a specific default value. :::code language="csharp" source="~/snippets/csharp/System/NullableT/GetValueOrDefault/gvod.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/NullableT/GetValueOrDefault/gvod.fs" id="Snippet1"::: @@ -345,7 +345,7 @@ The following code example defines three rows of a table in the Microsoft Pubs s method returns a value even if the property is `false` (unlike the property, which throws an exception). If the property is `false`, the method returns the [default](/dotnet/csharp/language-reference/keywords/default-values-table) value of the underlying type. + The method returns a value even if the property is `false` (unlike the property, which throws an exception). If the property is `false`, the method returns the [default](/dotnet/csharp/language-reference/keywords/default-values-table) value of the underlying type. ]]> @@ -409,7 +409,7 @@ The following code example defines three rows of a table in the Microsoft Pubs s method returns a value even if the property is `false` (unlike the property, which throws an exception). + The method returns a value even if the property is `false` (unlike the property, which throws an exception). ]]> @@ -469,12 +469,12 @@ The following code example defines three rows of a table in the Microsoft Pubs s property is `true`, the value of the current object can be accessed with the property. Otherwise, attempting to access its value throws an exception. + If the property is `true`, the value of the current object can be accessed with the property. Otherwise, attempting to access its value throws an exception. ## Examples - The following example uses the property of a `Nullable` (`Nullable(Of Integer)` in Visual Basic) object to determine whether it should display the object's property or its property. + The following example uses the property of a `Nullable` (`Nullable(Of Integer)` in Visual Basic) object to determine whether it should display the object's property or its property. :::code language="csharp" source="~/snippets/csharp/System/NullableT/HasValue/hasvalue2.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/NullableT/HasValue/hasvalue2.fs" id="Snippet1"::: @@ -534,12 +534,12 @@ The following code example defines three rows of a table in the Microsoft Pubs s instance to type `T`, the type of . The syntax for such explicit conversions is language-dependent. You may also be able to perform the conversion by calling the method. + This operator supports the explicit conversion of the current instance to type `T`, the type of . The syntax for such explicit conversions is language-dependent. You may also be able to perform the conversion by calling the method. - The equivalent method for this operator is + The equivalent method for this operator is ## Examples - The operator enables code such as the following, which converts a `Nullable(Of Int32)` value to an value. + The operator enables code such as the following, which converts a `Nullable(Of Int32)` value to an value. :::code language="csharp" source="~/snippets/csharp/System/NullableT/op_Explicit/explicit1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/NullableT/op_Explicit/explicit1.fs" id="Snippet1"::: @@ -599,15 +599,15 @@ The following code example defines three rows of a table in the Microsoft Pubs s property of the new value is initialized to the `value` parameter and the property is initialized to `true`. + The property of the new value is initialized to the `value` parameter and the property is initialized to `true`. - The equivalent method for this operator is + The equivalent method for this operator is > [!NOTE] -> In C# and Visual Basic, an implicit conversion from `T` to does not invoke this operator because these languages have special rules for the conversion. This operator is provided for the benefit of languages that do not have such special rules. +> In C# and Visual Basic, an implicit conversion from `T` to does not invoke this operator because these languages have special rules for the conversion. This operator is provided for the benefit of languages that do not have such special rules. > [!NOTE] -> In C# and Visual Basic, an implicit conversion from a `null` or `Nothing` literal to produces a value whose property is initialized to `false`. The conversion occurs at compile time in these languages and does not invoke any operator. +> In C# and Visual Basic, an implicit conversion from a `null` or `Nothing` literal to produces a value whose property is initialized to `false`. The conversion occurs at compile time in these languages and does not invoke any operator. ]]> @@ -661,12 +661,12 @@ The following code example defines three rows of a table in the Microsoft Pubs s property returns the string yielded by calling the `ToString` property of the object returned by the property. + The property returns the string yielded by calling the `ToString` property of the object returned by the property. ## Examples - The following code example displays the value of the current object. + The following code example displays the value of the current object. :::code language="csharp" source="~/snippets/csharp/System/NullableT/ToString/ts.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/NullableT/ToString/ts.fs" id="Snippet1"::: @@ -732,12 +732,12 @@ The following code example defines three rows of a table in the Microsoft Pubs s object, you can compare it to `null` and retrieve its property, but you cannot access its property or call its other members. + If a value of type `T` has not been assigned to the object, you can compare it to `null` and retrieve its property, but you cannot access its property or call its other members. ## Examples - The following example uses the property of a `Nullable` (`Nullable(Of Integer)` in Visual Basic) object to determine whether it should display the object's property or its property. + The following example uses the property of a `Nullable` (`Nullable(Of Integer)` in Visual Basic) object to determine whether it should display the object's property or its property. :::code language="csharp" source="~/snippets/csharp/System/NullableT/HasValue/hasvalue2.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/NullableT/HasValue/hasvalue2.fs" id="Snippet1"::: diff --git a/xml/System/Object.xml b/xml/System/Object.xml index b732794fc6e..e68a5e60a09 100644 --- a/xml/System/Object.xml +++ b/xml/System/Object.xml @@ -269,18 +269,18 @@ The following example defines a Point type derived from the method indicates whether two objects, `objA` and `objB`, are equal. It also enables you to test objects whose value is **null** for equality. It compares `objA` and `objB` for equality as follows: + The static method indicates whether two objects, `objA` and `objB`, are equal. It also enables you to test objects whose value is **null** for equality. It compares `objA` and `objB` for equality as follows: -- It determines whether the two objects represent the same object reference. If they do, the method returns `true`. This test is equivalent to calling the method. In addition, if both `objA` and `objB` are **null**, the method returns `true`. +- It determines whether the two objects represent the same object reference. If they do, the method returns `true`. This test is equivalent to calling the method. In addition, if both `objA` and `objB` are **null**, the method returns `true`. - It determines whether either `objA` or `objB` is **null**. If so, it returns `false`. -- If the two objects do not represent the same object reference and neither is **null**, it calls `objA`.`Equals`(`objB`) and returns the result. This means that if `objA` overrides the method, this override is called. +- If the two objects do not represent the same object reference and neither is **null**, it calls `objA`.`Equals`(`objB`) and returns the result. This means that if `objA` overrides the method, this override is called. ## Examples - The following example illustrates the method and compares it with the method. + The following example illustrates the method and compares it with the method. :::code language="csharp" source="~/snippets/csharp/System/Object/Equals/equals_static2.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Object/Equals/equals_static2.fs" id="Snippet1"::: @@ -345,13 +345,13 @@ The following example defines a Point type derived from the For more information about this API, see Supplemental API remarks for Object.Finalize. method is called when an object that overrides is destroyed. Note that, in a production application, the method would be overridden to release unmanaged resources held by the object. Also note that the C# example provides a destructor instead of overriding the method. +The following example verifies that the method is called when an object that overrides is destroyed. Note that, in a production application, the method would be overridden to release unmanaged resources held by the object. Also note that the C# example provides a destructor instead of overriding the method. :::code language="csharp" source="~/snippets/csharp/System/Object/Finalize/finalize1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Object/Finalize/finalize1.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/Object/Finalize/finalize1.vb" id="Snippet1"::: -For an additional example that overrides the method, see the method. +For an additional example that overrides the method, see the method. ]]> @@ -509,7 +509,7 @@ For an additional example that overrides the me is the base class for all types in the .NET type system, the method can be used to return objects that represent all .NET types. .NET recognizes the following five categories of types: + Because is the base class for all types in the .NET type system, the method can be used to return objects that represent all .NET types. .NET recognizes the following five categories of types: - Classes, which are derived from . - Value types, which are derived from . @@ -517,7 +517,7 @@ For an additional example that overrides the me - Enumerations, which are derived from . - Delegates, which are derived from . - For two objects `x` and `y` that have identical runtime types, `Object.ReferenceEquals(x.GetType(),y.GetType())` returns `true`. The following example uses the method with the method to determine whether one numeric value is the same type as two other numeric values. + For two objects `x` and `y` that have identical runtime types, `Object.ReferenceEquals(x.GetType(),y.GetType())` returns `true`. The following example uses the method with the method to determine whether one numeric value is the same type as two other numeric values. :::code language="csharp" source="~/snippets/csharp/System/Object/GetType/gettype1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Object/GetType/gettype1.fs" id="Snippet1"::: @@ -526,7 +526,7 @@ For an additional example that overrides the me > [!NOTE] > To determine whether an object is a specific type, you can use your language's type comparison keyword or construct. For example, you can use the `TypeOf…Is` construct in Visual Basic or the `is` keyword in C#. - The method is inherited by all types that derive from . This means that, in addition to using your own language's comparison keyword, you can use the method to determine the type of a particular object, as the following example shows. + The method is inherited by all types that derive from . This means that, in addition to using your own language's comparison keyword, you can use the method to determine the type of a particular object, as the following example shows. :::code language="csharp" source="~/snippets/csharp/System/Object/GetType/GetTypeEx2.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/Object/GetType/GetTypeEx2.fs" id="Snippet2"::: @@ -538,7 +538,7 @@ For an additional example that overrides the me ## Examples - The following code example demonstrates that returns the runtime type of the current instance. + The following code example demonstrates that returns the runtime type of the current instance. :::code language="csharp" source="~/snippets/csharp/System/Object/GetType/gettype.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Object/GetType/gettype.fs" id="Snippet1"::: @@ -603,25 +603,25 @@ For an additional example that overrides the me method creates a shallow copy by creating a new object, and then copying the nonstatic fields of the current object to the new object. If a field is a value type, a bit-by-bit copy of the field is performed. If a field is a reference type, the reference is copied but the referred object is not; therefore, the original object and its clone refer to the same object. + The method creates a shallow copy by creating a new object, and then copying the nonstatic fields of the current object to the new object. If a field is a value type, a bit-by-bit copy of the field is performed. If a field is a reference type, the reference is copied but the referred object is not; therefore, the original object and its clone refer to the same object. To illustrate the difference between a shallow and a deep copy operation, consider an object called X that references objects A and B. Object B, in turn, references object C. A shallow copy of X creates new object X2 that also references objects A and B. In contrast, a deep copy of X creates a new object X2 that references the new objects A2 and B2, which are copies of A and B. B2, in turn, references the new object C2, which is a copy of C. - There are numerous ways to implement a deep copy operation if the shallow copy operation performed by the method doesn't meet your needs. These include the following: + There are numerous ways to implement a deep copy operation if the shallow copy operation performed by the method doesn't meet your needs. These include the following: - Call a class constructor of the object to be copied to create a second object with property values taken from the first object. This assumes that the values of an object are entirely defined by its class constructor. -- Call the method to create a shallow copy of an object, and then assign new objects whose values are the same as the original object to any properties or fields whose values are reference types. The `DeepCopy` method in the example illustrates this approach. +- Call the method to create a shallow copy of an object, and then assign new objects whose values are the same as the original object to any properties or fields whose values are reference types. The `DeepCopy` method in the example illustrates this approach. - Serialize the object to be deep copied, and then restore the serialized data to a different object variable. - Use reflection with recursion to perform the deep copy operation. ## Examples - The following example illustrates the method. It defines a `ShallowCopy` method that calls the method to perform a shallow copy operation on a `Person` object. It also defines a `DeepCopy` method that performs a deep copy operation on a `Person` object. + The following example illustrates the method. It defines a `ShallowCopy` method that calls the method to perform a shallow copy operation on a `Person` object. It also defines a `DeepCopy` method that performs a deep copy operation on a `Person` object. :::code language="csharp" source="~/snippets/csharp/System/Object/MemberwiseClone/memberwiseclone1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Object/MemberwiseClone/memberwiseclone1.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/Object/MemberwiseClone/memberwiseclone1.vb" id="Snippet1"::: - In this example, the `Person.IdInfo` property returns an `IdInfo` object. As the output from the example shows, when a `Person` object is cloned by calling the method, the cloned `Person` object is an independent copy of the original object, except that they share the same `Person.IdInfo` object reference. As a result, modifying the clone's `Person.IdInfo` property changes the original object's `Person.IdInfo` property. On the other hand, when a deep copy operation is performed, the cloned `Person` object, including its `Person.IdInfo` property, can be modified without affecting the original object. + In this example, the `Person.IdInfo` property returns an `IdInfo` object. As the output from the example shows, when a `Person` object is cloned by calling the method, the cloned `Person` object is an independent copy of the original object, except that they share the same `Person.IdInfo` object reference. As a result, modifying the clone's `Person.IdInfo` property changes the original object's `Person.IdInfo` property. On the other hand, when a deep copy operation is performed, the cloned `Person` object, including its `Person.IdInfo` property, can be modified without affecting the original object. ]]> @@ -692,11 +692,11 @@ To illustrate the difference between a shallow and a deep copy operation, consid method and the equality operator, the method cannot be overridden. Because of this, if you want to test two object references for equality and you are unsure about the implementation of the `Equals` method, you can call the method. + Unlike the method and the equality operator, the method cannot be overridden. Because of this, if you want to test two object references for equality and you are unsure about the implementation of the `Equals` method, you can call the method. - However, the return value of the method may appear to be anomalous in these two scenarios: + However, the return value of the method may appear to be anomalous in these two scenarios: -- When comparing value types. If `objA` and `objB` are value types, they are boxed before they are passed to the method. This means that if both `objA` and `objB` represent the same instance of a value type, the method nevertheless returns `false`, as the following example shows. +- When comparing value types. If `objA` and `objB` are value types, they are boxed before they are passed to the method. This means that if both `objA` and `objB` represent the same instance of a value type, the method nevertheless returns `false`, as the following example shows. :::code language="csharp" source="~/snippets/csharp/System/Object/ReferenceEquals/referenceequals4.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Object/ReferenceEquals/referenceequals4.fs" id="Snippet1"::: @@ -704,19 +704,19 @@ To illustrate the difference between a shallow and a deep copy operation, consid For information on boxing value types, see [Boxing and Unboxing](/dotnet/csharp/programming-guide/types/boxing-and-unboxing). -- When comparing strings. If `objA` and `objB` are strings, the method returns `true` if the string is interned. It does not perform a test for value equality. In the following example, `s1` and `s2` are equal because they are two instances of a single interned string. However, `s3` and `s4` are not equal, because although they have identical string values, that string is not interned. +- When comparing strings. If `objA` and `objB` are strings, the method returns `true` if the string is interned. It does not perform a test for value equality. In the following example, `s1` and `s2` are equal because they are two instances of a single interned string. However, `s3` and `s4` are not equal, because although they have identical string values, that string is not interned. :::code language="csharp" source="~/snippets/csharp/System/Object/ReferenceEquals/referenceequalsa.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/Object/ReferenceEquals/referenceequalsa.fs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System/Object/ReferenceEquals/referenceequalsa.vb" id="Snippet2"::: - For more information about string interning, see . + For more information about string interning, see . ## Examples - The following example uses to determine if two objects are the same instance. + The following example uses to determine if two objects are the same instance. :::code language="csharp" source="~/snippets/csharp/System/Object/ReferenceEquals/referenceequals.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Object/ReferenceEquals/referenceequals.fs" id="Snippet1"::: diff --git a/xml/System/ObjectDisposedException.xml b/xml/System/ObjectDisposedException.xml index b18bdfcaaf1..f2c0965317c 100644 --- a/xml/System/ObjectDisposedException.xml +++ b/xml/System/ObjectDisposedException.xml @@ -71,15 +71,15 @@ ## Remarks An is thrown when you try to access a member of an object that implements the interface or interface, and that object has been disposed. Typically, this exception is caused by one of the following conditions: -- You've called an `IDisposable` object's `Dispose` method (or an `IDisposableAsync` object's `DisposeAsync` method), and you're trying to access an instance member that gets or sets the object's state. The following example illustrates the that is thrown when you try to reset the frequency of timer notifications after you call the method. +- You've called an `IDisposable` object's `Dispose` method (or an `IDisposableAsync` object's `DisposeAsync` method), and you're trying to access an instance member that gets or sets the object's state. The following example illustrates the that is thrown when you try to reset the frequency of timer notifications after you call the method. :::code language="csharp" source="~/snippets/csharp/System/ObjectDisposedException/Overview/dispose1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/ObjectDisposedException/Overview/dispose1.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/ObjectDisposedException/Overview/dispose1.vb" id="Snippet1"::: -- You've called an object's `Close` method, and you're trying to access an instance member that gets or sets the object's state. Often, the `Close` method provides a type's public implementation of the method. The same is true for `CloseAsync` and ``. +- You've called an object's `Close` method, and you're trying to access an instance member that gets or sets the object's state. Often, the `Close` method provides a type's public implementation of the method. The same is true for `CloseAsync` and ``. -- You've called an object's `Dispose` or `DisposeAsync` methods multiple times. Typically, this doesn't throw an exception. However, depending on how a type implements or , it may not allow multiple calls to that method. +- You've called an object's `Dispose` or `DisposeAsync` methods multiple times. Typically, this doesn't throw an exception. However, depending on how a type implements or , it may not allow multiple calls to that method. In most cases, this exception results from developer error. Instead of handling the error in a `try`/`catch` block, you should correct the error, typically by reinstantiating the object. @@ -462,7 +462,7 @@ Caught: ## Remarks If the property is not `null`, the message includes the name of the object. - This property overrides . + This property overrides . ]]> diff --git a/xml/System/ObsoleteAttribute.xml b/xml/System/ObsoleteAttribute.xml index f6bbf6dba75..328404074bb 100644 --- a/xml/System/ObsoleteAttribute.xml +++ b/xml/System/ObsoleteAttribute.xml @@ -72,7 +72,7 @@ Marks program elements that are no longer in use. - Source code imported from + Source code imported from ObsoleteAttribute.cs without any changes, all resulting warnings ignored accordingly. @@ -149,8 +149,8 @@ The following example defines a class that contains a property and a method that |Property|Value| |--------------|-----------| -||`false`| -||`null`| +||`false`| +||`null`| ||`null`| ||`null`| @@ -210,8 +210,8 @@ The following example defines a class that contains a property and a method that |Property|Value| |--------------|-----------| -||`false`.| -||The workaround message.| +||`false`.| +||The workaround message.| ||`null`.| ||`null`.| @@ -274,8 +274,8 @@ The following example defines a class that contains a property and a method that |Property|Value| |--------------|-----------| -||The `error` value.| -||The `message` value.| +||The `error` value.| +||The `message` value.| ||`null`.| ||`null`.| @@ -375,7 +375,7 @@ This property represents the unique ID that can be used to suppress the warnings attributes applied to members of the type and displays the values of their and properties. + The following example defines a class that contains two members marked as obsolete. The first, a property named `OldProperty`, produces a compiler warning if it is called. The second, a method named `CallOldMethod`, produces a compiler error. The example uses reflection to get information about the attributes applied to members of the type and displays the values of their and properties. :::code language="csharp" source="~/snippets/csharp/System/ObsoleteAttribute/IsError/obsoleteattribute_message.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/ObsoleteAttribute/IsError/obsoleteattribute_message.fs" id="Snippet1"::: @@ -433,7 +433,7 @@ This property represents the unique ID that can be used to suppress the warnings attributes applied to members of the type and displays the values of their and properties. + The following example defines a class that contains two members marked as obsolete. The first, a property named `OldProperty`, produces a compiler warning if it is called. The second, a method named `CallOldMethod`, produces a compiler error. The example uses reflection to get information about the attributes applied to members of the type and displays the values of their and properties. :::code language="csharp" source="~/snippets/csharp/System/ObsoleteAttribute/IsError/obsoleteattribute_message.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/ObsoleteAttribute/IsError/obsoleteattribute_message.fs" id="Snippet1"::: diff --git a/xml/System/OperatingSystem.xml b/xml/System/OperatingSystem.xml index c061be0e3cf..0498189b2d9 100644 --- a/xml/System/OperatingSystem.xml +++ b/xml/System/OperatingSystem.xml @@ -88,7 +88,7 @@ ## Remarks The class contains information about an operating system. - For information about the current runtime operating system, retrieve the object returned by the property. For a list of Windows operating system versions and their corresponding version numbers returned by the and properties and the method, see [Operating System Version](/windows/win32/sysinfo/operating-system-version). + For information about the current runtime operating system, retrieve the object returned by the property. For a list of Windows operating system versions and their corresponding version numbers returned by the and properties and the method, see [Operating System Version](/windows/win32/sysinfo/operating-system-version). By design, the class is not a general purpose means of describing an operating system, and you cannot derive a more inclusive type from the class. If you need a type to contain other information about an operating system, create your own type, then include a field of type and any additional fields, properties, or methods that you require. @@ -209,7 +209,7 @@ method to make a copy of an object. The clone is compared with the original object to show that they are not the same object. + The following code example illustrates the use of the method to make a copy of an object. The clone is compared with the original object to show that they are not the same object. :::code language="csharp" source="~/snippets/csharp/System/OperatingSystem/Clone/clone.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/OperatingSystem/Clone/clone.fs" id="Snippet1"::: @@ -286,9 +286,9 @@ method. + The `context` parameter is reserved for future use; it is currently not implemented in the method. - For more information, see the method. + For more information, see the method. ]]> @@ -1276,7 +1276,7 @@ For a list of Windows operating system versions and their corresponding version ## Examples - The following code example illustrates the use of the method to display objects. + The following code example illustrates the use of the method to display objects. :::code language="csharp" source="~/snippets/csharp/System/OperatingSystem/ToString/ctor_tostr.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/OperatingSystem/ToString/ctor_tostr.fs" id="Snippet1"::: @@ -1394,7 +1394,7 @@ For a list of Windows operating system versions and their corresponding version is the same as the value returned by the method. However, an implementation of the .NET Framework for a different platform might return a more appropriate string for that platform. + By default, the value returned by is the same as the value returned by the method. However, an implementation of the .NET Framework for a different platform might return a more appropriate string for that platform. For a list of Windows operating system versions and their corresponding version numbers, see [Operating System Version](/windows/win32/sysinfo/operating-system-version). diff --git a/xml/System/OperationCanceledException.xml b/xml/System/OperationCanceledException.xml index ed5bb0d8ed7..4951f920c6f 100644 --- a/xml/System/OperationCanceledException.xml +++ b/xml/System/OperationCanceledException.xml @@ -150,9 +150,9 @@ |Property|Value| |--------------|-----------| -||A nullreference (`Nothing` in Visual Basic).| -||The localized error message string.| -||A cancellation token created in the non-canceled state.| +||A nullreference (`Nothing` in Visual Basic).| +||The localized error message string.| +||A cancellation token created in the non-canceled state.| ]]> @@ -214,9 +214,9 @@ |Property|Value| |--------------|-----------| -||A null reference (`Nothing` in Visual Basic).| -||The error message string.| -||A cancellation token created in the non-canceled state.| +||A null reference (`Nothing` in Visual Basic).| +||The error message string.| +||A cancellation token created in the non-canceled state.| ]]> @@ -276,9 +276,9 @@ |Property|Value| |--------------|-----------| -||A nullreference (`Nothing` in Visual Basic).| -||The localized error message string.| -||`token`.| +||A nullreference (`Nothing` in Visual Basic).| +||The localized error message string.| +||`token`.| ]]> @@ -408,9 +408,9 @@ |Property Type|Condition| |-------------------|---------------| -||`innerException`.| -||`message`.| -||A cancellation token created in the non-canceled state.| +||`innerException`.| +||`message`.| +||A cancellation token created in the non-canceled state.| ]]> @@ -473,9 +473,9 @@ |Property|Value| |--------------|-----------| -||A null reference (`Nothing` in Visual Basic).| -||`message`.| -||`token`.| +||A null reference (`Nothing` in Visual Basic).| +||`message`.| +||`token`.| ]]> @@ -542,9 +542,9 @@ |Property Type|Condition| |-------------------|---------------| -||`innerException`.| -||`message`.| -||`token`.| +||`innerException`.| +||`message`.| +||`token`.| ]]> diff --git a/xml/System/OutOfMemoryException.xml b/xml/System/OutOfMemoryException.xml index 3389149d2bf..8548123d9d7 100644 --- a/xml/System/OutOfMemoryException.xml +++ b/xml/System/OutOfMemoryException.xml @@ -78,7 +78,7 @@ uses the HRESULT `COR_E_OUTOFMEMORY`, which has the value 0x8007000E. -For a list of initial property values for an instance of , see the constructors. +For a list of initial property values for an instance of , see the constructors. > [!NOTE] > The value of the inherited property is always `null`. @@ -89,7 +89,7 @@ An exception has two major causes: - The common language runtime cannot allocate enough contiguous memory to successfully perform an operation. This exception can be thrown by any property assignment or method call that requires a memory allocation. For more information on the cause of the exception, see the blog post ["Out of Memory" Does Not Refer to Physical Memory](https://learn.microsoft.com/archive/blogs/ericlippert/out-of-memory-does-not-refer-to-physical-memory). - This type of exception represents a catastrophic failure. If you choose to handle the exception, you should include a `catch` block that calls the method to terminate your app and add an entry to the system event log, as the following example does. + This type of exception represents a catastrophic failure. If you choose to handle the exception, you should include a `catch` block that calls the method to terminate your app and add an entry to the system event log, as the following example does. :::code language="csharp" source="~/snippets/csharp/System/OutOfMemoryException/Overview/failfast1.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/OutOfMemoryException/Overview/failfast1.fs" id="Snippet2"::: @@ -97,9 +97,9 @@ An exception has two major causes: Some of the conditions under which the exception is thrown and the actions you can take to eliminate it include the following: -**You are calling the method.** +**You are calling the method.** -You are attempting to increase the length of a object beyond the size specified by its property. The following example illustrates the exception thrown by a call to the method when the example tries to insert a string that would cause the object's property to exceed its maximum capacity. +You are attempting to increase the length of a object beyond the size specified by its property. The following example illustrates the exception thrown by a call to the method when the example tries to insert a string that would cause the object's property to exceed its maximum capacity. :::code language="csharp" source="~/snippets/csharp/System/OutOfMemoryException/Overview/sb_example1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/OutOfMemoryException/Overview/sb_example1.fs" id="Snippet1"::: @@ -107,9 +107,9 @@ You are attempting to increase the length of a You can do either of the following to address the error: -- Replace the call to the constructor with a call any other constructor overload. The maximum capacity of your object will be set to its default value, which is . +- Replace the call to the constructor with a call any other constructor overload. The maximum capacity of your object will be set to its default value, which is . -- Call the constructor with a `maxCapacity` value that is large enough to accommodate any expansions to the object. +- Call the constructor with a `maxCapacity` value that is large enough to accommodate any expansions to the object. **Your app runs as a 32-bit process.** @@ -119,9 +119,9 @@ You can do either of the following to address the error: Although the garbage collector is able to free memory allocated to managed types, it does not manage memory allocated to unmanaged resources such as operating system handles (including handles to files, memory-mapped files, pipes, registry keys, and wait handles) and memory blocks allocated directly by Windows API calls or by calls to memory allocation functions such as `malloc`. Types that consume unmanaged resources implement the interface. -If you are consuming a type that uses unmanaged resources, you should be sure to call its method when you have finished using it. (Some types also implement a `Close` method that is identical in function to a `Dispose` method.) For more information, see the [Using Objects That Implement IDisposable](/dotnet/standard/garbage-collection/using-objects) topic. +If you are consuming a type that uses unmanaged resources, you should be sure to call its method when you have finished using it. (Some types also implement a `Close` method that is identical in function to a `Dispose` method.) For more information, see the [Using Objects That Implement IDisposable](/dotnet/standard/garbage-collection/using-objects) topic. -If you have created a type that uses unmanaged resources, make sure that you have implemented the Dispose pattern and, if necessary, supplied a finalizer. For more information, see [Implementing a Dispose method](/dotnet/standard/garbage-collection/implementing-dispose) and . +If you have created a type that uses unmanaged resources, make sure that you have implemented the Dispose pattern and, if necessary, supplied a finalizer. For more information, see [Implementing a Dispose method](/dotnet/standard/garbage-collection/implementing-dispose) and . **You are attempting to create a large array in a 64-bit process** @@ -155,17 +155,17 @@ The following example eliminates the exceptio Because strings are immutable, each string concatenation operation creates a new string. The impact for small strings, or for a small number of concatenation operations, is negligible. But for large strings or a very large number of concatenation operations, string concatenation can lead to a large number of memory allocations and memory fragmentation, poor performance, and possibly exceptions. -When concatenating large strings or performing a large number of concatenation operations, you should use the class instead of the class. When you have finished manipulating the string, convert the instance to a string by calling the method. +When concatenating large strings or performing a large number of concatenation operations, you should use the class instead of the class. When you have finished manipulating the string, convert the instance to a string by calling the method. **You pin a large number of objects in memory.** -Pinning a large number of objects in memory for long periods can make it difficult for the garbage collector to allocate contiguous blocks of memory. If you've pinned a large number of objects in memory, for example by using the `fixed` statement in C# or by calling the method with a handle type of , you can do the following to address the exception. +Pinning a large number of objects in memory for long periods can make it difficult for the garbage collector to allocate contiguous blocks of memory. If you've pinned a large number of objects in memory, for example by using the `fixed` statement in C# or by calling the method with a handle type of , you can do the following to address the exception. - Evaluate whether each object really needs to be pinned, - Ensure that each object is unpinned as soon as possible. -- Make sure that each call to the method to pin memory has a corresponding call to the method to unpin that memory. +- Make sure that each call to the method to pin memory has a corresponding call to the method to unpin that memory. The following Microsoft intermediate (MSIL) instructions throw an exception: @@ -242,8 +242,8 @@ The following Microsoft intermediate (MSIL) instructions throw an |`null`.| -||The localized error message string.| +||`null`.| +||The localized error message string.| ]]> @@ -303,8 +303,8 @@ The following Microsoft intermediate (MSIL) instructions throw an |A null reference (`Nothing` in Visual Basic).| -||The error message string.| +||A null reference (`Nothing` in Visual Basic).| +||The error message string.| ]]> @@ -432,8 +432,8 @@ The following Microsoft intermediate (MSIL) instructions throw an |The inner exception reference.| -||The error message string.| +||The inner exception reference.| +||The error message string.| ]]> diff --git a/xml/System/OverflowException.xml b/xml/System/OverflowException.xml index f85a49f397b..d8031809a7c 100644 --- a/xml/System/OverflowException.xml +++ b/xml/System/OverflowException.xml @@ -106,7 +106,7 @@ uses the HRESULT COR_E_OVERFLOW, which has the value 0x80131516. - For a list of initial property values for an instance of , see the constructors. + For a list of initial property values for an instance of , see the constructors. ]]> @@ -174,8 +174,8 @@ |Property|Value| |--------------|-----------| -||A null reference (`Nothing` in Visual Basic).| -||The localized error message string.| +||A null reference (`Nothing` in Visual Basic).| +||The localized error message string.| ]]> @@ -235,8 +235,8 @@ |Property|Value| |--------------|-----------| -||A null reference (`Nothing` in Visual Basic).| -||The error message string.| +||A null reference (`Nothing` in Visual Basic).| +||The error message string.| ]]> @@ -363,8 +363,8 @@ |Property|Value| |--------------|-----------| -||The inner exception reference.| -||The error message string.| +||The inner exception reference.| +||The error message string.| ]]> diff --git a/xml/System/ParamArrayAttribute.xml b/xml/System/ParamArrayAttribute.xml index 5f6ba147161..710da9921e6 100644 --- a/xml/System/ParamArrayAttribute.xml +++ b/xml/System/ParamArrayAttribute.xml @@ -75,7 +75,7 @@ > [!NOTE] > Typically, the is not used directly in code. Instead, individual language keywords, such as `ParamArray` in Visual Basic and `params` in C#, are used as wrappers for the class. Some languages, such as C#, may even require the use of the language keyword and prohibit the use of . - During overload resolution, when compilers that support parameter arrays encounter a method overload that does not exist but has one fewer parameter than an overload that includes a parameter array, they will replace the method with the overload that includes the parameter array. For example, a call to the `String.Split()` instance method (which does not exist in the class) is resolved as a call to the method. The compiler will also pass an empty array of the required type to the method. This means that the method must always be prepared to handle an array whose length is zero when it processes the elements in the parameter array. The example provides an illustration. + During overload resolution, when compilers that support parameter arrays encounter a method overload that does not exist but has one fewer parameter than an overload that includes a parameter array, they will replace the method with the overload that includes the parameter array. For example, a call to the `String.Split()` instance method (which does not exist in the class) is resolved as a call to the method. The compiler will also pass an empty array of the required type to the method. This means that the method must always be prepared to handle an array whose length is zero when it processes the elements in the parameter array. The example provides an illustration. For more information about using attributes, see [Attributes](/dotnet/standard/attributes/). diff --git a/xml/System/PlatformID.xml b/xml/System/PlatformID.xml index e42b8820424..ad4541e47d2 100644 --- a/xml/System/PlatformID.xml +++ b/xml/System/PlatformID.xml @@ -69,13 +69,13 @@ and properties to obtain the `PlatformID` enumeration for the currently executing operating system or development platform. Use the `PlatformID` enumeration to help determine whether the current operating system or development platform supports your application. + Use the and properties to obtain the `PlatformID` enumeration for the currently executing operating system or development platform. Use the `PlatformID` enumeration to help determine whether the current operating system or development platform supports your application. You can use the underlying integer value of each `PlatformID` enumeration member as the `PlatformId` argument for the [SignTool.exe (Sign Tool)](/dotnet/framework/tools/signtool-exe) utility. ## Examples The following example demonstrates using the `PlatformID` class to identify the currently executing operating system: - + :::code language="csharp" source="~/snippets/csharp/System/PlatformID/Overview/pid.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/PlatformID/Overview/pid.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/PlatformID/Overview/pid.vb" id="Snippet1"::: diff --git a/xml/System/PlatformNotSupportedException.xml b/xml/System/PlatformNotSupportedException.xml index be92a8ed930..9bd51792542 100644 --- a/xml/System/PlatformNotSupportedException.xml +++ b/xml/System/PlatformNotSupportedException.xml @@ -137,8 +137,8 @@ |Property|Value| |--------------|-----------| -||`null`.| -||The empty string.| +||`null`.| +||The empty string.| ]]> @@ -196,8 +196,8 @@ |Property|Value| |--------------|-----------| -||`null`.| -||The error message string.| +||`null`.| +||The error message string.| ]]>
@@ -317,8 +317,8 @@ |Property|Value| |--------------|-----------| -||The inner exception reference.| -||The error message string.| +||The inner exception reference.| +||The error message string.| ]]>
diff --git a/xml/System/Predicate`1.xml b/xml/System/Predicate`1.xml index bb6ab0f4f44..9d921ce0192 100644 --- a/xml/System/Predicate`1.xml +++ b/xml/System/Predicate`1.xml @@ -76,32 +76,32 @@ if meets the criteria defined within the method represented by this delegate; otherwise, . - and classes to search for elements in the collection. - - Typically, the delegate is represented by a lambda expression. Because locally scoped variables are available to the lambda expression, it is easy to test for a condition that is not precisely known at compile time. This is simulated in the following example, which defines a `HockeyTeam` class that contains information about a National Hockey League team and the year in which it was founded. The example defines an array of integer values that represent years, and randomly assigns one element of the array to `foundedBeforeYear`, which is a variable that is locally scoped to the example's `Main` method. Because locally scoped variables are available to a lambda expression, the lambda expression passed to the method is able to return a `HockeyTeam` object for each team founded on or before that year. - + and classes to search for elements in the collection. + + Typically, the delegate is represented by a lambda expression. Because locally scoped variables are available to the lambda expression, it is easy to test for a condition that is not precisely known at compile time. This is simulated in the following example, which defines a `HockeyTeam` class that contains information about a National Hockey League team and the year in which it was founded. The example defines an array of integer values that represent years, and randomly assigns one element of the array to `foundedBeforeYear`, which is a variable that is locally scoped to the example's `Main` method. Because locally scoped variables are available to a lambda expression, the lambda expression passed to the method is able to return a `HockeyTeam` object for each team founded on or before that year. + :::code language="csharp" source="~/snippets/csharp/System/PredicateT/Overview/predicate1.cs" id="Snippet3"::: :::code language="fsharp" source="~/snippets/fsharp/System/PredicateT/Overview/predicate1.fs" id="Snippet3"::: :::code language="vb" source="~/snippets/visualbasic/System/PredicateT/Overview/predicate1.vb" id="Snippet3"::: - - - -## Examples - The following code example uses a delegate with the method to search an array of structures. The example explicitly defines a delegate named `predicate` and assigns it a method named `FindPoints` that returns `true` if the product of the and fields is greater than 100,000. Note that it is customary to use a lambda expression rather than to explicitly define a delegate of type , as the second example illustrates. - + + + +## Examples + The following code example uses a delegate with the method to search an array of structures. The example explicitly defines a delegate named `predicate` and assigns it a method named `FindPoints` that returns `true` if the product of the and fields is greater than 100,000. Note that it is customary to use a lambda expression rather than to explicitly define a delegate of type , as the second example illustrates. + :::code language="csharp" source="~/snippets/csharp/System/PredicateT/Overview/predicateex2.cs" id="Snippet4"::: :::code language="fsharp" source="~/snippets/fsharp/System/PredicateT/Overview/predicateex2.fs" id="Snippet4"::: :::code language="vb" source="~/snippets/visualbasic/System/PredicateT/Overview/predicateex2.vb" id="Snippet4"::: - - The following example is identical to the previous example, except that it uses a lambda expression to represent the delegate. Each element of the `points` array is passed to the lambda expression until the expression finds an element that meets the search criteria. In this case, the lambda expression returns `true` if the product of the X and Y fields is greater than 100,000. - + + The following example is identical to the previous example, except that it uses a lambda expression to represent the delegate. Each element of the `points` array is passed to the lambda expression until the expression finds an element that meets the search criteria. In this case, the lambda expression returns `true` if the product of the X and Y fields is greater than 100,000. + :::code language="csharp" source="~/snippets/csharp/System/PredicateT/Overview/predicateex1.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/PredicateT/Overview/predicateex1.fs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/System/PredicateT/Overview/predicateex1.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/System/PredicateT/Overview/predicateex1.vb" id="Snippet2"::: + ]]> diff --git a/xml/System/Progress`1.xml b/xml/System/Progress`1.xml index c5fa4f78f76..b49a0990986 100644 --- a/xml/System/Progress`1.xml +++ b/xml/System/Progress`1.xml @@ -79,13 +79,13 @@ Specifies the type of the progress report value. Provides an that invokes callbacks for each reported progress value. - event are invoked through a instance captured when the instance is constructed. If there is no current at the time of construction, the callbacks will be invoked on the . - - For more information and a code example, see the article [Async in 4.5: Enabling Progress and Cancellation in Async APIs](https://devblogs.microsoft.com/dotnet/async-in-4-5-enabling-progress-and-cancellation-in-async-apis/) in the .NET Framework blog. - + event are invoked through a instance captured when the instance is constructed. If there is no current at the time of construction, the callbacks will be invoked on the . + + For more information and a code example, see the article [Async in 4.5: Enabling Progress and Cancellation in Async APIs](https://devblogs.microsoft.com/dotnet/async-in-4-5-enabling-progress-and-cancellation-in-async-apis/) in the .NET Framework blog. + ]]> @@ -292,11 +292,11 @@ Raised for each reported progress value. - captured when the instance was constructed. - + captured when the instance was constructed. + ]]> diff --git a/xml/System/Random.xml b/xml/System/Random.xml index c42d8d8c58b..266ebac38f1 100644 --- a/xml/System/Random.xml +++ b/xml/System/Random.xml @@ -77,7 +77,7 @@ For more information about this API, see Supplemental API remarks for Random. , , and methods to generate sequences of random numbers within different ranges. +The following example creates a single random number generator and calls its , , and methods to generate sequences of random numbers within different ranges. :::code language="csharp" source="~/snippets/csharp/System/Random/Overview/Random2.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Random/fs/Random2.fs" id="Snippet2"::: @@ -155,11 +155,11 @@ The following example generates a random integer that it uses as an index to ret objects that are created in close succession by a call to the parameterless constructor have identical default seed values and, therefore, produce identical sets of random numbers. You can avoid this problem by using a single object to generate all random numbers. You can also work around it by generating your own random seed value and passing it to the constructor. For more information, see the constructor. +In .NET Framework, the default seed value is derived from the system clock, which has finite resolution. As a result, different objects that are created in close succession by a call to the parameterless constructor have identical default seed values and, therefore, produce identical sets of random numbers. You can avoid this problem by using a single object to generate all random numbers. You can also work around it by generating your own random seed value and passing it to the constructor. For more information, see the constructor. In .NET Core, the default seed value is produced by the thread-static, pseudo-random number generator, so the previously described limitation does not apply. Different objects created in close succession produce different sets of random numbers in .NET Core. - Call this constructor if you want your random number generator to generate a random sequence of numbers. To generate a fixed sequence of random numbers that will be the same for different random number generators, call the constructor with a fixed seed value. This constructor overload is frequently used when testing apps that use random numbers. + Call this constructor if you want your random number generator to generate a random sequence of numbers. To generate a fixed sequence of random numbers that will be the same for different random number generators, call the constructor with a fixed seed value. This constructor overload is frequently used when testing apps that use random numbers. Once you've instantiated the random number generator, you call individual methods, such as or , to generate random numbers. @@ -167,7 +167,7 @@ In .NET Core, the default seed value is produced by the thread-static, pseudo-ra ## Examples -The following example uses the parameterless constructor to instantiate three objects and displays a sequence of five random integers for each. If it is run on .NET Framework, because the first two objects are created in close succession, they are instantiated using identical seed values based on the system clock and, therefore, they produce an identical sequence of random numbers. On the other hand, the parameterless constructor of the third object is called after a two-second delay caused by calling the method. Because this produces a different seed value for the third object, it produces a different sequence of random numbers. +The following example uses the parameterless constructor to instantiate three objects and displays a sequence of five random integers for each. If it is run on .NET Framework, because the first two objects are created in close succession, they are instantiated using identical seed values based on the system clock and, therefore, they produce an identical sequence of random numbers. On the other hand, the parameterless constructor of the third object is called after a two-second delay caused by calling the method. Because this produces a different seed value for the third object, it produces a different sequence of random numbers. :::code language="csharp" source="~/snippets/csharp/System/Random/.ctor/ctor1.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Random.Ctor/FS/ctor1.fs" id="Snippet2"::: @@ -228,7 +228,7 @@ The following example uses the parameterless constructor to instantiate three objects causes each instance to produce identical sequences of random numbers. This is often done when testing apps that rely on random number generators. - If your application requires different random number sequences, invoke this constructor repeatedly with different seed values. One way to produce a unique seed value is to make it time-dependent. For example, derive the seed value from the system clock, as the overload does. However, the system clock might not have sufficient resolution to provide different invocations of this constructor with a different seed value. On the .NET Framework, this results in random number generators that generate identical sequences of pseudo-random numbers, as illustrated by the first two objects in the following example. To prevent this, apply an algorithm to differentiate the seed value in each invocation, or call the method to ensure that you provide each constructor with a different seed value. + If your application requires different random number sequences, invoke this constructor repeatedly with different seed values. One way to produce a unique seed value is to make it time-dependent. For example, derive the seed value from the system clock, as the overload does. However, the system clock might not have sufficient resolution to provide different invocations of this constructor with a different seed value. On the .NET Framework, this results in random number generators that generate identical sequences of pseudo-random numbers, as illustrated by the first two objects in the following example. To prevent this, apply an algorithm to differentiate the seed value in each invocation, or call the method to ensure that you provide each constructor with a different seed value. :::code language="csharp" source="~/snippets/csharp/System/Random/.ctor/ctor4.cs" id="Snippet4"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Random.Ctor/FS/ctor4.fs" id="Snippet4"::: @@ -620,16 +620,16 @@ The following example uses the parameterless constructor to instantiate three generates a random number whose value ranges from 0 to less than . To generate a random number whose value ranges from 0 to some other positive number, use the method overload. To generate a random number within a different range, use the method overload. + generates a random number whose value ranges from 0 to less than . To generate a random number whose value ranges from 0 to some other positive number, use the method overload. To generate a random number within a different range, use the method overload. ## Examples - The following example makes repeated calls to the method to generate 10 random numbers. + The following example makes repeated calls to the method to generate 10 random numbers. :::code language="csharp" source="~/snippets/csharp/System/Random/Overview/next3.cs" id="Snippet5"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Random.Next/FS/next3.fs" id="Snippet5"::: :::code language="vb" source="~/snippets/visualbasic/System/Random/Overview/next3.vb" id="Snippet5"::: - The following example derives a class from to generate a sequence of random numbers whose distribution differs from the uniform distribution generated by the method of the base class. It overrides the method to provide the distribution of random numbers, and overrides the method to use series of random numbers. + The following example derives a class from to generate a sequence of random numbers whose distribution differs from the uniform distribution generated by the method of the base class. It overrides the method to provide the distribution of random numbers, and overrides the method to use series of random numbers. :::code language="csharp" source="~/snippets/csharp/System/Random/Next/sample.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/Random/Next/sample.vb" id="Snippet1"::: @@ -695,12 +695,12 @@ The following example uses the parameterless constructor to instantiate three overload returns random integers that range from 0 to `maxValue` - 1. However, if `maxValue` is 0, the method returns 0. + The overload returns random integers that range from 0 to `maxValue` - 1. However, if `maxValue` is 0, the method returns 0. ## Examples - The following example generates random integers with various overloads of the method. + The following example generates random integers with various overloads of the method. :::code language="csharp" source="~/snippets/csharp/System/Random/Overview/next.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Random.Next/FS/next.fs" id="Snippet1"::: @@ -774,14 +774,14 @@ The following example uses the parameterless constructor to instantiate three overload returns random integers that range from `minValue` to `maxValue` - 1. However, if `maxValue` equals `minValue`, the method returns `minValue`. + The overload returns random integers that range from `minValue` to `maxValue` - 1. However, if `maxValue` equals `minValue`, the method returns `minValue`. - Unlike the other overloads of the method, which return only non-negative values, this method can return a negative random integer. + Unlike the other overloads of the method, which return only non-negative values, this method can return a negative random integer. ## Examples - The following example uses the method to generate random integers with three distinct ranges. Note that the exact output from the example depends on the system-supplied seed value passed to the class constructor. + The following example uses the method to generate random integers with three distinct ranges. Note that the exact output from the example depends on the system-supplied seed value passed to the class constructor. :::code language="csharp" source="~/snippets/csharp/System/Random/Overview/Next2.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Random.Next/FS/Next2.fs" id="Snippet2"::: @@ -857,13 +857,13 @@ The following example uses the parameterless constructor to instantiate three . - For example, to generate a cryptographically secured random number suitable for creating a random password, use a method such as . + For example, to generate a cryptographically secured random number suitable for creating a random password, use a method such as . ## Examples - The following example demonstrates how to use the method to fill an array of bytes with random byte values. + The following example demonstrates how to use the method to fill an array of bytes with random byte values. :::code language="csharp" source="~/snippets/csharp/System/Random/NextBytes/source.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/Random/NextBytes/source.vb" id="Snippet1"::: @@ -988,19 +988,19 @@ Each element of the span of bytes is set to a random number greater than or equa To retrieve random floating-point values within a range other than 0.0 and 1.0, see the "Retrieve floating-point values in a specified range" section of the class topic. - This method is the public version of the protected method, . + This method is the public version of the protected method, . ## Examples - The following example uses the method to generate sequences of random doubles. + The following example uses the method to generate sequences of random doubles. :::code language="csharp" source="~/snippets/csharp/System/Random/.ctor/ctor.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Random.Ctor/FS/ctor.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/Random/.ctor/ctor.vb" id="Snippet1"::: - The following example calls the method to generate 100 random numbers and displays their frequency distribution. + The following example calls the method to generate 100 random numbers and displays their frequency distribution. :::code language="csharp" source="~/snippets/csharp/System/Random/NextDouble/nextdouble1.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.random.nextdouble/fs/nextdouble1.fs" id="Snippet2"::: @@ -1222,15 +1222,15 @@ Each element of the span of bytes is set to a random number greater than or equa class and override the method. + To produce a different random distribution or a different random number generator principle, derive a class from the class and override the method. > [!IMPORTANT] -> The method is `protected`, which means that it is accessible only within the class and its derived classes. To generate a random number between 0 and 1 from a instance, call the method. +> The method is `protected`, which means that it is accessible only within the class and its derived classes. To generate a random number between 0 and 1 from a instance, call the method. ## Examples - The following example derives a class from and overrides the method to generate a distribution of random numbers. This distribution is different than the uniform distribution generated by the method of the base class. + The following example derives a class from and overrides the method to generate a distribution of random numbers. This distribution is different than the uniform distribution generated by the method of the base class. :::code language="csharp" source="~/snippets/csharp/System/Random/Next/sample.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.Random.Sample/FS/sample.fs" id="Snippet1"::: diff --git a/xml/System/RankException.xml b/xml/System/RankException.xml index 1a963714deb..a74e87c874d 100644 --- a/xml/System/RankException.xml +++ b/xml/System/RankException.xml @@ -77,7 +77,7 @@ ## Remarks uses the HRESULT COR_E_RANK, that has the value 0x80131517. - For a list of initial property values for an instance of , see the constructors. + For a list of initial property values for an instance of , see the constructors. ]]> @@ -147,8 +147,8 @@ |Property|Value| |--------------|-----------| -||A null reference (`Nothing` in Visual Basic).| -||The localized error message string.| +||A null reference (`Nothing` in Visual Basic).| +||The localized error message string.| ]]> @@ -208,8 +208,8 @@ |Property|Value| |--------------|-----------| -||A null reference (`Nothing` in Visual Basic).| -||The error message string.| +||A null reference (`Nothing` in Visual Basic).| +||The error message string.| ]]> @@ -337,8 +337,8 @@ |Property|Value| |--------------|-----------| -||The inner exception reference.| -||The error message string.| +||The inner exception reference.| +||The error message string.| ]]>
diff --git a/xml/System/ReadOnlyMemory`1.xml b/xml/System/ReadOnlyMemory`1.xml index 6876b25f3e6..12e1c1bb647 100644 --- a/xml/System/ReadOnlyMemory`1.xml +++ b/xml/System/ReadOnlyMemory`1.xml @@ -436,7 +436,7 @@ Returns `default` when `array` is `null`. [!IMPORTANT] -Two objects are equal if the memory regions point to the same array and have the same length. The method does not check to see if the contents are equal. +Two objects are equal if the memory regions point to the same array and have the same length. The method does not check to see if the contents are equal. ]]>
diff --git a/xml/System/ReadOnlySpan`1+Enumerator.xml b/xml/System/ReadOnlySpan`1+Enumerator.xml index b411313b4ec..68aa6bd492e 100644 --- a/xml/System/ReadOnlySpan`1+Enumerator.xml +++ b/xml/System/ReadOnlySpan`1+Enumerator.xml @@ -97,13 +97,13 @@ ## Remarks -The C# [foreach](/dotnet/csharp/language-reference/keywords/foreach-in) of the C# language and the [For Each...Next](/dotnet/visual-basic/language-reference/statements/for-each-next-statement) construct in Visual Basic hides the complexity of enumerators. Instead of directly manipulating the enumerator, using `foreach` or `For Each...Next` is recommended. +The C# [foreach](/dotnet/csharp/language-reference/keywords/foreach-in) of the C# language and the [For Each...Next](/dotnet/visual-basic/language-reference/statements/for-each-next-statement) construct in Visual Basic hides the complexity of enumerators. Instead of directly manipulating the enumerator, using `foreach` or `For Each...Next` is recommended. -Initially, the enumerator is positioned before the first element in the . At this position, is undefined. You must call to advance the enumerator to the first item in the before reading the value of . +Initially, the enumerator is positioned before the first element in the . At this position, is undefined. You must call to advance the enumerator to the first item in the before reading the value of . - returns the same value until is called. sets to the next item in the . + returns the same value until is called. sets to the next item in the . -If passes the end of the , returns `false`. When the enumerator is at this state, subsequent calls to also return `false` and is undefined. You cannot set to the first item in the again; you must create a new enumerator instance instead. +If passes the end of the , returns `false`. When the enumerator is at this state, subsequent calls to also return `false` and is undefined. You cannot set to the first item in the again; you must create a new enumerator instance instead. Though the is allocated on the stack, the underlying data on which the points to, may not be. Therefore, enumerating through a is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you must implement your own synchronization. @@ -165,11 +165,11 @@ Unlike some other enumerator structures in .NET, the must be called to advance the enumerator to the first element of the span before reading the value of `Current`. -- The last call to returned `false`, which indicates the end of the span. +- The last call to returned `false`, which indicates the end of the span. `Current` returns the same value until is called. sets `Current` to the next item in the span. @@ -227,7 +227,7 @@ Unlike some other enumerator structures in .NET, the `. Returns an enumerator for this . An enumerator for this read-only span. - method directly, you can use the C# `foreach` statement and the Visual Basic `For Each`...`Next` construct to enumerate a .]]> + method directly, you can use the C# `foreach` statement and the Visual Basic `For Each`...`Next` construct to enumerate a .]]> @@ -1080,7 +1080,7 @@ The following example demonstrates creating an integer array, pinning it, and wr if the two instances are not equal; otherwise, . - instances are not equal if they have different lengths or if the corresponding elements of `left` and `right` point to different memory locations.]]> + instances are not equal if they have different lengths or if the corresponding elements of `left` and `right` point to different memory locations.]]> @@ -1229,7 +1229,7 @@ The following example demonstrates creating an integer array, pinning it, and wr Copies the contents of this read-only span into a new array. An array containing the data in the current span. - are not available, but APIs that work with arrays are.]]> + are not available, but APIs that work with arrays are.]]> diff --git a/xml/System/ResolveEventArgs.xml b/xml/System/ResolveEventArgs.xml index 968e7d6004b..c632d0ce47a 100644 --- a/xml/System/ResolveEventArgs.xml +++ b/xml/System/ResolveEventArgs.xml @@ -228,7 +228,7 @@ event, is the assembly name before policy is applied. + For the event, is the assembly name before policy is applied. ]]> @@ -284,15 +284,15 @@ ## Remarks The assembly that is returned by this property is an assembly that was unable to resolve the item specified by the property, because the item did not exist in that assembly, in any of its loaded dependencies, or in any dependencies the loader could find through probing. - For example, suppose the current assembly uses the method to load assembly A from a directory outside the probing path, in order to use class CA. Suppose further that class CA uses class CB, in assembly B, and that assembly A has a compile-time reference to assembly B, also located outside the probing path. When the current assembly attempts to instantiate CA, the loader attempts to resolve the reference to assembly B. However, because assembly A was loaded by using the method, the loader cannot resolve the dependency. If there is a handler for the event, the event is raised, and the property of the resulting object contains assembly A, because assembly A is the assembly that is missing a dependency. + For example, suppose the current assembly uses the method to load assembly A from a directory outside the probing path, in order to use class CA. Suppose further that class CA uses class CB, in assembly B, and that assembly A has a compile-time reference to assembly B, also located outside the probing path. When the current assembly attempts to instantiate CA, the loader attempts to resolve the reference to assembly B. However, because assembly A was loaded by using the method, the loader cannot resolve the dependency. If there is a handler for the event, the event is raised, and the property of the resulting object contains assembly A, because assembly A is the assembly that is missing a dependency. The semantics of the property vary, depending on how the requesting assembly was loaded: -- Load context: The value of the property might be `null`. The load context is load-order independent, and the identity of the requesting assembly is not necessarily meaningful. A non-null example occurs when the method is called and the specified type is not known to the requesting assembly or any of its dependencies. +- Load context: The value of the property might be `null`. The load context is load-order independent, and the identity of the requesting assembly is not necessarily meaningful. A non-null example occurs when the method is called and the specified type is not known to the requesting assembly or any of its dependencies. - Load-from context: The property can be used as a probing hint, but the event handler should not get more than one request for a given assembly name. -- No context (that is, the requesting assembly was loaded by using the method, or as a byte stream, or in mixed mode): The handler can use the property to load different implementations of the same assembly based on the identity of the requesting assembly. +- No context (that is, the requesting assembly was loaded by using the method, or as a byte stream, or in mixed mode): The handler can use the property to load different implementations of the same assembly based on the identity of the requesting assembly. ]]>
diff --git a/xml/System/RuntimeFieldHandle.xml b/xml/System/RuntimeFieldHandle.xml index 001c97d1396..c9d29838180 100644 --- a/xml/System/RuntimeFieldHandle.xml +++ b/xml/System/RuntimeFieldHandle.xml @@ -381,7 +381,7 @@ ## Remarks The `context` parameter is reserved; it does not currently participate in this operation. - For more information, see the method. + For more information, see the method. ]]>
@@ -440,7 +440,7 @@ if is equal to ; otherwise, . - .]]> + .]]> @@ -494,7 +494,7 @@ if is not equal to ; otherwise, . - .]]> + .]]> diff --git a/xml/System/RuntimeMethodHandle.xml b/xml/System/RuntimeMethodHandle.xml index a73a80aeb0e..679a6e9a382 100644 --- a/xml/System/RuntimeMethodHandle.xml +++ b/xml/System/RuntimeMethodHandle.xml @@ -309,7 +309,7 @@ If the method has the attribute, then the returned value is an unmanaged function pointer with the same calling convention as specified in the attribute. If the method this handle represents is static, then the returned value can be cast to a C# managed function pointer type with the same signature. For instance method handles, the value is not easily usable from user code and is meant exclusively for usage within the runtime. - For methods that don't have the , use to get a function pointer that can be passed to native code. + For methods that don't have the , use to get a function pointer that can be passed to native code. ]]>
The caller does not have the necessary permission to perform this operation. @@ -434,7 +434,7 @@ ## Remarks The `context` parameter is reserved; it does not currently participate in this operation. - For more information, see the method. + For more information, see the method. ]]>
@@ -494,7 +494,7 @@ if the value of is equal to the value of ; otherwise, . - .]]> + .]]> @@ -548,7 +548,7 @@ if the value of is unequal to the value of ; otherwise, . - .]]> + .]]> diff --git a/xml/System/RuntimeTypeHandle.xml b/xml/System/RuntimeTypeHandle.xml index b301b8a4932..d12fae64ff0 100644 --- a/xml/System/RuntimeTypeHandle.xml +++ b/xml/System/RuntimeTypeHandle.xml @@ -426,7 +426,7 @@ ## Remarks The `context` parameter is reserved; it does not currently participate in this operation. - For more information about the serialization operation performed by this method, see the method. + For more information about the serialization operation performed by this method, see the method. ]]>
@@ -503,7 +503,7 @@ causes an ambiguous overload resolution error when compiled. Use the method instead. + Using this operator to compare two variables of type causes an ambiguous overload resolution error when compiled. Use the method instead. The equivalent method for this operator is .]]> @@ -563,7 +563,7 @@ causes an ambiguous overload resolution error when compiled. Use the method instead. + Using this operator to compare two variables of type causes an ambiguous overload resolution error when compiled. Use the method instead. The equivalent method for this operator is >.]]> @@ -636,7 +636,7 @@ causes an ambiguous overload resolution error when compiled. Use the method instead. + Using this operator to compare two variables of type causes an ambiguous overload resolution error when compiled. Use the method instead. The equivalent method for this operator is .]]> @@ -696,7 +696,7 @@ causes an ambiguous overload resolution error when compiled. Use the method instead. + Using this operator to compare two variables of type causes an ambiguous overload resolution error when compiled. Use the method instead. The equivalent method for this operator is .]]> diff --git a/xml/System/SByte.xml b/xml/System/SByte.xml index c4912948b50..823738a5780 100644 --- a/xml/System/SByte.xml +++ b/xml/System/SByte.xml @@ -528,18 +528,18 @@ interface and performs slightly better than the method because it does not have to convert the `value` parameter to an object. + This method implements the interface and performs slightly better than the method because it does not have to convert the `value` parameter to an object. - Depending on your programming language, it might be possible to code a method where the parameter type has fewer bits (is narrower) than the instance type. This is possible because some programming languages perform an implicit widening conversion that represents the parameter as a type with as many bits as the instance. + Depending on your programming language, it might be possible to code a method where the parameter type has fewer bits (is narrower) than the instance type. This is possible because some programming languages perform an implicit widening conversion that represents the parameter as a type with as many bits as the instance. - For example, suppose the instance type is and the parameter type is . The Microsoft C# compiler generates instructions to represent the value of the parameter as an object, then generates a method that compares the values of the instance and the parameter representation. + For example, suppose the instance type is and the parameter type is . The Microsoft C# compiler generates instructions to represent the value of the parameter as an object, then generates a method that compares the values of the instance and the parameter representation. Consult your programming language's documentation to determine if its compiler performs implicit widening conversions on numeric types. ## Examples - The following example demonstrates generic and nongeneric versions of the method for several value and reference types. + The following example demonstrates generic and nongeneric versions of the method for several value and reference types. :::code language="csharp" source="~/snippets/csharp/System/Boolean/CompareTo/cat.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Boolean/CompareTo/cat.fs" id="Snippet1"::: @@ -927,7 +927,7 @@ interface, and performs slightly better than because it does not have to convert the `obj` parameter to an object. + This method implements the interface, and performs slightly better than because it does not have to convert the `obj` parameter to an object. ]]> @@ -1070,7 +1070,7 @@ This method correctly handles floating-point values and so `2.0` will return `true` while `2.2` will return `false`. -A return value of `false` does not imply that will return `true`. A number with a fractional portion, for example, `3.3`, is not even or odd. +A return value of `false` does not imply that will return `true`. A number with a fractional portion, for example, `3.3`, is not even or odd. ]]> @@ -1118,7 +1118,7 @@ A return value of `false` does not imply that will return `true`. A complex number, `a + bi` for non-zero `b`, is not positive or negative +A return value of `false` does not imply that will return `true`. A complex number, `a + bi` for non-zero `b`, is not positive or negative ]]>
@@ -1168,7 +1168,7 @@ A return value of `false` does not imply that will return `true`. A number with a fractional portion, for example, `3.3`, is not even or odd. +A return value of `false` does not imply that will return `true`. A number with a fractional portion, for example, `3.3`, is not even or odd. ]]>
@@ -1216,7 +1216,7 @@ A return value of `false` does not imply that will return `true`. A complex number, `a + bi` for non-zero `b`, is not positive or negative +A return value of `false` does not imply that will return `true`. A complex number, `a + bi` for non-zero `b`, is not positive or negative ]]>
@@ -1384,7 +1384,7 @@ A return value of `false` does not imply that this method matches the IEEE 754:2019 `maximum` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. +For this method matches the IEEE 754:2019 `maximum` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. ]]>
@@ -1434,7 +1434,7 @@ For this method matches the IEEE 754:2 ## Remarks -For this method matches the IEEE 754:2019 `maximumMagnitude` function. This requires NaN inputs to not be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. +For this method matches the IEEE 754:2019 `maximumMagnitude` function. This requires NaN inputs to not be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. ]]>
@@ -1547,7 +1547,7 @@ For this method matches the IEE ## Remarks -For this method matches the IEEE 754:2019 `minimum` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. +For this method matches the IEEE 754:2019 `minimum` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. ]]>
@@ -1597,7 +1597,7 @@ For this method matches the IEEE 754:2 ## Remarks -For this method matches the IEEE 754:2019 `minimumMagnitude` function. This requires NaN inputs to not be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. +For this method matches the IEEE 754:2019 `minimumMagnitude` function. This requires NaN inputs to not be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. ]]>
@@ -1750,14 +1750,14 @@ For this method matches the IEE |*sign*|An optional sign.| |*digits*|A sequence of digits ranging from 0 to 9.| - The `s` parameter is interpreted using the style. In addition to the byte value's decimal digits, only leading and trailing spaces with a leading positive or negative sign are allowed. To explicitly define the style elements that can be present in `s`, use either the or the method. + The `s` parameter is interpreted using the style. In addition to the byte value's decimal digits, only leading and trailing spaces with a leading positive or negative sign are allowed. To explicitly define the style elements that can be present in `s`, use either the or the method. - The `s` parameter is parsed by using the formatting information in a that is initialized for the current system culture. For more information, see . To parse a string by using the formatting information of some other culture, use the method. + The `s` parameter is parsed by using the formatting information in a that is initialized for the current system culture. For more information, see . To parse a string by using the formatting information of some other culture, use the method. ## Examples - The following example demonstrates how to convert a string value into a signed byte value using the method. The resulting signed byte value is then displayed to the console. + The following example demonstrates how to convert a string value into a signed byte value using the method. The resulting signed byte value is then displayed to the console. :::code language="csharp" source="~/snippets/csharp/System/SByte/Parse/parseex1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/SByte/Parse/parseex1.fs" id="Snippet1"::: @@ -1977,14 +1977,14 @@ For this method matches the IEE > [!NOTE] > If the `s` parameter is the string representation of a hexadecimal number, it cannot be preceded by any decoration (such as `0x` or `&h`) that differentiates it as a hexadecimal number. This causes the parse operation to throw an exception. - If `s` represents a hexadecimal number, the method interprets the high-order bit of the byte as a sign bit. + If `s` represents a hexadecimal number, the method interprets the high-order bit of the byte as a sign bit. - The `s` parameter is parsed by using the formatting information in a object that is initialized for the current system culture. To use the formatting information of some other culture, call the overload. + The `s` parameter is parsed by using the formatting information in a object that is initialized for the current system culture. To use the formatting information of some other culture, call the overload. ## Examples - The following example parses string representations of values with the method. The current culture for the example is en-US. + The following example parses string representations of values with the method. The current culture for the example is en-US. :::code language="csharp" source="~/snippets/csharp/System/SByte/Parse/parseex2.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/SByte/Parse/parseex2.fs" id="Snippet2"::: @@ -2098,15 +2098,15 @@ For this method matches the IEE |*sign*|An optional sign.| |*digits*|A sequence of digits ranging from 0 to 9.| - The `s` parameter is interpreted using the style. In addition to the byte value's decimal digits, only leading and trailing spaces with a leading sign are allowed. To explicitly define the style elements with the culture-specific formatting information that can be present in `s`, use the method. + The `s` parameter is interpreted using the style. In addition to the byte value's decimal digits, only leading and trailing spaces with a leading sign are allowed. To explicitly define the style elements with the culture-specific formatting information that can be present in `s`, use the method. - The `provider` parameter is an implementation whose method returns a object that provides culture-specific information about the format of `s`. There are three ways to use the `provider` parameter to supply custom formatting information to the parse operation: + The `provider` parameter is an implementation whose method returns a object that provides culture-specific information about the format of `s`. There are three ways to use the `provider` parameter to supply custom formatting information to the parse operation: -- You can pass the actual object that provides formatting information. (Its implementation of simply returns itself.) +- You can pass the actual object that provides formatting information. (Its implementation of simply returns itself.) - You can pass a object that specifies the culture whose formatting is to be used. Its property provides formatting information. -- You can pass a custom implementation. Its method must instantiate and return the object that provides formatting information. +- You can pass a custom implementation. Its method must instantiate and return the object that provides formatting information. If `provider` is `null`, the object for the current culture is used. @@ -2361,22 +2361,22 @@ For this method matches the IEE > [!NOTE] > If the `s` parameter is the string representation of a hexadecimal number, it cannot be preceded by any decoration (such as `0x` or `&h`) that differentiates it as a hexadecimal number. This causes the parse operation to throw an exception. - If `s` represents a hexadecimal number, the method interprets the high-order bit of the byte as a sign bit. + If `s` represents a hexadecimal number, the method interprets the high-order bit of the byte as a sign bit. - The `provider` parameter is an implementation whose method returns a object that provides culture-specific information about the format of `s`. There are three ways to use the `provider` parameter to supply custom formatting information to the parse operation: + The `provider` parameter is an implementation whose method returns a object that provides culture-specific information about the format of `s`. There are three ways to use the `provider` parameter to supply custom formatting information to the parse operation: -- You can pass the actual object that provides formatting information. (Its implementation of simply returns itself.) +- You can pass the actual object that provides formatting information. (Its implementation of simply returns itself.) - You can pass a object that specifies the culture whose formatting is to be used. Its property provides formatting information. -- You can pass a custom implementation. Its method must instantiate and return the object that provides formatting information. +- You can pass a custom implementation. Its method must instantiate and return the object that provides formatting information. If `provider` is `null`, the object for the current culture is used. ## Examples - The following example illustrates the use of the method to convert various string representations of numbers to signed integer values. + The following example illustrates the use of the method to convert various string representations of numbers to signed integer values. :::code language="csharp" source="~/snippets/csharp/System/SByte/Parse/parse_1.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/SByte/Parse/parse_1.fs" id="Snippet2"::: @@ -2717,7 +2717,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -2775,7 +2775,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -2833,7 +2833,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -2943,7 +2943,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -3001,7 +3001,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -3059,7 +3059,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -3117,7 +3117,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -3175,7 +3175,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -3291,7 +3291,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -3351,7 +3351,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the `static` (`Shared` in Visual Basic) method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the `static` (`Shared` in Visual Basic) method. ]]> @@ -3409,7 +3409,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -3467,7 +3467,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -3525,7 +3525,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -6261,17 +6261,17 @@ This member is an explicit interface member implementation. It can be used only method formats an value in the default ("G", or general) format of the current culture. If you want to specify a different format or culture, use the other overloads of the method, as follows: + The method formats an value in the default ("G", or general) format of the current culture. If you want to specify a different format or culture, use the other overloads of the method, as follows: |To use format|For culture|Use the overload| |-------------------|-----------------|----------------------| -|Default ("G") format|A specific culture|| -|A specific format|Default (current) culture|| -|A specific format|A specific culture|| +|Default ("G") format|A specific culture|| +|A specific format|Default (current) culture|| +|A specific format|A specific culture|| The return value is formatted using the general numeric format specifier ("G") The string representation of the value includes a negative sign if its value is negative, and a sequence of digits ranging from 0 to 9 without leading zeros. The negative sign is defined by the object for the current culture. - To define the formatting of the signed byte value's string representation, call the method. + To define the formatting of the signed byte value's string representation, call the method. @@ -6359,15 +6359,15 @@ This member is an explicit interface member implementation. It can be used only method formats an value in the default ("G", or general) format of a specified culture. If you want to specify a different format or the current culture, use the other overloads of the method, as follows: + The method formats an value in the default ("G", or general) format of a specified culture. If you want to specify a different format or the current culture, use the other overloads of the method, as follows: |To use format|For culture|Use the overload| |-------------------|-----------------|----------------------| |Default ("G") format|Default (current) culture|| -|A specific format|Default (current) culture|| -|A specific format|A specific culture|| +|A specific format|Default (current) culture|| +|A specific format|A specific culture|| - The `provider` parameter is an implementation. Its method returns a object that provides culture-specific information about the format of the string returned by this method. If `provider` is `null`, the value is formatted using the object of the current culture. The only property of the object that controls the string representation of the value using the general format specifier is , which defines the character that represents the negative sign. + The `provider` parameter is an implementation. Its method returns a object that provides culture-specific information about the format of the string returned by this method. If `provider` is `null`, the value is formatted using the object of the current culture. The only property of the object that controls the string representation of the value using the general format specifier is , which defines the character that represents the negative sign. The `provider` parameter can be one of the following: @@ -6375,7 +6375,7 @@ This member is an explicit interface member implementation. It can be used only - The object that supplies formatting information. -- A custom object that implements . Its method returns the object that supplies formatting information. +- A custom object that implements . Its method returns the object that supplies formatting information. @@ -6456,13 +6456,13 @@ This member is an explicit interface member implementation. It can be used only method formats an value in a specified format by using the conventions of the current culture. If you want to use the default ("G", or general) format or specify a different culture, use the other overloads of the method, as follows: + The method formats an value in a specified format by using the conventions of the current culture. If you want to use the default ("G", or general) format or specify a different culture, use the other overloads of the method, as follows: |To use format|For culture|Use the overload| |-------------------|-----------------|----------------------| |Default ("G") format|Default (current) culture|| -|Default ("G") format|A specific culture|| -|A specific format|A specific culture|| +|Default ("G") format|A specific culture|| +|A specific format|A specific culture|| The `format` parameter can be any valid standard numeric format specifier, or any combination of custom numeric format specifiers. If `format` is equal to or is `null`, the return value of the current object is formatted with the general format specifier ("G"). If `format` is any other value, the method throws a . @@ -6472,7 +6472,7 @@ This member is an explicit interface member implementation. It can be used only - For more information about support for formatting in .NET, see [Formatting Types](/dotnet/standard/base-types/formatting-types). - The format of the returned string is determined by the object for the current culture. Depending on the `format` parameter, this object controls symbols such as the negative sign, the group separator, and the decimal point symbol in the output string. To provide formatting information for cultures other than the current culture, call the overload. + The format of the returned string is determined by the object for the current culture. Depending on the `format` parameter, this object controls symbols such as the negative sign, the group separator, and the decimal point symbol in the output string. To provide formatting information for cultures other than the current culture, call the overload. @@ -6557,13 +6557,13 @@ This member is an explicit interface member implementation. It can be used only method formats an value in a specified format of a specified culture. If you want to use default format or culture settings, use the other overloads of the method, as follows: + The method formats an value in a specified format of a specified culture. If you want to use default format or culture settings, use the other overloads of the method, as follows: |To use format|For culture|Use the overload| |-------------------|-----------------|----------------------| |Default ("G") format|Default (current) culture|| -|Default ("G") format|A specific culture|| -|A specific format|Default (current) culture|| +|Default ("G") format|A specific culture|| +|A specific format|Default (current) culture|| The `format` parameter can be any valid standard numeric format specifier, or any combination of custom numeric format specifiers. If `format` is equal to or is `null`, the return value of the current object is formatted with the general format specifier ("G"). If `format` is any other value, the method throws a . @@ -6573,13 +6573,13 @@ This member is an explicit interface member implementation. It can be used only - For more information about support for formatting in .NET, see [Formatting Types](/dotnet/standard/base-types/formatting-types). - The `provider` parameter is an implementation. Its method returns a object that provides culture-specific information about the format of the string returned by this method. When the method is invoked, it calls the `provider` parameter's method and passes it a object that represents the type. The method then returns the object that provides information for formatting the `value` parameter, such as the negative sign symbol, the group separator symbol, or the decimal point symbol. There are three ways to use the `provider` parameter to supply formatting information to the method: + The `provider` parameter is an implementation. Its method returns a object that provides culture-specific information about the format of the string returned by this method. When the method is invoked, it calls the `provider` parameter's method and passes it a object that represents the type. The method then returns the object that provides information for formatting the `value` parameter, such as the negative sign symbol, the group separator symbol, or the decimal point symbol. There are three ways to use the `provider` parameter to supply formatting information to the method: -- You can pass a object that represents the culture that supplies formatting information. Its method returns the object that provides numeric formatting information for that culture. +- You can pass a object that represents the culture that supplies formatting information. Its method returns the object that provides numeric formatting information for that culture. -- You can pass the actual object that provides numeric formatting information. (Its implementation of just returns itself.) +- You can pass the actual object that provides numeric formatting information. (Its implementation of just returns itself.) -- You can pass a custom object that implements . Its method instantiates and returns the object that provides formatting information. +- You can pass a custom object that implements . Its method instantiates and returns the object that provides formatting information. If `provider` is `null`, the formatting of the returned string is based on the object of the current culture. @@ -6937,7 +6937,7 @@ This member is an explicit interface member implementation. It can be used only method is like the method, except that it does not throw an exception if the conversion fails. This method eliminates the need to use exception handling to test for a if `value` is invalid and cannot be successfully parsed. + The method is like the method, except that it does not throw an exception if the conversion fails. This method eliminates the need to use exception handling to test for a if `value` is invalid and cannot be successfully parsed. The `s` parameter should be the string representation of a decimal number in the following form: @@ -6948,22 +6948,22 @@ This member is an explicit interface member implementation. It can be used only |Element|Description| |-------------|-----------------| |*ws*|Optional white space.| -|*sign*|An optional sign. Valid sign characters are determined by the and properties of the current culture.| +|*sign*|An optional sign. Valid sign characters are determined by the and properties of the current culture.| |*digits*|A sequence of decimal digits ranging from 0 to 9.| > [!NOTE] > The string specified by the `value` parameter cannot contain any group separators or decimal separator, and it cannot have a decimal portion. - The `s` parameter is interpreted by using the style. In addition to the decimal digits, only leading and trailing spaces with a leading sign are allowed. To explicitly define the style elements with the culture-specific formatting information that can be present in `value`, call the method. + The `s` parameter is interpreted by using the style. In addition to the decimal digits, only leading and trailing spaces with a leading sign are allowed. To explicitly define the style elements with the culture-specific formatting information that can be present in `value`, call the method. - The `s` parameter is parsed by using the formatting information in a object for the current culture. For more information, see . + The `s` parameter is parsed by using the formatting information in a object for the current culture. For more information, see . - This overload interprets all digits in the `value` parameter as decimal digits. To parse the string representation of a hexadecimal number, call the overload instead. + This overload interprets all digits in the `value` parameter as decimal digits. To parse the string representation of a hexadecimal number, call the overload instead. ## Examples - The following example tries to convert the strings in an array to values by calling the method. + The following example tries to convert the strings in an array to values by calling the method. :::code language="csharp" source="~/snippets/csharp/System/SByte/TryParse/TryParse1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/SByte/TryParse/TryParse1.fs" id="Snippet1"::: @@ -7301,7 +7301,7 @@ This member is an explicit interface member implementation. It can be used only method is like the method, except that it does not throw an exception if the conversion fails. This method eliminates the need to use exception handling to test for a if `value` is invalid and cannot be parsed successfully. + The method is like the method, except that it does not throw an exception if the conversion fails. This method eliminates the need to use exception handling to test for a if `value` is invalid and cannot be parsed successfully. The `style` parameter defines the style elements (such as white space or a positive or negative sign) that are allowed in the `value` parameter for the parse operation to succeed. It must be a combination of bit flags from the enumeration. Depending on the value of `style`, the `value` parameter may include the following elements: @@ -7316,7 +7316,7 @@ This member is an explicit interface member implementation. It can be used only |Element|Description| |-------------|-----------------| |*ws*|Optional white space. White space can appear at the start of `value` if `style` includes the flag, or at the end of `value` if `style` includes the flag.| -|*$*|A culture-specific currency symbol. Its position in the string is defined by the property of the object returned by the method of the `provider` parameter. The currency symbol can appear in `value` if `style` includes the flag.| +|*$*|A culture-specific currency symbol. Its position in the string is defined by the property of the object returned by the method of the `provider` parameter. The currency symbol can appear in `value` if `style` includes the flag.| |*sign*|An optional sign. The sign can appear at the start of `value` if `style` includes the flag, and it can appear at the end of `value` if `style` includes the flag. Parentheses can be used in `value` to indicate a negative value if `style` includes the flag.| |*digits*|A sequence of digits from 0 through 9.| |*,*|A culture-specific group separator. The group separator of the culture specified by `provider` can appear in `value` if `style` includes the flag.| @@ -7353,20 +7353,20 @@ This member is an explicit interface member implementation. It can be used only > [!NOTE] > If `value` is the string representation of a hexadecimal number, it cannot be preceded by any decoration (such as `0x` or `&h`) that differentiates it as a hexadecimal number. This causes the conversion to fail. - The `provider` parameter is an implementation. Its method returns a object that provides culture-specific information about the format of `value`. The `provider` parameter can be any one of the following: + The `provider` parameter is an implementation. Its method returns a object that provides culture-specific information about the format of `value`. The `provider` parameter can be any one of the following: -- A object that represents the culture that supplies formatting information. Its method returns the object that provides numeric formatting information for that culture. +- A object that represents the culture that supplies formatting information. Its method returns the object that provides numeric formatting information for that culture. -- A object that provides numeric formatting information. (Its implementation of just returns itself.) +- A object that provides numeric formatting information. (Its implementation of just returns itself.) -- A custom object that implements . Its method instantiates and returns the object that provides formatting information. +- A custom object that implements . Its method instantiates and returns the object that provides formatting information. If `provider` is `null`, the object for the current culture is used. ## Examples - The following example calls the method with a number of different string and values. + The following example calls the method with a number of different string and values. :::code language="csharp" source="~/snippets/csharp/System/SByte/TryParse/tryparse2.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/SByte/TryParse/tryparse2.fs" id="Snippet2"::: diff --git a/xml/System/STAThreadAttribute.xml b/xml/System/STAThreadAttribute.xml index 6b422d0c00f..92d26030d4b 100644 --- a/xml/System/STAThreadAttribute.xml +++ b/xml/System/STAThreadAttribute.xml @@ -64,7 +64,7 @@ or method before starting the thread. + Apply this attribute to the entry point method (the `Main()` method in C# and Visual Basic). It has no effect on other methods. To set the apartment state of threads you start in your code, use the or method before starting the thread. > [!NOTE] > For an overview of COM threading models, see [Understanding and Using COM Threading Models](https://learn.microsoft.com/previous-versions/ms809971(v=msdn.10)). @@ -79,7 +79,7 @@ |C++|Multithreaded apartment| |Visual Basic|Single-threaded apartment| - To change these defaults, you use the attribute to set the threading model for the application, or call the or method before starting the thread to set the threading model for a particular thread. In C++, you can also use the [/CLRTHREADATTRIBUTE](/cpp/build/reference/clrthreadattribute-set-clr-thread-attribute) linker option to specify the apartment model. + To change these defaults, you use the attribute to set the threading model for the application, or call the or method before starting the thread to set the threading model for a particular thread. In C++, you can also use the [/CLRTHREADATTRIBUTE](/cpp/build/reference/clrthreadattribute-set-clr-thread-attribute) linker option to specify the apartment model. ASP.NET applications should set the `ASPCompat` attribute of the [@ Page](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/ydy4x04a(v=vs.100)) directive to `true` to force the page to be serviced by the STA thread pool. diff --git a/xml/System/Single.xml b/xml/System/Single.xml index 9fc8df6f998..99a12afec08 100644 --- a/xml/System/Single.xml +++ b/xml/System/Single.xml @@ -1166,7 +1166,7 @@ This computes `arctan(x) / π` in the interval `[-0.5, +0.5]`. For more information about this API, see Supplemental API remarks for Single.CompareTo. method. +The following code example demonstrates the method. :::code language="csharp" source="~/snippets/csharp/System/Single/CompareTo/singlesample.cs" id="Snippet16"::: :::code language="fsharp" source="~/snippets/fsharp/System/Single/CompareTo/singlesample.fs" id="Snippet16"::: @@ -1248,7 +1248,7 @@ The following code example demonstrates the me For more information about this API, see Supplemental API remarks for Single.CompareTo. method for several value and reference types. +The following code example demonstrates generic and nongeneric versions of the method for several value and reference types. :::code language="csharp" source="~/snippets/csharp/System/Boolean/CompareTo/cat.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Boolean/CompareTo/cat.fs" id="Snippet1"::: @@ -1891,7 +1891,7 @@ This is known as Euler's number and is approximately 2.7182818284590452354. method should be used with caution, because two apparently equivalent values can be unequal due to the differing precision of the two values. The following example reports that the value .3333 and the returned by dividing 1 by 3 are unequal. + The method should be used with caution, because two apparently equivalent values can be unequal due to the differing precision of the two values. The following example reports that the value .3333 and the returned by dividing 1 by 3 are unequal. :::code language="csharp" source="~/snippets/csharp/System/Single/Epsilon/SingleEquals_25051.cs" id="Snippet3"::: :::code language="fsharp" source="~/snippets/fsharp/System/Single/Epsilon/SingleEquals_25051.fs" id="Snippet3"::: @@ -1913,7 +1913,7 @@ This is known as Euler's number and is approximately 2.7182818284590452354. ## Examples - The following code example demonstrates the method. + The following code example demonstrates the method. :::code language="csharp" source="~/snippets/csharp/System/Single/CompareTo/singlesample.cs" id="Snippet17"::: :::code language="fsharp" source="~/snippets/fsharp/System/Single/CompareTo/singlesample.fs" id="Snippet17"::: @@ -2584,7 +2584,7 @@ This is known as Euler's number and is approximately 2.7182818284590452354. This method correctly handles floating-point values and so `2.0` will return `true` while `2.2` will return `false`. -A return value of `false` does not imply that will return `true`. A number with a fractional portion, for example, `3.3`, is not even or odd. +A return value of `false` does not imply that will return `true`. A number with a fractional portion, for example, `3.3`, is not even or odd. ]]> @@ -2703,7 +2703,7 @@ A return value of `false` does not imply that method. + The following code example demonstrates the method. :::code language="csharp" source="~/snippets/csharp/System/Single/CompareTo/singlesample.cs" id="Snippet11"::: :::code language="fsharp" source="~/snippets/fsharp/System/Single/CompareTo/singlesample.fs" id="Snippet11"::: @@ -2834,12 +2834,12 @@ This method correctly handles floating-point values and so `2.0` and `3.0` will Floating-point operations return to signal that result of the operation is undefined. For example, dividing 0.0 by 0.0 results in . > [!NOTE] -> returns `false` if a value is either or . To test for these values, use the , , and methods. +> returns `false` if a value is either or . To test for these values, use the , , and methods. ## Examples - The following code example demonstrates the method. + The following code example demonstrates the method. :::code language="csharp" source="~/snippets/csharp/System/Single/CompareTo/singlesample.cs" id="Snippet8"::: :::code language="fsharp" source="~/snippets/fsharp/System/Single/CompareTo/singlesample.fs" id="Snippet8"::: @@ -2962,7 +2962,7 @@ This method correctly handles floating-point values and so `2.0` and `3.0` will ## Examples - The following code example demonstrates the method. + The following code example demonstrates the method. :::code language="csharp" source="~/snippets/csharp/System/Single/CompareTo/singlesample.cs" id="Snippet13"::: :::code language="fsharp" source="~/snippets/fsharp/System/Single/CompareTo/singlesample.fs" id="Snippet13"::: @@ -3064,7 +3064,7 @@ This method correctly handles floating-point values and so `2.0` and `3.0` will This method correctly handles floating-point values and so `3.0` will return `true` while `3.3` will return `false`. -A return value of `false` does not imply that will return `true`. A number with a fractional portion, for example, `3.3`, is not even or odd. +A return value of `false` does not imply that will return `true`. A number with a fractional portion, for example, `3.3`, is not even or odd. ]]> @@ -3112,7 +3112,7 @@ A return value of `false` does not imply that will return `true`. A complex number, `a + bi` for non-zero `b`, is not positive or negative +A return value of `false` does not imply that will return `true`. A complex number, `a + bi` for non-zero `b`, is not positive or negative ]]> @@ -3186,7 +3186,7 @@ A return value of `false` does not imply that method. + The following code example demonstrates the method. :::code language="csharp" source="~/snippets/csharp/System/Single/CompareTo/singlesample.cs" id="Snippet12"::: :::code language="fsharp" source="~/snippets/fsharp/System/Single/CompareTo/singlesample.fs" id="Snippet12"::: @@ -3701,7 +3701,7 @@ This function checks values against the extended real number line, thus returns ## Remarks -For this method matches the IEEE 754:2019 `maximum` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. +For this method matches the IEEE 754:2019 `maximum` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. ]]> @@ -3751,7 +3751,7 @@ For this method matches the IEEE 754:2 ## Remarks -For this method matches the IEEE 754:2019 `maximumMagnitude` function. This requires NaN inputs to not be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. +For this method matches the IEEE 754:2019 `maximumMagnitude` function. This requires NaN inputs to not be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. ]]> @@ -3801,7 +3801,7 @@ For this method matches the IEE ## Remarks -For this method matches the IEEE 754:2019 `maximumMagnitudeNumber` function. This requires NaN inputs to not be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. +For this method matches the IEEE 754:2019 `maximumMagnitudeNumber` function. This requires NaN inputs to not be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. ]]> @@ -3889,7 +3889,7 @@ For this method matches the IEE ## Remarks -For this method matches the IEEE 754:2019 `maximumNumber` function. This requires NaN inputs to not be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. +For this method matches the IEEE 754:2019 `maximumNumber` function. This requires NaN inputs to not be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. ]]> @@ -4008,7 +4008,7 @@ For this method matches the IEEE 754:2 ## Remarks -For this method matches the IEEE 754:2019 `minimum` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. +For this method matches the IEEE 754:2019 `minimum` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. ]]> @@ -4108,7 +4108,7 @@ For method to determine whether a value is not a number. In general, operators cannot be used to compare with other values, although comparison methods (such as and ) can. The following example illustrates the difference in behavior between comparison operators and methods. + Use the method to determine whether a value is not a number. In general, operators cannot be used to compare with other values, although comparison methods (such as and ) can. The following example illustrates the difference in behavior between comparison operators and methods. :::code language="csharp" source="~/snippets/csharp/System/Single/NaN/single.nan4.cs" id="Snippet4"::: :::code language="fsharp" source="~/snippets/fsharp/System/Single/NaN/single.nan4.fs" id="Snippet4"::: @@ -4443,7 +4443,7 @@ For this method matches the IEEE 754:2 This constant is returned when the result of an operation is less than . - Use to determine whether a value evaluates to negative infinity. + Use to determine whether a value evaluates to negative infinity. @@ -4548,7 +4548,7 @@ For this method matches the IEEE 754:2 method defines the equality operator for values. + The method defines the equality operator for values. ]]> @@ -4611,7 +4611,7 @@ For this method matches the IEEE 754:2 method defines the operation of the greater-than operator for values. + The method defines the operation of the greater-than operator for values. ]]> @@ -4674,7 +4674,7 @@ For this method matches the IEEE 754:2 method defines the operation of the greater-than-or-equal operator for values. + The method defines the operation of the greater-than-or-equal operator for values. ]]> @@ -4737,7 +4737,7 @@ For this method matches the IEEE 754:2 method defines the inequality operator for values. + The method defines the inequality operator for values. ]]> @@ -4800,7 +4800,7 @@ For this method matches the IEEE 754:2 method defines the operation of the less-than operator for values. + The method defines the operation of the less-than operator for values. ]]> @@ -4863,7 +4863,7 @@ For this method matches the IEEE 754:2 method defines the operation of the less-than-or-equal operator for values. + The method defines the operation of the less-than-or-equal operator for values. ]]> @@ -4938,7 +4938,7 @@ For this method matches the IEEE 754:2 ## Remarks In .NET Core 3.0 and later, values that are too large to represent are rounded to or as required by the IEEE 754 specification. In prior versions, including .NET Framework, parsing a value that was too large to represent resulted in failure. - The `s` parameter can contain the current culture's , , or symbol. This string comparison is case-insensitive in .NET Core 3.0 and later versions, but is case-sensitive in prior versions including .NET Framework. The `s` parameter can also be a string of the form: + The `s` parameter can contain the current culture's , , or symbol. This string comparison is case-insensitive in .NET Core 3.0 and later versions, but is case-sensitive in prior versions including .NET Framework. The `s` parameter can also be a string of the form: [*ws*][*sign*] [*integral-digits*[*,*]]*integral-digits*[*.*[*fractional-digits*]][e[*sign*]*exponential-digits*][*ws*] @@ -4947,7 +4947,7 @@ For this method matches the IEEE 754:2 |Element|Description| |-------------|-----------------| |*ws*|A series of white space characters.| -|*sign*|A negative sign symbol or a positive sign symbol. Valid sign characters are determined by the and properties of the current culture. Only a leading sign can be used.| +|*sign*|A negative sign symbol or a positive sign symbol. Valid sign characters are determined by the and properties of the current culture. Only a leading sign can be used.| |*integral-digits*|A series of digits ranging from 0 to 9 that specify the integral part of the number. Runs of *integral-digits* can be partitioned by a group-separator symbol. For example, in some cultures a comma (,) separates groups of thousands. The *integral-digits* element can be absent if the string contains the *fractional-digits* element.| |*,*|A culture-specific thousands separator symbol.| |*.*|A culture-specific decimal point symbol.| @@ -4955,18 +4955,18 @@ For this method matches the IEEE 754:2 |E|The "e" or "E" character, which indicates that the value is represented in exponential (scientific) notation.| |*exponential-digits*|A series of digits ranging from 0 to 9 that specify an exponent.| - The `s` parameter is interpreted using a combination of the and flags. This means that white space and thousands separators are allowed but currency symbols are not. To explicitly define the elements (such as currency symbols, thousands separators, and white space) that can be present in `s`, use the method overload. + The `s` parameter is interpreted using a combination of the and flags. This means that white space and thousands separators are allowed but currency symbols are not. To explicitly define the elements (such as currency symbols, thousands separators, and white space) that can be present in `s`, use the method overload. - The `s` parameter is parsed by using the formatting information in a object that is initialized for the current system culture. For more information, see . To parse a string by using the formatting information of a specific culture, use the or method. + The `s` parameter is parsed by using the formatting information in a object that is initialized for the current system culture. For more information, see . To parse a string by using the formatting information of a specific culture, use the or method. -Ordinarily, if you pass the method a string that is created by calling the method, the original value is returned. However, because of a loss of precision, the values may not be equal. +Ordinarily, if you pass the method a string that is created by calling the method, the original value is returned. However, because of a loss of precision, the values may not be equal. If `s` is out of range of the data type, the method throws an on .NET Framework. On .NET Core 3.0 and later versions, it returns if `s` is less than and if `s` is greater than . -If a separator is encountered in the `s` parameter during a parse operation, and the applicable currency or number decimal and group separators are the same, the parse operation assumes that the separator is a decimal separator rather than a group separator. For more information about separators, see , , , and . +If a separator is encountered in the `s` parameter during a parse operation, and the applicable currency or number decimal and group separators are the same, the parse operation assumes that the separator is a decimal separator rather than a group separator. For more information about separators, see , , , and . ## Examples - The following example uses the method to convert an array of strings to equivalent values. + The following example uses the method to convert an array of strings to equivalent values. :::code language="csharp" source="~/snippets/csharp/System/Single/Parse/parse1.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/Single/Parse/parse1.fs" id="Snippet2"::: @@ -5140,7 +5140,7 @@ If a separator is encountered in the `s` parameter during a parse operation, and - - The `s` parameter can contain the current culture's , , or symbol. This string comparison is case-insensitive in .NET Core 3.0 and later versions, but is case-sensitive in prior versions including .NET Framework. Depending on the value of `style`, the `s` parameter can also take the form: + The `s` parameter can contain the current culture's , , or symbol. This string comparison is case-insensitive in .NET Core 3.0 and later versions, but is case-sensitive in prior versions including .NET Framework. Depending on the value of `style`, the `s` parameter can also take the form: [*ws*][*$*][*sign*][*integral-digits*[*,*]]*integral-digits*[*.*[*fractional-digits*]][E[*sign*]*exponential-digits*][*ws*] @@ -5150,7 +5150,7 @@ If a separator is encountered in the `s` parameter during a parse operation, and A series of white-space characters. White space can appear at the beginning of `s` if `style` includes the flag, and it can appear at the end of `s` if `style` includes the flag. $ - A culture-specific currency symbol. Its position in the string is defined by the and properties of the current culture. The current culture's currency symbol can appear in `s` if `style` includes the flag. + A culture-specific currency symbol. Its position in the string is defined by the and properties of the current culture. The current culture's currency symbol can appear in `s` if `style` includes the flag. *sign* A negative sign symbol (-) or a positive sign symbol (+). The sign can appear at the beginning of `s` if `style` includes the flag, and it can appear at the end of `s` if `style` includes the flag. Parentheses can be used in `s` to indicate a negative value if `style` includes the flag. @@ -5197,16 +5197,16 @@ If a separator is encountered in the `s` parameter during a parse operation, and Some examples of `s` are "100", "-123,456,789", "123.45e+6", "+500", "5e2", "3.1416", "600.", "-.123", and "-Infinity". - The `s` parameter is parsed using the formatting information in a object that is initialized for the current system culture. To specify the culture whose formatting information is used for the parse operation, call the overload. + The `s` parameter is parsed using the formatting information in a object that is initialized for the current system culture. To specify the culture whose formatting information is used for the parse operation, call the overload. - Ordinarily, if you pass the method a string that is created by calling the method, the original value is returned. However, because of a loss of precision, the values may not be equal. + Ordinarily, if you pass the method a string that is created by calling the method, the original value is returned. However, because of a loss of precision, the values may not be equal. If `s` is out of range of the data type, the method throws an on .NET Framework. On .NET Core 3.0 and later versions, it returns if `s` is less than and if `s` is greater than . -If a separator is encountered in the `s` parameter during a parse operation, and the applicable currency or number decimal and group separators are the same, the parse operation assumes that the separator is a decimal separator rather than a group separator. For more information about separators, see , , , and . +If a separator is encountered in the `s` parameter during a parse operation, and the applicable currency or number decimal and group separators are the same, the parse operation assumes that the separator is a decimal separator rather than a group separator. For more information about separators, see , , , and . ## Examples - The following example uses the method to parse the string representations of values. The example uses formatting information for the en-US culture. + The following example uses the method to parse the string representations of values. The example uses formatting information for the en-US culture. :::code language="csharp" source="~/snippets/csharp/System/Single/Parse/parse2.cs" id="Snippet3"::: :::code language="fsharp" source="~/snippets/fsharp/System/Single/Parse/parse2.fs" id="Snippet3"::: @@ -5300,7 +5300,7 @@ If a separator is encountered in the `s` parameter during a parse operation, and This overload is typically used to convert text that can be formatted in a variety of ways to a value. For example, it can be used to convert the text entered by a user into an HTML text box to a numeric value. - The `s` parameter is interpreted using a combination of the and flags. The `s` parameter can contain , , or symbol for the culture specified by `provider`. This string comparison is case-insensitive in .NET Core 3.0 and later versions, but is case-sensitive in prior versions including .NET Framework. The `s` parameter can contain a string of the form: + The `s` parameter is interpreted using a combination of the and flags. The `s` parameter can contain , , or symbol for the culture specified by `provider`. This string comparison is case-insensitive in .NET Core 3.0 and later versions, but is case-sensitive in prior versions including .NET Framework. The `s` parameter can contain a string of the form: [*ws*][*sign*]*integral-digits*[*.*[*fractional-digits*]][E[*sign*]*exponential-digits*][*ws*] @@ -5318,24 +5318,24 @@ If a separator is encountered in the `s` parameter during a parse operation, and For more information about numeric formats, see the [Formatting Types](/dotnet/standard/base-types/formatting-types) topic. - The `provider` parameter is an implementation whose method returns a object that provides culture-specific formatting information. When the method is invoked, it calls the `provider` parameter's method and passes it a object that represents the type. The method then returns the object that provides information about the format of the `s` parameter. There are three ways to use the `provider` parameter to supply custom formatting information to the parse operation: + The `provider` parameter is an implementation whose method returns a object that provides culture-specific formatting information. When the method is invoked, it calls the `provider` parameter's method and passes it a object that represents the type. The method then returns the object that provides information about the format of the `s` parameter. There are three ways to use the `provider` parameter to supply custom formatting information to the parse operation: -- You can pass a object that represents the culture that supplies formatting information. Its method returns the object that provides numeric formatting information for that culture. +- You can pass a object that represents the culture that supplies formatting information. Its method returns the object that provides numeric formatting information for that culture. -- You can pass the actual object that provides numeric formatting information. (Its implementation of just returns itself.) +- You can pass the actual object that provides numeric formatting information. (Its implementation of just returns itself.) -- You can pass a custom object that implements . Its method instantiates and returns the object that provides formatting information. +- You can pass a custom object that implements . Its method instantiates and returns the object that provides formatting information. If `provider` is `null` or a cannot be obtained, the formatting information for the current system culture is used. If `s` is out of range of the data type, the method throws an on .NET Framework. On .NET Core 3.0 and later versions, it returns if `s` is less than and if `s` is greater than . -If a separator is encountered in the `s` parameter during a parse operation, and the applicable currency or number decimal and group separators are the same, the parse operation assumes that the separator is a decimal separator rather than a group separator. For more information about separators, see , , , and . +If a separator is encountered in the `s` parameter during a parse operation, and the applicable currency or number decimal and group separators are the same, the parse operation assumes that the separator is a decimal separator rather than a group separator. For more information about separators, see , , , and . Some examples of `s` are "100", "-123,456,789", "123.45e+6", "+500", "5e2", "3.1416", "600.", "-.123", and "-Infinity". ## Examples - The following example is the button click event handler of a Web form. It uses the array returned by the property to determine the user's locale. It then instantiates a object that corresponds to that locale. The object that belongs to that object is then passed to the method to convert the user's input to a value. + The following example is the button click event handler of a Web form. It uses the array returned by the property to determine the user's locale. It then instantiates a object that corresponds to that locale. The object that belongs to that object is then passed to the method to convert the user's input to a value. :::code language="csharp" source="~/snippets/csharp/System/Decimal/Parse/Default.aspx.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/Decimal/Parse/Default.aspx.vb" id="Snippet1"::: @@ -5546,7 +5546,7 @@ If `s` is out of range of the data type, the method returns - - The `s` parameter can contain , , or symbol for the culture specified by `provider`. This string comparison is case-insensitive in .NET Core 3.0 and later versions, but is case-sensitive in prior versions including .NET Framework. Depending on the value of `style`, the `s` parameter can also take the form: + The `s` parameter can contain , , or symbol for the culture specified by `provider`. This string comparison is case-insensitive in .NET Core 3.0 and later versions, but is case-sensitive in prior versions including .NET Framework. Depending on the value of `style`, the `s` parameter can also take the form: [*ws*] [*$*] [*sign*][*integral-digits*,]*integral-digits*[.[*fractional-digits*]][E[*sign*]*exponential-digits*][*ws*] @@ -5555,7 +5555,7 @@ If `s` is out of range of the data type, the method returns |Element|Description| |-------------|-----------------| |*ws*|A series of white-space characters. White space can appear at the beginning of `s` if `style` includes the flag, and it can appear at the end of `s` if `style` includes the flag.| -|$|A culture-specific currency symbol. Its position in the string is defined by the and properties of the current culture. The current culture's currency symbol can appear in `s` if `style` includes the flag.| +|$|A culture-specific currency symbol. Its position in the string is defined by the and properties of the current culture. The current culture's currency symbol can appear in `s` if `style` includes the flag.| |*sign*|A negative sign symbol (-) or a positive sign symbol (+). The sign can appear at the beginning of `s` if `style` includes the flag, and it can appear at the end of `s` if `style` includes the flag. Parentheses can be used in `s` to indicate a negative value if `style` includes the flag.| |*integral-digits*|A series of digits ranging from 0 to 9 that specify the integral part of the number. The *integral-digits* element can be absent if the string contains the *fractional-digits* element.| |,|A culture-specific group separator. The current culture's group separator symbol can appear in `s` if `style` includes the flag| @@ -5586,22 +5586,22 @@ If `s` is out of range of the data type, the method returns ||The `ws`, `sign`, thousands separator (,) and decimal point (.) elements.| ||All elements. However, `s` cannot represent a hexadecimal number.| - The `provider` parameter is an implementation. Its method returns a object that provides culture-specific information about the format of `value`. Typically, `provider` can be any one of the following: + The `provider` parameter is an implementation. Its method returns a object that provides culture-specific information about the format of `value`. Typically, `provider` can be any one of the following: -- A object that represents the culture that provides numeric formatting information. Its method returns the object that provides numeric formatting information. +- A object that represents the culture that provides numeric formatting information. Its method returns the object that provides numeric formatting information. -- A object that provides formatting information. (Its implementation of just returns itself.) +- A object that provides formatting information. (Its implementation of just returns itself.) -- A custom object that implements and uses the method to instantiate and return the object that provides formatting information. +- A custom object that implements and uses the method to instantiate and return the object that provides formatting information. If `provider` is `null`, the object for the current culture is used. If `s` is out of range of the data type, the method throws an on .NET Framework. On .NET Core 3.0 and later versions, it returns if `s` is less than and if `s` is greater than . -If a separator is encountered in the `s` parameter during a parse operation, and the applicable currency or number decimal and group separators are the same, the parse operation assumes that the separator is a decimal separator rather than a group separator. For more information about separators, see , , , and . +If a separator is encountered in the `s` parameter during a parse operation, and the applicable currency or number decimal and group separators are the same, the parse operation assumes that the separator is a decimal separator rather than a group separator. For more information about separators, see , , , and . ## Examples - The following code example uses the method to parse the string representations of values. Each string in an array is parsed using the formatting conventions of the en-US, nl-NL, and a custom culture. The custom culture defines its group separator symbol as the underscore ("_") and its group size as two. + The following code example uses the method to parse the string representations of values. Each string in an array is parsed using the formatting conventions of the en-US, nl-NL, and a custom culture. The custom culture defines its group separator symbol as the underscore ("_") and its group size as two. :::code language="csharp" source="~/snippets/csharp/System/Single/Parse/parse3.cs" id="Snippet4"::: :::code language="fsharp" source="~/snippets/fsharp/System/Single/Parse/parse3.fs" id="Snippet4"::: @@ -5715,7 +5715,7 @@ Pi is approximately 3.1415926535897932385. This constant is returned when the result of an operation is greater than . - Use to determine whether a value evaluates to positive infinity. + Use to determine whether a value evaluates to positive infinity. @@ -6608,7 +6608,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -6666,7 +6666,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -6828,7 +6828,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -6886,7 +6886,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -6944,7 +6944,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -7002,7 +7002,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -7060,7 +7060,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -7124,7 +7124,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -7242,7 +7242,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the `static` (`Shared` in Visual Basic) method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the `static` (`Shared` in Visual Basic) method. ]]> @@ -7306,7 +7306,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -7370,7 +7370,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -7434,7 +7434,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -9536,15 +9536,15 @@ Tau is approximately 6.2831853071795864769. method formats a value in the default ("G", or general) format of the current culture. If you want to specify a different format or culture, use the other overloads of the method, as follows: + The method formats a value in the default ("G", or general) format of the current culture. If you want to specify a different format or culture, use the other overloads of the method, as follows: |To use format|For culture|Use the overload| |-------------------|-----------------|----------------------| -|Default ("G") format|A specific culture|| -|A specific format|Default (current) culture|| -|A specific format|A specific culture|| +|Default ("G") format|A specific culture|| +|A specific format|Default (current) culture|| +|A specific format|A specific culture|| - The return value can be , , , or a string of the form: + The return value can be , , , or a string of the form: [sign]integral-digits[.[fractional-digits]][e[sign]exponential-digits] @@ -9570,13 +9570,13 @@ Tau is approximately 6.2831853071795864769. ## Examples - The following example uses the default method to display the string representations of a number of values. + The following example uses the default method to display the string representations of a number of values. :::code language="csharp" source="~/snippets/csharp/System/Single/ToString/ToString1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Single/ToString/ToString1.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/Single/ToString/ToString1.vb" id="Snippet1"::: - The following code example illustrates the use of the method along with the method. + The following code example illustrates the use of the method along with the method. :::code language="csharp" source="~/snippets/csharp/System/Single/CompareTo/singlesample.cs" id="Snippet3"::: :::code language="fsharp" source="~/snippets/fsharp/System/Single/CompareTo/singlesample.fs" id="Snippet3"::: @@ -9659,15 +9659,15 @@ Tau is approximately 6.2831853071795864769. method formats a value in the default ("G", or general) format of a specified culture. If you want to specify a different format or the current culture, use the other overloads of the method, as follows: + The method formats a value in the default ("G", or general) format of a specified culture. If you want to specify a different format or the current culture, use the other overloads of the method, as follows: |To use format|For culture|Use the overload| |-------------------|-----------------|----------------------| |Default ("G") format|Default (current) culture|| -|A specific format|Default (current) culture|| -|A specific format|A specific culture|| +|A specific format|Default (current) culture|| +|A specific format|A specific culture|| - The return value can be , , , or a string of the form: + The return value can be , , , or a string of the form: [sign]integral-digits[.[fractional-digits]][e[sign]exponential-digits] @@ -9690,9 +9690,9 @@ Tau is approximately 6.2831853071795864769. - For more information about formatting, see [Formatting Types](/dotnet/standard/base-types/formatting-types). - The `provider` parameter is an implementation whose method returns a object. Typically, `provider` is a object or a object. The `provider` parameter supplies culture-specific information used in formatting. If `provider` is `null`, the return value is formatted using the data for the current culture. + The `provider` parameter is an implementation whose method returns a object. Typically, `provider` is a object or a object. The `provider` parameter supplies culture-specific information used in formatting. If `provider` is `null`, the return value is formatted using the data for the current culture. - To convert a value to its string representation using a specified culture and a specific format string, call the method. + To convert a value to its string representation using a specified culture and a specific format string, call the method. @@ -9779,15 +9779,15 @@ Tau is approximately 6.2831853071795864769. method formats a value in a specified format by using the conventions of the current culture. If you want to use the default ("G", or general) format or specify a different culture, use the other overloads of the method, as follows: + The method formats a value in a specified format by using the conventions of the current culture. If you want to use the default ("G", or general) format or specify a different culture, use the other overloads of the method, as follows: |To use format|For culture|Use the overload| |-------------------|-----------------|----------------------| |Default ("G") format|Default (current) culture|| -|Default ("G") format|A specific culture|| -|A specific format|A specific culture|| +|Default ("G") format|A specific culture|| +|A specific format|A specific culture|| - The return value can be , , , or the string representation of the value of the current instance, as specified by `format`. + The return value can be , , , or the string representation of the value of the current instance, as specified by `format`. The `format` parameter can be any valid standard numeric format specifier except for D and X, as well as any combination of custom numeric format specifiers. If format is `null` or an empty string, the return value is formatted with the general numeric format specifier ("G"). @@ -9797,7 +9797,7 @@ Tau is approximately 6.2831853071795864769. - For more information about formatting, see [Formatting Types](/dotnet/standard/base-types/formatting-types). - By default, the return value only contains 7 digits of precision although a maximum of 9 digits is maintained internally. If the value of this instance has greater than 7 digits, returns or instead of the expected number. If you require more precision, specify `format` with the "G9" format specification, which always returns 9 digits of precision, or "R", which returns 7 digits if the number can be represented with that precision or 9 digits if the number can only be represented with maximum precision. + By default, the return value only contains 7 digits of precision although a maximum of 9 digits is maintained internally. If the value of this instance has greater than 7 digits, returns or instead of the expected number. If you require more precision, specify `format` with the "G9" format specification, which always returns 9 digits of precision, or "R", which returns 7 digits if the number can be represented with that precision or 9 digits if the number can only be represented with maximum precision. @@ -9894,15 +9894,15 @@ Tau is approximately 6.2831853071795864769. method formats a value in a specified format of a specified culture. If you want to use default format or culture settings, use the other overloads of the method, as follows: + The method formats a value in a specified format of a specified culture. If you want to use default format or culture settings, use the other overloads of the method, as follows: |To use format|For culture|Use the overload| |-------------------|-----------------|----------------------| |Default ("G") format|Default (current) culture|| -|Default ("G") format|A specific culture|| -|A specific format|Default (current) culture|| +|Default ("G") format|A specific culture|| +|A specific format|Default (current) culture|| - The return value can be , , , or the string representation of the value of the current instance, as specified by `format`. + The return value can be , , , or the string representation of the value of the current instance, as specified by `format`. The `format` parameter can be any valid standard numeric format specifier except for D and X, as well as any combination of custom numeric format specifiers. If `format` is `null` or an empty string, the return value for this instance is formatted with the general numeric format specifier ("G"). @@ -9912,9 +9912,9 @@ Tau is approximately 6.2831853071795864769. - For more information about formatting, see [Formatting Types](/dotnet/standard/base-types/formatting-types). - The `provider` parameter is an implementation whose method returns a object. Typically, `provider` is a object or a object. The `provider` parameter supplies culture-specific information used in formatting. If `provider` is `null`, the return value is formatted with the object for the current culture. + The `provider` parameter is an implementation whose method returns a object. Typically, `provider` is a object or a object. The `provider` parameter supplies culture-specific information used in formatting. If `provider` is `null`, the return value is formatted with the object for the current culture. - By default, the return value only contains 7 digits of precision although a maximum of 9 digits is maintained internally. If the value of this instance has greater than 7 digits, returns or instead of the expected number. If you require more precision, specify `format` with the "G9" format specification, which always returns 9 digits of precision, or "R", which returns 7 digits if the number can be represented with that precision or 9 digits if the number can only be represented with maximum precision. + By default, the return value only contains 7 digits of precision although a maximum of 9 digits is maintained internally. If the value of this instance has greater than 7 digits, returns or instead of the expected number. If you require more precision, specify `format` with the "G9" format specification, which always returns 9 digits of precision, or "R", which returns 7 digits if the number can be represented with that precision or 9 digits if the number can only be represented with maximum precision. @@ -10263,9 +10263,9 @@ Tau is approximately 6.2831853071795864769. ## Remarks In .NET Core 3.0 and later, values that are too large to represent are rounded to or as required by the IEEE 754 specification. In prior versions, including .NET Framework, parsing a value that was too large to represent resulted in failure. - This overload differs from the method by returning a Boolean value that indicates whether the parse operation succeeded instead of returning the parsed numeric value. It eliminates the need to use exception handling to test for a in the event that `s` is invalid and cannot be successfully parsed. + This overload differs from the method by returning a Boolean value that indicates whether the parse operation succeeded instead of returning the parsed numeric value. It eliminates the need to use exception handling to test for a in the event that `s` is invalid and cannot be successfully parsed. - The `s` parameter can contain , , or symbol. This string comparison is case-insensitive in .NET Core 3.0 and later versions, but is case-sensitive in prior versions including .NET Framework. The `s` parameter can also be a string of the form: + The `s` parameter can contain , , or symbol. This string comparison is case-insensitive in .NET Core 3.0 and later versions, but is case-sensitive in prior versions including .NET Framework. The `s` parameter can also be a string of the form: [ws][sign][integral-digits,]integral-digits[.[fractional-digits]][e[sign]exponential-digits][ws] @@ -10282,20 +10282,20 @@ Tau is approximately 6.2831853071795864769. |*E*|An uppercase or lowercase character 'e', that indicates exponential (scientific) notation.| |*exponential-digits*|A series of numeric characters ranging from 0 to 9 that specify an exponent.| - The `s` parameter is interpreted using a combination of the and flags. This means that white space and thousands separators are allowed but currency symbols are not. To explicitly define the elements (such as currency symbols, thousands separators, and white space) that can be present in `s`, use the method overload. + The `s` parameter is interpreted using a combination of the and flags. This means that white space and thousands separators are allowed but currency symbols are not. To explicitly define the elements (such as currency symbols, thousands separators, and white space) that can be present in `s`, use the method overload. - The `s` parameter is parsed using the formatting information in a object that is initialized for the current system culture. For more information, see . To parse a string using the formatting information of some other specified culture, use the method overload. + The `s` parameter is parsed using the formatting information in a object that is initialized for the current system culture. For more information, see . To parse a string using the formatting information of some other specified culture, use the method overload. - Ordinarily, if you pass the method a string that is created by calling the method, the original value is returned. However, because of a loss of precision, the values may not be equal. + Ordinarily, if you pass the method a string that is created by calling the method, the original value is returned. However, because of a loss of precision, the values may not be equal. If `s` is out of range of the data type, the method returns `false` on .NET Framework. On .NET Core 3.0 and later versions, it returns if `s` is less than and if `s` is greater than . -If a separator is encountered in the `s` parameter during a parse operation, and the applicable currency or number decimal and group separators are the same, the parse operation assumes that the separator is a decimal separator rather than a group separator. For more information about separators, see , , , and . +If a separator is encountered in the `s` parameter during a parse operation, and the applicable currency or number decimal and group separators are the same, the parse operation assumes that the separator is a decimal separator rather than a group separator. For more information about separators, see , , , and . ## Examples - The following example uses the method to convert the string representations of numeric values to values. It assumes that en-US is the current culture. + The following example uses the method to convert the string representations of numeric values to values. It assumes that en-US is the current culture. :::code language="csharp" source="~/snippets/csharp/System/Single/TryParse/tryparse1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Single/TryParse/tryparse1.fs" id="Snippet1"::: @@ -10630,7 +10630,7 @@ If a separator is encountered in the `s` parameter during a parse operation, and ## Remarks In .NET Core 3.0 and later, values that are too large to represent are rounded to or as required by the IEEE 754 specification. In prior versions, including .NET Framework, parsing a value that was too large to represent resulted in failure. - This overload differs from the method by returning a Boolean value that indicates whether the parse operation succeeded instead of returning the parsed numeric value. It eliminates the need to use exception handling to test for a in the event that `s` is invalid and cannot be successfully parsed. + This overload differs from the method by returning a Boolean value that indicates whether the parse operation succeeded instead of returning the parsed numeric value. It eliminates the need to use exception handling to test for a in the event that `s` is invalid and cannot be successfully parsed. The `style` parameter defines the allowable format of the `s` parameter for the parse operation to succeed. It must be a combination of bit flags from the enumeration. The following members are not supported: @@ -10638,7 +10638,7 @@ If a separator is encountered in the `s` parameter during a parse operation, and - - The `s` parameter can contain , , or symbol for the culture indicated by `provider`. This string comparison is case-insensitive in .NET Core 3.0 and later versions, but is case-sensitive in prior versions including .NET Framework. In addition, depending on the value of `style`, the `s` parameter may include the following elements: + The `s` parameter can contain , , or symbol for the culture indicated by `provider`. This string comparison is case-insensitive in .NET Core 3.0 and later versions, but is case-sensitive in prior versions including .NET Framework. In addition, depending on the value of `style`, the `s` parameter may include the following elements: [ws] [$] [sign][integral-digits,]integral-digits[.fractional-digits][e[sign]exponential-digits][ws] @@ -10647,7 +10647,7 @@ If a separator is encountered in the `s` parameter during a parse operation, and |Element|Description| |-------------|-----------------| |*ws*|Optional white space. White space can appear at the beginning of `s` if `style` includes the flag. It can appear at the end of `s` if `style` includes the flag.| -|*$*|A culture-specific currency symbol. Its position in the string is defined by the or properties of the object returned by the method of the `provider` parameter. The currency symbol can appear in `s` if `style` includes the flag.| +|*$*|A culture-specific currency symbol. Its position in the string is defined by the or properties of the object returned by the method of the `provider` parameter. The currency symbol can appear in `s` if `style` includes the flag.| |*sign*|An optional sign. The sign can appear at the beginning of `s` if `style` includes the flag, and it can appear at the end of `s` if `style` includes the flag. Parentheses can be used in `s` to indicate a negative value if `style` includes the flag.| |*integral-digits*|A series of digits ranging from 0 to 9 that specify the integral part of the number. Integral-digits can be absent if there are fractional-digits.| |*,*|A culture-specific thousands separator symbol. The current culture's thousands separator symbol can appear in `s` if `style` includes the flag.| @@ -10678,22 +10678,22 @@ If a separator is encountered in the `s` parameter during a parse operation, and ||The `ws`, `sign`, thousands separator (*,),* and decimal point (*.*) elements.| ||All styles, except `s` cannot represent a hexadecimal number.| - The `provider` parameter is an implementation whose method returns a object that provides culture-specific formatting information. When the method is invoked, it calls the `provider` parameter's method and passes it a object that represents the type. The method then returns the object that provides information about the format of the `s` parameter. There are three ways to use the `provider` parameter to supply custom formatting information to the parse operation: + The `provider` parameter is an implementation whose method returns a object that provides culture-specific formatting information. When the method is invoked, it calls the `provider` parameter's method and passes it a object that represents the type. The method then returns the object that provides information about the format of the `s` parameter. There are three ways to use the `provider` parameter to supply custom formatting information to the parse operation: -- You can pass a object that represents the culture that supplies formatting information. Its method returns the object that provides numeric formatting information for that culture. +- You can pass a object that represents the culture that supplies formatting information. Its method returns the object that provides numeric formatting information for that culture. -- You can pass the actual object that provides numeric formatting information. (Its implementation of just returns itself.) +- You can pass the actual object that provides numeric formatting information. (Its implementation of just returns itself.) -- You can pass a custom object that implements . Its method instantiates and returns the object that provides formatting information. +- You can pass a custom object that implements . Its method instantiates and returns the object that provides formatting information. If `provider` is `null`, the formatting of `s` is interpreted based on the object of the current culture. If `s` is out of range of the data type, the method throws an on .NET Framework. On .NET Core 3.0 and later versions, it returns if `s` is less than and if `s` is greater than . - If a separator is encountered in the `s` parameter during a parse operation, and the applicable currency or number decimal and group separators are the same, the parse operation assumes that the separator is a decimal separator rather than a group separator. For more information about separators, see , , , and . + If a separator is encountered in the `s` parameter during a parse operation, and the applicable currency or number decimal and group separators are the same, the parse operation assumes that the separator is a decimal separator rather than a group separator. For more information about separators, see , , , and . ## Examples - The following example demonstrates the use of the method to parse the string representation of numbers that have a particular style and are formatted using the conventions of a particular culture. + The following example demonstrates the use of the method to parse the string representation of numbers that have a particular style and are formatted using the conventions of a particular culture. :::code language="csharp" source="~/snippets/csharp/System/Single/TryParse/tryparse1.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/Single/TryParse/tryparse1.fs" id="Snippet2"::: diff --git a/xml/System/Span`1+Enumerator.xml b/xml/System/Span`1+Enumerator.xml index 66d92ab4f30..0d7259bf0d6 100644 --- a/xml/System/Span`1+Enumerator.xml +++ b/xml/System/Span`1+Enumerator.xml @@ -93,32 +93,32 @@ Provides an enumerator for the elements of a . - . At this position, is undefined. You must call to advance the enumerator to the first item in the before reading the value of . +Initially, the enumerator is positioned before the first element in the . At this position, is undefined. You must call to advance the enumerator to the first item in the before reading the value of . - returns the same value until is called. sets to the next item in the . + returns the same value until is called. sets to the next item in the . -If passes the end of the , returns `false`. When the enumerator is at this state, subsequent calls to also return `false` and is undefined. You cannot set to the first item in the again; you must create a new enumerator instance instead. +If passes the end of the , returns `false`. When the enumerator is at this state, subsequent calls to also return `false` and is undefined. You cannot set to the first item in the again; you must create a new enumerator instance instead. -The enumerator does not have exclusive access to the . In addition, the underlying data on which the span is based can also be modified. Therefore, enumerating through a span is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you must implement your own synchronization. For example, the following code has a race condition. It does not ensure that the span will be enumerated before the `ClearContents` method executes. As a result, the underlying array is cleared during enumeration of the span: +The enumerator does not have exclusive access to the . In addition, the underlying data on which the span is based can also be modified. Therefore, enumerating through a span is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you must implement your own synchronization. For example, the following code has a race condition. It does not ensure that the span will be enumerated before the `ClearContents` method executes. As a result, the underlying array is cleared during enumeration of the span: :::code language="csharp" source="~/snippets/csharp/System/Span.Enumerator/Program.cs"::: :::code language="fsharp" source="~/snippets/fsharp/System/Span.Enumerator/Program.fs"::: -If you synchronize access to the array before enumerating the span, as the revised version of the `EnumerateSpan` method does in the following example, the `ClearContents` method doesn't modify underlying span data during enumeration. Note that the example locks the underlying array on which the span is based. +If you synchronize access to the array before enumerating the span, as the revised version of the `EnumerateSpan` method does in the following example, the `ClearContents` method doesn't modify underlying span data during enumeration. Note that the example locks the underlying array on which the span is based. :::code language="csharp" source="~/snippets/csharp/System/Span.Enumerator/Program2.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Span.Enumerator/Program2.fs" id="Snippet1"::: -Unlike some other enumerator structures in .NET, the : +Unlike some other enumerator structures in .NET, the : -- Does not implement the or interface. This is because is a [ref struct](/dotnet/csharp/reference-semantics-with-value-types#ref-struct-type). +- Does not implement the or interface. This is because is a [ref struct](/dotnet/csharp/reference-semantics-with-value-types#ref-struct-type). + +- Does not include a `Reset` method, which can set the enumerator to its initial position before the first element in the span. (The method must be implemented as part of the interface, but most implementors either throw an exception or provide no implementation.) -- Does not include a `Reset` method, which can set the enumerator to its initial position before the first element in the span. (The method must be implemented as part of the interface, but most implementors either throw an exception or provide no implementation.) - ]]> @@ -161,15 +161,15 @@ Unlike some other enumerator structures in .NET, the Gets a reference to the item at the current position of the enumerator. The element in the at the current position of the enumerator. - must be called to advance the enumerator to the first element of the span before reading the value of `Current`. +- Immediately after the enumerator is created, the enumerator is positioned before the first element in the span. must be called to advance the enumerator to the first element of the span before reading the value of `Current`. -- The last call to returned `false`, which indicates the end of the span. +- The last call to returned `false`, which indicates the end of the span. -`Current` returns the same value until is called. sets `Current` to the next item in the span. +`Current` returns the same value until is called. sets `Current` to the next item in the span. ]]> @@ -221,9 +221,9 @@ Unlike some other enumerator structures in .NET, the if the enumerator successfully advanced to the next item; if the end of the span has been passed. - object to their default values. It does not remove items from the . +The `Clear` method sets the items in the object to their default values. It does not remove items from the . ]]> @@ -514,13 +514,13 @@ This method copies all of `source` to `destination` even if `source` and `destin Calls to this method are not supported. method are not supported. Calls to the methods produce either of two results: +Calls to the method are not supported. Calls to the methods produce either of two results: -- If `obj` is a , the method call generates compiler error CS1503: "cannot convert from 'System.Span' to 'object'." This is because is a [ref struct](/dotnet/csharp/language-reference/builtin-types/ref-struct) that cannot be boxed and therefore cannot be converted to an . +- If `obj` is a , the method call generates compiler error CS1503: "cannot convert from 'System.Span' to 'object'." This is because is a [ref struct](/dotnet/csharp/language-reference/builtin-types/ref-struct) that cannot be boxed and therefore cannot be converted to an . -- If the type of `obj` is not a , the method call throws a . +- If the type of `obj` is not a , the method call throws a . -To compare two objects for equality, use the comparison operator. +To compare two objects for equality, use the comparison operator. ]]> @@ -616,7 +616,7 @@ To compare two objects for equality, use the An enumerator for this span. method directly, you can use the C# `foreach` statement and the Visual Basic `For Each`...`Next` construct to enumerate a . +Instead of calling the method directly, you can use the C# `foreach` statement and the Visual Basic `For Each`...`Next` construct to enumerate a . ]]> @@ -928,7 +928,7 @@ The following example demonstrates creating an integer array, pinning it, and wr objects are equal if they have the same length and the corresponding elements of `left` and `right` point to the same memory. Note that the test for equality does *not* attempt to determine whether the contents are equal. +Two objects are equal if they have the same length and the corresponding elements of `left` and `right` point to the same memory. Note that the test for equality does *not* attempt to determine whether the contents are equal. ]]> @@ -1167,7 +1167,7 @@ Two objects are equal if they have the same length and th objects are not equal if they have different lengths or if the corresponding elements of `left` and `right` do not point to the same memory. +Two objects are not equal if they have different lengths or if the corresponding elements of `left` and `right` do not point to the same memory. ]]> @@ -1320,7 +1320,7 @@ Two objects are not equal if they have different lengths does not exist. +This method performs a heap allocation and therefore should be avoided if possible. Heap allocations are expected in APIs that work with arrays. Using such APIs is unavoidable if an alternative API overload that takes a does not exist. ]]> @@ -1366,7 +1366,7 @@ This method performs a heap allocation and therefore should be avoided if possib The string representation of this object. `, the `ToString` method returns a that contains the characters pointed to by the . Otherwise, it returns a with the name of the type and the number of elements that the contains. +For a `Span`, the `ToString` method returns a that contains the characters pointed to by the . Otherwise, it returns a with the name of the type and the number of elements that the contains. ]]> @@ -1426,7 +1426,7 @@ For a `Span`, the `ToString` method returns a that co This method copies all of `source` to `destination` even if `source` and `destination` overlap. -If `destination` is shorter than the source , this method returns `false`, and no data is written to `destination`. +If `destination` is shorter than the source , this method returns `false`, and no data is written to `destination`. ]]> diff --git a/xml/System/StackOverflowException.xml b/xml/System/StackOverflowException.xml index b219ed9ff54..3db62932ff9 100644 --- a/xml/System/StackOverflowException.xml +++ b/xml/System/StackOverflowException.xml @@ -66,7 +66,7 @@ ## Remarks `StackOverflowException` is thrown for execution stack overflow errors, typically in case of a very deep or unbounded recursion. So make sure your code doesn't have an infinite loop or infinite recursion. - `StackOverflowException` uses the HRESULT COR_E_STACKOVERFLOW, which has the value 0x800703E9. The intermediate language (IL) instruction throws `StackOverflowException`. For a list of initial property values for a `StackOverflowException` object, see the constructors. + `StackOverflowException` uses the HRESULT COR_E_STACKOVERFLOW, which has the value 0x800703E9. The intermediate language (IL) instruction throws `StackOverflowException`. For a list of initial property values for a `StackOverflowException` object, see the constructors. You can't catch a `StackOverflowException` object with a `try`/`catch` block, and the corresponding process is terminated by default. Consequently, you should write your code to detect and prevent a stack overflow. For example, if your app depends on recursion, use a counter or a state condition to terminate the recursive loop. For an illustration of this technique, see the [Examples](#examples) section. @@ -142,8 +142,8 @@ You can't catch a `StackOverflowException` object with a `try`/`catch` block, an |Property|Value| |--------------|-----------| -||`null`.| -||The localized error message string.| +||`null`.| +||The localized error message string.| ]]> @@ -197,8 +197,8 @@ You can't catch a `StackOverflowException` object with a `try`/`catch` block, an |Property|Value| |--------------|-----------| -||A null reference (`Nothing` in Visual Basic).| -||The error message string.| +||A null reference (`Nothing` in Visual Basic).| +||The error message string.| ]]> @@ -256,8 +256,8 @@ You can't catch a `StackOverflowException` object with a `try`/`catch` block, an |Property|Value| |--------------|-----------| -||The inner exception reference.| -||The error message string.| +||The inner exception reference.| +||The error message string.| ]]> diff --git a/xml/System/String.xml b/xml/System/String.xml index 59a0f9dc6fc..915a5794287 100644 --- a/xml/System/String.xml +++ b/xml/System/String.xml @@ -209,7 +209,7 @@ ## Remarks > [!NOTE] -> For examples and comprehensive usage information about this and other `String` constructor overloads, see the constructor summary. +> For examples and comprehensive usage information about this and other `String` constructor overloads, see the constructor summary. ]]> @@ -274,7 +274,7 @@ ## Remarks > [!NOTE] -> For examples and comprehensive usage information about this and other `String` constructor overloads, see the constructor summary. +> For examples and comprehensive usage information about this and other `String` constructor overloads, see the constructor summary. ]]> @@ -370,7 +370,7 @@ ## Remarks > [!NOTE] -> For examples and comprehensive usage information about this and other `String` constructor overloads, see the constructor summary. +> For examples and comprehensive usage information about this and other `String` constructor overloads, see the constructor summary. ]]>
@@ -439,7 +439,7 @@ ## Remarks > [!NOTE] -> For examples and comprehensive usage information about this and other `String` constructor overloads, see the constructor summary. +> For examples and comprehensive usage information about this and other `String` constructor overloads, see the constructor summary. ]]>
@@ -509,7 +509,7 @@ ## Remarks > [!NOTE] -> For examples and comprehensive usage information about this and other `String` constructor overloads, see the constructor summary. +> For examples and comprehensive usage information about this and other `String` constructor overloads, see the constructor summary. ]]>
@@ -578,7 +578,7 @@ ## Remarks > [!NOTE] -> For examples and comprehensive usage information about this and other `String` constructor overloads, see the constructor summary. +> For examples and comprehensive usage information about this and other `String` constructor overloads, see the constructor summary. ]]>
@@ -650,7 +650,7 @@ The sum of and is grea ## Remarks > [!NOTE] -> For examples and comprehensive usage information about this and other `String` constructor overloads, see the constructor summary. +> For examples and comprehensive usage information about this and other `String` constructor overloads, see the constructor summary. ]]>
@@ -742,7 +742,7 @@ A new instance of could not be initialized using ## Remarks > [!NOTE] -> For examples and comprehensive usage information about this and other `String` constructor overloads, see the constructor summary. +> For examples and comprehensive usage information about this and other `String` constructor overloads, see the constructor summary. ]]>
@@ -897,9 +897,9 @@ The following example demonstrates how you can use this indexer in a routine to or method to create a separate object with the same value as this instance. +The return value is not an independent copy of this instance; it is simply another view of the same data. Use the or method to create a separate object with the same value as this instance. -Because the method simply returns the existing string instance, there is little reason to call it directly. +Because the method simply returns the existing string instance, there is little reason to call it directly. ]]> @@ -921,7 +921,7 @@ Because the method simply returns the existing str method return a 32-bit signed integer indicating the lexical relationship between the two comparands. +All overloads of the method return a 32-bit signed integer indicating the lexical relationship between the two comparands. |Value|Condition| |-----------|---------------| @@ -930,7 +930,7 @@ All overloads of the method return a 32-bit sign |Greater than zero|The first substring follows the second substring in the sort order.| > [!WARNING] -> Whenever possible, you should call an overload of the method that includes a parameter. For more information, see [Best Practices for Using Strings](/dotnet/standard/base-types/best-practices-strings). +> Whenever possible, you should call an overload of the method that includes a parameter. For more information, see [Best Practices for Using Strings](/dotnet/standard/base-types/best-practices-strings). ]]> @@ -1020,7 +1020,7 @@ The comparison uses the current culture to obtain culture-specific information s The comparison is performed using word sort rules. For more information about word, string, and ordinal sorts, see . > [!WARNING] -> When comparing strings, you should call the method, which requires that you explicitly specify the type of string comparison that the method uses. For more information, see [Best Practices for Using Strings](/dotnet/standard/base-types/best-practices-strings). +> When comparing strings, you should call the method, which requires that you explicitly specify the type of string comparison that the method uses. For more information, see [Best Practices for Using Strings](/dotnet/standard/base-types/best-practices-strings). One or both comparands can be `null`. By definition, any string, including the empty string (""), compares greater than a null reference; and two null references compare equal to each other. @@ -1039,13 +1039,13 @@ Compare the path name to "file" using an ordinal comparison. The correct code to :::code language="vb" source="~/snippets/visualbasic/System/String/Compare/remarks.vb" id="Snippet11"::: ## Examples -The following example calls the method to compare three sets of strings. +The following example calls the method to compare three sets of strings. :::code language="csharp" source="~/snippets/csharp/System/String/Compare/compare02.cs" id="Snippet18"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/Compare/compare02.fs" id="Snippet18"::: :::code language="vb" source="~/snippets/visualbasic/System/String/Compare/compare02.vb" id="Snippet18"::: -In the following example, the `ReverseStringComparer` class demonstrates how you can evaluate two strings with the method. +In the following example, the `ReverseStringComparer` class demonstrates how you can evaluate two strings with the method. :::code language="csharp" source="~/snippets/csharp/System/String/Compare/ArrayListSample.cs" id="Snippet7"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/Compare/ArrayListSample.fs" id="Snippet7"::: @@ -1151,7 +1151,7 @@ The comparison uses the current culture to obtain culture-specific information s The comparison is performed using word sort rules. For more information about word, string, and ordinal sorts, see . > [!WARNING] -> When comparing strings, you should call the method, which requires that you explicitly specify the type of string comparison that the method uses. For more information, see [Best Practices for Using Strings](/dotnet/standard/base-types/best-practices-strings). +> When comparing strings, you should call the method, which requires that you explicitly specify the type of string comparison that the method uses. For more information, see [Best Practices for Using Strings](/dotnet/standard/base-types/best-practices-strings). One or both comparands can be `null`. By definition, any string, including the empty string (""), compares greater than a null reference; and two null references compare equal to each other. @@ -1170,7 +1170,7 @@ Compare the path name to "file" using an ordinal comparison. The correct code to :::code language="vb" source="~/snippets/visualbasic/System/String/Compare/remarks.vb" id="Snippet13"::: ## Examples -The following example demonstrates that the method is equivalent to using or when comparing strings. +The following example demonstrates that the method is equivalent to using or when comparing strings. :::code language="csharp" source="~/snippets/csharp/System/String/Compare/compare02.cs" id="Snippet18"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/Compare/compare02.fs" id="Snippet18"::: @@ -1516,7 +1516,7 @@ To recognize ignorable characters in a string comparison, call the . > [!WARNING] -> When comparing strings, you should call the method, which requires that you explicitly specify the type of string comparison that the method uses. For more information, see [Best Practices for Using Strings](/dotnet/standard/base-types/best-practices-strings). +> When comparing strings, you should call the method, which requires that you explicitly specify the type of string comparison that the method uses. For more information, see [Best Practices for Using Strings](/dotnet/standard/base-types/best-practices-strings). One or both comparands can be `null`. By definition, any string, including the empty string (""), compares greater than a null reference; and two null references compare equal to each other. @@ -2172,7 +2172,7 @@ The number of characters to compare is the lesser of the lengths of the two subs The comparison uses the `culture` parameter to obtain culture-specific information, such as casing rules and the alphabetical order of individual characters. For example, a particular culture could specify that certain combinations of characters be treated as a single character, that uppercase and lowercase characters be compared in a particular way, or that the sort order of a character depends on the characters that precede or follow it. > [!CAUTION] -> The method is designed primarily for use in sorting or alphabetizing operations. It should not be used when the primary purpose of the method call is to determine whether two substrings are equivalent (that is, when the purpose of the method call is to test for a return value of zero). To determine whether two strings are equivalent, call the method. +> The method is designed primarily for use in sorting or alphabetizing operations. It should not be used when the primary purpose of the method call is to determine whether two substrings are equivalent (that is, when the purpose of the method call is to test for a return value of zero). To determine whether two strings are equivalent, call the method. One or both of `strA` and `strB` can be `null`. By definition, any string, including , compares greater than a null reference, and two null references compare equal to each other. @@ -2181,7 +2181,7 @@ The comparison can be further specified by the `options` parameter, which consis The comparison terminates when an inequality is discovered or both substrings have been compared. However, if the two strings compare equal to the end of one string, and the other string has characters remaining, the string with the remaining characters is considered greater. The return value is the result of the last comparison performed. ## Examples -The following example uses the method to compare the last names of two people. It then lists them in alphabetical order. +The following example uses the method to compare the last names of two people. It then lists them in alphabetical order. :::code language="csharp" source="~/snippets/csharp/System/String/Compare/Example1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/Compare/Example1.fs" id="Snippet1"::: @@ -2302,9 +2302,9 @@ Either or is . To perform a case-insensitive comparison using ordinal sort rules, call the method with the `comparisonType` argument set to . +This method performs a case-sensitive comparison using ordinal sort rules. For more information about word, string, and ordinal sorts, see . To perform a case-insensitive comparison using ordinal sort rules, call the method with the `comparisonType` argument set to . -Because is a static method, `strA` and `strB` can be `null`. If both values are `null`, the method returns 0 (zero), which indicates that `strA` and `strB` are equal. If only one of the values is `null`, the method considers the non-null value to be greater. +Because is a static method, `strA` and `strB` can be `null`. If both values are `null`, the method returns 0 (zero), which indicates that `strA` and `strB` are equal. If only one of the values is `null`, the method considers the non-null value to be greater. ## Examples The following example performs and ordinal comparison of two strings that only differ in case. @@ -2412,12 +2412,12 @@ The `indexA`, `indexB`, and `length` parameters must be nonnegative. The number of characters compared is the lesser of the length of `strA` less `indexA`, the length of `strB` less `indexB`, and `length`. -This method performs a case-sensitive comparison using ordinal sort rules. For more information about word, string, and ordinal sorts, see . To perform a case-insensitive comparison using ordinal sort rules, call the method with the `comparisonType` argument set to . +This method performs a case-sensitive comparison using ordinal sort rules. For more information about word, string, and ordinal sorts, see . To perform a case-insensitive comparison using ordinal sort rules, call the method with the `comparisonType` argument set to . -Because is a static method, `strA` and `strB` can be `null`. If both values are `null`, the method returns 0 (zero), which indicates that `strA` and `strB` are equal. If only one of the values is `null`, the method considers the non-null value to be greater. +Because is a static method, `strA` and `strB` can be `null`. If both values are `null`, the method returns 0 (zero), which indicates that `strA` and `strB` are equal. If only one of the values is `null`, the method considers the non-null value to be greater. ## Examples -This following example demonstrates that and use different sort orders. +This following example demonstrates that and use different sort orders. :::code language="csharp" source="~/snippets/csharp/System/String/CompareOrdinal/stringcompareordinal.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/CompareOrdinal/stringcompareordinal.fs" id="Snippet1"::: @@ -2452,7 +2452,7 @@ This following example demonstrates that method perform culture-sensitive and case-sensitive comparison. You cannot use this method to perform culture-insensitive or ordinal comparisons. For code clarity, we recommend that you avoid the method and call the method instead. +Both overloads of the method perform culture-sensitive and case-sensitive comparison. You cannot use this method to perform culture-insensitive or ordinal comparisons. For code clarity, we recommend that you avoid the method and call the method instead. ]]> @@ -2540,14 +2540,14 @@ Both overloads of the method perform culture-s `value` must be a object. > [!CAUTION] -> The method was designed primarily for use in sorting or alphabetizing operations. It should not be used when the primary purpose of the method call is to determine whether two strings are equivalent. To determine whether two strings are equivalent, call the method. +> The method was designed primarily for use in sorting or alphabetizing operations. It should not be used when the primary purpose of the method call is to determine whether two strings are equivalent. To determine whether two strings are equivalent, call the method. This method performs a word (case-sensitive and culture-sensitive) comparison using the current culture. For more information about word, string, and ordinal sorts, see . -For more information about the behavior of this method, see the Remarks section of the method. +For more information about the behavior of this method, see the Remarks section of the method. ## Examples -The following example uses the method with an . Because it attempts to compare a instance to a `TestClass` object, the method throws an . +The following example uses the method with an . Because it attempts to compare a instance to a `TestClass` object, the method throws an . :::code language="csharp" source="~/snippets/csharp/System/String/CompareTo/extostring.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/CompareTo/extostring.fs" id="Snippet1"::: @@ -2659,14 +2659,14 @@ To recognize ignorable characters in a string comparison, call the method. +The method concatenates each object in `values`; it does not add any delimiters. To specify a delimiter between each member of `values`, call the method. An string is used in place of any null element in `values`. If `values` is an empty `IEnumerable(Of String)`, the method returns . If `values` is `null`, the method throws an exception. - is a convenience method that lets you concatenate each element in an `IEnumerable(Of String)` collection without first converting the elements to a string array. It is particularly useful with Language-Integrated Query (LINQ) query expressions. The following example passes a `List(Of String)` object that contains either the uppercase or lowercase letters of the alphabet to a lambda expression that selects letters that are equal to or greater than a particular letter (which, in the example, is "M"). The `IEnumerable(Of String)` collection that is returned by the method is passed to the method to display the result as a single string. + is a convenience method that lets you concatenate each element in an `IEnumerable(Of String)` collection without first converting the elements to a string array. It is particularly useful with Language-Integrated Query (LINQ) query expressions. The following example passes a `List(Of String)` object that contains either the uppercase or lowercase letters of the alphabet to a lambda expression that selects letters that are equal to or greater than a particular letter (which, in the example, is "M"). The `IEnumerable(Of String)` collection that is returned by the method is passed to the method to display the result as a single string. :::code language="csharp" source="~/snippets/csharp/System/String/Concat/concat2.cs" id="Snippet3"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/Concat/concat2.fs" id="Snippet3"::: :::code language="vb" source="~/snippets/visualbasic/System/String/Concat/concat2.vb" id="Snippet3"::: ## Examples -The following example uses the Sieve of Eratosthenes algorithm to calculate the prime numbers that are less than or equal to 100. It assigns the result to a object of type , which it then passes to the method. +The following example uses the Sieve of Eratosthenes algorithm to calculate the prime numbers that are less than or equal to 100. It assigns the result to a object of type , which it then passes to the method. :::code language="csharp" source="~/snippets/csharp/System/String/Concat/concat1.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/Concat/concat1.fs" id="Snippet2"::: @@ -2864,7 +2864,7 @@ The following example uses the Sieve of Eratosthenes algorithm to calculate the The method represents `arg0` as a string by calling its parameterless `ToString` method. ## Examples -The following example demonstrates the method. +The following example demonstrates the method. :::code language="csharp" source="~/snippets/csharp/System/String/Concat/string.concat5.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/Concat/string.concat5.fs" id="Snippet1"::: @@ -2944,7 +2944,7 @@ The method concatenates each object in `args` by calling the parameterless `ToSt is used in place of any null object in the array. ## Examples -The following example demonstrates the use of the method with an array. +The following example demonstrates the use of the method with an array. :::code language="csharp" source="~/snippets/csharp/System/String/Concat/stringconcat1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/Concat/stringconcat1.fs" id="Snippet1"::: @@ -3132,7 +3132,7 @@ The method concatenates each object in `values`; it does not add any delimiters. An string is used in place of any null object in the array. ## Examples -The following example demonstrates the use of the method with a array. +The following example demonstrates the use of the method with a array. :::code language="csharp" source="~/snippets/csharp/System/String/Concat/stringconcat3.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/Concat/stringconcat3.fs" id="Snippet1"::: @@ -3207,7 +3207,7 @@ The method concatenates `arg0` and `arg1` by calling the parameterless `ToString If either of the arguments is an array reference, the method concatenates a string representing that array, instead of its members (for example, "System.String[]"). ## Examples -The following example demonstrates the method. +The following example demonstrates the method. :::code language="csharp" source="~/snippets/csharp/System/String/Concat/string.concat5.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/Concat/string.concat5.fs" id="Snippet1"::: @@ -3403,7 +3403,7 @@ The method concatenates `arg0`, `arg1`, and `arg2` by calling the parameterless is used in place of any null argument. ## Examples -The following example demonstrates the method. +The following example demonstrates the method. :::code language="csharp" source="~/snippets/csharp/System/String/Concat/string.concat5.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/Concat/string.concat5.fs" id="Snippet1"::: @@ -3529,7 +3529,7 @@ The following example demonstrates the method. The method concatenates `str0`, `str1`, and `str2`; it does not add any delimiters. ## Examples -The following example uses the method to concatenate three strings and displays the result. +The following example uses the method to concatenate three strings and displays the result. :::code language="csharp" source="~/snippets/csharp/System/String/Concat/Concat6.cs" id="Snippet6"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/Concat/Concat6.fs" id="Snippet6"::: @@ -3600,10 +3600,10 @@ The method concatenates each object in the parameter list by calling its paramet is used in place of any null argument. > [!NOTE] -> The last parameter of the method is an optional comma-delimited list of one or more additional objects to concatenate. +> The last parameter of the method is an optional comma-delimited list of one or more additional objects to concatenate. ## Examples -The following example illustrates the use of the method to concatenate a list of variable parameters. In this case, the method is called with nine parameters. +The following example illustrates the use of the method to concatenate a list of variable parameters. In this case, the method is called with nine parameters. :::code language="csharp" source="~/snippets/csharp/System/String/Concat/concat4.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/Concat/concat4.fs" id="Snippet1"::: @@ -3734,7 +3734,7 @@ The following example illustrates the use of the method to reassemble the scrambled words. +The following example defines an array of four-letter words and stores their individual letters to a string array in order to scramble them. It then calls the method to reassemble the scrambled words. :::code language="csharp" source="~/snippets/csharp/System/String/Concat/concat4.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/Concat/concat4.fs" id="Snippet1"::: @@ -3815,10 +3815,10 @@ The method concatenates each object in `values`; it does not add any delimiters. An string is used in place of any null argument. - is a convenience method that lets you concatenate each element in an collection without first converting the elements to strings. It is particularly useful with Language-Integrated Query (LINQ) query expressions, as the example illustrates. The string representation of each object in the collection is derived by calling that object's `ToString` method. + is a convenience method that lets you concatenate each element in an collection without first converting the elements to strings. It is particularly useful with Language-Integrated Query (LINQ) query expressions, as the example illustrates. The string representation of each object in the collection is derived by calling that object's `ToString` method. ## Examples -The following example defines a very simple `Animal` class that contains the name of an animal and the order to which it belongs. It then defines a object to contain a number of `Animal` objects. The extension method is called to extract the `Animal` objects whose `Order` property equals "Rodent". The result is passed to the method and displayed to the console. +The following example defines a very simple `Animal` class that contains the name of an animal and the order to which it belongs. It then defines a object to contain a number of `Animal` objects. The extension method is called to extract the `Animal` objects whose `Order` property equals "Rodent". The result is passed to the method and displayed to the console. :::code language="csharp" source="~/snippets/csharp/System/String/Concat/concat3.cs" id="Snippet4"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/Concat/concat3.fs" id="Snippet4"::: @@ -3949,7 +3949,7 @@ To perform a culture-sensitive or ordinal case-insensitive comparison: :::code language="vb" source="~/snippets/visualbasic/System/String/Contains/ContainsExt1.vb" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/String/Contains/ContainsExt1.vb" id="Snippet2"::: -If you are interested in the position of the substring `value` in the current instance, you can call the method to get the starting position of its first occurrence, or you can call the method to get the starting position of its last occurrence. The example includes a call to the method if a substring is found in a string instance. +If you are interested in the position of the substring `value` in the current instance, you can call the method to get the starting position of its first occurrence, or you can call the method to get the starting position of its last occurrence. The example includes a call to the method if a substring is found in a string instance. ## Examples The following example determines whether the string "fox" is a substring of a familiar quotation. If "fox" is found in the string, it also displays its starting position. @@ -4191,15 +4191,15 @@ Depending on *why* you want to call the `Copy` method, there are a number of alt :::code language="fsharp" source="~/snippets/fsharp/System/String/Copy/Program.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/api/system/string/copy/program.vb" id="Snippet1"::: - In this case, calling the `Copy` method to create a new string before calling the method unnecessarily creates a new string instance. + In this case, calling the `Copy` method to create a new string before calling the method unnecessarily creates a new string instance. -- If you want to create a mutable buffer with the same contents as the original string, call the or constructor. For example: +- If you want to create a mutable buffer with the same contents as the original string, call the or constructor. For example: :::code language="csharp" source="~/snippets/csharp/System/String/Copy/Program.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/Copy/Program.fs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/api/system/string/copy/program.vb" id="Snippet2"::: -- If you want to create a mutable copy of the string so that you can use unsafe code to modify the string contents, use method. The following example uses the method to get a pointer to the location of an copied string in unmanaged memory, increments the Unicode code point of each character in the string by one, and copies the resulting string back to a managed string. +- If you want to create a mutable copy of the string so that you can use unsafe code to modify the string contents, use method. The following example uses the method to get a pointer to the location of an copied string in unmanaged memory, increments the Unicode code point of each character in the string by one, and copies the resulting string back to a managed string. :::code language="csharp" source="~/snippets/csharp/System/String/Copy/Program.cs" id="Snippet3"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/Copy/Program.fs" id="Snippet3"::: @@ -4313,7 +4313,7 @@ This method copies `count` characters from the `sourceIndex` position of this in `sourceIndex` and `destinationIndex` are zero-based. ## Examples -The following example demonstrates the method. +The following example demonstrates the method. :::code language="csharp" source="~/snippets/csharp/System/String/CopyTo/stringcopyto.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/CopyTo/stringcopyto.fs" id="Snippet1"::: @@ -4573,7 +4573,7 @@ To support interop scenarios, the underlying buffer is guaranteed to be at least ## Remarks The value of this field is the zero-length string, "". -In application code, this field is most commonly used in assignments to initialize a string variable to an empty string. To test whether the value of a string is either `null` or , use the method. +In application code, this field is most commonly used in assignments to initialize a string variable to an empty string. To test whether the value of a string is either `null` or , use the method. ]]>
@@ -4847,7 +4847,7 @@ The following example defines a `StripEndTags` method that uses the method compares the `value` parameter to the substring at the end of this string and returns a value that indicates whether they are equal. To be equal, `value` must be a reference to this same string, must be the empty string (""), or must match the end of this string. The type of comparison performed by the method depends on the value of the `comparisonType` parameter. +The method compares the `value` parameter to the substring at the end of this string and returns a value that indicates whether they are equal. To be equal, `value` must be a reference to this same string, must be the empty string (""), or must match the end of this string. The type of comparison performed by the method depends on the value of the `comparisonType` parameter. ## Examples The following example determines whether a string ends with a particular substring. The results are affected by the choice of culture, whether case is ignored, and whether an ordinal comparison is performed. @@ -4963,7 +4963,7 @@ This method compares the `value` parameter to the substring at the end of this s This method performs a word (culture-sensitive) comparison using the specified casing and culture. ## Examples -The following example determines whether a string occurs at the end of another string. The method is called several times using case sensitivity, case insensitivity, and different cultures that influence the results of the search. +The following example determines whether a string occurs at the end of another string. The method is called several times using case sensitivity, case insensitivity, and different cultures that influence the results of the search. :::code language="csharp" source="~/snippets/csharp/System/String/EndsWith/ewci.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/EndsWith/ewci.fs" id="Snippet1"::: @@ -5102,7 +5102,7 @@ Invalid sequences are represented in the enumeration by method. +The following example demonstrates the method. :::code language="csharp" source="~/snippets/csharp/System/String/Equals/equals.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/Equals/equals.fs" id="Snippet1"::: @@ -5192,7 +5192,7 @@ The following example demonstrates the method. This method performs an ordinal (case-sensitive and culture-insensitive) comparison. ## Examples -The following example demonstrates the method. It compares the title-cased word "File" with an equivalent word, its lowercase equivalent, its uppercase equivalent, and a word that contains LATIN SMALL LETTER DOTLESS I (U+0131) instead of LATIN SMALL LETTER I (U+0069). Because the method performs an ordinal comparison, only the comparison with an identical word returns `true`. +The following example demonstrates the method. It compares the title-cased word "File" with an equivalent word, its lowercase equivalent, its uppercase equivalent, and a word that contains LATIN SMALL LETTER DOTLESS I (U+0131) instead of LATIN SMALL LETTER I (U+0069). Because the method performs an ordinal comparison, only the comparison with an identical word returns `true`. :::code language="csharp" source="~/snippets/csharp/System/String/Equals/equalsex1.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/Equals/equalsex1.fs" id="Snippet2"::: @@ -5267,7 +5267,7 @@ The following example demonstrates the method. It This method performs an ordinal (case-sensitive and culture-insensitive) comparison. ## Examples -The following example demonstrates the method. +The following example demonstrates the method. :::code language="csharp" source="~/snippets/csharp/System/String/Equals/equals.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/Equals/equals.fs" id="Snippet1"::: @@ -5348,7 +5348,7 @@ The following example demonstrates the method. The `comparisonType` parameter indicates whether the comparison should use the current or invariant culture, honor or ignore the case of the two strings being compared, or use word or ordinal sort rules. ## Examples -The following example creates a string array that consists of an uppercase "I", a lowercase "i", and a dotless "ı". It then calls the method to compare them by using each possible enumeration value. +The following example creates a string array that consists of an uppercase "I", a lowercase "i", and a dotless "ı". It then calls the method to compare them by using each possible enumeration value. :::code language="csharp" source="~/snippets/csharp/System/String/Equals/eqcmp.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/Equals/eqcmp.fs" id="Snippet1"::: @@ -5536,7 +5536,7 @@ This method uses the [composite formatting feature](/dotnet/standard/base-types/ ## Example: Formatting a single argument -The following example uses the method to embed an individual's age in the middle of a string. +The following example uses the method to embed an individual's age in the middle of a string. :::code language="csharp" source="~/snippets/csharp/System/FormatException/Overview/format7.cs" id="Snippet7"::: :::code language="fsharp" source="~/snippets/fsharp/System/FormatException/Overview/format7.fs" id="Snippet7"::: @@ -5923,7 +5923,7 @@ This method uses the [composite formatting feature](/dotnet/standard/base-types/ ### Example: Culture-sensitive formatting -This example uses the method to display the string representation of some date and time values and numeric values by using several different cultures. +This example uses the method to display the string representation of some date and time values and numeric values by using several different cultures. :::code language="csharp" source="~/snippets/csharp/System/String/Format/Example2.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/Format/Example2.fs" id="Snippet2"::: @@ -6228,7 +6228,7 @@ This method uses the [composite formatting feature](/dotnet/standard/base-types/ ## Example: Format two arguments -This example uses the method to display time and temperature data stored in a generic object. Note that the format string has three format items, although there are only two objects to format. This is because the first object in the list (a date and time value) is used by two format items: The first format item displays the time, and the second displays the date. +This example uses the method to display time and temperature data stored in a generic object. Note that the format string has three format items, although there are only two objects to format. This is because the first object in the list (a date and time value) is used by two format items: The first format item displays the time, and the second displays the date. :::code language="csharp" source="~/snippets/csharp/System/FormatException/Overview/formatexample4.cs" id="Snippet6"::: :::code language="fsharp" source="~/snippets/fsharp/System/FormatException/Overview/formatexample4.fs" id="Snippet6"::: @@ -6415,7 +6415,7 @@ This method uses the [composite formatting feature](/dotnet/standard/base-types/ ## Example: Format three arguments -This example uses the method to create a string that illustrates the result of a Boolean `And` operation with two integer values. Note that the format string includes six format items, but the method has only three items in its parameter list, because each item is formatted in two different ways. +This example uses the method to create a string that illustrates the result of a Boolean `And` operation with two integer values. Note that the format string includes six format items, but the method has only three items in its parameter list, because each item is formatted in two different ways. :::code language="csharp" source="~/snippets/csharp/System/FormatException/Overview/format4.cs" id="Snippet4"::: :::code language="fsharp" source="~/snippets/fsharp/System/FormatException/Overview/format4.fs" id="Snippet4"::: @@ -6777,12 +6777,12 @@ The index of a format item is less than zero, or greater than two. ## Remarks > [!TIP] -> Rather than calling the method to retrieve a object that you then use to enumerate a string, you should instead use your language's iteration construct. Examples include [foreach](/dotnet/csharp/language-reference/keywords/foreach-in) in C#, [for..in](/dotnet/fsharp/language-reference/loops-for-in-expression) in F#, and [For Each](/dotnet/visual-basic/language-reference/statements/for-each-next-statement) in Visual Basic). +> Rather than calling the method to retrieve a object that you then use to enumerate a string, you should instead use your language's iteration construct. Examples include [foreach](/dotnet/csharp/language-reference/keywords/foreach-in) in C#, [for..in](/dotnet/fsharp/language-reference/loops-for-in-expression) in F#, and [For Each](/dotnet/visual-basic/language-reference/statements/for-each-next-statement) in Visual Basic). This method enables you to iterate the individual characters in a string. For example, the Visual Basic `For Each`, the F# `for..in` expression, and C# `foreach` statements invoke this method to return a object that can provide read-only access to the characters in this string instance. ## Examples -The following example iterates the characters in several strings and displays information about their individual characters. It uses the language iteration construct rather than a call to the method. +The following example iterates the characters in several strings and displays information about their individual characters. It uses the language iteration construct rather than a call to the method. :::code language="csharp" source="~/snippets/csharp/System/String/GetEnumerator/getenumerator.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/GetEnumerator/getenumerator.fs" id="Snippet1"::: @@ -6853,10 +6853,10 @@ The following example iterates the characters in several strings and displays in is dependent on its implementation, which might change from one version of the common language runtime to another. A reason why this might happen is to improve the performance of . +The behavior of is dependent on its implementation, which might change from one version of the common language runtime to another. A reason why this might happen is to improve the performance of . > [!IMPORTANT] -> If two string objects are equal, the method returns identical values. However, there is not a unique hash code value for each unique string value. Different strings can return the same hash code. +> If two string objects are equal, the method returns identical values. However, there is not a unique hash code value for each unique string value. Different strings can return the same hash code. > > The hash code itself is not guaranteed to be stable. Hash codes for identical strings can differ across .NET implementations, across .NET versions, and across .NET platforms (such as 32-bit and 64-bit) for a single version of .NET. In some cases, they can even differ by application domain. This implies that two subsequent runs of the same program may return different hash codes. > @@ -6864,7 +6864,7 @@ The behavior of is dependent on its implemen > > Finally, don't use the hash code instead of a value returned by a cryptographic hashing function if you need a cryptographically strong hash. For cryptographic hashes, use a class derived from the or class. > -> For more information about hash codes, see . +> For more information about hash codes, see . In .NET Framework desktop apps, you can use the [\ element](/dotnet/framework/configure-apps/file-schema/runtime/userandomizedstringhashalgorithm-element) to generate unique hash codes on a per-application domain basis. This can reduce the number of collisions and improve the overall performance of insertions and lookups that use hash tables. The following example shows how to use the [\ element](/dotnet/framework/configure-apps/file-schema/runtime/userandomizedstringhashalgorithm-element). It defines a `DisplayString` class that includes a private string constant, `s`, whose value is "This is a string." It also includes a `ShowStringHashCode` method that displays the string value and its hash code along with the name of the application domain in which the method is executing. @@ -6900,10 +6900,10 @@ String 'This is a string.' in domain 'NewDomain': 75CC8236 > [!IMPORTANT] > Hash codes are used to insert and retrieve keyed objects from hash tables efficiently. However, hash codes don't uniquely identify strings. Identical strings have equal hash codes, but the common language runtime can also assign the same hash code to different strings. In addition, hash codes can vary by version of .NET, by platform within a single version, and by application domain. Because of this, you should not serialize or persist hash code values, nor should you use them as keys in a hash table or dictionary. -For additional information about the use of hash codes and the `GetHashCode` method, see . +For additional information about the use of hash codes and the `GetHashCode` method, see . ## Examples -The following example demonstrates the method using various input strings. +The following example demonstrates the method using various input strings. :::code language="csharp" source="~/snippets/csharp/System/String/GetHashCode/gethashcode.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/GetHashCode/gethashcode.fs" id="Snippet1"::: @@ -7233,10 +7233,10 @@ The following example displays the enumerated constant fo ## Remarks Index numbering starts from zero. -This method performs an ordinal (culture-insensitive) search, where a character is considered equivalent to another character only if their Unicode scalar values are the same. To perform a culture-sensitive search, use the method, where a Unicode scalar value representing a precomposed character, such as the ligature "Æ" (U+00C6), might be considered equivalent to any occurrence of the character's components in the correct sequence, such as "AE" (U+0041, U+0045), depending on the culture. +This method performs an ordinal (culture-insensitive) search, where a character is considered equivalent to another character only if their Unicode scalar values are the same. To perform a culture-sensitive search, use the method, where a Unicode scalar value representing a precomposed character, such as the ligature "Æ" (U+00C6), might be considered equivalent to any occurrence of the character's components in the correct sequence, such as "AE" (U+0041, U+0045), depending on the culture. ## Examples -The following example demonstrates how you can search a for a character using the method. +The following example demonstrates how you can search a for a character using the method. :::code language="csharp" source="~/snippets/csharp/System/String/IndexOf/indexof_c.cs" id="Snippet5"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/IndexOf/indexof_c.fs" id="Snippet5"::: @@ -7318,7 +7318,7 @@ The following example searches for the "n" in "animal". Because string indexes b :::code language="fsharp" source="~/snippets/fsharp/System/String/IndexOf/simple1.fs" id="Snippet12"::: :::code language="vb" source="~/snippets/visualbasic/System/String/IndexOf/simple1.vb" id="Snippet12"::: -The following example uses the method to determine the starting position of an animal name in a sentence. It then uses this position to insert an adjective that describes the animal into the sentence. +The following example uses the method to determine the starting position of an animal name in a sentence. It then uses this position to insert an adjective that describes the animal into the sentence. :::code language="csharp" source="~/snippets/csharp/System/String/IndexOf/stringinsert.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/IndexOf/stringinsert.fs" id="Snippet1"::: @@ -7432,10 +7432,10 @@ Index numbering starts from 0. The `startIndex` parameter can range from 0 to th The search ranges from `startIndex` to the end of the string. -This method performs an ordinal (culture-insensitive) search, where a character is considered equivalent to another character only if their Unicode scalar values are the same. To perform a culture-sensitive search, use the method, where a Unicode scalar value representing a precomposed character, such as the ligature "Æ" (U+00C6), might be considered equivalent to any occurrence of the character's components in the correct sequence, such as "AE" (U+0041, U+0045), depending on the culture. +This method performs an ordinal (culture-insensitive) search, where a character is considered equivalent to another character only if their Unicode scalar values are the same. To perform a culture-sensitive search, use the method, where a Unicode scalar value representing a precomposed character, such as the ligature "Æ" (U+00C6), might be considered equivalent to any occurrence of the character's components in the correct sequence, such as "AE" (U+0041, U+0045), depending on the culture. ## Examples -The following example demonstrates the method. +The following example demonstrates the method. :::code language="csharp" source="~/snippets/csharp/System/String/IndexOf/ixof1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/IndexOf/ixof1.fs" id="Snippet1"::: @@ -7563,7 +7563,7 @@ Index numbering starts from 0. The `startIndex` parameter can range from 0 to th This method performs a word (case-sensitive and culture-sensitive) search using the current culture. The search begins at the `startIndex` character position of this instance and continues until the last character position. -Character sets include ignorable characters, which are characters that are not considered when performing a linguistic or culture-sensitive comparison. In a culture-sensitive search, if `value` contains an ignorable character, the result is equivalent to searching with that character removed. If `value` consists only of one or more ignorable characters, the method always returns `startIndex`, which is the character position at which the search begins. In the following example, the method is used to find the position of a soft hyphen (U+00AD) followed by an "m" in two strings. Only one of the strings contains the required substring. If the example is run on the .NET Framework 4 or later, in both cases, because the soft hyphen is an ignorable character, the method returns the index of "m" in the string. Note that in the case of the first string, which includes the soft hyphen followed by an "m", the method fails to return the index of the soft hyphen but instead returns the index of the "m". +Character sets include ignorable characters, which are characters that are not considered when performing a linguistic or culture-sensitive comparison. In a culture-sensitive search, if `value` contains an ignorable character, the result is equivalent to searching with that character removed. If `value` consists only of one or more ignorable characters, the method always returns `startIndex`, which is the character position at which the search begins. In the following example, the method is used to find the position of a soft hyphen (U+00AD) followed by an "m" in two strings. Only one of the strings contains the required substring. If the example is run on the .NET Framework 4 or later, in both cases, because the soft hyphen is an ignorable character, the method returns the index of "m" in the string. Note that in the case of the first string, which includes the soft hyphen followed by an "m", the method fails to return the index of the soft hyphen but instead returns the index of the "m". :::code language="csharp" source="~/snippets/csharp/System/String/IndexOf/ignorable22.cs" id="Snippet22"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/IndexOf/ignorable22.fs" id="Snippet22"::: @@ -7659,7 +7659,7 @@ Index numbering starts from zero. The `comparisonType` parameter specifies to search for the `value` parameter using the current or invariant culture, using a case-sensitive or case-insensitive search, and using word or ordinal comparison rules. ## Examples -The following example demonstrates three overloads of the method that find the first occurrence of a string within another string using different values of the enumeration. +The following example demonstrates three overloads of the method that find the first occurrence of a string within another string using different values of the enumeration. :::code language="csharp" source="~/snippets/csharp/System/String/IndexOf/iocmp.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/IndexOf/iocmp.fs" id="Snippet1"::: @@ -7813,10 +7813,10 @@ The search begins at `startIndex` and continues to `startIndex` + `count` -1. Th Index numbering starts from 0 (zero). The `startIndex` parameter can range from 0 to the length of the string instance. -This method performs an ordinal (culture-insensitive) search, where a character is considered equivalent to another character only if their Unicode scalar values are the same. To perform a culture-sensitive search, use the method, where a Unicode scalar value representing a precomposed character, such as the ligature "Æ" (U+00C6), might be considered equivalent to any occurrence of the character's components in the correct sequence, such as "AE" (U+0041, U+0045), depending on the culture. +This method performs an ordinal (culture-insensitive) search, where a character is considered equivalent to another character only if their Unicode scalar values are the same. To perform a culture-sensitive search, use the method, where a Unicode scalar value representing a precomposed character, such as the ligature "Æ" (U+00C6), might be considered equivalent to any occurrence of the character's components in the correct sequence, such as "AE" (U+0041, U+0045), depending on the culture. ## Examples -The following example demonstrates the method. +The following example demonstrates the method. :::code language="csharp" source="~/snippets/csharp/System/String/IndexOf/indexofcii.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/IndexOf/indexofcii.fs" id="Snippet1"::: @@ -7935,7 +7935,7 @@ Index numbering starts from 0 (zero). The `startIndex` parameter can range from This method performs a word (case-sensitive and culture-sensitive) search using the current culture. The search begins at `startIndex` and continues to `startIndex` + `count` -1. The character at `startIndex` + `count` is not included in the search. -Character sets include ignorable characters, which are characters that are not considered when performing a linguistic or culture-sensitive comparison. In a culture-sensitive search, if `value` contains an ignorable character, the result is equivalent to searching with that character removed. If `value` consists only of one or more ignorable characters, the method always returns `startIndex`, which is the character position at which the search begins. In the following example, the method is used to find the position of a soft hyphen (U+00AD) followed by an "m" starting in the third through sixth character positions in two strings. Only one of the strings contains the required substring. If the example is run on the .NET Framework 4 or later, in both cases, because the soft hyphen is an ignorable character, the method returns the index of "m" in the string when it performs a culture-sensitive comparison. Note that in the case of the first string, which includes the soft hyphen followed by an "m", the method fails to return the index of the soft hyphen but instead returns the index of the "m". +Character sets include ignorable characters, which are characters that are not considered when performing a linguistic or culture-sensitive comparison. In a culture-sensitive search, if `value` contains an ignorable character, the result is equivalent to searching with that character removed. If `value` consists only of one or more ignorable characters, the method always returns `startIndex`, which is the character position at which the search begins. In the following example, the method is used to find the position of a soft hyphen (U+00AD) followed by an "m" starting in the third through sixth character positions in two strings. Only one of the strings contains the required substring. If the example is run on the .NET Framework 4 or later, in both cases, because the soft hyphen is an ignorable character, the method returns the index of "m" in the string when it performs a culture-sensitive comparison. Note that in the case of the first string, which includes the soft hyphen followed by an "m", the method fails to return the index of the soft hyphen but instead returns the index of the "m". :::code language="csharp" source="~/snippets/csharp/System/String/IndexOf/ignorable23.cs" id="Snippet23"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/IndexOf/ignorable23.fs" id="Snippet23"::: @@ -8037,7 +8037,7 @@ Index numbering starts from 0. The `startIndex` parameter can range from 0 to th The `comparisonType` parameter specifies to search for the `value` parameter using the current or invariant culture, using a case-sensitive or case-insensitive search, and using word or ordinal comparison rules. ## Examples -The following example demonstrates three overloads of the method that find the first occurrence of a string within another string using different values of the enumeration. +The following example demonstrates three overloads of the method that find the first occurrence of a string within another string using different values of the enumeration. :::code language="csharp" source="~/snippets/csharp/System/String/IndexOf/iocmp.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/IndexOf/iocmp.fs" id="Snippet1"::: @@ -8238,7 +8238,7 @@ The search begins at `startIndex` and continues to `startIndex` + `count` -1. Th The `comparisonType` parameter specifies to search for the `value` parameter using the current or invariant culture, using a case-sensitive or case-insensitive search, and using word or ordinal comparison rules. ## Examples -The following example demonstrates three overloads of the method that find the first occurrence of a string within another string using different values of the enumeration. +The following example demonstrates three overloads of the method that find the first occurrence of a string within another string using different values of the enumeration. :::code language="csharp" source="~/snippets/csharp/System/String/IndexOf/iocmp.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/IndexOf/iocmp.fs" id="Snippet1"::: @@ -8383,7 +8383,7 @@ Index numbering starts from zero. The search for `anyOf` is case-sensitive. If `anyOf` is an empty array, the method returns -1. -This method performs an ordinal (culture-insensitive) search, where a character is considered equivalent to another character only if their Unicode scalar values are the same. To perform a culture-sensitive search, use the method, where a Unicode scalar value representing a precomposed character, such as the ligature "Æ" (U+00C6), might be considered equivalent to any occurrence of the character's components in the correct sequence, such as "AE" (U+0041, U+0045), depending on the culture. +This method performs an ordinal (culture-insensitive) search, where a character is considered equivalent to another character only if their Unicode scalar values are the same. To perform a culture-sensitive search, use the method, where a Unicode scalar value representing a precomposed character, such as the ligature "Æ" (U+00C6), might be considered equivalent to any occurrence of the character's components in the correct sequence, such as "AE" (U+0041, U+0045), depending on the culture. ## Examples @@ -8467,7 +8467,7 @@ The search ranges from `startIndex` to the end of the string. The search for `anyOf` is case-sensitive. -This method performs an ordinal (culture-insensitive) search, where a character is considered equivalent to another character only if their Unicode scalar value are the same. To perform a culture-sensitive search, use the method, where a Unicode scalar value representing a precomposed character, such as the ligature "Æ" (U+00C6), might be considered equivalent to any occurrence of the character's components in the correct sequence, such as "AE" (U+0041, U+0045), depending on the culture. +This method performs an ordinal (culture-insensitive) search, where a character is considered equivalent to another character only if their Unicode scalar value are the same. To perform a culture-sensitive search, use the method, where a Unicode scalar value representing a precomposed character, such as the ligature "Æ" (U+00C6), might be considered equivalent to any occurrence of the character's components in the correct sequence, such as "AE" (U+0041, U+0045), depending on the culture. ## Examples The following example finds the index of the occurrence of any character of the string "is" within a substring of another string. @@ -8561,7 +8561,7 @@ Index numbering starts from zero. The `startIndex` parameter can range from 0 to The search for `anyOf` is case-sensitive. -This method performs an ordinal (culture-insensitive) search, where a character is considered equivalent to another character only if their Unicode scalar value are the same. To perform a culture-sensitive search, use the method, where a Unicode scalar value representing a precomposed character, such as the ligature "Æ" (U+00C6), might be considered equivalent to any occurrence of the character's components in the correct sequence, such as "AE" (U+0041, U+0045), depending on the culture. +This method performs an ordinal (culture-insensitive) search, where a character is considered equivalent to another character only if their Unicode scalar value are the same. To perform a culture-sensitive search, use the method, where a Unicode scalar value representing a precomposed character, such as the ligature "Æ" (U+00C6), might be considered equivalent to any occurrence of the character's components in the correct sequence, such as "AE" (U+0041, U+0045), depending on the culture. ## Examples The following example finds the index of the occurrence of any character of the string "aid" within a substring of another string. @@ -8661,7 +8661,7 @@ The following example inserts a space character in the fourth character position :::code language="fsharp" source="~/snippets/fsharp/System/String/Insert/Insert1.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/String/Insert/Insert1.vb" id="Snippet1"::: -The following console application prompts the users to enter one or more adjectives to describe two animals. It then calls the method to insert the text entered by the user into a string. +The following console application prompts the users to enter one or more adjectives to describe two animals. It then calls the method to insert the text entered by the user into a string. :::code language="csharp" source="~/snippets/csharp/System/String/IndexOf/stringinsert.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/IndexOf/stringinsert.fs" id="Snippet1"::: @@ -8813,13 +8813,13 @@ The following example uses three strings that are equal in value to determine wh you add programmatically by calling the method. +The common language runtime automatically maintains a table, called the intern pool, which contains a single instance of each unique literal string constant declared in a program, as well as any unique instance of you add programmatically by calling the method. The intern pool conserves string storage. If you assign a literal string constant to several variables, each variable is set to reference the same constant in the intern pool instead of referencing several different instances of that have identical values. This method looks up `str` in the intern pool. If `str` has already been interned, a reference to that instance is returned; otherwise, `null` is returned. -Compare this method to the method. +Compare this method to the method. This method does not return a Boolean value. If you call the method because you want a Boolean value that indicates whether a particular string is interned, you can use code such as the following. @@ -9125,16 +9125,16 @@ The following example examines three strings and determines whether each string is a convenience method that is similar to the following code, except that it offers superior performance: + is a convenience method that is similar to the following code, except that it offers superior performance: :::code language="csharp" source="~/snippets/csharp/System/String/IsNullOrWhiteSpace/isnullorwhitespace.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/IsNullOrWhiteSpace/isnullorwhitespace.fs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System/String/IsNullOrWhiteSpace/isnullorwhitespace.vb" id="Snippet2"::: -White-space characters are defined by the Unicode standard. The method interprets any character that returns a value of `true` when it is passed to the method as a white-space character. +White-space characters are defined by the Unicode standard. The method interprets any character that returns a value of `true` when it is passed to the method as a white-space character. ## Examples -The following example creates a string array, and then passes each element of the array to the method. +The following example creates a string array, and then passes each element of the array to the method. :::code language="csharp" source="~/snippets/csharp/System/String/IsNullOrWhiteSpace/isnullorwhitespace1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/IsNullOrWhiteSpace/isnullorwhitespace1.fs" id="Snippet1"::: @@ -9459,14 +9459,14 @@ The following example creates a string array, and then passes each element of th ## Remarks If `separator` is `null`, an empty string () is used instead. If any member of `values` is `null`, an empty string is used instead. - is a convenience method that lets you concatenate each element in an `IEnumerable(Of String)` collection without first converting the elements to a string array. It is particularly useful with Language-Integrated Query (LINQ) query expressions. The following example passes a `List(Of String)` object that contains either the uppercase or lowercase letters of the alphabet to a lambda expression that selects letters that are equal to or greater than a particular letter (which, in the example, is "M"). The `IEnumerable(Of String)` collection returned by the method is passed to the method to display the result as a single string. + is a convenience method that lets you concatenate each element in an `IEnumerable(Of String)` collection without first converting the elements to a string array. It is particularly useful with Language-Integrated Query (LINQ) query expressions. The following example passes a `List(Of String)` object that contains either the uppercase or lowercase letters of the alphabet to a lambda expression that selects letters that are equal to or greater than a particular letter (which, in the example, is "M"). The `IEnumerable(Of String)` collection returned by the method is passed to the method to display the result as a single string. :::code language="csharp" source="~/snippets/csharp/System/String/Join/join4.cs" id="Snippet4"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/Join/join4.fs" id="Snippet4"::: :::code language="vb" source="~/snippets/visualbasic/System/String/Join/join4.vb" id="Snippet4"::: ## Examples -The following example uses the Sieve of Eratosthenes algorithm to calculate the prime numbers that are less than or equal to 100. It assigns the result to a object of type , which it then passes to the method. +The following example uses the Sieve of Eratosthenes algorithm to calculate the prime numbers that are less than or equal to 100. It assigns the result to a object of type , which it then passes to the method. :::code language="csharp" source="~/snippets/csharp/System/String/Join/join3.cs" id="Snippet3"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/Join/join3.fs" id="Snippet3"::: @@ -9566,10 +9566,10 @@ The following example uses the Sieve of Eratosthenes algorithm to calculate the ## Remarks If `separator` is `null` or if any element of `values` other than the first element is `null`, an empty string () is used instead. See the Notes for Callers section if the first element of `values` is `null`. - is a convenience method that lets you concatenate each element in an object array without explicitly converting its elements to strings. The string representation of each object in the array is derived by calling that object's `ToString` method. + is a convenience method that lets you concatenate each element in an object array without explicitly converting its elements to strings. The string representation of each object in the array is derived by calling that object's `ToString` method. ## Examples -The following example uses the Sieve of Eratosthenes algorithm to calculate the prime numbers that are less than or equal to 100. It assigns the result to a integer array, which it then passes to the method. +The following example uses the Sieve of Eratosthenes algorithm to calculate the prime numbers that are less than or equal to 100. It assigns the result to a integer array, which it then passes to the method. :::code language="csharp" source="~/snippets/csharp/System/String/Join/join1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/Join/join1.fs" id="Snippet1"::: @@ -9790,7 +9790,7 @@ For example, if `separator` is ", " and the elements of `value` are "apple", "or If `separator` is `null`, an empty string () is used instead. If any element in `value` is `null`, an empty string is used instead. ## Examples -The following example demonstrates the method. +The following example demonstrates the method. :::code language="csharp" source="~/snippets/csharp/System/String/Join/stringjoin.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/Join/stringjoin.fs" id="Snippet1"::: @@ -10122,16 +10122,16 @@ The following example concatenates two elements from an array of names of fruit. ## Remarks If `separator` is `null`, an empty string () is used instead. If any member of `values` is `null`, an empty string is used instead. - is a convenience method that lets you concatenate each member of an collection without first converting them to strings. The string representation of each object in the collection is derived by calling that object's `ToString` method. + is a convenience method that lets you concatenate each member of an collection without first converting them to strings. The string representation of each object in the collection is derived by calling that object's `ToString` method. -This method is particular useful with Language-Integrated Query (LINQ) query expressions. For example, the following code defines a very simple `Animal` class that contains the name of an animal and the order to which it belongs. It then defines a object that contains a number of `Animal` objects. The extension method is called to extract the `Animal` objects whose `Order` property equals "Rodent". The result is passed to the method. +This method is particular useful with Language-Integrated Query (LINQ) query expressions. For example, the following code defines a very simple `Animal` class that contains the name of an animal and the order to which it belongs. It then defines a object that contains a number of `Animal` objects. The extension method is called to extract the `Animal` objects whose `Order` property equals "Rodent". The result is passed to the method. :::code language="csharp" source="~/snippets/csharp/System/String/Join/join5.cs" id="Snippet5"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/Join/join5.fs" id="Snippet5"::: :::code language="vb" source="~/snippets/visualbasic/System/String/Join/join5.vb" id="Snippet5"::: ## Examples -The following example uses the Sieve of Eratosthenes algorithm to calculate the prime numbers that are less than or equal to 100. It assigns the result to a object of type integer, which it then passes to the method. +The following example uses the Sieve of Eratosthenes algorithm to calculate the prime numbers that are less than or equal to 100. It assigns the result to a object of type integer, which it then passes to the method. :::code language="csharp" source="~/snippets/csharp/System/String/Join/join6.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/Join/join6.fs" id="Snippet2"::: @@ -10215,11 +10215,11 @@ The following example uses the Sieve of Eratosthenes algorithm to calculate the - 1. +Index numbering starts from zero. That is, the first character in the string is at index zero and the last is at - 1. This method begins searching at the last character position of this instance and proceeds backward toward the beginning until either `value` is found or the first character position has been examined. The search is case-sensitive. -This method performs an ordinal (culture-insensitive) search, where a character is considered equivalent to another character only if their Unicode scalar values are the same. To perform a culture-sensitive search, use the method, where a Unicode scalar value representing a precomposed character, such as the ligature "Æ" (U+00C6), might be considered equivalent to any occurrence of the character's components in the correct sequence, such as "AE" (U+0041, U+0045), depending on the culture. +This method performs an ordinal (culture-insensitive) search, where a character is considered equivalent to another character only if their Unicode scalar values are the same. To perform a culture-sensitive search, use the method, where a Unicode scalar value representing a precomposed character, such as the ligature "Æ" (U+00C6), might be considered equivalent to any occurrence of the character's components in the correct sequence, such as "AE" (U+0041, U+0045), depending on the culture. ## Examples The following example defines an `ExtractFilename` method that uses the method to find the last directory separator character in a string and to extract the string's file name. If the file exists, the method returns the file name without its path. @@ -10294,7 +10294,7 @@ The following example defines an `ExtractFilename` method that uses the - 1. +Index numbering starts from zero. That is, the first character in the string is at index zero and the last is at - 1. The search begins at the last character position of this instance and proceeds backward toward the beginning until either `value` is found or the first character position has been examined. @@ -10302,14 +10302,14 @@ This method performs a word (case-sensitive and culture-sensitive) search using Character sets include ignorable characters, which are characters that are not considered when performing a linguistic or culture-sensitive comparison. In a culture-sensitive search, if `value` contains an ignorable character, the result is equivalent to searching with that character removed. -In the following example, the method is used to find two substrings (a soft hyphen followed by "n" and a soft hyphen followed by "m") in two strings. Only one of the strings contains a soft hyphen. If the example is run on .NET Framework 4 or later, in each case, because the soft hyphen is an ignorable character, the result is the same as if the soft hyphen had not been included in `value`. +In the following example, the method is used to find two substrings (a soft hyphen followed by "n" and a soft hyphen followed by "m") in two strings. Only one of the strings contains a soft hyphen. If the example is run on .NET Framework 4 or later, in each case, because the soft hyphen is an ignorable character, the result is the same as if the soft hyphen had not been included in `value`. :::code language="csharp" source="~/snippets/csharp/System/String/LastIndexOf/lastindexof21.cs" id="Snippet21"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/LastIndexOf/lastindexof21.fs" id="Snippet21"::: :::code language="vb" source="~/snippets/visualbasic/System/String/LastIndexOf/lastindexof21.vb" id="Snippet21"::: ## Examples -The following example removes opening and closing HTML tags from a string if the tags begin and end the string. If a string ends with a closing bracket character (">"), the example uses the method to locate the start of the end tag. +The following example removes opening and closing HTML tags from a string if the tags begin and end the string. If a string ends with a closing bracket character (">"), the example uses the method to locate the start of the end tag. :::code language="csharp" source="~/snippets/csharp/System/String/LastIndexOf/lastindexof_example2.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/LastIndexOf/lastindexof_example2.fs" id="Snippet2"::: @@ -10412,9 +10412,9 @@ The following example removes opening and closing HTML tags from a string if the - 1. This method begins searching at the `startIndex` character position of this instance and proceeds backward toward the beginning of the current instance until either `value` is found or the first character position has been examined. For example, if `startIndex` is - 1, the method searches every character from the last character in the string to the beginning. The search is case-sensitive. +Index numbering starts from zero. That is, the first character in the string is at index zero and the last is at - 1. This method begins searching at the `startIndex` character position of this instance and proceeds backward toward the beginning of the current instance until either `value` is found or the first character position has been examined. For example, if `startIndex` is - 1, the method searches every character from the last character in the string to the beginning. The search is case-sensitive. -This method performs an ordinal (culture-insensitive) search, where a character is considered equivalent to another character only if their Unicode scalar values are the same. To perform a culture-sensitive search, use the method, where a Unicode scalar value representing a precomposed character, such as the ligature "Æ" (U+00C6), might be considered equivalent to any occurrence of the character's components in the correct sequence, such as "AE" (U+0041, U+0045), depending on the culture. +This method performs an ordinal (culture-insensitive) search, where a character is considered equivalent to another character only if their Unicode scalar values are the same. To perform a culture-sensitive search, use the method, where a Unicode scalar value representing a precomposed character, such as the ligature "Æ" (U+00C6), might be considered equivalent to any occurrence of the character's components in the correct sequence, such as "AE" (U+0041, U+0045), depending on the culture. ## Examples The following example finds the index of all occurrences of a character in a string, working from the end of the string to the start of the string. @@ -10519,13 +10519,13 @@ The following example finds the index of all occurrences of a character in a str - 1. +Index numbering starts from zero. That is, the first character in the string is at index zero and the last is at - 1. -The search begins at the `startIndex` character position of this instance and proceeds backward toward the beginning until either `value` is found or the first character position has been examined. For example, if `startIndex` is - 1, the method searches every character from the last character in the string to the beginning. +The search begins at the `startIndex` character position of this instance and proceeds backward toward the beginning until either `value` is found or the first character position has been examined. For example, if `startIndex` is - 1, the method searches every character from the last character in the string to the beginning. This method performs a word (case-sensitive and culture-sensitive) search using the current culture. -Character sets include ignorable characters, which are characters that are not considered when performing a linguistic or culture-sensitive comparison. In a culture-sensitive search, if `value` contains an ignorable character, the result is equivalent to searching with that character removed. In the following example, the method is used to find a substring that includes a soft hyphen (U+00AD) and that precedes or includes the final "m" in a string. If the example is run on .NET Framework 4 or later, because the soft hyphen in the search string is ignored, calling the method to find a substring that consists of the soft hyphen and "m" returns the position of the "m" in the string, whereas calling it to find a substring that consists of the soft hyphen and "n" returns the position of the "n". +Character sets include ignorable characters, which are characters that are not considered when performing a linguistic or culture-sensitive comparison. In a culture-sensitive search, if `value` contains an ignorable character, the result is equivalent to searching with that character removed. In the following example, the method is used to find a substring that includes a soft hyphen (U+00AD) and that precedes or includes the final "m" in a string. If the example is run on .NET Framework 4 or later, because the soft hyphen in the search string is ignored, calling the method to find a substring that consists of the soft hyphen and "m" returns the position of the "m" in the string, whereas calling it to find a substring that consists of the soft hyphen and "n" returns the position of the "n". :::code language="csharp" source="~/snippets/csharp/System/String/LastIndexOf/lastindexof22.cs" id="Snippet22"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/LastIndexOf/lastindexof22.fs" id="Snippet22"::: @@ -10619,7 +10619,7 @@ The current instance equals , and - 1. +Index numbering starts from zero. That is, the first character in the string is at index zero and the last is at - 1. The `comparisonType` parameter specifies to search for the `value` parameter using: @@ -10630,7 +10630,7 @@ The `comparisonType` parameter specifies to search for the `value` parameter usi The search begins at the last character position of this instance and proceeds backward toward the beginning until either `value` is found or the first character position has been examined. ## Examples -The following example demonstrates three overloads of the method that find the last occurrence of a string within another string using different values of the enumeration. +The following example demonstrates three overloads of the method that find the last occurrence of a string within another string using different values of the enumeration. :::code language="csharp" source="~/snippets/csharp/System/String/LastIndexOf/liocmp.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/LastIndexOf/liocmp.fs" id="Snippet1"::: @@ -10780,11 +10780,11 @@ In the following example, the - 1. +Index numbering starts from zero. That is, the first character in the string is at index zero and the last is at - 1. -This method begins searching at the `startIndex` character position and proceeds backward toward the beginning of this instance until either `value` is found or `count` character positions have been examined. For example, if `startIndex` is - 1, the method searches backward `count` characters from the last character in the string. The search is case-sensitive. +This method begins searching at the `startIndex` character position and proceeds backward toward the beginning of this instance until either `value` is found or `count` character positions have been examined. For example, if `startIndex` is - 1, the method searches backward `count` characters from the last character in the string. The search is case-sensitive. -This method performs an ordinal (culture-insensitive) search, where a character is considered equivalent to another character only if their Unicode scalar value are the same. To perform a culture-sensitive search, use the method, where a Unicode scalar value representing a precomposed character, such as the ligature "Æ" (U+00C6), might be considered equivalent to any occurrence of the character's components in the correct sequence, such as "AE" (U+0041, U+0045), depending on the culture. +This method performs an ordinal (culture-insensitive) search, where a character is considered equivalent to another character only if their Unicode scalar value are the same. To perform a culture-sensitive search, use the method, where a Unicode scalar value representing a precomposed character, such as the ligature "Æ" (U+00C6), might be considered equivalent to any occurrence of the character's components in the correct sequence, such as "AE" (U+0041, U+0045), depending on the culture. ## Examples The following example finds the index of all occurrences of a character in a substring, working from the end of the substring to the start of the substring. @@ -10897,15 +10897,15 @@ The current instance does not equal , and

- 1. +Index numbering starts from zero. That is, the first character in the string is at index zero and the last is at - 1. -The search begins at the `startIndex` character position of this instance and proceeds backward toward the beginning until either `value` is found or `count` character positions have been examined. For example, if `startIndex` is - 1, the method searches backward `count` characters from the last character in the string. +The search begins at the `startIndex` character position of this instance and proceeds backward toward the beginning until either `value` is found or `count` character positions have been examined. For example, if `startIndex` is - 1, the method searches backward `count` characters from the last character in the string. This method performs a word (case-sensitive and culture-sensitive) search using the current culture. Character sets include ignorable characters, which are characters that are not considered when performing a linguistic or culture-sensitive comparison. In a culture-sensitive search, if `value` contains an ignorable character, the result is equivalent to searching with that character removed. -In the following example, the method is used to find the position of a soft hyphen (U+00AD) followed by an "m" or "n" in two strings. Only one of the strings contains a soft hyphen. In the case of the string that includes the soft hyphen followed by an "m", `LastIndexOf` returns the index of the "m" when searching for the soft hyphen followed by "m". +In the following example, the method is used to find the position of a soft hyphen (U+00AD) followed by an "m" or "n" in two strings. Only one of the strings contains a soft hyphen. In the case of the string that includes the soft hyphen followed by an "m", `LastIndexOf` returns the index of the "m" when searching for the soft hyphen followed by "m". :::code language="csharp" source="~/snippets/csharp/System/String/LastIndexOf/lastindexof23.cs" id="Snippet23"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/LastIndexOf/lastindexof23.fs" id="Snippet23"::: @@ -11007,14 +11007,14 @@ The current instance equals and - 1. +Index numbering starts from zero. That is, the first character in the string is at index zero and the last is at - 1. -The search begins at the `startIndex` character position and proceeds backward until either `value` is found or the first character position has been examined. For example, if `startIndex` is - 1, the method searches every character from the last character in the string to the beginning. +The search begins at the `startIndex` character position and proceeds backward until either `value` is found or the first character position has been examined. For example, if `startIndex` is - 1, the method searches every character from the last character in the string to the beginning. The `comparisonType` parameter specifies to search for the `value` parameter using the current or invariant culture, using a case-sensitive or case-insensitive search, and using word or ordinal comparison rules. ## Examples -The following example demonstrates three overloads of the method that find the last occurrence of a string within another string using different values of the enumeration. +The following example demonstrates three overloads of the method that find the last occurrence of a string within another string using different values of the enumeration. :::code language="csharp" source="~/snippets/csharp/System/String/LastIndexOf/liocmp.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/LastIndexOf/liocmp.fs" id="Snippet1"::: @@ -11211,9 +11211,9 @@ In the following example, the - 1. +Index numbering starts from zero. That is, the first character in the string is at index zero and the last is at - 1. -The search begins at the `startIndex` character position and proceeds backward until either `value` is found or `count` character positions have been examined. For example, if `startIndex` is - 1, the method searches backward `count` characters from the last character in the string. +The search begins at the `startIndex` character position and proceeds backward until either `value` is found or `count` character positions have been examined. For example, if `startIndex` is - 1, the method searches backward `count` characters from the last character in the string. The `comparisonType` parameter specifies to search for the `value` parameter using: @@ -11222,7 +11222,7 @@ The `comparisonType` parameter specifies to search for the `value` parameter usi - Word or ordinal comparison rules. ## Examples -The following example demonstrates three overloads of the method that find the last occurrence of a string within another string using different values of the enumeration. +The following example demonstrates three overloads of the method that find the last occurrence of a string within another string using different values of the enumeration. :::code language="csharp" source="~/snippets/csharp/System/String/LastIndexOf/liocmp.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/LastIndexOf/liocmp.fs" id="Snippet1"::: @@ -11372,7 +11372,7 @@ Index numbering starts from zero. This method begins searching at the last character position of this instance and proceeds backward toward the beginning until either a character in `anyOf` is found or the first character position has been examined. The search is case-sensitive. -This method performs an ordinal (culture-insensitive) search, where a character is considered equivalent to another character only if their Unicode scalar values are the same. To perform a culture-sensitive search, use the method, where a Unicode scalar value representing a precomposed character, such as the ligature "Æ" (U+00C6), might be considered equivalent to any occurrence of the character's components in the correct sequence, such as "AE" (U+0041, U+0045), depending on the culture. +This method performs an ordinal (culture-insensitive) search, where a character is considered equivalent to another character only if their Unicode scalar values are the same. To perform a culture-sensitive search, use the method, where a Unicode scalar value representing a precomposed character, such as the ligature "Æ" (U+00C6), might be considered equivalent to any occurrence of the character's components in the correct sequence, such as "AE" (U+0041, U+0045), depending on the culture. ## Examples The following example finds the index of the last occurrence of any character in the string "is" within another string. @@ -11450,7 +11450,7 @@ Index numbering starts from zero. This method begins searching at the `startIndex` character position of this instance and proceeds backward toward the beginning until either a character in `anyOf` is found or the first character position has been examined. The search is case-sensitive. -This method performs an ordinal (culture-insensitive) search, where a character is considered equivalent to another character only if their Unicode scalar values are the same. To perform a culture-sensitive search, use the method, where a Unicode scalar value representing a precomposed character, such as the ligature "Æ" (U+00C6), might be considered equivalent to any occurrence of the character's components in the correct sequence, such as "AE" (U+0041, U+0045), depending on the culture. +This method performs an ordinal (culture-insensitive) search, where a character is considered equivalent to another character only if their Unicode scalar values are the same. To perform a culture-sensitive search, use the method, where a Unicode scalar value representing a precomposed character, such as the ligature "Æ" (U+00C6), might be considered equivalent to any occurrence of the character's components in the correct sequence, such as "AE" (U+0041, U+0045), depending on the culture. ## Examples The following example finds the index of the last occurrence of any character in the string "is" within a substring of another string. @@ -11537,7 +11537,7 @@ Index numbering starts from zero. This method begins searching at the `startIndex` character position of this instance and proceeds backward toward the beginning until either a character in `anyOf` is found or `count` character positions have been examined. The search is case-sensitive. -This method performs an ordinal (culture-insensitive) search, where a character is considered equivalent to another character only if their Unicode scalar values are the same. To perform a culture-sensitive search, use the method, where a Unicode scalar value representing a precomposed character, such as the ligature "Æ" (U+00C6), might be considered equivalent to any occurrence of the character's components in the correct sequence, such as "AE" (U+0041, U+0045), depending on the culture. +This method performs an ordinal (culture-insensitive) search, where a character is considered equivalent to another character only if their Unicode scalar values are the same. To perform a culture-sensitive search, use the method, where a Unicode scalar value representing a precomposed character, such as the ligature "Æ" (U+00C6), might be considered equivalent to any occurrence of the character's components in the correct sequence, such as "AE" (U+0041, U+0045), depending on the culture. ## Examples The following example finds the index of the last occurrence of any character in the string "aid" within a substring of another string. @@ -11719,7 +11719,7 @@ To normalize and compare two strings, do the following: 2. Call the method to normalize the strings to normalization form C. -3. To compare two strings, call a method that supports ordinal string comparison, such as the method, and supply a value of or as the argument. To sort an array of normalized strings, pass a `comparer` value of or to an appropriate overload of . +3. To compare two strings, call a method that supports ordinal string comparison, such as the method, and supply a value of or as the argument. To sort an array of normalized strings, pass a `comparer` value of or to an appropriate overload of . 4. Emit the strings in the sorted output based on the order indicated by the previous step. @@ -11796,7 +11796,7 @@ To normalize and compare two strings, do the following: 2. Call the method to normalize the strings to a specified normalization form. -3. To compare two strings, call a method that supports ordinal string comparison, such as the method, and supply a value of or as the argument. To sort an array of normalized strings, pass a `comparer` value of or to an appropriate overload of . +3. To compare two strings, call a method that supports ordinal string comparison, such as the method, and supply a value of or as the argument. To sort an array of normalized strings, pass a `comparer` value of or to an appropriate overload of . 4. Emit the strings in the sorted output based on the order indicated by the previous step. @@ -11872,10 +11872,10 @@ For a description of supported Unicode normalization forms, see method defines the operation of the equality operator for the class. It enables code such as that shown in the Example section. The operator, in turn, calls the static method, which performs an ordinal (case-sensitive and culture-insensitive) comparison. +The method defines the operation of the equality operator for the class. It enables code such as that shown in the Example section. The operator, in turn, calls the static method, which performs an ordinal (case-sensitive and culture-insensitive) comparison. > [!NOTE] -> The Visual Basic compiler does not resolve the equality operator as a call to the method. Instead, the equality operator wraps a call to the method. +> The Visual Basic compiler does not resolve the equality operator as a call to the method. Instead, the equality operator wraps a call to the method. ## Examples The following example demonstrates the equality operator. @@ -11996,12 +11996,12 @@ The following example demonstrates the equality operator. method defines the operation of the inequality operator for the class. It enables code such as that shown in the Examples section. +The method defines the operation of the inequality operator for the class. It enables code such as that shown in the Examples section. -The operator in turn calls the static method, which performs an ordinal (case-sensitive and culture-insensitive) comparison. +The operator in turn calls the static method, which performs an ordinal (case-sensitive and culture-insensitive) comparison. > [!NOTE] -> The Visual Basic compiler does not resolve the inequality operator as a call to the method. Instead, the inequality operator wraps a call to the method. +> The Visual Basic compiler does not resolve the inequality operator as a call to the method. Instead, the inequality operator wraps a call to the method. ## Examples The following example demonstrates the inequality operator. @@ -12082,10 +12082,10 @@ A Unicode space is defined as hexadecimal 0x0020. The method pads the beginning of the returned string. This means that, when used with right-to-left languages, it pads the right portion of the string. > [!NOTE] -> If the method pads the current instance with white-space characters, this method does not modify the value of the current instance. Instead, it returns a new string that is padded with leading white space so that its total length is `totalWidth` characters. +> If the method pads the current instance with white-space characters, this method does not modify the value of the current instance. Instead, it returns a new string that is padded with leading white space so that its total length is `totalWidth` characters. ## Examples -The following example demonstrates the method. +The following example demonstrates the method. :::code language="csharp" source="~/snippets/csharp/System/String/PadLeft/source.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/PadLeft/source.fs" id="Snippet1"::: @@ -12153,13 +12153,13 @@ The following example demonstrates the method. method pads the beginning of the returned string. This means that, when used with right-to-left languages, it pads the right portion of the string. +The method pads the beginning of the returned string. This means that, when used with right-to-left languages, it pads the right portion of the string. > [!NOTE] -> If the method pads the current instance with white-space characters, this method does not modify the value of the current instance. Instead, it returns a new string that is padded with leading `paddingChar` characters so that its total length is `totalWidth` characters. +> If the method pads the current instance with white-space characters, this method does not modify the value of the current instance. Instead, it returns a new string that is padded with leading `paddingChar` characters so that its total length is `totalWidth` characters. ## Examples -The following example demonstrates the method. +The following example demonstrates the method. :::code language="csharp" source="~/snippets/csharp/System/String/PadLeft/source1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/PadLeft/source1.fs" id="Snippet1"::: @@ -12244,10 +12244,10 @@ A Unicode space is defined as hexadecimal 0x0020. The method pads the end of the returned string. This means that, when used with right-to-left languages, it pads the left portion of the string. > [!NOTE] -> If the method pads the current instance with white-space characters, this method does not modify the value of the current instance. Instead, it returns a new string that is padded with trailing white space so that its total length is `totalWidth` characters. +> If the method pads the current instance with white-space characters, this method does not modify the value of the current instance. Instead, it returns a new string that is padded with trailing white space so that its total length is `totalWidth` characters. ## Examples -The following example demonstrates the method. +The following example demonstrates the method. :::code language="csharp" source="~/snippets/csharp/System/String/PadRight/source.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/PadRight/source.fs" id="Snippet1"::: @@ -12315,13 +12315,13 @@ The following example demonstrates the method. method pads the end of the returned string. This means that, when used with right-to-left languages, it pads the left portion of the string. +The method pads the end of the returned string. This means that, when used with right-to-left languages, it pads the left portion of the string. > [!NOTE] -> If the method pads the current instance with white-space characters, this method does not modify the value of the current instance. Instead, it returns a new string that is padded with trailing `paddingChar` characters so that its total length is `totalWidth` characters. +> If the method pads the current instance with white-space characters, this method does not modify the value of the current instance. Instead, it returns a new string that is padded with trailing `paddingChar` characters so that its total length is `totalWidth` characters. ## Examples -The following example demonstrates the method. +The following example demonstrates the method. :::code language="csharp" source="~/snippets/csharp/System/String/PadRight/source1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/PadRight/source1.fs" id="Snippet1"::: @@ -12406,7 +12406,7 @@ In the .NET Framework, strings are zero-based. The value of the `startIndex` par > This method does not modify the value of the current instance. Instead, it returns a new string in which all characters from position `startIndex` to the end of the original string have been removed. ## Examples -The following example demonstrates the method. The next-to-last case removes all text starting from the specified index through the end of the string. The last case removes three characters starting from the specified index. +The following example demonstrates the method. The next-to-last case removes all text starting from the specified index through the end of the string. The last case removes three characters starting from the specified index. :::code language="csharp" source="~/snippets/csharp/System/String/Remove/r.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/Remove/r.fs" id="Snippet1"::: @@ -12595,7 +12595,7 @@ This method performs an ordinal (case-sensitive and culture-insensitive) search > [!NOTE] > This method does not modify the value of the current instance. Instead, it returns a new string in which all occurrences of `oldChar` are replaced by `newChar`. -Because this method returns the modified string, you can chain together successive calls to the method to perform multiple replacements on the original string. Method calls are executed from left to right. The following example provides an illustration. +Because this method returns the modified string, you can chain together successive calls to the method to perform multiple replacements on the original string. Method calls are executed from left to right. The following example provides an illustration. :::code language="csharp" source="~/snippets/csharp/System/String/Replace/replace2.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/Replace/replace2.fs" id="Snippet2"::: @@ -12698,14 +12698,14 @@ If `newValue` is `null`, all occurrences of `oldValue` are removed. This method performs an ordinal (case-sensitive and culture-insensitive) search to find `oldValue`. -Because this method returns the modified string, you can chain together successive calls to the method to perform multiple replacements on the original string. Method calls are executed from left to right. The following example provides an illustration. +Because this method returns the modified string, you can chain together successive calls to the method to perform multiple replacements on the original string. Method calls are executed from left to right. The following example provides an illustration. :::code language="csharp" source="~/snippets/csharp/System/String/Replace/replace1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/Replace/replace1.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/String/Replace/replace1.vb" id="Snippet1"::: ## Examples -The following example demonstrates how you can use the method to correct a spelling error. +The following example demonstrates how you can use the method to correct a spelling error. :::code language="csharp" source="~/snippets/csharp/System/String/Replace/stringreplace.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/Replace/stringreplace.fs" id="Snippet1"::: @@ -12820,7 +12820,7 @@ If `newValue` is `null`, all occurrences of `oldValue` are removed. This method performs a search to find `oldValue` using the culture and case sensitivity described by `comparisonType`. -Because this method returns the modified string, you can chain together successive calls to the method to perform multiple replacements on the original string. Method calls are executed from left to right. The following example provides an illustration. +Because this method returns the modified string, you can chain together successive calls to the method to perform multiple replacements on the original string. Method calls are executed from left to right. The following example provides an illustration. :::code language="csharp" source="~/snippets/csharp/System/String/Replace/replace1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/Replace/replace1.fs" id="Snippet1"::: @@ -12905,7 +12905,7 @@ If `newValue` is `null`, all occurrences of `oldValue` are removed. This method performs a search to find `oldValue` using the provided `culture` and `ignoreCase` case sensitivity. -Because this method returns the modified string, you can chain together successive calls to the method to perform multiple replacements on the original string. Method calls are executed from left to right. The following example provides an illustration. +Because this method returns the modified string, you can chain together successive calls to the method to perform multiple replacements on the original string. Method calls are executed from left to right. The following example provides an illustration. :::code language="csharp" source="~/snippets/csharp/System/String/Replace/replace1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/Replace/replace1.fs" id="Snippet1"::: @@ -13031,12 +13031,12 @@ This method is guaranteed O(n * r) complexity, where n is the length of ## Remarks - is used to break a delimited string into substrings. You can use either a character array or a string array to specify zero or more delimiting characters or strings. If no delimiting characters are specified, the string is split at white-space characters. + is used to break a delimited string into substrings. You can use either a character array or a string array to specify zero or more delimiting characters or strings. If no delimiting characters are specified, the string is split at white-space characters. -Overloads of the method allow you to limit the number of substrings returned by the method (the method), to specify whether to include empty strings and/or trim substrings in the result (the and methods), or to do both (the and methods). +Overloads of the method allow you to limit the number of substrings returned by the method (the method), to specify whether to include empty strings and/or trim substrings in the result (the and methods), or to do both (the and methods). > [!TIP] -> The method is not always the best way to break a delimited string into substrings. If you don't want to extract all of the substrings of a delimited string, or if you want to parse a string based on a pattern instead of a set of delimiter characters, consider using regular expressions, or combine one of the search methods that returns the index of a character with the method. For more information, see [Extract substrings from a string](/dotnet/standard/base-types/divide-up-strings). +> The method is not always the best way to break a delimited string into substrings. If you don't want to extract all of the substrings of a delimited string, or if you want to parse a string based on a pattern instead of a set of delimiter characters, consider using regular expressions, or combine one of the search methods that returns the index of a character with the method. For more information, see [Extract substrings from a string](/dotnet/standard/base-types/divide-up-strings). ## Example @@ -13157,17 +13157,17 @@ The following table shows some examples. Each element of separator defines a separate delimiter that consists of a single character. -If the `separator` argument is `null` or contains no characters, the method treats white-space characters as the delimiters. White-space characters are defined by the Unicode standard, and the method returns `true` if a white-space character is passed to it. +If the `separator` argument is `null` or contains no characters, the method treats white-space characters as the delimiters. White-space characters are defined by the Unicode standard, and the method returns `true` if a white-space character is passed to it. ### String.Split(Char[]) and compiler overload resolution -Although the single parameter for this overload of is a character array, you can call it with a single character, as the following example shows. +Although the single parameter for this overload of is a character array, you can call it with a single character, as the following example shows. :::code language="csharp" source="~/snippets/csharp/System/String/Split/compiler-resolution.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/Split/compiler-resolution.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/system/string.split/compiler-resolution.vb" id="Snippet12"::: -Because the `separator` parameter is decorated with the attribute, compilers will interpret a single character as a single-element character array. This is not the case for other overloads that include a `separator` parameter; you must explicitly pass these overloads a character array as the `separator` argument. +Because the `separator` parameter is decorated with the attribute, compilers will interpret a single character as a single-element character array. This is not the case for other overloads that include a `separator` parameter; you must explicitly pass these overloads a character array as the `separator` argument. ### Comparison details @@ -13177,11 +13177,11 @@ The method looks for delimiters by ### Performance considerations -The methods allocate memory for the returned array object and a object for each array element. If your application requires optimal performance or if managing memory allocation is critical in your application, consider using the or method. You also have the option of using the method to locate a substring within a string. +The methods allocate memory for the returned array object and a object for each array element. If your application requires optimal performance or if managing memory allocation is critical in your application, consider using the or method. You also have the option of using the method to locate a substring within a string. -To split a string at a separator character, use the or method to locate a separator character in the string. To split a string at a separator string, use the or method to locate the first character of the separator string. Then use the method to determine whether the characters after that first character are equal to the remaining characters of the separator string. +To split a string at a separator character, use the or method to locate a separator character in the string. To split a string at a separator string, use the or method to locate the first character of the separator string. Then use the method to determine whether the characters after that first character are equal to the remaining characters of the separator string. -In addition, if the same set of characters is used to split strings in multiple method calls, consider creating a single array and referencing it in each method call. This significantly reduces the additional overhead of each method call. +In addition, if the same set of characters is used to split strings in multiple method calls, consider creating a single array and referencing it in each method call. This significantly reduces the additional overhead of each method call. ## Examples @@ -13363,7 +13363,7 @@ Delimiter characters are not included in the elements of the returned array. If this instance does not contain any of the characters in `separator`, the returned array consists of a single element that contains this instance. If `count` is zero, an empty array is returned. -If the `separator` parameter is `null` or contains no characters, white-space characters are assumed to be the delimiters. White-space characters are defined by the Unicode standard and the method returns `true` if they are passed to it. +If the `separator` parameter is `null` or contains no characters, white-space characters are assumed to be the delimiters. White-space characters are defined by the Unicode standard and the method returns `true` if they are passed to it. Each element of `separator` defines a separate delimiter character. If two delimiters are adjacent, or a delimiter is found at the beginning or end of this instance, the corresponding array element contains . @@ -13387,14 +13387,14 @@ The following table shows some examples. | Visual Basic | "Darb" & vbLf & "Smarba" | Nothing | {"Darb", "Smarba"} | ### Performance considerations -The methods allocate memory for the returned array object and a object for each array element. If your application requires optimal performance or if managing memory allocation is critical in your application, consider using the or method, and optionally the method, to locate a substring within a string. +The methods allocate memory for the returned array object and a object for each array element. If your application requires optimal performance or if managing memory allocation is critical in your application, consider using the or method, and optionally the method, to locate a substring within a string. -If you are splitting a string at a separator character, use the or method to locate a separator character in the string. If you are splitting a string at a separator string, use the or method to locate the first character of the separator string. Then use the method to determine whether the characters after that first character are equal to the remaining characters of the separator string. +If you are splitting a string at a separator character, use the or method to locate a separator character in the string. If you are splitting a string at a separator string, use the or method to locate the first character of the separator string. Then use the method to determine whether the characters after that first character are equal to the remaining characters of the separator string. -In addition, if the same set of characters is used to split strings in multiple method calls, consider creating a single array and referencing it in each method call. This significantly reduces the additional overhead of each method call. +In addition, if the same set of characters is used to split strings in multiple method calls, consider creating a single array and referencing it in each method call. This significantly reduces the additional overhead of each method call. ## Examples -The following example demonstrates how `count` can be used to limit the number of strings returned by . +The following example demonstrates how `count` can be used to limit the number of strings returned by . :::code language="csharp" source="~/snippets/csharp/System/String/Split/limit.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/Split/limit.fs" id="Snippet1"::: @@ -13506,7 +13506,7 @@ Each element of `separator` defines a separate delimiter that consists of a sing ### The separator array -If the `separator` parameter is `null` or contains no characters, white-space characters are assumed to be the delimiters. White-space characters are defined by the Unicode standard and the method returns `true` if they are passed to it. +If the `separator` parameter is `null` or contains no characters, white-space characters are assumed to be the delimiters. White-space characters are defined by the Unicode standard and the method returns `true` if they are passed to it. To pass `null` for the `char[] separator` parameter, you must indicate the type of the `null` to disambiguate the call from some other overloads, such as . The following example shows several ways to unambiguously identify this overload. @@ -13515,19 +13515,19 @@ To pass `null` for the `char[] separator` parameter, you must indicate the type :::code language="vb" source="~/snippets/visualbasic/system/string.split/identify.vb" id="Snippet5"::: ### Comparison details -The method extracts the substrings in this string that are delimited by one or more of the characters in the `separator` parameter, and returns those substrings as elements of an array. +The method extracts the substrings in this string that are delimited by one or more of the characters in the `separator` parameter, and returns those substrings as elements of an array. -The method looks for delimiters by performing comparisons using case-sensitive ordinal sort rules. For more information about word, string, and ordinal sorts, see the enumeration. +The method looks for delimiters by performing comparisons using case-sensitive ordinal sort rules. For more information about word, string, and ordinal sorts, see the enumeration. ### Performance considerations -The methods allocate memory for the returned array object and a object for each array element. If your application requires optimal performance or if managing memory allocation is critical in your application, consider using the or method, and optionally the method, to locate a substring within a string. +The methods allocate memory for the returned array object and a object for each array element. If your application requires optimal performance or if managing memory allocation is critical in your application, consider using the or method, and optionally the method, to locate a substring within a string. -If you are splitting a string at a separator character, use the or method to locate a separator character in the string. If you are splitting a string at a separator string, use the or method to locate the first character of the separator string. Then use the method to determine whether the characters after that first character are equal to the remaining characters of the separator string. +If you are splitting a string at a separator character, use the or method to locate a separator character in the string. If you are splitting a string at a separator string, use the or method to locate the first character of the separator string. Then use the method to determine whether the characters after that first character are equal to the remaining characters of the separator string. -In addition, if the same set of characters is used to split strings in multiple method calls, consider creating a single array and referencing it in each method call. This significantly reduces the additional overhead of each method call. +In addition, if the same set of characters is used to split strings in multiple method calls, consider creating a single array and referencing it in each method call. This significantly reduces the additional overhead of each method call. ## Examples -The following example uses the enumeration to include or exclude substrings generated by the method. +The following example uses the enumeration to include or exclude substrings generated by the method. :::code language="csharp" source="~/snippets/csharp/System/String/Split/options.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/Split/options.fs" id="Snippet1"::: @@ -13659,7 +13659,7 @@ The following example uses the enumeration to i ## Remarks -When a string is delimited by a known set of strings, you can use the method to separate it into substrings. +When a string is delimited by a known set of strings, you can use the method to separate it into substrings. Delimiter strings are not included in the elements of the returned array. For example, if the `separator` array includes the string "--" and the value of the current string instance is "aa--bb--cc", the method returns an array that contains three elements: "aa", "bb", and "cc". @@ -13683,7 +13683,7 @@ Each element of `separator` defines a separate delimiter that consists of one or If any of the elements in `separator` consists of multiple characters, the entire substring is considered a delimiter. For example, if one of the elements in `separator` is "10", attempting to split the string "This10is10a10string." returns the following four-element array: { "This", "is", "a", "string." }. -If the `separator` parameter is `null` or contains no non-empty strings, white-space characters are assumed to be the delimiters. White-space characters are defined by the Unicode standard and the method returns `true` if they are passed to it. +If the `separator` parameter is `null` or contains no non-empty strings, white-space characters are assumed to be the delimiters. White-space characters are defined by the Unicode standard and the method returns `true` if they are passed to it. To pass `null` for the `string[] separator` parameter, you must indicate the type of the `null` to disambiguate the call from some other overloads, such as . The following example shows several ways to unambiguously identify this overload. @@ -13692,34 +13692,34 @@ To pass `null` for the `string[] separator` parameter, you must indicate the typ :::code language="vb" source="~/snippets/visualbasic/system/string.split/identify.vb" id="Snippet6"::: ### Comparison details -The method extracts the substrings in this string that are delimited by one or more of the strings in the `separator` parameter, and returns those substrings as elements of an array. +The method extracts the substrings in this string that are delimited by one or more of the strings in the `separator` parameter, and returns those substrings as elements of an array. -The method looks for delimiters by performing comparisons using case-sensitive ordinal sort rules. For more information about word, string, and ordinal sorts, see the enumeration. +The method looks for delimiters by performing comparisons using case-sensitive ordinal sort rules. For more information about word, string, and ordinal sorts, see the enumeration. -The method ignores any element of `separator` whose value is `null` or the empty string (""). +The method ignores any element of `separator` whose value is `null` or the empty string (""). -To avoid ambiguous results when strings in `separator` have characters in common, the operation proceeds from the beginning to the end of the value of the instance, and matches the first element in `separator` that is equal to a delimiter in the instance. The order in which substrings are encountered in the instance takes precedence over the order of elements in `separator`. +To avoid ambiguous results when strings in `separator` have characters in common, the operation proceeds from the beginning to the end of the value of the instance, and matches the first element in `separator` that is equal to a delimiter in the instance. The order in which substrings are encountered in the instance takes precedence over the order of elements in `separator`. For example, consider an instance whose value is "abcdef". If the first element in `separator` was "ef" and the second element was "bcde", the result of the split operation would be a string array that contains two elements, "a" and "f". This is because the substring in the instance, "bcde", is encountered and matches an element in `separator` before the substring "f" is encountered. However, if the first element of `separator` was "bcd" and the second element was "bc", the result of the split operation would be a string array that contains two elements, "a" and "ef". This is because "bcd" is the first delimiter in `separator` that matches a delimiter in the instance. If the order of the separators was reversed so the first element was "bc" and the second element was "bcd", the result would be a string array that contains two elements, "a" and "def". ### Performance considerations -The methods allocate memory for the returned array object and a object for each array element. If your application requires optimal performance or if managing memory allocation is critical in your application, consider using the or method, and optionally the method, to locate a substring within a string. +The methods allocate memory for the returned array object and a object for each array element. If your application requires optimal performance or if managing memory allocation is critical in your application, consider using the or method, and optionally the method, to locate a substring within a string. -If you are splitting a string at a separator character, use the or method to locate a separator character in the string. If you are splitting a string at a separator string, use the or method to locate the first character of the separator string. Then use the method to determine whether the characters after that first character are equal to the remaining characters of the separator string. +If you are splitting a string at a separator character, use the or method to locate a separator character in the string. If you are splitting a string at a separator string, use the or method to locate the first character of the separator string. Then use the method to determine whether the characters after that first character are equal to the remaining characters of the separator string. -In addition, if the same set of characters is used to split strings in multiple method calls, consider creating a single array and referencing it in each method call. This significantly reduces the additional overhead of each method call. +In addition, if the same set of characters is used to split strings in multiple method calls, consider creating a single array and referencing it in each method call. This significantly reduces the additional overhead of each method call. ## Examples -The following example illustrates the difference in the arrays returned by calling a string's method with its `options` parameter equal to and . +The following example illustrates the difference in the arrays returned by calling a string's method with its `options` parameter equal to and . :::code language="csharp" source="~/snippets/csharp/System/String/Split/options.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/Split/options.fs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/system/string.split/options.vb" id="Snippet1"::: -The following example defines an array of separators that include punctuation and white-space characters. Passing this array along with a value of to the method returns an array that consists of the individual words from the string. +The following example defines an array of separators that include punctuation and white-space characters. Passing this array along with a value of to the method returns an array that consists of the individual words from the string. :::code language="csharp" source="~/snippets/csharp/System/String/Split/options.cs" id="Snippet3"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/Split/options.fs" id="Snippet3"::: @@ -13891,7 +13891,7 @@ Delimiter characters are not included in the elements of the returned array. If this instance does not contain any of the characters in `separator`, or the `count` parameter is 1, the returned array consists of a single element that contains this instance. -If the `separator` parameter is `null` or contains no characters, white-space characters are assumed to be the delimiters. White-space characters are defined by the Unicode standard and the method returns `true` if they are passed to it. +If the `separator` parameter is `null` or contains no characters, white-space characters are assumed to be the delimiters. White-space characters are defined by the Unicode standard and the method returns `true` if they are passed to it. To pass `null` for the `char[] separator` parameter, you must indicate the type of the `null` to disambiguate the call from some other overloads, such as . The following example shows several ways to unambiguously identify this overload. @@ -13908,15 +13908,15 @@ If there are more than `count` substrings in this instance, the first `count` mi If `count` is greater than the number of substrings, the available substrings are returned and no exception is thrown. ### Performance considerations -The methods allocate memory for the returned array object and a object for each array element. If your application requires optimal performance or if managing memory allocation is critical in your application, consider using the or method, and optionally the method, to locate a substring within a string. +The methods allocate memory for the returned array object and a object for each array element. If your application requires optimal performance or if managing memory allocation is critical in your application, consider using the or method, and optionally the method, to locate a substring within a string. -If you are splitting a string at a separator character, use the or method to locate a separator character in the string. If you are splitting a string at a separator string, use the or method to locate the first character of the separator string. Then use the method to determine whether the characters after that first character are equal to the remaining characters of the separator string. +If you are splitting a string at a separator character, use the or method to locate a separator character in the string. If you are splitting a string at a separator string, use the or method to locate the first character of the separator string. Then use the method to determine whether the characters after that first character are equal to the remaining characters of the separator string. -In addition, if the same set of characters is used to split strings in multiple method calls, consider creating a single array and referencing it in each method call. This significantly reduces the additional overhead of each method call. +In addition, if the same set of characters is used to split strings in multiple method calls, consider creating a single array and referencing it in each method call. This significantly reduces the additional overhead of each method call. ## Examples -The following example uses the enumeration to include or exclude substrings generated by the method. +The following example uses the enumeration to include or exclude substrings generated by the method. :::code language="csharp" source="~/snippets/csharp/System/String/Split/options.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/Split/options.fs" id="Snippet1"::: @@ -14066,7 +14066,7 @@ Delimiter strings are not included in the elements of the returned array. If this instance does not contain any of the strings in `separator`, or the `count` parameter is 1, the returned array consists of a single element that contains this instance. -If the `separator` parameter is `null` or contains no characters, white-space characters are assumed to be the delimiters. White-space characters are defined by the Unicode standard and the method returns `true` if they are passed to it. +If the `separator` parameter is `null` or contains no characters, white-space characters are assumed to be the delimiters. White-space characters are defined by the Unicode standard and the method returns `true` if they are passed to it. To pass `null` for the `string[] separator` parameter, you must indicate the type of the `null` to disambiguate the call from some other overloads, such as . The following example shows several ways to unambiguously identify this overload. @@ -14087,28 +14087,28 @@ If `count` is greater than the number of substrings, the available substrings ar If any of the elements in `separator` consists of multiple characters, the entire substring is considered a delimiter. For example, if one of the elements in `separator` is "10", attempting to split the string "This10is10a10string." returns this four-element array: { "This", "is", "a", "string." }. ### Comparison details -The method extracts the substrings in this string that are delimited by one or more of the strings in the `separator` parameter, and returns those substrings as elements of an array. +The method extracts the substrings in this string that are delimited by one or more of the strings in the `separator` parameter, and returns those substrings as elements of an array. -The method looks for delimiters by performing comparisons using case-sensitive ordinal sort rules. For more information about word, string, and ordinal sorts, see the enumeration. +The method looks for delimiters by performing comparisons using case-sensitive ordinal sort rules. For more information about word, string, and ordinal sorts, see the enumeration. -The method ignores any element of `separator` whose value is `null` or the empty string (""). +The method ignores any element of `separator` whose value is `null` or the empty string (""). -To avoid ambiguous results when strings in `separator` have characters in common, the method proceeds from the beginning to the end of the value of the instance, and matches the first element in `separator` that is equal to a delimiter in the instance. The order in which substrings are encountered in the instance takes precedence over the order of elements in `separator`. +To avoid ambiguous results when strings in `separator` have characters in common, the method proceeds from the beginning to the end of the value of the instance, and matches the first element in `separator` that is equal to a delimiter in the instance. The order in which substrings are encountered in the instance takes precedence over the order of elements in `separator`. For example, consider an instance whose value is "abcdef". If the first element in `separator` was "ef" and the second element was "bcde", the result of the split operation would be "a" and "f". This is because the substring in the instance, "bcde", is encountered and matches an element in `separator` before the substring "f" is encountered. However, if the first element of `separator` was "bcd" and the second element was "bc", the result of the split operation would be "a" and "ef". This is because "bcd" is the first delimiter in `separator` that matches a delimiter in the instance. If the order of the separators was reversed so the first element was "bc" and the second element was "bcd", the result would be "a" and "def". ### Performance considerations -The methods allocate memory for the returned array object and a object for each array element. If your application requires optimal performance or if managing memory allocation is critical in your application, consider using the or method, and optionally the method, to locate a substring within a string. +The methods allocate memory for the returned array object and a object for each array element. If your application requires optimal performance or if managing memory allocation is critical in your application, consider using the or method, and optionally the method, to locate a substring within a string. -If you are splitting a string at a separator character, use the or method to locate a separator character in the string. If you are splitting a string at a separator string, use the or method to locate the first character of the separator string. Then use the method to determine whether the characters after that first character are equal to the remaining characters of the separator string. +If you are splitting a string at a separator character, use the or method to locate a separator character in the string. If you are splitting a string at a separator string, use the or method to locate the first character of the separator string. Then use the method to determine whether the characters after that first character are equal to the remaining characters of the separator string. -In addition, if the same set of characters is used to split strings in multiple method calls, consider creating a single array and referencing it in each method call. This significantly reduces the additional overhead of each method call. +In addition, if the same set of characters is used to split strings in multiple method calls, consider creating a single array and referencing it in each method call. This significantly reduces the additional overhead of each method call. ## Examples -The following example uses the enumeration to include or exclude substrings generated by the method. +The following example uses the enumeration to include or exclude substrings generated by the method. :::code language="csharp" source="~/snippets/csharp/System/String/Split/options.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/Split/options.fs" id="Snippet1"::: @@ -14417,10 +14417,10 @@ The following example defines a `StripStartTags` method that uses the method compares the `value` parameter to the substring at the beginning of this string and returns a value that indicates whether they are equal. To be equal, `value` must be a reference to this same string, must be the empty string (""), or must match the beginning of this string. The type of comparison performed by the method depends on the value of the `comparisonType` parameter. The comparison can use the conventions of the current culture ( and ) or the invariant culture ( and ), or it can consist of a character-by-character comparison of code points ( or ). The comparison can also be case-sensitive (, , or ), or it can ignore case (, , ). +The method compares the `value` parameter to the substring at the beginning of this string and returns a value that indicates whether they are equal. To be equal, `value` must be a reference to this same string, must be the empty string (""), or must match the beginning of this string. The type of comparison performed by the method depends on the value of the `comparisonType` parameter. The comparison can use the conventions of the current culture ( and ) or the invariant culture ( and ), or it can consist of a character-by-character comparison of code points ( or ). The comparison can also be case-sensitive (, , or ), or it can ignore case (, , ). ## Examples -The following example searches for the string "the" at the beginning of a longer string that begins with the word "The". As the output from the example shows, a call to the method that performs a culture-insensitive but case-sensitive comparison fails to match the string, while a call that performs a culture- and case-insensitive comparison matches the string. +The following example searches for the string "the" at the beginning of a longer string that begins with the word "The". As the output from the example shows, a call to the method that performs a culture-insensitive but case-sensitive comparison fails to match the string, while a call that performs a culture- and case-insensitive comparison matches the string. :::code language="csharp" source="~/snippets/csharp/System/String/StartsWith/StartsWith2.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/StartsWith/StartsWith2.fs" id="Snippet2"::: @@ -14539,7 +14539,7 @@ This method compares the `value` parameter to the substring at the beginning of This method performs a comparison using the specified casing and culture. ## Examples -The following example determines whether a string occurs at the beginning of another string. The method is called several times using case sensitivity, case insensitivity, and different cultures that influence the results of the search. +The following example determines whether a string occurs at the beginning of another string. The method is called several times using case sensitivity, case insensitivity, and different cultures that influence the results of the search. :::code language="csharp" source="~/snippets/csharp/System/String/StartsWith/swci.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/StartsWith/swci.fs" id="Snippet1"::: @@ -14623,12 +14623,12 @@ This member is overloaded. For complete information about this member, including method to extract a substring from a string that begins at a specified character position and ends at the end of the string. The starting character position is zero-based; in other words, the first character in the string is at index 0, not index 1. To extract a substring that begins at a specified character position and ends before the end of the string, call the method. +You call the method to extract a substring from a string that begins at a specified character position and ends at the end of the string. The starting character position is zero-based; in other words, the first character in the string is at index 0, not index 1. To extract a substring that begins at a specified character position and ends before the end of the string, call the method. > [!NOTE] > This method does not modify the value of the current instance. Instead, it returns a new string that begins at the `startIndex` position in the current string. -To extract a substring that begins with a particular character or character sequence, call a method such as or to get the value of `startIndex`. The second example illustrates this; it extracts a key value that begins one character position after the `=` character. +To extract a substring that begins with a particular character or character sequence, call a method such as or to get the value of `startIndex`. The second example illustrates this; it extracts a key value that begins one character position after the `=` character. If `startIndex` is equal to zero, the method returns the original string unchanged. ## Examples @@ -14638,13 +14638,13 @@ The following example demonstrates obtaining a substring from a string. :::code language="fsharp" source="~/snippets/fsharp/System/String/Substring/Substring10.fs" id="Snippet10"::: :::code language="vb" source="~/snippets/visualbasic/System/String/Substring/Substring10.vb" id="Snippet10"::: -The following example uses the method to separate key/value pairs that are delimited by an equals (`=`) character. +The following example uses the method to separate key/value pairs that are delimited by an equals (`=`) character. :::code language="csharp" source="~/snippets/csharp/System/String/Substring/Substring1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/Substring/Substring1.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/String/Substring/Substring1.vb" id="Snippet1"::: -The method is used to get the position of the equals character in the string. The call to the method extracts the key name, which starts from the first character in the string and extends for the number of characters returned by the call to the method. The call to the method then extracts the value assigned to the key. It starts at one character position beyond the equals character and extends to the end of the string. +The method is used to get the position of the equals character in the string. The call to the method extracts the key name, which starts from the first character in the string and extends for the number of characters returned by the call to the method. The call to the method then extracts the value assigned to the key. It starts at one character position beyond the equals character and extends to the end of the string. ]]> @@ -14723,45 +14723,45 @@ The method is used to get the position of the eq method to extract a substring from a string that begins at a specified character position and ends before the end of the string. The starting character position is zero-based; in other words, the first character in the string is at index 0, not index 1. To extract a substring that begins at a specified character position and continues to the end of the string, call the method. +You call the method to extract a substring from a string that begins at a specified character position and ends before the end of the string. The starting character position is zero-based; in other words, the first character in the string is at index 0, not index 1. To extract a substring that begins at a specified character position and continues to the end of the string, call the method. > [!NOTE] > This method does not modify the value of the current instance. Instead, it returns a new string with `length` characters starting from the `startIndex` position in the current string. -The `length` parameter represents the total number of characters to extract from the current string instance. This includes the starting character found at index `startIndex`. In other words, the method attempts to extract characters from index `startIndex` to index `startIndex` + `length` - 1. +The `length` parameter represents the total number of characters to extract from the current string instance. This includes the starting character found at index `startIndex`. In other words, the method attempts to extract characters from index `startIndex` to index `startIndex` + `length` - 1. -To extract a substring that begins with a particular character or character sequence, call a method such as or to get the value of `startIndex`. +To extract a substring that begins with a particular character or character sequence, call a method such as or to get the value of `startIndex`. -If the substring should extend from `startIndex` to a specified character sequence, you can call a method such as or to get the index of the ending character or character sequence. You can then convert that value to an index position in the string as follows: +If the substring should extend from `startIndex` to a specified character sequence, you can call a method such as or to get the index of the ending character or character sequence. You can then convert that value to an index position in the string as follows: -- If you've searched for a single character that is to mark the end of the substring, the `length` parameter equals `endIndex` - `startIndex` + 1, where `endIndex` is the return value of the or method. The following example extracts a continuous block of "b" characters from a string. +- If you've searched for a single character that is to mark the end of the substring, the `length` parameter equals `endIndex` - `startIndex` + 1, where `endIndex` is the return value of the or method. The following example extracts a continuous block of "b" characters from a string. :::code language="csharp" source="~/snippets/csharp/System/String/Substring/Substring2.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/Substring/Substring2.fs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System/String/Substring/Substring2.vb" id="Snippet2"::: -- If you've searched for multiple characters that are to mark the end of the substring, the `length` parameter equals `endIndex` + `endMatchLength` - `startIndex`, where `endIndex` is the return value of the or method, and `endMatchLength` is the length of the character sequence that marks the end of the substring. The following example extracts a block of text that contains an XML `` element. +- If you've searched for multiple characters that are to mark the end of the substring, the `length` parameter equals `endIndex` + `endMatchLength` - `startIndex`, where `endIndex` is the return value of the or method, and `endMatchLength` is the length of the character sequence that marks the end of the substring. The following example extracts a block of text that contains an XML `` element. :::code language="csharp" source="~/snippets/csharp/System/String/Substring/Substring3.cs" id="Snippet3"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/Substring/Substring3.fs" id="Snippet3"::: :::code language="vb" source="~/snippets/visualbasic/System/String/Substring/Substring3.vb" id="Snippet3"::: -- If the character or character sequence is not included in the end of the substring, the `length` parameter equals `endIndex` - `startIndex`, where `endIndex` is the return value of the or method. +- If the character or character sequence is not included in the end of the substring, the `length` parameter equals `endIndex` - `startIndex`, where `endIndex` is the return value of the or method. If `startIndex` is equal to zero and `length` equals the length of the current string, the method returns the original string unchanged. ## Examples -The following example illustrates a simple call to the method that extracts two characters from a string starting at the sixth character position (that is, at index five). +The following example illustrates a simple call to the method that extracts two characters from a string starting at the sixth character position (that is, at index five). :::code language="csharp" source="~/snippets/csharp/System/String/Substring/Substring4.cs" id="Snippet4"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/Substring/Substring4.fs" id="Snippet4"::: :::code language="vb" source="~/snippets/visualbasic/System/String/Substring/Substring4.vb" id="Snippet4"::: -The following example uses the method in the following three cases to isolate substrings within a string. In two cases the substrings are used in comparisons, and in the third case an exception is thrown because invalid parameters are specified. +The following example uses the method in the following three cases to isolate substrings within a string. In two cases the substrings are used in comparisons, and in the third case an exception is thrown because invalid parameters are specified. - It extracts the single character at the third position in the string (at index 2) and compares it with a "c". This comparison returns `true`. -- It extracts zero characters starting at the fourth position in the string (at index 3) and passes it to the method. This returns true because the call to the method returns . +- It extracts zero characters starting at the fourth position in the string (at index 3) and passes it to the method. This returns true because the call to the method returns . - It attempts to extract one character starting at the fourth position in the string. Because there is no character at that position, the method call throws an exception. @@ -14769,13 +14769,13 @@ The following example uses the method to separate key/value pairs that are delimited by an equals (`=`) character. +The following example uses the method to separate key/value pairs that are delimited by an equals (`=`) character. :::code language="csharp" source="~/snippets/csharp/System/String/Substring/Substring1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/Substring/Substring1.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/String/Substring/Substring1.vb" id="Snippet1"::: -The method is used to get the position of the equals character in the string. The call to the method extracts the key name, which starts from the first character in the string and extends for the number of characters returned by the call to the method. The call to the method then extracts the value assigned to the key. It starts at one character position beyond the equals character and extends to the end of the string. +The method is used to get the position of the equals character in the string. The call to the method extracts the key name, which starts from the first character in the string and extends for the number of characters returned by the call to the method. The call to the method then extracts the value assigned to the key. It starts at one character position beyond the equals character and extends to the end of the string. ]]> @@ -14839,7 +14839,7 @@ The method is used to get the position of the eq instance is cast to an interface object. For more information, see the method. +This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface object. For more information, see the method. ]]> @@ -14896,7 +14896,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. For more information, see the method. +This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. For more information, see the method. ]]> @@ -14946,15 +14946,15 @@ This member is an explicit interface member implementation. It can be used only `value` must be a object. > [!CAUTION] -> The method was designed primarily for use in sorting or alphabetizing operations. It should not be used when the primary purpose of the method call is to determine whether two strings are equivalent. To determine whether two strings are equivalent, call the method. +> The method was designed primarily for use in sorting or alphabetizing operations. It should not be used when the primary purpose of the method call is to determine whether two strings are equivalent. To determine whether two strings are equivalent, call the method. This method performs a word (case-sensitive and culture-sensitive) comparison using the current culture. For more information about word, string, and ordinal sorts, see . -For more information about the behavior of this method, see the Remarks section of the method. +For more information about the behavior of this method, see the Remarks section of the method. ## Examples -The following example uses the method with an . Because it attempts to compare a instance to a `TestClass` object, the method throws an . +The following example uses the method with an . Because it attempts to compare a instance to a `TestClass` object, the method throws an . :::code language="csharp" source="~/snippets/csharp/System/String/CompareTo/extostring.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/CompareTo/extostring.fs" id="Snippet1"::: @@ -15128,7 +15128,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. +This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -15188,7 +15188,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. +This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -15252,7 +15252,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. +This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -15316,7 +15316,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. +This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -15382,7 +15382,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. +This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -15448,7 +15448,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. +This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -15514,7 +15514,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. +This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -15578,7 +15578,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. +This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -15646,7 +15646,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. +This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -15712,7 +15712,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. +This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -15819,7 +15819,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. +This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -15890,7 +15890,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. +This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -15960,7 +15960,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. +This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -16030,7 +16030,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. +This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -16278,7 +16278,7 @@ This member is an explicit interface member implementation. It can be used only object) in a string to a character array. The first character copied is at index zero of the returned character array; the last character copied is at index - 1. +This method copies each character (that is, each object) in a string to a character array. The first character copied is at index zero of the returned character array; the last character copied is at index - 1. To create a string from the characters in a character array, call the constructor. @@ -16295,7 +16295,7 @@ To create a byte array that contains the encoded characters in a string, instant For more information, see [Character Encoding in .NET](/dotnet/standard/base-types/character-encoding). ## Examples -The following example calls the method to extract the characters in a string to a character array. It then displays the original string and the elements in the array. +The following example calls the method to extract the characters in a string to a character array. It then displays the original string and the elements in the array. :::code language="csharp" source="~/snippets/csharp/System/String/ToCharArray/ToCharArray1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/ToCharArray/ToCharArray1.fs" id="Snippet1"::: @@ -16366,13 +16366,13 @@ The following example calls the method to ex constructor. +This method copies the characters in a portion of a string to a character array. To create a string from a range of characters in a character array, call the constructor. The `startIndex` parameter is zero-based. That is, the index of the first character in the string instance is zero. If `length` is zero, the returned array is empty and has a zero length. If this instance is `null` or an empty string (""), the returned array is empty and has a zero length. -To create a byte array that contains the encoded characters in a portion of a string, instantiate the appropriate object and call its method. Some of the standard encodings available in .NET include: +To create a byte array that contains the encoded characters in a portion of a string, instantiate the appropriate object and call its method. Some of the standard encodings available in .NET include: |Encoding|Object| |--------------|------------| @@ -16471,7 +16471,7 @@ This method takes into account the casing rules of the current culture. > [!NOTE] > This method does not modify the value of the current instance. Instead, it returns a new string in which all characters in the current instance are converted to lowercase. -The casing operation that results from calling the method takes the casing conventions of the current culture into account. If you need the lowercase or uppercase version of an operating system identifier, such as a file name, named pipe, or registry key, use the or methods. This produces the same result in every culture (unlike the method) and performs more efficiently. +The casing operation that results from calling the method takes the casing conventions of the current culture into account. If you need the lowercase or uppercase version of an operating system identifier, such as a file name, named pipe, or registry key, use the or methods. This produces the same result in every culture (unlike the method) and performs more efficiently. ]]> @@ -16559,7 +16559,7 @@ The casing rules of the culture specified by the `culture` parameter determine t > [!NOTE] > This method does not modify the value of the current instance. Instead, it returns a new string in which all characters in the current instance are converted to lowercase. -If you pass the method a object other than , the casing operation will take culture-specific rules into account. If you need the lowercase or uppercase version of an operating system identifier, such as a file name, named pipe, or registry key, use the or method. This produces the same result in every culture and performs more efficiently. +If you pass the method a object other than , the casing operation will take culture-specific rules into account. If you need the lowercase or uppercase version of an operating system identifier, such as a file name, named pipe, or registry key, use the or method. This produces the same result in every culture and performs more efficiently. ]]> @@ -16631,15 +16631,15 @@ The following example converts two strings of uppercase characters to lowercase ## Remarks The invariant culture represents a culture that is culture-insensitive. It is associated with the English language but not with a specific country or region. For more information, see the property. -If your application depends on the case of a string changing in a predictable way that is unaffected by the current culture, use the method. The method is equivalent to `ToLower(CultureInfo.InvariantCulture)`. The method is recommended when a collection of strings must appear in a predictable order in a user interface control. +If your application depends on the case of a string changing in a predictable way that is unaffected by the current culture, use the method. The method is equivalent to `ToLower(CultureInfo.InvariantCulture)`. The method is recommended when a collection of strings must appear in a predictable order in a user interface control. > [!NOTE] > This method does not modify the value of the current instance. Instead, it returns a new string in which all characters in the current instance are converted to lowercase. -If you need the lowercase or uppercase version of an operating system identifier, such as a file name, named pipe, or registry key, use the or methods. +If you need the lowercase or uppercase version of an operating system identifier, such as a file name, named pipe, or registry key, use the or methods. ## Examples -The following example defines a string array that contains a single word in a number of languages. The method is used to populate the elements of a parallel array with the case-insensitive version of each word. The method is used to sort the case-sensitive array based on the order of elements in the lowercase array to ensure that elements appear in the same order regardless of language. +The following example defines a string array that contains a single word in a number of languages. The method is used to populate the elements of a parallel array with the case-insensitive version of each word. The method is used to sort the case-sensitive array based on the order of elements in the lowercase array to ensure that elements appear in the same order regardless of language. :::code language="csharp" source="~/snippets/csharp/System/String/ToLowerInvariant/tolowerinvariant.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/ToLowerInvariant/tolowerinvariant.fs" id="Snippet1"::: @@ -16723,7 +16723,7 @@ The following example defines a string array that contains a single word in a nu Because this method simply returns the current string unchanged, there is no need to call it directly. It is usually called implicitly in a composite formatting operation, as the example shows. ## Examples -The following example demonstrates the method.Note that the example does not explicitly call the method. Instead, the method is called implicitly by the [composite formatting](/dotnet/standard/base-types/composite-formatting) feature. +The following example demonstrates the method.Note that the example does not explicitly call the method. Instead, the method is called implicitly by the [composite formatting](/dotnet/standard/base-types/composite-formatting) feature. :::code language="csharp" source="~/snippets/csharp/System/String/ToString/string.tostring.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/ToString/string.tostring.fs" id="Snippet1"::: @@ -16872,15 +16872,15 @@ This method uses the casing rules of the current culture to convert each charact > [!NOTE] > This method does not modify the value of the current instance. Instead, it returns a new string in which all characters in the current instance are converted to uppercase. -The method is often used to convert a string to uppercase so that it can be used in a case-insensitive comparison. A better method to perform case-insensitive comparison is to call a string comparison method that has a parameter whose value you set to for a culture-sensitive, case-insensitive comparison. +The method is often used to convert a string to uppercase so that it can be used in a case-insensitive comparison. A better method to perform case-insensitive comparison is to call a string comparison method that has a parameter whose value you set to for a culture-sensitive, case-insensitive comparison. -The casing operation that results from calling the method takes the casing conventions of the current culture into account. If you need the lowercase or uppercase version of an operating system identifier, such as a file name, named pipe, or registry key, use the or method. This produces the same result in every culture (unlike the method) and performs more efficiently. +The casing operation that results from calling the method takes the casing conventions of the current culture into account. If you need the lowercase or uppercase version of an operating system identifier, such as a file name, named pipe, or registry key, use the or method. This produces the same result in every culture (unlike the method) and performs more efficiently. ]]> method to convert a series of one-character strings that contain each character in the Basic Latin, Latin-1 Supplement, and Latin Extended-A character sets. It then displays each string whose uppercase character is different from its lowercase character. +The following example calls the method to convert a series of one-character strings that contain each character in the Basic Latin, Latin-1 Supplement, and Latin Extended-A character sets. It then displays each string whose uppercase character is different from its lowercase character. :::code language="csharp" source="~/snippets/csharp/System/String/ToUpper/ToUpperEx.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/ToUpper/ToUpperEx.fs" id="Snippet1"::: @@ -16961,7 +16961,7 @@ The casing rules of the culture specified by the `culture` parameter determine t > [!NOTE] > This method does not modify the value of the current instance. Instead, it returns a new string in which all characters in the current instance are converted to uppercase. -If you pass the method a object other than , the casing operation will take culture-specific rules into account. If you need the lowercase or uppercase version of an operating system identifier, such as a file name, named pipe, or registry key, use the or method. This produces the same result in every culture and performs more efficiently. +If you pass the method a object other than , the casing operation will take culture-specific rules into account. If you need the lowercase or uppercase version of an operating system identifier, such as a file name, named pipe, or registry key, use the or method. This produces the same result in every culture and performs more efficiently. ]]> @@ -17034,18 +17034,18 @@ The following example converts a string of lowercase characters to two strings o ## Remarks The invariant culture represents a culture that is culture-insensitive. It is associated with the English language but not with a specific country or region. For more information, see the property. -If your application depends on the case of a string changing in a predictable way that is unaffected by the current culture, use the method. The method is equivalent to `ToUpper(CultureInfo.InvariantCulture)`. The method is recommended when a collection of strings must appear in a predictable order in a user interface control. +If your application depends on the case of a string changing in a predictable way that is unaffected by the current culture, use the method. The method is equivalent to `ToUpper(CultureInfo.InvariantCulture)`. The method is recommended when a collection of strings must appear in a predictable order in a user interface control. > [!NOTE] > This method does not modify the value of the current instance. Instead, it returns a new string in which all characters in the current instance are converted to uppercase. -If you need the lowercase or uppercase version of an operating system identifier, such as a file name, named pipe, or registry key, use the or methods. +If you need the lowercase or uppercase version of an operating system identifier, such as a file name, named pipe, or registry key, use the or methods. ]]> method is used to populate the elements of a parallel array with the case-insensitive version of each word. The method is used to sort the case-sensitive array based on the order of elements in the uppercase array to ensure that elements appear in the same order regardless of language. +The following example defines a string array that contains a single word in a number of languages. The method is used to populate the elements of a parallel array with the case-insensitive version of each word. The method is used to sort the case-sensitive array based on the order of elements in the uppercase array to ensure that elements appear in the same order regardless of language. :::code language="csharp" source="~/snippets/csharp/System/String/ToUpperInvariant/toupperinvariant.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/ToUpperInvariant/toupperinvariant.fs" id="Snippet1"::: @@ -17126,7 +17126,7 @@ The `Trim` method removes from the current string all leading and trailing white If the current string equals or all the characters in the current instance consist of white-space characters, the method returns . -White-space characters are defined by the Unicode standard. The `Trim` method removes any leading and trailing characters that produce a return value of `true` when they are passed to the method. +White-space characters are defined by the Unicode standard. The `Trim` method removes any leading and trailing characters that produce a return value of `true` when they are passed to the method. ## Examples @@ -17277,7 +17277,7 @@ The `Trim(System.Char[])` method removes from the current string all leading and If the current string equals or all the characters in the current instance consist of characters in the `trimChars` array, the method returns . -If `trimChars` is `null` or an empty array, this method removes any leading or trailing characters that result in the method returning `true` when they are passed to the method. +If `trimChars` is `null` or an empty array, this method removes any leading or trailing characters that result in the method returning `true` when they are passed to the method. ## Examples @@ -17733,13 +17733,13 @@ The `TrimStart(System.Char[])` method removes from the current string all leadin ## Examples -The following example demonstrates the basic functionality of the method: +The following example demonstrates the basic functionality of the method: :::code language="csharp" source="~/snippets/csharp/System/String/TrimStart/sample.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/TrimStart/sample.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/String/TrimStart/sample.vb" id="Snippet1"::: -The following example uses the method to trim white space and comment characters from lines of source code. The `StripComments` method wraps a call to and passes it a character array that contains a space and the comment character, which is an apostrophe ( ' ) in Visual Basic and a slash ( / ) in C# or F#. The method is also called to remove leading white space when evaluating whether a string is a comment. +The following example uses the method to trim white space and comment characters from lines of source code. The `StripComments` method wraps a call to and passes it a character array that contains a space and the comment character, which is an apostrophe ( ' ) in Visual Basic and a slash ( / ) in C# or F#. The method is also called to remove leading white space when evaluating whether a string is a comment. :::code language="csharp" source="~/snippets/csharp/System/String/TrimStart/sample.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/TrimStart/sample.fs" id="Snippet2"::: diff --git a/xml/System/StringComparer.xml b/xml/System/StringComparer.xml index 7fa15742ff8..1335ec3df85 100644 --- a/xml/System/StringComparer.xml +++ b/xml/System/StringComparer.xml @@ -90,7 +90,7 @@ For more information about this API, see Supplemental API remarks for StringComparer. method of the class. The example illustrates how different objects sort three versions of the Latin letter I. +The following example demonstrates the properties and the method of the class. The example illustrates how different objects sort three versions of the Latin letter I. :::code language="csharp" source="~/snippets/csharp/System/StringComparer/Overview/omni.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/StringComparer/Overview/omni.fs" id="Snippet1"::: @@ -227,7 +227,7 @@ The following example demonstrates the properties and the method is slightly more efficient than the method because no conversion of the `x` and `y` arguments is needed to perform the comparison. + The method is slightly more efficient than the method because no conversion of the `x` and `y` arguments is needed to perform the comparison. ]]> @@ -310,7 +310,7 @@ The following example demonstrates the properties and the method is slightly more efficient than the method because no conversion of the `x` and `y` arguments is needed to perform the comparison. + The method is slightly more efficient than the method because no conversion of the `x` and `y` arguments is needed to perform the comparison. ]]> @@ -368,7 +368,7 @@ The following example demonstrates the properties and the method of the class. The example illustrates how different objects sort three versions of the Latin letter I. + The following code example demonstrates the properties and the method of the class. The example illustrates how different objects sort three versions of the Latin letter I. :::code language="csharp" source="~/snippets/csharp/System/StringComparer/Overview/omni.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/StringComparer/Overview/omni.fs" id="Snippet1"::: @@ -495,7 +495,7 @@ The following example demonstrates the properties and the method of the class. The example illustrates how different objects sort three versions of the Latin letter I. + The following code example demonstrates the properties and the method of the class. The example illustrates how different objects sort three versions of the Latin letter I. :::code language="csharp" source="~/snippets/csharp/System/StringComparer/Overview/omni.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/StringComparer/Overview/omni.fs" id="Snippet1"::: @@ -643,7 +643,7 @@ The following example demonstrates the properties and the method may be slightly more efficient than the method. + Because the runtime does not have to unbox `x` or `y` if they are value types or attempt to downcast `x` or `y` to strings if they are reference types, the method may be slightly more efficient than the method. ]]> @@ -708,7 +708,7 @@ The following example demonstrates the properties and the method may be slightly more efficient than the method. + Because the runtime does not have to unbox `x` or `y` if they are value types or attempt to downcast `x` or `y` to strings if they are reference types, the method may be slightly more efficient than the method. ]]> @@ -823,9 +823,9 @@ The following example demonstrates the properties and the method is more efficient than the method because the `obj` parameter does not have to be unboxed to perform the operation. + The method is more efficient than the method because the `obj` parameter does not have to be unboxed to perform the operation. - The method allocates an amount of memory that is proportional to the size of `obj` to calculate the hash code of `obj`. In the case of large strings, trying to retrieve the hash code can throw an . Instead, you can use an alternate algorithm that allocates a fixed amount of memory when calculating hash codes. To use this algorithm, add the [](/dotnet/framework/configure-apps/file-schema/runtime/netfx45-cultureawarecomparergethashcode-longstrings-element) element to the [\](/dotnet/framework/configure-apps/file-schema/runtime/runtime-element) section of your application's configuration file. + The method allocates an amount of memory that is proportional to the size of `obj` to calculate the hash code of `obj`. In the case of large strings, trying to retrieve the hash code can throw an . Instead, you can use an alternate algorithm that allocates a fixed amount of memory when calculating hash codes. To use this algorithm, add the [](/dotnet/framework/configure-apps/file-schema/runtime/netfx45-cultureawarecomparergethashcode-longstrings-element) element to the [\](/dotnet/framework/configure-apps/file-schema/runtime/runtime-element) section of your application's configuration file. ]]> @@ -889,9 +889,9 @@ The following example demonstrates the properties and the method is more efficient than the method because the `obj` parameter does not have to be unboxed to perform the operation. + The method is more efficient than the method because the `obj` parameter does not have to be unboxed to perform the operation. - The method allocates an amount of memory that is proportional to the size of `obj` to calculate the hash code of `obj`. In the case of large strings, trying to retrieve the hash code can throw an . Instead, you can use an alternate algorithm that allocates a fixed amount of memory when calculating hash codes. To use this algorithm, add the [](/dotnet/framework/configure-apps/file-schema/runtime/netfx45-cultureawarecomparergethashcode-longstrings-element) element to the [\](/dotnet/framework/configure-apps/file-schema/runtime/runtime-element) section of your application's configuration file. + The method allocates an amount of memory that is proportional to the size of `obj` to calculate the hash code of `obj`. In the case of large strings, trying to retrieve the hash code can throw an . Instead, you can use an alternate algorithm that allocates a fixed amount of memory when calculating hash codes. To use this algorithm, add the [](/dotnet/framework/configure-apps/file-schema/runtime/netfx45-cultureawarecomparergethashcode-longstrings-element) element to the [\](/dotnet/framework/configure-apps/file-schema/runtime/runtime-element) section of your application's configuration file. ]]> @@ -954,7 +954,7 @@ The following example demonstrates the properties and the method of the class. The example illustrates how different objects sort three versions of the Latin letter I. + The following code example demonstrates the properties and the method of the class. The example illustrates how different objects sort three versions of the Latin letter I. :::code language="csharp" source="~/snippets/csharp/System/StringComparer/Overview/omni.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/StringComparer/Overview/omni.fs" id="Snippet1"::: @@ -1128,10 +1128,10 @@ A "well-known culture-aware comparer" describes a comparer that's tied to a spec ## Remarks A "well-known ordinal comparer" describes a comparer that behaves identically to - when passed to or . - For example, is a well-known ordinal comparer because - a given as a constructor - argument will behave identically to a given + when passed to or . + For example, is a well-known ordinal comparer because + a given as a constructor + argument will behave identically to a given as a constructor argument. If `ignoreCase` is `true` on method exit, then `comparer` behaves identically to when passed to the constructor of such a collection. @@ -1195,7 +1195,7 @@ A "well-known ordinal comparer" describes a comparer that behaves identically to ## Examples - The following code example demonstrates the properties and the method of the class. The example illustrates how different objects sort three versions of the Latin letter I. + The following code example demonstrates the properties and the method of the class. The example illustrates how different objects sort three versions of the Latin letter I. :::code language="csharp" source="~/snippets/csharp/System/StringComparer/Overview/omni.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/StringComparer/Overview/omni.fs" id="Snippet1"::: @@ -1261,7 +1261,7 @@ A "well-known ordinal comparer" describes a comparer that behaves identically to ## Examples - The following code example demonstrates the properties and the method of the class. The example illustrates how different objects sort three versions of the Latin letter I. + The following code example demonstrates the properties and the method of the class. The example illustrates how different objects sort three versions of the Latin letter I. :::code language="csharp" source="~/snippets/csharp/System/StringComparer/Overview/omni.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/StringComparer/Overview/omni.fs" id="Snippet1"::: diff --git a/xml/System/StringComparison.xml b/xml/System/StringComparison.xml index 15d153ccf13..9c710c6e93a 100644 --- a/xml/System/StringComparison.xml +++ b/xml/System/StringComparison.xml @@ -60,28 +60,28 @@

Specifies the culture, case, and sort rules to be used by certain overloads of the and methods. - enumeration is used to specify whether a string comparison should use the current culture or the invariant culture, word or ordinal sort rules, and be case-sensitive or case-insensitive. - + enumeration is used to specify whether a string comparison should use the current culture or the invariant culture, word or ordinal sort rules, and be case-sensitive or case-insensitive. + > [!IMPORTANT] -> When you call a string comparison method such as , , or , you should always call an overload that includes a parameter of type so that you can specify the type of comparison that the method performs. For more information, see [Best Practices for Using Strings](/dotnet/standard/base-types/best-practices-strings). - - An operation that uses word sort rules performs a culture-sensitive comparison wherein certain nonalphanumeric Unicode characters might have special weights assigned to them. Using word sort rules and the conventions of a specific culture, the hyphen ("-") might have a very small weight assigned to it so that "coop" and "co-op" appear next to each other in a sorted list. - -[!INCLUDE[platform-note](~/includes/c-and-posix-cultures.md)] - - An operation that uses ordinal sort rules performs a comparison based on the numeric value (Unicode code point) of each in the string. An ordinal comparison is fast but culture-insensitive. When you use ordinal sort rules to sort strings that start with Unicode characters (U+), the string U+xxxx comes before the string U+yyyy if the value of xxxx is numerically less than yyyy. - - For more information about comparisons, see the class remarks. For more information about culture, see the class remarks. For guidelines on when to use ordinal or culture-sensitive comparison rules or the rules of the invariant culture, see [Best Practices for Using Strings](/dotnet/standard/base-types/best-practices-strings). For a set of text files that contain information on the character weights used in sorting and comparison operations for Windows operating systems, see [Sorting Weight Tables](https://www.microsoft.com/download/details.aspx?id=10921). For the sort weight table for Linux and macOS, see the [Default Unicode Collation Element Table](https://www.unicode.org/Public/UCA/latest/allkeys.txt). - -## Examples - The following example compares three sets of strings by using each member of the enumeration. The comparisons use the conventions of the English (United States), Thai (Thailand), and Turkish (Turkey) cultures. Note that the strings "a" and "a-" are considered equivalent in the "th-TH" culture but not in the others, while "i" and "İ" are considered equivalent in the "tr-TR" culture when case is ignored but not in the other cultures. - +> When you call a string comparison method such as , , or , you should always call an overload that includes a parameter of type so that you can specify the type of comparison that the method performs. For more information, see [Best Practices for Using Strings](/dotnet/standard/base-types/best-practices-strings). + + An operation that uses word sort rules performs a culture-sensitive comparison wherein certain nonalphanumeric Unicode characters might have special weights assigned to them. Using word sort rules and the conventions of a specific culture, the hyphen ("-") might have a very small weight assigned to it so that "coop" and "co-op" appear next to each other in a sorted list. + +[!INCLUDE[platform-note](~/includes/c-and-posix-cultures.md)] + + An operation that uses ordinal sort rules performs a comparison based on the numeric value (Unicode code point) of each in the string. An ordinal comparison is fast but culture-insensitive. When you use ordinal sort rules to sort strings that start with Unicode characters (U+), the string U+xxxx comes before the string U+yyyy if the value of xxxx is numerically less than yyyy. + + For more information about comparisons, see the class remarks. For more information about culture, see the class remarks. For guidelines on when to use ordinal or culture-sensitive comparison rules or the rules of the invariant culture, see [Best Practices for Using Strings](/dotnet/standard/base-types/best-practices-strings). For a set of text files that contain information on the character weights used in sorting and comparison operations for Windows operating systems, see [Sorting Weight Tables](https://www.microsoft.com/download/details.aspx?id=10921). For the sort weight table for Linux and macOS, see the [Default Unicode Collation Element Table](https://www.unicode.org/Public/UCA/latest/allkeys.txt). + +## Examples + The following example compares three sets of strings by using each member of the enumeration. The comparisons use the conventions of the English (United States), Thai (Thailand), and Turkish (Türkiye) cultures. Note that the strings "a" and "a-" are considered equivalent in the "th-TH" culture but not in the others, while "i" and "İ" are considered equivalent in the "tr-TR" culture when case is ignored but not in the other cultures. + :::code language="csharp" source="~/snippets/csharp/System/String/Equals/equals_ex3.cs" id="Snippet3"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/Equals/equals_ex3.fs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/System/String/Equals/equals_ex3.vb" id="Snippet3"::: + :::code language="vb" source="~/snippets/visualbasic/System/String/Equals/equals_ex3.vb" id="Snippet3"::: ]]> diff --git a/xml/System/StringNormalizationExtensions.xml b/xml/System/StringNormalizationExtensions.xml index bf46dbd9c1f..937767cbc85 100644 --- a/xml/System/StringNormalizationExtensions.xml +++ b/xml/System/StringNormalizationExtensions.xml @@ -78,12 +78,12 @@ Provides extension methods to work with string normalization. - class are designed to work with .NET implementations that do not support the and methods. However, these methods are included in the class in .NET Standard 2.0 and are therefore available on all .NET implementations that support the .NET Standard 2.0. For more information, see [.NET Standard](/dotnet/standard/net-standard). -The extension methods of the class are designed to work with .NET implementations that do not support the and methods. However, these methods are included in the class in .NET Standard 2.0 and are therefore available on all .NET implementations that support the .NET Standard 2.0. For more information, see [.NET Standard](/dotnet/standard/net-standard). - ]]> diff --git a/xml/System/StringSplitOptions.xml b/xml/System/StringSplitOptions.xml index 7b916b339aa..9b43ae9d900 100644 --- a/xml/System/StringSplitOptions.xml +++ b/xml/System/StringSplitOptions.xml @@ -63,15 +63,15 @@ ## Remarks -The method returns an array of the substrings in a given string that are delimited by specified characters or strings. Adjacent delimiters yield an array element that contains an empty string (`""`). One of the fields of the `StringSplitOptions` enumeration specifies whether an element that contains an empty string should be included in the returned array. +The method returns an array of the substrings in a given string that are delimited by specified characters or strings. Adjacent delimiters yield an array element that contains an empty string (`""`). One of the fields of the `StringSplitOptions` enumeration specifies whether an element that contains an empty string should be included in the returned array. -Specify the `None` field to invoke the default behavior of the method, which is not to trim white-space characters and to include empty substrings. +Specify the `None` field to invoke the default behavior of the method, which is not to trim white-space characters and to include empty substrings. The `TrimEntries` field is only available in .NET 5 and later versions. ## Examples -The following example shows how the `StringSplitOptions` enumeration is used to include or exclude substrings generated by the method: +The following example shows how the `StringSplitOptions` enumeration is used to include or exclude substrings generated by the method: :::code language="csharp" source="~/snippets/csharp/System/String/Split/options.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/String/Split/options.fs" id="Snippet1"::: diff --git a/xml/System/SystemException.xml b/xml/System/SystemException.xml index dac1f10d978..9bc1e70cd45 100644 --- a/xml/System/SystemException.xml +++ b/xml/System/SystemException.xml @@ -134,8 +134,8 @@ |Property|Value| |--------------|-----------| -||A null reference (`Nothing` in Visual Basic).| -||The localized error message string.| +||A null reference (`Nothing` in Visual Basic).| +||The localized error message string.| ]]>
@@ -191,8 +191,8 @@ |Property|Value| |--------------|-----------| -||A null reference (`Nothing` in Visual Basic).| -||The error message string.| +||A null reference (`Nothing` in Visual Basic).| +||The error message string.| ]]>
@@ -316,8 +316,8 @@ |Property|Value| |--------------|-----------| -||The inner exception reference.| -||The error message string.| +||The inner exception reference.| +||The error message string.| ]]>
diff --git a/xml/System/TimeSpan.xml b/xml/System/TimeSpan.xml index cdffb804839..cc7941d4432 100644 --- a/xml/System/TimeSpan.xml +++ b/xml/System/TimeSpan.xml @@ -534,7 +534,7 @@ The specified `days`, `hours`, `minutes`, `seconds`, `milliseconds`, and `micros ## Examples - The following example calls the method to add each element in an array of time intervals to a base value. + The following example calls the method to add each element in an array of time intervals to a base value. :::code language="csharp" source="~/snippets/csharp/System/TimeSpan/Add/add1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TimeSpan/Add/add1.fs" id="Snippet1"::: @@ -617,7 +617,7 @@ The specified `days`, `hours`, `minutes`, `seconds`, `milliseconds`, and `micros method to compare several objects with a object whose value is a 2-hour time interval. + The following example uses the method to compare several objects with a object whose value is a 2-hour time interval. :::code language="csharp" source="~/snippets/csharp/System/TimeSpan/Compare/compare1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TimeSpan/Compare/compare1.fs" id="Snippet1"::: @@ -641,7 +641,7 @@ The specified `days`, `hours`, `minutes`, `seconds`, `milliseconds`, and `micros method return a signed number that indicates the relative value of this instance and the `value` argument, as shown in the following table. + The two overloads of the method return a signed number that indicates the relative value of this instance and the `value` argument, as shown in the following table. |Value|Description| |-----------|-----------------| @@ -729,7 +729,7 @@ The specified `days`, `hours`, `minutes`, `seconds`, `milliseconds`, and `micros ## Examples - The following example compares several structures and other objects to a reference structure using the method. + The following example compares several structures and other objects to a reference structure using the method. :::code language="csharp" source="~/snippets/csharp/System/TimeSpan/CompareTo/cto_eq_obj.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TimeSpan/CompareTo/cto_eq_obj.fs" id="Snippet1"::: @@ -815,12 +815,12 @@ The specified `days`, `hours`, `minutes`, `seconds`, `milliseconds`, and `micros interface and performs slightly better than the method because it does not have to convert the `value` parameter to an object. + This method implements the interface and performs slightly better than the method because it does not have to convert the `value` parameter to an object. ## Examples - The following example demonstrates generic and nongeneric versions of the method for several value and reference types. + The following example demonstrates generic and nongeneric versions of the method for several value and reference types. :::code language="csharp" source="~/snippets/csharp/System/Boolean/CompareTo/cat.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Boolean/CompareTo/cat.fs" id="Snippet1"::: @@ -1030,7 +1030,7 @@ The specified `days`, `hours`, `minutes`, `seconds`, `milliseconds`, and `micros method to several objects. + The following example applies the method to several objects. :::code language="csharp" source="~/snippets/csharp/System/TimeSpan/Duration/dura_nega_una.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TimeSpan/Duration/dura_nega_una.fs" id="Snippet1"::: @@ -1115,7 +1115,7 @@ The specified `days`, `hours`, `minutes`, `seconds`, `milliseconds`, and `micros and other objects to a reference using the method. + The following example compares several and other objects to a reference using the method. :::code language="csharp" source="~/snippets/csharp/System/TimeSpan/CompareTo/cto_eq_obj.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TimeSpan/CompareTo/cto_eq_obj.fs" id="Snippet1"::: @@ -1182,12 +1182,12 @@ The specified `days`, `hours`, `minutes`, `seconds`, `milliseconds`, and `micros interface, and performs slightly better than because it does not have to convert the `obj` parameter to an object. + This method implements the interface, and performs slightly better than because it does not have to convert the `obj` parameter to an object. ## Examples - The following example demonstrates generic and nongeneric versions of the method for several value and reference types. + The following example demonstrates generic and nongeneric versions of the method for several value and reference types. :::code language="csharp" source="~/snippets/csharp/System/Boolean/CompareTo/cat.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Boolean/CompareTo/cat.fs" id="Snippet1"::: @@ -1253,7 +1253,7 @@ The specified `days`, `hours`, `minutes`, `seconds`, `milliseconds`, and `micros objects to a reference object using the static method. + The following example compares several objects to a reference object using the static method. :::code language="csharp" source="~/snippets/csharp/System/TimeSpan/CompareTo/comp_equal.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/TimeSpan/CompareTo/comp_equal.fs" id="Snippet2"::: @@ -1326,7 +1326,7 @@ The specified `days`, `hours`, `minutes`, `seconds`, `milliseconds`, and `micros ## Examples - The following example creates several objects using the method. + The following example creates several objects using the method. :::code language="csharp" source="~/snippets/csharp/System/TimeSpan/FromDays/fromdays.cs" id="Snippet6"::: :::code language="fsharp" source="~/snippets/fsharp/System/TimeSpan/FromDays/fromdays.fs" id="Snippet6"::: @@ -1491,7 +1491,7 @@ The specified `days`, `hours`, `minutes`, `seconds`, `milliseconds`, and `micros ## Examples - The following example creates several objects using the method. + The following example creates several objects using the method. :::code language="csharp" source="~/snippets/csharp/System/TimeSpan/FromDays/fromhours.cs" id="Snippet5"::: :::code language="fsharp" source="~/snippets/fsharp/System/TimeSpan/FromDays/fromhours.fs" id="Snippet5"::: @@ -1735,7 +1735,7 @@ The specified `days`, `hours`, `minutes`, `seconds`, `milliseconds`, and `micros ## Examples - The following example creates several objects by using the method. + The following example creates several objects by using the method. :::code language="csharp" source="~/snippets/csharp/System/TimeSpan/FromDays/frommillisec.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/TimeSpan/FromDays/frommillisec.fs" id="Snippet2"::: @@ -1896,7 +1896,7 @@ The specified `days`, `hours`, `minutes`, `seconds`, `milliseconds`, and `micros ## Examples - The following example creates several objects using the method. + The following example creates several objects using the method. :::code language="csharp" source="~/snippets/csharp/System/TimeSpan/FromDays/fromminutes.cs" id="Snippet4"::: :::code language="fsharp" source="~/snippets/fsharp/System/TimeSpan/FromDays/fromminutes.fs" id="Snippet4"::: @@ -2057,7 +2057,7 @@ The specified `days`, `hours`, `minutes`, `seconds`, `milliseconds`, and `micros ## Examples - The following example creates several objects using the method. + The following example creates several objects using the method. :::code language="csharp" source="~/snippets/csharp/System/TimeSpan/FromDays/fromseconds.cs" id="Snippet3"::: :::code language="fsharp" source="~/snippets/fsharp/System/TimeSpan/FromDays/fromseconds.fs" id="Snippet3"::: @@ -2213,12 +2213,12 @@ The specified `days`, `hours`, `minutes`, `seconds`, `milliseconds`, and `micros constructor. A single tick represents one hundred nanoseconds or one ten-millionth of a second. There are 10,000 ticks in a millisecond. + This is a convenience method with the same behavior as the constructor. A single tick represents one hundred nanoseconds or one ten-millionth of a second. There are 10,000 ticks in a millisecond. ## Examples - The following example creates several objects using the method. + The following example creates several objects using the method. :::code language="csharp" source="~/snippets/csharp/System/TimeSpan/FromDays/fromticks.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TimeSpan/FromDays/fromticks.fs" id="Snippet1"::: @@ -2287,7 +2287,7 @@ The specified `days`, `hours`, `minutes`, `seconds`, `milliseconds`, and `micros ## Examples - The following example generates the hash codes of several objects using the method. + The following example generates the hash codes of several objects using the method. :::code language="csharp" source="~/snippets/csharp/System/TimeSpan/GetHashCode/hashcode.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TimeSpan/GetHashCode/hashcode.fs" id="Snippet1"::: @@ -3189,7 +3189,7 @@ The value of this constant is 100. method to several objects. + The following example applies the method to several objects. :::code language="csharp" source="~/snippets/csharp/System/TimeSpan/Duration/dura_nega_una.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TimeSpan/Duration/dura_nega_una.fs" id="Snippet1"::: @@ -3253,15 +3253,15 @@ The value of this constant is 100. method defines the addition operator for values. It enables code such as the following: + The method defines the addition operator for values. It enables code such as the following: :::code language="csharp" source="~/snippets/csharp/System/TimeSpan/op_Addition/operators1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TimeSpan/op_Addition/operators1.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/TimeSpan/op_Addition/operators1.vb" id="Snippet1"::: - Languages that do not support custom operators can call the method instead. + Languages that do not support custom operators can call the method instead. - The equivalent method for this operator is ]]> + The equivalent method for this operator is ]]> The resulting is less than TimeSpan.MinValue or greater than TimeSpan.MaxValue. @@ -3412,10 +3412,10 @@ The value of this constant is 100. if the values of and are equal; otherwise, . - + ## Examples - The following example compares several objects to a reference using the operator. + The following example compares several objects to a reference using the operator. :::code language="csharp" source="~/snippets/csharp/System/TimeSpan/op_Equality/relationalops.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TimeSpan/op_Equality/relationalops.fs" id="Snippet1"::: @@ -3486,10 +3486,10 @@ The value of this constant is 100. if the value of is greater than the value of ; otherwise, . - + ## Examples - The following example compares several objects to a reference using the operator. + The following example compares several objects to a reference using the operator. :::code language="csharp" source="~/snippets/csharp/System/TimeSpan/op_Equality/relationalops.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TimeSpan/op_Equality/relationalops.fs" id="Snippet1"::: @@ -3559,10 +3559,10 @@ The value of this constant is 100. if the value of is greater than or equal to the value of ; otherwise, . - + ## Examples - The following example compares several objects to a reference using the operator. + The following example compares several objects to a reference using the operator. :::code language="csharp" source="~/snippets/csharp/System/TimeSpan/op_Equality/relationalops.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TimeSpan/op_Equality/relationalops.fs" id="Snippet1"::: @@ -3632,10 +3632,10 @@ The value of this constant is 100. if the values of and are not equal; otherwise, . - + ## Examples - The following example compares several objects to a reference using the operator. + The following example compares several objects to a reference using the operator. :::code language="csharp" source="~/snippets/csharp/System/TimeSpan/op_Equality/relationalops.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TimeSpan/op_Equality/relationalops.fs" id="Snippet1"::: @@ -3705,10 +3705,10 @@ The value of this constant is 100. if the value of is less than the value of ; otherwise, . - + ## Examples - The following example compares several objects to a reference using the operator. + The following example compares several objects to a reference using the operator. :::code language="csharp" source="~/snippets/csharp/System/TimeSpan/op_Equality/relationalops.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TimeSpan/op_Equality/relationalops.fs" id="Snippet1"::: @@ -3778,10 +3778,10 @@ The value of this constant is 100. if the value of is less than or equal to the value of ; otherwise, . - + ## Examples - The following example compares several objects to a reference using the operator. + The following example compares several objects to a reference using the operator. :::code language="csharp" source="~/snippets/csharp/System/TimeSpan/op_Equality/relationalops.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TimeSpan/op_Equality/relationalops.fs" id="Snippet1"::: @@ -3938,7 +3938,7 @@ The value of this constant is 100. Subtracts a specified from another specified . An object whose value is the result of the value of minus the value of . - + ## Examples The following example uses the subtraction operator to calculate the total length of the weekly work day. It also uses the addition operator to compute the total time of the daily breaks before using it in a subtraction operation to compute the total actual daily working time. @@ -4003,7 +4003,7 @@ The value of this constant is 100. ## Examples - The following example applies the operator to several objects. + The following example applies the operator to several objects. :::code language="csharp" source="~/snippets/csharp/System/TimeSpan/Duration/dura_nega_una.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TimeSpan/Duration/dura_nega_una.fs" id="Snippet1"::: @@ -4065,7 +4065,7 @@ The value of this constant is 100. operator to several objects. + The following example applies the operator to several objects. :::code language="csharp" source="~/snippets/csharp/System/TimeSpan/Duration/dura_nega_una.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TimeSpan/Duration/dura_nega_una.fs" id="Snippet1"::: @@ -4140,7 +4140,7 @@ The value of this constant is 100. For more information about this API, see Supplemental API remarks for TimeSpan.Parse. method to convert each element in a string array to a value. It changes the current system culture to Croatian - Croatia ("hr-HR") and English - United States ("en-US") to illustrate how the current system culture affects the parsing operation. +The following example uses the method to convert each element in a string array to a value. It changes the current system culture to Croatian - Croatia ("hr-HR") and English - United States ("en-US") to illustrate how the current system culture affects the parsing operation. :::code language="csharp" source="~/snippets/csharp/System/TimeSpan/Parse/parse1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TimeSpan/Parse/parse1.fs" id="Snippet1"::: @@ -4278,7 +4278,7 @@ The `formatProvider` parameter is an implementatio - A object that represents the culture whose formatting conventions are to be reflected in the returned string. The object returned by the property defines the formatting of the returned string. - A object that defines the formatting of the returned string. -- A custom object that implements the interface. Its method returns a object that provides formatting information. +- A custom object that implements the interface. Its method returns a object that provides formatting information. If `formatProvider` is `null`, the object that is associated with the current culture is used. @@ -4287,7 +4287,7 @@ For more information about this API, see [Supplemental API remarks for System.Ti objects, and uses each object in calls to the method to parse the elements in a string array. The example illustrates how the conventions of a specific culture influence the formatting operation. +The following example defines an array of objects, and uses each object in calls to the method to parse the elements in a string array. The example illustrates how the conventions of a specific culture influence the formatting operation. :::code language="csharp" source="~/snippets/csharp/System/TimeSpan/Parse/parse2.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/TimeSpan/Parse/parse2.fs" id="Snippet2"::: @@ -4388,12 +4388,12 @@ The following example defines an array of method parses the string representation of a time interval, which must be in the format defined by the `format` parameter, except that leading and trailing white-space characters are ignored. Because `input` must conform to the format of `format` exactly, you should always use exception handling when converting a string input by the user to a time interval. If you prefer not to use exception handling, you can call the method instead. + The method parses the string representation of a time interval, which must be in the format defined by the `format` parameter, except that leading and trailing white-space characters are ignored. Because `input` must conform to the format of `format` exactly, you should always use exception handling when converting a string input by the user to a time interval. If you prefer not to use exception handling, you can call the method instead. The `format` parameter is a string that contains either a single standard format specifier, or one or more custom format specifiers that define the required format of `input`. For more information about valid format strings, see [Standard TimeSpan Format Strings](/dotnet/standard/base-types/standard-timespan-format-strings) and [Custom TimeSpan Format Strings](/dotnet/standard/base-types/custom-timespan-format-strings). > [!IMPORTANT] -> The method uses the conventions of the culture specified by the `formatProvider` parameter only if `format` is a standard format string whose value is either "g" or "G". The "c", "t", and "T" standard format strings use the formatting conventions of the invariant culture. Custom format strings define the precise format of the input string and use literal characters to separate the components of a time interval. +> The method uses the conventions of the culture specified by the `formatProvider` parameter only if `format` is a standard format string whose value is either "g" or "G". The "c", "t", and "T" standard format strings use the formatting conventions of the invariant culture. Custom format strings define the precise format of the input string and use literal characters to separate the components of a time interval. The `formatProvider` parameter is an implementation that provides culture-specific information about the format of the returned string if `format` is a standard format string. The `formatProvider` parameter can be any of the following: @@ -4401,14 +4401,14 @@ The following example defines an array of object that defines the formatting of the returned string. -- A custom object that implements the interface. Its method returns a object that provides formatting information. +- A custom object that implements the interface. Its method returns a object that provides formatting information. If `formatProvider` is `null`, the object that is associated with the current culture is used. ## Examples - The following example uses the method to parse several string representations of time intervals using various format strings and cultures. + The following example uses the method to parse several string representations of time intervals using various format strings and cultures. :::code language="csharp" source="~/snippets/csharp/System/TimeSpan/ParseExact/parseexactexample1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TimeSpan/ParseExact/parseexactexample1.fs" id="Snippet1"::: @@ -4498,12 +4498,12 @@ The following example defines an array of method parses the string representation of a time interval, which must be in one of the formats defined by the `formats` parameter, except that leading and trailing white-space characters are ignored. Because `input` must exactly conform to one of the formats specified in `formats`, you should always use exception handling when converting a string input by the user to a time interval. If you prefer not to use exception handling, you can call the method instead. + The method parses the string representation of a time interval, which must be in one of the formats defined by the `formats` parameter, except that leading and trailing white-space characters are ignored. Because `input` must exactly conform to one of the formats specified in `formats`, you should always use exception handling when converting a string input by the user to a time interval. If you prefer not to use exception handling, you can call the method instead. The `formats` parameter is a string array whose elements consist of either a single standard format specifier, or one or more custom format specifiers that define the required format of `input`. For more information about valid format strings, see [Standard TimeSpan Format Strings](/dotnet/standard/base-types/standard-timespan-format-strings) and [Custom TimeSpan Format Strings](/dotnet/standard/base-types/custom-timespan-format-strings). `input` must correspond exactly to a member of `formats` for the parse operation to succeed. The parse operation attempts to match `input` to each element in `formats` starting with the first element in the array. > [!IMPORTANT] -> The method uses the conventions of the culture specified by the `formatProvider` parameter only if the format string used to parse `input` is a standard format string whose value is either "g" or "G". The "c", "t", and "T" standard format strings use the formatting conventions of the invariant culture. Custom format strings define the precise format of the input string and use literal characters to separate the components of a time interval. +> The method uses the conventions of the culture specified by the `formatProvider` parameter only if the format string used to parse `input` is a standard format string whose value is either "g" or "G". The "c", "t", and "T" standard format strings use the formatting conventions of the invariant culture. Custom format strings define the precise format of the input string and use literal characters to separate the components of a time interval. The `formatProvider` parameter is an implementation that provides culture-specific information about the format of the returned string if the format string used to parse `input` is a standard format string. The `formatProvider` parameter can be any of the following: @@ -4511,14 +4511,14 @@ The following example defines an array of object that defines the formatting of the returned string. -- A custom object that implements the interface. Its method returns a object that provides formatting information. +- A custom object that implements the interface. Its method returns a object that provides formatting information. If `formatProvider` is `null`, the object that is associated with the current culture is used. ## Examples - The following example calls the method to convert each element of a string array to a value. The example interprets the strings using the formatting conventions of the French - France ("fr-FR") culture. The strings can represent a time interval in either the general short format or the general long format. + The following example calls the method to convert each element of a string array to a value. The example interprets the strings using the formatting conventions of the French - France ("fr-FR") culture. The strings can represent a time interval in either the general short format or the general long format. In addition, the example changes the way in which the time interval parsing methods interpret a single digit. Ordinarily, a single digit is interpreted as the number of days in a time interval. Instead, the `%h` custom format string is used to interpret a single digit as the number of hours. For this change to be effective, note that the `%h` custom format string must precede the other format strings in the `formats` array. @@ -4737,12 +4737,12 @@ The following example defines an array of method parses the string representation of a time interval, which must be in the format defined by the `format` parameter, except that leading and trailing white-space characters are ignored. Because `input` must conform to the format of `format` exactly, you should always use exception handling when converting a string input by the user to a time interval. If you prefer not to use exception handling, you can call the method instead. + The method parses the string representation of a time interval, which must be in the format defined by the `format` parameter, except that leading and trailing white-space characters are ignored. Because `input` must conform to the format of `format` exactly, you should always use exception handling when converting a string input by the user to a time interval. If you prefer not to use exception handling, you can call the method instead. The `format` parameter is a string that contains either a single standard format specifier, or one or more custom format specifiers that define the required format of `input`. For more information about valid format strings, see [Standard TimeSpan Format Strings](/dotnet/standard/base-types/standard-timespan-format-strings) and [Custom TimeSpan Format Strings](/dotnet/standard/base-types/custom-timespan-format-strings). > [!IMPORTANT] -> The method uses the conventions of the culture specified by the `formatProvider` parameter only if `format` is a standard format string whose value is either "g" or "G". The "c", "t", and "T" standard format strings use the formatting conventions of the invariant culture. Custom format strings define the precise format of the input string and use literal characters to separate the components of a time interval. +> The method uses the conventions of the culture specified by the `formatProvider` parameter only if `format` is a standard format string whose value is either "g" or "G". The "c", "t", and "T" standard format strings use the formatting conventions of the invariant culture. Custom format strings define the precise format of the input string and use literal characters to separate the components of a time interval. The `formatProvider` parameter is an implementation that provides culture-specific information about the format of the returned string if `format` is a standard format string. The `formatProvider` parameter can be any of the following: @@ -4750,7 +4750,7 @@ The following example defines an array of object that defines the formatting of the returned string. -- A custom object that implements the interface. Its method returns a object that provides formatting information. +- A custom object that implements the interface. Its method returns a object that provides formatting information. If `formatProvider` is `null`, the object that is associated with the current culture is used. @@ -4759,7 +4759,7 @@ The following example defines an array of method to parse several string representations of time intervals using various format strings and cultures. It also uses the value to interpret each string as a negative time interval. The output from the example illustrates that the style affects the return value only when it is used with custom format strings. + The following example uses the method to parse several string representations of time intervals using various format strings and cultures. It also uses the value to interpret each string as a negative time interval. The output from the example illustrates that the style affects the return value only when it is used with custom format strings. :::code language="csharp" source="~/snippets/csharp/System/TimeSpan/ParseExact/parseexactexample2.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/TimeSpan/ParseExact/parseexactexample2.fs" id="Snippet2"::: @@ -4853,12 +4853,12 @@ The following example defines an array of method parses the string representation of a time interval, which must be in one of the formats defined by the `formats` parameter, except that leading and trailing white-space characters are ignored. Because `input` must exactly conform to one of the formats specified in `formats`, you should always use exception handling when converting a string input by the user to a time interval. If you prefer not to use exception handling, you can call the method instead. + The method parses the string representation of a time interval, which must be in one of the formats defined by the `formats` parameter, except that leading and trailing white-space characters are ignored. Because `input` must exactly conform to one of the formats specified in `formats`, you should always use exception handling when converting a string input by the user to a time interval. If you prefer not to use exception handling, you can call the method instead. The `formats` parameter is a string array whose elements consist of either a single standard format specifier, or one or more custom format specifiers that define the required format of `input`. For more information about valid format strings, see [Standard TimeSpan Format Strings](/dotnet/standard/base-types/standard-timespan-format-strings) and [Custom TimeSpan Format Strings](/dotnet/standard/base-types/custom-timespan-format-strings). `input` must correspond exactly to a member of `formats` for the parse operation to succeed. The parse operation attempts to match `input` to each element in `formats` starting with the first element in the array. > [!IMPORTANT] -> The method uses the conventions of the culture specified by the `formatProvider` parameter only if the format string used to parse `input` is a standard format string whose value is either "g" or "G". The "c", "t", and "T" standard format strings use the formatting conventions of the invariant culture. Custom format strings define the precise format of the input string and use literal characters to separate the components of a time interval. +> The method uses the conventions of the culture specified by the `formatProvider` parameter only if the format string used to parse `input` is a standard format string whose value is either "g" or "G". The "c", "t", and "T" standard format strings use the formatting conventions of the invariant culture. Custom format strings define the precise format of the input string and use literal characters to separate the components of a time interval. The `formatProvider` parameter is an implementation that provides culture-specific information about the format of the returned string if the format string used to parse `input` is a standard format string. The `formatProvider` parameter can be any of the following: @@ -4866,7 +4866,7 @@ The following example defines an array of object that defines the formatting of the returned string. -- A custom object that implements the interface. Its method returns a object that provides formatting information. +- A custom object that implements the interface. Its method returns a object that provides formatting information. If `formatProvider` is `null`, the object that is associated with the current culture is used. @@ -4875,7 +4875,7 @@ The following example defines an array of method to convert each element of a string array to a value. The strings can represent a time interval in either the general short format or the general long format. + The following example calls the method to convert each element of a string array to a value. The strings can represent a time interval in either the general short format or the general long format. In addition, the example changes the way in which the time interval parsing methods interpret a single digit. Ordinarily, a single digit is interpreted as the number of days in a time interval. Instead, the `%h` custom format string is used to interpret a single digit as the number of hours. For this change to be effective, note that the `%h` custom format string must precede the other format strings in the `formats` array. Also note from the output that the flag specified in the method call is used only when parsing a string with this format specifier. @@ -5116,7 +5116,7 @@ The following example defines an array of method to calculate the difference between a single value and each of the time intervals in an array. Note that, because format strings do not include negative signs in the result string, the example uses conditional logic to include a negative sign with negative time intervals. + The following example uses the method to calculate the difference between a single value and each of the time intervals in an array. Note that, because format strings do not include negative signs in the result string, the example uses conditional logic to include a negative sign with negative time intervals. :::code language="csharp" source="~/snippets/csharp/System/TimeSpan/Subtract/subtract1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TimeSpan/Subtract/subtract1.fs" id="Snippet1"::: @@ -5694,7 +5694,7 @@ The value of this constant is 10. |"*fffffff*"|Fractional seconds in the time interval. This element is omitted if the time interval does not include fractional seconds. If present, fractional seconds are always expressed using seven decimal digits.| ## Examples - The following example displays the strings returned by calling the method with a number of values. Note that although the example does not call the method directly, it is called by the method when it attempts to convert a value to its string representation. + The following example displays the strings returned by calling the method with a number of values. Note that although the example does not call the method directly, it is called by the method when it attempts to convert a value to its string representation. :::code language="csharp" source="~/snippets/csharp/System/TimeSpan/ToString/ToString1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TimeSpan/ToString/ToString1.fs" id="Snippet1"::: @@ -5879,14 +5879,14 @@ The value of this constant is 10. - A object that defines the formatting of the returned string. -- A custom object that implements the interface. Its method returns a object that provides formatting information. +- A custom object that implements the interface. Its method returns a object that provides formatting information. If `formatProvider` is `null`, the object that is associated with the current culture is used. If `format` is a custom format string, the `formatProvider` parameter is ignored. ## Examples - The following example calls the method to format two time intervals. The example calls the method twice for each format string, first to display it using the conventions of the en-US culture and then to display it using the conventions of the fr-FR culture. + The following example calls the method to format two time intervals. The example calls the method twice for each format string, first to display it using the conventions of the en-US culture and then to display it using the conventions of the fr-FR culture. :::code language="csharp" source="~/snippets/csharp/System/TimeSpan/ToString/tostring4.cs" id="Snippet4"::: :::code language="fsharp" source="~/snippets/fsharp/System/TimeSpan/ToString/tostring4.fs" id="Snippet4"::: @@ -6578,7 +6578,7 @@ The property represents whole and fracti For more information about this API, see Supplemental API remarks for TimeSpan.TryParse. method to create objects from valid strings and to indicate when the parse operation has failed because the time span string is invalid. +The following example uses the method to create objects from valid strings and to indicate when the parse operation has failed because the time span string is invalid. :::code language="csharp" source="~/snippets/csharp/System/TimeSpan/TryParse/TryParse1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TimeSpan/TryParse/TryParse1.fs" id="Snippet1"::: @@ -6703,7 +6703,7 @@ The following example uses the method to crea For more information about this API, see Supplemental API remarks for TimeSpan.TryParse. objects, and uses each object in calls to the method to parse the elements in a string array. The example illustrates how the conventions of a specific culture influence the formatting operation. +The following example defines an array of objects, and uses each object in calls to the method to parse the elements in a string array. The example illustrates how the conventions of a specific culture influence the formatting operation. :::code language="csharp" source="~/snippets/csharp/System/TimeSpan/TryParse/tryparse2.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/TimeSpan/TryParse/tryparse2.fs" id="Snippet2"::: @@ -6931,12 +6931,12 @@ The following example defines an array of method parses the string representation of a time interval, which must be in the format defined by the `format` parameter, except that leading and trailing white-space characters are ignored. This method is similar to the method, except that it does not throw an exception if the conversion fails. + The method parses the string representation of a time interval, which must be in the format defined by the `format` parameter, except that leading and trailing white-space characters are ignored. This method is similar to the method, except that it does not throw an exception if the conversion fails. The `format` parameter is a string that contains either a single standard format specifier, or one or more custom format specifiers that define the required format of `input`. For more information about valid format strings, see [Standard TimeSpan Format Strings](/dotnet/standard/base-types/standard-timespan-format-strings) and [Custom TimeSpan Format Strings](/dotnet/standard/base-types/custom-timespan-format-strings). > [!IMPORTANT] -> The method uses the conventions of the culture specified by the `formatProvider` parameter only if `format` is a standard format string whose value is either "g" or "G". The "c", "t", and "T" standard format strings use the formatting conventions of the invariant culture. Custom format strings define the precise format of the input string and use literal characters to separate the components of a time interval. +> The method uses the conventions of the culture specified by the `formatProvider` parameter only if `format` is a standard format string whose value is either "g" or "G". The "c", "t", and "T" standard format strings use the formatting conventions of the invariant culture. Custom format strings define the precise format of the input string and use literal characters to separate the components of a time interval. The `formatProvider` parameter is an implementation that provides culture-specific information about the format of the returned string if `format` is a standard format string. The `formatProvider` parameter can be any of the following: @@ -6944,14 +6944,14 @@ The following example defines an array of object that defines the formatting of the returned string. -- A custom object that implements the interface. Its method returns a object that provides formatting information. +- A custom object that implements the interface. Its method returns a object that provides formatting information. If `formatProvider` is `null`, the object that is associated with the current culture is used. ## Examples - The following example uses the method to parse several string representations of time intervals using various format strings and cultures. + The following example uses the method to parse several string representations of time intervals using various format strings and cultures. :::code language="csharp" source="~/snippets/csharp/System/TimeSpan/TryParseExact/tryparseexactexample1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TimeSpan/TryParseExact/tryparseexactexample1.fs" id="Snippet1"::: @@ -7039,12 +7039,12 @@ The following example defines an array of method parses the string representation of a time interval, which must be in the format defined by one of the format strings specified by the `formats` parameter, except that leading and trailing white-space characters are ignored. This method is similar to the method, except that it does not throw an exception if the conversion fails. + The method parses the string representation of a time interval, which must be in the format defined by one of the format strings specified by the `formats` parameter, except that leading and trailing white-space characters are ignored. This method is similar to the method, except that it does not throw an exception if the conversion fails. The `formats` parameter is a string array whose elements consist of either a single standard format specifier, or one or more custom format specifiers that define the required format of `input`. For more information about valid format strings, see [Standard TimeSpan Format Strings](/dotnet/standard/base-types/standard-timespan-format-strings) and [Custom TimeSpan Format Strings](/dotnet/standard/base-types/custom-timespan-format-strings). `input` must correspond exactly to a member of `formats` for the parse operation to succeed. The parse operation attempts to match `input` to each element in `formats` starting with the first element in the array. > [!IMPORTANT] -> The method uses the conventions of the culture specified by the `formatProvider` parameter only if the format string used to parse `input` is a standard format string whose value is either "g" or "G". The "c", "t", and "T" standard format strings use the formatting conventions of the invariant culture. Custom format strings define the precise format of the input string and use literal characters to separate the components of a time interval. +> The method uses the conventions of the culture specified by the `formatProvider` parameter only if the format string used to parse `input` is a standard format string whose value is either "g" or "G". The "c", "t", and "T" standard format strings use the formatting conventions of the invariant culture. Custom format strings define the precise format of the input string and use literal characters to separate the components of a time interval. The `formatProvider` parameter is an implementation that provides culture-specific information about the format of the returned string if the format string used to parse `input` is a standard format string. The `formatProvider` parameter can be any of the following: @@ -7052,14 +7052,14 @@ The following example defines an array of object that defines the formatting of the returned string. -- A custom object that implements the interface. Its method returns a object that provides formatting information. +- A custom object that implements the interface. Its method returns a object that provides formatting information. If `formatProvider` is `null`, the object that is associated with the current culture is used. ## Examples - The following example calls the method to convert each element of a string array to a value. The example interprets the strings by using the formatting conventions of the French - France ("fr-FR") culture. The strings can represent a time interval in either the general short format or the general long format. + The following example calls the method to convert each element of a string array to a value. The example interprets the strings by using the formatting conventions of the French - France ("fr-FR") culture. The strings can represent a time interval in either the general short format or the general long format. In addition, the example changes the way in which the time interval parsing methods interpret a single digit. Ordinarily, a single digit is interpreted as the number of days in a time interval. Instead, the `%h` custom format string is used to interpret a single digit as the number of hours. For this change to be effective, note that the `%h` custom format string must precede the other format strings in the `formats` array. @@ -7284,7 +7284,7 @@ The following example defines an array of method parses the string representation of a time interval, which must be in the format defined by the `format` parameter, except that leading and trailing white-space characters are ignored. This method is similar to the method, except that it does not throw an exception if the conversion fails. + The method parses the string representation of a time interval, which must be in the format defined by the `format` parameter, except that leading and trailing white-space characters are ignored. This method is similar to the method, except that it does not throw an exception if the conversion fails. The `format` parameter is a string that contains either a single standard format specifier, or one or more custom format specifiers that define the required format of `input`. For more information about valid format strings, see [Standard TimeSpan Format Strings](/dotnet/standard/base-types/standard-timespan-format-strings) and [Custom TimeSpan Format Strings](/dotnet/standard/base-types/custom-timespan-format-strings). @@ -7294,7 +7294,7 @@ The following example defines an array of object that defines the formatting of the returned string. -- A custom object that implements the interface. Its method returns a object that provides formatting information. +- A custom object that implements the interface. Its method returns a object that provides formatting information. If `formatProvider` is `null`, the object that is associated with the current culture is used. @@ -7303,7 +7303,7 @@ The following example defines an array of method to parse several string representations of time intervals using various format strings and cultures. It also uses the value to interpret each string as a negative time interval. The output from the example illustrates that the style affects the return value only when it is used with custom format strings. + The following example uses the method to parse several string representations of time intervals using various format strings and cultures. It also uses the value to interpret each string as a negative time interval. The output from the example illustrates that the style affects the return value only when it is used with custom format strings. :::code language="csharp" source="~/snippets/csharp/System/TimeSpan/TryParseExact/tryparseexactexample2.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/TimeSpan/TryParseExact/tryparseexactexample2.fs" id="Snippet2"::: @@ -7393,12 +7393,12 @@ The following example defines an array of method parses the string representation of a time interval, which must be in the format defined by one of the format strings specified by the `formats` parameter, except that leading and trailing white-space characters are ignored. This method is similar to the method, except that it does not throw an exception if the conversion fails. + The method parses the string representation of a time interval, which must be in the format defined by one of the format strings specified by the `formats` parameter, except that leading and trailing white-space characters are ignored. This method is similar to the method, except that it does not throw an exception if the conversion fails. The `formats` parameter is a string array whose elements consist of either a single standard format specifier, or one or more custom format specifiers that define the required format of `input`. For more information about valid format strings, see [Standard TimeSpan Format Strings](/dotnet/standard/base-types/standard-timespan-format-strings) and [Custom TimeSpan Format Strings](/dotnet/standard/base-types/custom-timespan-format-strings). `input` must correspond exactly to a member of `formats` for the parse operation to succeed. The parse operation attempts to match `input` to each element in `formats` starting with the first element in the array. > [!IMPORTANT] -> The method uses the conventions of the culture specified by the `formatProvider` parameter only if the format string used to parse `input` is a standard format string whose value is either "g" or "G". The "c", "t", and "T" standard format strings use the formatting conventions of the invariant culture. Custom format strings define the precise format of the input string and use literal characters to separate the components of a time interval. +> The method uses the conventions of the culture specified by the `formatProvider` parameter only if the format string used to parse `input` is a standard format string whose value is either "g" or "G". The "c", "t", and "T" standard format strings use the formatting conventions of the invariant culture. Custom format strings define the precise format of the input string and use literal characters to separate the components of a time interval. The `formatProvider` parameter is an implementation that provides culture-specific information about the format of the returned string if the format string used to parse `input` is a standard format string. The `formatProvider` parameter can be any of the following: @@ -7406,7 +7406,7 @@ The following example defines an array of object that defines the formatting of the returned string. -- A custom object that implements the interface. Its method returns a object that provides formatting information. +- A custom object that implements the interface. Its method returns a object that provides formatting information. If `formatProvider` is `null`, the object that is associated with the current culture is used. @@ -7415,7 +7415,7 @@ The following example defines an array of method to convert each element of a string array to a value. The strings can represent a time interval in either the general short format or the general long format. + The following example calls the method to convert each element of a string array to a value. The strings can represent a time interval in either the general short format or the general long format. In addition, the example changes the way in which the time interval parsing methods interpret a single digit. Ordinarily, a single digit is interpreted as the number of days in a time interval. Instead, the `%h` custom format string is used to interpret a single digit as the number of hours. For this change to be effective, note that the `%h` custom format string must precede the other format strings in the `formats` array. Also note from the output that the flag specified in the method call is used only when parsing a string with this format specifier. diff --git a/xml/System/TimeZone.xml b/xml/System/TimeZone.xml index d4b35f91134..150c50ae3bc 100644 --- a/xml/System/TimeZone.xml +++ b/xml/System/TimeZone.xml @@ -283,7 +283,7 @@ ## Remarks Only one daylight saving time period per year is supported. - If daylight saving time is not used in the current time zone, the return value is a object, where the value of and is , and the value of is a initialized to 0 ticks. + If daylight saving time is not used in the current time zone, the return value is a object, where the value of and is , and the value of is a initialized to 0 ticks. ]]> @@ -348,12 +348,12 @@ The method interprets the time zone of `time` based on its property. If the value of the property is or , the method returns the offset of the local time zone. If the value of the property is , the method returns an offset equal to . - If the local time zone observes daylight saving time, applies the current adjustment rule to `time` when determining the offset of the local time zone. That is, the offset returned by reflects whether `time` falls in the time zone's standard time or its daylight saving time. + If the local time zone observes daylight saving time, applies the current adjustment rule to `time` when determining the offset of the local time zone. That is, the offset returned by reflects whether `time` falls in the time zone's standard time or its daylight saving time. > [!NOTE] -> The method recognizes only the current daylight saving time adjustment rule for the local time zone. As a result, it is guaranteed to accurately return the UTC offset of a local time only during the period in which the latest adjustment rule is in effect. It may return inaccurate results if `time` is a historic date and time value that was subject to a previous adjustment rule. +> The method recognizes only the current daylight saving time adjustment rule for the local time zone. As a result, it is guaranteed to accurately return the UTC offset of a local time only during the period in which the latest adjustment rule is in effect. It may return inaccurate results if `time` is a historic date and time value that was subject to a previous adjustment rule. - The method corresponds to the method. Whenever possible, use the method. + The method corresponds to the method. Whenever possible, use the method. Because the date and time value represented by `time` and this value's offset from UTC are not tightly coupled, a local or unspecified date and time value can return a different offset value when run on different computers or when run on the same computer under different time zones. If this behavior is undesirable, use a value instead. The data type tightly couples a date and time value with its offset from UTC. @@ -422,7 +422,7 @@ ## Remarks The year to which the daylight saving time period applies is derived from the `time` parameter. - Because the class supports a single daylight saving time adjustment rule, the method applies the current adjustment rule to any date, regardless of whether the adjustment rule was in effect on that date. Assuming that the operating system itself has accurate historic daylight saving time data, a more accurate result is available by using the method. Whenever possible, use the method. + Because the class supports a single daylight saving time adjustment rule, the method applies the current adjustment rule to any date, regardless of whether the adjustment rule was in effect on that date. Assuming that the operating system itself has accurate historic daylight saving time data, a more accurate result is available by using the method. Whenever possible, use the method. ]]> @@ -479,7 +479,7 @@ method provides the same functionality as this overload of the method. Whenever possible, use the method. + The method provides the same functionality as this overload of the method. Whenever possible, use the method. ]]> @@ -594,12 +594,12 @@ |A local time ().|No conversion necessary.|The same value represented by the `time` parameter.| |An unspecified time ().|Assumes that the time is UTC and converts it from UTC to the local time.|A object whose value is the local time that corresponds to `time`.| - If the local time zone observes daylight saving time, applies the current adjustment rule to `time` when performing the conversion. + If the local time zone observes daylight saving time, applies the current adjustment rule to `time` when performing the conversion. > [!NOTE] -> The method recognizes only the current daylight saving time adjustment rule for the local time zone. As a result, it is guaranteed to accurately return the local time corresponding to a particular UTC time only during the period in which the latest adjustment rule is in effect. It may return inaccurate results if `time` is a historic date and time value that was subject to a previous adjustment rule. +> The method recognizes only the current daylight saving time adjustment rule for the local time zone. As a result, it is guaranteed to accurately return the local time corresponding to a particular UTC time only during the period in which the latest adjustment rule is in effect. It may return inaccurate results if `time` is a historic date and time value that was subject to a previous adjustment rule. - The method corresponds to the method with its `destinationTimeZone` parameter set to . Whenever possible, use the method. + The method corresponds to the method with its `destinationTimeZone` parameter set to . Whenever possible, use the method. ]]> @@ -656,16 +656,16 @@ applies the current adjustment rule to the `time` parameter when performing the conversion. + If the local time zone observes daylight saving time, applies the current adjustment rule to the `time` parameter when performing the conversion. > [!NOTE] -> The method recognizes only the current daylight saving time adjustment rule for the local time zone. As a result, it is guaranteed to accurately return the Coordinated Universal Time (UTC) corresponding to a particular local time only during the period in which the latest adjustment rule is in effect. It may return inaccurate results if `time` is a historic date and time value that was subject to a previous adjustment rule. +> The method recognizes only the current daylight saving time adjustment rule for the local time zone. As a result, it is guaranteed to accurately return the Coordinated Universal Time (UTC) corresponding to a particular local time only during the period in which the latest adjustment rule is in effect. It may return inaccurate results if `time` is a historic date and time value that was subject to a previous adjustment rule. If the `time` parameter is an ambiguous time, the method assumes that it is a standard time. (An ambiguous time is one that can map either to a standard time or to a daylight saving time in the local time zone.) If `time` is an invalid time, the method simply subtracts the local time from the local time zone's UTC offset to return UTC. (An invalid time is one that does not exist because of the application of daylight saving time adjustment rules.) Because `time` is interpreted in relation to the current time zone on the current system, the date and time returned by this method can differ if an application is run on different computers or on the same computer with different time zones. For cases in which a date and time value must represent a single, unambiguous point in time, use a value to represent the local time. - The method corresponds to the method overload with a parameter whose property does not equal . Whenever possible, use the method overload. + The method corresponds to the method overload with a parameter whose property does not equal . Whenever possible, use the method overload. ]]> diff --git a/xml/System/TimeZoneInfo+AdjustmentRule.xml b/xml/System/TimeZoneInfo+AdjustmentRule.xml index d3069485ebe..e99b942076c 100644 --- a/xml/System/TimeZoneInfo+AdjustmentRule.xml +++ b/xml/System/TimeZoneInfo+AdjustmentRule.xml @@ -80,7 +80,7 @@ > [!NOTE] > An instance of the class is immutable. Once an object has been created, its values cannot be modified. - To create a object, call the `static` (`Shared` in Visual Basic) method. You can then supply an array of objects to two of the overloads of the method. To retrieve the adjustment rules of a particular time zone, call its method, which returns an array of objects. + To create a object, call the `static` (`Shared` in Visual Basic) method. You can then supply an array of objects to two of the overloads of the method. To retrieve the adjustment rules of a particular time zone, call its method, which returns an array of objects. @@ -238,10 +238,10 @@ W. Central Africa Standard Time has no adjustment rules objects returned by calls to this method can then be passed as the `adjustmentRules` parameter to two overloads of the method. The example illustrates this procedure. + You can use this method to create one or more adjustment rules for a custom time zone. An array of the objects returned by calls to this method can then be passed as the `adjustmentRules` parameter to two overloads of the method. The example illustrates this procedure. > [!NOTE] -> The method can be used only to define an adjustment rule for a new time zone; it cannot be used to modify an adjustment rule for an existing time zone. +> The method can be used only to define an adjustment rule for a new time zone; it cannot be used to modify an adjustment rule for an existing time zone. The `dateStart` and `dateEnd` parameters must be date values without a time component or an is thrown. The time component can be removed by retrieving a value from the date and time's property as shown in the following statements: @@ -254,15 +254,15 @@ dateVariable.Date The property of the `dateStart` and `dateEnd` parameters must also be . - The value of the `daylightDelta` parameter can range from -14 to 14. The sum of the `daylightDelta` parameter and the `baseUtcOffset` parameter used in the call to the method must also range from -14 to 14 or an is thrown. + The value of the `daylightDelta` parameter can range from -14 to 14. The sum of the `daylightDelta` parameter and the `baseUtcOffset` parameter used in the call to the method must also range from -14 to 14 or an is thrown. > [!NOTE] -> The `daylightDelta` parameter defines the difference between a time zone's standard time and its daylight saving time. It is not intended to define the time zone's standard time offset from Coordinated Universal Time (UTC). The class assumes that this offset from UTC is constant throughout the life of the time zone. To reflect a change in a time zone's offset from UTC that is not caused by the application of an adjustment rule, you must use the method to create a new custom time zone. +> The `daylightDelta` parameter defines the difference between a time zone's standard time and its daylight saving time. It is not intended to define the time zone's standard time offset from Coordinated Universal Time (UTC). The class assumes that this offset from UTC is constant throughout the life of the time zone. To reflect a change in a time zone's offset from UTC that is not caused by the application of an adjustment rule, you must use the method to create a new custom time zone. ## Examples - The following example creates an alternate Central Standard Time zone and defines three adjustment rules for the periods 1976-1986, 1987-2006, and 2007 and beyond. These rules are added to a generic object whose elements are then copied to a array. This array is then used in the call to the method. + The following example creates an alternate Central Standard Time zone and defines three adjustment rules for the periods 1976-1986, 1987-2006, and 2007 and beyond. These rules are added to a generic object whose elements are then copied to a array. This array is then used in the call to the method. :::code language="csharp" source="~/snippets/csharp/System/TimeZoneInfo+AdjustmentRule/Overview/System.TimeZone2.AdjustmentRule.Class.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TimeZoneInfo+AdjustmentRule/Overview/System.TimeZone2.AdjustmentRule.Class.fs" id="Snippet1"::: @@ -535,7 +535,7 @@ TimeZoneTime = BaseUtcOffset + DaylightDelta + UtcTime The value of the property can range from 14 hours to -14 hours. > [!NOTE] -> The property measures the difference between the time zone's standard time and its daylight saving time. It does not apply to changes in a time zone's standard offset from Coordinated Universal Time (UTC). To represent a time zone that has changed its standard time offset from UTC, you must call the method to create a new time zone. +> The property measures the difference between the time zone's standard time and its daylight saving time. It does not apply to changes in a time zone's standard offset from Coordinated Universal Time (UTC). To represent a time zone that has changed its standard time offset from UTC, you must call the method to create a new time zone. The most common value of the property is 1.0 hours. The application of the daylight saving time adjustment rule increases the time zone's offset from Coordinated Universal Time (UTC) by one hour. @@ -743,12 +743,12 @@ TimeZoneTime = BaseUtcOffset + DaylightDelta + UtcTime objects are equal, the method compares the member values of each object. Two adjustment rules are equal if they have the same effective dates, the same delta, and identical values for the objects returned by their and properties. + To determine whether two objects are equal, the method compares the member values of each object. Two adjustment rules are equal if they have the same effective dates, the same delta, and identical values for the objects returned by their and properties. ## Examples - The following example calls the method to compare the adjustment rules for Central Standard Time with those for Canada Central Standard Time and Mexico Standard Time. + The following example calls the method to compare the adjustment rules for Central Standard Time with those for Canada Central Standard Time and Mexico Standard Time. :::code language="csharp" source="~/snippets/csharp/System/TimeZoneInfo+AdjustmentRule/Overview/System.TimeZone2.AdjustmentRule.Class.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/TimeZoneInfo+AdjustmentRule/Overview/System.TimeZone2.AdjustmentRule.Class.fs" id="Snippet2"::: diff --git a/xml/System/TimeZoneInfo+TransitionTime.xml b/xml/System/TimeZoneInfo+TransitionTime.xml index ce820b8df2e..17a907b671e 100644 --- a/xml/System/TimeZoneInfo+TransitionTime.xml +++ b/xml/System/TimeZoneInfo+TransitionTime.xml @@ -93,9 +93,9 @@ > [!NOTE] > An instance of the structure is immutable. Once an object has been created, its values cannot be modified. - A object can be created by calling the `static` (`Shared` in Visual Basic) and methods to create a fixed or floating-date rule, respectively. The starting and ending objects are then supplied as parameters to the method to create a new adjustment rule that includes this transition time information. + A object can be created by calling the `static` (`Shared` in Visual Basic) and methods to create a fixed or floating-date rule, respectively. The starting and ending objects are then supplied as parameters to the method to create a new adjustment rule that includes this transition time information. - The and properties of an object return a object. + The and properties of an object return a object. ]]> @@ -323,7 +323,7 @@ ## Remarks The property returns a valid value only if the property is `true`. - The property value corresponds to the value of the `day` parameter of the method. If its value is greater than the number of days in the month of the transition, the transition occurs on the last day of the month. + The property value corresponds to the value of the `day` parameter of the method. If its value is greater than the number of days in the month of the transition, the transition occurs on the last day of the month. The property indicates the day of the month on which a fixed-date rule is applied (for example, April 15). In contrast, the property indicates the day of the week on which a floating-date rule is applied (for example, the second Sunday of November). @@ -475,7 +475,7 @@ ## Examples - The following example illustrates calls to the method. + The following example illustrates calls to the method. :::code language="csharp" source="~/snippets/csharp/System/TimeZoneInfo+TransitionTime/CreateFixedDateRule/System.TimeZone2.TransitionTime.Class.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TimeZoneInfo+TransitionTime/CreateFixedDateRule/System.TimeZone2.TransitionTime.Class.fs" id="Snippet1"::: @@ -543,7 +543,7 @@ ## Examples - The following example illustrates calls to the method. + The following example illustrates calls to the method. :::code language="csharp" source="~/snippets/csharp/System/TimeZoneInfo+TransitionTime/CreateFixedDateRule/System.TimeZone2.TransitionTime.Class.cs" id="Snippet7"::: :::code language="fsharp" source="~/snippets/fsharp/System/TimeZoneInfo+TransitionTime/CreateFixedDateRule/System.TimeZone2.TransitionTime.Class.fs" id="Snippet7"::: @@ -794,7 +794,7 @@ ## Remarks Two objects are equal if they have identical values for each of their six properties. Otherwise, they are unequal. - The equivalent method for this operator is .]]> + The equivalent method for this operator is .]]> @@ -861,7 +861,7 @@ ## Remarks Two objects are unequal if they have different values for any of their six properties. Otherwise, they are equal. - The equivalent method for this operator is .]]> + The equivalent method for this operator is .]]> @@ -1018,9 +1018,9 @@ value represents the time of the transition in the time zone's standard time. For transitions from daylight saving time to standard time, it represents the time of the transition in the time zone's daylight saving time. + For transitions from standard time to daylight saving time, the value represents the time of the transition in the time zone's standard time. For transitions from daylight saving time to standard time, it represents the time of the transition in the time zone's daylight saving time. - The property defines only the time of a time change, but not its date. The date is determined by the and properties for fixed-rule changes, and by the , , and properties for floating-rule changes. The date component of this value is ignored; the value of the year, month, and day is always 1. + The property defines only the time of a time change, but not its date. The date is determined by the and properties for fixed-rule changes, and by the , , and properties for floating-rule changes. The date component of this value is ignored; the value of the year, month, and day is always 1. The property is used for both fixed-date and floating-date transitions. @@ -1088,11 +1088,11 @@ |If the Week property value is|The transition occurs on| |-----------------------------------|------------------------------| -|1|The first occurrence of the value in .| -|2|The second occurrence of the value in .| -|3|The third occurrence of the value in .| -|4|The fourth occurrence of the value in .| -|5|The last occurrence of the value in .| +|1|The first occurrence of the value in .| +|2|The second occurrence of the value in .| +|3|The third occurrence of the value in .| +|4|The fourth occurrence of the value in .| +|5|The last occurrence of the value in .| For example, if a transition occurs on the first Sunday of March, the value of the property is 1. If it occurs on the last Sunday of March, the value of the property is 5. diff --git a/xml/System/TimeZoneInfo.xml b/xml/System/TimeZoneInfo.xml index 9252d1e590c..fc863e8bb0b 100644 --- a/xml/System/TimeZoneInfo.xml +++ b/xml/System/TimeZoneInfo.xml @@ -113,14 +113,14 @@ |Static member name|Description| |------------------------|-----------------| -| method|Creates a custom time zone from application-supplied data.| -| method|Instantiates a time zone based on its identifier.| -| method|Deserializes a string value to re-create a previously serialized object.| -| method|Returns an enumerable of objects that represents all time zones that are available on the local system.| +| method|Creates a custom time zone from application-supplied data.| +| method|Instantiates a time zone based on its identifier.| +| method|Deserializes a string value to re-create a previously serialized object.| +| method|Returns an enumerable of objects that represents all time zones that are available on the local system.| | property|Instantiates a object that represents the local time zone.| | property|Instantiates a object that represents the UTC zone.| - You can use the method to create a time zone that is not defined in the local system registry on Windows systems or by the [ICU Library's Time Zone Data](https://unicode-org.github.io/icu/userguide/datetime/timezone/) on Linux or macOS. You can then use the property to save the time zone object's information as a string, which can be stored in some form that is accessible to the application. You can use the method to convert a serialized string back to a object. + You can use the method to create a time zone that is not defined in the local system registry on Windows systems or by the [ICU Library's Time Zone Data](https://unicode-org.github.io/icu/userguide/datetime/timezone/) on Linux or macOS. You can then use the property to save the time zone object's information as a string, which can be stored in some form that is accessible to the application. You can use the method to convert a serialized string back to a object. ]]> @@ -177,16 +177,16 @@ ## Remarks The time span returned by the property can range from 14 hours (for a time zone that is 14 hours ahead of Coordinated Universal Time (UTC)) to -14 hours (for a time zone that is 14 hours behind UTC). Time zones that are ahead of UTC have a positive offset; time zones that are behind UTC have a negative offset. - The value is represented as a whole number of minutes. It cannot include a fractional number of minutes. + The value is represented as a whole number of minutes. It cannot include a fractional number of minutes. > [!NOTE] -> Because is a property of the object rather than the object, the class applies a single offset from UTC to all of a time zone's adjustments. To reflect a time zone that has modified its offset from UTC, you must create a new time zone using the method. +> Because is a property of the object rather than the object, the class applies a single offset from UTC to all of a time zone's adjustments. To reflect a time zone that has modified its offset from UTC, you must create a new time zone using the method. - The property differs from the method in the following ways: + The property differs from the method in the following ways: -- The property returns the difference between UTC and the time zone's standard time; the method returns the difference between UTC and the time zone's time at a particular point in time. +- The property returns the difference between UTC and the time zone's standard time; the method returns the difference between UTC and the time zone's time at a particular point in time. -- The method reflects the application of any adjustment rules to the time zone; the property does not. +- The method reflects the application of any adjustment rules to the time zone; the property does not. @@ -251,7 +251,7 @@ You might call the `ClearCachedData` method to reduce the memory devoted to the application's cache of time zone information or to reflect the fact that the local system's time zone has changed. - Storing references to the local and UTC time zones is not recommended. After the call to the `ClearCachedData` method, these object variables will be undefined objects that are no longer references to or . For example, in the following code, the second call to the method throws an because the `local` variable is no longer considered equal to . + Storing references to the local and UTC time zones is not recommended. After the call to the `ClearCachedData` method, these object variables will be undefined objects that are no longer references to or . For example, in the following code, the second call to the method throws an because the `local` variable is no longer considered equal to . :::code language="csharp" source="~/snippets/csharp/System/TimeZoneInfo/ClearCachedData/System.TimeZone2.BestPractices.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TimeZoneInfo/ClearCachedData/System.TimeZone2.BestPractices.fs" id="Snippet1"::: @@ -330,34 +330,34 @@ method applies any adjustment rules in effect in the `destinationTimeZone` time zone. + When performing the conversion, the method applies any adjustment rules in effect in the `destinationTimeZone` time zone. - This overload of the method determines the source time zone from the value of the `dateTime` parameter's property, as the following table shows. + This overload of the method determines the source time zone from the value of the `dateTime` parameter's property, as the following table shows. |Kind property value|Source time zone|Method behavior| |-------------------------|----------------------|---------------------| -|||Converts the local time to the time in `destinationTimeZone`.| -|||Converts Coordinated Universal Time (UTC) to the time in `destinationTimeZone`.| -||Assumed to be .|Converts the local time to the time in `destinationTimeZone`.| +|||Converts the local time to the time in `destinationTimeZone`.| +|||Converts Coordinated Universal Time (UTC) to the time in `destinationTimeZone`.| +||Assumed to be .|Converts the local time to the time in `destinationTimeZone`.| The property of the returned value is set as shown in the following table. |Condition|Returned Kind property value| |---------------|----------------------------------| -|The `destinationTimeZone` is .|| -|The `destinationTimeZone` is .|| +|The `destinationTimeZone` is .|| +|The `destinationTimeZone` is .|| |All other date and time values and destination time zones.|| If the value of the `dateTime` parameter is an ambiguous local time, it is interpreted as a standard time. If the `dateTime` parameter is an invalid local time, this method throws an . If the conversion of `dateTime` results in a date and time value that is earlier than or later than , this method returns or , respectively. - You can also convert to or from UTC by calling the and methods. + You can also convert to or from UTC by calling the and methods. ## Examples - The following example converts an array of date and time values to times in the Eastern Time zone of the U.S. and Canada. It shows that the source time zone depends on the property of the source value. It also illustrates that the method takes time zone adjustments into account, because a time zone adjustment occurs in both the source and destination time zones at 2:00 A.M. on November 7, 2010. + The following example converts an array of date and time values to times in the Eastern Time zone of the U.S. and Canada. It shows that the source time zone depends on the property of the source value. It also illustrates that the method takes time zone adjustments into account, because a time zone adjustment occurs in both the source and destination time zones at 2:00 A.M. on November 7, 2010. :::code language="csharp" source="~/snippets/csharp/System/TimeZoneInfo/ConvertTime/converttime1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TimeZoneInfo/ConvertTime/converttime1.fs" id="Snippet1"::: @@ -425,9 +425,9 @@ method applies any adjustment rules in effect in the `destinationTimeZone` time zone. + When performing the conversion, the method applies any adjustment rules in effect in the `destinationTimeZone` time zone. - This overload differs from the other overloads of the method by accepting a value as its first parameter. This identifies the date and time as an offset from Coordinated Universal Time (UTC) rather than as the date and time in a particular time zone. As a result, the `dateTimeOffset` parameter cannot represent either an ambiguous time or an invalid time. + This overload differs from the other overloads of the method by accepting a value as its first parameter. This identifies the date and time as an offset from Coordinated Universal Time (UTC) rather than as the date and time in a particular time zone. As a result, the `dateTimeOffset` parameter cannot represent either an ambiguous time or an invalid time. In converting the `dateTimeOffset` value to the time in the destination time zone, this method takes into account any adjustment rules in effect in the destination time zone. @@ -436,7 +436,7 @@ ## Examples - The following example converts an array of values to times in the Eastern Time zone of the U.S. and Canada. It illustrates that the method takes time zone adjustments into account, because a time zone adjustment occurs in both the source and destination time zones at 2:00 A.M. on November 7, 2010. + The following example converts an array of values to times in the Eastern Time zone of the U.S. and Canada. It illustrates that the method takes time zone adjustments into account, because a time zone adjustment occurs in both the source and destination time zones at 2:00 A.M. on November 7, 2010. :::code language="csharp" source="~/snippets/csharp/System/TimeZoneInfo/ConvertTime/converttime2.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/TimeZoneInfo/ConvertTime/converttime2.fs" id="Snippet2"::: @@ -503,38 +503,38 @@ method applies any adjustment rules in effect in the `destinationTimeZone` time zone. + When performing the conversion, the method applies any adjustment rules in effect in the `destinationTimeZone` time zone. The value of the property of the `dateTime` parameter must correspond to the `sourceTimeZone` parameter, as the following table shows. |DateTime.Kind value|sourceTimeZone value|Method behavior| |-------------------------|--------------------------|---------------------| -||Equals .|Converts `dateTime` to the destination time zone's time.| -||Does not equal .|Throws an .| -||Equals .|Converts `dateTime` to the destination time zone's time.| -||Does not equal .|Throws an .| +||Equals .|Converts `dateTime` to the destination time zone's time.| +||Does not equal .|Throws an .| +||Equals .|Converts `dateTime` to the destination time zone's time.| +||Does not equal .|Throws an .| ||Any.|Converts `dateTime` to the destination time zone's time.| - You can also convert to or from Coordinated Universal Time (UTC) by calling the and methods. + You can also convert to or from Coordinated Universal Time (UTC) by calling the and methods. The property of the returned value is set as shown in the following table. |Condition|Returned Kind property value| |---------------|----------------------------------| -|The `destinationTimeZone` argument is .|| -|The `destinationTimeZone` argument is .|| +|The `destinationTimeZone` argument is .|| +|The `destinationTimeZone` argument is .|| |All other date and time values, source time zones, and destination time zones.|| If the value of the `dateTime` parameter is an ambiguous time in the source time zone, it is interpreted as a standard time. If the `dateTime` parameter is an invalid time in the source time zone, this method throws an . If the conversion of `dateTime` results in a date and time value that is earlier than or later than , this method returns or , respectively. - The method throws an exception if the property of the `dateTime` argument is but the `sourceTimeZone` argument is not . To determine whether the source time zone is the local time zone or the universal time zone, the method tests for reference equality instead of testing for value equality with the method. Note that objects that represent the local time zone and that are retrieved by calling the method do not have referential equality with . Furthermore, objects that represent the local or universal time zone and that are retrieved by iterating the collection returned by the method do not have referential equality with or . As an alternative, you can call the method. + The method throws an exception if the property of the `dateTime` argument is but the `sourceTimeZone` argument is not . To determine whether the source time zone is the local time zone or the universal time zone, the method tests for reference equality instead of testing for value equality with the method. Note that objects that represent the local time zone and that are retrieved by calling the method do not have referential equality with . Furthermore, objects that represent the local or universal time zone and that are retrieved by iterating the collection returned by the method do not have referential equality with or . As an alternative, you can call the method. ## Examples - The following example illustrates the use of the method to convert from Hawaiian Standard Time to local time. + The following example illustrates the use of the method to convert from Hawaiian Standard Time to local time. :::code language="csharp" source="~/snippets/csharp/System/TimeZoneInfo/ConvertTime/TimeZone2Concepts.cs" id="Snippet9"::: :::code language="fsharp" source="~/snippets/fsharp/System/TimeZoneInfo/ConvertTime/TimeZone2Concepts.fs" id="Snippet9"::: @@ -622,17 +622,17 @@ method applies any adjustment rules in effect in the `destinationTimeZoneId` time zone. + When performing the conversion, the method applies any adjustment rules in effect in the `destinationTimeZoneId` time zone. - This overload is largely identical to calling the method, except that it allows you to specify the destination time zone by its identifier rather than by an object reference. This method is most useful when you must convert a time without retrieving the time zone object that corresponds to it and you do not need to know whether the converted time is standard or daylight saving time. + This overload is largely identical to calling the method, except that it allows you to specify the destination time zone by its identifier rather than by an object reference. This method is most useful when you must convert a time without retrieving the time zone object that corresponds to it and you do not need to know whether the converted time is standard or daylight saving time. - The method determines the source time zone from the value of the `dateTime` parameter's property, as the following table shows. + The method determines the source time zone from the value of the `dateTime` parameter's property, as the following table shows. |Kind property value|Source time zone|Method behavior| |-------------------------|----------------------|---------------------| -|||Converts the local time to the time in `destinationTimeZone`.| -|||Converts Coordinated Universal Time (UTC) to the time in `destinationTimeZone`.| -||Assumed to be .|Converts the local time to the time in `destinationTimeZone`.| +|||Converts the local time to the time in `destinationTimeZone`.| +|||Converts Coordinated Universal Time (UTC) to the time in `destinationTimeZone`.| +||Assumed to be .|Converts the local time to the time in `destinationTimeZone`.| The property of the returned value is set as shown in the following table. @@ -645,7 +645,7 @@ If the conversion of `dateTime` results in a date and time value that is earlier than or later than , this method returns or , respectively. - This method retrieves information on the time zone whose identifier is specified by the `destinationTimeZoneId` parameter from the registry on Windows systems and from the [ICU Library](https://unicode-org.github.io/icu/userguide/datetime/timezone/) on Linux and macOS. It cannot retrieve a time zone object that is created using the method. The `destinationTimeZoneId` parameter must correspond exactly to the time zone's identifier in length, but not in case, for a successful match to occur; that is, the comparison of `destinationTimeZoneId` with time zone identifiers is case-insensitive. + This method retrieves information on the time zone whose identifier is specified by the `destinationTimeZoneId` parameter from the registry on Windows systems and from the [ICU Library](https://unicode-org.github.io/icu/userguide/datetime/timezone/) on Linux and macOS. It cannot retrieve a time zone object that is created using the method. The `destinationTimeZoneId` parameter must correspond exactly to the time zone's identifier in length, but not in case, for a successful match to occur; that is, the comparison of `destinationTimeZoneId` with time zone identifiers is case-insensitive. ]]> @@ -708,13 +708,13 @@ method applies any adjustment rules in effect in the `destinationTimeZoneId` time zone. + When performing the conversion, the method applies any adjustment rules in effect in the `destinationTimeZoneId` time zone. - This overload is identical to calling the method, except that it allows you to specify the destination time zone by its identifier rather than by an object reference. This method is most useful when you must convert a time without retrieving the time zone object that corresponds to it and you do not need to know whether the converted time is standard or daylight saving time. + This overload is identical to calling the method, except that it allows you to specify the destination time zone by its identifier rather than by an object reference. This method is most useful when you must convert a time without retrieving the time zone object that corresponds to it and you do not need to know whether the converted time is standard or daylight saving time. Because the `dateTimeOffset` parameter represents a date and time together with that time's offset from Coordinated Universal Time (UTC), it cannot represent either an ambiguous time or an invalid time. - This method retrieves the time zone whose identifier is specified by the `destinationTimeZoneId` parameter from the registry on Windows systems and from the [ICU Library](https://unicode-org.github.io/icu/userguide/datetime/timezone/) on Linux and macOS. It cannot retrieve a time zone object that is created using the method. The `destinationTimeZoneId` parameter must correspond exactly to the time zone's identifier in length, but not in case, for a successful match to occur; that is, the comparison of `destinationTimeZoneId` with time zone identifiers is case-insensitive. + This method retrieves the time zone whose identifier is specified by the `destinationTimeZoneId` parameter from the registry on Windows systems and from the [ICU Library](https://unicode-org.github.io/icu/userguide/datetime/timezone/) on Linux and macOS. It cannot retrieve a time zone object that is created using the method. The `destinationTimeZoneId` parameter must correspond exactly to the time zone's identifier in length, but not in case, for a successful match to occur; that is, the comparison of `destinationTimeZoneId` with time zone identifiers is case-insensitive. In converting the `dateTimeOffset` value to the time in the destination time zone, the method takes into account any adjustment rules in effect in the destination time zone. @@ -783,11 +783,11 @@ method applies any adjustment rules in effect in the `destinationTimeZoneId` time zone. + When performing the conversion, the method applies any adjustment rules in effect in the `destinationTimeZoneId` time zone. - Although it is similar to the method, you can use to specify the source and destination time zones using their identifiers instead of their objects. This method is most useful when you must convert a time without retrieving the time zone object that corresponds to it and you do not need to know whether the converted time is standard or daylight saving time. + Although it is similar to the method, you can use to specify the source and destination time zones using their identifiers instead of their objects. This method is most useful when you must convert a time without retrieving the time zone object that corresponds to it and you do not need to know whether the converted time is standard or daylight saving time. - This method retrieves the time zones whose identifiers are the `sourceTimeZoneId` and `destinationTimeZoneId` parameters from the registry on Windows systems and from the [ICU Library](https://unicode-org.github.io/icu/userguide/datetime/timezone/) on Linux and macOS. It cannot retrieve time zone objects that are created using the method. + This method retrieves the time zones whose identifiers are the `sourceTimeZoneId` and `destinationTimeZoneId` parameters from the registry on Windows systems and from the [ICU Library](https://unicode-org.github.io/icu/userguide/datetime/timezone/) on Linux and macOS. It cannot retrieve time zone objects that are created using the method. The value of the property of the `dateTime` parameter must correspond to the `sourceTimeZoneId` parameter, as the following table shows. @@ -799,7 +799,7 @@ ||Does not equal `TimeZoneInfo.Local.Id`.|Throws an .| ||Any.|Converts `dateTime` to the destination time zone's time.| - Because it relies on calls to the method, the method performs a case-insensitive search to locate the time zones that correspond to `sourceTimeZoneId` and `destinationTimeZoneId`. + Because it relies on calls to the method, the method performs a case-insensitive search to locate the time zones that correspond to `sourceTimeZoneId` and `destinationTimeZoneId`. If the value of the `dateTime` parameter is an ambiguous time in the source time zone, it is interpreted as a standard time. If the `dateTime` parameter is an invalid time in the source time zone, this method throws an . @@ -808,7 +808,7 @@ ## Examples - The following example uses the method to display the time that corresponds to the local system time in eight cities of the world. + The following example uses the method to display the time that corresponds to the local system time in eight cities of the world. :::code language="csharp" source="~/snippets/csharp/System/TimeZoneInfo/ConvertTimeBySystemTimeZoneId/System.TimeZone2.Conversions.cs" id="Snippet3"::: :::code language="fsharp" source="~/snippets/fsharp/System/TimeZoneInfo/ConvertTimeBySystemTimeZoneId/System.TimeZone2.Conversions.fs" id="Snippet3"::: @@ -888,7 +888,7 @@ method applies any adjustment rules in effect in the `destinationTimeZone` time zone. + When performing the conversion, the method applies any adjustment rules in effect in the `destinationTimeZone` time zone. The precise behavior of this method depends on the value of the property of the `dateTime` parameter, as the following table shows. @@ -987,7 +987,7 @@ If `dateTime` corresponds to an ambiguous local time, this method assumes that it is standard local time. If `dateTime` corresponds to an invalid local time, the method throws an . > [!NOTE] -> If the current computer's local time zone includes multiple adjustment rules, this overload of the method can return results that differ from the and methods. always applies the current adjustment rule to time zone conversion, whether or not `dateTime` lies within its date range. And when executing on .NET Framework 3.5, also applies the current adjustment rule to time zone conversion, whether or not `dateTime` lies within its date range. +> If the current computer's local time zone includes multiple adjustment rules, this overload of the method can return results that differ from the and methods. always applies the current adjustment rule to time zone conversion, whether or not `dateTime` lies within its date range. And when executing on .NET Framework 3.5, also applies the current adjustment rule to time zone conversion, whether or not `dateTime` lies within its date range. If the UTC equivalent of `dateTime` is earlier than or later that , this method returns or , respectively. @@ -1060,7 +1060,7 @@ property of the `dateTime` parameter equals and the `sourceTimeZone` parameter equals , this method returns `dateTime` without performing any conversion. + If the property of the `dateTime` parameter equals and the `sourceTimeZone` parameter equals , this method returns `dateTime` without performing any conversion. If `dateTime` corresponds to an ambiguous time, this method assumes that it is the standard time of the source time zone. If `dateTime` corresponds to an invalid time, this method throws an . @@ -1172,16 +1172,16 @@ method is suitable for creating a time zone that has no adjustments (that is, a time zone that does not support daylight saving time). To define a time zone that includes adjustments for daylight saving time, use either the or the method. + This overload of the method is suitable for creating a time zone that has no adjustments (that is, a time zone that does not support daylight saving time). To define a time zone that includes adjustments for daylight saving time, use either the or the method. - The following table shows the relationship between the parameters that are provided to the method and the properties of the object that are returned by the method call. + The following table shows the relationship between the parameters that are provided to the method and the properties of the object that are returned by the method call. |CreateCustomTimeZone parameter|TimeZoneInfo property| |------------------------------------|---------------------------| -|`id`|| -|`baseUtcOffset`|| -|`displayName`|| -|`standardDisplayName`|| +|`id`|| +|`baseUtcOffset`|| +|`displayName`|| +|`standardDisplayName`|| Typically, the time zone's standard time name and its identifier are the same. However, the length of the time zone's identifier should not exceed 32 characters. The string passed to the `displayName` parameter follows a fairly standard format. The first portion of the display name is the time zone's base offset from Coordinated Universal Time, which is indicated by the acronym GMT (for Greenwich Mean Time), enclosed in parentheses. This is followed by a string that identifies the time zone itself, or one or more of the cities, regions, or countries in the time zone, or both. For example: @@ -1290,18 +1290,18 @@ method is suitable for creating a time zone that supports daylight saving time. To define a time zone that does not support daylight saving time, use either the or the method. + This overload of the method is suitable for creating a time zone that supports daylight saving time. To define a time zone that does not support daylight saving time, use either the or the method. - The following table shows the relationship between the parameters that are provided to the method and the members of the object that are returned by the method call. + The following table shows the relationship between the parameters that are provided to the method and the members of the object that are returned by the method call. |CreateCustomTimeZone parameter|TimeZoneInfo member| |------------------------------------|-------------------------| -|`id`|| -|`baseUtcOffset`|| -|`displayName`|| -|`standardDisplayName`|| -|`daylightDisplayName`|| -|`adjustmentRules`|An array of objects returned by the method.| +|`id`|| +|`baseUtcOffset`|| +|`displayName`|| +|`standardDisplayName`|| +|`daylightDisplayName`|| +|`adjustmentRules`|An array of objects returned by the method.| Typically, the time zone's standard time name and its identifier are the same. However, the length of the time zone's identifier should not exceed 32 characters. The string passed to the `displayName` parameter follows a fairly standard format. The first portion of the display name is the time zone's base offset from Coordinated Universal Time, which is indicated by the acronym GMT (for Greenwich Mean Time), enclosed in parentheses. This is followed by a string that identifies the time zone itself, or one or more of the cities, regions, or countries in the time zone, or both. For example: @@ -1315,9 +1315,9 @@ A time zone's adjustment rules are defined by doing the following: -1. Calling either the or the method to define the starting and ending transition time for each adjustment rule. +1. Calling either the or the method to define the starting and ending transition time for each adjustment rule. -2. Calling the method for each adjustment rule. +2. Calling the method for each adjustment rule. 3. Assigning the adjustment rules to an array that can be passed as the `adjustmentRules` parameter. @@ -1442,19 +1442,19 @@ method to create a custom time zone whose support for daylight saving time can be determined by conditions at run time. + You can use this overload of the method to create a custom time zone whose support for daylight saving time can be determined by conditions at run time. - The following table shows the relationship between the parameters that are provided to the method and the members of the object that are returned by the method call. + The following table shows the relationship between the parameters that are provided to the method and the members of the object that are returned by the method call. |CreateCustomTimeZone parameter|TimeZoneInfo property| |------------------------------------|---------------------------| -|`id`|| -|`baseUtcOffset`|| -|`displayName`|| -|`standardDisplayName`|| -|`daylightDisplayName`| if `disableDaylightSavingTime` is `false`; if `disableDaylightSavingTime` is `true`.| -|`adjustmentRules`|An array of objects returned by the method if `disableDaylightSavingTime` is `false`; an empty array returned by the method if `disableDaylightSavingTime` is `true`.| -|`disableDaylightSavingTime`|Not .| +|`id`|| +|`baseUtcOffset`|| +|`displayName`|| +|`standardDisplayName`|| +|`daylightDisplayName`| if `disableDaylightSavingTime` is `false`; if `disableDaylightSavingTime` is `true`.| +|`adjustmentRules`|An array of objects returned by the method if `disableDaylightSavingTime` is `false`; an empty array returned by the method if `disableDaylightSavingTime` is `true`.| +|`disableDaylightSavingTime`|Not .| Typically, the time zone's standard time name and its identifier are the same. However, the length of the time zone's identifier should not exceed 32 characters. The string passed to the `displayName` parameter follows a fairly standard format. The first portion of the display name is the time zone's base offset from Coordinated Universal Time, which is indicated by the acronym GMT (for Greenwich Mean Time), enclosed in parentheses. This is followed by a string that identifies the time zone itself, or one or more of the cities, regions, or countries in the time zone, or both. For example: @@ -1466,16 +1466,16 @@ A time zone's adjustment rules are defined by doing the following: -1. Calling either the or the method to define the starting and ending transition rules for each adjustment rule. +1. Calling either the or the method to define the starting and ending transition rules for each adjustment rule. -2. Calling the method for each adjustment rule. +2. Calling the method for each adjustment rule. 3. Assigning the adjustment rules to an array that can be passed as the `adjustmentRules` parameter. - If `disableDaylightSavingTime` parameter is `false`, the operation of this method is identical to the overload. If `disableDaylightSavingTime` is `true`, the returned object includes no adjustment rules and a property whose value is an empty string. + If `disableDaylightSavingTime` parameter is `false`, the operation of this method is identical to the overload. If `disableDaylightSavingTime` is `true`, the returned object includes no adjustment rules and a property whose value is an empty string. ## Examples - The following example creates a custom time zone for the Palmer station and Anvers Island in Antarctica. It sets the `disableDaylightSavingTime` parameter in the call to the method to `true`. It then displays the new time zone's daylight saving time name, if one is present, and the number of adjustment rules to confirm that the new time zone has no daylight saving time information. + The following example creates a custom time zone for the Palmer station and Anvers Island in Antarctica. It sets the `disableDaylightSavingTime` parameter in the call to the method to `true`. It then displays the new time zone's daylight saving time name, if one is present, and the number of adjustment rules to confirm that the new time zone has no daylight saving time information. :::code language="csharp" source="~/snippets/csharp/System/TimeZoneInfo/CreateCustomTimeZone/System.TimeZone2.CreateTimeZone.cs" id="Snippet3"::: :::code language="fsharp" source="~/snippets/fsharp/System/TimeZoneInfo/CreateCustomTimeZone/System.TimeZone2.CreateTimeZone.fs" id="Snippet3"::: @@ -1564,14 +1564,14 @@ A property whose value is not or `null` does not necessarily indicate that the time zone supports daylight saving time. To determine whether the time zone supports daylight saving time, check the value of its property. - In most cases, the `DaylightName` property of system-defined time zones is not or `null`. However, the property of custom time zones can be set to . This occurs when custom time zones are created by the or the overload and the `disableDaylightSavingTime` parameter is `true`. Therefore, your code should never assume that the value of the property is not `null` or empty. + In most cases, the `DaylightName` property of system-defined time zones is not or `null`. However, the property of custom time zones can be set to . This occurs when custom time zones are created by the or the overload and the `disableDaylightSavingTime` parameter is `true`. Therefore, your code should never assume that the value of the property is not `null` or empty. The property is equivalent to the property of the class. ## Examples - The following example defines a method named `DisplayDateWithTimeZoneName` that uses the method to determine whether to display a time zone's standard time name or daylight saving time name. + The following example defines a method named `DisplayDateWithTimeZoneName` that uses the method to determine whether to display a time zone's standard time name or daylight saving time name. :::code language="csharp" source="~/snippets/csharp/System/TimeZoneInfo/DaylightName/IsDaylightSavingTime.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TimeZoneInfo/DaylightName/IsDaylightSavingTime.fs" id="Snippet1"::: @@ -1732,7 +1732,7 @@ ## Examples - The following example uses the method to determine whether the local time zone is Pacific Time or Eastern Time. + The following example uses the method to determine whether the local time zone is Pacific Time or Eastern Time. :::code language="csharp" source="~/snippets/csharp/System/TimeZoneInfo/Equals/equals1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TimeZoneInfo/Equals/equals1.fs" id="Snippet1"::: @@ -1813,7 +1813,7 @@ - They have the same adjustment rules. - returns the Boolean value that results from evaluating the following expression: + returns the Boolean value that results from evaluating the following expression: ```csharp other.Id == this.Id && HasSameRules(other); @@ -1828,7 +1828,7 @@ ## Examples - The following example uses the method to determine whether the local time zone is Pacific Time or Eastern Time. + The following example uses the method to determine whether the local time zone is Pacific Time or Eastern Time. :::code language="csharp" source="~/snippets/csharp/System/TimeZoneInfo/BaseUtcOffset/TimeZone2_Examples.cs" id="Snippet7"::: :::code language="fsharp" source="~/snippets/fsharp/System/TimeZoneInfo/BaseUtcOffset/TimeZone2_Examples.fs" id="Snippet7"::: @@ -1890,20 +1890,20 @@ ## Remarks -The `id` parameter must correspond exactly to the time zone's identifier in length, but not in case, for a successful match to occur; that is, the comparison of `id` with time zone identifiers is case-insensitive. If you want to retrieve time zone objects based on partial matches, you can write custom procedures that work with the read-only collection of objects returned by the method. +The `id` parameter must correspond exactly to the time zone's identifier in length, but not in case, for a successful match to occur; that is, the comparison of `id` with time zone identifiers is case-insensitive. If you want to retrieve time zone objects based on partial matches, you can write custom procedures that work with the read-only collection of objects returned by the method. On Windows systems, `FindSystemTimeZoneById` tries to match `id` to the subkey names of the HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Time Zones branch of the registry. Starting with .NET 6, Windows systems also support IANA time zone identifiers (such as "America/Los_Angeles" or "Pacific/Auckland"), providing cross-platform time zone resolution. IANA IDs are supported on Windows only if NLS isn't enabled and globalization invariant mode isn't enabled. On Linux and macOS, it uses time zone information available in the [ICU Library](https://unicode-org.github.io/icu/userguide/datetime/timezone/). -If the registry or the library does not have the information for the time zone you desire, you can create a particular time zone either by calling one of the overloads of the method or by calling to deserialize a object that represents the required time zone. -However, time zones created by these method calls are not system-defined time and cannot be retrieved using the method. -These custom time zones can be accessed only through the object reference returned by the or method call. +If the registry or the library does not have the information for the time zone you desire, you can create a particular time zone either by calling one of the overloads of the method or by calling to deserialize a object that represents the required time zone. +However, time zones created by these method calls are not system-defined time and cannot be retrieved using the method. +These custom time zones can be accessed only through the object reference returned by the or method call. In .NET 7 and earlier versions, this method returns a new instance for each method call. This might impact performance in applications that call the `FindSystemTimeZoneById` method repeatedly with the same identifier. (In .NET 8 and later versions, this method always returns a cached instance.) ## Examples -The following example uses the method to retrieve the Tokyo Standard Time zone. This object is then used to convert the local time to the time in Tokyo and to determine whether it is Tokyo Standard Time or Tokyo Daylight Time. +The following example uses the method to retrieve the Tokyo Standard Time zone. This object is then used to convert the local time to the time in Tokyo and to determine whether it is Tokyo Standard Time or Tokyo Daylight Time. :::code language="csharp" source="~/snippets/csharp/System/TimeZoneInfo/ConvertTimeBySystemTimeZoneId/convertdt2.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/TimeZoneInfo/ConvertTimeBySystemTimeZoneId/convertdt2.fs" id="Snippet2"::: @@ -1969,7 +1969,7 @@ The following example uses the method in a standalone executable or use an application's setup program to save the time zone as a string. The application can then retrieve this string from its storage location and instantiate it using the method. + There is an alternative to providing all the code required to create a time zone that is not found in the registry on Windows or in the [ICU Library](https://unicode-org.github.io/icu/userguide/) on Linux and macOS. You can define a custom time zone and either use the method in a standalone executable or use an application's setup program to save the time zone as a string. The application can then retrieve this string from its storage location and instantiate it using the method. @@ -2035,13 +2035,13 @@ The following example uses the method retrieves an array of objects. Each object in the array defines the effective start and end date of that time zone adjustment, as well as its delta (the exact amount by which the adjustment causes the time to change). In addition, two properties return objects that define when each annual transition to and from standard time occurs. + The method retrieves an array of objects. Each object in the array defines the effective start and end date of that time zone adjustment, as well as its delta (the exact amount by which the adjustment causes the time to change). In addition, two properties return objects that define when each annual transition to and from standard time occurs. - If a time zone has multiple adjustment rules, they are generally ordered from earliest (at index 0) to latest (at index - 1). + If a time zone has multiple adjustment rules, they are generally ordered from earliest (at index 0) to latest (at index - 1). - If a time zone has no adjustment rules, the method returns an empty array (an array whose is zero). + If a time zone has no adjustment rules, the method returns an empty array (an array whose is zero). - Any modifications to the elements of the array returned by the method are not reflected in the adjustment rules that belong to a particular time zone. To modify a time zone's adjustment rules (such as to reflect its historical transition to and from daylight saving time) you must create a new time zone with the appropriate adjustment rules, rather than modify the existing one. + Any modifications to the elements of the array returned by the method are not reflected in the adjustment rules that belong to a particular time zone. To modify a time zone's adjustment rules (such as to reflect its historical transition to and from daylight saving time) you must create a new time zone with the appropriate adjustment rules, rather than modify the existing one. @@ -2128,9 +2128,9 @@ The following example uses the | or |Returns ambiguous time offsets for `dateTime`.| -|||Converts `dateTime` to the local time, and then returns ambiguous time offsets for that time.| -||Any value.|Throws an .| +|| or |Returns ambiguous time offsets for `dateTime`.| +|||Converts `dateTime` to the local time, and then returns ambiguous time offsets for that time.| +||Any value.|Throws an .| |Any other time zone.| or |Converts `dateTime` to the specified time zone, and then determines whether that time is ambiguous.| |Any other time zone.||Determines whether `dateTime` is ambiguous in the specified time zone.| @@ -2139,7 +2139,7 @@ The following example uses the method to map an ambiguous time to its possible corresponding Coordinated Universal Time (UTC) times. + The following example defines a method named `ShowPossibleUtcTimes` that uses the method to map an ambiguous time to its possible corresponding Coordinated Universal Time (UTC) times. :::code language="csharp" source="~/snippets/csharp/System/TimeZoneInfo/GetAmbiguousTimeOffsets/System.TimeZone2.GetAmbiguousTimeOffsets.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TimeZoneInfo/GetAmbiguousTimeOffsets/System.TimeZone2.GetAmbiguousTimeOffsets.fs" id="Snippet1"::: @@ -2276,7 +2276,7 @@ The following example uses the method, see . + For additional detail about the method, see . ]]> @@ -2344,18 +2344,18 @@ The following example uses the method retrieves all available time zone information from the subkeys of the registry's HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Time Zones key on Windows systems and from the [ICU Library](https://unicode-org.github.io/icu/userguide/datetime/timezone/) on Linux and macOS. If it is unable to successfully retrieve and parse values for particular string properties of individual objects, this method sets their value to an empty string (""). + The method retrieves all available time zone information from the subkeys of the registry's HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Time Zones key on Windows systems and from the [ICU Library](https://unicode-org.github.io/icu/userguide/datetime/timezone/) on Linux and macOS. If it is unable to successfully retrieve and parse values for particular string properties of individual objects, this method sets their value to an empty string (""). > [!IMPORTANT] -> The method returns a collection of objects only for time zones defined in the Windows registry or the ICU library. It does not include time zones created using the overloads of the method. These are accessible only through the object reference returned by the time zone creation method. +> The method returns a collection of objects only for time zones defined in the Windows registry or the ICU library. It does not include time zones created using the overloads of the method. These are accessible only through the object reference returned by the time zone creation method. - The collection returned by this method is sorted by UTC offset and, for time zones that have the same UTC offset, by the display name using the current culture. For information about the display name, see . + The collection returned by this method is sorted by UTC offset and, for time zones that have the same UTC offset, by the display name using the current culture. For information about the display name, see . - The object returned by this method supports the interface, which means that it can be iterated using the `foreach` (in C#) or `For Each…Next` (in Visual Basic) statements. Each iteration of the loop provides the next object in the collection. + The object returned by this method supports the interface, which means that it can be iterated using the `foreach` (in C#) or `For Each…Next` (in Visual Basic) statements. Each iteration of the loop provides the next object in the collection. - The collection of objects represents time zones defined on the local computer; it does not necessarily provide complete information for all time zones during all time periods. If your application requires time zones not found on the local computer, you can create custom time zones using the overloads of the method. For more information, see [How to: Create Time Zones Without Adjustment Rules](/dotnet/standard/datetime/create-time-zones-without-adjustment-rules) and [How to: Create Time Zones with Adjustment Rules](/dotnet/standard/datetime/create-time-zones-with-adjustment-rules). + The collection of objects represents time zones defined on the local computer; it does not necessarily provide complete information for all time zones during all time periods. If your application requires time zones not found on the local computer, you can create custom time zones using the overloads of the method. For more information, see [How to: Create Time Zones Without Adjustment Rules](/dotnet/standard/datetime/create-time-zones-without-adjustment-rules) and [How to: Create Time Zones with Adjustment Rules](/dotnet/standard/datetime/create-time-zones-with-adjustment-rules). - You can also determine whether an individual time zone is defined on the local computer by calling the method and providing the identifier of the time zone you want to retrieve as a parameter. + You can also determine whether an individual time zone is defined on the local computer by calling the method and providing the identifier of the time zone you want to retrieve as a parameter. @@ -2482,12 +2482,12 @@ The following example uses the property does not correspond to the time zone object, this method performs the necessary conversion before returning a result. For example, this can occur if the property is but the time zone object is not the local time zone. If `dateTime` is ambiguous, or if the converted time is ambiguous, this method interprets the ambiguous time as a standard time. If `dateTime` is invalid, this method returns a object that reflects the difference between UTC and the time zone's standard time. - The method is similar in operation to the method of the class. + The method is similar in operation to the method of the class. ## Examples - The following example illustrates the use of the method with different time zones and with date values that have different property values. + The following example illustrates the use of the method with different time zones and with date values that have different property values. :::code language="csharp" source="~/snippets/csharp/System/TimeZoneInfo/GetUtcOffset/System.TimeZone2.GetUtcOffset.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TimeZoneInfo/GetUtcOffset/System.TimeZone2.GetUtcOffset.fs" id="Snippet1"::: @@ -2642,7 +2642,7 @@ The following example uses the method, the method indicates whether two time zones have the same base offset (as defined by the property) and the same adjustment rules. Unlike the method, does not compare time zone identifiers (as defined by the property). + Like the method, the method indicates whether two time zones have the same base offset (as defined by the property) and the same adjustment rules. Unlike the method, does not compare time zone identifiers (as defined by the property). @@ -2795,23 +2795,23 @@ The time zone identifier is a key string that uniquely identifies a particular t ## Remarks An ambiguous time falls within a range of times for the current time zone. This means it can be either a standard time or a time that results from the application of an adjustment rule. Typically, ambiguous times result when the clock is set to return to standard time from daylight saving time. See the Example section for an illustration. - Coordinated Universal Time (UTC) has no ambiguous times; neither do time zones that do not support daylight saving time. Therefore, these time zones have no adjustment rules and calls to the method always return `false`. + Coordinated Universal Time (UTC) has no ambiguous times; neither do time zones that do not support daylight saving time. Therefore, these time zones have no adjustment rules and calls to the method always return `false`. For time zones that do observe daylight saving time, the precise behavior of this method depends on the relationship between the property and the object, as the following table shows. |TimeZoneInfo object type|Kind property value|Behavior| |------------------------------|-------------------------|--------------| -|| or |Determines whether the `dateTime` parameter is ambiguous.| -|||Converts `dateTime` to the local time and then determines whether that time is ambiguous.| -|| or |Returns `false`.| -|||If `dateTime` is ambiguous, assumes it is a standard time, converts it to UTC, and returns `false`.| +|| or |Determines whether the `dateTime` parameter is ambiguous.| +|||Converts `dateTime` to the local time and then determines whether that time is ambiguous.| +|| or |Returns `false`.| +|||If `dateTime` is ambiguous, assumes it is a standard time, converts it to UTC, and returns `false`.| |Any other time zone.| or |Converts `dateTime` to the time in the specified time zone and then determines whether that time is ambiguous.| |Any other time zone.||Determines whether `dateTime` is ambiguous.| ## Examples - In the Pacific Time zone, daylight saving time ends at 2:00 A.M. on November 4, 2007. The following example passes the time at one-minute intervals from 12:59 A.M. on November 4, 2007, to 2:01 A.M. on November 4, 2007, to the method of a object that represents the Pacific Time zone. The console output indicates that all times from 1:00 A.M. on November 4, 2007, to 1:59 A.M. on November 4, 2007, are ambiguous. + In the Pacific Time zone, daylight saving time ends at 2:00 A.M. on November 4, 2007. The following example passes the time at one-minute intervals from 12:59 A.M. on November 4, 2007, to 2:01 A.M. on November 4, 2007, to the method of a object that represents the Pacific Time zone. The console output indicates that all times from 1:00 A.M. on November 4, 2007, to 1:59 A.M. on November 4, 2007, are ambiguous. :::code language="csharp" source="~/snippets/csharp/System/TimeZoneInfo/BaseUtcOffset/TimeZone2_Examples.cs" id="Snippet8"::: :::code language="fsharp" source="~/snippets/fsharp/System/TimeZoneInfo/BaseUtcOffset/TimeZone2_Examples.fs" id="Snippet8"::: @@ -2952,23 +2952,23 @@ The time zone identifier is a key string that uniquely identifies a particular t is affected by the relationship between the time zone represented by the object and the property of the `dateTime` parameter, as the following table shows. + The return value of is affected by the relationship between the time zone represented by the object and the property of the `dateTime` parameter, as the following table shows. |TimeZoneInfo object|DateTime.Kind property|Result| |-------------------------|----------------------------|------------| -||`DateTimeKind.Local`|Determines whether `dateTime` is daylight saving time.| -||`DateTimeKind.Utc`|Converts `dateTime` from Coordinated Universal Time (UTC) to local time and determines whether it is daylight saving time.| -||`DateTimeKind.Unspecified`|Assumes that `dateTime` represents local time and determines whether it is daylight saving time.| -||`DateTimeKind.Local`, `DateTimeKind.Unspecified`, or `DateTimeKind.Utc`|Returns `false` (UTC does not support daylight saving time).| +||`DateTimeKind.Local`|Determines whether `dateTime` is daylight saving time.| +||`DateTimeKind.Utc`|Converts `dateTime` from Coordinated Universal Time (UTC) to local time and determines whether it is daylight saving time.| +||`DateTimeKind.Unspecified`|Assumes that `dateTime` represents local time and determines whether it is daylight saving time.| +||`DateTimeKind.Local`, `DateTimeKind.Unspecified`, or `DateTimeKind.Utc`|Returns `false` (UTC does not support daylight saving time).| |Any other object.|`DateTimeKind.Local`|Converts the local time to the equivalent time of the object and then determines whether the latter is daylight saving time.| |Any other object.|`DateTimeKind.Utc`|Converts UTC to the equivalent time of the object and then determines whether the latter is daylight saving time.| |Any other object.|`DateTimeKind.Unspecified`|Determines whether `dateTime` is daylight saving time.| - If the time zone represented by the object does not support daylight saving time, the method always returns `false`. A number of time zones, including , do not observe daylight saving time. To determine whether a time zone supports daylight saving time, retrieve the value of its property. + If the time zone represented by the object does not support daylight saving time, the method always returns `false`. A number of time zones, including , do not observe daylight saving time. To determine whether a time zone supports daylight saving time, retrieve the value of its property. - If the `dateTime` parameter specifies an ambiguous time in the current object's time zone, the method interprets `dateTime` as standard time and returns `false` if its property is or . If the property is , this method will select the correct ambiguous time and indicate whether it is a daylight saving time. + If the `dateTime` parameter specifies an ambiguous time in the current object's time zone, the method interprets `dateTime` as standard time and returns `false` if its property is or . If the property is , this method will select the correct ambiguous time and indicate whether it is a daylight saving time. - Because the method can return `false` for a date and time that is ambiguous (that is, a date and time that can represent either a standard time or a daylight saving time in a particular time zone), the method can be paired with the method to determine whether a time may be a daylight saving time. Because an ambiguous time is one that can be both a daylight saving time and a standard time, the method can be called first to determine whether a date and time may be a daylight saving time. If the method returns `false`, the method can be called to determine whether the value is a daylight saving time. The following example illustrates this technique. + Because the method can return `false` for a date and time that is ambiguous (that is, a date and time that can represent either a standard time or a daylight saving time in a particular time zone), the method can be paired with the method to determine whether a time may be a daylight saving time. Because an ambiguous time is one that can be both a daylight saving time and a standard time, the method can be called first to determine whether a date and time may be a daylight saving time. If the method returns `false`, the method can be called to determine whether the value is a daylight saving time. The following example illustrates this technique. :::code language="csharp" source="~/snippets/csharp/System/TimeZoneInfo/DaylightName/IsDaylightSavingTime.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/TimeZoneInfo/DaylightName/IsDaylightSavingTime.fs" id="Snippet2"::: @@ -2976,12 +2976,12 @@ The time zone identifier is a key string that uniquely identifies a particular t If the `dateTime` parameter specifies an invalid time, the method call throws an if the value of the `dateTime` parameter's property is ; otherwise, the method returns `false`. - Call the method to determine whether to use a time zone's value or its value when displaying the time zone name. See the Example section for an illustration. + Call the method to determine whether to use a time zone's value or its value when displaying the time zone name. See the Example section for an illustration. ## Examples - The following example defines a method named `DisplayDateWithTimeZoneName` that uses the method to determine whether to display a time zone's standard time name or daylight saving time name. + The following example defines a method named `DisplayDateWithTimeZoneName` that uses the method to determine whether to display a time zone's standard time name or daylight saving time name. :::code language="csharp" source="~/snippets/csharp/System/TimeZoneInfo/DaylightName/IsDaylightSavingTime.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TimeZoneInfo/DaylightName/IsDaylightSavingTime.fs" id="Snippet1"::: @@ -3047,7 +3047,7 @@ The time zone identifier is a key string that uniquely identifies a particular t is affected by the relationship between the time zone represented by the object and the property of the `dateTimeOffset` parameter. If `dateTimeOffset` does not correspond to the current time zone's offset from Coordinated Universal Time (UTC), the method converts that time to the time in the current time zone. It then determines whether that date and time is a daylight saving time. + The return value of is affected by the relationship between the time zone represented by the object and the property of the `dateTimeOffset` parameter. If `dateTimeOffset` does not correspond to the current time zone's offset from Coordinated Universal Time (UTC), the method converts that time to the time in the current time zone. It then determines whether that date and time is a daylight saving time. If the time zone represented by the object does not support daylight saving time, the method always returns `false`. To determine whether a time zone supports daylight saving time, retrieve the value of its property. @@ -3116,15 +3116,15 @@ The time zone identifier is a key string that uniquely identifies a particular t |DateTime.Kind property|TimeZoneInfo object (if applicable)|Behavior| |----------------------------|-------------------------------------------|--------------| -|||Determines whether the time is invalid.| -|| or a non-local time zone.|Converts `dateTime` to the time of the object and returns `false`.| +|||Determines whether the time is invalid.| +|| or a non-local time zone.|Converts `dateTime` to the time of the object and returns `false`.| ||Not applicable.|Assumes `dateTime` is the time of the object and determines whether it is invalid.| ||Not applicable.|Returns `false`.| ## Examples - In the Pacific Time zone, daylight saving time begins at 2:00 A.M. on April 2, 2006. The following code passes the time at one-minute intervals from 1:59 A.M. on April 2, 2006, to 3:01 A.M. on April 2, 2006, to the method of a object that represents the Pacific Time zone. The console output indicates that all times from 2:00 A.M. on April 2, 2006, to 2:59 A.M. on April 2, 2006, are invalid. + In the Pacific Time zone, daylight saving time begins at 2:00 A.M. on April 2, 2006. The following code passes the time at one-minute intervals from 1:59 A.M. on April 2, 2006, to 3:01 A.M. on April 2, 2006, to the method of a object that represents the Pacific Time zone. The console output indicates that all times from 2:00 A.M. on April 2, 2006, to 2:59 A.M. on April 2, 2006, are invalid. :::code language="csharp" source="~/snippets/csharp/System/TimeZoneInfo/BaseUtcOffset/TimeZone2_Examples.cs" id="Snippet9"::: :::code language="fsharp" source="~/snippets/fsharp/System/TimeZoneInfo/BaseUtcOffset/TimeZone2_Examples.fs" id="Snippet9"::: @@ -3193,19 +3193,19 @@ The time zone identifier is a key string that uniquely identifies a particular t The local time zone is the time zone on the computer where the code is executing. > [!IMPORTANT] -> You should always access the local time zone through the property rather than assigning the local time zone to a object variable. This prevents the object variable from being invalidated by a call to the method. +> You should always access the local time zone through the property rather than assigning the local time zone to a object variable. This prevents the object variable from being invalidated by a call to the method. On Windows systems, the object returned by the property reflects the setting of the **Automatically adjust clock for Daylight Saving Time** checkbox in the Control Panel **Date and Time** application. If the checkbox is unchecked, the cached copy of the local time zone contains no daylight saving time information. This means that: -- The local time zone's method returns an array whose length is zero. +- The local time zone's method returns an array whose length is zero. - The local time zone's property returns `false`. -- The local time zone has no ambiguous or invalid times (all calls to or return `false`). +- The local time zone has no ambiguous or invalid times (all calls to or return `false`). -- All calls to with individual local times return false. +- All calls to with individual local times return false. - This is not true, however, if a reference to the local time zone is retrieved using the method. + This is not true, however, if a reference to the local time zone is retrieved using the method. The property corresponds to the property of the class. @@ -3281,7 +3281,7 @@ The time zone identifier is a key string that uniquely identifies a particular t ## Examples - The following example defines a method named `DisplayDateWithTimeZoneName` that uses the method to determine whether to display a time zone's standard time name or daylight saving time name. + The following example defines a method named `DisplayDateWithTimeZoneName` that uses the method to determine whether to display a time zone's standard time name or daylight saving time name. :::code language="csharp" source="~/snippets/csharp/System/TimeZoneInfo/DaylightName/IsDaylightSavingTime.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TimeZoneInfo/DaylightName/IsDaylightSavingTime.fs" id="Snippet1"::: @@ -3512,7 +3512,7 @@ The time zone identifier is a key string that uniquely identifies a particular t method to instantiate the necessary time zones as objects. The application can then call the method to convert the time zone object to a string. + Applications that rely on time zones that are not typically defined in the registry of Windows systems or the [ICU Library](https://unicode-org.github.io/icu/userguide/datetime/timezone/) on Linux and macOScan can use the method to instantiate the necessary time zones as objects. The application can then call the method to convert the time zone object to a string. The object should also be stored in a location where the application can retrieve it when needed. Possible locations include: @@ -3587,7 +3587,7 @@ The time zone identifier is a key string that uniquely identifies a particular t objects to a list control such as the control, the control automatically calls the method to extract a string that describes each object to be represented in the list. As a result, you do not need to store a meaningful description of the object as a string, and the user does not need to use that string to extract the object from the collection. See [How to: Enumerate Time Zones Present on a Computer](/dotnet/standard/datetime/enumerate-time-zones) for more detail. + When assigning a collection that contains objects to a list control such as the control, the control automatically calls the method to extract a string that describes each object to be represented in the list. As a result, you do not need to store a meaningful description of the object as a string, and the user does not need to use that string to extract the object from the collection. See [How to: Enumerate Time Zones Present on a Computer](/dotnet/standard/datetime/enumerate-time-zones) for more detail. ]]> @@ -3902,7 +3902,7 @@ If the application is running on a Windows OS version that lacks the ICU library This is a built-in object; information about this object is not retrieved from the registry on Windows systems and from the [ICU Library](https://unicode-org.github.io/icu/userguide/datetime/timezone/) on Linux and macOS. > [!IMPORTANT] -> You should always access the Coordinated Universal Time (UTC) zone through the property rather than assigning the UTC time zone to a object variable. This prevents the object variable from being invalidated by a call to the method. +> You should always access the Coordinated Universal Time (UTC) zone through the property rather than assigning the UTC time zone to a object variable. This prevents the object variable from being invalidated by a call to the method. Coordinated Universal Time was previously known as Greenwich Mean Time (GMT). diff --git a/xml/System/TimeZoneNotFoundException.xml b/xml/System/TimeZoneNotFoundException.xml index db7f88397e4..0209272069a 100644 --- a/xml/System/TimeZoneNotFoundException.xml +++ b/xml/System/TimeZoneNotFoundException.xml @@ -67,17 +67,17 @@ and methods when a time zone identifier cannot be found on the local system, or when there is no data associated with a particular time zone identifier. + This exception is thrown by the and methods when a time zone identifier cannot be found on the local system, or when there is no data associated with a particular time zone identifier. Because the registry serves as the repository of time zone information in Windows XP and Windows Vista, this exception indicates that the registry contains no information about a particular time zone. Time zone information is stored in the subkeys of HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Time Zones. If an application depends on the presence of a particular time zone and the attempt to retrieve it throws a , the application can handle the exception in either of two ways: -- By calling the method to deserialize a saved object. +- By calling the method to deserialize a saved object. -- By calling one of the overloads of the method to create a time zone. +- By calling one of the overloads of the method to create a time zone. - See the examples for the and methods. + See the examples for the and methods. ]]> @@ -253,7 +253,7 @@ object. Instead, it is called by the object's method when deserializing the object from a stream. + This constructor is not called directly by your code to instantiate the object. Instead, it is called by the object's method when deserializing the object from a stream. ]]> diff --git a/xml/System/TimeoutException.xml b/xml/System/TimeoutException.xml index e8e31f5de25..de4e9f04cd5 100644 --- a/xml/System/TimeoutException.xml +++ b/xml/System/TimeoutException.xml @@ -78,7 +78,7 @@ uses the HRESULT, COR_E_TIMEOUT, which has the value 0x80131505. - For a list of initial property values for an instance of , see the constructors. + For a list of initial property values for an instance of , see the constructors. @@ -156,8 +156,8 @@ |Property|Value| |--------------|-----------| -||A null reference (`Nothing` in Visual Basic).| -||The localized error message string.| +||A null reference (`Nothing` in Visual Basic).| +||The localized error message string.| ]]> @@ -216,8 +216,8 @@ |Property|Value| |--------------|-----------| -||A null reference (`Nothing` in Visual Basic).| -||The error message string.| +||A null reference (`Nothing` in Visual Basic).| +||The error message string.| ]]> @@ -349,8 +349,8 @@ |Property|Value| |--------------|-----------| -||The error message string.| -||The inner exception reference.| +||The error message string.| +||The inner exception reference.| ]]> diff --git a/xml/System/Tuple.xml b/xml/System/Tuple.xml index 67edac34a79..bbcbad7e8f4 100644 --- a/xml/System/Tuple.xml +++ b/xml/System/Tuple.xml @@ -58,7 +58,7 @@ property of a object. + A tuple is a data structure that has a specific number and sequence of elements. An example of a tuple is a data structure with three elements (known as a 3-tuple or triple) that is used to store an identifier such as a person's name in the first element, a year in the second element, and the person's income for that year in the third element. The .NET Framework directly supports tuples with one to seven elements. In addition, you can create tuples of eight or more elements by nesting tuple objects in the property of a object. Tuples are commonly used in four ways: @@ -68,7 +68,7 @@ - To return multiple values from a method without using `out` parameters (in C#) or `ByRef` parameters (in Visual Basic). -- To pass multiple values to a method through a single parameter. For example, the method has a single parameter that lets you supply one value to the method that the thread executes at startup time. If you supply a object as the method argument, you can supply the thread's startup routine with three items of data. +- To pass multiple values to a method through a single parameter. For example, the method has a single parameter that lets you supply one value to the method that the thread executes at startup time. If you supply a object as the method argument, you can supply the thread's startup routine with three items of data. The class does not itself represent a tuple. Instead, it is a class that provides static methods for creating instances of the tuple types that are supported by the .NET Framework. It provides helper methods that you can call to instantiate tuple objects without having to explicitly specify the type of each tuple component. @@ -84,7 +84,7 @@ :::code language="fsharp" source="~/snippets/fsharp/System/Tuple/Overview/example1.fs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System/Tuple/Overview/example1.vb" id="Snippet2"::: - The helper methods directly support the creation of tuple objects that have from one to eight components (that is, singletons through octuples). Although there is no practical limit to the number of components a tuple may have, helper methods are not available to create a tuple with nine or more components. To create such a tuple, you must call the constructor. + The helper methods directly support the creation of tuple objects that have from one to eight components (that is, singletons through octuples). Although there is no practical limit to the number of components a tuple may have, helper methods are not available to create a tuple with nine or more components. To create such a tuple, you must call the constructor. > [!NOTE] > For additional information and examples that use tuples, see the documentation for the individual tuple types in the .NET Framework. These are listed in the See Also section at the end of this topic. @@ -183,13 +183,13 @@ is a helper method that you can call to instantiate a 1-tuple object without having to explicitly specify the type of its component. The following example uses the method to instantiate a 1-tuple whose component is of type . + is a helper method that you can call to instantiate a 1-tuple object without having to explicitly specify the type of its component. The following example uses the method to instantiate a 1-tuple whose component is of type . :::code language="csharp" source="~/snippets/csharp/System/Tuple/Overview/create1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Tuple/Overview/create1.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/Tuple/Overview/create1.vb" id="Snippet1"::: - This code is equivalent to the following call to the class constructor. + This code is equivalent to the following call to the class constructor. :::code language="csharp" source="~/snippets/csharp/System/Tuple/Overview/create1.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/Tuple/Overview/create1.fs" id="Snippet2"::: @@ -271,13 +271,13 @@ is a helper method that you can call to instantiate a 2-tuple object without having to explicitly specify the types of its components. The following example uses the method to instantiate a 2-tuple. + is a helper method that you can call to instantiate a 2-tuple object without having to explicitly specify the types of its components. The following example uses the method to instantiate a 2-tuple. :::code language="csharp" source="~/snippets/csharp/System/Tuple/Overview/create1.cs" id="Snippet3"::: :::code language="fsharp" source="~/snippets/fsharp/System/Tuple/Overview/create1.fs" id="Snippet3"::: :::code language="vb" source="~/snippets/visualbasic/System/Tuple/Overview/create1.vb" id="Snippet3"::: - This code is equivalent to the following call to the class constructor. + This code is equivalent to the following call to the class constructor. :::code language="csharp" source="~/snippets/csharp/System/Tuple/Overview/create1.cs" id="Snippet4"::: :::code language="fsharp" source="~/snippets/fsharp/System/Tuple/Overview/create1.fs" id="Snippet4"::: @@ -370,13 +370,13 @@ is a helper method that you can call to instantiate a 3-tuple object without having to explicitly specify the types of its components. The following example uses the method to instantiate a 3-tuple. + is a helper method that you can call to instantiate a 3-tuple object without having to explicitly specify the types of its components. The following example uses the method to instantiate a 3-tuple. :::code language="csharp" source="~/snippets/csharp/System/Tuple/Overview/create1.cs" id="Snippet5"::: :::code language="fsharp" source="~/snippets/fsharp/System/Tuple/Overview/create1.fs" id="Snippet5"::: :::code language="vb" source="~/snippets/visualbasic/System/Tuple/Overview/create1.vb" id="Snippet5"::: - This code is equivalent to the following call to the class constructor. + This code is equivalent to the following call to the class constructor. :::code language="csharp" source="~/snippets/csharp/System/Tuple/Overview/create1.cs" id="Snippet6"::: :::code language="fsharp" source="~/snippets/fsharp/System/Tuple/Overview/create1.fs" id="Snippet6"::: @@ -480,13 +480,13 @@ is a helper method that you can call to instantiate a 4-tuple object without having to explicitly specify the types of its components. The following example uses the method to instantiate a 4-tuple. + is a helper method that you can call to instantiate a 4-tuple object without having to explicitly specify the types of its components. The following example uses the method to instantiate a 4-tuple. :::code language="csharp" source="~/snippets/csharp/System/Tuple/Overview/create1.cs" id="Snippet7"::: :::code language="fsharp" source="~/snippets/fsharp/System/Tuple/Overview/create1.fs" id="Snippet7"::: :::code language="vb" source="~/snippets/visualbasic/System/Tuple/Overview/create1.vb" id="Snippet7"::: - This code is equivalent to the following call to the class constructor. + This code is equivalent to the following call to the class constructor. :::code language="csharp" source="~/snippets/csharp/System/Tuple/Overview/create1.cs" id="Snippet8"::: :::code language="fsharp" source="~/snippets/fsharp/System/Tuple/Overview/create1.fs" id="Snippet8"::: @@ -601,13 +601,13 @@ is a helper method that you can call to instantiate a 5-tuple object without having to explicitly specify the types of its components. The following example uses the method to instantiate a 5-tuple. + is a helper method that you can call to instantiate a 5-tuple object without having to explicitly specify the types of its components. The following example uses the method to instantiate a 5-tuple. :::code language="csharp" source="~/snippets/csharp/System/Tuple/Overview/create1.cs" id="Snippet9"::: :::code language="fsharp" source="~/snippets/fsharp/System/Tuple/Overview/create1.fs" id="Snippet9"::: :::code language="vb" source="~/snippets/visualbasic/System/Tuple/Overview/create1.vb" id="Snippet9"::: - This code is equivalent to the following call to the class constructor. + This code is equivalent to the following call to the class constructor. :::code language="csharp" source="~/snippets/csharp/System/Tuple/Overview/create1.cs" id="Snippet10"::: :::code language="fsharp" source="~/snippets/fsharp/System/Tuple/Overview/create1.fs" id="Snippet10"::: @@ -733,13 +733,13 @@ is a helper method that you can call to instantiate a 6-tuple object without having to explicitly specify the types of its components. The following example uses the method to instantiate a 6-tuple. + is a helper method that you can call to instantiate a 6-tuple object without having to explicitly specify the types of its components. The following example uses the method to instantiate a 6-tuple. :::code language="csharp" source="~/snippets/csharp/System/Tuple/Overview/create1.cs" id="Snippet11"::: :::code language="fsharp" source="~/snippets/fsharp/System/Tuple/Overview/create1.fs" id="Snippet11"::: :::code language="vb" source="~/snippets/visualbasic/System/Tuple/Overview/create1.vb" id="Snippet11"::: - This code is equivalent to the following call to the class constructor. + This code is equivalent to the following call to the class constructor. :::code language="csharp" source="~/snippets/csharp/System/Tuple/Overview/create1.cs" id="Snippet12"::: :::code language="fsharp" source="~/snippets/fsharp/System/Tuple/Overview/create1.fs" id="Snippet12"::: @@ -876,13 +876,13 @@ is a helper method that you can call to instantiate a 7-tuple object without having to explicitly specify the types of its components. The following example uses the method to instantiate a 7-tuple. + is a helper method that you can call to instantiate a 7-tuple object without having to explicitly specify the types of its components. The following example uses the method to instantiate a 7-tuple. :::code language="csharp" source="~/snippets/csharp/System/Tuple/Overview/create1.cs" id="Snippet13"::: :::code language="fsharp" source="~/snippets/fsharp/System/Tuple/Overview/create1.fs" id="Snippet13"::: :::code language="vb" source="~/snippets/visualbasic/System/Tuple/Overview/create1.vb" id="Snippet13"::: - This code is equivalent to the following call to the class constructor. + This code is equivalent to the following call to the class constructor. :::code language="csharp" source="~/snippets/csharp/System/Tuple/Overview/create1.cs" id="Snippet14"::: :::code language="fsharp" source="~/snippets/fsharp/System/Tuple/Overview/create1.fs" id="Snippet14"::: @@ -1030,10 +1030,10 @@ is a helper method that you can call to instantiate an 8-tuple without having to explicitly specify the types of its components. + is a helper method that you can call to instantiate an 8-tuple without having to explicitly specify the types of its components. > [!NOTE] -> You must call the constructor to create a tuple with nine or more components unless your language provides a special syntax for this purpose. The static (`Shared` in Visual Basic) methods of the class cannot be used to create a tuple with nine or more components. +> You must call the constructor to create a tuple with nine or more components unless your language provides a special syntax for this purpose. The static (`Shared` in Visual Basic) methods of the class cannot be used to create a tuple with nine or more components. @@ -1044,7 +1044,7 @@ :::code language="fsharp" source="~/snippets/fsharp/System/Tuple/Overview/createntuple.fs" id="Snippet17"::: :::code language="vb" source="~/snippets/visualbasic/System/Tuple/Overview/createntuple.vb" id="Snippet17"::: - This is equivalent to the following example, which uses the class constructor instead of the factory creation method. Note that instantiating a object in this way involves considerably more code, because you must declare a nested object as the object's eighth component to produce an octuple. + This is equivalent to the following example, which uses the class constructor instead of the factory creation method. Note that instantiating a object in this way involves considerably more code, because you must declare a nested object as the object's eighth component to produce an octuple. :::code language="csharp" source="~/snippets/csharp/System/Tuple/Overview/ctor8.cs" id="Snippet20"::: :::code language="fsharp" source="~/snippets/fsharp/System/Tuple/Overview/ctor8.fs" id="Snippet20"::: diff --git a/xml/System/TupleExtensions.xml b/xml/System/TupleExtensions.xml index 13876278839..bbbefe68bc3 100644 --- a/xml/System/TupleExtensions.xml +++ b/xml/System/TupleExtensions.xml @@ -65,11 +65,11 @@ Provides extension methods for tuples to interoperate with language support for tuples in C#. - @@ -148,11 +148,11 @@ When this method returns, contains the value of the single element. Deconstructs a tuple with 1 element into a separate variable. - @@ -235,11 +235,11 @@ When this method returns, contains the value of the second element. Deconstructs a tuple with 2 elements into separate variables. - @@ -333,11 +333,11 @@ When this method returns, contains the value of the third element. Deconstructs a tuple with 3 elements into separate variables. - @@ -442,11 +442,11 @@ When this method returns, contains the value of the fourth element. Deconstructs a tuple with 4 elements into separate variables. - @@ -562,11 +562,11 @@ When this method returns, contains the value of the fifth element. Deconstructs a tuple with 5 elements into separate variables. - @@ -693,11 +693,11 @@ When this method returns, contains the value of the sixth element. Deconstructs a tuple with 6 elements into separate variables. - @@ -835,11 +835,11 @@ When this method returns, contains the value of the seventh element. Deconstructs a tuple with 7 elements into separate variables. - @@ -988,13 +988,13 @@ When this method returns, contains the value of the eighth element, or . Deconstructs a tuple with 8 elements into separate variables. - , `item8` is an element in a nested tuple. - + , `item8` is an element in a nested tuple. + ]]> @@ -1154,13 +1154,13 @@ When this method returns, contains the value of the ninth element, or . Deconstructs a tuple with 9 elements into separate variables. - , `item8` and `item9` are elements of nested tuples. - + , `item8` and `item9` are elements of nested tuples. + ]]> @@ -1331,13 +1331,13 @@ When this method returns, contains the value of the tenth element, or . Deconstructs a tuple with 10 elements into separate variables. - , `item8` through `item10` are elements of nested tuples. - + , `item8` through `item10` are elements of nested tuples. + ]]> @@ -1519,13 +1519,13 @@ When this method returns, contains the value of the eleventh element, or . Deconstructs a tuple with 11 elements into separate variables. - , `item8` through `item11` are elements of nested tuples. - + , `item8` through `item11` are elements of nested tuples. + ]]> @@ -1718,13 +1718,13 @@ When this method returns, contains the value of the twelfth element, or . Deconstructs a tuple with 12 elements into separate variables. - , `item8` through `item12` are elements of nested tuples. - + , `item8` through `item12` are elements of nested tuples. + ]]> @@ -1928,13 +1928,13 @@ When this method returns, contains the value of the thirteenth element, or . Deconstructs a tuple with 13 elements into separate variables. - , `item8` through `item13` are elements of nested tuples. - + , `item8` through `item13` are elements of nested tuples. + ]]> @@ -2372,13 +2372,13 @@ When this method returns, contains the value of the fifteenth element, or . Deconstructs a tuple with 15 elements into separate variables. - , `item8` through `item15` are elements of nested tuples. - + , `item8` through `item15` are elements of nested tuples. + ]]> @@ -2615,13 +2615,13 @@ When this method returns, contains the value of the sixteenth element, or . Deconstructs a tuple with 16 elements into separate variables. - , `item8` through `item16` are elements of nested tuples. - + , `item8` through `item16` are elements of nested tuples. + ]]> @@ -2869,13 +2869,13 @@ When this method returns, contains the value of the seventeenth element, or . Deconstructs a tuple with 17 elements into separate variables. - , `item8` through `item17` are elements of nested tuples. - + , `item8` through `item17` are elements of nested tuples. + ]]> @@ -3134,13 +3134,13 @@ When this method returns, contains the value of the eighteenth element, or . Deconstructs a tuple with 18 elements into separate variables. - , `item8` through `item18` are elements of nested tuples. - + , `item8` through `item18` are elements of nested tuples. + ]]> @@ -3410,13 +3410,13 @@ When this method returns, contains the value of the nineteenth element, or . Deconstructs a tuple with 19 elements into separate variables. - , `item8` through `item19` are elements of nested tuples. - + , `item8` through `item19` are elements of nested tuples. + ]]> @@ -3986,13 +3986,13 @@ When this method returns, contains the value of the twenty-first element, or . Deconstructs a tuple with 21 elements into separate variables. - , `item8` through `item21` are elements of nested tuples. - + , `item8` through `item21` are elements of nested tuples. + ]]> diff --git a/xml/System/Tuple`1.xml b/xml/System/Tuple`1.xml index 1cec1b3adb9..ef29a127098 100644 --- a/xml/System/Tuple`1.xml +++ b/xml/System/Tuple`1.xml @@ -91,9 +91,9 @@ class represents a 1-tuple, or singleton, which is a tuple that has a single component. A singleton is used comparatively rarely in application development. + A tuple is a data structure that has a specific number and sequence of values. The class represents a 1-tuple, or singleton, which is a tuple that has a single component. A singleton is used comparatively rarely in application development. - You can instantiate a object by calling either the constructor or the static method. You can retrieve the value of the tuple's single component by using the read-only instance property. + You can instantiate a object by calling either the constructor or the static method. You can retrieve the value of the tuple's single component by using the read-only instance property. ]]> @@ -152,13 +152,13 @@ method to instantiate a 1-tuple object without having to explicitly specify the type of its component. The following example uses the method to instantiate a 1-tuple whose component is of type . + You can also use the static method to instantiate a 1-tuple object without having to explicitly specify the type of its component. The following example uses the method to instantiate a 1-tuple whose component is of type . :::code language="csharp" source="~/snippets/csharp/System/Tuple/Overview/create1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Tuple/Overview/create1.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/Tuple/Overview/create1.vb" id="Snippet1"::: - This is equivalent to the following call to the class constructor. + This is equivalent to the following call to the class constructor. :::code language="csharp" source="~/snippets/csharp/System/Tuple/Overview/create1.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/Tuple/Overview/create1.fs" id="Snippet2"::: @@ -228,7 +228,7 @@ ## Remarks The `obj` parameter is considered to be equal to the current instance under the following conditions: -- It is a object. +- It is a object. - Its single component is of the same type as the current instance. @@ -237,7 +237,7 @@ ## Examples - The following example calls the method to compare a object whose component is a value with three objects whose components have the following characteristics: + The following example calls the method to compare a object whose component is a value with three objects whose components have the following characteristics: - Same type () and same value. @@ -349,11 +349,11 @@ component in one of two ways: + You can determine the type of the component in one of two ways: -- By calling the `GetType` method on the value that is returned by the property. +- By calling the `GetType` method on the value that is returned by the property. -- By retrieving the object that represents the object, and retrieving the first element from the array that is returned by its method. +- By retrieving the object that represents the object, and retrieving the first element from the array that is returned by its method. The example illustrates both approaches. @@ -442,15 +442,15 @@ parameters to order the members of a collection. For example, it is called by the method and the method of a object that is instantiated by using the constructor. + Although this method can be called directly, it is most commonly called by collection sorting methods that include parameters to order the members of a collection. For example, it is called by the method and the method of a object that is instantiated by using the constructor. > [!CAUTION] -> The method is intended for use in sorting operations. It should not be used when the primary purpose of a comparison is to determine whether two objects are equal. To determine whether two objects are equal, call the method. +> The method is intended for use in sorting operations. It should not be used when the primary purpose of a comparison is to determine whether two objects are equal. To determine whether two objects are equal, call the method. ## Examples - The following example defines a generic class named `DescendingComparer` that implements the interface. `DescendingComparer` sorts objects in descending rather than ascending order by reversing the value returned by the default comparer for a particular type. An instance of the generic `DescendingComparer` class is then passed to the method to sort an array of objects in descending order. Note that the example does not directly call the method. This method is called implicitly by the method for each element in the array. + The following example defines a generic class named `DescendingComparer` that implements the interface. `DescendingComparer` sorts objects in descending rather than ascending order by reversing the value returned by the default comparer for a particular type. An instance of the generic `DescendingComparer` class is then passed to the method to sort an array of objects in descending order. Note that the example does not directly call the method. This method is called implicitly by the method for each element in the array. :::code language="csharp" source="~/snippets/csharp/System/TupleT1/System.Collections.IStructuralComparable.CompareTo/compareto2.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/TupleT1/System.Collections.IStructuralComparable.CompareTo/compareto2.fs" id="Snippet2"::: @@ -525,9 +525,9 @@ instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. - The implementation is called only if `other` is not `null`, and if it can be successfully cast (in C#) or converted (in Visual Basic) to a object whose single component is of the same type as the current instance. The method is passed the component of the current instance and the component of the object represented by the `other` parameter. + The implementation is called only if `other` is not `null`, and if it can be successfully cast (in C#) or converted (in Visual Basic) to a object whose single component is of the same type as the current instance. The method is passed the component of the current instance and the component of the object represented by the `other` parameter. @@ -595,11 +595,11 @@ instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. - The method simply wraps a call to the `comparer` object's implementation. + The method simply wraps a call to the `comparer` object's implementation. - The algorithm used to compute the hash code should return the same hash code for two objects that are considered to be equal. + The algorithm used to compute the hash code should return the same hash code for two objects that are considered to be equal. ]]> @@ -675,19 +675,19 @@ instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. - This method provides the implementation for the class. Although the method can be called directly, it is most commonly called by the default overloads of collection sorting methods, such as and , to order the members of a collection. + This method provides the implementation for the class. Although the method can be called directly, it is most commonly called by the default overloads of collection sorting methods, such as and , to order the members of a collection. > [!CAUTION] -> The method is intended for use in sorting operations. It should not be used when the primary purpose of a comparison is to determine whether two objects are equal. To determine whether two objects are equal, call the method. +> The method is intended for use in sorting operations. It should not be used when the primary purpose of a comparison is to determine whether two objects are equal. To determine whether two objects are equal, call the method. - The method uses the default object comparer. + The method uses the default object comparer. ## Examples - The following example creates an array of singletons whose component is a value. It displays the value of each tuple component in unsorted order, sorts the array, and then displays the values in sorted order. Note that the example does not directly call the method. This method is called implicitly by the method for each element in the array. + The following example creates an array of singletons whose component is a value. It displays the value of each tuple component in unsorted order, sorts the array, and then displays the values in sorted order. Note that the example does not directly call the method. This method is called implicitly by the method for each element in the array. :::code language="csharp" source="~/snippets/csharp/System/TupleT1/System.Collections.IStructuralComparable.CompareTo/compareto1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TupleT1/System.Collections.IStructuralComparable.CompareTo/compareto1.fs" id="Snippet1"::: @@ -802,7 +802,7 @@ The property is an explicit interface implementation. To call it, you must cast or convert the object to an interface object. + The property is an explicit interface implementation. To call it, you must cast or convert the object to an interface object. ]]> @@ -854,12 +854,12 @@ The property. If the value of is `null`, it is represented as . + The string returned by this method takes the form (*Item1*), where *Item1* represents the value of the property. If the value of is `null`, it is represented as . ## Examples - The following example illustrates the method. + The following example illustrates the method. :::code language="csharp" source="~/snippets/csharp/System/TupleT1/ToString/tostring1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TupleT1/ToString/tostring1.fs" id="Snippet1"::: diff --git a/xml/System/Tuple`2.xml b/xml/System/Tuple`2.xml index 176d22cc446..4eb3f94ef60 100644 --- a/xml/System/Tuple`2.xml +++ b/xml/System/Tuple`2.xml @@ -104,27 +104,27 @@ class represents a 2-tuple, or pair, which is a tuple that has two components. A 2-tuple is similar to a structure. + A tuple is a data structure that has a specific number and sequence of values. The class represents a 2-tuple, or pair, which is a tuple that has two components. A 2-tuple is similar to a structure. - You can instantiate a object by calling either the constructor or the static method. You can retrieve the values of the tuple's components by using the read-only and instance properties. + You can instantiate a object by calling either the constructor or the static method. You can retrieve the values of the tuple's components by using the read-only and instance properties. Tuples are commonly used in four different ways: - To represent a single set of data. For example, a tuple can represent a record in a database, and its components can represent that record's fields. -- To provide easy access to, and manipulation of, a data set. The following example defines an array of objects that contain the names of students and their corresponding test scores. It then iterates the array to calculate the mean test score. +- To provide easy access to, and manipulation of, a data set. The following example defines an array of objects that contain the names of students and their corresponding test scores. It then iterates the array to calculate the mean test score. :::code language="csharp" source="~/snippets/csharp/System/TupleT1,T2/Overview/example1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TupleT1,T2/Overview/example1.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/TupleT1,T2/Overview/example1.vb" id="Snippet1"::: -- To return multiple values from a method without the use of `out` parameters (in C#) or `ByRef` parameters (in Visual Basic). For example, the following example uses a object to return the quotient and the remainder that result from integer division. +- To return multiple values from a method without the use of `out` parameters (in C#) or `ByRef` parameters (in Visual Basic). For example, the following example uses a object to return the quotient and the remainder that result from integer division. :::code language="csharp" source="~/snippets/csharp/System/TupleT1,T2/Overview/item1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TupleT1,T2/Overview/item1.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/TupleT1,T2/Overview/item1.vb" id="Snippet1"::: -- To pass multiple values to a method through a single parameter. For example, the method has a single parameter that lets you supply one value to the method that the thread executes at startup. If you supply a object as the method argument, you can supply the thread's startup routine with two items of data. +- To pass multiple values to a method through a single parameter. For example, the method has a single parameter that lets you supply one value to the method that the thread executes at startup. If you supply a object as the method argument, you can supply the thread's startup routine with two items of data. ]]> @@ -185,13 +185,13 @@ method to instantiate a 2-tuple object without having to explicitly specify the types of its components. The following example uses the method to instantiate a 2-tuple whose components are of type and . + You can also use the static method to instantiate a 2-tuple object without having to explicitly specify the types of its components. The following example uses the method to instantiate a 2-tuple whose components are of type and . :::code language="csharp" source="~/snippets/csharp/System/Tuple/Overview/create1.cs" id="Snippet3"::: :::code language="fsharp" source="~/snippets/fsharp/System/Tuple/Overview/create1.fs" id="Snippet3"::: :::code language="vb" source="~/snippets/visualbasic/System/Tuple/Overview/create1.vb" id="Snippet3"::: - This is equivalent to the following call to the class constructor. + This is equivalent to the following call to the class constructor. :::code language="csharp" source="~/snippets/csharp/System/Tuple/Overview/create1.cs" id="Snippet4"::: :::code language="fsharp" source="~/snippets/fsharp/System/Tuple/Overview/create1.fs" id="Snippet4"::: @@ -261,7 +261,7 @@ ## Remarks The `obj` parameter is considered to be equal to the current instance under the following conditions: -- It is a object. +- It is a object. - Its two components are of the same types as the current instance. @@ -270,7 +270,7 @@ ## Examples - The following example calls the method to determine whether any of the objects in an array of objects are equal to one another. The output reflects the fact that the method returns `true` when comparing objects whose components have equal values. + The following example calls the method to determine whether any of the objects in an array of objects are equal to one another. The output reflects the fact that the method returns `true` when comparing objects whose components have equal values. :::code language="csharp" source="~/snippets/csharp/System/TupleT1,T2/Equals/equals1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TupleT1,T2/Equals/equals1.fs" id="Snippet1"::: @@ -370,16 +370,16 @@ component in one of two ways: + You can dynamically determine the type of the component in one of two ways: -- By calling the `GetType` method on the value that is returned by the property. +- By calling the `GetType` method on the value that is returned by the property. -- By retrieving the object that represents the object, and retrieving the first element from the array that is returned by its method. +- By retrieving the object that represents the object, and retrieving the first element from the array that is returned by its method. ## Examples - The example illustrates the use of the and properties to define a method that returns multiple values in the form of a 2-tuple. + The example illustrates the use of the and properties to define a method that returns multiple values in the form of a 2-tuple. :::code language="csharp" source="~/snippets/csharp/System/TupleT1,T2/Overview/item1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TupleT1,T2/Overview/item1.fs" id="Snippet1"::: @@ -434,16 +434,16 @@ component in one of two ways: + You can dynamically determine the type of the component in one of two ways: -- By calling the `GetType` method on the value that is returned by the property. +- By calling the `GetType` method on the value that is returned by the property. -- By retrieving the object that represents the object, and retrieving the second element from the array that is returned by its method. +- By retrieving the object that represents the object, and retrieving the second element from the array that is returned by its method. ## Examples - The example illustrates the use of the and properties to define a method that returns multiple values in the form of a 2-tuple. + The example illustrates the use of the and properties to define a method that returns multiple values in the form of a 2-tuple. :::code language="csharp" source="~/snippets/csharp/System/TupleT1,T2/Overview/item1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TupleT1,T2/Overview/item1.fs" id="Snippet1"::: @@ -525,17 +525,17 @@ instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. - Although this method can be called directly, it is most commonly called by collection sorting methods that include parameters to order the members of a collection. For example, it is called by the method and the method of a object that is instantiated by using the constructor. + Although this method can be called directly, it is most commonly called by collection sorting methods that include parameters to order the members of a collection. For example, it is called by the method and the method of a object that is instantiated by using the constructor. > [!CAUTION] -> The method is intended for use in sorting operations. It should not be used when the primary purpose of a comparison is to determine whether two objects are equal. To determine whether two objects are equal, call the method. +> The method is intended for use in sorting operations. It should not be used when the primary purpose of a comparison is to determine whether two objects are equal. To determine whether two objects are equal, call the method. ## Examples - The following example creates an array of objects that consist of a student's name and test score. It displays the component of each tuple in the array in unsorted order, sorts the array, and then calls to display the value of each tuple in sorted order. To sort the array, the example defines a generic `ScoreComparer` class that implements the interface and sorts the objects in ascending order by the value of their second component rather than their first component. Note that the example does not directly call the method. This method is called implicitly by the method for each element in the array. + The following example creates an array of objects that consist of a student's name and test score. It displays the component of each tuple in the array in unsorted order, sorts the array, and then calls to display the value of each tuple in sorted order. To sort the array, the example defines a generic `ScoreComparer` class that implements the interface and sorts the objects in ascending order by the value of their second component rather than their first component. Note that the example does not directly call the method. This method is called implicitly by the method for each element in the array. :::code language="csharp" source="~/snippets/csharp/System/TupleT1,T2/System.Collections.IStructuralComparable.CompareTo/compareto2.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/TupleT1,T2/System.Collections.IStructuralComparable.CompareTo/compareto2.fs" id="Snippet2"::: @@ -610,14 +610,14 @@ instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. - The implementation is called only if `other` is not `null`, and if it can be successfully cast (in C#) or converted (in Visual Basic) to a object whose components are of the same types as the current instance. The method first passes the values of the objects to be compared to the implementation. If this method call returns `true`, the method is called again and passed the values of the two objects. + The implementation is called only if `other` is not `null`, and if it can be successfully cast (in C#) or converted (in Visual Basic) to a object whose components are of the same types as the current instance. The method first passes the values of the objects to be compared to the implementation. If this method call returns `true`, the method is called again and passed the values of the two objects. ## Examples - The following example defines an `Item2Comparer` class that implements the interface and changes the way in which objects are evaluated for equality. The method always returns `true` when it is passed the property values of two objects, and it calls the method to evaluate their property values. As a result, the method tests for equality based only on the value of the property. The output illustrates the result for a data set of objects that record the names of runners and the distances that they ran. + The following example defines an `Item2Comparer` class that implements the interface and changes the way in which objects are evaluated for equality. The method always returns `true` when it is passed the property values of two objects, and it calls the method to evaluate their property values. As a result, the method tests for equality based only on the value of the property. The output illustrates the result for a data set of objects that record the names of runners and the distances that they ran. :::code language="csharp" source="~/snippets/csharp/System/TupleT1,T2/Equals/equals2.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/TupleT1,T2/Equals/equals2.fs" id="Snippet2"::: @@ -680,11 +680,11 @@ instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. - The method simply wraps a call to the `comparer` object's implementation. + The method simply wraps a call to the `comparer` object's implementation. - The algorithm used to compute the hash code should return the same hash code for two objects that are considered to be equal. + The algorithm used to compute the hash code should return the same hash code for two objects that are considered to be equal. ]]> @@ -760,19 +760,19 @@ instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. - This method provides the implementation for the class. Although the method can be called directly, it is most commonly called by the default overloads of collection sorting methods, such as and , to order the members of a collection. + This method provides the implementation for the class. Although the method can be called directly, it is most commonly called by the default overloads of collection sorting methods, such as and , to order the members of a collection. > [!CAUTION] -> The method is intended for use in sorting operations. It should not be used when the primary purpose of a comparison is to determine whether two objects are equal. To determine whether two objects are equal, call the method. +> The method is intended for use in sorting operations. It should not be used when the primary purpose of a comparison is to determine whether two objects are equal. To determine whether two objects are equal, call the method. - The method uses the default object comparer to compare each component. + The method uses the default object comparer to compare each component. ## Examples - The following example creates an array of objects that consist of a student's name and test score. It displays the component of each tuple in the array in unsorted order, sorts the array, and then calls to display the value of each tuple in sorted order. The output shows that the array has been sorted by its first component. Note that the example does not directly call the method. This method is called implicitly by the method for each element in the array. + The following example creates an array of objects that consist of a student's name and test score. It displays the component of each tuple in the array in unsorted order, sorts the array, and then calls to display the value of each tuple in sorted order. The output shows that the array has been sorted by its first component. Note that the example does not directly call the method. This method is called implicitly by the method for each element in the array. :::code language="csharp" source="~/snippets/csharp/System/TupleT1,T2/System.Collections.IStructuralComparable.CompareTo/compareto1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TupleT1,T2/System.Collections.IStructuralComparable.CompareTo/compareto1.fs" id="Snippet1"::: @@ -888,7 +888,7 @@ property is an explicit interface implementation. To call it, you must cast or convert the object to an interface object. + The property is an explicit interface implementation. To call it, you must cast or convert the object to an interface object. ]]> @@ -940,12 +940,12 @@ and properties. If either property value is `null`, it is represented as . + The string returned by this method takes the form (*Item1*, *Item2*), where *Item1* and *Item2* represent the values of the and properties. If either property value is `null`, it is represented as . ## Examples - The following example illustrates the method. + The following example illustrates the method. :::code language="csharp" source="~/snippets/csharp/System/TupleT1,T2/ToString/tostring1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TupleT1,T2/ToString/tostring1.fs" id="Snippet1"::: diff --git a/xml/System/Tuple`3.xml b/xml/System/Tuple`3.xml index af6ecf92992..6beacbd98a1 100644 --- a/xml/System/Tuple`3.xml +++ b/xml/System/Tuple`3.xml @@ -113,23 +113,23 @@ class represents a 3-tuple, or triple, which is a tuple that has three components. + A tuple is a data structure that has a specific number and sequence of values. The class represents a 3-tuple, or triple, which is a tuple that has three components. - You can instantiate a object by calling either the constructor or the static method. You can retrieve the values of the tuple's components by using the read-only , , and instance properties. + You can instantiate a object by calling either the constructor or the static method. You can retrieve the values of the tuple's components by using the read-only , , and instance properties. Tuples are commonly used in four different ways: - To represent a single set of data. For example, a tuple can represent a database record, and its components can represent individual fields of the record. -- To provide easy access to, and manipulation of, a data set. The following example defines an array of objects that contain the names of students, their average test scores, and the number of tests taken. The array is passed to the `ComputeStatistics` method, which calculates the mean and standard deviation of the test scores. +- To provide easy access to, and manipulation of, a data set. The following example defines an array of objects that contain the names of students, their average test scores, and the number of tests taken. The array is passed to the `ComputeStatistics` method, which calculates the mean and standard deviation of the test scores. :::code language="csharp" source="~/snippets/csharp/System/TupleT1,T2,T3/Overview/example1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TupleT1,T2,T3/Overview/example1.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/TupleT1,T2,T3/Overview/example1.vb" id="Snippet1"::: -- To return multiple values from a method without the use of `out` parameters (in C#) or `ByRef` parameters (in Visual Basic). For example, the previous example returns its summary test score statistics in a object. +- To return multiple values from a method without the use of `out` parameters (in C#) or `ByRef` parameters (in Visual Basic). For example, the previous example returns its summary test score statistics in a object. -- To pass multiple values to a method through a single parameter. For example, the method has a single parameter that lets you supply one value to the method that the thread executes at startup. If you supply a object as the method argument, you can supply the thread's startup routine with three items of data. +- To pass multiple values to a method through a single parameter. For example, the method has a single parameter that lets you supply one value to the method that the thread executes at startup. If you supply a object as the method argument, you can supply the thread's startup routine with three items of data. ]]> @@ -192,13 +192,13 @@ method to instantiate a 3-tuple object without having to explicitly specify the types of its components. The following example uses the method to instantiate a 3-tuple whose components are of type , , and . + You can also use the static method to instantiate a 3-tuple object without having to explicitly specify the types of its components. The following example uses the method to instantiate a 3-tuple whose components are of type , , and . :::code language="csharp" source="~/snippets/csharp/System/Tuple/Overview/create1.cs" id="Snippet5"::: :::code language="fsharp" source="~/snippets/fsharp/System/Tuple/Overview/create1.fs" id="Snippet5"::: :::code language="vb" source="~/snippets/visualbasic/System/Tuple/Overview/create1.vb" id="Snippet5"::: - This is equivalent to the following call to the class constructor. + This is equivalent to the following call to the class constructor. :::code language="csharp" source="~/snippets/csharp/System/Tuple/Overview/create1.cs" id="Snippet6"::: :::code language="fsharp" source="~/snippets/fsharp/System/Tuple/Overview/create1.fs" id="Snippet6"::: @@ -268,7 +268,7 @@ ## Remarks The `obj` parameter is considered to be equal to the current instance under the following conditions: -- It is a object. +- It is a object. - Its three components are of the same types as the current instance. @@ -277,7 +277,7 @@ ## Examples - The following example calls the method to determine whether any of the objects in an array of objects are equal to one another. The output reflects the fact that the method returns `true` when comparing objects whose components have equal values. + The following example calls the method to determine whether any of the objects in an array of objects are equal to one another. The output reflects the fact that the method returns `true` when comparing objects whose components have equal values. :::code language="csharp" source="~/snippets/csharp/System/TupleT1,T2,T3/Equals/equals1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TupleT1,T2,T3/Equals/equals1.fs" id="Snippet1"::: @@ -377,16 +377,16 @@ component in one of two ways: + You can dynamically determine the type of the component in one of two ways: -- By calling the `GetType` method on the value that is returned by the property. +- By calling the `GetType` method on the value that is returned by the property. -- By retrieving the object that represents the object, and retrieving the first element from the array that is returned by its method. +- By retrieving the object that represents the object, and retrieving the first element from the array that is returned by its method. ## Examples - The following example defines an array of objects that contain the names of students, their average test scores, and the number of tests taken. The array is passed to the `ComputeStatistics` method, which calculates the mean score, standard deviation, and number of cases from which the statistics are calculated. These values are stored in the object that is returned by the `ComputeStatistics` method. The property contains the number of cases. + The following example defines an array of objects that contain the names of students, their average test scores, and the number of tests taken. The array is passed to the `ComputeStatistics` method, which calculates the mean score, standard deviation, and number of cases from which the statistics are calculated. These values are stored in the object that is returned by the `ComputeStatistics` method. The property contains the number of cases. :::code language="csharp" source="~/snippets/csharp/System/TupleT1,T2,T3/Overview/example1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TupleT1,T2,T3/Overview/example1.fs" id="Snippet1"::: @@ -441,16 +441,16 @@ component in one of two ways: + You can dynamically determine the type of the component in one of two ways: -- By calling the `GetType` method on the value that is returned by the property. +- By calling the `GetType` method on the value that is returned by the property. -- By retrieving the object that represents the object, and retrieving the second element from the array that is returned by its method. +- By retrieving the object that represents the object, and retrieving the second element from the array that is returned by its method. ## Examples - The following example defines an array of objects that contain the names of students, their average test scores, and the number of tests taken. The array is passed to the `ComputeStatistics` method, which calculates the mean score, standard deviation, and number of cases from which the statistics are calculated. These values are stored in the object that is returned by the `ComputeStatistics` method. The property contains the mean test score. + The following example defines an array of objects that contain the names of students, their average test scores, and the number of tests taken. The array is passed to the `ComputeStatistics` method, which calculates the mean score, standard deviation, and number of cases from which the statistics are calculated. These values are stored in the object that is returned by the `ComputeStatistics` method. The property contains the mean test score. :::code language="csharp" source="~/snippets/csharp/System/TupleT1,T2,T3/Overview/example1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TupleT1,T2,T3/Overview/example1.fs" id="Snippet1"::: @@ -505,16 +505,16 @@ component in one of two ways: + You can dynamically determine the type of the component in one of two ways: -- By calling the `GetType` method on the value returned by the property. +- By calling the `GetType` method on the value returned by the property. -- By retrieving the object that represents the object, and retrieving the third element from the array that is returned by its method. +- By retrieving the object that represents the object, and retrieving the third element from the array that is returned by its method. ## Examples - The following example defines an array of objects that contain the names of students, their average test scores, and the number of tests taken. The array is passed to the `ComputeStatistics` method, which calculates the mean score, standard deviation, and number of cases from which the statistics are calculated. These values are stored in the object that is returned by the `ComputeStatistics` method. The property contains the standard deviation. + The following example defines an array of objects that contain the names of students, their average test scores, and the number of tests taken. The array is passed to the `ComputeStatistics` method, which calculates the mean score, standard deviation, and number of cases from which the statistics are calculated. These values are stored in the object that is returned by the `ComputeStatistics` method. The property contains the standard deviation. :::code language="csharp" source="~/snippets/csharp/System/TupleT1,T2,T3/Overview/example1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TupleT1,T2,T3/Overview/example1.fs" id="Snippet1"::: @@ -596,17 +596,17 @@ instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. - Although this method can be called directly, it is most commonly called by collection sorting methods that include parameters to order the members of a collection. For example, it is called by the method and the method of a object that is instantiated by using the constructor. + Although this method can be called directly, it is most commonly called by collection sorting methods that include parameters to order the members of a collection. For example, it is called by the method and the method of a object that is instantiated by using the constructor. > [!CAUTION] -> The method is intended for use in sorting operations. It should not be used when the primary purpose of a comparison is to determine whether two objects are equal. To determine whether two objects are equal, call the method. +> The method is intended for use in sorting operations. It should not be used when the primary purpose of a comparison is to determine whether two objects are equal. To determine whether two objects are equal, call the method. ## Examples - The following example creates an array of objects that consist of a student's name, mean test score, and number of tests. It displays the component of each tuple in the array in unsorted order, sorts the array, and then calls to display the value of each tuple in sorted order. To sort the array, the example defines a generic `ScoreComparer` class that implements the interface and sorts the objects in ascending order by the value of their second component rather than their first component. Note that the example does not directly call the method. This method is called implicitly by the method for each element in the array. + The following example creates an array of objects that consist of a student's name, mean test score, and number of tests. It displays the component of each tuple in the array in unsorted order, sorts the array, and then calls to display the value of each tuple in sorted order. To sort the array, the example defines a generic `ScoreComparer` class that implements the interface and sorts the objects in ascending order by the value of their second component rather than their first component. Note that the example does not directly call the method. This method is called implicitly by the method for each element in the array. :::code language="csharp" source="~/snippets/csharp/System/TupleT1,T2,T3/System.Collections.IStructuralComparable.CompareTo/compareto2.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/TupleT1,T2,T3/System.Collections.IStructuralComparable.CompareTo/compareto2.fs" id="Snippet2"::: @@ -681,14 +681,14 @@ instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. - The implementation is called only if `other` is not `null`, and if it can be successfully cast (in C#) or converted (in Visual Basic) to a object whose components are of the same types as the current instance. The method first passes the values of the objects to be compared to the implementation. If this method call returns `true`, the method is called again and passed the values of the two objects. If this method call returns `true` again, the method is called a third time and passed the values of the two objects. + The implementation is called only if `other` is not `null`, and if it can be successfully cast (in C#) or converted (in Visual Basic) to a object whose components are of the same types as the current instance. The method first passes the values of the objects to be compared to the implementation. If this method call returns `true`, the method is called again and passed the values of the two objects. If this method call returns `true` again, the method is called a third time and passed the values of the two objects. ## Examples - The following example defines an `Item2Comparer` class that implements the interface and changes the way in which objects are evaluated for equality. The method always returns `true` when it is passed the property values of two objects, and it calls the method to evaluate their property values. If this method call returns `true`, their property values are passed to the method, which always returns `true`. As a result, the method tests for equality based only on the value of the property. The output illustrates the result for a data set of objects that record the names, mean test score, and number of tests of students in a class. + The following example defines an `Item2Comparer` class that implements the interface and changes the way in which objects are evaluated for equality. The method always returns `true` when it is passed the property values of two objects, and it calls the method to evaluate their property values. If this method call returns `true`, their property values are passed to the method, which always returns `true`. As a result, the method tests for equality based only on the value of the property. The output illustrates the result for a data set of objects that record the names, mean test score, and number of tests of students in a class. :::code language="csharp" source="~/snippets/csharp/System/TupleT1,T2,T3/Equals/equals2.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/TupleT1,T2,T3/Equals/equals2.fs" id="Snippet2"::: @@ -750,11 +750,11 @@ instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. - The method simply wraps a call to the `comparer` object's implementation. + The method simply wraps a call to the `comparer` object's implementation. - The algorithm used to compute the hash code should return the same hash code for two objects that are considered to be equal. + The algorithm used to compute the hash code should return the same hash code for two objects that are considered to be equal. ]]> @@ -830,19 +830,19 @@ instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. - This method provides the implementation for the class. Although the method can be called directly, it is most commonly called by the default overloads of collection sorting methods, such as and , to order the members of a collection. + This method provides the implementation for the class. Although the method can be called directly, it is most commonly called by the default overloads of collection sorting methods, such as and , to order the members of a collection. > [!CAUTION] -> The method is intended for use in sorting operations. It should not be used when the primary purpose of a comparison is to determine whether two objects are equal. To determine whether two objects are equal, call the method. +> The method is intended for use in sorting operations. It should not be used when the primary purpose of a comparison is to determine whether two objects are equal. To determine whether two objects are equal, call the method. - The method uses the default object comparer to compare each component. + The method uses the default object comparer to compare each component. ## Examples - The following example creates an array of objects whose components consist of a student's name, mean test score, and number of tests. It displays the components of each tuple in the array in unsorted order, sorts the array, and then calls to display each tuple in sorted order. The output shows that the array has been sorted by its first component. Note that the example does not directly call the method. This method is called implicitly by the method for each element in the array. + The following example creates an array of objects whose components consist of a student's name, mean test score, and number of tests. It displays the components of each tuple in the array in unsorted order, sorts the array, and then calls to display each tuple in sorted order. The output shows that the array has been sorted by its first component. Note that the example does not directly call the method. This method is called implicitly by the method for each element in the array. :::code language="csharp" source="~/snippets/csharp/System/TupleT1,T2,T3/System.Collections.IStructuralComparable.CompareTo/compareto1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TupleT1,T2,T3/System.Collections.IStructuralComparable.CompareTo/compareto1.fs" id="Snippet1"::: @@ -957,7 +957,7 @@ The property is an explicit interface implementation. To call it, you must cast or convert the object to an interface object. + The property is an explicit interface implementation. To call it, you must cast or convert the object to an interface object. ]]> @@ -1009,12 +1009,12 @@ The , , and properties, respectively. If any of the property values is `null`, it is represented as . + The string returned by this method takes the form (*Item1*, *Item2*, *Item3*), where *Item1*, *Item2*, and *Item3* represent the values of the , , and properties, respectively. If any of the property values is `null`, it is represented as . ## Examples - The following example illustrates the method. + The following example illustrates the method. :::code language="csharp" source="~/snippets/csharp/System/TupleT1,T2,T3/ToString/tostring1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TupleT1,T2,T3/ToString/tostring1.fs" id="Snippet1"::: diff --git a/xml/System/Tuple`4.xml b/xml/System/Tuple`4.xml index 9aa5a8e9d69..84c4af43edd 100644 --- a/xml/System/Tuple`4.xml +++ b/xml/System/Tuple`4.xml @@ -122,23 +122,23 @@ class represents a 4-tuple, or quadruple, which is a tuple that has four components. + A tuple is a data structure that has a specific number and sequence of values. The class represents a 4-tuple, or quadruple, which is a tuple that has four components. - You can instantiate a object by calling either the constructor or the static method. You can retrieve the value of the tuple's components by using the read-only , , , and instance properties. + You can instantiate a object by calling either the constructor or the static method. You can retrieve the value of the tuple's components by using the read-only , , , and instance properties. Tuples are commonly used in four different ways: - To represent a single set of data. For example, a tuple can represent a database record, and its components can represent individual fields of the record. -- To provide easy access to, and manipulation of, a data set. The following example defines an array of objects that contain the names of baseball pitchers, the number of innings they pitched, and the number of earned runs (runs that scored without fielding errors), and hits that they gave up. The array is passed to the `ComputeStatistics` method, which calculates each pitcher's earned run average (the average number of runs given up in a nine-inning game), and the average number of hits given up per inning. The method also uses these two averages to compute a hypothetical effectiveness average. +- To provide easy access to, and manipulation of, a data set. The following example defines an array of objects that contain the names of baseball pitchers, the number of innings they pitched, and the number of earned runs (runs that scored without fielding errors), and hits that they gave up. The array is passed to the `ComputeStatistics` method, which calculates each pitcher's earned run average (the average number of runs given up in a nine-inning game), and the average number of hits given up per inning. The method also uses these two averages to compute a hypothetical effectiveness average. :::code language="csharp" source="~/snippets/csharp/System/TupleT1,T2,T3,T4/Overview/example1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TupleT1,T2,T3,T4/Overview/example1.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/TupleT1,T2,T3,T4/Overview/example1.vb" id="Snippet1"::: -- To return multiple values from a method without the use of `out` parameters (in C#) or `ByRef` parameters (in Visual Basic). For example, the previous example returns its computed statistics, along with the name of the pitcher, in an array of objects. +- To return multiple values from a method without the use of `out` parameters (in C#) or `ByRef` parameters (in Visual Basic). For example, the previous example returns its computed statistics, along with the name of the pitcher, in an array of objects. -- To pass multiple values to a method through a single parameter. For example, the method has a single parameter that lets you supply one value to the method that the thread executes at startup. If you supply a object as the method argument, you can supply the thread's startup routine with four items of data. +- To pass multiple values to a method through a single parameter. For example, the method has a single parameter that lets you supply one value to the method that the thread executes at startup. If you supply a object as the method argument, you can supply the thread's startup routine with four items of data. ]]> @@ -203,13 +203,13 @@ method to instantiate a 4-tuple object without having to explicitly specify the types of its components. The following example uses the method to instantiate a 4-tuple whose components are of type , , , and . + You can also use the static method to instantiate a 4-tuple object without having to explicitly specify the types of its components. The following example uses the method to instantiate a 4-tuple whose components are of type , , , and . :::code language="csharp" source="~/snippets/csharp/System/Tuple/Overview/create1.cs" id="Snippet7"::: :::code language="fsharp" source="~/snippets/fsharp/System/Tuple/Overview/create1.fs" id="Snippet7"::: :::code language="vb" source="~/snippets/visualbasic/System/Tuple/Overview/create1.vb" id="Snippet7"::: - This is equivalent to the following call to the class constructor. + This is equivalent to the following call to the class constructor. :::code language="csharp" source="~/snippets/csharp/System/Tuple/Overview/create1.cs" id="Snippet8"::: :::code language="fsharp" source="~/snippets/fsharp/System/Tuple/Overview/create1.fs" id="Snippet8"::: @@ -279,7 +279,7 @@ ## Remarks The `obj` parameter is considered to be equal to the current instance under the following conditions: -- It is a object. +- It is a object. - Its four components are of the same types as the current instance. @@ -288,7 +288,7 @@ ## Examples - The following example defines an array of objects that provide data on temperatures at three times during a particular day. The method is called to compare every object with every other object. The output illustrates that the method returns `true` only when all four components of the objects have equal values. + The following example defines an array of objects that provide data on temperatures at three times during a particular day. The method is called to compare every object with every other object. The output illustrates that the method returns `true` only when all four components of the objects have equal values. :::code language="csharp" source="~/snippets/csharp/System/TupleT1,T2,T3,T4/Equals/equals1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TupleT1,T2,T3,T4/Equals/equals1.fs" id="Snippet1"::: @@ -388,16 +388,16 @@ component in one of two ways: + You can dynamically determine the type of the component in one of two ways: -- By calling the `GetType` method on the value that is returned by the property. +- By calling the `GetType` method on the value that is returned by the property. -- By retrieving the object that represents the object, and retrieving the first element from the array that is returned by its method. +- By retrieving the object that represents the object, and retrieving the first element from the array that is returned by its method. ## Examples - The following example defines an array of objects whose components contain the name of a city, a month of the year, and the average high and low temperatures for that month. It then retrieves and displays the value of each component. + The following example defines an array of objects whose components contain the name of a city, a month of the year, and the average high and low temperatures for that month. It then retrieves and displays the value of each component. :::code language="csharp" source="~/snippets/csharp/System/TupleT1,T2,T3,T4/Item1/item1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TupleT1,T2,T3,T4/Item1/item1.fs" id="Snippet1"::: @@ -452,16 +452,16 @@ component in one of two ways: + You can dynamically determine the type of the component in one of two ways: -- By calling the `GetType` method on the value that is returned by the property. +- By calling the `GetType` method on the value that is returned by the property. -- By retrieving the object that represents the object, and retrieving the second element from the array that is returned by its method. +- By retrieving the object that represents the object, and retrieving the second element from the array that is returned by its method. ## Examples - The following example defines an array of objects whose components contain the name of a city, a month of the year, and the average high and low temperatures for that month. It then retrieves and displays the value of each component. + The following example defines an array of objects whose components contain the name of a city, a month of the year, and the average high and low temperatures for that month. It then retrieves and displays the value of each component. :::code language="csharp" source="~/snippets/csharp/System/TupleT1,T2,T3,T4/Item1/item1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TupleT1,T2,T3,T4/Item1/item1.fs" id="Snippet1"::: @@ -516,16 +516,16 @@ component in one of two ways: + You can dynamically determine the type of the component in one of two ways: -- By calling the `GetType` method on the value that is returned by the property. +- By calling the `GetType` method on the value that is returned by the property. -- By retrieving the object that represents the object, and retrieving the third element from the array that is returned by its method. +- By retrieving the object that represents the object, and retrieving the third element from the array that is returned by its method. ## Examples - The following example defines an array of objects whose components contain the name of a city, a month of the year, and the average high and low temperatures for that month. It then retrieves and displays the value of each component. + The following example defines an array of objects whose components contain the name of a city, a month of the year, and the average high and low temperatures for that month. It then retrieves and displays the value of each component. :::code language="csharp" source="~/snippets/csharp/System/TupleT1,T2,T3,T4/Item1/item1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TupleT1,T2,T3,T4/Item1/item1.fs" id="Snippet1"::: @@ -580,16 +580,16 @@ component in one of two ways: + You can dynamically determine the type of the component in one of two ways: -- By calling the `GetType` method on the value that is returned by the property. +- By calling the `GetType` method on the value that is returned by the property. -- By retrieving the object that represents the object, and retrieving the fourth element from the array that is returned by its method. +- By retrieving the object that represents the object, and retrieving the fourth element from the array that is returned by its method. ## Examples - The following example defines an array of objects whose components contain the name of a city, a month of the year, and the average high and low temperatures for that month. It then retrieves and displays the value of each component. + The following example defines an array of objects whose components contain the name of a city, a month of the year, and the average high and low temperatures for that month. It then retrieves and displays the value of each component. :::code language="csharp" source="~/snippets/csharp/System/TupleT1,T2,T3,T4/Item1/item1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TupleT1,T2,T3,T4/Item1/item1.fs" id="Snippet1"::: @@ -671,17 +671,17 @@ instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. - Although this method can be called directly, it is most commonly called by collection sorting methods that include parameters to order the members of a collection. For example, it is called by the method and the method of a object that is instantiated by using the constructor. + Although this method can be called directly, it is most commonly called by collection sorting methods that include parameters to order the members of a collection. For example, it is called by the method and the method of a object that is instantiated by using the constructor. > [!CAUTION] -> The method is intended for use in sorting operations. It should not be used when the primary purpose of a comparison is to determine whether two objects are equal. To determine whether two objects are equal, call the method. +> The method is intended for use in sorting operations. It should not be used when the primary purpose of a comparison is to determine whether two objects are equal. To determine whether two objects are equal, call the method. ## Examples - The following example creates an array of objects that contain statistical data about baseball pitchers. The data items include the name of the pitcher, the number of innings pitched, the pitcher's earned run average (the average number of runs a pitcher allows per game), and the number of hits the pitcher has given up. The example displays the component of each tuple in the array in unsorted order, sorts the array, and then calls to display the value of each tuple in sorted order. To sort the array, the example defines a generic `PitcherComparer` class that implements the interface and sorts the objects in ascending order by the value of their third component (the earned run average) rather than their first component. Note that the example does not directly call the method. This method is called implicitly by the method for each element in the array. + The following example creates an array of objects that contain statistical data about baseball pitchers. The data items include the name of the pitcher, the number of innings pitched, the pitcher's earned run average (the average number of runs a pitcher allows per game), and the number of hits the pitcher has given up. The example displays the component of each tuple in the array in unsorted order, sorts the array, and then calls to display the value of each tuple in sorted order. To sort the array, the example defines a generic `PitcherComparer` class that implements the interface and sorts the objects in ascending order by the value of their third component (the earned run average) rather than their first component. Note that the example does not directly call the method. This method is called implicitly by the method for each element in the array. :::code language="csharp" source="~/snippets/csharp/System/TupleT1,T2,T3,T4/System.Collections.IStructuralComparable.CompareTo/compareto2.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/TupleT1,T2,T3,T4/System.Collections.IStructuralComparable.CompareTo/compareto2.fs" id="Snippet2"::: @@ -755,14 +755,14 @@ instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. - The implementation is called only if `other` is not `null`, and if it can be successfully cast (in C#) or converted (in Visual Basic) to a object whose components are of the same types as the current instance. The method first passes the values of the objects to be compared to the implementation. If this method call returns `true`, the method is called again and passed the values of the two objects. If this method call returns `true` again, the method is called a third time and passed the values of the two objects. If this method call returns `true` again, the method is called for the fourth and final time and passed the values of the two objects. + The implementation is called only if `other` is not `null`, and if it can be successfully cast (in C#) or converted (in Visual Basic) to a object whose components are of the same types as the current instance. The method first passes the values of the objects to be compared to the implementation. If this method call returns `true`, the method is called again and passed the values of the two objects. If this method call returns `true` again, the method is called a third time and passed the values of the two objects. If this method call returns `true` again, the method is called for the fourth and final time and passed the values of the two objects. ## Examples - The following example defines an `Item3And4Comparer` class that implements the interface and changes the way in which objects are evaluated for equality. The method always returns `true` when it is passed the and property values of two objects, and it calls the `obj.Equals` method to evaluate their property values. It this method call returns `true`, it also calls the `obj.Equals` method to evaluate the tuples' property values. As a result, the method tests for equality based only on the values of the and properties. The output illustrates the result for a data set of objects that record the name of a U.S. city, the month of a year, and the average high and low temperature for that month. + The following example defines an `Item3And4Comparer` class that implements the interface and changes the way in which objects are evaluated for equality. The method always returns `true` when it is passed the and property values of two objects, and it calls the `obj.Equals` method to evaluate their property values. It this method call returns `true`, it also calls the `obj.Equals` method to evaluate the tuples' property values. As a result, the method tests for equality based only on the values of the and properties. The output illustrates the result for a data set of objects that record the name of a U.S. city, the month of a year, and the average high and low temperature for that month. :::code language="csharp" source="~/snippets/csharp/System/TupleT1,T2,T3,T4/Equals/equals2.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/TupleT1,T2,T3,T4/Equals/equals2.fs" id="Snippet2"::: @@ -824,11 +824,11 @@ instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. - The method simply wraps a call to the `comparer` object's implementation. + The method simply wraps a call to the `comparer` object's implementation. - The algorithm used to compute the hash code should return the same hash code for two objects that are considered to be equal. + The algorithm used to compute the hash code should return the same hash code for two objects that are considered to be equal. ]]> @@ -904,19 +904,19 @@ instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. - This method provides the implementation for the class. Although the method can be called directly, it is most commonly called by the default overloads of collection sorting methods, such as and , to order the members of a collection. + This method provides the implementation for the class. Although the method can be called directly, it is most commonly called by the default overloads of collection sorting methods, such as and , to order the members of a collection. > [!CAUTION] -> The method is intended for use in sorting operations. It should not be used when the primary purpose of a comparison is to determine whether two objects are equal. To determine whether two objects are equal, call the method. +> The method is intended for use in sorting operations. It should not be used when the primary purpose of a comparison is to determine whether two objects are equal. To determine whether two objects are equal, call the method. - The method uses the default object comparer to compare each component. + The method uses the default object comparer to compare each component. ## Examples - The following example creates an array of objects whose components consist of a baseball pitcher's name, number of innings pitched, and number of hits and earned runs given up. It displays the components of each tuple in the array in unsorted order, sorts the array, and then calls to display each tuple in sorted order. The output shows that the array has been sorted by name, which is the first component. Note that the example does not directly call the method. This method is called implicitly by the method for each element in the array. + The following example creates an array of objects whose components consist of a baseball pitcher's name, number of innings pitched, and number of hits and earned runs given up. It displays the components of each tuple in the array in unsorted order, sorts the array, and then calls to display each tuple in sorted order. The output shows that the array has been sorted by name, which is the first component. Note that the example does not directly call the method. This method is called implicitly by the method for each element in the array. :::code language="csharp" source="~/snippets/csharp/System/TupleT1,T2,T3,T4/System.Collections.IStructuralComparable.CompareTo/compareto1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TupleT1,T2,T3,T4/System.Collections.IStructuralComparable.CompareTo/compareto1.fs" id="Snippet1"::: @@ -1032,7 +1032,7 @@ property is an explicit interface implementation. To call it, you must cast or convert the object to an interface object. + The property is an explicit interface implementation. To call it, you must cast or convert the object to an interface object. ]]> @@ -1084,12 +1084,12 @@ , , , and properties, respectively. If any of the property values is `null`, it is represented as . + The string returned by this method takes the form (*Item1*, *Item2*, *Item3*, *Item4*), where *Item1*, *Item2*, *Item3*, and *Item4* represent the values of the , , , and properties, respectively. If any of the property values is `null`, it is represented as . ## Examples - The following example illustrates the method. It displays the components of an array of 4-tuple objects that contain the name of a city, a month of the year, and the high and low average temperature for that month. + The following example illustrates the method. It displays the components of an array of 4-tuple objects that contain the name of a city, a month of the year, and the high and low average temperature for that month. :::code language="csharp" source="~/snippets/csharp/System/TupleT1,T2,T3,T4/ToString/tostring1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TupleT1,T2,T3,T4/ToString/tostring1.fs" id="Snippet1"::: diff --git a/xml/System/Tuple`5.xml b/xml/System/Tuple`5.xml index c3346a26f68..8151133f8a6 100644 --- a/xml/System/Tuple`5.xml +++ b/xml/System/Tuple`5.xml @@ -131,23 +131,23 @@ class represents a 5-tuple, or quintuple, which is a tuple that has five components. + A tuple is a data structure that has a specific number and sequence of values. The class represents a 5-tuple, or quintuple, which is a tuple that has five components. - You can instantiate a object by calling either the constructor or the static method. You can retrieve the value of the tuple's components by using the read-only , , , , and instance properties. + You can instantiate a object by calling either the constructor or the static method. You can retrieve the value of the tuple's components by using the read-only , , , , and instance properties. Tuples are commonly used in four different ways: - To represent a single set of data. For example, a tuple can represent a database record, and its components can represent individual fields of the record. -- To provide easy access to, and manipulation of, a data set. The following example defines an array of objects that contain the names of running backs in American football, the number of games in which they played, and the number of carries, total yards gained, and touchdowns scored during those games. The array is passed to the `ComputeStatistics` method, which calculates each running back's number of carries per game, average yards per game, average yards per carry, and average number of touchdowns per attempt. +- To provide easy access to, and manipulation of, a data set. The following example defines an array of objects that contain the names of running backs in American football, the number of games in which they played, and the number of carries, total yards gained, and touchdowns scored during those games. The array is passed to the `ComputeStatistics` method, which calculates each running back's number of carries per game, average yards per game, average yards per carry, and average number of touchdowns per attempt. :::code language="csharp" source="~/snippets/csharp/System/TupleT1,T2,T3,T4,T5/Overview/example1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TupleT1,T2,T3,T4,T5/Overview/example1.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/TupleT1,T2,T3,T4,T5/Overview/example1.vb" id="Snippet1"::: -- To return multiple values from a method without the use of `out` parameters (in C#) or `ByRef` parameters (in Visual Basic). For example, the previous example returns its computed statistics, along with the name of the player, in an array of objects. +- To return multiple values from a method without the use of `out` parameters (in C#) or `ByRef` parameters (in Visual Basic). For example, the previous example returns its computed statistics, along with the name of the player, in an array of objects. -- To pass multiple values to a method through a single parameter. For example, the method has a single parameter that lets you supply one value to the method that the thread executes at startup. If you supply a object as the method argument, you can supply the thread's startup routine with five items of data. +- To pass multiple values to a method through a single parameter. For example, the method has a single parameter that lets you supply one value to the method that the thread executes at startup. If you supply a object as the method argument, you can supply the thread's startup routine with five items of data. ]]> @@ -214,13 +214,13 @@ method to instantiate a 5-tuple object without having to explicitly specify the types of its components. The following example uses the method to instantiate a 5-tuple whose first component is of type and its remaining four components are of type . + You can also use the static method to instantiate a 5-tuple object without having to explicitly specify the types of its components. The following example uses the method to instantiate a 5-tuple whose first component is of type and its remaining four components are of type . :::code language="csharp" source="~/snippets/csharp/System/Tuple/Overview/create1.cs" id="Snippet9"::: :::code language="fsharp" source="~/snippets/fsharp/System/Tuple/Overview/create1.fs" id="Snippet9"::: :::code language="vb" source="~/snippets/visualbasic/System/Tuple/Overview/create1.vb" id="Snippet9"::: - This is equivalent to the following call to the class constructor. + This is equivalent to the following call to the class constructor. :::code language="csharp" source="~/snippets/csharp/System/Tuple/Overview/create1.cs" id="Snippet10"::: :::code language="fsharp" source="~/snippets/fsharp/System/Tuple/Overview/create1.fs" id="Snippet10"::: @@ -290,7 +290,7 @@ ## Remarks The `obj` parameter is considered to be equal to the current instance under the following conditions: -- It is a object. +- It is a object. - Its five components are of the same types as the current instance. @@ -299,7 +299,7 @@ ## Examples - The following example defines an array of 5-tuple objects that contain data about the temperatures of patients in two test groups. The first component of the array provides the number of the test group, and the second through fifth components provide the temperatures of a patient at hourly intervals. The method is called to compare every object with every other object. The output illustrates that the method returns `true` only when all five components of the objects have equal values. + The following example defines an array of 5-tuple objects that contain data about the temperatures of patients in two test groups. The first component of the array provides the number of the test group, and the second through fifth components provide the temperatures of a patient at hourly intervals. The method is called to compare every object with every other object. The output illustrates that the method returns `true` only when all five components of the objects have equal values. :::code language="csharp" source="~/snippets/csharp/System/TupleT1,T2,T3,T4,T5/Equals/equals1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TupleT1,T2,T3,T4,T5/Equals/equals1.fs" id="Snippet1"::: @@ -399,16 +399,16 @@ component in one of two ways: + You can dynamically determine the type of the component in one of two ways: -- By calling the `GetType` method on the value that is returned by the property. +- By calling the `GetType` method on the value that is returned by the property. -- By retrieving the object that represents the object, and retrieving the first element from the array that is returned by its method. +- By retrieving the object that represents the object, and retrieving the first element from the array that is returned by its method. ## Examples - The following example defines an array of objects whose components contain the name of a state in the United States, its population in 1990 and 2000, its population change in this 10-year period, and the percentage change in its population. It then iterates through the array and displays the value of each component in a tuple. + The following example defines an array of objects whose components contain the name of a state in the United States, its population in 1990 and 2000, its population change in this 10-year period, and the percentage change in its population. It then iterates through the array and displays the value of each component in a tuple. :::code language="csharp" source="~/snippets/csharp/System/TupleT1,T2,T3,T4,T5/Item1/item1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TupleT1,T2,T3,T4,T5/Item1/item1.fs" id="Snippet1"::: @@ -463,16 +463,16 @@ component in one of two ways: + You can dynamically determine the type of the component in one of two ways: -- By calling the `GetType` method on the value that is returned by the property. +- By calling the `GetType` method on the value that is returned by the property. -- By retrieving the object that represents the object, and retrieving the second element from the array that is returned by its method. +- By retrieving the object that represents the object, and retrieving the second element from the array that is returned by its method. ## Examples - The following example defines an array of objects whose components contain the name of a state in the United States, its population in 1990 and 2000, its population change in this 10-year period, and the percentage change in its population. It then iterates through the array and displays the value of each component in a tuple. + The following example defines an array of objects whose components contain the name of a state in the United States, its population in 1990 and 2000, its population change in this 10-year period, and the percentage change in its population. It then iterates through the array and displays the value of each component in a tuple. :::code language="csharp" source="~/snippets/csharp/System/TupleT1,T2,T3,T4,T5/Item1/item1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TupleT1,T2,T3,T4,T5/Item1/item1.fs" id="Snippet1"::: @@ -527,16 +527,16 @@ component in one of two ways: + You can dynamically determine the type of the component in one of two ways: -- By calling the `GetType` method on the value that is returned by the property. +- By calling the `GetType` method on the value that is returned by the property. -- By retrieving the object that represents the object, and retrieving the second element from the array that is returned by its method. +- By retrieving the object that represents the object, and retrieving the second element from the array that is returned by its method. ## Examples - The following example defines an array of objects whose components contain the name of a state in the United States, its population in 1990 and 2000, its population change in this 10-year period, and the percentage change in its population. It then iterates through the array and displays the value of each component in a tuple. + The following example defines an array of objects whose components contain the name of a state in the United States, its population in 1990 and 2000, its population change in this 10-year period, and the percentage change in its population. It then iterates through the array and displays the value of each component in a tuple. :::code language="csharp" source="~/snippets/csharp/System/TupleT1,T2,T3,T4,T5/Item1/item1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TupleT1,T2,T3,T4,T5/Item1/item1.fs" id="Snippet1"::: @@ -591,16 +591,16 @@ component in one of two ways: + You can dynamically determine the type of the component in one of two ways: -- By calling the `GetType` method on the value that is returned by the property. +- By calling the `GetType` method on the value that is returned by the property. -- By retrieving the object that represents the object, and retrieving the second element from the array that is returned by its method. +- By retrieving the object that represents the object, and retrieving the second element from the array that is returned by its method. ## Examples - The following example defines an array of objects whose components contain the name of a state in the United States, its population in 1990 and 2000, its population change in this 10-year period, and the percentage change in its population. It then iterates through the array and displays the value of each component in a tuple. + The following example defines an array of objects whose components contain the name of a state in the United States, its population in 1990 and 2000, its population change in this 10-year period, and the percentage change in its population. It then iterates through the array and displays the value of each component in a tuple. :::code language="csharp" source="~/snippets/csharp/System/TupleT1,T2,T3,T4,T5/Item1/item1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TupleT1,T2,T3,T4,T5/Item1/item1.fs" id="Snippet1"::: @@ -655,16 +655,16 @@ component in one of two ways: + You can dynamically determine the type of the component in one of two ways: -- By calling the `GetType` method on the value that is returned by the property. +- By calling the `GetType` method on the value that is returned by the property. -- By retrieving the object that represents the object, and retrieving the second element from the array that is returned by its method. +- By retrieving the object that represents the object, and retrieving the second element from the array that is returned by its method. ## Examples - The following example defines an array of objects whose components contain the name of a state in the United States, its population in 1990 and 2000, its population change in this 10-year period, and the percentage change in its population. It then iterates through the array and displays the value of each component in a tuple. + The following example defines an array of objects whose components contain the name of a state in the United States, its population in 1990 and 2000, its population change in this 10-year period, and the percentage change in its population. It then iterates through the array and displays the value of each component in a tuple. :::code language="csharp" source="~/snippets/csharp/System/TupleT1,T2,T3,T4,T5/Item1/item1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TupleT1,T2,T3,T4,T5/Item1/item1.fs" id="Snippet1"::: @@ -746,15 +746,15 @@ instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. - Although this method can be called directly, it is most commonly called by collection-sorting methods that include parameters to order the members of a collection. For example, it is called by the method and the method of a object that is instantiated by using the constructor. + Although this method can be called directly, it is most commonly called by collection-sorting methods that include parameters to order the members of a collection. For example, it is called by the method and the method of a object that is instantiated by using the constructor. > [!CAUTION] -> The method is intended for use in sorting operations. It should not be used when the primary purpose of a comparison is to determine whether two objects are equal. To determine whether two objects are equal, call the method. +> The method is intended for use in sorting operations. It should not be used when the primary purpose of a comparison is to determine whether two objects are equal. To determine whether two objects are equal, call the method. ## Examples - The following example creates an array of objects that contain career statistical data for running backs in American professional football. The 5-tuple's components consist of the player's name, the number of games in which he played, the number of carries or attempts, the total number of yards gained, and the number of touchdowns scored. The example displays the components of each tuple in the array in unsorted order, sorts the array, and then calls to display each tuple in sorted order. To sort the array, the example defines a generic `YardsGained` class that implements the interface and sorts the objects in descending order by the value of their fourth component (yards gained) rather than by their first component. Note that the example does not directly call the method. This method is called implicitly by the method for each element in the array. + The following example creates an array of objects that contain career statistical data for running backs in American professional football. The 5-tuple's components consist of the player's name, the number of games in which he played, the number of carries or attempts, the total number of yards gained, and the number of touchdowns scored. The example displays the components of each tuple in the array in unsorted order, sorts the array, and then calls to display each tuple in sorted order. To sort the array, the example defines a generic `YardsGained` class that implements the interface and sorts the objects in descending order by the value of their fourth component (yards gained) rather than by their first component. Note that the example does not directly call the method. This method is called implicitly by the method for each element in the array. :::code language="csharp" source="~/snippets/csharp/System/TupleT1,T2,T3,T4,T5/System.Collections.IStructuralComparable.CompareTo/compareto2.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/TupleT1,T2,T3,T4,T5/System.Collections.IStructuralComparable.CompareTo/compareto2.fs" id="Snippet2"::: @@ -828,14 +828,14 @@ instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. - The implementation is called only if `other` is not `null`, and if it can be successfully cast (in C#) or converted (in Visual Basic) to a object whose components are of the same types as the current instance. The method first passes the values of the objects to be compared to the implementation. If this method call returns `true`, the method is called again and passed the values of the two objects. This continues until the method call returns `false` when it compares a specific pair of `Item` values, or the two values are passed to the method. + The implementation is called only if `other` is not `null`, and if it can be successfully cast (in C#) or converted (in Visual Basic) to a object whose components are of the same types as the current instance. The method first passes the values of the objects to be compared to the implementation. If this method call returns `true`, the method is called again and passed the values of the two objects. This continues until the method call returns `false` when it compares a specific pair of `Item` values, or the two values are passed to the method. ## Examples - The following example defines a `DoubleComparer` class that implements the interface. The example instantiates two objects by using a random number generator to populate their second through fifth components, casts the first instance to an interface, and then uses a `DoubleComparer` object to test the two objects for approximate equality. + The following example defines a `DoubleComparer` class that implements the interface. The example instantiates two objects by using a random number generator to populate their second through fifth components, casts the first instance to an interface, and then uses a `DoubleComparer` object to test the two objects for approximate equality. :::code language="csharp" source="~/snippets/csharp/System/TupleT1,T2,T3,T4,T5/Equals/equals2.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/TupleT1,T2,T3,T4,T5/Equals/equals2.fs" id="Snippet2"::: @@ -897,11 +897,11 @@ instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. - The method simply wraps a call to the `comparer` object's implementation. + The method simply wraps a call to the `comparer` object's implementation. - The algorithm used to compute the hash code should return the same hash code for two objects that are considered to be equal. + The algorithm used to compute the hash code should return the same hash code for two objects that are considered to be equal. ]]> @@ -977,19 +977,19 @@ instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. - This method provides the implementation for the class. Although the method can be called directly, it is most commonly called by the default overloads of collection-sorting methods, such as and , to order the members of a collection. + This method provides the implementation for the class. Although the method can be called directly, it is most commonly called by the default overloads of collection-sorting methods, such as and , to order the members of a collection. > [!CAUTION] -> The method is intended for use in sorting operations. It should not be used when the primary purpose of a comparison is to determine whether two objects are equal. To determine whether two objects are equal, call the method. +> The method is intended for use in sorting operations. It should not be used when the primary purpose of a comparison is to determine whether two objects are equal. To determine whether two objects are equal, call the method. - The method uses the default object comparer to compare each component. + The method uses the default object comparer to compare each component. ## Examples - The following example creates an array of objects that contain career statistics for running backs in American professional football. The five components consist of the player's name, the number of games in which he played, the number of carries or attempts, the total number of yards gained, and the number of touchdowns scored. The example displays the components of each tuple in the array in unsorted order, sorts the array, and then calls to display each tuple in sorted order. The output shows that the array has been sorted by name, which is the first component. Note that the example does not directly call the method. This method is called implicitly by the method for each element in the array. + The following example creates an array of objects that contain career statistics for running backs in American professional football. The five components consist of the player's name, the number of games in which he played, the number of carries or attempts, the total number of yards gained, and the number of touchdowns scored. The example displays the components of each tuple in the array in unsorted order, sorts the array, and then calls to display each tuple in sorted order. The output shows that the array has been sorted by name, which is the first component. Note that the example does not directly call the method. This method is called implicitly by the method for each element in the array. :::code language="csharp" source="~/snippets/csharp/System/TupleT1,T2,T3,T4,T5/System.Collections.IStructuralComparable.CompareTo/compareto1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TupleT1,T2,T3,T4,T5/System.Collections.IStructuralComparable.CompareTo/compareto1.fs" id="Snippet1"::: @@ -1105,7 +1105,7 @@ property is an explicit interface implementation. To call it, you must cast or convert the object to an interface object. + The property is an explicit interface implementation. To call it, you must cast or convert the object to an interface object. ]]> @@ -1157,12 +1157,12 @@ , , , , and properties, respectively. If any of the property values is `null`, it is represented as . + The string returned by this method takes the form (*Item1*, *Item2*, *Item3*, *Item4*, `Item5`), where *Item1*, *Item2*, *Item3*, *Item4*, and `Item5` represent the values of the , , , , and properties, respectively. If any of the property values is `null`, it is represented as . ## Examples - The following example illustrates the method. It displays an array of 5-tuple objects that contain the name of a state in the United States, its population in 1990 and 2000, its population change in this 10-year period, and the annual rate of population change. + The following example illustrates the method. It displays an array of 5-tuple objects that contain the name of a state in the United States, its population in 1990 and 2000, its population change in this 10-year period, and the annual rate of population change. :::code language="csharp" source="~/snippets/csharp/System/TupleT1,T2,T3,T4,T5/ToString/tostring1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TupleT1,T2,T3,T4,T5/ToString/tostring1.fs" id="Snippet1"::: diff --git a/xml/System/Tuple`6.xml b/xml/System/Tuple`6.xml index 7e09c4f1138..08dc9dd73c4 100644 --- a/xml/System/Tuple`6.xml +++ b/xml/System/Tuple`6.xml @@ -140,23 +140,23 @@ class represents a 6-tuple, or sextuple, which is a tuple that has six components. + A tuple is a data structure that has a specific number and sequence of values. The class represents a 6-tuple, or sextuple, which is a tuple that has six components. - You can instantiate a object by calling either the or the static method. You can retrieve the value of the tuple's components by using the read-only , , , , , and instance properties. + You can instantiate a object by calling either the or the static method. You can retrieve the value of the tuple's components by using the read-only , , , , , and instance properties. Tuples are commonly used in four different ways: - To represent a single set of data. For example, a tuple can represent a database record, and its components can represent individual fields of the record. -- To provide easy access to, and manipulation of, a data set. The following example defines a object that contains population data for New York City for each census from 1960 through 2000. The sextuple is passed to the `ComputePopulationChange` method, which calculates the annual rate of change between censuses, as well as the annual rate of change for the entire 50 year period. +- To provide easy access to, and manipulation of, a data set. The following example defines a object that contains population data for New York City for each census from 1960 through 2000. The sextuple is passed to the `ComputePopulationChange` method, which calculates the annual rate of change between censuses, as well as the annual rate of change for the entire 50 year period. :::code language="csharp" source="~/snippets/csharp/System/TupleT1,T2,T3,T4,T5,T6/Overview/example1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TupleT1,T2,T3,T4,T5,T6/Overview/example1.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/TupleT1,T2,T3,T4,T5,T6/Overview/example1.vb" id="Snippet1"::: -- To return multiple values from a method without the use of `out` parameters (in C#) or `ByRef` parameters (in Visual Basic). For example, the previous example returns its computed statistics, along with the city name, in a object. +- To return multiple values from a method without the use of `out` parameters (in C#) or `ByRef` parameters (in Visual Basic). For example, the previous example returns its computed statistics, along with the city name, in a object. -- To pass multiple values to a method through a single parameter. For example, the method has a single parameter that lets you supply one value to the method that the thread executes at startup. If you supply a object as the method argument, you can supply the thread's startup routine with six items of data. +- To pass multiple values to a method through a single parameter. For example, the method has a single parameter that lets you supply one value to the method that the thread executes at startup. If you supply a object as the method argument, you can supply the thread's startup routine with six items of data. ]]> @@ -225,13 +225,13 @@ method to instantiate a 6-tuple object without having to explicitly specify the types of its components. The following example uses the method to instantiate a 6-tuple whose first component is of type and whose remaining components are of type . + You can also use the static method to instantiate a 6-tuple object without having to explicitly specify the types of its components. The following example uses the method to instantiate a 6-tuple whose first component is of type and whose remaining components are of type . :::code language="csharp" source="~/snippets/csharp/System/Tuple/Overview/create1.cs" id="Snippet11"::: :::code language="fsharp" source="~/snippets/fsharp/System/Tuple/Overview/create1.fs" id="Snippet11"::: :::code language="vb" source="~/snippets/visualbasic/System/Tuple/Overview/create1.vb" id="Snippet11"::: - This is equivalent to the following call to the class constructor. + This is equivalent to the following call to the class constructor. :::code language="csharp" source="~/snippets/csharp/System/Tuple/Overview/create1.cs" id="Snippet12"::: :::code language="fsharp" source="~/snippets/fsharp/System/Tuple/Overview/create1.fs" id="Snippet12"::: @@ -301,7 +301,7 @@ ## Remarks The `obj` parameter is considered to be equal to the current instance under the following conditions: -- It is a object. +- It is a object. - Its six components are of the same types as the current instance. @@ -410,16 +410,16 @@ component in one of two ways: + You can dynamically determine the type of the component in one of two ways: -- By calling the `GetType` method on the value that is returned by the property. +- By calling the `GetType` method on the value that is returned by the property. -- By retrieving the object that represents the object, and retrieving the first element from the array that is returned by its method. +- By retrieving the object that represents the object, and retrieving the first element from the array that is returned by its method. ## Examples - The following example defines an array of objects whose components contain population data for three U.S. cities (New York, Chicago, and Los Angeles) from 1960 through 2000. It then displays a table that lists the data. To display the city name, it retrieves the value of the property for each object. + The following example defines an array of objects whose components contain population data for three U.S. cities (New York, Chicago, and Los Angeles) from 1960 through 2000. It then displays a table that lists the data. To display the city name, it retrieves the value of the property for each object. :::code language="csharp" source="~/snippets/csharp/System/TupleT1,T2,T3,T4,T5,T6/Item1/item1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TupleT1,T2,T3,T4,T5,T6/Item1/item1.fs" id="Snippet1"::: @@ -474,16 +474,16 @@ component in one of two ways: + You can dynamically determine the type of the component in one of two ways: -- By calling the `GetType` method on the value that is returned by the property. +- By calling the `GetType` method on the value that is returned by the property. -- By retrieving the object that represents the object, and retrieving the first element from the array that is returned by its method. +- By retrieving the object that represents the object, and retrieving the first element from the array that is returned by its method. ## Examples - The following example defines an array of objects whose components contain population data for three U.S. cities (New York, Chicago, and Los Angeles) from 1960 through 2000. It then displays a table that lists the data. To display the population in 1960, it retrieves the value of the property for each object. + The following example defines an array of objects whose components contain population data for three U.S. cities (New York, Chicago, and Los Angeles) from 1960 through 2000. It then displays a table that lists the data. To display the population in 1960, it retrieves the value of the property for each object. :::code language="csharp" source="~/snippets/csharp/System/TupleT1,T2,T3,T4,T5,T6/Item1/item1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TupleT1,T2,T3,T4,T5,T6/Item1/item1.fs" id="Snippet1"::: @@ -538,16 +538,16 @@ component in one of two ways: + You can dynamically determine the type of the component in one of two ways: -- By calling the `GetType` method on the value that is returned by the property. +- By calling the `GetType` method on the value that is returned by the property. -- By retrieving the object that represents the object, and retrieving the first element from the array that is returned by its method. +- By retrieving the object that represents the object, and retrieving the first element from the array that is returned by its method. ## Examples - The following example defines an array of objects whose components contain population data for three U.S. cities (New York, Chicago, and Los Angeles) from 1960 through 2000. It then displays a table that lists the data. To display the population in 1970, it retrieves the value of the property for each object. + The following example defines an array of objects whose components contain population data for three U.S. cities (New York, Chicago, and Los Angeles) from 1960 through 2000. It then displays a table that lists the data. To display the population in 1970, it retrieves the value of the property for each object. :::code language="csharp" source="~/snippets/csharp/System/TupleT1,T2,T3,T4,T5,T6/Item1/item1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TupleT1,T2,T3,T4,T5,T6/Item1/item1.fs" id="Snippet1"::: @@ -602,16 +602,16 @@ component in one of two ways: + You can dynamically determine the type of the component in one of two ways: -- By calling the `GetType` method on the value that is returned by the property. +- By calling the `GetType` method on the value that is returned by the property. -- By retrieving the object that represents the object, and retrieving the first element from the array that is returned by its method. +- By retrieving the object that represents the object, and retrieving the first element from the array that is returned by its method. ## Examples - The following example defines an array of objects whose components contain population data for three U.S. cities (New York, Chicago, and Los Angeles) from 1960 through 2000. It then displays a table that lists the data. To display the population in 1980, it retrieves the value of the property for each object. + The following example defines an array of objects whose components contain population data for three U.S. cities (New York, Chicago, and Los Angeles) from 1960 through 2000. It then displays a table that lists the data. To display the population in 1980, it retrieves the value of the property for each object. :::code language="csharp" source="~/snippets/csharp/System/TupleT1,T2,T3,T4,T5,T6/Item1/item1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TupleT1,T2,T3,T4,T5,T6/Item1/item1.fs" id="Snippet1"::: @@ -666,16 +666,16 @@ component in one of two ways: + You can dynamically determine the type of the component in one of two ways: -- By calling the `GetType` method on the value that is returned by the property. +- By calling the `GetType` method on the value that is returned by the property. -- By retrieving the object that represents the object, and retrieving the first element from the array that is returned by its method. +- By retrieving the object that represents the object, and retrieving the first element from the array that is returned by its method. ## Examples - The following example defines an array of objects whose components contain population data for three U.S. cities (New York, Chicago, and Los Angeles) from 1960 through 2000. It then displays a table that lists the data. To display the population in 1990, it retrieves the value of the property for each object. + The following example defines an array of objects whose components contain population data for three U.S. cities (New York, Chicago, and Los Angeles) from 1960 through 2000. It then displays a table that lists the data. To display the population in 1990, it retrieves the value of the property for each object. :::code language="csharp" source="~/snippets/csharp/System/TupleT1,T2,T3,T4,T5,T6/Item1/item1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TupleT1,T2,T3,T4,T5,T6/Item1/item1.fs" id="Snippet1"::: @@ -730,16 +730,16 @@ component in one of two ways: + You can dynamically determine the type of the component in one of two ways: -- By calling the `GetType` method on the value that is returned by the property. +- By calling the `GetType` method on the value that is returned by the property. -- By retrieving the object that represents the object, and retrieving the first element from the array that is returned by its method. +- By retrieving the object that represents the object, and retrieving the first element from the array that is returned by its method. ## Examples - The following example defines an array of objects whose components contain population data for three U.S. cities (New York, Chicago, and Los Angeles) from 1960 through 2000. It then displays a table that lists the data. To display the population in 2000, it retrieves the value of the property for each object. + The following example defines an array of objects whose components contain population data for three U.S. cities (New York, Chicago, and Los Angeles) from 1960 through 2000. It then displays a table that lists the data. To display the population in 2000, it retrieves the value of the property for each object. :::code language="csharp" source="~/snippets/csharp/System/TupleT1,T2,T3,T4,T5,T6/Item1/item1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TupleT1,T2,T3,T4,T5,T6/Item1/item1.fs" id="Snippet1"::: @@ -821,19 +821,19 @@ instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. - This method lets you define customized comparisons of objects. For example, you can use this method to order objects based on the value of a specific component. + This method lets you define customized comparisons of objects. For example, you can use this method to order objects based on the value of a specific component. - Although this method can be called directly, it is most commonly called by collection-sorting methods that include parameters to order the members of a collection. For example, it is called by the method and the method of a object that is instantiated by using the constructor. + Although this method can be called directly, it is most commonly called by collection-sorting methods that include parameters to order the members of a collection. For example, it is called by the method and the method of a object that is instantiated by using the constructor. > [!CAUTION] -> The method is intended for use in sorting operations. It should not be used when the primary purpose of a comparison is to determine whether two objects are equal. To determine whether two objects are equal, call the method. +> The method is intended for use in sorting operations. It should not be used when the primary purpose of a comparison is to determine whether two objects are equal. To determine whether two objects are equal, call the method. ## Examples - The following example creates an array of objects that contains population data for three U.S. cities from 1960 to 2000. The sextuple's first component is the city name. The remaining five components represent the population at 10-year intervals from 1960 to 2000. + The following example creates an array of objects that contains population data for three U.S. cities from 1960 to 2000. The sextuple's first component is the city name. The remaining five components represent the population at 10-year intervals from 1960 to 2000. The `PopulationComparer` class provides an implementation that allows the array of sextuples to be sorted by any one of its components. Two values are provided to the `PopulationComparer` class in its constructor: The position of the component that defines the sort order, and a value that indicates whether the tuple objects should be sorted in ascending or descending order. @@ -911,14 +911,14 @@ instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. - The implementation is called only if `other` is not `null`, and if it can be successfully cast (in C#) or converted (in Visual Basic) to a object whose components are of the same types as the current instance. The method first passes the values of the objects to be compared to the implementation. If this method call returns `true`, the method is called again and passed the values of the two objects. This continues until the method call returns `false` when it compares a specific pair of `Item` values, or the two values are passed to the method. + The implementation is called only if `other` is not `null`, and if it can be successfully cast (in C#) or converted (in Visual Basic) to a object whose components are of the same types as the current instance. The method first passes the values of the objects to be compared to the implementation. If this method call returns `true`, the method is called again and passed the values of the two objects. This continues until the method call returns `false` when it compares a specific pair of `Item` values, or the two values are passed to the method. ## Examples - The following example defines a `RateComparer` class that performs a custom test for equality. If the values that are passed to its method are of type or , the method tests for equality by using only up to three fractional digits. Otherwise, it simply calls the `x` parameter's `Equals` method. The example uses this implementation to determine whether four objects that contain data on the rate of population change between 1960 and 2000 are equal. + The following example defines a `RateComparer` class that performs a custom test for equality. If the values that are passed to its method are of type or , the method tests for equality by using only up to three fractional digits. Otherwise, it simply calls the `x` parameter's `Equals` method. The example uses this implementation to determine whether four objects that contain data on the rate of population change between 1960 and 2000 are equal. :::code language="csharp" source="~/snippets/csharp/System/TupleT1,T2,T3,T4,T5,T6/Equals/equals2.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/TupleT1,T2,T3,T4,T5,T6/Equals/equals2.fs" id="Snippet2"::: @@ -980,11 +980,11 @@ instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. - The method simply wraps a call to the `comparer` object's implementation. + The method simply wraps a call to the `comparer` object's implementation. - The algorithm used to compute the hash code should return the same hash code for two objects that are considered to be equal. + The algorithm used to compute the hash code should return the same hash code for two objects that are considered to be equal. ]]> @@ -1060,19 +1060,19 @@ instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. - This method provides the implementation for the class. Although the method can be called directly, it is most commonly called by the default overloads of collection-sorting methods, such as and , to order the members of a collection. + This method provides the implementation for the class. Although the method can be called directly, it is most commonly called by the default overloads of collection-sorting methods, such as and , to order the members of a collection. > [!CAUTION] -> The method is intended for use in sorting operations. It should not be used when the primary purpose of a comparison is to determine whether two objects are equal. To determine whether two objects are equal, call the method. +> The method is intended for use in sorting operations. It should not be used when the primary purpose of a comparison is to determine whether two objects are equal. To determine whether two objects are equal, call the method. - The method uses the default object comparer to compare each component. + The method uses the default object comparer to compare each component. ## Examples - The following example creates an array of objects that contain population data for three cities in the United States from 1960 to 2000. The six components consist of the city name followed by the city's population at 10-year intervals from 1960 to 2000. The example displays the components of each tuple in the array in unsorted order, sorts the array, and then calls the method to display each tuple in sorted order. The output shows that the array has been sorted by name, which is the first component. Note that the example does not directly call the method. This method is called implicitly by the method for each element in the array. + The following example creates an array of objects that contain population data for three cities in the United States from 1960 to 2000. The six components consist of the city name followed by the city's population at 10-year intervals from 1960 to 2000. The example displays the components of each tuple in the array in unsorted order, sorts the array, and then calls the method to display each tuple in sorted order. The output shows that the array has been sorted by name, which is the first component. Note that the example does not directly call the method. This method is called implicitly by the method for each element in the array. :::code language="csharp" source="~/snippets/csharp/System/TupleT1,T2,T3,T4,T5,T6/System.Collections.IStructuralComparable.CompareTo/compareto1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TupleT1,T2,T3,T4,T5,T6/System.Collections.IStructuralComparable.CompareTo/compareto1.fs" id="Snippet1"::: @@ -1187,7 +1187,7 @@ property is an explicit interface implementation. To call it, you must cast or convert the object to an interface object. + The property is an explicit interface implementation. To call it, you must cast or convert the object to an interface object. ]]> @@ -1239,12 +1239,12 @@ , , , , , and properties, respectively. If any of the property values is `null`, it is represented as . + The string returned by this method takes the form (*Item1*, *Item2*, *Item3*, *Item4*, `Item5, Item6`), where *Item1*, *Item2*, *Item3*, *Item4*, *Item5*, and *Item6* represent the values of the , , , , , and properties, respectively. If any of the property values is `null`, it is represented as . ## Examples - The following example defines a object that contains population data for New York City for each census from 1960 through 2000. The components of the sextuple are then displayed by a call to the method. + The following example defines a object that contains population data for New York City for each census from 1960 through 2000. The components of the sextuple are then displayed by a call to the method. :::code language="csharp" source="~/snippets/csharp/System/TupleT1,T2,T3,T4,T5,T6/ToString/tostring1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TupleT1,T2,T3,T4,T5,T6/ToString/tostring1.fs" id="Snippet1"::: diff --git a/xml/System/Tuple`7.xml b/xml/System/Tuple`7.xml index de387598a85..322b84cadfe 100644 --- a/xml/System/Tuple`7.xml +++ b/xml/System/Tuple`7.xml @@ -149,23 +149,23 @@ class represents a 7-tuple, or septuple, which is a tuple that has seven components. + A tuple is a data structure that has a specific number and sequence of values. The class represents a 7-tuple, or septuple, which is a tuple that has seven components. - You can instantiate a object by calling either the or the static method. You can retrieve the value of the tuple's components by using the read-only , , , , , , and instance properties. + You can instantiate a object by calling either the or the static method. You can retrieve the value of the tuple's components by using the read-only , , , , , , and instance properties. Tuples are commonly used in four different ways: - To represent a single set of data. For example, a tuple can represent a database record, and its components can represent individual fields of the record. -- To provide easy access to, and manipulation of, a data set. The following example defines a object that contains population data for New York City for each census from 1950 through 2000. The septuple is passed to the `ComputePopulationChange` method, which calculates the annual rate of change between censuses, as well as the annual rate of change for the entire 60 year period. +- To provide easy access to, and manipulation of, a data set. The following example defines a object that contains population data for New York City for each census from 1950 through 2000. The septuple is passed to the `ComputePopulationChange` method, which calculates the annual rate of change between censuses, as well as the annual rate of change for the entire 60 year period. :::code language="csharp" source="~/snippets/csharp/System/TupleT1,T2,T3,T4,T5,T6,T7/Overview/example1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TupleT1,T2,T3,T4,T5,T6,T7/Overview/example1.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/TupleT1,T2,T3,T4,T5,T6,T7/Overview/example1.vb" id="Snippet1"::: -- To return multiple values from a method without the use of `out` parameters (in C#) or `ByRef` parameters (in Visual Basic). For example, the previous example returns its computed statistics, along with the city name, in a object. +- To return multiple values from a method without the use of `out` parameters (in C#) or `ByRef` parameters (in Visual Basic). For example, the previous example returns its computed statistics, along with the city name, in a object. -- To pass multiple values to a method through a single parameter. For example, the method has a single parameter that lets you supply one value to the method that the thread executes at startup. If you supply a object as the method argument, you can supply the thread's startup routine with seven items of data. +- To pass multiple values to a method through a single parameter. For example, the method has a single parameter that lets you supply one value to the method that the thread executes at startup. If you supply a object as the method argument, you can supply the thread's startup routine with seven items of data. ]]> @@ -236,13 +236,13 @@ method to instantiate a 7-tuple object without having to explicitly specify the types of its components. The following example uses the method to instantiate a 7-tuple whose first component is of type and whose remaining components are of type . + You can use the static method to instantiate a 7-tuple object without having to explicitly specify the types of its components. The following example uses the method to instantiate a 7-tuple whose first component is of type and whose remaining components are of type . :::code language="csharp" source="~/snippets/csharp/System/Tuple/Overview/create1.cs" id="Snippet13"::: :::code language="fsharp" source="~/snippets/fsharp/System/Tuple/Overview/create1.fs" id="Snippet13"::: :::code language="vb" source="~/snippets/visualbasic/System/Tuple/Overview/create1.vb" id="Snippet13"::: - This is equivalent to the following call to the class constructor. + This is equivalent to the following call to the class constructor. :::code language="csharp" source="~/snippets/csharp/System/Tuple/Overview/create1.cs" id="Snippet14"::: :::code language="fsharp" source="~/snippets/fsharp/System/Tuple/Overview/create1.fs" id="Snippet14"::: @@ -312,7 +312,7 @@ ## Remarks The `obj` parameter is considered to be equal to the current instance under the following conditions: -- It is a object. +- It is a object. - Its seven components are of the same types as the current instance. @@ -421,16 +421,16 @@ component in one of two ways: + You can dynamically determine the type of the component in one of two ways: -- By calling the `GetType` method on the value that is returned by the property. +- By calling the `GetType` method on the value that is returned by the property. -- By retrieving the object that represents the object, and retrieving the first element from the array that is returned by its method. +- By retrieving the object that represents the object, and retrieving the first element from the array that is returned by its method. ## Examples - The following example defines an array of objects whose components contain population data for three U.S. cities (New York, Chicago, and Los Angeles) from 1950 through 2000. It then displays a table that lists the data. To display the city name, it retrieves the value of the property for each object. + The following example defines an array of objects whose components contain population data for three U.S. cities (New York, Chicago, and Los Angeles) from 1950 through 2000. It then displays a table that lists the data. To display the city name, it retrieves the value of the property for each object. :::code language="csharp" source="~/snippets/csharp/System/TupleT1,T2,T3,T4,T5,T6,T7/Item1/item1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TupleT1,T2,T3,T4,T5,T6,T7/Item1/item1.fs" id="Snippet1"::: @@ -485,16 +485,16 @@ component in one of two ways: + You can dynamically determine the type of the component in one of two ways: -- By calling the `GetType` method on the value that is returned by the property. +- By calling the `GetType` method on the value that is returned by the property. -- By retrieving the object that represents the object, and retrieving the second element from the array that is returned by its method. +- By retrieving the object that represents the object, and retrieving the second element from the array that is returned by its method. ## Examples - The following example defines an array of objects whose components contain population data for three U.S. cities (New York, Chicago, and Los Angeles) from 1950 through 2000. It then displays a table that lists the data. To display the population in 1950, it retrieves the value of the property for each object. + The following example defines an array of objects whose components contain population data for three U.S. cities (New York, Chicago, and Los Angeles) from 1950 through 2000. It then displays a table that lists the data. To display the population in 1950, it retrieves the value of the property for each object. :::code language="csharp" source="~/snippets/csharp/System/TupleT1,T2,T3,T4,T5,T6,T7/Item1/item1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TupleT1,T2,T3,T4,T5,T6,T7/Item1/item1.fs" id="Snippet1"::: @@ -549,16 +549,16 @@ component in one of two ways: + You can dynamically determine the type of the component in one of two ways: -- By calling the `GetType` method on the value that is returned by the property. +- By calling the `GetType` method on the value that is returned by the property. -- By retrieving the object that represents the object, and retrieving the third element from the array that is returned by its method. +- By retrieving the object that represents the object, and retrieving the third element from the array that is returned by its method. ## Examples - The following example defines an array of objects whose components contain population data for three U.S. cities (New York, Chicago, and Los Angeles) from 1950 through 2000. It then displays a table that lists the data. To display the population in 1960, it retrieves the value of the property for each object. + The following example defines an array of objects whose components contain population data for three U.S. cities (New York, Chicago, and Los Angeles) from 1950 through 2000. It then displays a table that lists the data. To display the population in 1960, it retrieves the value of the property for each object. :::code language="csharp" source="~/snippets/csharp/System/TupleT1,T2,T3,T4,T5,T6,T7/Item1/item1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TupleT1,T2,T3,T4,T5,T6,T7/Item1/item1.fs" id="Snippet1"::: @@ -613,16 +613,16 @@ component in one of two ways: + You can dynamically determine the type of the component in one of two ways: -- By calling the `GetType` method on the value that is returned by the property. +- By calling the `GetType` method on the value that is returned by the property. -- By retrieving the object that represents the object, and retrieving the fourth element from the array that is returned by its method. +- By retrieving the object that represents the object, and retrieving the fourth element from the array that is returned by its method. ## Examples - The following example defines an array of objects whose components contain population data for three U.S. cities (New York, Chicago, and Los Angeles) from 1950 through 2000. It then displays a table that lists the data. To display the population in 1970, it retrieves the value of the property for each object. + The following example defines an array of objects whose components contain population data for three U.S. cities (New York, Chicago, and Los Angeles) from 1950 through 2000. It then displays a table that lists the data. To display the population in 1970, it retrieves the value of the property for each object. :::code language="csharp" source="~/snippets/csharp/System/TupleT1,T2,T3,T4,T5,T6,T7/Item1/item1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TupleT1,T2,T3,T4,T5,T6,T7/Item1/item1.fs" id="Snippet1"::: @@ -677,16 +677,16 @@ component in one of two ways: + You can dynamically determine the type of the component in one of two ways: -- By calling the `GetType` method on the value that is returned by the property. +- By calling the `GetType` method on the value that is returned by the property. -- By retrieving the object that represents the object, and retrieving the fifth element from the array that is returned by its method. +- By retrieving the object that represents the object, and retrieving the fifth element from the array that is returned by its method. ## Examples - The following example defines an array of objects whose components contain population data for three U.S. cities (New York, Chicago, and Los Angeles) from 1950 through 2000. It then displays a table that lists the data. To display the population in 1980, it retrieves the value of the property for each object. + The following example defines an array of objects whose components contain population data for three U.S. cities (New York, Chicago, and Los Angeles) from 1950 through 2000. It then displays a table that lists the data. To display the population in 1980, it retrieves the value of the property for each object. :::code language="csharp" source="~/snippets/csharp/System/TupleT1,T2,T3,T4,T5,T6,T7/Item1/item1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TupleT1,T2,T3,T4,T5,T6,T7/Item1/item1.fs" id="Snippet1"::: @@ -741,16 +741,16 @@ component in one of two ways: + You can dynamically determine the type of the component in one of two ways: -- By calling the `GetType` method on the value that is returned by the property. +- By calling the `GetType` method on the value that is returned by the property. -- By retrieving the object that represents the object, and retrieving the sixth element from the array that is returned by its method. +- By retrieving the object that represents the object, and retrieving the sixth element from the array that is returned by its method. ## Examples - The following example defines an array of objects whose components contain population data for three U.S. cities (New York, Chicago, and Los Angeles) from 1950 through 2000. It then displays a table that lists the data. To display the population in 1990, it retrieves the value of the property for each object. + The following example defines an array of objects whose components contain population data for three U.S. cities (New York, Chicago, and Los Angeles) from 1950 through 2000. It then displays a table that lists the data. To display the population in 1990, it retrieves the value of the property for each object. :::code language="csharp" source="~/snippets/csharp/System/TupleT1,T2,T3,T4,T5,T6,T7/Item1/item1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TupleT1,T2,T3,T4,T5,T6,T7/Item1/item1.fs" id="Snippet1"::: @@ -805,16 +805,16 @@ component in one of two ways: + You can dynamically determine the type of the component in one of two ways: -- By calling the `GetType` method on the value that is returned by the property. +- By calling the `GetType` method on the value that is returned by the property. -- By retrieving the object that represents the object, and retrieving the seventh element from the array that is returned by its method. +- By retrieving the object that represents the object, and retrieving the seventh element from the array that is returned by its method. ## Examples - The following example defines an array of objects whose components contain population data for three U.S. cities (New York, Chicago, and Los Angeles) from 1950 through 2000. It then displays a table that lists the data. To display the population in 2000, it retrieves the value of the property for each object. + The following example defines an array of objects whose components contain population data for three U.S. cities (New York, Chicago, and Los Angeles) from 1950 through 2000. It then displays a table that lists the data. To display the population in 2000, it retrieves the value of the property for each object. :::code language="csharp" source="~/snippets/csharp/System/TupleT1,T2,T3,T4,T5,T6,T7/Item1/item1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TupleT1,T2,T3,T4,T5,T6,T7/Item1/item1.fs" id="Snippet1"::: @@ -896,19 +896,19 @@ instance is cast to an interface. + This member is an explicit interface implementation. It can be used only when the instance is cast to an interface. - This method lets you define customized comparisons of objects. For example, you can use this method to order objects based on the value of a specific component. + This method lets you define customized comparisons of objects. For example, you can use this method to order objects based on the value of a specific component. - Although this method can be called directly, it is most commonly called by collection-sorting methods that include parameters to order the members of a collection. For example, it is called by the method and the method of a object that is instantiated by using the constructor. + Although this method can be called directly, it is most commonly called by collection-sorting methods that include parameters to order the members of a collection. For example, it is called by the method and the method of a object that is instantiated by using the constructor. > [!CAUTION] -> The method is intended for use in sorting operations. It should not be used when the primary purpose of a comparison is to determine whether two objects are equal. To determine whether two objects are equal, call the method. +> The method is intended for use in sorting operations. It should not be used when the primary purpose of a comparison is to determine whether two objects are equal. To determine whether two objects are equal, call the method. ## Examples - The following example creates an array of objects that contains population data for three U.S. cities from 1950 to 2000. The septuple's first component is the city name. The remaining five components represent the population at 10-year intervals from 1950 to 2000. + The following example creates an array of objects that contains population data for three U.S. cities from 1950 to 2000. The septuple's first component is the city name. The remaining five components represent the population at 10-year intervals from 1950 to 2000. The `PopulationComparer` class provides an implementation that allows the array of septuples to be sorted by any one of its components. Two values are provided to the `PopulationComparer` class in its constructor: The position of the component that defines the sort order, and a value that indicates whether the tuple objects should be sorted in ascending or descending order. @@ -987,14 +987,14 @@ instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. - The implementation is called only if other is not `null`, and if it can be successfully cast (in C#) or converted (in Visual Basic) to a object whose components are of the same types as the current instance. The method first passes the values of the objects to be compared to the implementation. If this method call returns `true`, the method is called again and passed the values of the two objects. This continues until the method call returns `false` when it compares a specific pair of `Item` values, or the two values are passed to the method. + The implementation is called only if other is not `null`, and if it can be successfully cast (in C#) or converted (in Visual Basic) to a object whose components are of the same types as the current instance. The method first passes the values of the objects to be compared to the implementation. If this method call returns `true`, the method is called again and passed the values of the two objects. This continues until the method call returns `false` when it compares a specific pair of `Item` values, or the two values are passed to the method. ## Examples - The following example defines a `RateComparer` class that performs a custom test for equality. If the values that are passed to its method are of type or , the method tests for equality by using only up to three fractional digits. Otherwise, it simply calls the `x` parameter's `Equals` method. The example uses this implementation to determine whether four objects that contain data on the rate of population change between 1950 and 2000 are equal. + The following example defines a `RateComparer` class that performs a custom test for equality. If the values that are passed to its method are of type or , the method tests for equality by using only up to three fractional digits. Otherwise, it simply calls the `x` parameter's `Equals` method. The example uses this implementation to determine whether four objects that contain data on the rate of population change between 1950 and 2000 are equal. :::code language="csharp" source="~/snippets/csharp/System/TupleT1,T2,T3,T4,T5,T6,T7/Equals/equals2.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/TupleT1,T2,T3,T4,T5,T6,T7/Equals/equals2.fs" id="Snippet2"::: @@ -1056,11 +1056,11 @@ instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. - the method simply wraps a call to the comparer object's implementation. + the method simply wraps a call to the comparer object's implementation. - The algorithm used to compute the hash code should return the same hash code for two objects that are considered to be equal. + The algorithm used to compute the hash code should return the same hash code for two objects that are considered to be equal. ]]> @@ -1136,19 +1136,19 @@ instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. - This method provides the implementation for the class. Although the method can be called directly, it is most commonly called by the default overloads of collection-sorting methods, such as and , to order the members of a collection. + This method provides the implementation for the class. Although the method can be called directly, it is most commonly called by the default overloads of collection-sorting methods, such as and , to order the members of a collection. > [!CAUTION] -> The method is intended for use in sorting operations. It should not be used when the primary purpose of a comparison is to determine whether two objects are equal. To determine whether two objects are equal, call the method. +> The method is intended for use in sorting operations. It should not be used when the primary purpose of a comparison is to determine whether two objects are equal. To determine whether two objects are equal, call the method. This method uses the default object comparer to compare each component. ## Examples - The following example creates an array of objects that contain population data for three cities in the United States from 1950 to 2000. The seven components consist of the city name followed by the city's population at 10-year intervals from 1950 to 2000. The example displays the components of each tuple in the array in unsorted order, sorts the array, and then calls the method to display each tuple in sorted order. The output shows that the array has been sorted by name, which is the first component. Note that the example does not directly call the method. This method is called implicitly by the method for each element in the array. + The following example creates an array of objects that contain population data for three cities in the United States from 1950 to 2000. The seven components consist of the city name followed by the city's population at 10-year intervals from 1950 to 2000. The example displays the components of each tuple in the array in unsorted order, sorts the array, and then calls the method to display each tuple in sorted order. The output shows that the array has been sorted by name, which is the first component. Note that the example does not directly call the method. This method is called implicitly by the method for each element in the array. :::code language="csharp" source="~/snippets/csharp/System/TupleT1,T2,T3,T4,T5,T6,T7/System.Collections.IStructuralComparable.CompareTo/compareto1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TupleT1,T2,T3,T4,T5,T6,T7/System.Collections.IStructuralComparable.CompareTo/compareto1.fs" id="Snippet1"::: @@ -1263,7 +1263,7 @@ property is an explicit interface implementation. To call it, you must cast or convert the object to an interface object. + The property is an explicit interface implementation. To call it, you must cast or convert the object to an interface object. ]]> @@ -1315,12 +1315,12 @@ , , , , , , and properties, respectively. If any of the property values is `null`, it is represented as . + The string returned by this method takes the form (*Item1*, *Item2*, *Item3*, *Item4*, `Item5, Item6, Item7`), where *Item1*, *Item2*, *Item3*, *Item4*, *Item5*, *Item6*, and *Item7* represent the values of the , , , , , , and properties, respectively. If any of the property values is `null`, it is represented as . ## Examples - The following example defines a object that contains population data for New York City for each census from 1950 through 2000. The components of the sextuple are then displayed by a call to the method. + The following example defines a object that contains population data for New York City for each census from 1950 through 2000. The components of the sextuple are then displayed by a call to the method. :::code language="csharp" source="~/snippets/csharp/System/TupleT1,T2,T3,T4,T5,T6,T7/ToString/tostring1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TupleT1,T2,T3,T4,T5,T6,T7/ToString/tostring1.fs" id="Snippet1"::: diff --git a/xml/System/Tuple`8.xml b/xml/System/Tuple`8.xml index 4910b285fd2..d6df7a303e0 100644 --- a/xml/System/Tuple`8.xml +++ b/xml/System/Tuple`8.xml @@ -151,32 +151,32 @@ class represents an *n*-tuple that has eight or more components. + A tuple is a data structure that has a specific number and sequence of values. The class represents an *n*-tuple that has eight or more components. - You can instantiate a object with exactly eight components by calling the static method. The following example creates an 8-tuple (octuple) that contains prime numbers that are less than 20. Note that it uses type inference to determine the type of each component. + You can instantiate a object with exactly eight components by calling the static method. The following example creates an 8-tuple (octuple) that contains prime numbers that are less than 20. Note that it uses type inference to determine the type of each component. :::code language="csharp" source="~/snippets/csharp/System/Tuple/Overview/createntuple.cs" id="Snippet17"::: :::code language="fsharp" source="~/snippets/fsharp/System/Tuple/Overview/createntuple.fs" id="Snippet17"::: :::code language="vb" source="~/snippets/visualbasic/System/Tuple/Overview/createntuple.vb" id="Snippet17"::: - You can also instantiate an n-tuple object with eight or more components by calling the constructor. The following example uses the constructor to create an 8-tuple that is equivalent to the tuple created in the previous example. + You can also instantiate an n-tuple object with eight or more components by calling the constructor. The following example uses the constructor to create an 8-tuple that is equivalent to the tuple created in the previous example. :::code language="csharp" source="~/snippets/csharp/System/TupleT1,T2,T3,T4,T5,T6,T7,TRest/Overview/octuple1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TupleT1,T2,T3,T4,T5,T6,T7,TRest/Overview/octuple1.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/TupleT1,T2,T3,T4,T5,T6,T7,TRest/Overview/octuple1.vb" id="Snippet1"::: > [!NOTE] -> To create an n-tuple with nine or more components, you must call the constructor. The static factory methods of the class do not support the creation of `Tuple` objects with more than eight components. +> To create an n-tuple with nine or more components, you must call the constructor. The static factory methods of the class do not support the creation of `Tuple` objects with more than eight components. - To instantiate an n-tuple that has eight or more components with the constructor, you supply a generic `Tuple` object as the `rest` parameter to define the eighth through *n*th components of the tuple. By nesting generic `Tuple` objects in this way, you can create a tuple that has no practical limitation on the number of its components. + To instantiate an n-tuple that has eight or more components with the constructor, you supply a generic `Tuple` object as the `rest` parameter to define the eighth through *n*th components of the tuple. By nesting generic `Tuple` objects in this way, you can create a tuple that has no practical limitation on the number of its components. - The following example creates a 17-tuple that contains population data for the city of Detroit, Michigan, for each national census from 1860 to 2000. The first component of the tuple is the city name. The second component is the start date of the data series, and the third component is the population at the start date. Each subsequent component provides the population at decade intervals. The 17-tuple is created by nesting a object inside a object. (That is, the object is supplied as the value of the `rest` parameter in the class constructor.) This object is, in turn, nested in an outer object. (That is, the object is supplied as the value of the `rest` parameter in the outer object's class constructor.) + The following example creates a 17-tuple that contains population data for the city of Detroit, Michigan, for each national census from 1860 to 2000. The first component of the tuple is the city name. The second component is the start date of the data series, and the third component is the population at the start date. Each subsequent component provides the population at decade intervals. The 17-tuple is created by nesting a object inside a object. (That is, the object is supplied as the value of the `rest` parameter in the class constructor.) This object is, in turn, nested in an outer object. (That is, the object is supplied as the value of the `rest` parameter in the outer object's class constructor.) :::code language="csharp" source="~/snippets/csharp/System/Tuple/Overview/example.cs" id="Snippet19"::: :::code language="fsharp" source="~/snippets/fsharp/System/Tuple/Overview/example.fs" id="Snippet19"::: :::code language="vb" source="~/snippets/visualbasic/System/Tuple/Overview/example.vb" id="Snippet19"::: - You can retrieve the value of the tuple's first seven components by using the read-only , , , , , , and instance properties. Any additional components are nested and can be retrieved from the property. In the previous example, the through properties retrieve the first through seventh components of the tuple. The eighth through fourteenth components are contained in the tuple that is nested at the second level, and are represented by the `Rest.Item1` through `Rest.Item7` properties. The fifteenth through seventeenth components are contained in the tuple that is nested at the third level, and are represented by the `Rest.Rest.Item1` though `Rest.Rest.Item3` properties. + You can retrieve the value of the tuple's first seven components by using the read-only , , , , , , and instance properties. Any additional components are nested and can be retrieved from the property. In the previous example, the through properties retrieve the first through seventh components of the tuple. The eighth through fourteenth components are contained in the tuple that is nested at the second level, and are represented by the `Rest.Item1` through `Rest.Item7` properties. The fifteenth through seventeenth components are contained in the tuple that is nested at the third level, and are represented by the `Rest.Rest.Item1` though `Rest.Rest.Item3` properties. Tuples are commonly used in four different ways: @@ -184,9 +184,9 @@ - To provide easy access to, and manipulation of, a data set. -- To return multiple values from a method without the use of `out` parameters (in C#) or `ByRef` parameters (in Visual Basic). For example, the previous example returns its computed statistics, along with the city name, in a object. +- To return multiple values from a method without the use of `out` parameters (in C#) or `ByRef` parameters (in Visual Basic). For example, the previous example returns its computed statistics, along with the city name, in a object. -- To pass multiple values to a method through a single parameter. For example, the method has a single parameter that lets you supply one value to the method that the thread executes at startup. If you supply a object as the method argument, you can supply the thread's startup routine with seven items of data. +- To pass multiple values to a method through a single parameter. For example, the method has a single parameter that lets you supply one value to the method that the thread executes at startup. If you supply a object as the method argument, you can supply the thread's startup routine with seven items of data. ]]> @@ -259,29 +259,29 @@ method to instantiate an 8-tuple (octuple) object without having to explicitly specify the types of its components. The following example uses the method to instantiate an 8-tuple object that contains prime numbers that are less than 20. + You can also use the static method to instantiate an 8-tuple (octuple) object without having to explicitly specify the types of its components. The following example uses the method to instantiate an 8-tuple object that contains prime numbers that are less than 20. :::code language="csharp" source="~/snippets/csharp/System/Tuple/Overview/createntuple.cs" id="Snippet17"::: :::code language="fsharp" source="~/snippets/fsharp/System/Tuple/Overview/createntuple.fs" id="Snippet17"::: :::code language="vb" source="~/snippets/visualbasic/System/Tuple/Overview/createntuple.vb" id="Snippet17"::: - This is equivalent to the following call to the class constructor. + This is equivalent to the following call to the class constructor. :::code language="csharp" source="~/snippets/csharp/System/TupleT1,T2,T3,T4,T5,T6,T7,TRest/Overview/octuple1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TupleT1,T2,T3,T4,T5,T6,T7,TRest/Overview/octuple1.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/TupleT1,T2,T3,T4,T5,T6,T7,TRest/Overview/octuple1.vb" id="Snippet1"::: - However, the static method cannot be used to create a tuple object with more than eight components. + However, the static method cannot be used to create a tuple object with more than eight components. - When using the constructor to create an n-tuple with eight or more components, you use the `rest` parameter to create a nested n-tuple that has from one to seven components. By using successive levels of nesting, you can create an n-tuple that has a virtually unlimited number of components. For example, to create a 25-tuple, you instantiate a object with three levels of nesting, as follows: + When using the constructor to create an n-tuple with eight or more components, you use the `rest` parameter to create a nested n-tuple that has from one to seven components. By using successive levels of nesting, you can create an n-tuple that has a virtually unlimited number of components. For example, to create a 25-tuple, you instantiate a object with three levels of nesting, as follows: -- The outermost object contains the first through seventh components. Its property provides access to an object at the first level of nesting. +- The outermost object contains the first through seventh components. Its property provides access to an object at the first level of nesting. -- The outermost nested object contains the eighth through fourteenth components, and its property provides access to an object at the second level of nesting. +- The outermost nested object contains the eighth through fourteenth components, and its property provides access to an object at the second level of nesting. -- The object at the second level of nesting contains the fifteenth through twenty-first components, and its property provides access to an object at the third level of nesting. +- The object at the second level of nesting contains the fifteenth through twenty-first components, and its property provides access to an object at the third level of nesting. -- The innermost tuple is a object that contains the twenty-second through twenty-fifth components. +- The innermost tuple is a object that contains the twenty-second through twenty-fifth components. @@ -359,7 +359,7 @@ ## Remarks The `obj` parameter is considered to be equal to the current instance if it meets all the following conditions: -- It is a object. +- It is a object. - It has the same total number of components that are of the same types as the current instance. @@ -368,7 +368,7 @@ ## Examples - The following example defines five objects that contain prime numbers. It then compares the first object with each of the remaining objects. As the output shows, only the first and the last objects are equal, because they have an identical number of components with identical values. + The following example defines five objects that contain prime numbers. It then compares the first object with each of the remaining objects. As the output shows, only the first and the last objects are equal, because they have an identical number of components with identical values. :::code language="csharp" source="~/snippets/csharp/System/TupleT1,T2,T3,T4,T5,T6,T7,TRest/Equals/equals1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TupleT1,T2,T3,T4,T5,T6,T7,TRest/Equals/equals1.fs" id="Snippet1"::: @@ -468,16 +468,16 @@ component in one of two ways: + You can dynamically determine the type of the component in one of two ways: -- By calling the `GetType` method on the value that is returned by the property. +- By calling the `GetType` method on the value that is returned by the property. -- By retrieving the object that represents the object, and retrieving the first element from the array that is returned by its method. +- By retrieving the object that represents the object, and retrieving the first element from the array that is returned by its method. ## Examples - The following example creates a 17-tuple object that contains population data for the city of Detroit, Michigan, from 1860 to 2000. The first component of the 17-tuple is the city name. The example uses the property to display the city name in the table header before displaying the population data. + The following example creates a 17-tuple object that contains population data for the city of Detroit, Michigan, from 1860 to 2000. The first component of the 17-tuple is the city name. The example uses the property to display the city name in the table header before displaying the population data. :::code language="csharp" source="~/snippets/csharp/System/TupleT1,T2,T3,T4,T5,T6,T7,TRest/Item1/item1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TupleT1,T2,T3,T4,T5,T6,T7,TRest/Item1/item1.fs" id="Snippet1"::: @@ -532,16 +532,16 @@ component in one of two ways: + You can dynamically determine the type of the component in one of two ways: -- By calling the `GetType` method on the value that is returned by the property. +- By calling the `GetType` method on the value that is returned by the property. -- By retrieving the object that represents the object, and retrieving the second element from the array that is returned by its method. +- By retrieving the object that represents the object, and retrieving the second element from the array that is returned by its method. ## Examples - The following example creates a 17-tuple object that contains population data for the city of Detroit, Michigan, from 1860 to 2000. The second component of the 17-tuple is the first year of the data series. The example assigns the value of the property to a variable, and then uses that variable to represent the year whose data is displayed. + The following example creates a 17-tuple object that contains population data for the city of Detroit, Michigan, from 1860 to 2000. The second component of the 17-tuple is the first year of the data series. The example assigns the value of the property to a variable, and then uses that variable to represent the year whose data is displayed. :::code language="csharp" source="~/snippets/csharp/System/TupleT1,T2,T3,T4,T5,T6,T7,TRest/Item1/item1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TupleT1,T2,T3,T4,T5,T6,T7,TRest/Item1/item1.fs" id="Snippet1"::: @@ -596,16 +596,16 @@ component in one of two ways: + You can dynamically determine the type of the component in one of two ways: -- By calling the `GetType` method on the value that is returned by the property. +- By calling the `GetType` method on the value that is returned by the property. -- By retrieving the object that represents the object, and retrieving the third element from the array that is returned by its method. +- By retrieving the object that represents the object, and retrieving the third element from the array that is returned by its method. ## Examples - The following example creates a 17-tuple object that contains population data for the city of Detroit, Michigan, from 1860 to 2000. The third component of the 17-tuple is the population in 1860. The example uses the property to display the population value and to calculate the annual rate of population change between 1860 and 1870. + The following example creates a 17-tuple object that contains population data for the city of Detroit, Michigan, from 1860 to 2000. The third component of the 17-tuple is the population in 1860. The example uses the property to display the population value and to calculate the annual rate of population change between 1860 and 1870. :::code language="csharp" source="~/snippets/csharp/System/TupleT1,T2,T3,T4,T5,T6,T7,TRest/Item1/item1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TupleT1,T2,T3,T4,T5,T6,T7,TRest/Item1/item1.fs" id="Snippet1"::: @@ -660,16 +660,16 @@ component in one of two ways: + You can dynamically determine the type of the component in one of two ways: -- By calling the `GetType` method on the value that is returned by the property. +- By calling the `GetType` method on the value that is returned by the property. -- By retrieving the object that represents the object, and retrieving the fourth element from the array that is returned by its method. +- By retrieving the object that represents the object, and retrieving the fourth element from the array that is returned by its method. ## Examples - The following example creates a 17-tuple object that contains population data for the city of Detroit, Michigan, from 1860 to 2000. The fourth component of the 17-tuple is the population in 1870. The example uses the property to display the population value and to calculate the annual rate of population change between 1870 and 1880. + The following example creates a 17-tuple object that contains population data for the city of Detroit, Michigan, from 1860 to 2000. The fourth component of the 17-tuple is the population in 1870. The example uses the property to display the population value and to calculate the annual rate of population change between 1870 and 1880. :::code language="csharp" source="~/snippets/csharp/System/TupleT1,T2,T3,T4,T5,T6,T7,TRest/Item1/item1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TupleT1,T2,T3,T4,T5,T6,T7,TRest/Item1/item1.fs" id="Snippet1"::: @@ -724,16 +724,16 @@ component in one of two ways: + You can dynamically determine the type of the component in one of two ways: -- By calling the `GetType` method on the value that is returned by the property. +- By calling the `GetType` method on the value that is returned by the property. -- By retrieving the object that represents the object, and retrieving the fifth element from the array that is returned by its method. +- By retrieving the object that represents the object, and retrieving the fifth element from the array that is returned by its method. ## Examples - The following example creates a 17-tuple object that contains population data for the city of Detroit, Michigan, from 1860 to 2000. The fifth component of the 17-tuple is the population in 1880. The example uses the property to display the population value and to calculate the annual rate of population change between 1880 and 1890. + The following example creates a 17-tuple object that contains population data for the city of Detroit, Michigan, from 1860 to 2000. The fifth component of the 17-tuple is the population in 1880. The example uses the property to display the population value and to calculate the annual rate of population change between 1880 and 1890. :::code language="csharp" source="~/snippets/csharp/System/TupleT1,T2,T3,T4,T5,T6,T7,TRest/Item1/item1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TupleT1,T2,T3,T4,T5,T6,T7,TRest/Item1/item1.fs" id="Snippet1"::: @@ -788,16 +788,16 @@ component in one of two ways: + You can dynamically determine the type of the component in one of two ways: -- By calling the `GetType` method on the value that is returned by the property. +- By calling the `GetType` method on the value that is returned by the property. -- By retrieving the object that represents the object, and retrieving the sixth element from the array that is returned by its method. +- By retrieving the object that represents the object, and retrieving the sixth element from the array that is returned by its method. ## Examples - The following example creates a 17-tuple object that contains population data for the city of Detroit, Michigan, from 1860 to 2000. The sixth component of the 17-tuple is the population in 1890. The example uses the property to display the population value and to calculate the annual rate of population change between 1890 and 1900. + The following example creates a 17-tuple object that contains population data for the city of Detroit, Michigan, from 1860 to 2000. The sixth component of the 17-tuple is the population in 1890. The example uses the property to display the population value and to calculate the annual rate of population change between 1890 and 1900. :::code language="csharp" source="~/snippets/csharp/System/TupleT1,T2,T3,T4,T5,T6,T7,TRest/Item1/item1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TupleT1,T2,T3,T4,T5,T6,T7,TRest/Item1/item1.fs" id="Snippet1"::: @@ -852,16 +852,16 @@ component in one of two ways: + You can dynamically determine the type of the component in one of two ways: -- By calling the `GetType` method on the value that is returned by the property. +- By calling the `GetType` method on the value that is returned by the property. -- By retrieving the object that represents the object, and retrieving the seventh element from the array that is returned by its method. +- By retrieving the object that represents the object, and retrieving the seventh element from the array that is returned by its method. ## Examples - The following example creates a 17-tuple object that contains population data for the city of Detroit, Michigan, from 1860 to 2000. The seventh component of the 17-tuple is the population in 1900. The example uses the property to display the population value and to calculate the annual rate of population change between 1900 and 1910. + The following example creates a 17-tuple object that contains population data for the city of Detroit, Michigan, from 1860 to 2000. The seventh component of the 17-tuple is the population in 1900. The example uses the property to display the population value and to calculate the annual rate of population change between 1900 and 1910. :::code language="csharp" source="~/snippets/csharp/System/TupleT1,T2,T3,T4,T5,T6,T7,TRest/Item1/item1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TupleT1,T2,T3,T4,T5,T6,T7,TRest/Item1/item1.fs" id="Snippet1"::: @@ -916,16 +916,16 @@ property returns a nested `Tuple` object that allows access to the eighth though *n*th components of the tuple. Depending on the total number of components in the tuple, the values of the eighth through fourteenth components can be retrieved from the nested `Tuple` object's through properties. You can then use the property of a nested object to retrieve the `Tuple` object at the next level of nesting. + The property returns a nested `Tuple` object that allows access to the eighth though *n*th components of the tuple. Depending on the total number of components in the tuple, the values of the eighth through fourteenth components can be retrieved from the nested `Tuple` object's through properties. You can then use the property of a nested object to retrieve the `Tuple` object at the next level of nesting. - You can dynamically determine the number of components in a nested `Tuple` object that is returned by the property by extracting the digit from its type name. The following example provides an illustration. + You can dynamically determine the number of components in a nested `Tuple` object that is returned by the property by extracting the digit from its type name. The following example provides an illustration. :::code language="vb" source="~/snippets/visualbasic/System/TupleT1,T2,T3,T4,T5,T6,T7,TRest/Item1/rest.vb" id="Snippet2"::: ## Examples - The following example creates a 17-tuple object that contains population data for the city of Detroit, Michigan, from 1860 to 2000. The seventh component of the 17-tuple is the population in 1900. The example uses the property to retrieve the values of the eighth through fourteenth components, and it uses the property of the nested object to retrieve the values of the remaining components. + The following example creates a 17-tuple object that contains population data for the city of Detroit, Michigan, from 1860 to 2000. The seventh component of the 17-tuple is the population in 1900. The example uses the property to retrieve the values of the eighth through fourteenth components, and it uses the property of the nested object to retrieve the values of the remaining components. :::code language="csharp" source="~/snippets/csharp/System/TupleT1,T2,T3,T4,T5,T6,T7,TRest/Item1/item1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TupleT1,T2,T3,T4,T5,T6,T7,TRest/Item1/item1.fs" id="Snippet1"::: @@ -1007,19 +1007,19 @@ instance is cast to an interface. + This member is an explicit interface implementation. It can be used only when the instance is cast to an interface. - This method lets you define customized comparisons of objects. For example, you can use this method to order objects based on the value of a specific component. + This method lets you define customized comparisons of objects. For example, you can use this method to order objects based on the value of a specific component. - Although this method can be called directly, it is most commonly called by collection-sorting methods that include parameters to order the members of a collection. For example, it is called by the method and the method of a object that is instantiated by using the constructor. + Although this method can be called directly, it is most commonly called by collection-sorting methods that include parameters to order the members of a collection. For example, it is called by the method and the method of a object that is instantiated by using the constructor. > [!CAUTION] -> The method is intended for use in sorting operations. It should not be used when the primary purpose of a comparison is to determine whether two objects are equal. To determine whether two objects are equal, call the method. +> The method is intended for use in sorting operations. It should not be used when the primary purpose of a comparison is to determine whether two objects are equal. To determine whether two objects are equal, call the method. ## Examples - The following example creates an array of objects that contains population data for four U.S. cities from 1940 to 2000. The octuple's first component is the city name. The remaining six components represent the population at 10-year intervals from 1940 to 2000. + The following example creates an array of objects that contains population data for four U.S. cities from 1940 to 2000. The octuple's first component is the city name. The remaining six components represent the population at 10-year intervals from 1940 to 2000. The `PopulationComparer` class provides an implementation that allows the array of octuples to be sorted by any one of its components. Two values are provided to the `PopulationComparer` class in its constructor: The position of the component that defines the sort order, and a value that indicates whether the tuple objects should be sorted in ascending or descending order. @@ -1097,9 +1097,9 @@ instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. - The implementation is called only if `other` is not `null`, and if it can be successfully cast (in C#) or converted (in Visual Basic) to a object that has the same total number of components (including those in nested `Tuple` objects) of the same types as the current instance. The method first passes the values of the objects to be compared to the implementation. If this method call returns `true`, the method is called again and passed the values of the two objects. This continues until the method call returns `false` when it compares a specific pair of values, or the two values are passed to the method. + The implementation is called only if `other` is not `null`, and if it can be successfully cast (in C#) or converted (in Visual Basic) to a object that has the same total number of components (including those in nested `Tuple` objects) of the same types as the current instance. The method first passes the values of the objects to be compared to the implementation. If this method call returns `true`, the method is called again and passed the values of the two objects. This continues until the method call returns `false` when it compares a specific pair of values, or the two values are passed to the method. ]]> @@ -1157,11 +1157,11 @@ instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. - The method simply wraps a call to the `comparer` object's implementation. + The method simply wraps a call to the `comparer` object's implementation. - The algorithm used to compute the hash code should return the same hash code for two objects that are considered to be equal. + The algorithm used to compute the hash code should return the same hash code for two objects that are considered to be equal. ]]> @@ -1237,19 +1237,19 @@ instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. - This method provides the implementation for the class. Although the method can be called directly, it is most commonly called by the default overloads of collection-sorting methods, such as and , to order the members of a collection. + This method provides the implementation for the class. Although the method can be called directly, it is most commonly called by the default overloads of collection-sorting methods, such as and , to order the members of a collection. > [!CAUTION] -> The method is intended for use in sorting operations. It should not be used when the primary purpose of a comparison is to determine whether two objects are equal. To determine whether two objects are equal, call the method. +> The method is intended for use in sorting operations. It should not be used when the primary purpose of a comparison is to determine whether two objects are equal. To determine whether two objects are equal, call the method. This method uses the default object comparer to compare each component. ## Examples - The following example creates an array of octuples whose components are integers that contain a range of prime numbers. The example displays the elements of the array in unsorted order, sorts the array, and then displays the array in sorted order. The output shows that the array has been sorted by , or the tuple's first component. Note that the example does not directly call the method. This method is called implicitly by the method for each element in the array. + The following example creates an array of octuples whose components are integers that contain a range of prime numbers. The example displays the elements of the array in unsorted order, sorts the array, and then displays the array in sorted order. The output shows that the array has been sorted by , or the tuple's first component. Note that the example does not directly call the method. This method is called implicitly by the method for each element in the array. :::code language="csharp" source="~/snippets/csharp/System/TupleT1,T2,T3,T4,T5,T6,T7,TRest/System.Collections.IStructuralComparable.CompareTo/compareto1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TupleT1,T2,T3,T4,T5,T6,T7,TRest/System.Collections.IStructuralComparable.CompareTo/compareto1.fs" id="Snippet1"::: @@ -1368,7 +1368,7 @@ property is an explicit interface implementation. To call it, you must cast or convert the type to an interface object. + The property is an explicit interface implementation. To call it, you must cast or convert the type to an interface object. ]]> @@ -1420,12 +1420,12 @@ , , , , , , and properties. *Item8* represents the value of the object's `Next.Item1` property. The value of any additional nested components follow *Item8*. If any of the property values is `null`, it is represented as . + The string returned by this method takes the form (*Item1*, *Item2*, *Item3*, *Item4*, `Item5, Item6, Item7`, *Item8*…), where *Item1*, *Item2*, *Item3*, *Item4*, *Item5*, *Item6*, and *Item7* represent the values of the , , , , , , and properties. *Item8* represents the value of the object's `Next.Item1` property. The value of any additional nested components follow *Item8*. If any of the property values is `null`, it is represented as . ## Examples - The following example creates a 17-tuple that contains population data for the city of Detroit, Michigan, from 1860 to 1900. It then uses the method to display the tuple's data. + The following example creates a 17-tuple that contains population data for the city of Detroit, Michigan, from 1860 to 1900. It then uses the method to display the tuple's data. :::code language="csharp" source="~/snippets/csharp/System/TupleT1,T2,T3,T4,T5,T6,T7,TRest/ToString/tostring1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/TupleT1,T2,T3,T4,T5,T6,T7,TRest/ToString/tostring1.fs" id="Snippet1"::: diff --git a/xml/System/Type.xml b/xml/System/Type.xml index 547c5cead7d..155977561bb 100644 --- a/xml/System/Type.xml +++ b/xml/System/Type.xml @@ -94,11 +94,11 @@ For more information about this API, see Supplemental API remarks for Type. . The C# `typeof` operator (`GetType` operator in Visual Basic) is used to get a object representing . From this object, the method is used to get a representing the overload that takes a starting location and a length. +The following example shows a few representative features of . The C# `typeof` operator (`GetType` operator in Visual Basic) is used to get a object representing . From this object, the method is used to get a representing the overload that takes a starting location and a length. To identify the overload signature, the code example creates a temporary array containing two objects representing `int` (`Integer` in Visual Basic). -The code example uses the to invoke the method on the string "Hello, World!", and displays the result. +The code example uses the to invoke the method on the string "Hello, World!", and displays the result. :::code language="csharp" source="~/snippets/csharp/System/Type/Overview/source.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Type/Overview/source.fs" id="Snippet1"::: @@ -324,7 +324,7 @@ The code example uses the to invoke the property. > [!NOTE] -> Processor architecture is part of assembly identity, and can be specified as part of assembly name strings. For example, "ProcessorArchitecture=msil". However, it's not included in the string returned by the property, for compatibility reasons. See . +> Processor architecture is part of assembly identity, and can be specified as part of assembly name strings. For example, "ProcessorArchitecture=msil". However, it's not included in the string returned by the property, for compatibility reasons. See . All compilers that support the common language runtime emit the simple name of a nested class, and reflection constructs a mangled name when queried, in accordance with the following conventions. @@ -350,7 +350,7 @@ TopNamespace.Sub\+Namespace.ContainingClass+NestedClass, MyAssembly, Version=1.3 A "++" becomes "\\+\\+", and a "\\" becomes "\\\\". - This qualified name can be persisted and later used to load the . To search for and load a , use either with the type name only or with the assembly qualified type name. with the type name only will look for the in the caller's assembly and then in the System assembly. with the assembly qualified type name will look for the in any assembly. + This qualified name can be persisted and later used to load the . To search for and load a , use either with the type name only or with the assembly qualified type name. with the type name only will look for the in the caller's assembly and then in the System assembly. with the assembly qualified type name will look for the in any assembly. Type names may include trailing characters that denote additional information about the type, such as whether the type is a reference type, a pointer type or an array type. To retrieve the type name without these trailing characters, use `t.GetElementType().ToString()`, where `t` is the type. @@ -367,7 +367,7 @@ TopNamespace.Sub\+Namespace.ContainingClass+NestedClass, MyAssembly, Version=1.3 :::code language="fsharp" source="~/snippets/fsharp/System/Type/Assembly/type_assembly.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/Type/Assembly/type_assembly.vb" id="Snippet1"::: - The following example compares the strings returned by the method and the , , and `AssemblyQualifiedName` properties. + The following example compares the strings returned by the method and the , , and `AssemblyQualifiedName` properties. :::code language="csharp" source="~/snippets/csharp/System/Type/AssemblyQualifiedName/fullname1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Type/AssemblyQualifiedName/fullname1.fs" id="Snippet1"::: @@ -432,7 +432,7 @@ TopNamespace.Sub\+Namespace.ContainingClass+NestedClass, MyAssembly, Version=1.3 Some members of the enumeration are masks that represent a group of values. Each group includes one member whose underlying value is zero. For example, the underlying value of the member in the group is zero, as is the member in the group. Because of this, you must use the mask before testing for those values. The example provides an illustration. > [!TIP] -> For most purposes, properties like ,, and are easier to use than type attributes. +> For most purposes, properties like ,, and are easier to use than type attributes. If the current represents a constructed generic type, this property returns the attributes of the generic type definition. For example, the attributes returned for `MyGenericClass` (`MyGenericClass(Of Integer)` in Visual Basic) are the attributes of `MyGenericClass` (`MyGenericClass(Of T)` in Visual Basic). @@ -507,7 +507,7 @@ TopNamespace.Sub\+Namespace.ContainingClass+NestedClass, MyAssembly, Version=1.3 ## Remarks The base type is the type from which the current type directly inherits. is the only type that does not have a base type, therefore `null` is returned as the base type of . - Interfaces inherit from zero or more base interfaces; therefore, this property returns `null` if the `Type` object represents an interface. The base interfaces can be determined with or . + Interfaces inherit from zero or more base interfaces; therefore, this property returns `null` if the `Type` object represents an interface. The base interfaces can be determined with or . If the current represents a constructed generic type, the base type reflects the generic arguments. For example, consider the following declarations: @@ -517,7 +517,7 @@ TopNamespace.Sub\+Namespace.ContainingClass+NestedClass, MyAssembly, Version=1.3 For the constructed type `C` (`C(Of Integer)` in Visual Basic), the property returns `B`. - If the current represents a type parameter of a generic type definition, returns the class constraint, that is, the class the type parameter must inherit. If there is no class constraint, returns . + If the current represents a type parameter of a generic type definition, returns the class constraint, that is, the class the type parameter must inherit. If there is no class constraint, returns . This property is read-only. @@ -595,7 +595,7 @@ TopNamespace.Sub\+Namespace.ContainingClass+NestedClass, MyAssembly, Version=1.3 The property searches recursively for type parameters. For example, it returns `true` for an array whose elements are type `A` (`A(Of T)` in Visual Basic), even though the array is not itself generic. Contrast this with the behavior of the property, which returns `false` for arrays. - For a set of example classes and a table showing the values of the property, see . + For a set of example classes and a table showing the values of the property, see . @@ -664,9 +664,9 @@ TopNamespace.Sub\+Namespace.ContainingClass+NestedClass, MyAssembly, Version=1.3 does not return `null`, then `DeclaringMethod.IsGenericMethodDefinition` returns `true`. + The declaring method is a generic method definition. That is, if does not return `null`, then `DeclaringMethod.IsGenericMethodDefinition` returns `true`. - The and properties identify the generic type definition or generic method definition in which the generic type parameter was originally defined: + The and properties identify the generic type definition or generic method definition in which the generic type parameter was originally defined: - If the property returns a , that represents a generic method definition, and the current object represents a type parameter of that generic method definition. @@ -759,13 +759,13 @@ TopNamespace.Sub\+Namespace.ContainingClass+NestedClass, MyAssembly, Version=1.3 ## Remarks If the current object represents a type parameter of a generic type, this property returns the generic type definition. - If the current object represents a type parameter of a generic method, this property returns the type that contains the generic method definition. If the type is generic, the generic type definition is returned. That is, the following code returns the generic type definition of the generic class, which contains the generic method: + If the current object represents a type parameter of a generic method, this property returns the type that contains the generic method definition. If the type is generic, the generic type definition is returned. That is, the following code returns the generic type definition of the generic class, which contains the generic method: :::code language="csharp" source="~/snippets/csharp/System/Type/DeclaringType/remarks.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Type/DeclaringType/remarks.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/Type/DeclaringType/remarks.vb" id="Snippet1"::: - If the current represents a type parameter in the definition of a generic type or generic method, the and properties identify the generic type definition or generic method definition where the generic type parameter was originally defined: + If the current represents a type parameter in the definition of a generic type or generic method, the and properties identify the generic type definition or generic method definition where the generic type parameter was originally defined: - If the property returns a , that represents a generic method definition, and the current object represents a type parameter of that generic method definition. @@ -837,11 +837,11 @@ TopNamespace.Sub\+Namespace.ContainingClass+NestedClass, MyAssembly, Version=1.3 class and pass an instance of that type using the `binder` parameter of one of the overloads. + The default binder provided with the common language runtime is applicable in all but the most specialized circumstances. If you need a binder that follows rules that differ from those of the supplied default binder, define a type derived from the class and pass an instance of that type using the `binder` parameter of one of the overloads. Reflection models the accessibility rules of the common type system. For example, if the caller is in the same assembly, the caller does not need special permissions for internal members. Otherwise, the caller needs . This is consistent with lookup of members that are protected, private, and so on. - The general principle is that should perform only widening conversions, which never lose data. An example of a widening conversion is converting a value that is a 32-bit signed integer to a value that is a 64-bit signed integer. This is distinguished from a narrowing conversion, which may lose data. An example of a narrowing conversion is converting a 64-bit signed integer to a 32-bit signed integer. + The general principle is that should perform only widening conversions, which never lose data. An example of a widening conversion is converting a value that is a 32-bit signed integer to a value that is a 64-bit signed integer. This is distinguished from a narrowing conversion, which may lose data. An example of a narrowing conversion is converting a 64-bit signed integer to a 32-bit signed integer. The following table lists the conversions supported by the default binder. @@ -864,7 +864,7 @@ TopNamespace.Sub\+Namespace.ContainingClass+NestedClass, MyAssembly, Version=1.3 ## Examples - The following example gets the default binder from the `DefaultBinder` property, and invokes a member of MyClass by passing the `DefaultBinder` value as a parameter to . + The following example gets the default binder from the `DefaultBinder` property, and invokes a member of MyClass by passing the `DefaultBinder` value as a parameter to . :::code language="csharp" source="~/snippets/csharp/System/Type/DefaultBinder/type_defaultbinder.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Type/DefaultBinder/type_defaultbinder.fs" id="Snippet1"::: @@ -1044,12 +1044,12 @@ TopNamespace.Sub\+Namespace.ContainingClass+NestedClass, MyAssembly, Version=1.3 . It casts `o` to an object of type and calls the method. + This method overrides . It casts `o` to an object of type and calls the method. ## Examples - The following example uses to compare various object instances with various instances. + The following example uses to compare various object instances with various instances. :::code language="csharp" source="~/snippets/csharp/System/Type/Equals/EqualsEx1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Type/Equals/EqualsEx1.fs" id="Snippet1"::: @@ -1059,7 +1059,7 @@ TopNamespace.Sub\+Namespace.ContainingClass+NestedClass, MyAssembly, Version=1.3 - The comparison of a object that represents an integer with a object that represents an integer return `true` because is derived from . -- The comparison of a object that represents a object (an open generic type) with a `List(Of String)` object (a closed generic type) returns `false`. +- The comparison of a object that represents a object (an open generic type) with a `List(Of String)` object (a closed generic type) returns `false`. ]]> @@ -1185,14 +1185,14 @@ TopNamespace.Sub\+Namespace.ContainingClass+NestedClass, MyAssembly, Version=1.3 method. The method encapsulated by this delegate takes two parameters: the first is a object and the second is an `Object`. The method determines whether the `MemberInfo` object matches the criteria specified by the `Object`. The `Object` may be assigned the value of any one of the fields on the classes , , or . + This field holds a reference to the delegate used by the method. The method encapsulated by this delegate takes two parameters: the first is a object and the second is an `Object`. The method determines whether the `MemberInfo` object matches the criteria specified by the `Object`. The `Object` may be assigned the value of any one of the fields on the classes , , or . For example, the `Object` can be assigned the value of a field from `FieldAttributes` such as Public. In that case, when the `FilterAttribute` delegate is invoked, it will return `true` only if the method represented by the `MemberInfo` object is decorated with the public field attribute in metadata. ## Examples - The following example gets the `FilterAttribute` delegate, passes it as a parameter to the method, and displays the specified members and their attributes. + The following example gets the `FilterAttribute` delegate, passes it as a parameter to the method, and displays the specified members and their attributes. :::code language="csharp" source="~/snippets/csharp/System/Type/FilterAttribute/type_filterattribute.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Type/FilterAttribute/type_filterattribute.fs" id="Snippet1"::: @@ -1246,7 +1246,7 @@ TopNamespace.Sub\+Namespace.ContainingClass+NestedClass, MyAssembly, Version=1.3 method. The method encapsulated by this delegate takes two parameters: the first is a object and the second is an `Object`. The method determines whether the `MemberInfo` object matches the criteria specified by the `Object`. The `Object` is assigned a string value, which may include a trailing "*" wildcard character. Only wildcard end string matching is supported. + This field holds a reference to the delegate used by the method. The method encapsulated by this delegate takes two parameters: the first is a object and the second is an `Object`. The method determines whether the `MemberInfo` object matches the criteria specified by the `Object`. The `Object` is assigned a string value, which may include a trailing "*" wildcard character. Only wildcard end string matching is supported. For example, the `Object` may be assigned the value "Byte*". In that case, when the `FilterName` delegate is invoked, it will return `true` only if the method represented by the `MemberInfo` object has a name that begins with "Byte". @@ -1307,14 +1307,14 @@ TopNamespace.Sub\+Namespace.ContainingClass+NestedClass, MyAssembly, Version=1.3 method. The method encapsulated by this delegate takes two parameters: the first is a object and the second is an `Object`. The method determines whether the `MemberInfo` object matches the criteria specified by the `Object`. The `Object` is assigned a string value, which may include a trailing "*" wildcard character. Only wildcard end string matching is supported. + This field holds a reference to the delegate used by the method. The method encapsulated by this delegate takes two parameters: the first is a object and the second is an `Object`. The method determines whether the `MemberInfo` object matches the criteria specified by the `Object`. The `Object` is assigned a string value, which may include a trailing "*" wildcard character. Only wildcard end string matching is supported. For example, the `Object` may be assigned the value "ByTe*". In that case, when the `FilterName` delegate is invoked, it will return true only if the method represented by the `MemberInfo` object has a name that begins with "byte", ignoring case. ## Examples - The following example gets the `MemberFilter` delegate, passes it as a parameter to the method, and displays the methods and their attributes of the `String` class that begin with the letter "c", disregarding the case. + The following example gets the `MemberFilter` delegate, passes it as a parameter to the method, and displays the methods and their attributes of the `String` class that begin with the letter "c", disregarding the case. :::code language="csharp" source="~/snippets/csharp/System/Type/FilterNameIgnoreCase/type_filternameignorecase.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Type/FilterNameIgnoreCase/type_filternameignorecase.fs" id="Snippet1"::: @@ -1400,10 +1400,10 @@ TopNamespace.Sub\+Namespace.ContainingClass+NestedClass, MyAssembly, Version=1.3 This method searches the base class hierarchy, returning each of the matching interfaces each class implements as well as all the matching interfaces each of those interfaces implements (that is, the transitive closure of the matching interfaces is returned). No duplicate interfaces are returned. - If the current represents a type parameter in the definition of a generic type or generic method, searches all the interfaces declared in the constraints on the type parameter, and all interfaces inherited through the interfaces declared in the constraints. If the current represents a type argument of a generic type, searches all the interfaces implemented by the type, whether or not they match constraints. + If the current represents a type parameter in the definition of a generic type or generic method, searches all the interfaces declared in the constraints on the type parameter, and all interfaces inherited through the interfaces declared in the constraints. If the current represents a type argument of a generic type, searches all the interfaces implemented by the type, whether or not they match constraints. > [!NOTE] -> can return generic interfaces, even on types that are not generic. For example, a nongeneric type might implement `IEnumerable` (`IEnumerable(Of Integer)` in Visual Basic). +> can return generic interfaces, even on types that are not generic. For example, a nongeneric type might implement `IEnumerable` (`IEnumerable(Of Integer)` in Visual Basic). @@ -1533,7 +1533,7 @@ For the `FindMembers` method to successfully retrieve member information, the `b To get the class initializer (static constructor) using this method, you must specify | (` Or ` in Visual Basic). You can also get the class initializer using the property. -If the current represents a type parameter of a generic type or generic method, processes any members declared by the class constraint and the interface constraints of the type parameter. +If the current represents a type parameter of a generic type or generic method, processes any members declared by the class constraint and the interface constraints of the type parameter. The `filter` argument can be a custom delegate of type , or it can be one of the following predefined delegates: @@ -1631,7 +1631,7 @@ The `filter` argument can be a custom delegate of type object represents a type parameter of a generic type. - The following example retrieves the type parameter of the type and attempts to display its property. + The following example retrieves the type parameter of the type and attempts to display its property. :::code language="csharp" source="~/snippets/csharp/System/Type/FullName/Fullname3.cs" id="Snippet3"::: :::code language="fsharp" source="~/snippets/fsharp/System/Type/FullName/Fullname3.fs" id="Snippet3"::: @@ -1639,7 +1639,7 @@ The `filter` argument can be a custom delegate of type object represents an array type, a pointer type, or a `byref` type that is based on a generic type parameter. - The following example defines a generic type, `Generictype1`, with three methods: `Display(T[])`, which is passed an array of type T; `HandleT(T)`, which is passed a T object; and `ChangeValue(ref T)`, which is passed a T object by reference. Because C# and Visual Basic do not allow us to define T as a pointer in the `HandleT` method, we have to call the method on the object that represents the method's parameter type to create a pointer to a generic type. The output from the example shows that in all three cases, the property is `null`. + The following example defines a generic type, `Generictype1`, with three methods: `Display(T[])`, which is passed an array of type T; `HandleT(T)`, which is passed a T object; and `ChangeValue(ref T)`, which is passed a T object by reference. Because C# and Visual Basic do not allow us to define T as a pointer in the `HandleT` method, we have to call the method on the object that represents the method's parameter type to create a pointer to a generic type. The output from the example shows that in all three cases, the property is `null`. :::code language="csharp" source="~/snippets/csharp/System/Type/FullName/Fullname4.cs" id="Snippet4"::: :::code language="fsharp" source="~/snippets/fsharp/System/Type/FullName/Fullname4.fs" id="Snippet4"::: @@ -1653,7 +1653,7 @@ The `filter` argument can be a custom delegate of type that is not `null`, you can use the method to get the generic type definition, as the example illustrates. + To get a that is not `null`, you can use the method to get the generic type definition, as the example illustrates. This property is read-only. @@ -1666,7 +1666,7 @@ The `filter` argument can be a custom delegate of type method and the , `FullName`, and properties. + The following example compares the strings returned by the method and the , `FullName`, and properties. :::code language="csharp" source="~/snippets/csharp/System/Type/AssemblyQualifiedName/fullname1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Type/AssemblyQualifiedName/fullname1.fs" id="Snippet1"::: @@ -1730,7 +1730,7 @@ The `filter` argument can be a custom delegate of type property and the method. + The following code example defines a generic type `Test` with two type parameters that have different constraints. When the program executes, the constraints are examined using the property and the method. :::code language="csharp" source="~/snippets/csharp/System/Type/GenericParameterAttributes/source.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Type/GenericParameterAttributes/source.fs" id="Snippet1"::: @@ -1795,7 +1795,7 @@ The `filter` argument can be a custom delegate of type property returns the position of a type parameter in the parameter list of the generic type definition or generic method definition where the type parameter was originally defined. The and properties identify the generic type or method definition: + The property returns the position of a type parameter in the parameter list of the generic type definition or generic method definition where the type parameter was originally defined. The and properties identify the generic type or method definition: - If the property returns a , that represents a generic method definition, and the current object represents a type parameter of that generic method definition. @@ -1807,10 +1807,10 @@ The `filter` argument can be a custom delegate of type for `GetSomething`, and from that you can obtain the return type. When you examine the type parameters of the return type, returns 0 for both. The position of `V` is 0 because `V` is the first type parameter in the type parameter list for class `A`. The position of `X` is 0 because `X` is the first type parameter in the type parameter list for `GetSomething`. + The type returned by `GetSomething` depends on the type arguments supplied to class `A` and to `GetSomething` itself. You can obtain a for `GetSomething`, and from that you can obtain the return type. When you examine the type parameters of the return type, returns 0 for both. The position of `V` is 0 because `V` is the first type parameter in the type parameter list for class `A`. The position of `X` is 0 because `X` is the first type parameter in the type parameter list for `GetSomething`. > [!NOTE] -> Calling the property causes an exception if the current does not represent a type parameter. When you examine the type arguments of an open constructed type, use the property to tell which are type parameters and which are types. The property returns `true` for a type parameter; you can then use the method to obtain its position and use the and properties to determine the generic method or type definition that defines it. +> Calling the property causes an exception if the current does not represent a type parameter. When you examine the type arguments of an open constructed type, use the property to tell which are type parameters and which are types. The property returns `true` for a type parameter; you can then use the method to obtain its position and use the and properties to determine the generic method or type definition that defines it. @@ -1884,7 +1884,7 @@ The `filter` argument can be a custom delegate of type [!NOTE] > If a generic type is used in a generic method or in another generic type, some of its generic type arguments might be generic type parameters of the enclosing method or type. - To get the generic type parameters of a type that represents a generic type definition, use the property. To get a object for the current object, use the extension method. + To get the generic type parameters of a type that represents a generic type definition, use the property. To get a object for the current object, use the extension method. ]]> @@ -2578,7 +2578,7 @@ The `filter` argument can be a custom delegate of type for more information. - This method implements . + This method implements . ]]> @@ -2636,9 +2636,9 @@ False False ``` - Because the overload uses only and , the static constructor is neither counted by the `for` expression nor evaluated by `IsStatic`. + Because the overload uses only and , the static constructor is neither counted by the `for` expression nor evaluated by `IsStatic`. - To find static constructors, use the overload, and pass it the combination (logical OR) of , , , , as shown in the following code example: + To find static constructors, use the overload, and pass it the combination (logical OR) of , , , , as shown in the following code example: :::code language="csharp" source="~/snippets/csharp/System/Type/GetConstructors/source2.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/Type/GetConstructors/source2.fs" id="Snippet2"::: @@ -2717,7 +2717,7 @@ False method does not return constructors in a particular order, such as declaration order. Your code must not depend on the order in which constructors are returned, because that order varies. However, starting with .NET 7, the ordering is deterministic based upon the metadata ordering in the assembly. + In .NET 6 and earlier versions, the method does not return constructors in a particular order, such as declaration order. Your code must not depend on the order in which constructors are returned, because that order varies. However, starting with .NET 7, the ordering is deterministic based upon the metadata ordering in the assembly. The following table shows what members of a base class are returned by the `Get` methods when reflecting on a type. @@ -2736,11 +2736,11 @@ False 3. Custom attributes are not part of the common type system. - This method overload calls the method overload, with | (` Or ` in Visual Basic). It will not find class initializers (static constructor). To find class initializers, use an overload that takes , and specify | (` Or ` in Visual Basic). You can also get the class initializer using the property. + This method overload calls the method overload, with | (` Or ` in Visual Basic). It will not find class initializers (static constructor). To find class initializers, use an overload that takes , and specify | (` Or ` in Visual Basic). You can also get the class initializer using the property. - If the current represents a constructed generic type, this method returns the objects with the type parameters replaced by the appropriate type arguments. For example, if class `C` has a constructor `C(T t1)` (`Sub New(ByVal t1 As T)` in Visual Basic), calling on `C` returns a that represents `C(int t1)` in C# (`Sub New(ByVal t1 As Integer)` in Visual Basic). + If the current represents a constructed generic type, this method returns the objects with the type parameters replaced by the appropriate type arguments. For example, if class `C` has a constructor `C(T t1)` (`Sub New(ByVal t1 As T)` in Visual Basic), calling on `C` returns a that represents `C(int t1)` in C# (`Sub New(ByVal t1 As Integer)` in Visual Basic). - If the current represents a generic type parameter, the method returns an empty array. + If the current represents a generic type parameter, the method returns an empty array. ]]> @@ -2823,11 +2823,11 @@ The following filter flags can be used to See for more information. -In .NET 6 and earlier versions, the method does not return constructors in a particular order, such as declaration order. Your code must not depend on the order in which constructors are returned, because that order varies. However, starting with .NET 7, the ordering is deterministic based upon the metadata ordering in the assembly. +In .NET 6 and earlier versions, the method does not return constructors in a particular order, such as declaration order. Your code must not depend on the order in which constructors are returned, because that order varies. However, starting with .NET 7, the ordering is deterministic based upon the metadata ordering in the assembly. -If the current represents a constructed generic type, this method returns the objects with the type parameters replaced by the appropriate type arguments. For example, if class `C` has a constructor `C(T t1)` (`Sub New(ByVal t1 As T)` in Visual Basic), calling on `C` returns a that represents `C(int t1)` in C# (`Sub New(ByVal t1 As Integer)` in Visual Basic). +If the current represents a constructed generic type, this method returns the objects with the type parameters replaced by the appropriate type arguments. For example, if class `C` has a constructor `C(T t1)` (`Sub New(ByVal t1 As T)` in Visual Basic), calling on `C` returns a that represents `C(int t1)` in C# (`Sub New(ByVal t1 As Integer)` in Visual Basic). -If the current represents a generic type parameter, the method returns an empty array. +If the current represents a generic type parameter, the method returns an empty array. ]]> @@ -2898,7 +2898,7 @@ If the current represents a generic type parameter, the method does not return members in a particular order, such as alphabetical or declaration order. Your code must not depend on the order in which members are returned, because that order varies. + The method does not return members in a particular order, such as alphabetical or declaration order. Your code must not depend on the order in which members are returned, because that order varies. This method can be overridden by a derived class. @@ -2921,7 +2921,7 @@ If the current represents a generic type parameter, the represents a constructed generic type, this method returns the objects with the type parameters replaced by the appropriate type arguments. For example, if class `C` has a property `P` that returns `T`, calling on `C` returns `int P` in C# (`Property P As Integer` in Visual Basic). + If the current represents a constructed generic type, this method returns the objects with the type parameters replaced by the appropriate type arguments. For example, if class `C` has a property `P` that returns `T`, calling on `C` returns `int P` in C# (`Property P As Integer` in Visual Basic). If the current represents a type parameter in the definition of a generic type or generic method, this method searches the members of the class constraint, or the members of if there is no class constraint. @@ -3475,7 +3475,7 @@ If the current represents a generic type parameter, the method to search a type for a public or non-public event named "Click" that is not `static` (`Shared` in Visual Basic). + The following code example uses the method to search a type for a public or non-public event named "Click" that is not `static` (`Shared` in Visual Basic). :::code language="csharp" source="~/snippets/csharp/System/Type/GetEvent/type_getevent1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Type/GetEvent/type_getevent1.fs" id="Snippet1"::: @@ -3561,7 +3561,7 @@ If the current represents a generic type parameter, the | | (in Visual Basic, combine the values using ` Or `) to get it. - In .NET 6 and earlier versions, the method does not return events in a particular order, such as alphabetical or declaration order. Your code must not depend on the order in which events are returned, because that order varies. However, starting with .NET 7, the ordering is deterministic based upon the metadata ordering in the assembly. + In .NET 6 and earlier versions, the method does not return events in a particular order, such as alphabetical or declaration order. Your code must not depend on the order in which events are returned, because that order varies. However, starting with .NET 7, the ordering is deterministic based upon the metadata ordering in the assembly. This method can be overridden by a derived class. @@ -3667,7 +3667,7 @@ If the current represents a generic type parameter, the method does not return events in a particular order, such as alphabetical or declaration order. Your code must not depend on the order in which events are returned, because that order varies. However, starting with .NET 7, the ordering is deterministic based upon the metadata ordering in the assembly. + In .NET 6 and earlier versions, the method does not return events in a particular order, such as alphabetical or declaration order. Your code must not depend on the order in which events are returned, because that order varies. However, starting with .NET 7, the ordering is deterministic based upon the metadata ordering in the assembly. The following filter flags can be used to define which events to include in the search: @@ -4011,7 +4011,7 @@ If the current represents a generic type parameter, the method does not return fields in a particular order, such as alphabetical or declaration order. Your code must not depend on the order in which fields are returned, because that order varies. However, starting with .NET 7, the ordering is deterministic based upon the metadata ordering in the assembly. + In .NET 6 and earlier versions, the method does not return fields in a particular order, such as alphabetical or declaration order. Your code must not depend on the order in which fields are returned, because that order varies. However, starting with .NET 7, the ordering is deterministic based upon the metadata ordering in the assembly. The following table shows what members of a base class are returned by the `Get` methods when reflecting on a type. @@ -4137,7 +4137,7 @@ The following modifier flags can be used t See for more information. -In .NET 6 and earlier versions, the method does not return fields in a particular order, such as alphabetical or declaration order. Your code must not depend on the order in which fields are returned, because that order varies. However, starting with .NET 7, the ordering is deterministic based upon the metadata ordering in the assembly. +In .NET 6 and earlier versions, the method does not return fields in a particular order, such as alphabetical or declaration order. Your code must not depend on the order in which fields are returned, because that order varies. However, starting with .NET 7, the ordering is deterministic based upon the metadata ordering in the assembly. If the current represents a constructed generic type, this method returns the objects with the type parameters replaced by the appropriate type arguments. @@ -4316,7 +4316,7 @@ In .NET 6 and earlier versions, the method does ## Remarks The array elements are returned in the order in which they appear in the list of type arguments for the generic type. -- If the current type is a closed constructed type (that is, the property returns `false`), the array returned by the method contains the types that have been assigned to the generic type parameters of the generic type definition. +- If the current type is a closed constructed type (that is, the property returns `false`), the array returned by the method contains the types that have been assigned to the generic type parameters of the generic type definition. - If the current type is a generic type definition, the array contains the type parameters. @@ -4327,7 +4327,7 @@ In .NET 6 and earlier versions, the method does ## Examples - The following code example uses the method to display the type arguments of a constructed type and the type parameters of its generic type definition. + The following code example uses the method to display the type arguments of a constructed type and the type parameters of its generic type definition. This code example is part of a larger example provided for the property. See the larger example for sample output. @@ -4394,7 +4394,7 @@ In .NET 6 and earlier versions, the method does ## Examples - The following code example defines a generic type `Test` with two type parameters that have different constraints. When the program executes, the constraints are examined using the property and the method. + The following code example defines a generic type `Test` with two type parameters that have different constraints. When the program executes, the constraints are examined using the property and the method. :::code language="csharp" source="~/snippets/csharp/System/Type/GenericParameterAttributes/source.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Type/GenericParameterAttributes/source.fs" id="Snippet1"::: @@ -4459,19 +4459,19 @@ In .NET 6 and earlier versions, the method does `, you can construct and instantiate the type `G`. Given a object representing this constructed type, the method returns the generic type definition. + A generic type definition is a template from which other types can be constructed. For example, from the C# generic type definition `G`, you can construct and instantiate the type `G`. Given a object representing this constructed type, the method returns the generic type definition. - If two constructed types are created from the same generic type definition, using the same type arguments, the method returns the same object for both types. + If two constructed types are created from the same generic type definition, using the same type arguments, the method returns the same object for both types. - If you call the method on a object that already represents a generic type definition, it returns the current . + If you call the method on a object that already represents a generic type definition, it returns the current . > [!IMPORTANT] -> An array of generic types is not itself generic. In the C# code `A[] v;` or the Visual Basic code `Dim v() As A(Of Integer)`, the type of variable `v` is not generic. Use to determine whether a type is generic before calling . +> An array of generic types is not itself generic. In the C# code `A[] v;` or the Visual Basic code `Dim v() As A(Of Integer)`, the type of variable `v` is not generic. Use to determine whether a type is generic before calling . For a list of the invariant conditions for terms used in generic reflection, see the property remarks. ## Examples - The following code example creates an instance of a constructed type by using ordinary instance creation and then uses the and methods to retrieve the constructed type and the generic type definition. This example uses the generic type; the constructed type represents a of `Test` objects with string keys. + The following code example creates an instance of a constructed type by using ordinary instance creation and then uses the and methods to retrieve the constructed type and the generic type definition. This example uses the generic type; the constructed type represents a of `Test` objects with string keys. :::code language="csharp" source="~/snippets/csharp/System/Type/GetGenericTypeDefinition/source.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Type/GetGenericTypeDefinition/source.fs" id="Snippet1"::: @@ -4545,7 +4545,7 @@ In .NET 6 and earlier versions, the method does . + This method overrides . @@ -4652,9 +4652,9 @@ In .NET 6 and earlier versions, the method does ## Examples - The following code example uses the method to search the class for the interface, and lists the methods of the interface. + The following code example uses the method to search the class for the interface, and lists the methods of the interface. - The code example also demonstrates the method overload and the method. + The code example also demonstrates the method overload and the method. :::code language="csharp" source="~/snippets/csharp/System/Type/GetInterface/type_getinterface.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Type/GetInterface/type_getinterface.fs" id="Snippet1"::: @@ -4756,9 +4756,9 @@ In .NET 6 and earlier versions, the method does ## Examples - The following code example uses the method to perform a case-insensitive search of the class for the interface. + The following code example uses the method to perform a case-insensitive search of the class for the interface. - The code example also demonstrates the method overload and the method. + The code example also demonstrates the method overload and the method. :::code language="csharp" source="~/snippets/csharp/System/Type/GetInterface/type_getinterface.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/Type/GetInterface/type_getinterface.fs" id="Snippet2"::: @@ -4844,7 +4844,7 @@ In .NET 6 and earlier versions, the method does ## Examples - The following example calls the method to determine how the interface maps to methods, and how the interface maps to properties. Note that, because the interface defines a set of properties, the returned object includes separate objects for a property's get and set accessors. + The following example calls the method to determine how the interface maps to methods, and how the interface maps to properties. Note that, because the interface defines a set of properties, the returned object includes separate objects for a property's get and set accessors. :::code language="csharp" source="~/snippets/csharp/System/Type/GetInterfaceMap/interfacemapping1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Type/GetInterfaceMap/interfacemapping1.fs" id="Snippet1"::: @@ -4931,7 +4931,7 @@ The current instance or argument is an open ge method does not return interfaces in a particular order, such as alphabetical or declaration order. Your code must not depend on the order in which interfaces are returned, because that order varies. However, starting with .NET 7, the ordering is deterministic based upon the metadata ordering in the assembly. + In .NET 6 and earlier versions, the method does not return interfaces in a particular order, such as alphabetical or declaration order. Your code must not depend on the order in which interfaces are returned, because that order varies. However, starting with .NET 7, the ordering is deterministic based upon the metadata ordering in the assembly. If the current represents a constructed generic type, this method returns the objects with the type parameters replaced by the appropriate type arguments. @@ -5028,7 +5028,7 @@ The current instance or argument is an open ge Members include properties, methods, fields, events, and so on. - In .NET 6 and earlier versions, the method does not return members in a particular order, such as alphabetical or declaration order. Your code must not depend on the order in which members are returned, because that order varies. However, starting with .NET 7, the ordering is deterministic based upon the metadata ordering in the assembly. + In .NET 6 and earlier versions, the method does not return members in a particular order, such as alphabetical or declaration order. Your code must not depend on the order in which members are returned, because that order varies. However, starting with .NET 7, the ordering is deterministic based upon the metadata ordering in the assembly. This method overload will not find class initializers (static constructor). To find class initializers, use an overload that takes , and specify | (` Or ` in Visual Basic). You can also get the class initializer using the property. @@ -5148,7 +5148,7 @@ The current instance or argument is an open ge Members include properties, methods, fields, events, and so on. - In .NET 6 and earlier versions, the method does not return members in a particular order, such as alphabetical or declaration order. Your code must not depend on the order in which members are returned, because that order varies. However, starting with .NET 7, the ordering is deterministic based upon the metadata ordering in the assembly. + In .NET 6 and earlier versions, the method does not return members in a particular order, such as alphabetical or declaration order. Your code must not depend on the order in which members are returned, because that order varies. However, starting with .NET 7, the ordering is deterministic based upon the metadata ordering in the assembly. The following filter flags can be used to define which members to include in the search: @@ -5269,7 +5269,7 @@ The current instance or argument is an open ge ## Remarks Members include properties, methods, fields, events, and so on. - In .NET 6 and earlier versions, the method does not return members in a particular order, such as alphabetical or declaration order. Your code must not depend on the order in which members are returned, because that order varies. However, starting with .NET 7, the ordering is deterministic based upon the metadata ordering in the assembly. + In .NET 6 and earlier versions, the method does not return members in a particular order, such as alphabetical or declaration order. Your code must not depend on the order in which members are returned, because that order varies. However, starting with .NET 7, the ordering is deterministic based upon the metadata ordering in the assembly. The following filter flags can be used to define which members to include in the search: @@ -5398,9 +5398,9 @@ The current instance or argument is an open ge Members include properties, methods, constructors, fields, events, and nested types. - In .NET 6 and earlier versions, the method does not return members in a particular order, such as alphabetical or declaration order. Your code must not depend on the order in which members are returned, because that order varies. However, starting with .NET 7, the ordering is deterministic based upon the metadata ordering in the assembly. + In .NET 6 and earlier versions, the method does not return members in a particular order, such as alphabetical or declaration order. Your code must not depend on the order in which members are returned, because that order varies. However, starting with .NET 7, the ordering is deterministic based upon the metadata ordering in the assembly. - This method overload calls the method overload, with | | (` Or `` Or ` in Visual Basic). It will not find class initializers (static constructors). To find class initializers, call the overload, and specify | (` Or ` in Visual Basic). You can also get the class initializer using the property. + This method overload calls the method overload, with | | (` Or `` Or ` in Visual Basic). It will not find class initializers (static constructors). To find class initializers, call the overload, and specify | (` Or ` in Visual Basic). You can also get the class initializer using the property. The following table shows what members of a base class are returned by the `Get` methods when reflecting on a type. @@ -5532,7 +5532,7 @@ The following modifier flags can be used t See for more information. -In .NET 6 and earlier versions, the method does not return members in a particular order, such as alphabetical or declaration order. Your code must not depend on the order in which members are returned, because that order varies. However, starting with .NET 7, the ordering is deterministic based upon the metadata ordering in the assembly. +In .NET 6 and earlier versions, the method does not return members in a particular order, such as alphabetical or declaration order. Your code must not depend on the order in which members are returned, because that order varies. However, starting with .NET 7, the ordering is deterministic based upon the metadata ordering in the assembly. To get the class initializer (static constructor) using this method overload, you must specify | (` Or ` in Visual Basic). You can also get the class initializer using the property. @@ -5541,7 +5541,7 @@ In .NET 6 and earlier versions, the method does If the current represents a type parameter in the definition of a generic type or generic method, this method searches the members of the class constraint, or the members of if there is no class constraint. ## Examples - The following code example demonstrates how to use the method overload to collect information about all public instance members of a specified class. + The following code example demonstrates how to use the method overload to collect information about all public instance members of a specified class. :::code language="csharp" source="~/snippets/csharp/System/Type/GetMembers/type_getmembers2.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Type/GetMembers/type_getmembers2.fs" id="Snippet1"::: @@ -5683,7 +5683,7 @@ This method can be used to find a constructed generic member given a member from ## Remarks The search for `name` is case-sensitive. The search includes public static and public instance methods. - If a method is overloaded and has more than one public method, the method throws an exception. In the following example, an exception is thrown because there is more than one public overload of the method. On the other hand, because the `Person.ToString` method overrides and therefore is not overloaded, the method is able to retrieve the object. + If a method is overloaded and has more than one public method, the method throws an exception. In the following example, an exception is thrown because there is more than one public overload of the method. On the other hand, because the `Person.ToString` method overrides and therefore is not overloaded, the method is able to retrieve the object. :::code language="csharp" source="~/snippets/csharp/System/Type/GetMethod/GetMethodWithOverloads2.cs" id="Snippet3"::: :::code language="fsharp" source="~/snippets/fsharp/System/Type/GetMethod/GetMethodWithOverloads2.fs" id="Snippet3"::: @@ -5691,9 +5691,9 @@ This method can be used to find a constructed generic member given a member from You can do one of the following to retrieve a specific method: -- Call the method and specify a `bindingAttr` argument that uniquely identifies the method. For example, if the exception is thrown because a type has a static and an instance overload, you can specify a `bindingAttr` argument of or . +- Call the method and specify a `bindingAttr` argument that uniquely identifies the method. For example, if the exception is thrown because a type has a static and an instance overload, you can specify a `bindingAttr` argument of or . -- Call an overload of the method that includes a `types` parameter which defines the types of the method's parameters. +- Call an overload of the method that includes a `types` parameter which defines the types of the method's parameters. - Call the method to retrieve an array containing all of the public methods belonging to a type. You can then iterate it to identify the duplicate methods named `name`. @@ -5827,9 +5827,9 @@ This method can be used to find a constructed generic member given a member from - Change the binding constraints. In the previous example, attempting to retrieve a public instance `Equals` method that is declared by the type and not inherited successfully retrieves `Equals(TestClass)`. -- Call an overload of the method that includes a `types` parameter which defines the types of the method's parameters. +- Call an overload of the method that includes a `types` parameter which defines the types of the method's parameters. -- Call the method to retrieve an array containing all of the methods belonging to a type that have the specified binding attributes. You can then iterate it to identify the duplicate methods named `name`. This approach is illustrated in the previous example's handler for the exception. +- Call the method to retrieve an array containing all of the methods belonging to a type that have the specified binding attributes. You can then iterate it to identify the duplicate methods named `name`. This approach is illustrated in the previous example's handler for the exception. If the current represents a constructed generic type, this method returns the with the type parameters replaced by the appropriate type arguments. @@ -5956,13 +5956,13 @@ This method can be used to find a constructed generic member given a member from :::code language="fsharp" source="~/snippets/fsharp/System/Type/GetMethod/type_getmethod4.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/Type/GetMethod/type_getmethod4.vb" id="Snippet1"::: - The following example retrieves objects that represent the `Add` methods of a non-generic type (the class), an open generic type (the class), and a closed generic type (the `List(Of String)` type. + The following example retrieves objects that represent the `Add` methods of a non-generic type (the class), an open generic type (the class), and a closed generic type (the `List(Of String)` type. :::code language="csharp" source="~/snippets/csharp/System/Type/GetMethod/GetMethod1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Type/GetMethod/GetMethod1.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/Type/GetMethod/GetMethod1.vb" id="Snippet1"::: - The example defines a `GetAddMethod` method that retrieves the appropriate object. To provide the `types` argument for an open generic type, it calls the method. To provide the `types` argument for a closed generic type, it retrieves the value of the property. + The example defines a `GetAddMethod` method that retrieves the appropriate object. To provide the `types` argument for an open generic type, it calls the method. To provide the `types` argument for a closed generic type, it retrieves the value of the property. ]]> @@ -7223,7 +7223,7 @@ An empty array of the type (that is, Type[] types = ## Remarks -In .NET 6 and earlier versions, the method does not return methods in a particular order, such as alphabetical or declaration order. Your code must not depend on the order in which methods are returned, because that order varies. However, starting with .NET 7, the ordering is deterministic based upon the metadata ordering in the assembly. +In .NET 6 and earlier versions, the method does not return methods in a particular order, such as alphabetical or declaration order. Your code must not depend on the order in which methods are returned, because that order varies. However, starting with .NET 7, the ordering is deterministic based upon the metadata ordering in the assembly. Constructors are not included in the array of methods returned by this call. Make a separate call to `GetConstructors()` to get the constructor methods. @@ -7345,7 +7345,7 @@ For the `GetMethods(BindingFlags)` overload to successfully retrieve method info See for more information. -In .NET 6 and earlier versions, the method does not return methods in a particular order, such as alphabetical or declaration order. Your code must not depend on the order in which methods are returned, because that order varies. However, starting with .NET 7, the ordering is deterministic based upon the metadata ordering in the assembly. +In .NET 6 and earlier versions, the method does not return methods in a particular order, such as alphabetical or declaration order. Your code must not depend on the order in which methods are returned, because that order varies. However, starting with .NET 7, the ordering is deterministic based upon the metadata ordering in the assembly. If the current represents a constructed generic type, this method returns the objects with the type parameters replaced by the appropriate type arguments. @@ -7469,7 +7469,7 @@ If the current represents a type parameter in the definition > [!NOTE] > If the current represents a generic type defined in C#, Visual Basic, or C++, its nested types are all generic even if they have no generic parameters of their own. This is not necessarily true of nested types defined in dynamic assemblies or compiled with the [Ilasm.exe (IL Assembler)](/dotnet/framework/tools/ilasm-exe-il-assembler). - For information on nested generic types, and on constructing nested generic types from their generic type definitions, see . + For information on nested generic types, and on constructing nested generic types from their generic type definitions, see . ]]> @@ -7559,7 +7559,7 @@ If the current represents a type parameter in the definition - Specify to include non-public nested types (that is, private, internal, and protected nested types) in the search. - This method returns only the nested types of the current type. It does not search the base classes of the current type. To find types that are nested in base classes, you must walk the inheritance hierarchy, calling at each level. + This method returns only the nested types of the current type. It does not search the base classes of the current type. To find types that are nested in base classes, you must walk the inheritance hierarchy, calling at each level. and are ignored. @@ -7574,7 +7574,7 @@ If the current represents a type parameter in the definition > [!NOTE] > If the current represents a generic type defined in C#, Visual Basic, or C++, its nested types are all generic even if they have no generic parameters of their own. This is not necessarily true of nested types defined in dynamic assemblies or compiled with the [Ilasm.exe (IL Assembler)](/dotnet/framework/tools/ilasm-exe-il-assembler). - For information on nested generic types, and on constructing nested generic types from their generic type definitions, see . + For information on nested generic types, and on constructing nested generic types from their generic type definitions, see . ]]> @@ -7652,7 +7652,7 @@ If the current represents a type parameter in the definition method does not return types in a particular order, such as alphabetical or declaration order. Your code must not depend on the order in which types are returned, because that order varies. However, starting with .NET 7, the ordering is deterministic based upon the metadata ordering in the assembly. + In .NET 6 and earlier versions, the method does not return types in a particular order, such as alphabetical or declaration order. Your code must not depend on the order in which types are returned, because that order varies. However, starting with .NET 7, the ordering is deterministic based upon the metadata ordering in the assembly. Only the public types immediately nested in the current type are returned; the search is not recursive. @@ -7680,7 +7680,7 @@ If the current represents a type parameter in the definition > [!NOTE] > If the current represents a generic type defined in C#, Visual Basic, or C++, its nested types are all generic even if they have no generic parameters of their own. This is not necessarily true of nested types defined in dynamic assemblies or compiled with the [Ilasm.exe (IL Assembler)](/dotnet/framework/tools/ilasm-exe-il-assembler). - For information on nested generic types, and on constructing nested generic types from their generic type definitions, see . + For information on nested generic types, and on constructing nested generic types from their generic type definitions, see . @@ -7757,7 +7757,7 @@ If the current represents a type parameter in the definition ## Remarks The search for nested types is not recursive. - In .NET 6 and earlier versions, the method does not return types in a particular order, such as alphabetical or declaration order. Your code must not depend on the order in which types are returned, because that order varies. However, starting with .NET 7, the ordering is deterministic based upon the metadata ordering in the assembly. + In .NET 6 and earlier versions, the method does not return types in a particular order, such as alphabetical or declaration order. Your code must not depend on the order in which types are returned, because that order varies. However, starting with .NET 7, the ordering is deterministic based upon the metadata ordering in the assembly. The following filter flags can be used to define which nested types to include in the search: @@ -7767,7 +7767,7 @@ If the current represents a type parameter in the definition - Specify to include non-public nested types (that is, private, internal, and protected nested types) in the search. - This method returns only the nested types of the current type. It does not search the base classes of the current type. To find types that are nested in base classes, you must walk the inheritance hierarchy, calling at each level. + This method returns only the nested types of the current type. It does not search the base classes of the current type. To find types that are nested in base classes, you must walk the inheritance hierarchy, calling at each level. and are ignored. @@ -7782,7 +7782,7 @@ If the current represents a type parameter in the definition > [!NOTE] > If the current represents a generic type defined in C#, Visual Basic, or C++, its nested types are all generic even if they have no generic parameters of their own. This is not necessarily true of nested types defined in dynamic assemblies or compiled with the [Ilasm.exe (IL Assembler)](/dotnet/framework/tools/ilasm-exe-il-assembler). - For information on nested generic types, and on constructing nested generic types from their generic type definitions, see . + For information on nested generic types, and on constructing nested generic types from their generic type definitions, see . @@ -7839,7 +7839,7 @@ If the current represents a type parameter in the definition and methods are provided for designers of managed compilers. For more information on custom modifiers, see classes in the namespace. Also see the metadata specification in Partition II of the [Common Language Infrastructure (CLI) documentation](https://www.ecma-international.org/publications-and-standards/standards/ecma-335/). + The and methods are provided for designers of managed compilers. For more information on custom modifiers, see classes in the namespace. Also see the metadata specification in Partition II of the [Common Language Infrastructure (CLI) documentation](https://www.ecma-international.org/publications-and-standards/standards/ecma-335/). ]]> @@ -7915,11 +7915,11 @@ If the current represents a type parameter in the definition overload with a `bindingAttr` argument equal to `BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public` in C# and `BindingFlags.Instance Or BindingFlags.Static Or BindingFlags.Public` in Visual Basic. It returns all public instance and static properties, both those defined by the type represented by the current object as well as those inherited from its base types. + Calling this overload is equivalent to calling the overload with a `bindingAttr` argument equal to `BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public` in C# and `BindingFlags.Instance Or BindingFlags.Static Or BindingFlags.Public` in Visual Basic. It returns all public instance and static properties, both those defined by the type represented by the current object as well as those inherited from its base types. A property is considered public to reflection if it has at least one accessor that is public. Otherwise the property is considered private, and you must use | | (in Visual Basic, combine the values using ` Or `) to get it. - In .NET 6 and earlier versions, the method does not return properties in a particular order, such as alphabetical or declaration order. Your code must not depend on the order in which properties are returned, because that order varies. However, starting with .NET 7, the ordering is deterministic based upon the metadata ordering in the assembly. + In .NET 6 and earlier versions, the method does not return properties in a particular order, such as alphabetical or declaration order. Your code must not depend on the order in which properties are returned, because that order varies. However, starting with .NET 7, the ordering is deterministic based upon the metadata ordering in the assembly. The following table shows what members of a base class are returned by the `Get` methods when reflecting on a type. @@ -8045,7 +8045,7 @@ The following filter flags can be used to See for more information. -In .NET 6 and earlier versions, the method does not return properties in a particular order, such as alphabetical or declaration order. Your code must not depend on the order in which properties are returned, because that order varies. However, starting with .NET 7, the ordering is deterministic based upon the metadata ordering in the assembly. +In .NET 6 and earlier versions, the method does not return properties in a particular order, such as alphabetical or declaration order. Your code must not depend on the order in which properties are returned, because that order varies. However, starting with .NET 7, the ordering is deterministic based upon the metadata ordering in the assembly. If the current represents a constructed generic type, this method returns the objects with the type parameters replaced by the appropriate type arguments. @@ -8999,7 +8999,7 @@ The following example retrieves the `Type` object of a user-defined class, retri and methods are provided for designers of managed compilers. For more information on custom modifiers, see classes in the namespace. Also see the metadata specification in Partition II of the [Common Language Infrastructure (CLI) documentation](https://www.ecma-international.org/publications-and-standards/standards/ecma-335/). + The and methods are provided for designers of managed compilers. For more information on custom modifiers, see classes in the namespace. Also see the metadata specification in Partition II of the [Common Language Infrastructure (CLI) documentation](https://www.ecma-international.org/publications-and-standards/standards/ecma-335/). ]]> @@ -9129,16 +9129,16 @@ The following example retrieves the `Type` object of a user-defined class, retri ## Remarks -You can use the method to obtain a object for a type in another assembly if you know its assembly-qualified name, which can be obtained from . causes loading of the assembly specified in `typeName`. You can also load an assembly using the method, and then use the or method to get objects. If a type is in an assembly known to your program at compile time, it's more efficient to use `typeof` in C# or the `GetType` operator in Visual Basic. +You can use the method to obtain a object for a type in another assembly if you know its assembly-qualified name, which can be obtained from . causes loading of the assembly specified in `typeName`. You can also load an assembly using the method, and then use the or method to get objects. If a type is in an assembly known to your program at compile time, it's more efficient to use `typeof` in C# or the `GetType` operator in Visual Basic. > [!NOTE] -> If `typeName` cannot be found, the call to the method returns `null`. It does not throw an exception. To control whether an exception is thrown, call an overload of the method that has a `throwOnError` parameter. +> If `typeName` cannot be found, the call to the method returns `null`. It does not throw an exception. To control whether an exception is thrown, call an overload of the method that has a `throwOnError` parameter. - .NET Framework only: only works on assemblies loaded from disk. If you call to look up a type defined in a dynamic assembly defined using the services, you might get inconsistent behavior. The behavior depends on whether the dynamic assembly is persistent, that is, created using the `RunAndSave` or `Save` access modes of the enumeration. If the dynamic assembly is persistent and has been written to disk before `GetType` is called, the loader finds the saved assembly on disk, loads that assembly, and retrieves the type from that assembly. If the assembly has not been saved to disk when `GetType` is called, the method returns `null`. `GetType` does not understand transient dynamic assemblies; therefore, calling `GetType` to retrieve a type in a transient dynamic assembly returns `null`. + .NET Framework only: only works on assemblies loaded from disk. If you call to look up a type defined in a dynamic assembly defined using the services, you might get inconsistent behavior. The behavior depends on whether the dynamic assembly is persistent, that is, created using the `RunAndSave` or `Save` access modes of the enumeration. If the dynamic assembly is persistent and has been written to disk before `GetType` is called, the loader finds the saved assembly on disk, loads that assembly, and retrieves the type from that assembly. If the assembly has not been saved to disk when `GetType` is called, the method returns `null`. `GetType` does not understand transient dynamic assemblies; therefore, calling `GetType` to retrieve a type in a transient dynamic assembly returns `null`. In .NET Framework, to use `GetType` on a dynamic module, subscribe to the event and call `GetType` before saving. Otherwise, you will get two copies of the assembly in memory. - On .NET Core 3.0 and later versions, assembly loads triggered by this API are affected by the current value of . + On .NET Core 3.0 and later versions, assembly loads triggered by this API are affected by the current value of . The following table shows what members of a base class are returned by the `Get` methods when reflecting on a type. @@ -9159,14 +9159,14 @@ You can use the method to obtain a . + `typeName` can be the type name qualified by its namespace or an assembly-qualified name that includes an assembly name specification. See . If `typeName` includes the namespace but not the assembly name, this method searches only the calling object's assembly and mscorlib.dll/System.Private.CoreLib.dll, in that order. If typeName is fully qualified with the partial or complete assembly name, this method searches in the specified assembly. If the assembly has a strong name, a complete assembly name is required. The property returns a fully qualified type name including nested types, the assembly name, and generic type arguments. All compilers that support the common language runtime will emit the simple name of a nested class, and reflection constructs a mangled name when queried, in accordance with the following conventions. > [!NOTE] -> Processor architecture is part of assembly identity, and can be specified as part of assembly name strings. For example, "ProcessorArchitecture=msil". However, it's not included in the string returned by the property, for compatibility reasons. You can also load types by creating an object and passing it to an appropriate overload of the method. You can then use the method to load types from the assembly. See also . +> Processor architecture is part of assembly identity, and can be specified as part of assembly name strings. For example, "ProcessorArchitecture=msil". However, it's not included in the string returned by the property, for compatibility reasons. You can also load types by creating an object and passing it to an appropriate overload of the method. You can then use the method to load types from the assembly. See also . |Delimiter|Meaning| |---------------|-------------| @@ -9191,7 +9191,7 @@ TopNamespace.Sub\+Namespace.ContainingClass+NestedClass,MyAssembly A "++" becomes "\\+\\+", and a "\\" becomes "\\\\". - This qualified name can be persisted and later used to load the . To search for and load a , use either with the type name only or with the assembly qualified type name. with the type name only will look for the in the caller's assembly and then in the System assembly. with the assembly qualified type name will look for the in any assembly. + This qualified name can be persisted and later used to load the . To search for and load a , use either with the type name only or with the assembly qualified type name. with the type name only will look for the in the caller's assembly and then in the System assembly. with the assembly qualified type name will look for the in any assembly. Type names may include trailing characters that denote additional information about the type, such as whether the type is a reference type, a pointer type or an array type. To retrieve the type name without these trailing characters, use `t.GetElementType().ToString()`, where `t` is the type. @@ -9199,13 +9199,13 @@ TopNamespace.Sub\+Namespace.ContainingClass+NestedClass,MyAssembly The name of a generic type ends with a backtick (\`) followed by digits representing the number of generic type arguments. The purpose of this name mangling is to allow compilers to support generic types with the same name but with different numbers of type parameters, occurring in the same scope. For example, reflection returns the mangled names ``Tuple`1`` and ``Tuple`2`` from the generic methods `Tuple(Of T)` and `Tuple(Of T0, T1)` in Visual Basic, or `Tuple` and `Tuple` in Visual C#. - For generic types, the type argument list is enclosed in brackets, and the type arguments are separated by commas. For example, a generic has two type parameters. A of `MyType` with keys of type might be represented as follows: + For generic types, the type argument list is enclosed in brackets, and the type arguments are separated by commas. For example, a generic has two type parameters. A of `MyType` with keys of type might be represented as follows: ```txt System.Collections.Generic.Dictionary`2[System.String,MyType] ``` - To specify an assembly-qualified type within a type argument list, enclose the assembly-qualified type within brackets. Otherwise, the commas that separate the parts of the assembly-qualified name are interpreted as delimiting additional type arguments. For example, a of `MyType` fromMyAssembly.dll, with keys of type , might be specified as follows: + To specify an assembly-qualified type within a type argument list, enclose the assembly-qualified type within brackets. Otherwise, the commas that separate the parts of the assembly-qualified name are interpreted as delimiting additional type arguments. For example, a of `MyType` fromMyAssembly.dll, with keys of type , might be specified as follows: ```txt Type.GetType("System.Collections.Generic.Dictionary`2[System.String,[MyType,MyAssembly]]") @@ -9343,13 +9343,13 @@ Note: In .NET for Win method to obtain a object for a type in another assembly if you know its assembly-qualified name, which can be obtained from . causes loading of the assembly specified in `typeName`. You can also load an assembly using the method, and then use the or method to get objects. If a type is in an assembly known to your program at compile time, it's more efficient to use `typeof` in C# or the `GetType` operator in Visual Basic. + You can use the method to obtain a object for a type in another assembly if you know its assembly-qualified name, which can be obtained from . causes loading of the assembly specified in `typeName`. You can also load an assembly using the method, and then use the or method to get objects. If a type is in an assembly known to your program at compile time, it's more efficient to use `typeof` in C# or the `GetType` operator in Visual Basic. - .NET Framework only: only works on assemblies loaded from disk. If you call to look up a type defined in a dynamic assembly defined using the services, you might get inconsistent behavior. The behavior depends on whether the dynamic assembly is persistent, that is, created using the `RunAndSave` or `Save` access modes of the enumeration. If the dynamic assembly is persistent and has been written to disk before `GetType` is called, the loader finds the saved assembly on disk, loads that assembly, and retrieves the type from that assembly. If the assembly has not been saved to disk when `GetType` is called, the method returns `null`. `GetType` does not understand transient dynamic assemblies; therefore, calling `GetType` to retrieve a type in a transient dynamic assembly returns `null`. + .NET Framework only: only works on assemblies loaded from disk. If you call to look up a type defined in a dynamic assembly defined using the services, you might get inconsistent behavior. The behavior depends on whether the dynamic assembly is persistent, that is, created using the `RunAndSave` or `Save` access modes of the enumeration. If the dynamic assembly is persistent and has been written to disk before `GetType` is called, the loader finds the saved assembly on disk, loads that assembly, and retrieves the type from that assembly. If the assembly has not been saved to disk when `GetType` is called, the method returns `null`. `GetType` does not understand transient dynamic assemblies; therefore, calling `GetType` to retrieve a type in a transient dynamic assembly returns `null`. In .NET Framework, to use `GetType` on a dynamic module, subscribe to the event and call `GetType` before saving. Otherwise, you will get two copies of the assembly in memory. - On .NET Core 3.0 and later versions, assembly loads triggered by this API are affected by the current value of . + On .NET Core 3.0 and later versions, assembly loads triggered by this API are affected by the current value of . The `throwOnError` parameter specifies what happens when the type is not found, and also suppresses certain other exception conditions, as described in the Exceptions section. Some exceptions are thrown regardless of the value of `throwOnError`. For example, if the type is found but cannot be loaded, a is thrown even if `throwOnError` is `false`. @@ -9372,14 +9372,14 @@ Note: In .NET for Win Arrays or COM types are not searched for unless they have already been loaded into the table of available classes. - `typeName` can be the type name qualified by its namespace or an assembly-qualified name that includes an assembly name specification. See . + `typeName` can be the type name qualified by its namespace or an assembly-qualified name that includes an assembly name specification. See . If `typeName` includes the namespace but not the assembly name, this method searches only the calling object's assembly and mscorlib.dll/System.Private.CoreLib.dll, in that order. If typeName is fully qualified with the partial or complete assembly name, this method searches in the specified assembly. If the assembly has a strong name, a complete assembly name is required. The property returns a fully qualified type name including nested types, the assembly name, and generic arguments. All compilers that support the common language runtime will emit the simple name of a nested class, and reflection constructs a mangled name when queried, in accordance with the following conventions. > [!NOTE] -> Processor architecture is part of assembly identity, and can be specified as part of assembly name strings. For example, "ProcessorArchitecture=msil". However, it's not included in the string returned by the property, for compatibility reasons. You can also load types by creating an object and passing it to an appropriate overload of the method. You can then use the method to load types from the assembly. See also . +> Processor architecture is part of assembly identity, and can be specified as part of assembly name strings. For example, "ProcessorArchitecture=msil". However, it's not included in the string returned by the property, for compatibility reasons. You can also load types by creating an object and passing it to an appropriate overload of the method. You can then use the method to load types from the assembly. See also . |Delimiter|Meaning| |---------------|-------------| @@ -9404,7 +9404,7 @@ TopNamespace.Sub\+Namespace.ContainingClass+NestedClass,MyAssembly A "++" becomes "\\+\\+", and a "\\" becomes "\\\\". - This qualified name can be persisted and later used to load the . To search for and load a , use either with the type name only or with the assembly qualified type name. with the type name only will look for the in the caller's assembly and then in the System assembly. with the assembly qualified type name will look for the in any assembly. + This qualified name can be persisted and later used to load the . To search for and load a , use either with the type name only or with the assembly qualified type name. with the type name only will look for the in the caller's assembly and then in the System assembly. with the assembly qualified type name will look for the in any assembly. Type names may include trailing characters that denote additional information about the type, such as whether the type is a reference type, a pointer type or an array type. To retrieve the type name without these trailing characters, use `t.GetElementType().ToString()`, where `t` is the type. @@ -9412,13 +9412,13 @@ TopNamespace.Sub\+Namespace.ContainingClass+NestedClass,MyAssembly The name of a generic type ends with a backtick (\`) followed by digits representing the number of generic type arguments. The purpose of this name mangling is to allow compilers to support generic types with the same name but with different numbers of type parameters, occurring in the same scope. For example, reflection returns the mangled names ``Tuple`1`` and ``Tuple`2`` from the generic methods `Tuple(Of T)` and `Tuple(Of T0, T1)` in Visual Basic, or `Tuple` and `Tuple` in Visual C#. - For generic types, the type argument list is enclosed in brackets, and the type arguments are separated by commas. For example, a generic has two type parameters. A of `MyType` with keys of type might be represented as follows: + For generic types, the type argument list is enclosed in brackets, and the type arguments are separated by commas. For example, a generic has two type parameters. A of `MyType` with keys of type might be represented as follows: ```txt System.Collections.Generic.Dictionary`2[System.String,MyType] ``` - To specify an assembly-qualified type within a type argument list, enclose the assembly-qualified type within brackets. Otherwise, the commas that separate the parts of the assembly-qualified name are interpreted as delimiting additional type arguments. For example, a of `MyType` from MyAssembly.dll, with keys of type , might be specified as follows: + To specify an assembly-qualified type within a type argument list, enclose the assembly-qualified type within brackets. Otherwise, the commas that separate the parts of the assembly-qualified name are interpreted as delimiting additional type arguments. For example, a of `MyType` from MyAssembly.dll, with keys of type , might be specified as follows: ```txt Type.GetType("System.Collections.Generic.Dictionary`2[System.String,[MyType,MyAssembly]]") @@ -9581,13 +9581,13 @@ Note: In .NET for Win method to obtain a object for a type in another assembly if you know its assembly-qualified name, which can be obtained from . causes loading of the assembly specified in `typeName`. You can also load an assembly using the method, and then use the or method to get objects. If a type is in an assembly known to your program at compile time, it's more efficient to use `typeof` in C# or the `GetType` operator in Visual Basic. + You can use the method to obtain a object for a type in another assembly if you know its assembly-qualified name, which can be obtained from . causes loading of the assembly specified in `typeName`. You can also load an assembly using the method, and then use the or method to get objects. If a type is in an assembly known to your program at compile time, it's more efficient to use `typeof` in C# or the `GetType` operator in Visual Basic. - .NET Framework only: only works on assemblies loaded from disk. If you call to look up a type defined in a dynamic assembly defined using the services, you might get inconsistent behavior. The behavior depends on whether the dynamic assembly is persistent, that is, created using the `RunAndSave` or `Save` access modes of the enumeration. If the dynamic assembly is persistent and has been written to disk before `GetType` is called, the loader finds the saved assembly on disk, loads that assembly, and retrieves the type from that assembly. If the assembly has not been saved to disk when `GetType` is called, the method returns `null`. `GetType` does not understand transient dynamic assemblies; therefore, calling `GetType` to retrieve a type in a transient dynamic assembly returns `null`. + .NET Framework only: only works on assemblies loaded from disk. If you call to look up a type defined in a dynamic assembly defined using the services, you might get inconsistent behavior. The behavior depends on whether the dynamic assembly is persistent, that is, created using the `RunAndSave` or `Save` access modes of the enumeration. If the dynamic assembly is persistent and has been written to disk before `GetType` is called, the loader finds the saved assembly on disk, loads that assembly, and retrieves the type from that assembly. If the assembly has not been saved to disk when `GetType` is called, the method returns `null`. `GetType` does not understand transient dynamic assemblies; therefore, calling `GetType` to retrieve a type in a transient dynamic assembly returns `null`. In .NET Framework, to use `GetType` on a dynamic module, subscribe to the event and call `GetType` before saving. Otherwise, you will get two copies of the assembly in memory. - On .NET Core 3.0 and later versions, assembly loads triggered by this API are affected by the current value of . + On .NET Core 3.0 and later versions, assembly loads triggered by this API are affected by the current value of . The `throwOnError` parameter specifies what happens when the type is not found, and also suppresses certain other exception conditions, as described in the Exceptions section. Some exceptions are thrown regardless of the value of `throwOnError`. For example, if the type is found but cannot be loaded, a is thrown even if `throwOnError` is `false`. @@ -9610,14 +9610,14 @@ Note: In .NET for Win Arrays or COM types are not searched for unless they have already been loaded into the table of available classes. - `typeName` can be the type name qualified by its namespace or an assembly-qualified name that includes an assembly name specification. See . + `typeName` can be the type name qualified by its namespace or an assembly-qualified name that includes an assembly name specification. See . If `typeName` includes the namespace but not the assembly name, this method searches only the calling object's assembly and mscorlib.dll/System.Private.CoreLib.dll, in that order. If typeName is fully qualified with the partial or complete assembly name, this method searches in the specified assembly. If the assembly has a strong name, a complete assembly name is required. The property returns a fully qualified type name including nested types, the assembly name, and type arguments. All compilers that support the common language runtime will emit the simple name of a nested class, and reflection constructs a mangled name when queried, in accordance with the following conventions. > [!NOTE] -> Processor architecture is part of assembly identity, and can be specified as part of assembly name strings. For example, "ProcessorArchitecture=msil". However, it's not included in the string returned by the property, for compatibility reasons. You can also load types by creating an object and passing it to an appropriate overload of the method. You can then use the method to load types from the assembly. See also . +> Processor architecture is part of assembly identity, and can be specified as part of assembly name strings. For example, "ProcessorArchitecture=msil". However, it's not included in the string returned by the property, for compatibility reasons. You can also load types by creating an object and passing it to an appropriate overload of the method. You can then use the method to load types from the assembly. See also . |Delimiter|Meaning| |---------------|-------------| @@ -9642,7 +9642,7 @@ TopNamespace.Sub\+Namespace.ContainingClass+NestedClass,MyAssembly A "++" becomes "\\+\\+", and a "\\" becomes "\\\\". - This qualified name can be persisted and later used to load the . To search for and load a , use either with the type name only or with the assembly qualified type name. with the type name only will look for the in the caller's assembly and then in the System assembly. with the assembly qualified type name will look for the in any assembly. + This qualified name can be persisted and later used to load the . To search for and load a , use either with the type name only or with the assembly qualified type name. with the type name only will look for the in the caller's assembly and then in the System assembly. with the assembly qualified type name will look for the in any assembly. Type names may include trailing characters that denote additional information about the type, such as whether the type is a reference type, a pointer type or an array type. To retrieve the type name without these trailing characters, use `t.GetElementType().ToString()`, where `t` is the type. @@ -9650,13 +9650,13 @@ TopNamespace.Sub\+Namespace.ContainingClass+NestedClass,MyAssembly The name of a generic type ends with a backtick (\`) followed by digits representing the number of generic type arguments. The purpose of this name mangling is to allow compilers to support generic types with the same name but with different numbers of type parameters, occurring in the same scope. For example, reflection returns the mangled names ``Tuple`1`` and ``Tuple`2`` from the generic methods `Tuple(Of T)` and `Tuple(Of T0, T1)` in Visual Basic, or `Tuple` and `Tuple` in Visual C#. - For generic types, the type argument list is enclosed in brackets, and the type arguments are separated by commas. For example, a generic has two type parameters. A of `MyType` with keys of type might be represented as follows: + For generic types, the type argument list is enclosed in brackets, and the type arguments are separated by commas. For example, a generic has two type parameters. A of `MyType` with keys of type might be represented as follows: ```txt System.Collections.Generic.Dictionary`2[System.String,MyType] ``` - To specify an assembly-qualified type within a type argument list, enclose the assembly-qualified type within brackets. Otherwise, the commas that separate the parts of the assembly-qualified name are interpreted as delimiting additional type arguments. For example, a of `MyType` from MyAssembly.dll, with keys of type , might be specified as follows: + To specify an assembly-qualified type within a type argument list, enclose the assembly-qualified type within brackets. Otherwise, the commas that separate the parts of the assembly-qualified name are interpreted as delimiting additional type arguments. For example, a of `MyType` from MyAssembly.dll, with keys of type , might be specified as follows: ```txt Type.GetType("System.Collections.Generic.Dictionary`2[System.String,[MyType,MyAssembly]]") @@ -9821,12 +9821,12 @@ Type.GetType("System.Collections.Generic.Dictionary`2[System.String,[MyType,MyAs ## Remarks -Usage scenarios for this method and details about the `assemblyResolver` and `typeResolver` parameters can be found in the method overload. +Usage scenarios for this method and details about the `assemblyResolver` and `typeResolver` parameters can be found in the method overload. > [!NOTE] -> If `typeName` cannot be found, the call to the method returns `null`. It does not throw an exception. To control whether an exception is thrown, call an overload of the method that has a `throwOnError` parameter. +> If `typeName` cannot be found, the call to the method returns `null`. It does not throw an exception. To control whether an exception is thrown, call an overload of the method that has a `throwOnError` parameter. -Calling this method overload is the same as calling the method overload and specifying `false` for the `throwOnError` and `ignoreCase` parameters. +Calling this method overload is the same as calling the method overload and specifying `false` for the `throwOnError` and `ignoreCase` parameters. ]]> @@ -9943,9 +9943,9 @@ Calling this method overload is the same as calling the method overload. + Usage scenarios for this method and details about the `assemblyResolver` and `typeResolver` parameters can be found in the method overload. - Calling this method overload is the same as calling the method overload and specifying `false` for the `ignoreCase` parameter. + Calling this method overload is the same as calling the method overload and specifying `false` for the `ignoreCase` parameter. ]]> @@ -10087,7 +10087,7 @@ Calling this method overload is the same as calling the . + On .NET Core 3.0 and later versions, if `assemblyResolver` is null, then assembly loads triggered by this API are affected by the current value of . For more information about this API, see [Supplemental API remarks for Type.GetType](/dotnet/fundamentals/runtime-libraries/system-type-gettype). ]]> @@ -10191,7 +10191,7 @@ Calling this method overload is the same as calling the method to list the types of the elements of an array. + The following code example demonstrates how to use the method to list the types of the elements of an array. :::code language="csharp" source="~/snippets/csharp/System/Type/GetProperties/type_gettypecode.cs" id="Snippet3"::: :::code language="fsharp" source="~/snippets/fsharp/System/Type/GetProperties/type_gettypecode.fs" id="Snippet3"::: @@ -10257,7 +10257,7 @@ Calling this method overload is the same as calling the , you can change the behavior of this method by overriding the method. + When you inherit from , you can change the behavior of this method by overriding the method. For types, the type code of the underlying integral type is returned. @@ -10316,7 +10316,7 @@ Calling this method overload is the same as calling the method. When you inherit from , you can override this method to provide your own implementation of . + This method provides the implementation for the `static` (in C#) or `Shared` (in Visual Basic) method. When you inherit from , you can override this method to provide your own implementation of . ]]> @@ -10393,25 +10393,25 @@ Calling this method overload is the same as calling the method supports late-bound access to unmanaged COM objects from .NET Framework apps when you know the COM object's class identifier (CLSID). The class identifier for COM classes is defined in the HKEY_CLASSES_ROOT\CLSID key of the registry. You can retrieve the value of the property to determine whether the type returned by this method is a COM object. + The method supports late-bound access to unmanaged COM objects from .NET Framework apps when you know the COM object's class identifier (CLSID). The class identifier for COM classes is defined in the HKEY_CLASSES_ROOT\CLSID key of the registry. You can retrieve the value of the property to determine whether the type returned by this method is a COM object. > [!TIP] -> You can call the method for late-bound access to COM objects whose programmatic identifier (ProgID) you know. +> You can call the method for late-bound access to COM objects whose programmatic identifier (ProgID) you know. Instantiating an unmanaged COM object from its CLSID is a two-step process: -1. Get a object that represents the`__ComObject` that corresponds to the CLSID by calling the method. +1. Get a object that represents the`__ComObject` that corresponds to the CLSID by calling the method. -2. Call the method to instantiate the COM object. +2. Call the method to instantiate the COM object. See the example for an illustration. - The overload ignores any exception that may occur when instantiating a object based on the `clsid` argument. Note that no exception is thrown if `clsid` is not found in the registry. + The overload ignores any exception that may occur when instantiating a object based on the `clsid` argument. Note that no exception is thrown if `clsid` is not found in the registry. ## Examples - The following example uses the CLSID of the Microsoft Word [Application object](/office/vba/api/word.application) to retrieve a COM type that represents the Microsoft Word application. It then instantiates the type by calling the method, and closes it by calling the [Application.Quit](/office/vba/api/word.application.quit(method)) method. + The following example uses the CLSID of the Microsoft Word [Application object](/office/vba/api/word.application) to retrieve a COM type that represents the Microsoft Word application. It then instantiates the type by calling the method, and closes it by calling the [Application.Quit](/office/vba/api/word.application.quit(method)) method. :::code language="csharp" source="~/snippets/csharp/System/Type/GetTypeFromCLSID/gettypefromclsid1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Type/GetTypeFromCLSID/gettypefromclsid1.fs" id="Snippet1"::: @@ -10496,16 +10496,16 @@ Calling this method overload is the same as calling the method supports late-bound access to unmanaged COM objects from .NET Framework apps when you know the COM object's class identifier (CLSID). The class identifier for COM classes is defined in the HKEY_CLASSES_ROOT\CLSID key of the registry. You can retrieve the value of the property to determine whether the type returned by this method is a COM object. + The method supports late-bound access to unmanaged COM objects from .NET Framework apps when you know the COM object's class identifier (CLSID). The class identifier for COM classes is defined in the HKEY_CLASSES_ROOT\CLSID key of the registry. You can retrieve the value of the property to determine whether the type returned by this method is a COM object. > [!TIP] -> You can call the method for late-bound access to COM objects whose programmatic identifier (ProgID) you know. +> You can call the method for late-bound access to COM objects whose programmatic identifier (ProgID) you know. Instantiating an unmanaged COM object from its CLSID is a two-step process: -1. Get a object that represents the `__ComObject` that corresponds to the CLSID by calling the method. +1. Get a object that represents the `__ComObject` that corresponds to the CLSID by calling the method. -2. Call the method to instantiate the COM object. +2. Call the method to instantiate the COM object. See the example for an illustration. @@ -10514,7 +10514,7 @@ Calling this method overload is the same as calling the method, and closes it by calling the [Application.Quit](/office/vba/api/word.application.quit(method)) method. An exception is thrown if an error occurs while loading the type. + The following example uses the CLSID of the Microsoft Word [Application object](/office/vba/api/word.application) to retrieve a COM type that represents the Microsoft Word application. It then instantiates the type by calling the method, and closes it by calling the [Application.Quit](/office/vba/api/word.application.quit(method)) method. An exception is thrown if an error occurs while loading the type. :::code language="csharp" source="~/snippets/csharp/System/Type/GetTypeFromCLSID/gettypefromclsid_ex2.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/Type/GetTypeFromCLSID/gettypefromclsid_ex2.fs" id="Snippet2"::: @@ -10594,21 +10594,21 @@ Calling this method overload is the same as calling the method supports late-bound access to unmanaged COM objects from .NET Framework apps when you know the COM object's class identifier (CLSID). The class identifier for COM classes is defined in the HKEY_CLASSES_ROOT\CLSID key of the registry. You can retrieve the value of the property to determine whether the type returned by this method is a COM object. + The method supports late-bound access to unmanaged COM objects from .NET Framework apps when you know the COM object's class identifier (CLSID). The class identifier for COM classes is defined in the HKEY_CLASSES_ROOT\CLSID key of the registry. You can retrieve the value of the property to determine whether the type returned by this method is a COM object. > [!TIP] -> You can call the method for late-bound access to COM objects whose programmatic identifier (ProgID) you know. +> You can call the method for late-bound access to COM objects whose programmatic identifier (ProgID) you know. Instantiating an unmanaged COM object from its CLSID is a two-step process: -1. Get a object that represents the `__ComObject` that corresponds to the CLSID by calling the method. +1. Get a object that represents the `__ComObject` that corresponds to the CLSID by calling the method. -2. Call the method to instantiate the COM object. +2. Call the method to instantiate the COM object. ## Examples - The following example uses the CLSID of the Microsoft Word [Application object](/office/vba/api/word.application) to retrieve a COM type that represents the Microsoft Word application from a server named computer17.central.contoso.com. It then instantiates the type by calling the method, and closes it by calling the [Application.Quit](/office/vba/api/word.application.quit(method)) method. + The following example uses the CLSID of the Microsoft Word [Application object](/office/vba/api/word.application) to retrieve a COM type that represents the Microsoft Word application from a server named computer17.central.contoso.com. It then instantiates the type by calling the method, and closes it by calling the [Application.Quit](/office/vba/api/word.application.quit(method)) method. :::code language="csharp" source="~/snippets/csharp/System/Type/GetTypeFromCLSID/gettypefromclsid_ex3.cs" id="Snippet3"::: :::code language="fsharp" source="~/snippets/fsharp/System/Type/GetTypeFromCLSID/gettypefromclsid_ex3.fs" id="Snippet3"::: @@ -10695,23 +10695,23 @@ Calling this method overload is the same as calling the method supports late-bound access to unmanaged COM objects from .NET Framework apps when you know the COM object's class identifier (CLSID). The class identifier for COM classes is defined in the HKEY_CLASSES_ROOT\CLSID key of the registry. You can retrieve the value of the property to determine whether the type returned by this method is a COM object. + The method supports late-bound access to unmanaged COM objects from .NET Framework apps when you know the COM object's class identifier (CLSID). The class identifier for COM classes is defined in the HKEY_CLASSES_ROOT\CLSID key of the registry. You can retrieve the value of the property to determine whether the type returned by this method is a COM object. > [!TIP] -> You can call the method for late-bound access to COM objects whose programmatic identifier (ProgID) you know. +> You can call the method for late-bound access to COM objects whose programmatic identifier (ProgID) you know. Instantiating an unmanaged COM object from its CLSID is a two-step process: -1. Get a object that represents the `__ComObject` that corresponds to the CLSID by calling the method. +1. Get a object that represents the `__ComObject` that corresponds to the CLSID by calling the method. -2. Call the method to instantiate the COM object. +2. Call the method to instantiate the COM object. Exceptions such as will be thrown when specifying `true` for `throwOnError`, but it will not fail for unregistered CLSIDs. ## Examples - The following example uses the CLSID of the Microsoft Word [Application object](/office/vba/api/word.application) to retrieve a COM type that represents the Microsoft Word application from a server named computer17.central.contoso.com. It then instantiates the type by calling the method, and closes it by calling the [Application.Quit](/office/vba/api/word.application.quit(method)) method. An exception is thrown if an error occurs while loading the type. + The following example uses the CLSID of the Microsoft Word [Application object](/office/vba/api/word.application) to retrieve a COM type that represents the Microsoft Word application from a server named computer17.central.contoso.com. It then instantiates the type by calling the method, and closes it by calling the [Application.Quit](/office/vba/api/word.application.quit(method)) method. An exception is thrown if an error occurs while loading the type. :::code language="csharp" source="~/snippets/csharp/System/Type/GetTypeFromCLSID/gettypefromclsid_ex4.cs" id="Snippet4"::: :::code language="fsharp" source="~/snippets/fsharp/System/Type/GetTypeFromCLSID/gettypefromclsid_ex4.fs" id="Snippet4"::: @@ -10793,7 +10793,7 @@ Calling this method overload is the same as calling the method to get a object from a provided by the method. + The following example uses the method to get a object from a provided by the method. :::code language="csharp" source="~/snippets/csharp/System/Type/GetTypeFromHandle/type_gettypefromhandle.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Type/GetTypeFromHandle/type_gettypefromhandle.fs" id="Snippet1"::: @@ -11535,7 +11535,7 @@ Calling this method overload is the same as calling the [!NOTE] -> You cannot use to invoke a generic method. +> You cannot use to invoke a generic method. The following filter flags can be used to define which members to include in the search: @@ -11575,7 +11575,7 @@ Calling this method overload is the same as calling the values `InvokeMethod`, `GetProperty`, and so on). The set of methods is filtered by the name, number of arguments, and a set of search modifiers defined in the binder. - After the method is selected, it's invoked. Accessibility is checked at that point. The search may control which set of methods are searched based upon the accessibility attribute associated with the method. The method of the class is responsible for selecting the method to be invoked. The default binder selects the most specific match. + After the method is selected, it's invoked. Accessibility is checked at that point. The search may control which set of methods are searched based upon the accessibility attribute associated with the method. The method of the class is responsible for selecting the method to be invoked. The default binder selects the most specific match. Access restrictions are ignored for fully trusted code; that is, private constructors, methods, fields, and properties can be accessed and invoked through whenever the code is fully trusted. @@ -11770,7 +11770,7 @@ Calling this method overload is the same as calling the (the `culture` parameter), you can use the abstract class to write a custom binder that does process `culture`. > [!NOTE] -> You cannot use to invoke a generic method. +> You cannot use to invoke a generic method. The following filter flags can be used to define which members to include in the search: @@ -11810,7 +11810,7 @@ Calling this method overload is the same as calling the values `InvokeMethod`, `GetProperty`, and so on). The set of methods is filtered by the name, number of arguments, and a set of search modifiers defined in the binder. - After the method is selected, it's invoked. Accessibility is checked at that point. The search may control which set of methods are searched based upon the accessibility attribute associated with the method. The method of the class is responsible for selecting the method to be invoked. The default binder selects the most specific match. + After the method is selected, it's invoked. Accessibility is checked at that point. The search may control which set of methods are searched based upon the accessibility attribute associated with the method. The method of the class is responsible for selecting the method to be invoked. The default binder selects the most specific match. Access restrictions are ignored for fully trusted code; that is, private constructors, methods, fields, and properties can be accessed and invoked through Reflection whenever the code is fully trusted. @@ -12004,7 +12004,7 @@ Calling this method overload is the same as calling the [!NOTE] -> You cannot use to invoke a generic method. +> You cannot use to invoke a generic method. When you invoke an `IDispatch` member you can specify the DispID instead of the member name, using the string format "[DispID=##]". For example, if the DispID of MyComMethod is 3, you can specify the string "[DispID=3]" instead of "MyComMethod". Invoking a member by DispID is faster than looking up the member by name. In complex aggregation scenarios, the DispID is sometimes the only way to invoke the desired member. @@ -12052,7 +12052,7 @@ Calling this method overload is the same as calling the values `InvokeMethod`, `GetProperty`, and so on). The set of methods is filtered by the name, number of arguments, and a set of search modifiers defined in the binder. - After the method is selected, it's invoked. Accessibility is checked at that point. The search may control which set of methods are searched based upon the accessibility attribute associated with the method. The method of the class is responsible for selecting the method to be invoked. The default binder selects the most specific match. + After the method is selected, it's invoked. Accessibility is checked at that point. The search may control which set of methods are searched based upon the accessibility attribute associated with the method. The method of the class is responsible for selecting the method to be invoked. The default binder selects the most specific match. `InvokeMember` can be used to invoke methods with parameters that have default values. To bind to these methods, Reflection requires to be specified. For a parameter that has a default value, you can either supply a different value, or supply to use the default value. @@ -12359,7 +12359,7 @@ Calling this method overload is the same as calling the property returns `false` for the class. It also returns `false` if the current instance is a object that represents a collection type or an interface designed to work with collections, such as or . + The property returns `false` for the class. It also returns `false` if the current instance is a object that represents a collection type or an interface designed to work with collections, such as or . To check for an array, use code such as: @@ -12527,7 +12527,7 @@ GetType(Array).IsAssignableFrom(type) method can be used to determine whether an instance of `c` can be assigned to an instance of the current type, The method is most useful when you are handling objects whose types are not known at design time and allows for conditional assignment, as the following example shows. + The method can be used to determine whether an instance of `c` can be assigned to an instance of the current type, The method is most useful when you are handling objects whose types are not known at design time and allows for conditional assignment, as the following example shows. :::code language="csharp" source="~/snippets/csharp/System/Type/IsAssignableFrom/IsAssignableFrom3.cs" id="Snippet3"::: :::code language="fsharp" source="~/snippets/fsharp/System/Type/IsAssignableFrom/IsAssignableFrom3.fs" id="Snippet3"::: @@ -12739,7 +12739,7 @@ GetType(Array).IsAssignableFrom(type) For dynamic types, you can specify when you create the type. In code, apply the attribute with the enumeration value to the type, to let the runtime determine the appropriate way to lay out the class. > [!NOTE] -> You cannot use the method to determine whether the has been applied to a type. +> You cannot use the method to determine whether the has been applied to a type. If the current represents a constructed generic type, this property applies to the generic type definition from which the type was constructed. For example, if the current represents `MyGenericType` (`MyGenericType(Of Integer)` in Visual Basic), the value of this property is determined by `MyGenericType.` @@ -12816,7 +12816,7 @@ GetType(Array).IsAssignableFrom(type) on that type. + To get to the actual type, dereference the type that was passed by reference, and then call on that type. @@ -12973,7 +12973,7 @@ Byref-like structures are declared using `ref struct` keyword in C#. An instance If the current represents a type parameter in the definition of a generic type or generic method, this property always returns `true`. If the current represents a constructed generic type, this property returns `true` if the generic type definition is a class definition; that is, it does not define an interface or a value type. > [!NOTE] -> This property returns `true` for `Type` instances that represent the and classes. These two classes are the base types for enumerations and value types, respectively, but they are not enumerations or value types themselves. For more information, see the and properties. +> This property returns `true` for `Type` instances that represent the and classes. These two classes are the base types for enumerations and value types, respectively, but they are not enumerations or value types themselves. For more information, see the and properties. The enumeration value distinguishes a type declaration as class or interface. However, both classes and value types are marked with the attribute. If you retrieve the value of a type's Attributes property and use the value to determine whether a type is a class instead of a value type, you must also call the property. The example for the enumeration contains additional information as well as anexample. @@ -13219,7 +13219,7 @@ Byref-like structures are declared using `ref struct` keyword in C#. An instance ## Examples - The following example demonstrates the `IsContextful`, , and properties of the class. It checks whether the given type can be hosted in the context, whether it can be marshaled by reference, and whether the type is a primitive data type. + The following example demonstrates the `IsContextful`, , and properties of the class. It checks whether the given type can be hosted in the context, whether it can be marshaled by reference, and whether the type is a primitive data type. :::code language="csharp" source="~/snippets/csharp/System/Type/IsContextful/type_iscontextful.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Type/IsContextful/type_iscontextful.fs" id="Snippet1"::: @@ -13477,7 +13477,7 @@ Byref-like structures are declared using `ref struct` keyword in C#. An instance ## Remarks Beginning with the .NET Framework 4, the common language runtime supports the embedding of type information for COM types directly into managed assemblies, instead of requiring the managed assemblies to obtain type information for COM types from interop assemblies. Because the embedded type information includes only the types and members that are actually used by a managed assembly, two managed assemblies might have very different views of the same COM type. Each managed assembly has a different object to represent its view of the COM type. The common language runtime supports type equivalence between these different views for interfaces, structures, enumerations, and delegates. - Type equivalence means that a COM object that is passed from one managed assembly to another can be cast to the appropriate managed type in the receiving assembly. The method enables an assembly to determine that a COM object obtained from another assembly has the same COM identity as one of the first assembly's own embedded interop types, and thus can be cast to that type. + Type equivalence means that a COM object that is passed from one managed assembly to another can be cast to the appropriate managed type in the receiving assembly. The method enables an assembly to determine that a COM object obtained from another assembly has the same COM identity as one of the first assembly's own embedded interop types, and thus can be cast to that type. For more information, see [Type Equivalence and Embedded Interop Types](/dotnet/framework/interop/type-equivalence-and-embedded-interop-types). @@ -13537,7 +13537,7 @@ Byref-like structures are declared using `ref struct` keyword in C#. An instance For dynamic types, you can specify when you create the type. In code, apply the attribute with the enumeration value to the type, to specify that the offsets at which the fields start are specified explicitly. > [!NOTE] -> You cannot use the method to determine whether the has been applied to a type. +> You cannot use the method to determine whether the has been applied to a type. If the current represents a constructed generic type, this property applies to the generic type definition from which the type was constructed. For example, if the current represents `MyGenericType` (`MyGenericType(Of Integer)` in Visual Basic), the value of this property is determined by `MyGenericType`. @@ -13679,13 +13679,13 @@ Byref-like structures are declared using `ref struct` keyword in C#. An instance objects that represent generic type parameters can be obtained by calling the method of a object that represents a generic type definition, or the method of a object that represents a generic method definition. + objects that represent generic type parameters can be obtained by calling the method of a object that represents a generic type definition, or the method of a object that represents a generic method definition. - For a generic type or method definition, the property returns `true` for every element of the resulting array. -- For a closed constructed type or method, the property returns `false` for every element of the array returned by the method. +- For a closed constructed type or method, the property returns `false` for every element of the array returned by the method. -- For an open constructed type or method, some elements of the array might be specific types and others might be type parameters. returns `false` for the types and `true` for the type parameters. The code example for the property demonstrates a generic class with a mixture of types and type parameters. +- For an open constructed type or method, some elements of the array might be specific types and others might be type parameters. returns `false` for the types and `true` for the type parameters. The code example for the property demonstrates a generic class with a mixture of types and type parameters. For a list of the invariant conditions for terms used in generic reflection, see the property remarks. @@ -13760,12 +13760,12 @@ Byref-like structures are declared using `ref struct` keyword in C#. An instance |Term|Invariant| |----------|---------------| -|generic type definition|The property is `true`.

Defines a generic type. A constructed type is created by calling the method on a object that represents a generic type definition and specifying an array of type arguments.

can be called only on generic type definitions.

Any generic type definition is a generic type (the property is `true`), but the converse is not true.| +|generic type definition|The property is `true`.

Defines a generic type. A constructed type is created by calling the method on a object that represents a generic type definition and specifying an array of type arguments.

can be called only on generic type definitions.

Any generic type definition is a generic type (the property is `true`), but the converse is not true.| |generic type|The property is `true`.

Can be a generic type definition, an open constructed type, or a closed constructed type.

Note that an array type whose element type is generic is not itself a generic type. The same is true of a object representing a pointer to a generic type.| |open constructed type|The property is `true`.

Examples are a generic type that has unassigned type parameters, a type that is nested in a generic type definition or in an open constructed type, or a generic type that has a type argument for which the property is `true`.

it's not possible to create an instance of an open constructed type.

Note that not all open constructed types are generic. For example, an array whose element type is a generic type definition is not generic, and a pointer to an open constructed type is not generic.| |closed constructed type|The property is `false`.

When examined recursively, the type has no unassigned generic parameters.| |generic type parameter|The property is `true`.

The property is `true`.

In a generic type definition, a placeholder for a type that will be assigned later.| -|generic type argument|Can be any type, including a generic type parameter.

Type arguments are specified as an array of objects passed to the method when creating a constructed generic type. If instances of the resulting type are to be created, the property must be `false` for all the type arguments.| +|generic type argument|Can be any type, including a generic type parameter.

Type arguments are specified as an array of objects passed to the method when creating a constructed generic type. If instances of the resulting type are to be created, the property must be `false` for all the type arguments.| The following code example and table illustrate some of these terms and invariants. The `Derived` class is of particular interest because its base type is a constructed type that has a mixture of types and type parameters in its type argument list. @@ -13777,17 +13777,17 @@ Byref-like structures are declared using `ref struct` keyword in C#. An instance |Example|Invariants| |-------------|----------------| -|`Derived(Of V)`

`Derived`|For this type:

is `true`.

is `true`.

is `true`.| -|`Base(Of String, V)`

`Base`

`Base`|For this type:

is `true`.

is `false`.

is `true`.| -|`Dim d() As Derived(Of Integer)`

`Derived[] d;`

`array^>^ d;`|For the type of variable `d`:

is `false` because `d` is an array.

is `false`.

is `false`.| -|`T`, `U`, and `V` (everywhere they appear)| is `true`.

is `false` because there is no way to constrain a type parameter to generic types.

is `false`.

is `true` because `T`, `U`, and `V` are themselves generic type parameters. This does not imply anything about type arguments that are assigned to them later.| -|The type of field `F`| is `true`.

is `false` because a type has been assigned to the type parameter of `G`. Note that this is equivalent to having called the method.

is `true` because the type of field `F` has a type argument that is an open constructed type. The constructed type is open because its type argument (that is, `Base`) is a generic type definition. This illustrates the recursive nature of the property.| -|The nested class `Nested`| is `true`, even though the `Nested` class has no generic type parameters of its own, because it's nested in a generic type.

is `true`. That is, you can call the method and supply the type parameter of the enclosing type, `Derived`.

is `true` because the enclosing type, `Derived`, has generic type parameters. This illustrates the recursive nature of the property.| +|`Derived(Of V)`

`Derived`|For this type:

is `true`.

is `true`.

is `true`.| +|`Base(Of String, V)`

`Base`

`Base`|For this type:

is `true`.

is `false`.

is `true`.| +|`Dim d() As Derived(Of Integer)`

`Derived[] d;`

`array^>^ d;`|For the type of variable `d`:

is `false` because `d` is an array.

is `false`.

is `false`.| +|`T`, `U`, and `V` (everywhere they appear)| is `true`.

is `false` because there is no way to constrain a type parameter to generic types.

is `false`.

is `true` because `T`, `U`, and `V` are themselves generic type parameters. This does not imply anything about type arguments that are assigned to them later.| +|The type of field `F`| is `true`.

is `false` because a type has been assigned to the type parameter of `G`. Note that this is equivalent to having called the method.

is `true` because the type of field `F` has a type argument that is an open constructed type. The constructed type is open because its type argument (that is, `Base`) is a generic type definition. This illustrates the recursive nature of the property.| +|The nested class `Nested`| is `true`, even though the `Nested` class has no generic type parameters of its own, because it's nested in a generic type.

is `true`. That is, you can call the method and supply the type parameter of the enclosing type, `Derived`.

is `true` because the enclosing type, `Derived`, has generic type parameters. This illustrates the recursive nature of the property.| ## Examples - The following code example displays the value of the , , , and properties for the types described in the Remarks section. For explanations of the property values, see the accompanying table in Remarks. + The following code example displays the value of the , , , and properties for the types described in the Remarks section. For explanations of the property values, see the accompanying table in Remarks. :::code language="csharp" source="~/snippets/csharp/System/Type/IsGenericType/source.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Type/IsGenericType/source.fs" id="Snippet1"::: @@ -13844,9 +13844,9 @@ Byref-like structures are declared using `ref struct` keyword in C#. An instance `, you can construct and instantiate the type `G` (`G(Of Integer)` in Visual Basic), by calling the method with a generic argument list containing the type. Given a object representing this constructed type, the method gets the generic type definition back again. + A generic type definition is a template from which other types can be constructed. For example, from the C# generic type definition `G`, you can construct and instantiate the type `G` (`G(Of Integer)` in Visual Basic), by calling the method with a generic argument list containing the type. Given a object representing this constructed type, the method gets the generic type definition back again. - Use the property to determine whether you can create new types from the current type. If the property returns `true`, you can call the method to create new generic types. + Use the property to determine whether you can create new types from the current type. If the property returns `true`, you can call the method to create new generic types. For a list of the invariant conditions for terms used in generic reflection, see the property remarks. @@ -14170,7 +14170,7 @@ Byref-like structures are declared using `ref struct` keyword in C#. An instance For dynamic types, you can specify when you create the type. In code, apply the attribute with the enumeration value to the type, to specify that layout is sequential. > [!NOTE] -> You cannot use the method to determine whether the has been applied to a type. +> You cannot use the method to determine whether the has been applied to a type. For more information, see section 9.1.2 of the specification for the [Common Language Infrastructure (CLI) documentation](https://www.ecma-international.org/publications-and-standards/standards/ecma-335/), "Partition II: Metadata Definition and Semantics". @@ -14240,7 +14240,7 @@ Byref-like structures are declared using `ref struct` keyword in C#. An instance , `IsMarshalByRef`, and properties of the class. It checks whether the given type can be hosted in the context, whether it can be marshaled by reference, and whether the type is a primitive data type. + The following example demonstrates the , `IsMarshalByRef`, and properties of the class. It checks whether the given type can be hosted in the context, whether it can be marshaled by reference, and whether the type is a primitive data type. :::code language="csharp" source="~/snippets/csharp/System/Type/IsContextful/type_iscontextful.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Type/IsContextful/type_iscontextful.fs" id="Snippet1"::: @@ -14365,7 +14365,7 @@ Byref-like structures are declared using `ref struct` keyword in C#. An instance property returns `true` for all nested types, regardless of visibility. To test for nesting and visibility at the same time, use the related properties , , , , , or . + The property returns `true` for all nested types, regardless of visibility. To test for nesting and visibility at the same time, use the related properties , , , , , or . > [!NOTE] > The enumeration member selects the visibility attributes for a type. @@ -15039,7 +15039,7 @@ Byref-like structures are declared using `ref struct` keyword in C#. An instance ## Examples - The following example demonstrates the , , and `IsPrimitive` properties of the class. It checks whether the given type can be hosted in the context, whether it can be marshaled by reference, and whether the type is a primitive data type. + The following example demonstrates the , , and `IsPrimitive` properties of the class. It checks whether the given type can be hosted in the context, whether it can be marshaled by reference, and whether the type is a primitive data type. :::code language="csharp" source="~/snippets/csharp/System/Type/IsContextful/type_iscontextful.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Type/IsContextful/type_iscontextful.fs" id="Snippet1"::: @@ -15188,7 +15188,7 @@ Byref-like structures are declared using `ref struct` keyword in C#. An instance instead. + Do not use with nested types; use instead. If the current represents a type parameter of a generic type, this property returns `true`. @@ -15203,7 +15203,7 @@ Byref-like structures are declared using `ref struct` keyword in C#. An instance :::code language="fsharp" source="~/snippets/fsharp/System/Type/IsPublic/type_ispublic.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/Type/IsPublic/type_ispublic.vb" id="Snippet1"::: - For nested classes, ignore the results of `IsPublic` and `IsNotPublic` and pay attention only to the results of and . + For nested classes, ignore the results of `IsPublic` and `IsNotPublic` and pay attention only to the results of and . ]]> @@ -15315,7 +15315,7 @@ Byref-like structures are declared using `ref struct` keyword in C#. An instance , , and properties report the transparency level of the type at its current trust level, as determined by the common language runtime (CLR). The combinations of these properties are shown in the following table: + The , , and properties report the transparency level of the type at its current trust level, as determined by the common language runtime (CLR). The combinations of these properties are shown in the following table: |Security level|IsSecurityCritical|IsSecuritySafeCritical|IsSecurityTransparent| |--------------------|------------------------|----------------------------|---------------------------| @@ -15326,7 +15326,7 @@ Byref-like structures are declared using `ref struct` keyword in C#. An instance Using these properties is much simpler than examining the security annotations of an assembly and its types, checking the current trust level, and attempting to duplicate the runtime's rules. > [!IMPORTANT] -> For partial-trust assemblies, the value of this property depends on the current trust level of the assembly. If the assembly is loaded into a partially trusted application domain (for example, into a sandboxed application domain), then the runtime ignores the security annotations of the assembly. The assembly and all its types are treated as transparent. The runtime pays attention to the security annotations of a partial-trust assembly only when that assembly is loaded into a fully trusted application domain (for example, into the default application domain of a desktop application). By contrast, a trusted assembly (that is, a strong-named assembly that is installed in the global assembly cache) is always loaded with full trust regardless of the trust level of the application domain, so its current trust level is always fully trusted. You can determine the current trust levels of assemblies and application domains by using the and properties. +> For partial-trust assemblies, the value of this property depends on the current trust level of the assembly. If the assembly is loaded into a partially trusted application domain (for example, into a sandboxed application domain), then the runtime ignores the security annotations of the assembly. The assembly and all its types are treated as transparent. The runtime pays attention to the security annotations of a partial-trust assembly only when that assembly is loaded into a fully trusted application domain (for example, into the default application domain of a desktop application). By contrast, a trusted assembly (that is, a strong-named assembly that is installed in the global assembly cache) is always loaded with full trust regardless of the trust level of the application domain, so its current trust level is always fully trusted. You can determine the current trust levels of assemblies and application domains by using the and properties. For more information about reflection and transparency, see [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection). For information about transparency, see [Security Changes](/dotnet/framework/security/security-changes). @@ -15380,7 +15380,7 @@ Byref-like structures are declared using `ref struct` keyword in C#. An instance , , and properties report the transparency level of the type at its current trust level, as determined by the common language runtime (CLR). The combinations of these properties are shown in the following table: + The , , and properties report the transparency level of the type at its current trust level, as determined by the common language runtime (CLR). The combinations of these properties are shown in the following table: |Security level|IsSecurityCritical|IsSecuritySafeCritical|IsSecurityTransparent| |--------------------|------------------------|----------------------------|---------------------------| @@ -15391,7 +15391,7 @@ Byref-like structures are declared using `ref struct` keyword in C#. An instance Using these properties is much simpler than examining the security annotations of an assembly and its types, checking the current trust level, and attempting to duplicate the runtime's rules. > [!IMPORTANT] -> For partial-trust assemblies, the value of this property depends on the current trust level of the assembly. If the assembly is loaded into a partially trusted application domain (for example, into a sandboxed application domain), then the runtime ignores the security annotations of the assembly. The assembly and all its types are treated as transparent. The runtime pays attention to the security annotations of a partial-trust assembly only when that assembly is loaded into a fully trusted application domain (for example, into the default application domain of a desktop application). By contrast, a trusted assembly (that is, a strong-named assembly that is installed in the global assembly cache) is always loaded with full trust regardless of the trust level of the application domain, so its current trust level is always fully trusted. You can determine the current trust levels of assemblies and application domains by using the and properties. +> For partial-trust assemblies, the value of this property depends on the current trust level of the assembly. If the assembly is loaded into a partially trusted application domain (for example, into a sandboxed application domain), then the runtime ignores the security annotations of the assembly. The assembly and all its types are treated as transparent. The runtime pays attention to the security annotations of a partial-trust assembly only when that assembly is loaded into a fully trusted application domain (for example, into the default application domain of a desktop application). By contrast, a trusted assembly (that is, a strong-named assembly that is installed in the global assembly cache) is always loaded with full trust regardless of the trust level of the application domain, so its current trust level is always fully trusted. You can determine the current trust levels of assemblies and application domains by using the and properties. For more information about reflection and transparency, see [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection). For information about transparency, see [Security Changes](/dotnet/framework/security/security-changes). @@ -15445,12 +15445,12 @@ Byref-like structures are declared using `ref struct` keyword in C#. An instance and properties return `false`. + If this property returns `true`, the and properties return `false`. - The , , and properties report the transparency level of the type at its current trust level, as determined by the common language runtime (CLR). Using these properties is much simpler than examining the security annotations of an assembly and its types, checking the current trust level, and attempting to duplicate the runtime's rules. + The , , and properties report the transparency level of the type at its current trust level, as determined by the common language runtime (CLR). Using these properties is much simpler than examining the security annotations of an assembly and its types, checking the current trust level, and attempting to duplicate the runtime's rules. > [!IMPORTANT] -> For partial-trust assemblies, the value of this property depends on the current trust level of the assembly. If the assembly is loaded into a partially trusted application domain (for example, into a sandboxed application domain), then the runtime ignores the security annotations of the assembly. The assembly and all its types are treated as transparent. The runtime pays attention to the security annotations of a partial-trust assembly only when that assembly is loaded into a fully trusted application domain (for example, into the default application domain of a desktop application). By contrast, a trusted assembly (that is, a strong-named assembly that is installed in the global assembly cache) is always loaded with full trust regardless of the trust level of the application domain, so its current trust level is always fully trusted. You can determine the current trust levels of assemblies and application domains by using the and properties. +> For partial-trust assemblies, the value of this property depends on the current trust level of the assembly. If the assembly is loaded into a partially trusted application domain (for example, into a sandboxed application domain), then the runtime ignores the security annotations of the assembly. The assembly and all its types are treated as transparent. The runtime pays attention to the security annotations of a partial-trust assembly only when that assembly is loaded into a fully trusted application domain (for example, into the default application domain of a desktop application). By contrast, a trusted assembly (that is, a strong-named assembly that is installed in the global assembly cache) is always loaded with full trust regardless of the trust level of the application domain, so its current trust level is always fully trusted. You can determine the current trust levels of assemblies and application domains by using the and properties. For more information about reflection and transparency, see [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection). For information about transparency, see [Security Changes](/dotnet/framework/security/security-changes). @@ -15577,7 +15577,7 @@ Types that are defined in the .NET Standard are not marked with method but does not support most of the other reflection functionality. For example, you can obtain the signature type instance corresponding to the generic method parameter by calling the method. +A signature type is a restricted type that can be passed to the method but does not support most of the other reflection functionality. For example, you can obtain the signature type instance corresponding to the generic method parameter by calling the method. ]]> @@ -15698,17 +15698,17 @@ A signature type is a restricted type that can be passed to the method to determine any of the following: + You can call the method to determine any of the following: - Whether one class derives from another. -- Whether a type derives from . However, the is a more efficient way to determine whether a type is a value type. +- Whether a type derives from . However, the is a more efficient way to determine whether a type is a value type. -- Whether a type derives from . However, the method is a more efficient way to determine whether a type is an enumeration. +- Whether a type derives from . However, the method is a more efficient way to determine whether a type is an enumeration. - Whether a type is a delegate, that is, whether it derives from either or . - The method cannot be used to determine whether an interface derives from another interface, or whether a class implements an interface. Use the method for that purpose, as the following example shows. + The method cannot be used to determine whether an interface derives from another interface, or whether a class implements an interface. Use the method for that purpose, as the following example shows. :::code language="csharp" source="~/snippets/csharp/System/Type/IsSubclassOf/issubclassof_interface1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Type/IsSubclassOf/issubclassof_interface1.fs" id="Snippet1"::: @@ -15717,14 +15717,14 @@ A signature type is a restricted type that can be passed to the represents a type parameter in the definition of a generic type or generic method, it derives from its class constraint or from if it has no class constraint. > [!NOTE] -> Except when used with interfaces, is the converse of . That is, if `t1.IsSubclassOf(t2)` is `true`, then `t2.IsAssignableFrom(t1)` is also `true`. +> Except when used with interfaces, is the converse of . That is, if `t1.IsSubclassOf(t2)` is `true`, then `t2.IsAssignableFrom(t1)` is also `true`. This method can be overridden by a derived class. ## Examples - The following example creates a class named `Class1` and a derived class named `DerivedC1`. It calls the method to show that `DerivedC1` is a subclass of `Class1`. + The following example creates a class named `Class1` and a derived class named `DerivedC1`. It calls the method to show that `DerivedC1` is a subclass of `Class1`. :::code language="csharp" source="~/snippets/csharp/System/Type/IsSubclassOf/testissubclassof.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Type/IsSubclassOf/testissubclassof.fs" id="Snippet1"::: @@ -15962,7 +15962,7 @@ A signature type is a restricted type that can be passed to the class, because is not a value type itself. it's the base class for all value types, and therefore any value type can be assigned to it. This would not be possible if itself was a value type. Value types are boxed when they are assigned to a field of type . - This property returns `true` for enumerations, but not for the type itself. For an example that demonstrates this behavior, see . + This property returns `true` for enumerations, but not for the type itself. For an example that demonstrates this behavior, see . This property is read-only. @@ -16237,9 +16237,9 @@ If the value of this property is `true` for an array type, it can be used to cre method provides a way to generate array types whose element types are computed at run time. + The method provides a way to generate array types whose element types are computed at run time. - **Note** The common language runtime makes a distinction between vectors (that is, one-dimensional arrays that are always zero-based) and multidimensional arrays. A vector, which always has only one dimension, is not the same as a multidimensional array that happens to have only one dimension. This method overload can only be used to create vector types, and it's the only way to create a vector type. Use the method overload to create multidimensional array types. + **Note** The common language runtime makes a distinction between vectors (that is, one-dimensional arrays that are always zero-based) and multidimensional arrays. A vector, which always has only one dimension, is not the same as a multidimensional array that happens to have only one dimension. This method overload can only be used to create vector types, and it's the only way to create a vector type. Use the method overload to create multidimensional array types. ]]> @@ -16313,7 +16313,7 @@ If the value of this property is `true` for an array type, it can be used to cre method provides a way to generate array types whose element types are computed at run time. + The method provides a way to generate array types whose element types are computed at run time. > [!NOTE] > The common language runtime makes a distinction between vectors (that is, one-dimensional arrays that are always zero-based) and multidimensional arrays. A vector, which always has only one dimension, is not the same as a multidimensional array that happens to have only one dimension. You cannot use this method overload to create a vector type; if `rank` is 1, this method overload returns a multidimensional array type that happens to have one dimension. Use the method overload to create vector types. @@ -16387,7 +16387,7 @@ If the value of this property is `true` for an array type, it can be used to cre method provides a way to generate `ref` types (`ByRef` in Visual Basic) for parameter lists. + The method provides a way to generate `ref` types (`ByRef` in Visual Basic) for parameter lists. Using the syntax of Microsoft intermediate language (MSIL), if the current object represents , this method returns a object representing `Int32&`. @@ -16572,7 +16572,7 @@ If the value of this property is `true` for an array type, it can be used to cre For more information about this API, see Supplemental API remarks for Type.MakeGenericType. method to create a constructed type from the generic type definition for the type. The constructed type represents a of `Test` objects with string keys. +The following example uses the method to create a constructed type from the generic type definition for the type. The constructed type represents a of `Test` objects with string keys. :::code language="csharp" source="~/snippets/csharp/System/Type/MakeGenericType/source.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Type/MakeGenericType/source.fs" id="Snippet1"::: @@ -16653,7 +16653,7 @@ The following example uses the method to c method provides a way to generate pointer types for parameter lists. + The method provides a way to generate pointer types for parameter lists. Using the syntax of Microsoft intermediate language (MSIL), if the current object represents , this method returns a object representing `Int32*`. @@ -16724,7 +16724,7 @@ The following example uses the method to c . Therefore, when you examine a set of objects - for example, the array returned by - the property returns when a given member is a nested type. + This property overrides . Therefore, when you examine a set of objects - for example, the array returned by - the property returns when a given member is a nested type. If the current represents a constructed generic type, this property applies to the generic type definition from which the type was constructed. For example, if the current represents `MyGenericType` (`MyGenericType(Of Integer)` in Visual Basic), the value of this property is determined by `MyGenericType`. @@ -16867,7 +16867,7 @@ The following example uses the method to c ## Examples - This following example demonstrates a use of the and `Module` properties and the method of . + This following example demonstrates a use of the and `Module` properties and the method of . :::code language="csharp" source="~/snippets/csharp/System/Type/Module/type_tostring.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Type/Module/type_tostring.fs" id="Snippet1"::: @@ -16969,12 +16969,12 @@ The following example uses the method to c If the current represents a constructed generic type, this property returns the namespace that contains the generic type definition. Similarly, if the current represents a generic parameter `T`, this property returns the namespace that contains the generic type definition that defines `T`. - If the current object represents a generic parameter and a generic type definition is not available, such as for a signature type returned by , this property returns `null`. + If the current object represents a generic parameter and a generic type definition is not available, such as for a signature type returned by , this property returns `null`. ## Examples - This following example demonstrates a use of the `Namespace` and properties and the method of . + This following example demonstrates a use of the `Namespace` and properties and the method of . :::code language="csharp" source="~/snippets/csharp/System/Type/Module/type_tostring.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Type/Module/type_tostring.fs" id="Snippet1"::: @@ -17231,7 +17231,7 @@ The following example uses the method to c method is equivalent to first loading the assembly for reflection only, using the method, and then loading the type by calling the assembly's method. For information about assembly-qualified names, see the property. For additional details on specifying type names, see the method overload. + If the assembly containing the type is not already loaded into the reflection-only context, using the method is equivalent to first loading the assembly for reflection only, using the method, and then loading the type by calling the assembly's method. For information about assembly-qualified names, see the property. For additional details on specifying type names, see the method overload. If the assembly is already loaded for execution, another copy is loaded into the reflection-only context. @@ -17344,7 +17344,7 @@ The following example uses the method to c is not returned by the method. Instead, use this property to get it. + is not returned by the method. Instead, use this property to get it. @@ -17617,13 +17617,13 @@ The following example uses the method to c ## Examples - This following example demonstrates a use of the and properties and the `ToString` method of . + This following example demonstrates a use of the and properties and the `ToString` method of . :::code language="csharp" source="~/snippets/csharp/System/Type/Module/type_tostring.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Type/Module/type_tostring.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/Type/Module/type_tostring.vb" id="Snippet1"::: - The following example compares the strings returned by the `ToString` method and the , , and properties. + The following example compares the strings returned by the `ToString` method and the , , and properties. :::code language="csharp" source="~/snippets/csharp/System/Type/AssemblyQualifiedName/fullname1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Type/AssemblyQualifiedName/fullname1.fs" id="Snippet1"::: @@ -17767,7 +17767,7 @@ The following example uses the method to c method, or through overloads of the , , , and methods that take as a parameter. + Class initializers are also available through the method, or through overloads of the , , , and methods that take as a parameter. If the current represents a type parameter in the definition of a generic type or generic method, this property returns `null`. diff --git a/xml/System/TypeAccessException.xml b/xml/System/TypeAccessException.xml index 9419e32bb24..991f48045cf 100644 --- a/xml/System/TypeAccessException.xml +++ b/xml/System/TypeAccessException.xml @@ -133,8 +133,8 @@ |Property|Value| |--------------|-----------| -||A null reference (`Nothing` in Visual Basic).| -||The localized error message string.| +||A null reference (`Nothing` in Visual Basic).| +||The localized error message string.| ]]> @@ -191,8 +191,8 @@ |Property|Value| |--------------|-----------| -||A null reference (`Nothing` in Visual Basic).| -||The error message string specified in `message`.| +||A null reference (`Nothing` in Visual Basic).| +||The error message string specified in `message`.| ]]> @@ -313,8 +313,8 @@ |Property|Value| |--------------|-----------| -||A null reference (`Nothing` in Visual Basic).| -||The error message string specified in `message`.| +||A null reference (`Nothing` in Visual Basic).| +||The error message string specified in `message`.| ]]> diff --git a/xml/System/TypeCode.xml b/xml/System/TypeCode.xml index 96d7a569fd3..78c5740d395 100644 --- a/xml/System/TypeCode.xml +++ b/xml/System/TypeCode.xml @@ -62,15 +62,15 @@ method on classes that implement the interface to obtain the type code for an instance of that class. + Call the method on classes that implement the interface to obtain the type code for an instance of that class. - Otherwise, call an object's method to obtain its object, then call the `Type` object's method to obtain the object's type code. + Otherwise, call an object's method to obtain its object, then call the `Type` object's method to obtain the object's type code. ## Examples The following code example demonstrates how the enumeration can be used. In a decision block inside the WriteObjectInfo method, the of an parameter is examined, and an appropriate message is written to the console. - + :::code language="csharp" source="~/snippets/csharp/System/Type/GetTypeCode/iconvertible.cs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System/Type/GetTypeCode/iconvertible.vb" id="Snippet2"::: diff --git a/xml/System/TypeInitializationException.xml b/xml/System/TypeInitializationException.xml index dd3a92631d0..43c89287402 100644 --- a/xml/System/TypeInitializationException.xml +++ b/xml/System/TypeInitializationException.xml @@ -132,9 +132,9 @@ |Property|Value| |--------------|-----------| -||The inner exception reference.| -||The localized error message string.| -||The name of the type.| +||The inner exception reference.| +||The localized error message string.| +||The name of the type.| ]]> diff --git a/xml/System/TypeLoadException.xml b/xml/System/TypeLoadException.xml index a1e95628c57..b5fbc85b493 100644 --- a/xml/System/TypeLoadException.xml +++ b/xml/System/TypeLoadException.xml @@ -85,7 +85,7 @@ uses the HRESULT COR_E_TYPELOAD, which has the value 0x80131522. - For a list of initial property values for an instance of , see the constructors. + For a list of initial property values for an instance of , see the constructors. The exact timing of when statically referenced types are loaded is unspecified. This exception may be thrown before the method that references the missing type starts executing. @@ -157,8 +157,8 @@ The exact timing of when statically referenced types are loaded is unspecified. |Property|Value| |--------------|-----------| -||A null reference (`Nothing` in Visual Basic).| -||The localized error message string.| +||A null reference (`Nothing` in Visual Basic).| +||The localized error message string.| ]]> @@ -218,13 +218,13 @@ The exact timing of when statically referenced types are loaded is unspecified. |Property|Value| |--------------|-----------| -||A null reference (`Nothing` in Visual Basic).| -||The error message string.| +||A null reference (`Nothing` in Visual Basic).| +||The error message string.| ## Examples - The following code example demonstrates the constructor. It contains a method that generates a with a custom message, and displays the error message to the console. + The following code example demonstrates the constructor. It contains a method that generates a with a custom message, and displays the error message to the console. :::code language="csharp" source="~/snippets/csharp/System/TypeLoadException/.ctor/typeloadexception_constructor2.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/TypeLoadException/.ctor/typeloadexception_constructor2.vb" id="Snippet1"::: @@ -364,13 +364,13 @@ The exact timing of when statically referenced types are loaded is unspecified. |Property|Value| |--------------|-----------| -||The inner exception reference.| -||The error message string.| +||The inner exception reference.| +||The error message string.| ## Examples - The following code example demonstrates the constructor. It contains a method that generates a , catches that exception, and throws a new with a custom message, including the original as the inner exception. + The following code example demonstrates the constructor. It contains a method that generates a , catches that exception, and throws a new with a custom message, including the original as the inner exception. :::code language="csharp" source="~/snippets/csharp/System/TypeLoadException/.ctor/typeloadexception_constructor3.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/TypeLoadException/.ctor/typeloadexception_constructor3.vb" id="Snippet1"::: @@ -446,7 +446,7 @@ The exact timing of when statically referenced types are loaded is unspecified. sets a with all the exception object data targeted for serialization. During deserialization, the exception object is reconstituted from the transmitted over the stream. + sets a with all the exception object data targeted for serialization. During deserialization, the exception object is reconstituted from the transmitted over the stream. For more information, see [XML and SOAP Serialization](/dotnet/standard/serialization/xml-and-soap-serialization). @@ -519,14 +519,14 @@ The exact timing of when statically referenced types are loaded is unspecified. . The error message should be localized. + This property overrides . The error message should be localized. This property is read-only. ## Examples - The following example attempts to load a non-existent type from the mscorlib assembly. The resulting exception is caught, and the and values are displayed. For this code example to run, you must provide the fully qualified assembly name. For information about how to obtain the fully qualified assembly name, see [Assembly Names](/dotnet/standard/assembly/names). + The following example attempts to load a non-existent type from the mscorlib assembly. The resulting exception is caught, and the and values are displayed. For this code example to run, you must provide the fully qualified assembly name. For information about how to obtain the fully qualified assembly name, see [Assembly Names](/dotnet/standard/assembly/names). :::code language="csharp" source="~/snippets/csharp/System/TypeLoadException/Message/typeloadexception_typename.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/TypeLoadException/Message/typeloadexception_typename.vb" id="Snippet1"::: @@ -582,7 +582,7 @@ The exact timing of when statically referenced types are loaded is unspecified. and values are displayed. For this code example to run, you must provide the fully qualified assembly name. For information about how to obtain the fully qualified assembly name, see [Assembly Names](/dotnet/standard/assembly/names). + The following example attempts to load a non-existent type from the mscorlib assembly. The resulting exception is caught, and the and values are displayed. For this code example to run, you must provide the fully qualified assembly name. For information about how to obtain the fully qualified assembly name, see [Assembly Names](/dotnet/standard/assembly/names). :::code language="csharp" source="~/snippets/csharp/System/TypeLoadException/Message/typeloadexception_typename.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/TypeLoadException/Message/typeloadexception_typename.vb" id="Snippet1"::: diff --git a/xml/System/TypeUnloadedException.xml b/xml/System/TypeUnloadedException.xml index 2b878cd4dd8..023f34f734f 100644 --- a/xml/System/TypeUnloadedException.xml +++ b/xml/System/TypeUnloadedException.xml @@ -72,7 +72,7 @@ ## Remarks uses the HRESULT COR_E_TYPEUNLOADED, that has the value 0x80131013. - For a list of initial property values for an instance of , see the constructors. + For a list of initial property values for an instance of , see the constructors. ]]> @@ -135,8 +135,8 @@ |Property|Value| |--------------|-----------| -||A null reference (`Nothing` in Visual Basic).| -||The localized error message string.| +||A null reference (`Nothing` in Visual Basic).| +||The localized error message string.| ]]> @@ -192,8 +192,8 @@ |Property|Value| |--------------|-----------| -||A null reference (`Nothing` in Visual Basic).| -||The error message string.| +||A null reference (`Nothing` in Visual Basic).| +||The error message string.| ]]> @@ -317,8 +317,8 @@ |Property|Value| |--------------|-----------| -||The inner exception reference.| -||The error message string.| +||The inner exception reference.| +||The error message string.| ]]> diff --git a/xml/System/TypedReference.xml b/xml/System/TypedReference.xml index a235d0cf90e..811cdf5e33a 100644 --- a/xml/System/TypedReference.xml +++ b/xml/System/TypedReference.xml @@ -278,7 +278,7 @@ method returns a typed reference to some terminal field, where the `target` parameter contains the field described by the first element of `flds`, the field described by the first element of `flds` contains the field described by the second element of `flds`, and so on until the terminal field is reached. + The method returns a typed reference to some terminal field, where the `target` parameter contains the field described by the first element of `flds`, the field described by the first element of `flds` contains the field described by the second element of `flds`, and so on until the terminal field is reached. > [!NOTE] > This method can be used to access non-public members if the caller has been granted with the flag and if the grant set of the non-public members is restricted to the caller's grant set, or a subset thereof. (See [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection).) diff --git a/xml/System/UInt128.xml b/xml/System/UInt128.xml index 3102a92c181..1a06197c48a 100644 --- a/xml/System/UInt128.xml +++ b/xml/System/UInt128.xml @@ -727,7 +727,7 @@ This method correctly handles floating-point values and so `2.0` will return `true` while `2.2` will return `false`. -A return value of `false` does not imply that will return `true`. A number with a fractional portion, for example, `3.3`, is not even or odd. +A return value of `false` does not imply that will return `true`. A number with a fractional portion, for example, `3.3`, is not even or odd. ]]> @@ -771,7 +771,7 @@ A return value of `false` does not imply that will return `true`. A number with a fractional portion, for example, `3.3`, is not even or odd. +A return value of `false` does not imply that will return `true`. A number with a fractional portion, for example, `3.3`, is not even or odd. ]]> @@ -915,7 +915,7 @@ A return value of `false` does not imply that this method matches the IEEE 754:2019 `maximum` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. +For this method matches the IEEE 754:2019 `maximum` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. ]]> @@ -988,7 +988,7 @@ For this method matches the IEEE 754:2 ## Remarks -For this method matches the IEEE 754:2019 `minimum` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. +For this method matches the IEEE 754:2019 `minimum` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. ]]> diff --git a/xml/System/UInt16.xml b/xml/System/UInt16.xml index 3039425eb4e..c86f8e9c271 100644 --- a/xml/System/UInt16.xml +++ b/xml/System/UInt16.xml @@ -412,7 +412,7 @@ ## Examples - The following example demonstrates the method. + The following example demonstrates the method. :::code language="csharp" source="~/snippets/csharp/System/UInt16/CompareTo/source.cs" id="Snippet3"::: :::code language="fsharp" source="~/snippets/fsharp/System/UInt16/CompareTo/source.fs" id="Snippet3"::: @@ -496,18 +496,18 @@ interface and performs slightly better than the method because it does not have to convert the `value` parameter to an object. + This method implements the interface and performs slightly better than the method because it does not have to convert the `value` parameter to an object. - Depending on your programming language, it might be possible to code a method where the parameter type has fewer bits (is narrower) than the instance type. This is possible because some programming languages perform an implicit widening conversion that represents the parameter as a type with as many bits as the instance. + Depending on your programming language, it might be possible to code a method where the parameter type has fewer bits (is narrower) than the instance type. This is possible because some programming languages perform an implicit widening conversion that represents the parameter as a type with as many bits as the instance. - For example, suppose the instance type is and the parameter type is . The Microsoft C# compiler generates instructions to represent the value of the parameter as an object, then generates a method that compares the values of the instance and the parameter representation. + For example, suppose the instance type is and the parameter type is . The Microsoft C# compiler generates instructions to represent the value of the parameter as an object, then generates a method that compares the values of the instance and the parameter representation. Consult your programming language's documentation to determine whether its compiler performs implicit widening conversions on numeric types. ## Examples - The following example demonstrates generic and nongeneric versions of the method for several value and reference types. + The following example demonstrates generic and nongeneric versions of the method for several value and reference types. :::code language="csharp" source="~/snippets/csharp/System/Boolean/CompareTo/cat.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Boolean/CompareTo/cat.fs" id="Snippet1"::: @@ -799,7 +799,7 @@ method. + The following example demonstrates the method. :::code language="csharp" source="~/snippets/csharp/System/UInt16/Equals/uint16_equals.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/UInt16/Equals/uint16_equals.fs" id="Snippet1"::: @@ -870,7 +870,7 @@ interface, and performs slightly better than because it does not have to convert the `obj` parameter to an object. + This method implements the interface, and performs slightly better than because it does not have to convert the `obj` parameter to an object. ]]> @@ -1020,7 +1020,7 @@ This method correctly handles floating-point values and so `2.0` will return `true` while `2.2` will return `false`. -A return value of `false` does not imply that will return `true`. A number with a fractional portion, for example, `3.3`, is not even or odd. +A return value of `false` does not imply that will return `true`. A number with a fractional portion, for example, `3.3`, is not even or odd. ]]> @@ -1070,7 +1070,7 @@ A return value of `false` does not imply that will return `true`. A number with a fractional portion, for example, `3.3`, is not even or odd. +A return value of `false` does not imply that will return `true`. A number with a fractional portion, for example, `3.3`, is not even or odd. ]]> @@ -1238,7 +1238,7 @@ A return value of `false` does not imply that this method matches the IEEE 754:2019 `maximum` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. +For this method matches the IEEE 754:2019 `maximum` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. ]]> @@ -1351,7 +1351,7 @@ For this method matches the IEEE 754:2 ## Remarks -For this method matches the IEEE 754:2019 `minimum` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. +For this method matches the IEEE 754:2019 `minimum` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. ]]> @@ -1501,18 +1501,18 @@ For this method matches the IEEE 754:2 |Element|Description| |-------------|-----------------| |*ws*|Optional white space.| -|*sign*|An optional sign. Valid sign characters are determined by the and properties of the current culture. However, the negative sign symbol can be used only with zero; otherwise, the method throws an .| +|*sign*|An optional sign. Valid sign characters are determined by the and properties of the current culture. However, the negative sign symbol can be used only with zero; otherwise, the method throws an .| |*digits*|A sequence of digits ranging from 0 to 9. Any leading zeros are ignored.| > [!NOTE] > The string specified by the `s` parameter is interpreted by using the style. It cannot contain any group separators or decimal separator, and it cannot have a decimal portion. - The `s` parameter is parsed by using the formatting information in a object that is initialized for the current system culture. For more information, see . To parse a string by using the formatting information of a specific culture, use the method. + The `s` parameter is parsed by using the formatting information in a object that is initialized for the current system culture. For more information, see . To parse a string by using the formatting information of a specific culture, use the method. ## Examples - The following example calls the method to convert each element in a string array to an unsigned 16-bit integer. + The following example calls the method to convert each element in a string array to an unsigned 16-bit integer. :::code language="csharp" source="~/snippets/csharp/System/UInt16/Parse/parseex5.cs" id="Snippet5"::: :::code language="fsharp" source="~/snippets/fsharp/System/UInt16/Parse/parseex5.fs" id="Snippet5"::: @@ -1703,7 +1703,7 @@ For this method matches the IEEE 754:2 |Element|Description| |-------------|-----------------| |*ws*|Optional white space. White space can appear at the start of `s` if `style` includes the flag, and it can appear at the end of `s` if `style` includes the flag.| -|*$*|A culture-specific currency symbol. Its position in the string is defined by the and properties of the current culture. The current culture's currency symbol can appear in `s` if `style` includes the flag.| +|*$*|A culture-specific currency symbol. Its position in the string is defined by the and properties of the current culture. The current culture's currency symbol can appear in `s` if `style` includes the flag.| |*sign*|An optional sign. The sign can appear at the start of `s` if `style` includes the flag, and it can appear at the end of `s` if `style` includes the flag. Parentheses can be used in `s` to indicate a negative value if `style` includes the flag. However, the negative sign symbol can be used only with zero; otherwise, the method throws an .| |*digits*

*fractional_digits*

*exponential_digits*|A sequence of digits from 0 through 9. For *fractional_digits*, only the digit 0 is valid.| |*,*|A culture-specific group separator symbol. The current culture's group separator can appear in `s` if `style` includes the flag.| @@ -1738,7 +1738,7 @@ For this method matches the IEEE 754:2 > [!NOTE] > If `s` is the string representation of a hexadecimal number, it cannot be preceded by any decoration (such as `0x` or `&h`) that differentiates it as a hexadecimal number. This causes the conversion to fail. - The `s` parameter is parsed by using the formatting information in a object that is initialized for the current system culture. To specify the culture whose formatting information is used for the parse operation, call the overload. + The `s` parameter is parsed by using the formatting information in a object that is initialized for the current system culture. To specify the culture whose formatting information is used for the parse operation, call the overload. @@ -1855,22 +1855,22 @@ For this method matches the IEEE 754:2 |sign|An optional sign, or a negative sign if `s` represents the value zero.| |digits|A sequence of digits ranging from 0 to 9.| - The s parameter is interpreted using the style. In addition to the byte value's decimal digits, only leading and trailing spaces along with a leading sign is allowed. (If the negative sign is present, `s` must represent a value of zero or the method throws an .) To explicitly define the style elements together with the culture-specific formatting information that can be present in `s`, use the method. + The s parameter is interpreted using the style. In addition to the byte value's decimal digits, only leading and trailing spaces along with a leading sign is allowed. (If the negative sign is present, `s` must represent a value of zero or the method throws an .) To explicitly define the style elements together with the culture-specific formatting information that can be present in `s`, use the method. - The `provider` parameter is an implementation whose method returns a object that provides culture-specific information about the format of `s`. There are three ways to use the `provider` parameter to supply custom formatting information to the parse operation: + The `provider` parameter is an implementation whose method returns a object that provides culture-specific information about the format of `s`. There are three ways to use the `provider` parameter to supply custom formatting information to the parse operation: -- You can pass the actual object that provides formatting information. (Its implementation of simply returns itself.) +- You can pass the actual object that provides formatting information. (Its implementation of simply returns itself.) - You can pass a object that specifies the culture whose formatting is to be used. Its property provides formatting information. -- You can pass a custom implementation. Its method must instantiate and return the object that provides formatting information. +- You can pass a custom implementation. Its method must instantiate and return the object that provides formatting information. If `provider` is `null`, the for the current culture is used. ## Examples - The following example instantiates a custom culture that uses two plus signs (++) as its positive sign. It then calls the method to parse an array of strings by using objects that represent both this custom culture and the invariant culture. + The following example instantiates a custom culture that uses two plus signs (++) as its positive sign. It then calls the method to parse an array of strings by using objects that represent both this custom culture and the invariant culture. :::code language="csharp" source="~/snippets/csharp/System/UInt16/Parse/parseex3.cs" id="Snippet3"::: :::code language="fsharp" source="~/snippets/fsharp/System/UInt16/Parse/parseex3.fs" id="Snippet3"::: @@ -2086,7 +2086,7 @@ For this method matches the IEEE 754:2 |Element|Description| |-------------|-----------------| |*ws*|Optional white space. White space can appear at the beginning of `s` if `style` includes the flag, and it can appear at the end of `s` if `style` includes the flag.| -|*$*|A culture-specific currency symbol. Its position in the string is defined by the property of the object that is returned by the method of the `provider` parameter. The currency symbol can appear in `s` if `style` includes the flag.| +|*$*|A culture-specific currency symbol. Its position in the string is defined by the property of the object that is returned by the method of the `provider` parameter. The currency symbol can appear in `s` if `style` includes the flag.| |*sign*|An optional sign. (The method throws an if `s` includes a negative sign and represents a non-zero number.) The sign can appear at the beginning of `s` if `style` includes the flag, and it can appear the end of `s` if `style` includes the flag. Parentheses can be used in `s` to indicate a negative value if `style` includes the flag.| |*digits*|A sequence of digits from 0 through 9.| |*.*|A culture-specific decimal point symbol. The current culture's decimal point symbol can appear in `s` if `style` includes the flag.| @@ -2118,20 +2118,20 @@ For this method matches the IEEE 754:2 > [!NOTE] > If the `s` parameter is the string representation of a hexadecimal number, it cannot be preceded by any decoration (such as `0x` or `&h`) that differentiates it as a hexadecimal number. This causes the parse operation to throw an exception. - The `provider` parameter is an implementation whose method returns a object that provides culture-specific information about the format of `s`. There are three ways to use the `provider` parameter to supply custom formatting information to the parse operation: + The `provider` parameter is an implementation whose method returns a object that provides culture-specific information about the format of `s`. There are three ways to use the `provider` parameter to supply custom formatting information to the parse operation: -- You can pass the actual object that provides formatting information. (Its implementation of simply returns itself.) +- You can pass the actual object that provides formatting information. (Its implementation of simply returns itself.) - You can pass a object that specifies the culture whose formatting is to be used. Its property provides formatting information. -- You can pass a custom implementation. Its method must instantiate and return the object that provides formatting information. +- You can pass a custom implementation. Its method must instantiate and return the object that provides formatting information. If `provider` is `null`, the object for the current culture is used. ## Examples - The following example uses the method to convert various string representations of numbers to 16-bit unsigned integer values. + The following example uses the method to convert various string representations of numbers to 16-bit unsigned integer values. :::code language="csharp" source="~/snippets/csharp/System/UInt16/Parse/parseex4.cs" id="Snippet4"::: :::code language="fsharp" source="~/snippets/fsharp/System/UInt16/Parse/parseex4.fs" id="Snippet4"::: @@ -2472,7 +2472,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -2530,7 +2530,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -2588,7 +2588,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -2698,7 +2698,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -2756,7 +2756,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -2814,7 +2814,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -2872,7 +2872,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -2930,7 +2930,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -2988,7 +2988,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -3046,7 +3046,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -3106,7 +3106,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the `static` (`Shared` in Visual Basic) method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the `static` (`Shared` in Visual Basic) method. ]]> @@ -3234,7 +3234,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -3298,7 +3298,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -6238,13 +6238,13 @@ This member is an explicit interface member implementation. It can be used only method formats a value in the default ("G", or general) format by using the object of the current culture. If you want to specify a different format or culture, use the other overloads of the method, as follows: + The method formats a value in the default ("G", or general) format by using the object of the current culture. If you want to specify a different format or culture, use the other overloads of the method, as follows: |To use format|For culture|Use the overload| |-------------------|-----------------|----------------------| -|Default ("G") format|A specific culture|| -|A specific format|Default (current) culture|| -|A specific format|A specific culture|| +|Default ("G") format|A specific culture|| +|A specific format|Default (current) culture|| +|A specific format|A specific culture|| @@ -6331,20 +6331,20 @@ This member is an explicit interface member implementation. It can be used only method formats a value in the default ("G", or general) format by using the object of a specified culture. If you want to specify a different format or the current culture, use the other overloads of the method, as follows: + The method formats a value in the default ("G", or general) format by using the object of a specified culture. If you want to specify a different format or the current culture, use the other overloads of the method, as follows: |To use format|For culture|Use the overload| |-------------------|-----------------|----------------------| |Default ("G") format|Default (current) culture|| -|A specific format|Default (current) culture|| -|A specific format|A specific culture|| +|A specific format|Default (current) culture|| +|A specific format|A specific culture|| - The `provider` parameter is an implementation. Its method returns a object that provides culture-specific formatting information. However, none of the properties of the are used when formatting with the general numeric format specifier ("G"). + The `provider` parameter is an implementation. Its method returns a object that provides culture-specific formatting information. However, none of the properties of the are used when formatting with the general numeric format specifier ("G"). ## Examples - The following example formats a 16-bit signed integer value by using several format providers, including one for the invariant culture. The output from the example illustrates that the formatted string returned by the method is the same regardless of the format provider. + The following example formats a 16-bit signed integer value by using several format providers, including one for the invariant culture. The output from the example illustrates that the formatted string returned by the method is the same regardless of the format provider. :::code language="csharp" source="~/snippets/csharp/System/UInt16/ToString/tostring2.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/UInt16/ToString/tostring2.fs" id="Snippet2"::: @@ -6425,13 +6425,13 @@ This member is an explicit interface member implementation. It can be used only method formats a value in a specified format by using a object that represents the conventions of the current culture. If you want to use the default ("G", or general) format or specify a different culture, use the other overloads of the method, as follows: + The method formats a value in a specified format by using a object that represents the conventions of the current culture. If you want to use the default ("G", or general) format or specify a different culture, use the other overloads of the method, as follows: |To use format|For culture|Use the overload| |-------------------|-----------------|----------------------| |Default ("G") format|Default (current) culture|| -|Default ("G") format|A specific culture|| -|A specific format|A specific culture|| +|Default ("G") format|A specific culture|| +|A specific format|A specific culture|| The `format` parameter can be any valid [standard numeric format specifier](/dotnet/standard/base-types/standard-numeric-format-strings), or any combination of [custom numeric format specifiers](/dotnet/standard/base-types/custom-numeric-format-strings). If `format` is equal to or is `null`, the return value of the current object is formatted with the general format specifier ("G"). If `format` is any other value, the method throws a . @@ -6441,7 +6441,7 @@ This member is an explicit interface member implementation. It can be used only - For more information about support for formatting in .NET, see [Formatting Types](/dotnet/standard/base-types/formatting-types). - The format of the returned string is determined by the object for the current culture. Depending on the `format` parameter, this object controls symbols such as the group separator and the decimal point symbol in the output string. To provide formatting information for cultures other than the current culture, call the overload. + The format of the returned string is determined by the object for the current culture. Depending on the `format` parameter, this object controls symbols such as the group separator and the decimal point symbol in the output string. To provide formatting information for cultures other than the current culture, call the overload. @@ -6530,13 +6530,13 @@ This member is an explicit interface member implementation. It can be used only method formats a value in a specified format by using the object of a specified culture. If you want to use default format or culture settings, use the other overloads of the method, as follows: + The method formats a value in a specified format by using the object of a specified culture. If you want to use default format or culture settings, use the other overloads of the method, as follows: |To use format|For culture|Use the overload| |-------------------|-----------------|----------------------| |Default ("G") format|Default (current) culture|| -|Default ("G") format|A specific culture|| -|A specific format|Default (current) culture|| +|Default ("G") format|A specific culture|| +|A specific format|Default (current) culture|| The `format` parameter can be any valid [Standard Numeric Format Strings](/dotnet/standard/base-types/standard-numeric-format-strings), or any combination of [Custom Numeric Format Strings](/dotnet/standard/base-types/custom-numeric-format-strings). If `format` is equal to or is `null`, the return value of the current object is formatted with the general format specifier ("G"). If `format` is any other value, the method throws a . @@ -6546,13 +6546,13 @@ This member is an explicit interface member implementation. It can be used only - For more information about formatting, see [Formatting Types](/dotnet/standard/base-types/formatting-types). - The `provider` parameter is an implementation. Its method returns a object that provides culture-specific information about the format of the string returned by this method. When the method is invoked, it calls the `provider` parameter's method and passes it a object that represents the type. The method then returns the object that provides information for formatting the current value, such as the group separator symbol or the decimal point symbol. There are three ways to use the `provider` parameter to supply formatting information to the method: + The `provider` parameter is an implementation. Its method returns a object that provides culture-specific information about the format of the string returned by this method. When the method is invoked, it calls the `provider` parameter's method and passes it a object that represents the type. The method then returns the object that provides information for formatting the current value, such as the group separator symbol or the decimal point symbol. There are three ways to use the `provider` parameter to supply formatting information to the method: -- You can pass a object that represents the culture that supplies formatting information. Its method returns the object that provides numeric formatting information for that culture. +- You can pass a object that represents the culture that supplies formatting information. Its method returns the object that provides numeric formatting information for that culture. -- You can pass the actual object that provides numeric formatting information. (Its implementation of just returns itself.) +- You can pass the actual object that provides numeric formatting information. (Its implementation of just returns itself.) -- You can pass a custom object that implements . Its method instantiates and returns the object that provides formatting information. +- You can pass a custom object that implements . Its method instantiates and returns the object that provides formatting information. If `provider` is `null`, the formatting of the returned string is based on the object of the current culture. @@ -6913,7 +6913,7 @@ This member is an explicit interface member implementation. It can be used only method is like the method, except that it does not throw an exception if the conversion fails. This method eliminates the need to use exception handling to test for a if `s` is invalid and cannot be successfully parsed. + The method is like the method, except that it does not throw an exception if the conversion fails. This method eliminates the need to use exception handling to test for a if `s` is invalid and cannot be successfully parsed. The `s` parameter should be the string representation of a decimal number in the following form: @@ -6924,22 +6924,22 @@ This member is an explicit interface member implementation. It can be used only |Element|Description| |-------------|-----------------| |*ws*|Optional white space.| -|*sign*|An optional sign. Valid sign characters are determined by the and properties of the current culture.| +|*sign*|An optional sign. Valid sign characters are determined by the and properties of the current culture.| |*digits*|A sequence of decimal digits ranging from 0 to 9.| > [!NOTE] > The string specified by the `s` parameter cannot contain any group separators or decimal separator, and it cannot have a decimal portion. - The `s` parameter is interpreted by using the style. In addition to the decimal digits, only leading and trailing spaces with a leading sign are allowed. To explicitly define the style elements with the culture-specific formatting information that can be present in `s`, call the method. + The `s` parameter is interpreted by using the style. In addition to the decimal digits, only leading and trailing spaces with a leading sign are allowed. To explicitly define the style elements with the culture-specific formatting information that can be present in `s`, call the method. - The `s` parameter is parsed by using the formatting information in a object for the current system culture. For more information, see . + The `s` parameter is parsed by using the formatting information in a object for the current system culture. For more information, see . - This overload interprets all digits in the `s` parameter as decimal digits. To parse the string representation of a hexadecimal number, call the overload instead. + This overload interprets all digits in the `s` parameter as decimal digits. To parse the string representation of a hexadecimal number, call the overload instead. ## Examples - The following example calls the method once for each element in a string array. + The following example calls the method once for each element in a string array. :::code language="csharp" source="~/snippets/csharp/System/UInt16/TryParse/tryparse11.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/UInt16/TryParse/tryparse11.fs" id="Snippet1"::: @@ -7285,7 +7285,7 @@ This member is an explicit interface member implementation. It can be used only method is like the method, except that it does not throw an exception if the conversion fails. This method eliminates the need to use exception handling to test for a if `s` is invalid and cannot be parsed successfully. + The method is like the method, except that it does not throw an exception if the conversion fails. This method eliminates the need to use exception handling to test for a if `s` is invalid and cannot be parsed successfully. The `style` parameter defines the style elements (such as white space or a positive or negative sign) that are allowed in the `s` parameter for the parse operation to succeed. It must be a combination of bit flags from the enumeration. Depending on the value of `style`, the `s` parameter may include the following elements: @@ -7301,7 +7301,7 @@ This member is an explicit interface member implementation. It can be used only Optional white space. White space can appear at the start of `s` if `style` includes the flag, or at the end of `s` if `style` includes the flag. *$* - A culture-specific currency symbol. Its position in the string is defined by the property of the object returned by the method of the `provider` parameter. The currency symbol can appear in `s` if `style` includes the flag. + A culture-specific currency symbol. Its position in the string is defined by the property of the object returned by the method of the `provider` parameter. The currency symbol can appear in `s` if `style` includes the flag. *sign* An optional sign. The sign can appear at the start of `s` if `style` includes the flag, and it can appear at the end of `s` if `style` includes the flag. Parentheses can be used in `s` to indicate a negative value if `style` includes the flag. However, if the negative sign is present, `s` can only represent the value zero for the parse operation to succeed. @@ -7354,20 +7354,20 @@ This member is an explicit interface member implementation. It can be used only > [!NOTE] > If `s` is the string representation of a hexadecimal number, it cannot be preceded by any decoration (such as `0x` or `&h`) that differentiates it as a hexadecimal number. This causes the conversion to fail. - The `provider` parameter is an implementation. Its method returns a object that provides culture-specific information about the format of `s`. The `provider` parameter can be any one of the following: + The `provider` parameter is an implementation. Its method returns a object that provides culture-specific information about the format of `s`. The `provider` parameter can be any one of the following: -- A object that represents the culture that supplies formatting information. Its method returns the object that provides numeric formatting information for that culture. +- A object that represents the culture that supplies formatting information. Its method returns the object that provides numeric formatting information for that culture. -- A object that provides numeric formatting information. (Its implementation of just returns itself.) +- A object that provides numeric formatting information. (Its implementation of just returns itself.) -- A custom object that implements . Its method instantiates and returns the object that provides formatting information. +- A custom object that implements . Its method instantiates and returns the object that provides formatting information. If `provider` is `null`, the object for the current culture is used. ## Examples - The following example calls the method with a number of different strings and values. + The following example calls the method with a number of different strings and values. :::code language="csharp" source="~/snippets/csharp/System/UInt16/TryParse/tryparse2.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/UInt16/TryParse/tryparse2.fs" id="Snippet2"::: diff --git a/xml/System/UInt32.xml b/xml/System/UInt32.xml index 001578e42e8..1a4d52fd426 100644 --- a/xml/System/UInt32.xml +++ b/xml/System/UInt32.xml @@ -447,7 +447,7 @@ ## Examples - The following code example demonstrates the method. + The following code example demonstrates the method. :::code language="csharp" source="~/snippets/csharp/System/UInt32/CompareTo/source.cs" id="Snippet3"::: :::code language="fsharp" source="~/snippets/fsharp/System/UInt32/CompareTo/source.fs" id="Snippet3"::: @@ -531,18 +531,18 @@ interface and performs slightly better than the method because it does not have to convert the `value` parameter to an object. + This method implements the interface and performs slightly better than the method because it does not have to convert the `value` parameter to an object. - Depending on your programming language, it might be possible to code a method where the parameter type has fewer bits (is narrower) than the instance type. This is possible because some programming languages perform an implicit widening conversion that represents the parameter as a type with as many bits as the instance. + Depending on your programming language, it might be possible to code a method where the parameter type has fewer bits (is narrower) than the instance type. This is possible because some programming languages perform an implicit widening conversion that represents the parameter as a type with as many bits as the instance. - For example, suppose the instance type is and the parameter type is . The Microsoft C# compiler generates instructions to represent the value of the parameter as an object, then generates a method that compares the values of the instance and the parameter representation. + For example, suppose the instance type is and the parameter type is . The Microsoft C# compiler generates instructions to represent the value of the parameter as an object, then generates a method that compares the values of the instance and the parameter representation. Consult your programming language's documentation to determine whether its compiler performs implicit widening conversions on numeric types. ## Examples - The following code example demonstrates generic and nongeneric versions of the method for several value and reference types. + The following code example demonstrates generic and nongeneric versions of the method for several value and reference types. :::code language="csharp" source="~/snippets/csharp/System/Boolean/CompareTo/cat.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Boolean/CompareTo/cat.fs" id="Snippet1"::: @@ -840,7 +840,7 @@ method. + The following code example demonstrates the method. :::code language="csharp" source="~/snippets/csharp/System/UInt32/Equals/uint32_equals.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/UInt32/Equals/uint32_equals.fs" id="Snippet1"::: @@ -912,7 +912,7 @@ interface, and performs slightly better than the method because it does not have to convert the `obj` parameter to an object. + This method implements the interface, and performs slightly better than the method because it does not have to convert the `obj` parameter to an object. ]]> @@ -1074,7 +1074,7 @@ This method correctly handles floating-point values and so `2.0` will return `true` while `2.2` will return `false`. -A return value of `false` does not imply that will return `true`. A number with a fractional portion, for example, `3.3`, is not even or odd. +A return value of `false` does not imply that will return `true`. A number with a fractional portion, for example, `3.3`, is not even or odd. ]]> @@ -1124,7 +1124,7 @@ A return value of `false` does not imply that will return `true`. A number with a fractional portion, for example, `3.3`, is not even or odd. +A return value of `false` does not imply that will return `true`. A number with a fractional portion, for example, `3.3`, is not even or odd. ]]> @@ -1292,7 +1292,7 @@ A return value of `false` does not imply that this method matches the IEEE 754:2019 `maximum` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. +For this method matches the IEEE 754:2019 `maximum` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. ]]> @@ -1405,7 +1405,7 @@ For this method matches the IEEE 754:2 ## Remarks -For this method matches the IEEE 754:2019 `minimum` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. +For this method matches the IEEE 754:2019 `minimum` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. ]]> @@ -1555,18 +1555,18 @@ For this method matches the IEEE 754:2 |Element|Description| |-------------|-----------------| |*ws*|Optional white space.| -|*sign*|An optional sign. Valid sign characters are determined by the and properties of the current culture. However, the negative sign symbol can be used only with zero; otherwise, the method throws an .| +|*sign*|An optional sign. Valid sign characters are determined by the and properties of the current culture. However, the negative sign symbol can be used only with zero; otherwise, the method throws an .| |*digits*|A sequence of digits ranging from 0 to 9. Any leading zeros are ignored.| > [!NOTE] > The string specified by the `s` parameter is interpreted by using the style. It cannot contain any group separators or decimal separator, and it cannot have a decimal portion. - The `s` parameter is parsed by using the formatting information in a object that is initialized for the current system culture. For more information, see . To parse a string by using the formatting information of a specific culture, use the method. + The `s` parameter is parsed by using the formatting information in a object that is initialized for the current system culture. For more information, see . To parse a string by using the formatting information of a specific culture, use the method. ## Examples - The following example uses the method to parse an array of string values. + The following example uses the method to parse an array of string values. :::code language="csharp" source="~/snippets/csharp/System/UInt32/Parse/parse1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/UInt32/Parse/parse1.fs" id="Snippet1"::: @@ -1751,7 +1751,7 @@ For this method matches the IEEE 754:2 |Element|Description| |-------------|-----------------| |*ws*|Optional white space. White space can appear at the start of `s` if `style` includes the flag, and it can appear at the end of `s` if `style` includes the flag.| -|*$*|A culture-specific currency symbol. Its position in the string is defined by the and properties of the current culture. The current culture's currency symbol can appear in `s` if `style` includes the flag.| +|*$*|A culture-specific currency symbol. Its position in the string is defined by the and properties of the current culture. The current culture's currency symbol can appear in `s` if `style` includes the flag.| |*sign*|An optional sign. The sign can appear at the start of `s` if `style` includes the flag, and it can appear at the end of `s` if `style` includes the flag. Parentheses can be used in `s` to indicate a negative value if `style` includes the flag. However, the negative sign symbol can be used only with zero; otherwise, the method throws an .| |*digits*

*fractional_digits*

*exponential_digits*|A sequence of digits from 0 through 9. For *fractional_digits*, only the digit 0 is valid.| |*,*|A culture-specific group separator symbol. The current culture's group separator can appear in `s` if `style` includes the flag.| @@ -1788,7 +1788,7 @@ For this method matches the IEEE 754:2 > [!NOTE] > If `s` is the string representation of a hexadecimal number, it cannot be preceded by any decoration (such as `0x` or `&h`) that differentiates it as a hexadecimal number. This causes the conversion to fail. - The `s` parameter is parsed by using the formatting information in a object that is initialized for the current system culture. To specify the culture whose formatting information is used for the parse operation, call the overload. + The `s` parameter is parsed by using the formatting information in a object that is initialized for the current system culture. To specify the culture whose formatting information is used for the parse operation, call the overload. @@ -1906,22 +1906,22 @@ For this method matches the IEEE 754:2 |*sign*|An optional sign, or a negative sign if `s` represents the value zero.| |*digits*|A sequence of digits ranging from 0 to 9.| - The s parameter is interpreted using the style. In addition to the unsigned integer value's decimal digits, only leading and trailing spaces along with a leading sign is allowed. (If the negative sign is present, `s` must represent a value of zero, or the method throws an .) To explicitly define the style elements together with the culture-specific formatting information that can be present in `s`, use the method. + The s parameter is interpreted using the style. In addition to the unsigned integer value's decimal digits, only leading and trailing spaces along with a leading sign is allowed. (If the negative sign is present, `s` must represent a value of zero, or the method throws an .) To explicitly define the style elements together with the culture-specific formatting information that can be present in `s`, use the method. - The `provider` parameter is an implementation whose method returns a object that provides culture-specific information about the format of `s`. There are three ways to use the `provider` parameter to supply custom formatting information to the parse operation: + The `provider` parameter is an implementation whose method returns a object that provides culture-specific information about the format of `s`. There are three ways to use the `provider` parameter to supply custom formatting information to the parse operation: -- You can pass the actual object that provides formatting information. (Its implementation of simply returns itself.) +- You can pass the actual object that provides formatting information. (Its implementation of simply returns itself.) - You can pass a object that specifies the culture whose formatting is to be used. Its property provides formatting information. -- You can pass a custom implementation. Its method must instantiate and return the object that provides formatting information. +- You can pass a custom implementation. Its method must instantiate and return the object that provides formatting information. If `provider` is `null`, the for the current culture is used. ## Examples - The following example is the button click event handler of a Web form. It uses the array returned by the property to determine the user's locale. It then instantiates a object that corresponds to that locale. The object that belongs to that object is then passed to the method to convert the user's input to a value. + The following example is the button click event handler of a Web form. It uses the array returned by the property to determine the user's locale. It then instantiates a object that corresponds to that locale. The object that belongs to that object is then passed to the method to convert the user's input to a value. :::code language="csharp" source="~/snippets/csharp/System/Decimal/Parse/Default.aspx.cs" id="Snippet6"::: :::code language="vb" source="~/snippets/visualbasic/System/Decimal/Parse/Default.aspx.vb" id="Snippet6"::: @@ -2136,7 +2136,7 @@ For this method matches the IEEE 754:2 |Element|Description| |-------------|-----------------| |*ws*|Optional white space. White space can appear at the beginning of `s` if `style` includes the flag, and it can appear at the end of `s` if `style` includes the flag.| -|*$*|A culture-specific currency symbol. Its position in the string is defined by the property of the object that is returned by the method of the `provider` parameter. The currency symbol can appear in `s` if `style` includes the flag.| +|*$*|A culture-specific currency symbol. Its position in the string is defined by the property of the object that is returned by the method of the `provider` parameter. The currency symbol can appear in `s` if `style` includes the flag.| |*sign*|An optional sign. (The method throws an if `s` includes a negative sign and represents a non-zero number.) The sign can appear at the beginning of `s` if `style` includes the flag, and it can appear the end of `s` if `style` includes the flag. Parentheses can be used in `s` to indicate a negative value if `style` includes the flag.| |*digits*|A sequence of digits from 0 through 9.| |*.*|A culture-specific decimal point symbol. The current culture's decimal point symbol can appear in `s` if `style` includes the flag.| @@ -2168,20 +2168,20 @@ For this method matches the IEEE 754:2 > [!NOTE] > If the `s` parameter is the string representation of a hexadecimal number, it cannot be preceded by any decoration (such as `0x` or `&h`) that differentiates it as a hexadecimal number. This causes the parse operation to throw an exception. - The `provider` parameter is an implementation whose method returns a object that provides culture-specific information about the format of `s`. There are three ways to use the `provider` parameter to supply custom formatting information to the parse operation: + The `provider` parameter is an implementation whose method returns a object that provides culture-specific information about the format of `s`. There are three ways to use the `provider` parameter to supply custom formatting information to the parse operation: -- You can pass the actual object that provides formatting information. (Its implementation of simply returns itself.) +- You can pass the actual object that provides formatting information. (Its implementation of simply returns itself.) - You can pass a object that specifies the culture whose formatting is to be used. Its property provides formatting information. -- You can pass a custom implementation. Its method must instantiate and return the object that provides formatting information. +- You can pass a custom implementation. Its method must instantiate and return the object that provides formatting information. If `provider` is `null`, the object for the current culture is used. ## Examples - The following example uses the method to convert various string representations of numbers to 32-bit unsigned integer values. + The following example uses the method to convert various string representations of numbers to 32-bit unsigned integer values. :::code language="csharp" source="~/snippets/csharp/System/UInt32/Parse/parseex4.cs" id="Snippet4"::: :::code language="fsharp" source="~/snippets/fsharp/System/UInt32/Parse/parseex4.fs" id="Snippet4"::: @@ -2521,7 +2521,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -2579,7 +2579,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -2637,7 +2637,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -2747,7 +2747,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -2805,7 +2805,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -2863,7 +2863,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -2921,7 +2921,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -2979,7 +2979,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -3037,7 +3037,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -3095,7 +3095,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -3155,7 +3155,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the `static` (`Shared` in Visual Basic) method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the `static` (`Shared` in Visual Basic) method. ]]> @@ -3219,7 +3219,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -3351,7 +3351,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -6295,13 +6295,13 @@ This member is an explicit interface member implementation. It can be used only method formats a value in the default ("G", or general) format by using the object of the current culture. If you want to specify a different format or culture, use the other overloads of the method, as follows: + The method formats a value in the default ("G", or general) format by using the object of the current culture. If you want to specify a different format or culture, use the other overloads of the method, as follows: |To use format|For culture|Use the overload| |-------------------|-----------------|----------------------| -|Default ("G") format|A specific culture|| -|A specific format|Default (current) culture|| -|A specific format|A specific culture|| +|Default ("G") format|A specific culture|| +|A specific format|Default (current) culture|| +|A specific format|A specific culture|| @@ -6388,20 +6388,20 @@ This member is an explicit interface member implementation. It can be used only method formats a value in the default ("G", or general) format by using the object of a specified culture. If you want to specify a different format or the current culture, use the other overloads of the method, as follows: + The method formats a value in the default ("G", or general) format by using the object of a specified culture. If you want to specify a different format or the current culture, use the other overloads of the method, as follows: |To use format|For culture|Use the overload| |-------------------|-----------------|----------------------| |Default ("G") format|Default (current) culture|| -|A specific format|Default (current) culture|| -|A specific format|A specific culture|| +|A specific format|Default (current) culture|| +|A specific format|A specific culture|| - The `provider` parameter is an implementation. Its method returns a object that provides culture-specific formatting information. However, none of the properties of the are used when formatting with the general numeric format specifier ("G"). + The `provider` parameter is an implementation. Its method returns a object that provides culture-specific formatting information. However, none of the properties of the are used when formatting with the general numeric format specifier ("G"). ## Examples - The following example formats a 16-bit signed integer value by using several format providers, including one for the invariant culture. The output from the example illustrates that the formatted string returned by the method is the same regardless of the format provider. + The following example formats a 16-bit signed integer value by using several format providers, including one for the invariant culture. The output from the example illustrates that the formatted string returned by the method is the same regardless of the format provider. :::code language="csharp" source="~/snippets/csharp/System/UInt32/ToString/tostring2.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/UInt32/ToString/tostring2.fs" id="Snippet2"::: @@ -6482,13 +6482,13 @@ This member is an explicit interface member implementation. It can be used only method formats a value in a specified format by using a object that represents the conventions of the current culture. If you want to use the default ("G", or general) format or specify a different culture, use the other overloads of the method, as follows: + The method formats a value in a specified format by using a object that represents the conventions of the current culture. If you want to use the default ("G", or general) format or specify a different culture, use the other overloads of the method, as follows: |To use format|For culture|Use the overload| |-------------------|-----------------|----------------------| |Default ("G") format|Default (current) culture|| -|Default ("G") format|A specific culture|| -|A specific format|A specific culture|| +|Default ("G") format|A specific culture|| +|A specific format|A specific culture|| The `format` parameter can be any valid [Standard Numeric Format Strings](/dotnet/standard/base-types/standard-numeric-format-strings), or any combination of [Custom Numeric Format Strings](/dotnet/standard/base-types/custom-numeric-format-strings). If `format` is equal to or is `null`, the return value of the current object is formatted with the general format specifier ("G"). If `format` is any other value, the method throws a . @@ -6498,7 +6498,7 @@ This member is an explicit interface member implementation. It can be used only - For more information about support for formatting in .NET, see [Formatting Types](/dotnet/standard/base-types/formatting-types). - The format of the returned string is determined by the object for the current culture. Depending on the `format` parameter, this object controls symbols such as the group separator and the decimal point symbol in the output string. To provide formatting information for cultures other than the current culture, call the overload. + The format of the returned string is determined by the object for the current culture. Depending on the `format` parameter, this object controls symbols such as the group separator and the decimal point symbol in the output string. To provide formatting information for cultures other than the current culture, call the overload. @@ -6591,13 +6591,13 @@ This member is an explicit interface member implementation. It can be used only method formats a value in a specified format by using the object of a specified culture. If you want to use default format or culture settings, use the other overloads of the method, as follows: + The method formats a value in a specified format by using the object of a specified culture. If you want to use default format or culture settings, use the other overloads of the method, as follows: |To use format|For culture|Use the overload| |-------------------|-----------------|----------------------| |Default ("G") format|Default (current) culture|| -|Default ("G") format|A specific culture|| -|A specific format|Default (current) culture|| +|Default ("G") format|A specific culture|| +|A specific format|Default (current) culture|| The `format` parameter can be any valid [Standard Numeric Format Strings](/dotnet/standard/base-types/standard-numeric-format-strings), or any combination of [Custom Numeric Format Strings](/dotnet/standard/base-types/custom-numeric-format-strings). If `format` is equal to or is `null`, the return value of the current object is formatted with the general format specifier ("G"). If `format` is any other value, the method throws a . @@ -6607,13 +6607,13 @@ This member is an explicit interface member implementation. It can be used only - For more information about formatting, see [Formatting Types](/dotnet/standard/base-types/formatting-types). - The `provider` parameter is an implementation. Its method returns a object that provides culture-specific information about the format of the string returned by this method. When the method is invoked, it calls the `provider` parameter's method and passes it a object that represents the type. The method then returns the object that provides information for formatting the current value, such as the group separator symbol or the decimal point symbol. There are three ways to use the `provider` parameter to supply formatting information to the method: + The `provider` parameter is an implementation. Its method returns a object that provides culture-specific information about the format of the string returned by this method. When the method is invoked, it calls the `provider` parameter's method and passes it a object that represents the type. The method then returns the object that provides information for formatting the current value, such as the group separator symbol or the decimal point symbol. There are three ways to use the `provider` parameter to supply formatting information to the method: -- You can pass a object that represents the culture that supplies formatting information. Its method returns the object that provides numeric formatting information for that culture. +- You can pass a object that represents the culture that supplies formatting information. Its method returns the object that provides numeric formatting information for that culture. -- You can pass the actual object that provides numeric formatting information. (Its implementation of just returns itself.) +- You can pass the actual object that provides numeric formatting information. (Its implementation of just returns itself.) -- You can pass a custom object that implements . Its method instantiates and returns the object that provides formatting information. +- You can pass a custom object that implements . Its method instantiates and returns the object that provides formatting information. If `provider` is `null`, the formatting of the returned string is based on the object of the current culture. @@ -6974,7 +6974,7 @@ This member is an explicit interface member implementation. It can be used only method is like the method, except that it does not throw an exception if the conversion fails. This method eliminates the need to use exception handling to test for a if `s` is invalid and cannot be successfully parsed. + The method is like the method, except that it does not throw an exception if the conversion fails. This method eliminates the need to use exception handling to test for a if `s` is invalid and cannot be successfully parsed. The `s` parameter should be the string representation of a decimal number in the following form: @@ -6985,22 +6985,22 @@ This member is an explicit interface member implementation. It can be used only |Element|Description| |-------------|-----------------| |*ws*|Optional white space.| -|*sign*|An optional sign. Valid sign characters are determined by the and properties of the current culture.| +|*sign*|An optional sign. Valid sign characters are determined by the and properties of the current culture.| |*digits*|A sequence of decimal digits ranging from 0 to 9.| - The `s` parameter is interpreted by using the style. In addition to the decimal digits, only leading and trailing spaces with a leading sign are allowed. To explicitly define the style elements with the culture-specific formatting information that can be present in `s`, call the method. + The `s` parameter is interpreted by using the style. In addition to the decimal digits, only leading and trailing spaces with a leading sign are allowed. To explicitly define the style elements with the culture-specific formatting information that can be present in `s`, call the method. > [!NOTE] > The string specified by the `s` parameter cannot contain any group separators or decimal separator, and it cannot have a fractional portion. - The `s` parameter is parsed by using the formatting information in a object for the current system culture. For more information, see . + The `s` parameter is parsed by using the formatting information in a object for the current system culture. For more information, see . - This overload interprets all digits in the `s` parameter as decimal digits. To parse the string representation of a hexadecimal number, call the overload instead. + This overload interprets all digits in the `s` parameter as decimal digits. To parse the string representation of a hexadecimal number, call the overload instead. ## Examples - The following example calls the method once for each element in a string array. + The following example calls the method once for each element in a string array. :::code language="csharp" source="~/snippets/csharp/System/UInt16/TryParse/tryparse11.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/UInt16/TryParse/tryparse11.fs" id="Snippet1"::: @@ -7346,7 +7346,7 @@ This member is an explicit interface member implementation. It can be used only method is like the method, except that it does not throw an exception if the conversion fails. This method eliminates the need to use exception handling to test for a if `s` is invalid and cannot be parsed successfully. + The method is like the method, except that it does not throw an exception if the conversion fails. This method eliminates the need to use exception handling to test for a if `s` is invalid and cannot be parsed successfully. The `style` parameter defines the style elements (such as white space or a positive or negative sign) that are allowed in the `s` parameter for the parse operation to succeed. It must be a combination of bit flags from the enumeration. Depending on the value of `style`, the `s` parameter may include the following elements: @@ -7361,7 +7361,7 @@ This member is an explicit interface member implementation. It can be used only |Element|Description| |-------------|-----------------| |*ws*|Optional white space. White space can appear at the start of `s` if `style` includes the flag, or at the end of `s` if `style` includes the flag.| -|*$*|A culture-specific currency symbol. Its position in the string is defined by the property of the object returned by the method of the `provider` parameter. The currency symbol can appear in `s` if `style` includes the flag.| +|*$*|A culture-specific currency symbol. Its position in the string is defined by the property of the object returned by the method of the `provider` parameter. The currency symbol can appear in `s` if `style` includes the flag.| |*sign*|An optional sign. The sign can appear at the start of `s` if `style` includes the flag, and it can appear at the end of `s` if `style` includes the flag. Parentheses can be used in `s` to indicate a negative value if `style` includes the flag. However, if the negative sign is present, `s` can only represent the value zero for the parse operation to succeed.| |*digits*|A sequence of digits from 0 through 9.| |*,*|A culture-specific group separator. The group separator of the culture specified by `provider` can appear in `s` if `style` includes the flag.| @@ -7398,20 +7398,20 @@ This member is an explicit interface member implementation. It can be used only > [!NOTE] > If `s` is the string representation of a hexadecimal number, it cannot be preceded by any decoration (such as `0x` or `&h`) that differentiates it as a hexadecimal number. This causes the conversion to fail. - The `provider` parameter is an implementation. Its method returns a object that provides culture-specific information about the format of `s`. The `provider` parameter can be any one of the following: + The `provider` parameter is an implementation. Its method returns a object that provides culture-specific information about the format of `s`. The `provider` parameter can be any one of the following: -- A object that represents the culture that supplies formatting information. Its method returns the object that provides numeric formatting information for that culture. +- A object that represents the culture that supplies formatting information. Its method returns the object that provides numeric formatting information for that culture. -- A object that provides numeric formatting information. (Its implementation of just returns itself.) +- A object that provides numeric formatting information. (Its implementation of just returns itself.) -- A custom object that implements . Its method instantiates and returns the object that provides formatting information. +- A custom object that implements . Its method instantiates and returns the object that provides formatting information. If `provider` is `null`, the object for the current culture is used. ## Examples - The following example calls the method with a number of different strings and values. + The following example calls the method with a number of different strings and values. :::code language="csharp" source="~/snippets/csharp/System/UInt16/TryParse/tryparse21.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/UInt16/TryParse/tryparse21.fs" id="Snippet2"::: diff --git a/xml/System/UInt64.xml b/xml/System/UInt64.xml index be3ac0792f9..d83d3bf8f49 100644 --- a/xml/System/UInt64.xml +++ b/xml/System/UInt64.xml @@ -445,7 +445,7 @@ ## Examples - The following code example demonstrates the method. + The following code example demonstrates the method. :::code language="csharp" source="~/snippets/csharp/System/UInt64/CompareTo/source.cs" id="Snippet3"::: :::code language="fsharp" source="~/snippets/fsharp/System/UInt64/CompareTo/source.fs" id="Snippet3"::: @@ -529,18 +529,18 @@ interface and performs slightly better than the method because it does not have to convert the `value` parameter to an object. + This method implements the interface and performs slightly better than the method because it does not have to convert the `value` parameter to an object. - Depending on your programming language, it might be possible to code a method where the parameter type has fewer bits (is narrower) than the instance type. This is possible because some programming languages perform an implicit widening conversion that represents the parameter as a type with as many bits as the instance. + Depending on your programming language, it might be possible to code a method where the parameter type has fewer bits (is narrower) than the instance type. This is possible because some programming languages perform an implicit widening conversion that represents the parameter as a type with as many bits as the instance. - For example, suppose the instance type is and the parameter type is . The Microsoft C# compiler generates instructions to represent the value of the parameter as an object, then generates a method that compares the values of the instance and the parameter representation. + For example, suppose the instance type is and the parameter type is . The Microsoft C# compiler generates instructions to represent the value of the parameter as an object, then generates a method that compares the values of the instance and the parameter representation. Consult your programming language's documentation to determine whether its compiler performs implicit widening conversions on numeric types. ## Examples - The following code example demonstrates generic and nongeneric versions of the method for several value and reference types. + The following code example demonstrates generic and nongeneric versions of the method for several value and reference types. :::code language="csharp" source="~/snippets/csharp/System/Boolean/CompareTo/cat.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Boolean/CompareTo/cat.fs" id="Snippet1"::: @@ -832,7 +832,7 @@ method. + The following example demonstrates the method. :::code language="csharp" source="~/snippets/csharp/System/UInt64/Equals/equals1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/UInt64/Equals/equals1.fs" id="Snippet1"::: @@ -904,12 +904,12 @@ interface, and performs slightly better than because it does not have to convert the `obj` parameter to an object. + This method implements the interface, and performs slightly better than because it does not have to convert the `obj` parameter to an object. ## Examples - The following example demonstrates the method. + The following example demonstrates the method. :::code language="csharp" source="~/snippets/csharp/System/UInt64/Equals/uint64_equals.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/UInt64/Equals/uint64_equals.fs" id="Snippet1"::: @@ -1063,7 +1063,7 @@ This method correctly handles floating-point values and so `2.0` will return `true` while `2.2` will return `false`. -A return value of `false` does not imply that will return `true`. A number with a fractional portion, for example, `3.3`, is not even or odd. +A return value of `false` does not imply that will return `true`. A number with a fractional portion, for example, `3.3`, is not even or odd. ]]> @@ -1113,7 +1113,7 @@ A return value of `false` does not imply that will return `true`. A number with a fractional portion, for example, `3.3`, is not even or odd. +A return value of `false` does not imply that will return `true`. A number with a fractional portion, for example, `3.3`, is not even or odd. ]]> @@ -1281,7 +1281,7 @@ A return value of `false` does not imply that this method matches the IEEE 754:2019 `maximum` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. +For this method matches the IEEE 754:2019 `maximum` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. ]]> @@ -1394,7 +1394,7 @@ For this method matches the IEEE 754:2 ## Remarks -For this method matches the IEEE 754:2019 `minimum` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. +For this method matches the IEEE 754:2019 `minimum` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. ]]> @@ -1544,18 +1544,18 @@ For this method matches the IEEE 754:2 |Element|Description| |-------------|-----------------| |*ws*|Optional white space.| -|*sign*|An optional sign. Valid sign characters are determined by the and properties of the current culture. However, the negative sign symbol can be used only with zero; otherwise, the method throws an .| +|*sign*|An optional sign. Valid sign characters are determined by the and properties of the current culture. However, the negative sign symbol can be used only with zero; otherwise, the method throws an .| |*digits*|A sequence of digits ranging from 0 to 9. Any leading zeros are ignored.| > [!NOTE] > The string specified by the `s` parameter is interpreted by using the style. It cannot contain any group separators or decimal separator, and it cannot have a decimal portion. - The `s` parameter is parsed by using the formatting information in a object that is initialized for the current system culture. For more information, see . To parse a string by using the formatting information of a specific culture, use the method. + The `s` parameter is parsed by using the formatting information in a object that is initialized for the current system culture. For more information, see . To parse a string by using the formatting information of a specific culture, use the method. ## Examples - The following example uses the method to parse an array of string values. + The following example uses the method to parse an array of string values. :::code language="csharp" source="~/snippets/csharp/System/UInt64/Parse/parse1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/UInt64/Parse/parse1.fs" id="Snippet1"::: @@ -1740,7 +1740,7 @@ For this method matches the IEEE 754:2 |Element|Description| |-------------|-----------------| |*ws*|Optional white space. White space can appear at the start of `s` if `style` includes the flag, and it can appear at the end of `s` if `style` includes the flag.| -|*$*|A culture-specific currency symbol. Its position in the string is defined by the and properties of the current culture. The current culture's currency symbol can appear in `s` if `style` includes the flag.| +|*$*|A culture-specific currency symbol. Its position in the string is defined by the and properties of the current culture. The current culture's currency symbol can appear in `s` if `style` includes the flag.| |*sign*|An optional sign. The sign can appear at the start of `s` if `style` includes the flag, and it can appear at the end of `s` if `style` includes the flag. Parentheses can be used in `s` to indicate a negative value if `style` includes the flag. However, the negative sign symbol can be used only with zero; otherwise, the method throws an .| |*digits*

*fractional_digits*

*exponential_digits*|A sequence of digits from 0 through 9. For *fractional_digits*, only the digit 0 is valid.| |*,*|A culture-specific group separator symbol. The current culture's group separator can appear in `s` if `style` includes the flag.| @@ -1775,7 +1775,7 @@ For this method matches the IEEE 754:2 > [!NOTE] > If `s` is the string representation of a hexadecimal number, it cannot be preceded by any decoration (such as `0x` or `&h`) that differentiates it as a hexadecimal number. This causes the conversion to fail. - The `s` parameter is parsed by using the formatting information in a object that is initialized for the current system culture. To specify the culture whose formatting information is used for the parse operation, call the overload. + The `s` parameter is parsed by using the formatting information in a object that is initialized for the current system culture. To specify the culture whose formatting information is used for the parse operation, call the overload. @@ -1878,7 +1878,7 @@ For this method matches the IEEE 754:2 method is typically used to convert text that can be formatted in a variety of ways to a value. For example, it can be used to convert the text entered by a user into an HTML text box to a numeric value. + This overload of the method is typically used to convert text that can be formatted in a variety of ways to a value. For example, it can be used to convert the text entered by a user into an HTML text box to a numeric value. The `s` parameter contains a number of the form: @@ -1892,22 +1892,22 @@ For this method matches the IEEE 754:2 |*sign*|An optional positive sign, or a negative sign if `s` represents the value zero.| |*digits*|A sequence of digits ranging from 0 to 9.| - The s parameter is interpreted using the style. In addition to the unsigned integer value's decimal digits, only leading and trailing spaces along with a leading sign is allowed. (If the negative sign is present, `s` must represent a value of zero, or the method throws an .) To explicitly define the style elements together with the culture-specific formatting information that can be present in `s`, use the method. + The s parameter is interpreted using the style. In addition to the unsigned integer value's decimal digits, only leading and trailing spaces along with a leading sign is allowed. (If the negative sign is present, `s` must represent a value of zero, or the method throws an .) To explicitly define the style elements together with the culture-specific formatting information that can be present in `s`, use the method. - The `provider` parameter is an implementation whose method returns a object that provides culture-specific information about the format of `s`. There are three ways to use the `provider` parameter to supply custom formatting information to the parse operation: + The `provider` parameter is an implementation whose method returns a object that provides culture-specific information about the format of `s`. There are three ways to use the `provider` parameter to supply custom formatting information to the parse operation: -- You can pass the actual object that provides formatting information. (Its implementation of simply returns itself.) +- You can pass the actual object that provides formatting information. (Its implementation of simply returns itself.) - You can pass a object that specifies the culture whose formatting is to be used. Its property provides formatting information. -- You can pass a custom implementation. Its method must instantiate and return the object that provides formatting information. +- You can pass a custom implementation. Its method must instantiate and return the object that provides formatting information. If `provider` is `null`, the for the current culture is used. ## Examples - The following example is the button click event handler of a Web form. It uses the array returned by the property to determine the user's locale. It then instantiates a object that corresponds to that locale. The object that belongs to that object is then passed to the method to convert the user's input to a value. + The following example is the button click event handler of a Web form. It uses the array returned by the property to determine the user's locale. It then instantiates a object that corresponds to that locale. The object that belongs to that object is then passed to the method to convert the user's input to a value. :::code language="csharp" source="~/snippets/csharp/System/Decimal/Parse/Default.aspx.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/Decimal/Parse/Default.aspx.vb" id="Snippet1"::: @@ -2119,7 +2119,7 @@ For this method matches the IEEE 754:2 |Element|Description| |-------------|-----------------| |*ws*|Optional white space. White space can appear at the beginning of `s` if `style` includes the flag, and it can appear at the end of `s` if `style` includes the flag.| -|*$*|A culture-specific currency symbol. Its position in the string is defined by the property of the object that is returned by the method of the `provider` parameter. The currency symbol can appear in `s` if `style` includes the flag.| +|*$*|A culture-specific currency symbol. Its position in the string is defined by the property of the object that is returned by the method of the `provider` parameter. The currency symbol can appear in `s` if `style` includes the flag.| |*sign*|An optional sign. (The method throws an if `s` includes a negative sign and represents a non-zero number.) The sign can appear at the beginning of `s` if `style` includes the flag, and it can appear the end of `s` if `style` includes the flag. Parentheses can be used in `s` to indicate a negative value if `style` includes the flag.| |*digits*|A sequence of digits from 0 through 9.| |*.*|A culture-specific decimal point symbol. The current culture's decimal point symbol can appear in `s` if `style` includes the flag.| @@ -2151,20 +2151,20 @@ For this method matches the IEEE 754:2 > [!NOTE] > If the `s` parameter is the string representation of a hexadecimal number, it cannot be preceded by any decoration (such as `0x` or `&h`) that differentiates it as a hexadecimal number. This causes the parse operation to throw an exception. - The `provider` parameter is an implementation whose method returns a object that provides culture-specific information about the format of `s`. There are three ways to use the `provider` parameter to supply custom formatting information to the parse operation: + The `provider` parameter is an implementation whose method returns a object that provides culture-specific information about the format of `s`. There are three ways to use the `provider` parameter to supply custom formatting information to the parse operation: -- You can pass the actual object that provides formatting information. (Its implementation of simply returns itself.) +- You can pass the actual object that provides formatting information. (Its implementation of simply returns itself.) - You can pass a object that specifies the culture whose formatting is to be used. Its property provides formatting information. -- You can pass a custom implementation. Its method must instantiate and return the object that provides formatting information. +- You can pass a custom implementation. Its method must instantiate and return the object that provides formatting information. If `provider` is `null`, the object for the current culture is used. ## Examples - The following example uses the method to convert various string representations of numbers to 64-bit unsigned integer values. + The following example uses the method to convert various string representations of numbers to 64-bit unsigned integer values. :::code language="csharp" source="~/snippets/csharp/System/UInt64/Parse/parseex4.cs" id="Snippet4"::: :::code language="fsharp" source="~/snippets/fsharp/System/UInt64/Parse/parseex4.fs" id="Snippet4"::: @@ -2501,7 +2501,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -2559,7 +2559,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -2617,7 +2617,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -2727,7 +2727,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -2785,7 +2785,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -2843,7 +2843,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -2901,7 +2901,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -2959,7 +2959,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -3017,7 +3017,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -3075,7 +3075,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -3135,7 +3135,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the `static` (`Shared` in Visual Basic) method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the `static` (`Shared` in Visual Basic) method. ]]> @@ -3199,7 +3199,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -3263,7 +3263,7 @@ This member is an explicit interface member implementation. It can be used only instance is cast to an interface. The recommended alternative is to call the method. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method. ]]> @@ -6267,13 +6267,13 @@ This member is an explicit interface member implementation. It can be used only method formats a value in the default ("G", or general) format by using the object of the current culture. If you want to specify a different format or culture, use the other overloads of the method, as follows: + The method formats a value in the default ("G", or general) format by using the object of the current culture. If you want to specify a different format or culture, use the other overloads of the method, as follows: |To use format|For culture|Use the overload| |-------------------|-----------------|----------------------| -|Default ("G") format|A specific culture|| -|A specific format|Default (current) culture|| -|A specific format|A specific culture|| +|Default ("G") format|A specific culture|| +|A specific format|Default (current) culture|| +|A specific format|A specific culture|| @@ -6360,20 +6360,20 @@ This member is an explicit interface member implementation. It can be used only method formats a value in the default ("G", or general) format by using the object of a specified culture. If you want to specify a different format or the current culture, use the other overloads of the method, as follows: + The method formats a value in the default ("G", or general) format by using the object of a specified culture. If you want to specify a different format or the current culture, use the other overloads of the method, as follows: |To use format|For culture|Use the overload| |-------------------|-----------------|----------------------| |Default ("G") format|Default (current) culture|| -|A specific format|Default (current) culture|| -|A specific format|A specific culture|| +|A specific format|Default (current) culture|| +|A specific format|A specific culture|| - The `provider` parameter is an implementation. Its method returns a object that provides culture-specific formatting information. However, none of the properties of the are used when formatting with the general numeric format specifier ("G"). + The `provider` parameter is an implementation. Its method returns a object that provides culture-specific formatting information. However, none of the properties of the are used when formatting with the general numeric format specifier ("G"). ## Examples - The following example formats a 64-bit signed integer value by using several format providers, including one for the invariant culture. The output from the example illustrates that the formatted string returned by the method is the same regardless of the format provider. + The following example formats a 64-bit signed integer value by using several format providers, including one for the invariant culture. The output from the example illustrates that the formatted string returned by the method is the same regardless of the format provider. :::code language="csharp" source="~/snippets/csharp/System/UInt64/ToString/tostring2.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/UInt64/ToString/tostring2.fs" id="Snippet2"::: @@ -6454,13 +6454,13 @@ This member is an explicit interface member implementation. It can be used only method formats a value in a specified format by using a object that represents the conventions of the current culture. If you want to use the default ("G", or general) format or specify a different culture, use the other overloads of the method, as follows: + The method formats a value in a specified format by using a object that represents the conventions of the current culture. If you want to use the default ("G", or general) format or specify a different culture, use the other overloads of the method, as follows: |To use format|For culture|Use the overload| |-------------------|-----------------|----------------------| |Default ("G") format|Default (current) culture|| -|Default ("G") format|A specific culture|| -|A specific format|A specific culture|| +|Default ("G") format|A specific culture|| +|A specific format|A specific culture|| The `format` parameter can be any valid [Standard Numeric Format Strings](/dotnet/standard/base-types/standard-numeric-format-strings), or any combination of [Custom Numeric Format Strings](/dotnet/standard/base-types/custom-numeric-format-strings). If `format` is equal to or is `null`, the return value of the current object is formatted with the general format specifier ("G"). If `format` is any other value, the method throws a . @@ -6470,7 +6470,7 @@ This member is an explicit interface member implementation. It can be used only - For more information about support for formatting in .NET, see [Formatting Types](/dotnet/standard/base-types/formatting-types). - The format of the returned string is determined by the object for the current culture. Depending on the `format` parameter, this object controls symbols such as the group separator and the decimal point symbol in the output string. To provide formatting information for cultures other than the current culture, call the overload. + The format of the returned string is determined by the object for the current culture. Depending on the `format` parameter, this object controls symbols such as the group separator and the decimal point symbol in the output string. To provide formatting information for cultures other than the current culture, call the overload. @@ -6559,13 +6559,13 @@ This member is an explicit interface member implementation. It can be used only method formats a value in a specified format by using the object of a specified culture. If you want to use default format or culture settings, use the other overloads of the method, as follows: + The method formats a value in a specified format by using the object of a specified culture. If you want to use default format or culture settings, use the other overloads of the method, as follows: |To use format|For culture|Use the overload| |-------------------|-----------------|----------------------| |Default ("G") format|Default (current) culture|| -|Default ("G") format|A specific culture|| -|A specific format|Default (current) culture|| +|Default ("G") format|A specific culture|| +|A specific format|Default (current) culture|| The `format` parameter can be any valid [Standard Numeric Format Strings](/dotnet/standard/base-types/standard-numeric-format-strings), or any combination of [Custom Numeric Format Strings](/dotnet/standard/base-types/custom-numeric-format-strings). If `format` is equal to or is `null`, the return value of the current object is formatted with the general format specifier ("G"). If `format` is any other value, the method throws a . @@ -6575,13 +6575,13 @@ This member is an explicit interface member implementation. It can be used only - For more information about formatting, see [Formatting Types](/dotnet/standard/base-types/formatting-types). - The `provider` parameter is an implementation. Its method returns a object that provides culture-specific information about the format of the string returned by this method. When the method is invoked, it calls the `provider` parameter's method and passes it a object that represents the type. The method then returns the object that provides information for formatting the current value, such as the group separator symbol or the decimal point symbol. There are three ways to use the `provider` parameter to supply formatting information to the method: + The `provider` parameter is an implementation. Its method returns a object that provides culture-specific information about the format of the string returned by this method. When the method is invoked, it calls the `provider` parameter's method and passes it a object that represents the type. The method then returns the object that provides information for formatting the current value, such as the group separator symbol or the decimal point symbol. There are three ways to use the `provider` parameter to supply formatting information to the method: -- You can pass a object that represents the culture that supplies formatting information. Its method returns the object that provides numeric formatting information for that culture. +- You can pass a object that represents the culture that supplies formatting information. Its method returns the object that provides numeric formatting information for that culture. -- You can pass the actual object that provides numeric formatting information. (Its implementation of just returns itself.) +- You can pass the actual object that provides numeric formatting information. (Its implementation of just returns itself.) -- You can pass a custom object that implements . Its method instantiates and returns the object that provides formatting information. +- You can pass a custom object that implements . Its method instantiates and returns the object that provides formatting information. If `provider` is `null`, the formatting of the returned string is based on the object of the current culture. @@ -6941,7 +6941,7 @@ This member is an explicit interface member implementation. It can be used only method is like the method, except that it does not throw an exception if the conversion fails. This method eliminates the need to use exception handling to test for a if `s` is invalid and cannot be successfully parsed. + The method is like the method, except that it does not throw an exception if the conversion fails. This method eliminates the need to use exception handling to test for a if `s` is invalid and cannot be successfully parsed. The `s` parameter should be the string representation of a decimal number in the following form: @@ -6952,22 +6952,22 @@ This member is an explicit interface member implementation. It can be used only |Element|Description| |-------------|-----------------| |*ws*|Optional white space.| -|*sign*|An optional sign. Valid sign characters are determined by the and properties of the current culture.| +|*sign*|An optional sign. Valid sign characters are determined by the and properties of the current culture.| |*digits*|A sequence of decimal digits ranging from 0 to 9.| - The `s` parameter is interpreted by using the style. In addition to the decimal digits, only leading and trailing spaces with a leading sign are allowed. To explicitly define the style elements with the culture-specific formatting information that can be present in `s`, call the method. + The `s` parameter is interpreted by using the style. In addition to the decimal digits, only leading and trailing spaces with a leading sign are allowed. To explicitly define the style elements with the culture-specific formatting information that can be present in `s`, call the method. > [!NOTE] > The string specified by the `s` parameter cannot contain any group separators or decimal separator, and it cannot have a fractional portion. - The `s` parameter is parsed using the formatting information in a object initialized for the current system culture. For more information, see . + The `s` parameter is parsed using the formatting information in a object initialized for the current system culture. For more information, see . - This overload interprets all digits in the `s` parameter as decimal digits. To parse the string representation of a hexadecimal number, call the overload instead. + This overload interprets all digits in the `s` parameter as decimal digits. To parse the string representation of a hexadecimal number, call the overload instead. ## Examples - The following example calls the method once for each element in a string array. + The following example calls the method once for each element in a string array. :::code language="csharp" source="~/snippets/csharp/System/UInt64/TryParse/tryparse1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/UInt64/TryParse/tryparse1.fs" id="Snippet1"::: @@ -7313,7 +7313,7 @@ This member is an explicit interface member implementation. It can be used only method is like the method, except that it does not throw an exception if the conversion fails. This method eliminates the need to use exception handling to test for a if `s` is invalid and cannot be parsed successfully. + The method is like the method, except that it does not throw an exception if the conversion fails. This method eliminates the need to use exception handling to test for a if `s` is invalid and cannot be parsed successfully. The `style` parameter defines the style elements (such as white space or a positive or negative sign) that are allowed in the `s` parameter for the parse operation to succeed. It must be a combination of bit flags from the enumeration. Depending on the value of `style`, the `s` parameter may include the following elements: @@ -7328,7 +7328,7 @@ This member is an explicit interface member implementation. It can be used only |Element|Description| |-------------|-----------------| |*ws*|Optional white space. White space can appear at the start of `s` if `style` includes the flag, or at the end of `s` if `style` includes the flag.| -|*$*|A culture-specific currency symbol. Its position in the string is defined by the property of the object returned by the method of the `provider` parameter. The currency symbol can appear in `s` if `style` includes the flag.| +|*$*|A culture-specific currency symbol. Its position in the string is defined by the property of the object returned by the method of the `provider` parameter. The currency symbol can appear in `s` if `style` includes the flag.| |*sign*|An optional sign. The sign can appear at the start of `s` if `style` includes the flag, and it can appear at the end of `s` if `style` includes the flag. Parentheses can be used in `s` to indicate a negative value if `style` includes the flag. However, if the negative sign is present, `s` can only represent the value zero for the parse operation to succeed.| |*digits*|A sequence of digits from 0 through 9.| |*,*|A culture-specific group separator. The group separator of the culture specified by `provider` can appear in `s` if `style` includes the flag.| @@ -7365,20 +7365,20 @@ This member is an explicit interface member implementation. It can be used only > [!NOTE] > If `s` is the string representation of a hexadecimal number, it cannot be preceded by any decoration (such as `0x` or `&h`) that differentiates it as a hexadecimal number. This causes the conversion to fail. - The `provider` parameter is an implementation. Its method returns a object that provides culture-specific information about the format of `s`. The `provider` parameter can be any one of the following: + The `provider` parameter is an implementation. Its method returns a object that provides culture-specific information about the format of `s`. The `provider` parameter can be any one of the following: -- A object that represents the culture that supplies formatting information. Its method returns the object that provides numeric formatting information for that culture. +- A object that represents the culture that supplies formatting information. Its method returns the object that provides numeric formatting information for that culture. -- A object that provides numeric formatting information. (Its implementation of just returns itself.) +- A object that provides numeric formatting information. (Its implementation of just returns itself.) -- A custom object that implements . Its method instantiates and returns the object that provides formatting information. +- A custom object that implements . Its method instantiates and returns the object that provides formatting information. If `provider` is `null`, the object for the current culture is used. ## Examples - The following example calls the method with a number of different strings and values. + The following example calls the method with a number of different strings and values. :::code language="csharp" source="~/snippets/csharp/System/UInt64/TryParse/tryparse2.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/UInt64/TryParse/tryparse2.fs" id="Snippet2"::: diff --git a/xml/System/UIntPtr.xml b/xml/System/UIntPtr.xml index e3ce14198ed..592b32559af 100644 --- a/xml/System/UIntPtr.xml +++ b/xml/System/UIntPtr.xml @@ -278,7 +278,7 @@ > [!NOTE] > Using as a pointer or a handle is error prone and unsafe. It is simply an integer type that can be used as an interchange format for pointers and handles due to being the same size. Outside of specific interchange requirements, such as for passing data to a language that doesn't support pointers, a correctly typed pointer should be used to represent pointers and should be used to represent handles. - This type implements the . In .NET 5 and later versions, this type also implements the interfaces. In .NET 7 and later versions, this type also implements the , , and interfaces. + This type implements the . In .NET 5 and later versions, this type also implements the interfaces. In .NET 7 and later versions, this type also implements the , , and interfaces. In C# starting from version 9.0, you can use the built-in `nuint` type to define native-sized integers. This type is represented by the type internally and provides operations and conversions that are appropriate for integer types. For more information, see [nint and nuint types](/dotnet/csharp/language-reference/builtin-types/nint-nuint). @@ -528,12 +528,12 @@ method does not throw an exception if the result is too large to represent as an unsigned integer in the executing process. Instead, the addition operation is performed in an unchecked context. + The method does not throw an exception if the result is too large to represent as an unsigned integer in the executing process. Instead, the addition operation is performed in an unchecked context. Languages that do not support operator overloading or custom operators can use this method to add an offset to the value of a pointer. ## Examples - The following example instantiates a object that points to the beginning of a ten-element array, and then calls the method to iterate the elements in the array. + The following example instantiates a object that points to the beginning of a ten-element array, and then calls the method to iterate the elements in the array. :::code language="csharp" source="~/snippets/csharp/System/UIntPtr/Add/add1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/UIntPtr/Add/add1.fs" id="Snippet1"::: @@ -1131,7 +1131,7 @@ This method correctly handles floating-point values and so `2.0` will return `true` while `2.2` will return `false`. -A return value of `false` does not imply that will return `true`. A number with a fractional portion, for example, `3.3`, is not even or odd. +A return value of `false` does not imply that will return `true`. A number with a fractional portion, for example, `3.3`, is not even or odd. ]]> @@ -1181,7 +1181,7 @@ A return value of `false` does not imply that will return `true`. A number with a fractional portion, for example, `3.3`, is not even or odd. +A return value of `false` does not imply that will return `true`. A number with a fractional portion, for example, `3.3`, is not even or odd. ]]> @@ -1349,7 +1349,7 @@ A return value of `false` does not imply that this method matches the IEEE 754:2019 `maximum` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. +For this method matches the IEEE 754:2019 `maximum` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. ]]> @@ -1436,7 +1436,7 @@ For this method matches the IEEE 754:2 ## Remarks -For this method matches the IEEE 754:2019 `minimum` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. +For this method matches the IEEE 754:2019 `minimum` function. This requires NaN inputs to be propagated back to the caller and for `-0.0` to be treated as less than `+0.0`. ]]> @@ -1537,19 +1537,19 @@ For this method matches the IEEE 754:2 method defines the addition operation for objects. It enables code such as the following. + The method defines the addition operation for objects. It enables code such as the following. :::code language="csharp" source="~/snippets/csharp/System/UIntPtr/op_Addition/op_addition1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/UIntPtr/op_Addition/op_addition1.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/UIntPtr/op_Addition/op_addition1.vb" id="Snippet1"::: - Languages that do not support custom operators can call the method instead. + Languages that do not support custom operators can call the method instead. The addition operation does not throw an exception if the result is too large to represent as an unsigned integer in the executing process. Instead, it is performed in an unchecked context. In C# starting from version 11 and when targeting the .NET 7 or later runtime, this API is only accessible via reflection. The addition operator is directly recognized by the language and will follow the normal language behavior for addition operations, including overflowing in a `checked` context if the result is too large to represent. - The equivalent method for this operator is . ]]> + The equivalent method for this operator is . ]]> @@ -1615,7 +1615,7 @@ For this method matches the IEEE 754:2 if equals ; otherwise, . - ]]> + ]]> @@ -2028,7 +2028,7 @@ For this method matches the IEEE 754:2 if does not equal ; otherwise, . - ]]> + ]]> @@ -2089,13 +2089,13 @@ For this method matches the IEEE 754:2 method defines the subtraction operation for objects. It enables code such as the following. + The method defines the subtraction operation for objects. It enables code such as the following. :::code language="csharp" source="~/snippets/csharp/System/UIntPtr/op_Addition/op_subtraction1.cs" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/System/UIntPtr/op_Addition/op_subtraction1.fs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System/UIntPtr/op_Addition/op_subtraction1.vb" id="Snippet2"::: - Languages that do not support custom operators can call the method instead. + Languages that do not support custom operators can call the method instead. The subtraction operation does not throw an exception if the result is too small to represent as an unsigned integer in the executing process. Instead, it is performed in an unchecked context. @@ -2780,12 +2780,12 @@ It is recommended that a function return `1`, `0`, and `-1`, respectively. method does not throw an exception if the result is too small to represent as an unsigned integer in the executing process. Instead, the subtraction operation is performed in an unchecked context. + The method does not throw an exception if the result is too small to represent as an unsigned integer in the executing process. Instead, the subtraction operation is performed in an unchecked context. Languages that do not support operator overloading or custom operators can use this method to subtract an offset from the value of a pointer. ## Examples - The following example instantiates an object that points to the end of a ten-element array, and then calls the method to iterate the elements in the array in reverse order. + The following example instantiates an object that points to the end of a ten-element array, and then calls the method to iterate the elements in the array in reverse order. :::code language="csharp" source="~/snippets/csharp/System/UIntPtr/Subtract/subtract1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/UIntPtr/Subtract/subtract1.fs" id="Snippet1"::: @@ -2836,7 +2836,7 @@ It is recommended that a function return `1`, `0`, and `-1`, respectively. ## Remarks -This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. +This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. ]]> @@ -5802,7 +5802,7 @@ This member is an explicit interface member implementation. It can be used only property for this instance is 4, then this method is equivalent to ; otherwise, this method is equivalent to . + If the value of the property for this instance is 4, then this method is equivalent to ; otherwise, this method is equivalent to . ]]> diff --git a/xml/System/UnauthorizedAccessException.xml b/xml/System/UnauthorizedAccessException.xml index 31900c17a8a..c66edf51839 100644 --- a/xml/System/UnauthorizedAccessException.xml +++ b/xml/System/UnauthorizedAccessException.xml @@ -156,8 +156,8 @@ |Property|Value| |--------------|-----------| -||A null reference (`Nothing` in Visual Basic).| -||The localized error message string.| +||A null reference (`Nothing` in Visual Basic).| +||The localized error message string.| ]]> @@ -217,8 +217,8 @@ |Property|Value| |--------------|-----------| -||A null reference (`Nothing` in Visual Basic).| -||The error message string.| +||A null reference (`Nothing` in Visual Basic).| +||The error message string.| ]]> @@ -338,8 +338,8 @@ |Property|Value| |--------------|-----------| -||The inner exception reference.| -||The error message string.| +||The inner exception reference.| +||The error message string.| ]]> diff --git a/xml/System/UnhandledExceptionEventArgs.xml b/xml/System/UnhandledExceptionEventArgs.xml index d650a874411..ae948fd5ad5 100644 --- a/xml/System/UnhandledExceptionEventArgs.xml +++ b/xml/System/UnhandledExceptionEventArgs.xml @@ -170,7 +170,7 @@ ## Remarks This property returns an object of type rather than one derived from . Although the Common Language Specification requires that all exception types derive from , it is possible for methods to throw exceptions with objects not derived from . You can do the following to work with this exception: -- Apply the attribute with a value of `true` to the assembly that contains the event handler. This wraps all exceptions not derived from the class in a object. You can then safely cast (in C#) or convert (in Visual Basic) the object returned by this property to an object, and retrieve the original exception object from the property. Note that some compilers, such as the C# and Visual Basic compilers, automatically apply this attribute. +- Apply the attribute with a value of `true` to the assembly that contains the event handler. This wraps all exceptions not derived from the class in a object. You can then safely cast (in C#) or convert (in Visual Basic) the object returned by this property to an object, and retrieve the original exception object from the property. Note that some compilers, such as the C# and Visual Basic compilers, automatically apply this attribute. - Cast the object returned by this property to an object. diff --git a/xml/System/Uri.xml b/xml/System/Uri.xml index 8a23c8ae6f5..d1f7a3e27da 100644 --- a/xml/System/Uri.xml +++ b/xml/System/Uri.xml @@ -202,7 +202,7 @@ This constructor does not ensure that the refers to an accessi If the `uriString` represents an IPv6 address, it must be enclosed within brackets, for example, "http://[2607:f8b0:400d:c06::69]". -This constructor assumes that the `string` parameter references an absolute URI and is equivalent to calling the constructor with set to . If the `string` parameter passed to the constructor is a relative URI, this constructor throws a . +This constructor assumes that the `string` parameter references an absolute URI and is equivalent to calling the constructor with set to . If the `string` parameter passed to the constructor is a relative URI, this constructor throws a . ## Examples @@ -1179,7 +1179,7 @@ The URI formed by combining and property is typically a server DNS host name or IP address. This property might include the service port number if it differs from the default port for the URI. If the component contains reserved characters, these are escaped in the string value returned by this property. + The property is typically a server DNS host name or IP address. This property might include the service port number if it differs from the default port for the URI. If the component contains reserved characters, these are escaped in the string value returned by this property. ## Examples The following example writes the host name (`www.contoso.com`) and port number (8080) of the server to the console. @@ -1310,7 +1310,7 @@ The URI formed by combining and method checks that the host name provided meets the requirements for a valid Internet host name. It does not, however, perform a host-name lookup to verify the existence of the host. + The method checks that the host name provided meets the requirements for a valid Internet host name. It does not, however, perform a host-name lookup to verify the existence of the host. ## Examples The following example checks whether the host name is valid. @@ -1531,7 +1531,7 @@ The URI formed by combining and method performs the comparison. + If both `uri1` and `uri2` are `null`, this method returns 0. When comparing URI values, a relative URI is always less than an absolute URI, and a non-null URI is always greater than a null URI. For cases where both `uri1` and `uri2` are not `null` and are both relative URIs or both absolute URIs, the method performs the comparison. ]]> @@ -1589,7 +1589,7 @@ The URI formed by combining and property is dependent on configuration settings in .NET Framework apps, as discussed later in this topic. The property is provided as the preferred alternative to using , because is guaranteed to always be DNS safe. + The property is dependent on configuration settings in .NET Framework apps, as discussed later in this topic. The property is provided as the preferred alternative to using , because is guaranteed to always be DNS safe. The property was extended in .NET Framework v3.5, 3.0 SP1, and 2.0 SP1 to provide International Resource Identifier (IRI) support based on RFC 3987. However, to ensure application compatibility with prior versions, you must specifically enable it in .NET Framework apps. To enable support for IRI, the following two changes are required: @@ -1631,13 +1631,13 @@ If you used an escaped string to construct this instance (for example, `"http:// For more information on IRI support, see the Remarks section for the class. ## Examples - The following example creates a instance from a string. It illustrates the difference between the value returned from , which returns the host name or address specified in the URI, and the value returned from , which returns an address that is safe to use in DNS resolution. + The following example creates a instance from a string. It illustrates the difference between the value returned from , which returns the host name or address specified in the URI, and the value returned from , which returns an address that is safe to use in DNS resolution. :::code language="csharp" source="~/snippets/csharp/System/Uri/.ctor/nclurienhancements.cs" id="Snippet4"::: :::code language="fsharp" source="~/snippets/fsharp/System/Uri/.ctor/nclurienhancements.fs" id="Snippet4"::: :::code language="vb" source="~/snippets/visualbasic/System/Uri/.ctor/nclurienhancements.vb" id="Snippet4"::: - As explained in Remarks, unescape the host name before resolving it. You can use the method to unescape the host name, and you can resolve it by calling the method. + As explained in Remarks, unescape the host name before resolving it. You can use the method to unescape the host name, and you can resolve it by calling the method. ]]>
@@ -1704,20 +1704,20 @@ If you used an escaped string to construct this instance (for example, `"http:// method compares the two instances without regard to user information () and fragment () parts that they might contain. For example, given the URIs `http://www.contoso.com/index.htm#search` and `http://user:password@www.contoso.com/index.htm`, the method would return `true`. + The method compares the two instances without regard to user information () and fragment () parts that they might contain. For example, given the URIs `http://www.contoso.com/index.htm#search` and `http://user:password@www.contoso.com/index.htm`, the method would return `true`. - If one instance is formed with a Unicode host name and `comparand` parameter contains a instance or identifier that is formed with a host name that has the equivalent Punycode host name, then returns `true` only if International Resource Identifier (IRI) and Internationalized Domain Name (IDN) support are enabled. Punycode names contain only ASCII characters and always start with the xn-- prefix. + If one instance is formed with a Unicode host name and `comparand` parameter contains a instance or identifier that is formed with a host name that has the equivalent Punycode host name, then returns `true` only if International Resource Identifier (IRI) and Internationalized Domain Name (IDN) support are enabled. Punycode names contain only ASCII characters and always start with the xn-- prefix. For more information on IRI support, see the Remarks section for the class. > [!NOTE] -> In the .NET Framework versions 1.0 and 1.1, the is also ignored. +> In the .NET Framework versions 1.0 and 1.1, the is also ignored. > [!NOTE] -> The method can be overridden in a derived class; use caution as a malicious entity could modify the method. You should not use this method to perform security checks unless you know that this instance came from a trusted source. +> The method can be overridden in a derived class; use caution as a malicious entity could modify the method. You should not use this method to perform security checks unless you know that this instance came from a trusted source. ## Examples - This example creates two instances from strings and compares them to determine whether they represent the same value. `address1` and `address2` are the same because the portion is ignored for this comparison. The outcome is written to the console. + This example creates two instances from strings and compares them to determine whether they represent the same value. `address1` and `address2` are the same because the portion is ignored for this comparison. The outcome is written to the console. :::code language="csharp" source="~/snippets/csharp/System/Uri/CheckSchemeName/uriexamples.cs" id="Snippet8"::: :::code language="fsharp" source="~/snippets/fsharp/System/Uri/CheckSchemeName/uriexamples.fs" id="Snippet8"::: @@ -1917,7 +1917,7 @@ If you used an escaped string to construct this instance (for example, `"http:// method converts all characters except for RFC 2396 unreserved characters to their hexadecimal representation. If International Resource Identifiers (IRIs) or Internationalized Domain Name (IDN) parsing is enabled, the method converts all characters, except for RFC 3986 unreserved characters, to their hexadecimal representation. All Unicode characters are converted to UTF-8 format before being escaped. + By default, the method converts all characters except for RFC 2396 unreserved characters to their hexadecimal representation. If International Resource Identifiers (IRIs) or Internationalized Domain Name (IDN) parsing is enabled, the method converts all characters, except for RFC 3986 unreserved characters, to their hexadecimal representation. All Unicode characters are converted to UTF-8 format before being escaped. This method assumes that `stringToEscape` has no escape sequences in it. @@ -2005,7 +2005,7 @@ If you used an escaped string to construct this instance (for example, `"http:// method converts RFC 2396 reserved characters and all characters with a character value greater than 127 to hexadecimal representation. All Unicode characters are converted to UTF-8 format before being escaped. + The method converts RFC 2396 reserved characters and all characters with a character value greater than 127 to hexadecimal representation. All Unicode characters are converted to UTF-8 format before being escaped. By default, the string is escaped according to RFC 2396. If International Resource Identifiers (IRIs) or Internationalized Domain Name (IDN) parsing is enabled, the string is escaped according to RFC 3986 and RFC 3987. @@ -2075,9 +2075,9 @@ If you used an escaped string to construct this instance (for example, `"http:// method to prepare an unescaped URI string to be a parameter to the constructor. + Use the method to prepare an unescaped URI string to be a parameter to the constructor. - By default, the method converts all characters, except RFC 2396 unreserved characters, to their hexadecimal representation. If International Resource Identifiers (IRIs) or Internationalized Domain Name (IDN) parsing is enabled, the method converts all characters, except for RFC 3986 unreserved characters, to their hexadecimal representation. All Unicode characters are converted to UTF-8 format before being escaped. + By default, the method converts all characters, except RFC 2396 unreserved characters, to their hexadecimal representation. If International Resource Identifiers (IRIs) or Internationalized Domain Name (IDN) parsing is enabled, the method converts all characters, except for RFC 3986 unreserved characters, to their hexadecimal representation. All Unicode characters are converted to UTF-8 format before being escaped. This method assumes that `stringToEscape` has no escape sequences in it. @@ -2141,7 +2141,7 @@ If you used an escaped string to construct this instance (for example, `"http:// ## Remarks The property gets any text following a fragment marker (#) in the URI, including the fragment marker itself. Given the URI `http://www.contoso.com/index.htm#main`, the property would return #main. - The property is not considered in any comparison. + The property is not considered in any comparison. > [!NOTE] > The property includes the leading delimiter (`#`), whereas the URI specification (RFC 3986) recognizes the fragment as the portion of a URI without the delimiter. @@ -2205,7 +2205,7 @@ If you used an escaped string to construct this instance (for example, `"http:// method converts a character representing a hexadecimal digit (0-9, a-f, A-F) to its decimal value (0 to 15). If `digit` is not a valid hexadecimal digit, an exception is thrown. + The method converts a character representing a hexadecimal digit (0-9, a-f, A-F) to its decimal value (0 to 15). If `digit` is not a valid hexadecimal digit, an exception is thrown. ## Examples The following example determines whether a character is a hexadecimal character and, if it is, writes the corresponding decimal value to the console. @@ -2276,12 +2276,12 @@ If you used an escaped string to construct this instance (for example, `"http:// The components are returned in the order that they appear in the URI. For example, if is specified, it appears first. - When International Resource Identifier (IRI) and Internationalized Domain Name (IDN) support are enabled, the number of characters returned in the increases. Punycode names used to support IRI contain only ASCII characters and always start with the xn-- prefix. When IRI and IDN are enabled, Unicode surrogate characters are handled correctly by the method. + When International Resource Identifier (IRI) and Internationalized Domain Name (IDN) support are enabled, the number of characters returned in the increases. Punycode names used to support IRI contain only ASCII characters and always start with the xn-- prefix. When IRI and IDN are enabled, Unicode surrogate characters are handled correctly by the method. For more information on IRI support, see the Remarks section for the class. > [!NOTE] -> If the method is called with `format` set to , you cannot use the return value as an argument to a constructor to create an equivalent . +> If the method is called with `format` set to , you cannot use the return value as an argument to a constructor to create an equivalent . ]]> @@ -2396,22 +2396,22 @@ If you used an escaped string to construct this instance (for example, `"http:// ## Remarks -The method returns a string containing the leftmost portion of the URI string, ending with the portion specified by `part`. +The method returns a string containing the leftmost portion of the URI string, ending with the portion specified by `part`. > [!IMPORTANT] -> The method performs Unicode character encoding and normalization as part of its processing. It is not a simple string manipulation method. The returned string may differ from the original URI string due to this encoding behavior. +> The method performs Unicode character encoding and normalization as part of its processing. It is not a simple string manipulation method. The returned string may differ from the original URI string due to this encoding behavior. -The method is equivalent to calling with the appropriate flags. For example: +The method is equivalent to calling with the appropriate flags. For example: - `GetLeftPart(UriPartial.Authority)` is equivalent to `GetComponents(UriComponents.Scheme | UriComponents.UserInfo | UriComponents.Host | UriComponents.Port, UriFormat.UriEscaped)` - includes delimiters in the following cases: + includes delimiters in the following cases: - includes the scheme delimiter. - does not include the path delimiter. - includes the path delimiter and any delimiters in the original URI up to the query or fragment delimiter. - includes the , plus the query and its delimiter. -The following examples show a URI and the results of calling with , , , or . +The following examples show a URI and the results of calling with , , , or . |URI|Scheme|Authority|Path|Query| |---------|------------|---------------|----------|-----------| @@ -2709,7 +2709,7 @@ The following examples show a URI and the results of calling instance and writes the to the console. + The following example creates a instance and writes the to the console. :::code language="csharp" source="~/snippets/csharp/System/Uri/CheckSchemeName/uriexamples.cs" id="Snippet9"::: :::code language="fsharp" source="~/snippets/fsharp/System/Uri/CheckSchemeName/uriexamples.fs" id="Snippet9"::: @@ -2763,9 +2763,9 @@ The following examples show a URI and the results of calling for the hostname. + This property is provided for the use of lower-level networking protocols that require the domain name in Punycode form. If your code does not require that specific format, use for the hostname. - The deprecated property is dependent on *app.config* settings, which cannot be changed by Windows Store applications. IdnHost is provided as the preferred alternative to using , because is guaranteed to always be DNS safe, no matter what the current *app.config* settings might be. + The deprecated property is dependent on *app.config* settings, which cannot be changed by Windows Store applications. IdnHost is provided as the preferred alternative to using , because is guaranteed to always be DNS safe, no matter what the current *app.config* settings might be. If you used an escaped string to construct this instance (for example, `"http://[fe80::200:39ff:fe36:1a2d%254]/temp/example.htm"`), then IdnHost returns an escaped string. You should unescape any escaped string returned from IdnHost before using that string for DNS resolution. Be aware that if you used an invalid unescaped string to construct this instance (for example, "http://[fe80::200:39ff:fe36:1a2d%4]/temp/example.htm"), then IdnHost returns an unescaped string. @@ -2946,7 +2946,7 @@ The following examples show a URI and the results of calling is used to compare the current instance to a specified to determine whether this URI is a base for the specified . When comparing two objects to determine a base relationship, the user information () is not evaluated. When comparing two URIs (uri1 and uri2), uri1 is the base of uri2 if, when you ignore everything in uri1 and uri2 after the last slash (/), uri2 starts with exactly uri1. Using http://host/path/path/file?query as the base URI, the following table shows whether it is a base for other URIs. + is used to compare the current instance to a specified to determine whether this URI is a base for the specified . When comparing two objects to determine a base relationship, the user information () is not evaluated. When comparing two URIs (uri1 and uri2), uri1 is the base of uri2 if, when you ignore everything in uri1 and uri2 after the last slash (/), uri2 starts with exactly uri1. Using http://host/path/path/file?query as the base URI, the following table shows whether it is a base for other URIs. |URI|http://host/path/path/file?query is base of| |---------|------------------------------------------------------| @@ -2964,7 +2964,7 @@ The following examples show a URI and the results of calling instance that represents a base instance. It then creates a second instance from a string. It calls to determine whether the base instance is the base of the second instance. The outcome is written to the console. + This example creates a instance that represents a base instance. It then creates a second instance from a string. It calls to determine whether the base instance is the base of the second instance. The outcome is written to the console. :::code language="csharp" source="~/snippets/csharp/System/Uri/.ctor/nclurienhancements.cs" id="Snippet6"::: :::code language="fsharp" source="~/snippets/fsharp/System/Uri/.ctor/nclurienhancements.fs" id="Snippet6"::: @@ -3269,7 +3269,7 @@ The following examples show a URI and the results of calling method checks for hexadecimal encoding that follows the pattern "%hexhex" in a string, where "hex" is a digit from 0 to 9 or a letter from A-F (case-insensitive). + The method checks for hexadecimal encoding that follows the pattern "%hexhex" in a string, where "hex" is a digit from 0 to 9 or a letter from A-F (case-insensitive). ## Examples The following code example determines whether a character is hexadecimal encoded and, if so, writes the equivalent character to the console. @@ -3330,7 +3330,7 @@ The following examples show a URI and the results of calling returns `true` if the URI specified when this instance was created was 127.0.0.1, loopback, or localhost, or if the URI did not specify host information (for example, file:///c:Dir/file.txt). All other URIs return `false`. + returns `true` if the URI specified when this instance was created was 127.0.0.1, loopback, or localhost, or if the URI did not specify host information (for example, file:///c:Dir/file.txt). All other URIs return `false`. ## Examples The following example creates a instance and determines whether it references a local host. @@ -3526,7 +3526,7 @@ The following examples show a URI and the results of calling and does not contain "://".|`www.contoso.com/path/file`| -|The parser for the indicates that the original string was not well-formed.|The example depends on the scheme of the URI.| +|The parser for the indicates that the original string was not well-formed.|The example depends on the scheme of the URI.| By default, the string used to construct this are considered well-formed in accordance with RFC 2396 and RFC 2732. @@ -3617,7 +3617,7 @@ The following examples show a URI and the results of calling and does not contain "://"|`www.contoso.com/path/file`| -|The parser for the indicates that the original string was not well-formed.|The example depends on the scheme of the URI.| +|The parser for the indicates that the original string was not well-formed.|The example depends on the scheme of the URI.| |Beginning with .NET 4.5, relative URIs with a colon (':') in their first segment are not considered well-formed.|`2013.05.29_14:33:41`| For more information on IRI support, see the Remarks section for the class. @@ -3757,7 +3757,7 @@ The following examples show a URI and the results of calling . + The following table shows the URI instance, `toUri`, and the results of calling . |Current URI instance|`toUri`|Return value| |--------------------------|-------------|------------------| @@ -3827,7 +3827,7 @@ The following examples show a URI and the results of calling . + The following table shows the URI instance, `toUri`, and the results of calling . |Current URI instance|`toUri`|Return value| |--------------------------|-------------|------------------| @@ -3906,10 +3906,10 @@ The following examples show a URI and the results of calling method to determine whether the two instances are equivalent. and content is ignored when making this comparison. + This overload uses the method to determine whether the two instances are equivalent. and content is ignored when making this comparison. ## Examples - This example creates three instances from strings and compares them to determine whether they represent the same value. `Address1` and `Address2` are the same because the portion is ignored for this comparison. The outcome is written to the console. + This example creates three instances from strings and compares them to determine whether they represent the same value. `Address1` and `Address2` are the same because the portion is ignored for this comparison. The outcome is written to the console. :::code language="csharp" source="~/snippets/csharp/System/Uri/.ctor/nclurienhancements.cs" id="Snippet5"::: :::code language="fsharp" source="~/snippets/fsharp/System/Uri/.ctor/nclurienhancements.fs" id="Snippet5"::: @@ -3973,10 +3973,10 @@ The following examples show a URI and the results of calling method to determine whether the two instances are not equivalent. and content is ignored when making this comparison. + This overload uses the method to determine whether the two instances are not equivalent. and content is ignored when making this comparison. ## Examples - This example creates three instances from strings and compares them to determine whether they represent the same value. `Address2` and `Address3` are not the same because `Address3` contains a that is not found in `Address2`. The outcome is written to the console. + This example creates three instances from strings and compares them to determine whether they represent the same value. `Address2` and `Address3` are not the same because `Address3` contains a that is not found in `Address2`. The outcome is written to the console. :::code language="csharp" source="~/snippets/csharp/System/Uri/.ctor/nclurienhancements.cs" id="Snippet5"::: :::code language="fsharp" source="~/snippets/fsharp/System/Uri/.ctor/nclurienhancements.fs" id="Snippet5"::: @@ -4034,16 +4034,16 @@ The following examples show a URI and the results of calling and . returns the canonically unescaped form of the URI. returns the canonically escaped form of the URI. + The value returned by this property differs from and . returns the canonically unescaped form of the URI. returns the canonically escaped form of the URI. - When International Resource Identifier (IRI) and Internationalized Domain Name (IDN) support are enabled, returns the original non normalized string with Punycode host name if one was used to initialize the instance. Punycode names contain only ASCII characters and always start with the xn-- prefix. + When International Resource Identifier (IRI) and Internationalized Domain Name (IDN) support are enabled, returns the original non normalized string with Punycode host name if one was used to initialize the instance. Punycode names contain only ASCII characters and always start with the xn-- prefix. For more information on IRI support, see the Remarks section for the class. - When a object is serialized, the is not preserved. The serialization process uses the fully escaped and canonicalized property when serializing. For a that contains an IPv6 address, the IPv6 address and the scope ID are included in the serialized object. + When a object is serialized, the is not preserved. The serialization process uses the fully escaped and canonicalized property when serializing. For a that contains an IPv6 address, the IPv6 address and the scope ID are included in the serialized object. ## Examples - The following example creates a new instance from a string. It illustrates the difference between the value returned from , which returns the string that was passed to the constructor, and from a call to , which returns the canonical form of the string. + The following example creates a new instance from a string. It illustrates the difference between the value returned from , which returns the string that was passed to the constructor, and from a call to , which returns the canonical form of the string. :::code language="csharp" source="~/snippets/csharp/System/Uri/.ctor/nclurienhancements.cs" id="Snippet3"::: :::code language="fsharp" source="~/snippets/fsharp/System/Uri/.ctor/nclurienhancements.fs" id="Snippet3"::: @@ -4157,7 +4157,7 @@ The following examples show a URI and the results of calling property contains the absolute path on the server and the query information sent with the request. It is identical to concatenating the and properties. + The property contains the absolute path on the server and the query information sent with the request. It is identical to concatenating the and properties. The property is escaped according to RFC 2396 by default. If International Resource Identifiers (IRIs) or Internationalized Domain Name (IDN) parsing is enabled, the property is escaped according to RFC 3986 and RFC 3987. @@ -4722,10 +4722,10 @@ The following examples show a URI and the results of calling [!NOTE] -> The string returned by the method may contain control characters, which can corrupt the state of a console application. You can use the method with the format to remove control characters from the returned string. +> The string returned by the method may contain control characters, which can corrupt the state of a console application. You can use the method with the format to remove control characters from the returned string. ## Examples - The following example creates a new instance from a string. It illustrates the difference between the value returned from , which returns the string that was passed to the constructor, and from a call to , which returns the canonical form of the string. + The following example creates a new instance from a string. It illustrates the difference between the value returned from , which returns the string that was passed to the constructor, and from a call to , which returns the canonical form of the string. :::code language="csharp" source="~/snippets/csharp/System/Uri/CheckSchemeName/uriexamples.cs" id="Snippet7"::: :::code language="fsharp" source="~/snippets/fsharp/System/Uri/CheckSchemeName/uriexamples.fs" id="Snippet7"::: @@ -5028,7 +5028,7 @@ The following examples show a URI and the results of calling is in `result`. - This method constructs the URI, puts it in canonical form, and validates it. If an unhandled exception occurs, this method catches it. If you want to create a and get exceptions use one of the constructors. + This method constructs the URI, puts it in canonical form, and validates it. If an unhandled exception occurs, this method catches it. If you want to create a and get exceptions use one of the constructors. ]]> diff --git a/xml/System/UriBuilder.xml b/xml/System/UriBuilder.xml index 8a29f1a3e06..5474478c24f 100644 --- a/xml/System/UriBuilder.xml +++ b/xml/System/UriBuilder.xml @@ -348,7 +348,7 @@ Note: In method compares a specified instance with the instance built by the instance. If the two are the same, the method returns `true`. + The method compares a specified instance with the instance built by the instance. If the two are the same, the method returns `true`. ]]> @@ -775,7 +775,7 @@ The property contains any text following a fra The hash codes for A and B are guaranteed to be the same when A.Equals(B) is `true`. - This method implements . + This method implements . ]]> @@ -1221,7 +1221,7 @@ The set accessor validates the scheme name for validity according to RFC 2396. T The display string contains the property value if one of the following conditions is true: - The property was set. -- The port was specified when the was constructed using one of the constructors that accept a port number parameter. +- The port was specified when the was constructed using one of the constructors that accept a port number parameter. In either case, the display string does not contain the property value if the port number was set to a value of -1 (for the default port). diff --git a/xml/System/UriComponents.xml b/xml/System/UriComponents.xml index f64d370d275..a823d5d594e 100644 --- a/xml/System/UriComponents.xml +++ b/xml/System/UriComponents.xml @@ -55,11 +55,11 @@ Specifies the parts of a . - . This enumeration is used with the method. - + . This enumeration is used with the method. + ]]> diff --git a/xml/System/UriFormat.xml b/xml/System/UriFormat.xml index 0d570fd8457..6aa84d011ec 100644 --- a/xml/System/UriFormat.xml +++ b/xml/System/UriFormat.xml @@ -49,15 +49,15 @@ Controls how URI information is escaped. - method to specify the level of character escaping in the returned URI. - - RFC 2396 defines the standard escaping for URIs, and is available at [https://rfc-editor.org](https://rfc-editor.org). - - SafeUnescaped leaves the following characters escaped if the character has a reserved meaning in the requested : "%", "#", "?", "/", "\\", and "@". - + method to specify the level of character escaping in the returned URI. + + RFC 2396 defines the standard escaping for URIs, and is available at [https://rfc-editor.org](https://rfc-editor.org). + + SafeUnescaped leaves the following characters escaped if the character has a reserved meaning in the requested : "%", "#", "?", "/", "\\", and "@". + ]]> diff --git a/xml/System/UriFormatException.xml b/xml/System/UriFormatException.xml index 8a58ec8f849..126d3a55e6d 100644 --- a/xml/System/UriFormatException.xml +++ b/xml/System/UriFormatException.xml @@ -322,8 +322,8 @@ |Property|Value| |--------------|-----------| -||`null`.| -||The error message string specified in `message`.| +||`null`.| +||The error message string specified in `message`.| ]]> diff --git a/xml/System/UriHostNameType.xml b/xml/System/UriHostNameType.xml index df1a565472e..79cd8a21cb2 100644 --- a/xml/System/UriHostNameType.xml +++ b/xml/System/UriHostNameType.xml @@ -50,11 +50,11 @@ Defines host name types for the method. - enumeration defines the values that the method can return. - + enumeration defines the values that the method can return. + ]]> diff --git a/xml/System/UriParser.xml b/xml/System/UriParser.xml index d56e6c3ef71..ad6bb555cee 100644 --- a/xml/System/UriParser.xml +++ b/xml/System/UriParser.xml @@ -156,7 +156,7 @@ method to determine the value of various parts of the URI, such as the , , or . + Use the method to determine the value of various parts of the URI, such as the , , or . The components are returned in the order that they appear in the URI. For example, if is specified, it appears first. @@ -237,7 +237,7 @@ method is called every time a is instantiated. + The method is called every time a is instantiated. ]]> @@ -386,7 +386,7 @@ method will return false if: + The method will return false if: - The string is not correctly escaped per RFC 2396. @@ -544,7 +544,7 @@ method registers no default value for the port number. + If the `defaultPort` parameter is set to -1, the method registers no default value for the port number. ]]> @@ -620,7 +620,7 @@ constructors and use to construct a URI from `baseUri` and `relativeUri`. + constructors and use to construct a URI from `baseUri` and `relativeUri`. If a parsing error occurs, the returned string for the resolved relative is null. diff --git a/xml/System/UriPartial.xml b/xml/System/UriPartial.xml index e8a60764799..a204d950e90 100644 --- a/xml/System/UriPartial.xml +++ b/xml/System/UriPartial.xml @@ -45,11 +45,11 @@ Defines the parts of a URI for the method. - enumeration defines the values that can be passed to the method. - + enumeration defines the values that can be passed to the method. + ]]> diff --git a/xml/System/UriTemplate.xml b/xml/System/UriTemplate.xml index dffd439998c..c5edd4eedd6 100644 --- a/xml/System/UriTemplate.xml +++ b/xml/System/UriTemplate.xml @@ -46,7 +46,7 @@ - "weather/{state}/{city}?forecast={day} - The preceding URI templates might be used for organizing weather reports. Segments enclosed in curly braces are variables, everything else is a literal. You can convert a instance into a by replacing variables with actual values. For example, taking the template "weather/{state}/{city}" and putting in values for the variables "{state}" and "{city}" gives you "weather/WA/Seattle". Given a candidate URI, you can test whether it matches a given URI template by calling . You can also use instances to create a from a set of variable values by calling or . + The preceding URI templates might be used for organizing weather reports. Segments enclosed in curly braces are variables, everything else is a literal. You can convert a instance into a by replacing variables with actual values. For example, taking the template "weather/{state}/{city}" and putting in values for the variables "{state}" and "{city}" gives you "weather/WA/Seattle". Given a candidate URI, you can test whether it matches a given URI template by calling . You can also use instances to create a from a set of variable values by calling or . @@ -265,7 +265,7 @@ ](xref:System.Collections.Generic.IDictionary%602) parameter contains a collection of parameter name and value pairs. The parameters are matched up against the variables within the template by a case-insensitive comparison. + The [IDictionary\](xref:System.Collections.Generic.IDictionary`2) parameter contains a collection of parameter name and value pairs. The parameters are matched up against the variables within the template by a case-insensitive comparison. > [!NOTE] > The name/value collection passed to this method must contain a key for every template variable. Extra name/value pairs that do not match template variables are appended to the query string of the final URI. @@ -318,7 +318,7 @@ The parameter contains a collection of parameter name/value pairs. The parameters are matched up against the variables within the template by a case-insensitive comparison. Values passed in this collection are escaped. > [!NOTE] -> The name/value collection passed to must contain a key for every template variable. Extra name/value pairs that do not match template variables are appended to the query string of the final URI. +> The name/value collection passed to must contain a key for every template variable. Extra name/value pairs that do not match template variables are appended to the query string of the final URI. > [!NOTE] > It is possible to pass in text within the name/value pairs that prevent the generated URI from matching the template that is used to generate it. Examples of such text includes: '/', '..', '*', '{', and '}'. @@ -326,7 +326,7 @@ ## Examples - The following example shows how to call the method. + The following example shows how to call the method. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/uritemplate/cs/snippets.cs" id="Snippet4"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CFX/uritemplate/vb/snippets.vb" id="Snippet4"::: @@ -467,7 +467,7 @@ ## Examples - The following example shows how to call the . + The following example shows how to call the . :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/uritemplate/cs/snippets.cs" id="Snippet5"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CFX/uritemplate/vb/snippets.vb" id="Snippet5"::: @@ -569,7 +569,7 @@ ## Examples - The following example shows how to call the . + The following example shows how to call the . :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/uritemplate/cs/snippets.cs" id="Snippet6"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CFX/uritemplate/vb/snippets.vb" id="Snippet6"::: @@ -615,7 +615,7 @@ ## Examples - The following example shows how to call the method. + The following example shows how to call the method. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/uritemplate/cs/snippets.cs" id="Snippet7"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CFX/uritemplate/vb/snippets.vb" id="Snippet7"::: diff --git a/xml/System/UriTemplateEquivalenceComparer.xml b/xml/System/UriTemplateEquivalenceComparer.xml index 1f82661ff01..c2e5c16ef45 100644 --- a/xml/System/UriTemplateEquivalenceComparer.xml +++ b/xml/System/UriTemplateEquivalenceComparer.xml @@ -35,19 +35,19 @@ A class used to compare instances for structural (instead of reference) equivalence. - instances are compared using reference equality by default. The class evaluates equivalence using instead of the default reference equality check. This class is useful when you wish to compare two instances based on the URIs they match instead of strict reference equality. - - - -## Examples - The following example shows the difference between reference equality and structural equality. It also shows how to use the as a comparer in a dictionary. - + instances are compared using reference equality by default. The class evaluates equivalence using instead of the default reference equality check. This class is useful when you wish to compare two instances based on the URIs they match instead of strict reference equality. + + + +## Examples + The following example shows the difference between reference equality and structural equality. It also shows how to use the as a comparer in a dictionary. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/uritemplateequivalencecomparer/cs/program.cs" id="Snippet0"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CFX/uritemplateequivalencecomparer/vb/program.vb" id="Snippet0"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CFX/uritemplateequivalencecomparer/vb/program.vb" id="Snippet0"::: + ]]> @@ -77,14 +77,14 @@ Initializes a new instance of the class. - @@ -121,18 +121,18 @@ Compares two instances for equivalence. A value that indicates whether the two instances are equivalent. - instances. - - - -## Examples - The following code shows how to call the method. - - :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/uritemplateequivalencecomparer/cs/snippets.cs" id="Snippet2"::: - + instances. + + + +## Examples + The following code shows how to call the method. + + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/uritemplateequivalencecomparer/cs/snippets.cs" id="Snippet2"::: + ]]> @@ -167,11 +167,11 @@ Gets a hash code for the specified instance. The hash code. - instance. - + instance. + ]]> diff --git a/xml/System/UriTemplateMatch.xml b/xml/System/UriTemplateMatch.xml index 3391bc5479c..b84d8a204a7 100644 --- a/xml/System/UriTemplateMatch.xml +++ b/xml/System/UriTemplateMatch.xml @@ -34,7 +34,7 @@ class represents the results of calling the method. This class is not thread safe. + The class represents the results of calling the method. This class is not thread safe. @@ -70,7 +70,7 @@ instance is returned from the or method. The method returns a collection of as well. + Usually you do not directly instantiate this class, a instance is returned from the or method. The method returns a collection of as well. ]]> @@ -187,7 +187,7 @@ to a you associate data with the template. This value is application specific; no particular semantics are associated with this value. When is called and a match is found the data associated with the matching template is returned in the property. + When you add a to a you associate data with the template. This value is application specific; no particular semantics are associated with this value. When is called and a match is found the data associated with the matching template is returned in the property. diff --git a/xml/System/UriTemplateTable.xml b/xml/System/UriTemplateTable.xml index 4e0d97683b6..8908e707520 100644 --- a/xml/System/UriTemplateTable.xml +++ b/xml/System/UriTemplateTable.xml @@ -34,11 +34,11 @@ is an associative set of objects bound to an object of the developer's choosing. It allows you to match candidate Uniform Resource Identifiers (URIs) against the templates in the set and retrieve the data associated with the matching templates. The contents of can be changed until the method is called, at which time one of following types of validation occurs: + A is an associative set of objects bound to an object of the developer's choosing. It allows you to match candidate Uniform Resource Identifiers (URIs) against the templates in the set and retrieve the data associated with the matching templates. The contents of can be changed until the method is called, at which time one of following types of validation occurs: -- When is called passing in `false`, the checks to make sure the table contains no multiple structurally-equivalent templates. If it finds such templates, it throws an exception. This type of validation is used in conjunction with when you want to ensure only one template matches an incoming URI. +- When is called passing in `false`, the checks to make sure the table contains no multiple structurally-equivalent templates. If it finds such templates, it throws an exception. This type of validation is used in conjunction with when you want to ensure only one template matches an incoming URI. -- When is called passing in `true`, multiple structurally-equivalent templates can be contained within a . However, any query strings in the templates must not be ambiguous; identical query strings are allowed. For more information about ambiguous query strings, see [UriTemplate and UriTemplateTable](/dotnet/framework/wcf/feature-details/uritemplate-and-uritemplatetable). +- When is called passing in `true`, multiple structurally-equivalent templates can be contained within a . However, any query strings in the templates must not be ambiguous; identical query strings are allowed. For more information about ambiguous query strings, see [UriTemplate and UriTemplateTable](/dotnet/framework/wcf/feature-details/uritemplate-and-uritemplatetable). @@ -249,7 +249,7 @@ property can only be set prior to calling or or otherwise an is thrown. + The property can only be set prior to calling or or otherwise an is thrown. @@ -290,7 +290,7 @@ is read only after the method is called. + A is read only after the method is called. @@ -336,7 +336,7 @@ instance in the table has data associated with it. The property contains a collection of key value pairs where the key is a instance and the value is the data associated with the . Values can only be added to property prior to calling or or otherwise a is thrown. + Each instance in the table has data associated with it. The property contains a collection of key value pairs where the key is a instance and the value is the data associated with the . Values can only be added to property prior to calling or or otherwise a is thrown. @@ -379,13 +379,13 @@ method is called, one of the following types of validation occurs: + When the method is called, one of the following types of validation occurs: -- When is called passing in `false`, the checks to make sure the table contains no multiple structurally-equivalent templates. If it finds such templates, an exception is thrown. This type of validation is used in conjunction with when you want to ensure only one template matches an incoming URI. +- When is called passing in `false`, the checks to make sure the table contains no multiple structurally-equivalent templates. If it finds such templates, an exception is thrown. This type of validation is used in conjunction with when you want to ensure only one template matches an incoming URI. -- When is called passing in `true`, multiple structurally-equivalent templates can be contained within a . However, any query strings in the templates must not be ambiguous; identical query strings are allowed. This type of validation is used in conjunction with when multiple template matches are allowed on the candidate URI. +- When is called passing in `true`, multiple structurally-equivalent templates can be contained within a . However, any query strings in the templates must not be ambiguous; identical query strings are allowed. This type of validation is used in conjunction with when multiple template matches are allowed on the candidate URI. - Only the first call to is honored, subsequent calls are ignored without any exception being thrown. + Only the first call to is honored, subsequent calls are ignored without any exception being thrown. ]]> @@ -426,7 +426,7 @@ ## Examples - The following example shows how to call the method. + The following example shows how to call the method. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/uritemplatetable/cs/snippets.cs" id="Snippet9"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CFX/uritemplatetable/vb/snippets.vb" id="Snippet9"::: @@ -470,7 +470,7 @@ ## Examples - The following example shows how to call the method. + The following example shows how to call the method. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/uritemplatetable/cs/snippets.cs" id="Snippet10"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CFX/uritemplatetable/vb/snippets.vb" id="Snippet10"::: diff --git a/xml/System/ValueTuple.xml b/xml/System/ValueTuple.xml index 7d672cbb728..9ba594dafb9 100644 --- a/xml/System/ValueTuple.xml +++ b/xml/System/ValueTuple.xml @@ -281,7 +281,7 @@ is a helper method that you can call to instantiate a 1-component value tuple without having to explicitly specify the type of its component. + is a helper method that you can call to instantiate a 1-component value tuple without having to explicitly specify the type of its component. ]]> @@ -366,7 +366,7 @@ is a helper method that you can call to instantiate an 2-component value tuple without having to explicitly specify the types of its components. + is a helper method that you can call to instantiate an 2-component value tuple without having to explicitly specify the types of its components. ]]> @@ -462,7 +462,7 @@ is a helper method that you can call to instantiate an 3-component value tuple without having to explicitly specify the types of its components. + is a helper method that you can call to instantiate an 3-component value tuple without having to explicitly specify the types of its components. ]]> @@ -569,7 +569,7 @@ is a helper method that you can call to instantiate an 4-component value tuple without having to explicitly specify the types of its components. + is a helper method that you can call to instantiate an 4-component value tuple without having to explicitly specify the types of its components. ]]> @@ -687,7 +687,7 @@ is a helper method that you can call to instantiate a 5-component value tuple without having to explicitly specify the types of its components. + is a helper method that you can call to instantiate a 5-component value tuple without having to explicitly specify the types of its components. ]]> @@ -816,7 +816,7 @@ is a helper method that you can call to instantiate a 6-component value tuple without having to explicitly specify the types of its components. + is a helper method that you can call to instantiate a 6-component value tuple without having to explicitly specify the types of its components. ]]> @@ -956,7 +956,7 @@ is a helper method that you can call to instantiate an 7-component value tuple without having to explicitly specify the types of its components. + is a helper method that you can call to instantiate an 7-component value tuple without having to explicitly specify the types of its components. ]]> @@ -1107,10 +1107,10 @@ is a helper method that you can call to instantiate an 8-component value tuple without having to explicitly specify the types of its components. + is a helper method that you can call to instantiate an 8-component value tuple without having to explicitly specify the types of its components. > [!NOTE] -> You must call the constructor to create a tuple with nine or more components unless your language provides a special syntax for this purpose. The static methods of the structure cannot be used to create a tuple with nine or more components. +> You must call the constructor to create a tuple with nine or more components unless your language provides a special syntax for this purpose. The static methods of the structure cannot be used to create a tuple with nine or more components. ]]> @@ -1399,7 +1399,7 @@ t> instance is cast to an interface. The implementation is called only if `other` is not `null`, and if it can be successfully cast to a object. + This member is an explicit interface implementation. It can only be used when the t> instance is cast to an interface. The implementation is called only if `other` is not `null`, and if it can be successfully cast to a object. ]]> diff --git a/xml/System/ValueTuple`1.xml b/xml/System/ValueTuple`1.xml index af75e14a26a..41a523946d4 100644 --- a/xml/System/ValueTuple`1.xml +++ b/xml/System/ValueTuple`1.xml @@ -300,7 +300,7 @@ ## Remarks The `obj` argument is considered to be equal to the current instance under the following conditions: -- It is a value type. +- It is a value type. - It component is of the same types as that of the current instance. @@ -789,7 +789,7 @@ property is an explicit interface implementation. To call it, you must cast or convert the object to a interface object. + The property is an explicit interface implementation. To call it, you must cast or convert the object to a interface object. ]]> @@ -842,7 +842,7 @@ property is an explicit interface implementation. To call it, you must cast or convert the object to an interface object. + The property is an explicit interface implementation. To call it, you must cast or convert the object to an interface object. ]]> @@ -896,7 +896,7 @@ field. If the field value is `null`, it is represented as . + The string returned by this method takes the form (*Item1*, where *Item1* represents the value of the field. If the field value is `null`, it is represented as . ]]> diff --git a/xml/System/ValueTuple`2.xml b/xml/System/ValueTuple`2.xml index e603290c7ca..59ade626711 100644 --- a/xml/System/ValueTuple`2.xml +++ b/xml/System/ValueTuple`2.xml @@ -313,7 +313,7 @@ ## Remarks The `obj` argument is considered to be equal to the current instance under the following conditions: -- It is a value type. +- It is a value type. - Its components are of the same types as those of the current instance. @@ -863,7 +863,7 @@ The property is an explicit interface implementation. To call it, you must cast or convert the object to an interface object. + The property is an explicit interface implementation. To call it, you must cast or convert the object to an interface object. ]]> @@ -916,7 +916,7 @@ The property is an explicit interface implementation. To call it, you must cast or convert the object to an interface object. + The property is an explicit interface implementation. To call it, you must cast or convert the object to an interface object. ]]> @@ -970,7 +970,7 @@ The and fields. If any of the field values is `null`, it is represented as . + The string returned by this method takes the form (*Item1*, *Item2*, where *Item1* and *Item2* represent the values of the and fields. If any of the field values is `null`, it is represented as . ]]> diff --git a/xml/System/ValueTuple`3.xml b/xml/System/ValueTuple`3.xml index 3bd23f34859..425ede82edd 100644 --- a/xml/System/ValueTuple`3.xml +++ b/xml/System/ValueTuple`3.xml @@ -324,7 +324,7 @@ ## Remarks The `obj` argument is considered to be equal to the current instance under the following conditions: -- It is a value type. +- It is a value type. - Its components are of the same types as those of the current instance. @@ -915,7 +915,7 @@ property is an explicit interface implementation. To call it, you must cast or convert the object to an interface object. + The property is an explicit interface implementation. To call it, you must cast or convert the object to an interface object. ]]> @@ -968,7 +968,7 @@ property is an explicit interface implementation. To call it, you must cast or convert the object to an interface object. + The property is an explicit interface implementation. To call it, you must cast or convert the object to an interface object. ]]> @@ -1022,7 +1022,7 @@ , , and fields. If any of the field values is `null`, it is represented as . + The string returned by this method takes the form (*Item1*, *Item2*, *Item3*, where *Item1*, *Item2*, and *Item3* represent the values of the , , and fields. If any of the field values is `null`, it is represented as . ]]> diff --git a/xml/System/ValueTuple`4.xml b/xml/System/ValueTuple`4.xml index f38b742faf8..53d728afd2b 100644 --- a/xml/System/ValueTuple`4.xml +++ b/xml/System/ValueTuple`4.xml @@ -339,7 +339,7 @@ ## Remarks The `obj` argument is considered to be equal to the current instance under the following conditions: -- It is a value type. +- It is a value type. - Its components are of the same types as those of the current instance. @@ -957,7 +957,7 @@ property is an explicit interface implementation. To call it, you must cast or convert the object to an interface object. + The property is an explicit interface implementation. To call it, you must cast or convert the object to an interface object. ]]> @@ -1010,7 +1010,7 @@ property is an explicit interface implementation. To call it, you must cast or convert the object to an interface object. + The property is an explicit interface implementation. To call it, you must cast or convert the object to an interface object. ]]> @@ -1064,7 +1064,7 @@ , , , and fields. If any of the field values is `null`, it is represented as . + The string returned by this method takes the form (*Item1*, *Item2*, *Item3*, *Item4*, where *Item1*, *Item2*, *Item3*, and *Item4* represent the values of the , , , and fields. If any of the field values is `null`, it is represented as . ]]> diff --git a/xml/System/ValueTuple`5.xml b/xml/System/ValueTuple`5.xml index 83916007a32..c95b2881031 100644 --- a/xml/System/ValueTuple`5.xml +++ b/xml/System/ValueTuple`5.xml @@ -350,7 +350,7 @@ ## Remarks The `obj` argument is considered to be equal to the current instance under the following conditions: -- It is a value type. +- It is a value type. - Its components are of the same types as those of the current instance. @@ -1013,7 +1013,7 @@ property is an explicit interface implementation. To call it, you must cast or convert the object to an interface object. + The property is an explicit interface implementation. To call it, you must cast or convert the object to an interface object. ]]> @@ -1066,7 +1066,7 @@ property is an explicit interface implementation. To call it, you must cast or convert the object to an interface object. + The property is an explicit interface implementation. To call it, you must cast or convert the object to an interface object. ]]> @@ -1120,7 +1120,7 @@ , , , , and fields. If any of the field values is `null`, it is represented as . + The string returned by this method takes the form (*Item1*, *Item2*, *Item3*, *Item4*, *Item5*, where *Item1*, *Item2*, *Item3*, *Item4*, and *Item5* represent the values of the , , , , and fields. If any of the field values is `null`, it is represented as . ]]> diff --git a/xml/System/ValueTuple`6.xml b/xml/System/ValueTuple`6.xml index ea02d4a176d..f6d41c297d9 100644 --- a/xml/System/ValueTuple`6.xml +++ b/xml/System/ValueTuple`6.xml @@ -361,7 +361,7 @@ ## Remarks The `obj` argument is considered to be equal to the current instance under the following conditions: -- It is a value type. +- It is a value type. - Its components are of the same types as those of the current instance. @@ -1069,7 +1069,7 @@ property is an explicit interface implementation. To call it, you must cast or convert the object to an interface object. + The property is an explicit interface implementation. To call it, you must cast or convert the object to an interface object. ]]> @@ -1122,7 +1122,7 @@ property is an explicit interface implementation. To call it, you must cast or convert the object to an interface object. + The property is an explicit interface implementation. To call it, you must cast or convert the object to an interface object. ]]> @@ -1176,7 +1176,7 @@ , , , , , and fields. If any of the field values is `null`, it is represented as . + The string returned by this method takes the form (*Item1*, *Item2*, *Item3*, *Item4*, *Item5*, *Item6*, where *Item1*, *Item2*, *Item3*, *Item4*, *Item5*, and *Item6* represent the values of the , , , , , and fields. If any of the field values is `null`, it is represented as . ]]> diff --git a/xml/System/ValueTuple`7.xml b/xml/System/ValueTuple`7.xml index d3c213c7dba..25f03b5ffcf 100644 --- a/xml/System/ValueTuple`7.xml +++ b/xml/System/ValueTuple`7.xml @@ -372,7 +372,7 @@ ## Remarks The `obj` argument is considered to be equal to the current instance under the following conditions: -- It is a value type. +- It is a value type. - Its components are of the same types as those of the current instance. @@ -1125,7 +1125,7 @@ property is an explicit interface implementation. To call it, you must cast or convert the object to an interface object. + The property is an explicit interface implementation. To call it, you must cast or convert the object to an interface object. ]]> @@ -1178,7 +1178,7 @@ property is an explicit interface implementation. To call it, you must cast or convert the object to an interface object. + The property is an explicit interface implementation. To call it, you must cast or convert the object to an interface object. ]]> @@ -1232,7 +1232,7 @@ , , , , , , and fields. If any of the field values is `null`, it is represented as . + The string returned by this method takes the form (*Item1*, *Item2*, *Item3*, *Item4*, *Item5*, *Item6*, *Item7*, where *Item1*, *Item2*, *Item3*, *Item4*, *Item5*, *Item6*, and *Item7* represent the values of the , , , , , , and fields. If any of the field values is `null`, it is represented as . ]]> diff --git a/xml/System/ValueTuple`8.xml b/xml/System/ValueTuple`8.xml index 40298fa13fd..6027fdeda5f 100644 --- a/xml/System/ValueTuple`8.xml +++ b/xml/System/ValueTuple`8.xml @@ -247,7 +247,7 @@ method without having to explicitly specify the types of its elements. + In addition to using your language's build-in support for tuples, you can also create a value tuple by calling the static method without having to explicitly specify the types of its elements. ]]> @@ -406,7 +406,7 @@ ## Remarks The `obj` argument is considered to be equal to the current instance under the following conditions: -- It is a value type. +- It is a value type. - Its components are of the same types as those of the current instance. @@ -902,7 +902,7 @@ field returns a nested value tuple that allows access to the eighth though *n*th elements of the tuple. Depending on the total number of elements in the tuple, the values of the eighth through fourteenth components can be retrieved from the nested value tuple's `Item1` through `Item7` properties. You can then use the property of a nested object to retrieve the value tuple at the next level of nesting. + The field returns a nested value tuple that allows access to the eighth though *n*th elements of the tuple. Depending on the total number of elements in the tuple, the values of the eighth through fourteenth components can be retrieved from the nested value tuple's `Item1` through `Item7` properties. You can then use the property of a nested object to retrieve the value tuple at the next level of nesting. ]]> @@ -982,14 +982,14 @@ instance is cast to an interface. + This member is an explicit interface implementation. It can only be used when the instance is cast to an interface. - This method lets you define customized comparisons of objects. For example, you can use this method to order objects based on the value of a specific component. + This method lets you define customized comparisons of objects. For example, you can use this method to order objects based on the value of a specific component. - Although this method can be called directly, it is most commonly called by collection-sorting methods that include parameters to order the members of a collection. For example, it is called by the method and the method of a object that is instantiated by using the constructor. + Although this method can be called directly, it is most commonly called by collection-sorting methods that include parameters to order the members of a collection. For example, it is called by the method and the method of a object that is instantiated by using the constructor. > [!CAUTION] -> The method is intended for use in sorting operations. It should not be used when the primary purpose of a comparison is to determine whether two objects are equal. To determine whether two objects are equal, call the method. +> The method is intended for use in sorting operations. It should not be used when the primary purpose of a comparison is to determine whether two objects are equal. To determine whether two objects are equal, call the method. ]]> @@ -1054,9 +1054,9 @@ instance is cast to an interface. + This member is an explicit interface implementation. It can only be used when the instance is cast to an interface. - The implementation is called only if `other` is not `null`, and if it can be successfully cast to a object that has the same total number of components (including those in nested tuple objects) of the same types as the current instance. The method first passes the values of the objects to be compared to the implementation. If this method call returns `true`, the method is called again and passed the values of the two objects. This continues until the method call returns `false` when it compares a specific pair of values, or the two values are passed to the method. + The implementation is called only if `other` is not `null`, and if it can be successfully cast to a object that has the same total number of components (including those in nested tuple objects) of the same types as the current instance. The method first passes the values of the objects to be compared to the implementation. If this method call returns `true`, the method is called again and passed the values of the two objects. This continues until the method call returns `false` when it compares a specific pair of values, or the two values are passed to the method. ]]> @@ -1116,9 +1116,9 @@ instance is cast to an interface. The method simply wraps a call to the `comparer` object's implementation. + This member is an explicit interface implementation. It can only be used when the instance is cast to an interface. The method simply wraps a call to the `comparer` object's implementation. - The algorithm used to compute the hash code should return the same hash code for two objects that are considered to be equal. + The algorithm used to compute the hash code should return the same hash code for two objects that are considered to be equal. ]]> @@ -1196,12 +1196,12 @@ instance is cast to an interface. + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. - This method provides the implementation for the structure. Although the method can be called directly, it is most commonly called by the default overloads of collection-sorting methods, such as and , to order the members of a collection. + This method provides the implementation for the structure. Although the method can be called directly, it is most commonly called by the default overloads of collection-sorting methods, such as and , to order the members of a collection. > [!CAUTION] -> The method is intended for use in sorting operations. It should not be used when the primary purpose of a comparison is to determine whether two objects are equal. To determine whether two objects are equal, call the method. +> The method is intended for use in sorting operations. It should not be used when the primary purpose of a comparison is to determine whether two objects are equal. To determine whether two objects are equal, call the method. This method uses the default object comparer to compare each component. @@ -1267,7 +1267,7 @@ property is an explicit interface implementation. To call it, you must cast or convert the object to an interface object. + The property is an explicit interface implementation. To call it, you must cast or convert the object to an interface object. ]]> @@ -1324,7 +1324,7 @@ property is an explicit interface implementation. To call it, you must cast or convert the object to an interface object. + The property is an explicit interface implementation. To call it, you must cast or convert the object to an interface object. ]]> @@ -1378,7 +1378,7 @@ , , , , , , and fields. *Item8* represents the value of the instance's `Next.Item1` field. The value of any additional nested elements follows *Item8*. If any of the field values is `null`, it is represented as . + The string returned by this method takes the form (*Item1*, *Item2*, *Item3*, *Item4*, *Item5*, *Item6*, *Item7*, *Item8*…), where *Item1*, *Item2*, *Item3*, *Item4*, *Item5*, *Item6*, and *Item7* represent the values of the , , , , , , and fields. *Item8* represents the value of the instance's `Next.Item1` field. The value of any additional nested elements follows *Item8*. If any of the field values is `null`, it is represented as . ]]> diff --git a/xml/System/ValueType.xml b/xml/System/ValueType.xml index 056fe13e921..880bdb936f4 100644 --- a/xml/System/ValueType.xml +++ b/xml/System/ValueType.xml @@ -210,12 +210,12 @@ The default implementation calls method on a Windows Runtime structure, it provides the default behavior for value types that don't override . This is part of the support that .NET provides for the Windows Runtime (see [.NET Support for Windows Store Apps and Windows Runtime](/dotnet/standard/cross-platform/support-for-windows-store-apps-and-windows-runtime)). Windows Runtime structures can't override , even if they're written with C# or Visual Basic, because they can't have methods. (In addition, structures in the Windows Runtime itself don't inherit .) However, they appear to have , , and methods when you use them in your C# or Visual Basic code, and .NET provides the default behavior for these methods. +When you call the method on a Windows Runtime structure, it provides the default behavior for value types that don't override . This is part of the support that .NET provides for the Windows Runtime (see [.NET Support for Windows Store Apps and Windows Runtime](/dotnet/standard/cross-platform/support-for-windows-store-apps-and-windows-runtime)). Windows Runtime structures can't override , even if they're written with C# or Visual Basic, because they can't have methods. (In addition, structures in the Windows Runtime itself don't inherit .) However, they appear to have , , and methods when you use them in your C# or Visual Basic code, and .NET provides the default behavior for these methods. ]]> method can be overridden by a derived value type. +The following example demonstrates how the method can be overridden by a derived value type. :::code language="csharp" source="~/snippets/csharp/System/ValueType/Equals/source.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/ValueType/Equals/source.fs" id="Snippet1"::: @@ -276,20 +276,20 @@ The following example demonstrates how the met A 32-bit signed integer that is the hash code for this instance. method applies to types derived from . One or more fields of the derived type is used to calculate the return value. If you call the derived type's `GetHashCode` method, the return value is not likely to be suitable for use as a key in a hash table. Additionally, if the value of one or more of those fields changes, the return value might become unsuitable for use as a key in a hash table. In either case, consider writing your own implementation of the method that more closely represents the concept of a hash code for the type. +The method applies to types derived from . One or more fields of the derived type is used to calculate the return value. If you call the derived type's `GetHashCode` method, the return value is not likely to be suitable for use as a key in a hash table. Additionally, if the value of one or more of those fields changes, the return value might become unsuitable for use as a key in a hash table. In either case, consider writing your own implementation of the method that more closely represents the concept of a hash code for the type. -For more information, see , and . +For more information, see , and . -.NET 9 and later, the default implementation of throws if is applied to the type. +.NET 9 and later, the default implementation of throws if is applied to the type. ## Notes for the Windows Runtime -When you call the method on a Windows Runtime structure, it provides the default behavior for value types that don't override . This is part of the support that .NET provides for the Windows Runtime (see [.NET Support for Windows Store Apps and Windows Runtime](/dotnet/standard/cross-platform/support-for-windows-store-apps-and-windows-runtime)). Windows Runtime structures can't override , even if they're written with C# or Visual Basic, because they can't have methods. (In addition, structures in the Windows Runtime itself don't inherit .) However, they appear to have , , and methods when you use them in your C# or Visual Basic code, and .NET provides the default behavior for these methods. +When you call the method on a Windows Runtime structure, it provides the default behavior for value types that don't override . This is part of the support that .NET provides for the Windows Runtime (see [.NET Support for Windows Store Apps and Windows Runtime](/dotnet/standard/cross-platform/support-for-windows-store-apps-and-windows-runtime)). Windows Runtime structures can't override , even if they're written with C# or Visual Basic, because they can't have methods. (In addition, structures in the Windows Runtime itself don't inherit .) However, they appear to have , , and methods when you use them in your C# or Visual Basic code, and .NET provides the default behavior for these methods. ]]> method can be overridden by a derived value type. +The following example demonstrates how the method can be overridden by a derived value type. :::code language="csharp" source="~/snippets/csharp/System/ValueType/Equals/source.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/ValueType/Equals/source.fs" id="Snippet1"::: @@ -348,19 +348,19 @@ The following example demonstrates how the method overrides the method and provides the default implementation of the `ToString` method for value types. (Value types are types defined by the `struct` keyword in C#, and by the `Structure`...`End Structure` construct in Visual Basic.) Functionally, however, the implementation is that same as that of : the method returns the fully qualified type name. + The method overrides the method and provides the default implementation of the `ToString` method for value types. (Value types are types defined by the `struct` keyword in C#, and by the `Structure`...`End Structure` construct in Visual Basic.) Functionally, however, the implementation is that same as that of : the method returns the fully qualified type name. - Value types defined by the `struct` keyword in C# and the `Structure`...`End Structure` construct in Visual Basic typically override the method to provide a more meaningful string representation of the value type. The following example illustrates the difference. It defines two value types, `EmployeeA` and `EmployeeB`, creates an instance of each, and calls its `ToString` method. Because the `EmployeeA` structure does not override the method, it displays only the fully qualified type name. The `EmployeeB.ToString` method, on the other hand, provides meaningful information about the object. + Value types defined by the `struct` keyword in C# and the `Structure`...`End Structure` construct in Visual Basic typically override the method to provide a more meaningful string representation of the value type. The following example illustrates the difference. It defines two value types, `EmployeeA` and `EmployeeB`, creates an instance of each, and calls its `ToString` method. Because the `EmployeeA` structure does not override the method, it displays only the fully qualified type name. The `EmployeeB.ToString` method, on the other hand, provides meaningful information about the object. :::code language="csharp" source="~/snippets/csharp/System/ValueType/ToString/ToString2.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/ValueType/ToString/ToString2.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/System/ValueType/ToString/ToString2.vb" id="Snippet1"::: - Note that, although enumeration types are also value types, they derive from the class, which overrides . + Note that, although enumeration types are also value types, they derive from the class, which overrides . ## Notes for the Windows Runtime - When you call the method on a Windows Runtime structure, it provides the default behavior for value types that don't override . This is part of the support that .NET provides for the Windows Runtime (see [.NET Support for Windows Store Apps and Windows Runtime](/dotnet/standard/cross-platform/support-for-windows-store-apps-and-windows-runtime)). Windows Runtime structures can't override , even if they're written with C# or Visual Basic, because they can't have methods. (In addition, structures in the Windows Runtime itself don't inherit .) However, they appear to have , , and methods when you use them in your C# or Visual Basic code, and .NET provides the default behavior for these methods. + When you call the method on a Windows Runtime structure, it provides the default behavior for value types that don't override . This is part of the support that .NET provides for the Windows Runtime (see [.NET Support for Windows Store Apps and Windows Runtime](/dotnet/standard/cross-platform/support-for-windows-store-apps-and-windows-runtime)). Windows Runtime structures can't override , even if they're written with C# or Visual Basic, because they can't have methods. (In addition, structures in the Windows Runtime itself don't inherit .) However, they appear to have , , and methods when you use them in your C# or Visual Basic code, and .NET provides the default behavior for these methods. ]]> diff --git a/xml/System/Version.xml b/xml/System/Version.xml index 3842d324db3..2322c56999d 100644 --- a/xml/System/Version.xml +++ b/xml/System/Version.xml @@ -116,7 +116,7 @@ For more information about this API, see Supplemental API remarks for Version. attribute to assign a version number to an assembly. At compile time, this version information is stored with the assembly's metadata. At run time, the example retrieves the value of the property on a type found in the assembly to get a reference to the executing assembly, and it retrieves the assembly's version information from the property of the object returned by the method. +The following example uses the attribute to assign a version number to an assembly. At compile time, this version information is stored with the assembly's metadata. At run time, the example retrieves the value of the property on a type found in the assembly to get a reference to the executing assembly, and it retrieves the assembly's version information from the property of the object returned by the method. :::code language="csharp" source="~/snippets/csharp/System/Version/Overview/example1.cs" id="Snippet6"::: :::code language="fsharp" source="~/snippets/fsharp/System/Version/Overview/example1.fs" id="Snippet6"::: @@ -178,10 +178,10 @@ The following example uses the |Property|Value| |--------------|-----------| -||0| -||0| -||undefined (-1)| -||undefined (-1)| +||0| +||0| +||undefined (-1)| +||undefined (-1)| ]]> @@ -306,10 +306,10 @@ The following example uses the |Property|Value| |--------------|-----------| -||`major`| -||`minor`| -||undefined (-1)| -||undefined (-1)| +||`major`| +||`minor`| +||undefined (-1)| +||undefined (-1)| ]]> @@ -372,10 +372,10 @@ The following example uses the |Property|Value| |--------------|-----------| -||`major`| -||`minor`| -||`build`| -||undefined (-1)| +||`major`| +||`minor`| +||`build`| +||undefined (-1)| ]]> @@ -440,15 +440,15 @@ The following example uses the |Property|Value| |--------------|-----------| -||`major`| -||`minor`| -||`build`| -||`revision`| +||`major`| +||`minor`| +||`build`| +||`revision`| ## Examples - The following code example demonstrates the constructor, and , , , , , and properties. + The following code example demonstrates the constructor, and , , , , , and properties. :::code language="csharp" source="~/snippets/csharp/System/Version/.ctor/rev.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Version/.ctor/rev.fs" id="Snippet1"::: @@ -512,7 +512,7 @@ The following example uses the ## Examples - The following code example demonstrates the constructor, and , , , , , and properties. + The following code example demonstrates the constructor, and , , , , , and properties. :::code language="csharp" source="~/snippets/csharp/System/Version/.ctor/rev.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Version/.ctor/rev.fs" id="Snippet1"::: @@ -748,7 +748,7 @@ The following example uses the interface, and performs slightly better than the method because it does not have to unbox the `value` parameter. + This method implements the interface, and performs slightly better than the method because it does not have to unbox the `value` parameter. The components of `Version` in decreasing order of importance are: major, minor, build, and revision. An unknown component is assumed to be older than any known component. For example: @@ -910,7 +910,7 @@ The following example uses the interface, and performs slightly better than the method because it does not have to unbox the `obj` parameter. + This method implements the interface, and performs slightly better than the method because it does not have to unbox the `obj` parameter. ]]> @@ -966,7 +966,7 @@ The following example uses the constructor, and , , , , , and properties. + The following code example demonstrates the constructor, and , , , , , and properties. :::code language="csharp" source="~/snippets/csharp/System/Version/.ctor/rev.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Version/.ctor/rev.fs" id="Snippet1"::: @@ -1082,7 +1082,7 @@ The following example uses the ## Examples - The following code example demonstrates the constructor, and the , , , , , and properties. + The following code example demonstrates the constructor, and the , , , , , and properties. :::code language="csharp" source="~/snippets/csharp/System/Version/.ctor/rev.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Version/.ctor/rev.fs" id="Snippet1"::: @@ -1145,7 +1145,7 @@ The following example uses the ## Examples - The following code example demonstrates the constructor, and , , , , , and properties. + The following code example demonstrates the constructor, and , , , , , and properties. :::code language="csharp" source="~/snippets/csharp/System/Version/.ctor/rev.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Version/.ctor/rev.fs" id="Snippet1"::: @@ -1206,7 +1206,7 @@ The following example uses the ## Examples - The following code example demonstrates the constructor, and the , , , , , and properties. + The following code example demonstrates the constructor, and the , , , , , and properties. :::code language="csharp" source="~/snippets/csharp/System/Version/.ctor/rev.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Version/.ctor/rev.fs" id="Snippet1"::: @@ -1269,7 +1269,7 @@ The following example uses the if equals ; otherwise, . - ]]> + ]]> @@ -1327,7 +1327,7 @@ The following example uses the if is greater than ; otherwise, . - ]]> + ]]> @@ -1385,7 +1385,7 @@ The following example uses the if is greater than or equal to ; otherwise, . - ]]> + ]]> @@ -1443,7 +1443,7 @@ The following example uses the if does not equal ; otherwise, . - ]]> + ]]> @@ -1501,7 +1501,7 @@ The following example uses the if is less than ; otherwise, . - ]]> + ]]> .NET Framework only: is . @@ -1560,7 +1560,7 @@ The following example uses the if is less than or equal to ; otherwise, . - ]]> + ]]> .NET Framework only: is . @@ -1729,12 +1729,12 @@ where `major`, `minor`, `build`, and `revision` are the string representations o where `major`, `minor`, `build`, and `revision` are the string representations of the version number's four components: major version number, minor version number, build number, and revision number, respectively. Optional components are shown in square brackets ([ and ]). The components must appear in the specified order and must be separated by periods. > [!IMPORTANT] -> Because the string representation of a version number must conform to a recognized pattern, applications should always use exception handling when calling the method to parse user input. Alternatively, you can call the method to parse the string representation of a version number and return a value that indicates whether the parse operation succeeded. +> Because the string representation of a version number must conform to a recognized pattern, applications should always use exception handling when calling the method to parse user input. Alternatively, you can call the method to parse the string representation of a version number and return a value that indicates whether the parse operation succeeded. - The method is a convenience method; it is equivalent to calling the constructor. + The method is a convenience method; it is equivalent to calling the constructor. ## Examples - The following example uses the method to parse a number of strings that contain version information. + The following example uses the method to parse a number of strings that contain version information. :::code language="csharp" source="~/snippets/csharp/System/Version/Parse/parse1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Version/Parse/parse1.fs" id="Snippet1"::: @@ -1805,7 +1805,7 @@ where `major`, `minor`, `build`, and `revision` are the string representations o ## Examples - The following code example demonstrates the constructor, and , , , , , and properties. + The following code example demonstrates the constructor, and , , , , , and properties. :::code language="csharp" source="~/snippets/csharp/System/Version/.ctor/rev.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Version/.ctor/rev.fs" id="Snippet1"::: @@ -2497,7 +2497,7 @@ This member is an explicit interface member implementation. ## Remarks -The `TryParse` method is similar to the method, except that it doesn't throw an exception if the conversion fails. Instead, it returns `false` if `input` is `null`, has fewer than two or more than four components, has at least one component that is not an integer, has at least one component that is less than zero, or has at least one component that is greater than . +The `TryParse` method is similar to the method, except that it doesn't throw an exception if the conversion fails. Instead, it returns `false` if `input` is `null`, has fewer than two or more than four components, has at least one component that is not an integer, has at least one component that is less than zero, or has at least one component that is greater than . For the parse operation to succeed, the `input` parameter must be in the following format: @@ -2576,7 +2576,7 @@ where `major`, `minor`, `build`, and `revision` are the string representations o method, except that it doesn't throw an exception if the conversion fails. Instead, it returns `false` if `input` is `null`, has fewer than two or more than four components, has at least one component that is not an integer, has at least one component that is less than zero, or has at least one component that is greater than . + The `TryParse` method is similar to the method, except that it doesn't throw an exception if the conversion fails. Instead, it returns `false` if `input` is `null`, has fewer than two or more than four components, has at least one component that is not an integer, has at least one component that is less than zero, or has at least one component that is greater than . For the parse operation to succeed, the `input` parameter must be in the following format: @@ -2587,7 +2587,7 @@ where `major`, `minor`, `build`, and `revision` are the string representations o ## Examples - The following example uses the method to parse a number of strings that contain version information. + The following example uses the method to parse a number of strings that contain version information. :::code language="csharp" source="~/snippets/csharp/System/Version/TryParse/tryparse1.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/System/Version/TryParse/tryparse1.fs" id="Snippet1"::: diff --git a/xml/System/WeakReference.xml b/xml/System/WeakReference.xml index ae1961052dc..efa665ca1c3 100644 --- a/xml/System/WeakReference.xml +++ b/xml/System/WeakReference.xml @@ -83,7 +83,7 @@ ## Examples - The following example demonstrates how you can use weak references to maintain a cache of objects as a resource for an application. The cache is constructed using an of objects keyed by an index value. The property for the objects is an object in a byte array that represents data. + The following example demonstrates how you can use weak references to maintain a cache of objects as a resource for an application. The cache is constructed using an of objects keyed by an index value. The property for the objects is an object in a byte array that represents data. The example randomly accesses objects in the cache. If an object is reclaimed for garbage collection, a new data object is regenerated; otherwise, the object is available to access because of the weak reference. diff --git a/xml/System/WindowsRuntimeSystemExtensions.xml b/xml/System/WindowsRuntimeSystemExtensions.xml index 8da67b528c9..8efd4be52ff 100644 --- a/xml/System/WindowsRuntimeSystemExtensions.xml +++ b/xml/System/WindowsRuntimeSystemExtensions.xml @@ -32,11 +32,11 @@ ## Remarks -The extension method overloads enable you to use a .NET object to manage an asynchronous operation from the Windows Runtime. +The extension method overloads enable you to use a .NET object to manage an asynchronous operation from the Windows Runtime. -The method and the method enable you to pass started tasks to methods that take Windows Runtime asynchronous actions and operations. See also the methods of the class. +The method and the method enable you to pass started tasks to methods that take Windows Runtime asynchronous actions and operations. See also the methods of the class. -The methods are used by compilers to implement the `await` operation (`Await` in Visual Basic). +The methods are used by compilers to implement the `await` operation (`Await` in Visual Basic). ]]> @@ -74,7 +74,7 @@ The methods are used Use this method when you want to pass a task to a Windows Runtime method that takes an asynchronous action. -The class provides static methods (`Shared` methods in Visual Basic) that create and start Windows Runtime asynchronous actions that represent tasks that can respond to cancellation requests and report progress. +The class provides static methods (`Shared` methods in Visual Basic) that create and start Windows Runtime asynchronous actions that represent tasks that can respond to cancellation requests and report progress. ]]> @@ -239,11 +239,11 @@ Use this method to get a object for a Windows ## Remarks > [!NOTE] -> In Visual Basic and C#, you can call this method as an instance method on any object of type . When you use instance method syntax to call this method, omit the first parameter. For more information, see [Extension Methods (Visual Basic)](/dotnet/visual-basic/programming-guide/language-features/procedures/extension-methods) or [Extension Methods (C# Programming Guide)](/dotnet/csharp/programming-guide/classes-and-structs/extension-methods). +> In Visual Basic and C#, you can call this method as an instance method on any object of type . When you use instance method syntax to call this method, omit the first parameter. For more information, see [Extension Methods (Visual Basic)](/dotnet/visual-basic/programming-guide/language-features/procedures/extension-methods) or [Extension Methods (C# Programming Guide)](/dotnet/csharp/programming-guide/classes-and-structs/extension-methods). Use this method to get a object for a Windows Runtime asynchronous operation. objects simplify the coordination of asynchronous operations. -Calling this method overload is equivalent to calling the extension method overload and specifying `null` for the `progress` parameter. This is useful when you don't want to get progress reports from an action that reports progress. +Calling this method overload is equivalent to calling the extension method overload and specifying `null` for the `progress` parameter. This is useful when you don't want to get progress reports from an action that reports progress. ]]> @@ -284,7 +284,7 @@ Calling this method overload is equivalent to calling the [!NOTE] -> In Visual Basic and C#, you can call this method as an instance method on any object of type . When you use instance method syntax to call this method, omit the first parameter. For more information, see [Extension Methods (Visual Basic)](/dotnet/visual-basic/programming-guide/language-features/procedures/extension-methods) or [Extension Methods (C# Programming Guide)](/dotnet/csharp/programming-guide/classes-and-structs/extension-methods). +> In Visual Basic and C#, you can call this method as an instance method on any object of type . When you use instance method syntax to call this method, omit the first parameter. For more information, see [Extension Methods (Visual Basic)](/dotnet/visual-basic/programming-guide/language-features/procedures/extension-methods) or [Extension Methods (C# Programming Guide)](/dotnet/csharp/programming-guide/classes-and-structs/extension-methods). Use this method to get a object for a Windows Runtime asynchronous operation. objects simplify the coordination of asynchronous operations. @@ -327,11 +327,11 @@ Use this method to get a object for a Windows ## Remarks > [!NOTE] -> In Visual Basic and C#, you can call this method as an instance method on any object of type . When you use instance method syntax to call this method, omit the first parameter. For more information, see [Extension Methods (Visual Basic)](/dotnet/visual-basic/programming-guide/language-features/procedures/extension-methods) or [Extension Methods (C# Programming Guide)](/dotnet/csharp/programming-guide/classes-and-structs/extension-methods). +> In Visual Basic and C#, you can call this method as an instance method on any object of type . When you use instance method syntax to call this method, omit the first parameter. For more information, see [Extension Methods (Visual Basic)](/dotnet/visual-basic/programming-guide/language-features/procedures/extension-methods) or [Extension Methods (C# Programming Guide)](/dotnet/csharp/programming-guide/classes-and-structs/extension-methods). Use this method to get a object for a Windows Runtime asynchronous operation. objects simplify the coordination of asynchronous operations. -Calling this method overload is equivalent to calling the extension method overload and specifying `null` for the `progress` parameter. This is useful when you don't want to get progress reports from an action that reports progress. +Calling this method overload is equivalent to calling the extension method overload and specifying `null` for the `progress` parameter. This is useful when you don't want to get progress reports from an action that reports progress. ]]> @@ -374,7 +374,7 @@ Calling this method overload is equivalent to calling the [!NOTE] -> In Visual Basic and C#, you can call this method as an instance method on any object of type . When you use instance method syntax to call this method, omit the first parameter. For more information, see [Extension Methods (Visual Basic)](/dotnet/visual-basic/programming-guide/language-features/procedures/extension-methods) or [Extension Methods (C# Programming Guide)](/dotnet/csharp/programming-guide/classes-and-structs/extension-methods). +> In Visual Basic and C#, you can call this method as an instance method on any object of type . When you use instance method syntax to call this method, omit the first parameter. For more information, see [Extension Methods (Visual Basic)](/dotnet/visual-basic/programming-guide/language-features/procedures/extension-methods) or [Extension Methods (C# Programming Guide)](/dotnet/csharp/programming-guide/classes-and-structs/extension-methods). Use this method to get a object for a Windows Runtime asynchronous operation. objects simplify the coordination of asynchronous operations. @@ -415,9 +415,9 @@ Use this method to get a object for a Windows ## Remarks > [!NOTE] -> In Visual Basic and C#, you can call this method as an instance method on any object of type . When you use instance method syntax to call this method, omit the first parameter. For more information, see [Extension Methods (Visual Basic)](/dotnet/visual-basic/programming-guide/language-features/procedures/extension-methods) or [Extension Methods (C# Programming Guide)](/dotnet/csharp/programming-guide/classes-and-structs/extension-methods). +> In Visual Basic and C#, you can call this method as an instance method on any object of type . When you use instance method syntax to call this method, omit the first parameter. For more information, see [Extension Methods (Visual Basic)](/dotnet/visual-basic/programming-guide/language-features/procedures/extension-methods) or [Extension Methods (C# Programming Guide)](/dotnet/csharp/programming-guide/classes-and-structs/extension-methods). -Use this method to get a object for a Windows Runtime asynchronous operation. objects simplify the coordination of asynchronous operations. +Use this method to get a object for a Windows Runtime asynchronous operation. objects simplify the coordination of asynchronous operations. ]]> @@ -458,9 +458,9 @@ Use this method to get a object for a Win ## Remarks > [!NOTE] -> In Visual Basic and C#, you can call this method as an instance method on any object of type . When you use instance method syntax to call this method, omit the first parameter. For more information, see [Extension Methods (Visual Basic)](/dotnet/visual-basic/programming-guide/language-features/procedures/extension-methods) or [Extension Methods (C# Programming Guide)](/dotnet/csharp/programming-guide/classes-and-structs/extension-methods). +> In Visual Basic and C#, you can call this method as an instance method on any object of type . When you use instance method syntax to call this method, omit the first parameter. For more information, see [Extension Methods (Visual Basic)](/dotnet/visual-basic/programming-guide/language-features/procedures/extension-methods) or [Extension Methods (C# Programming Guide)](/dotnet/csharp/programming-guide/classes-and-structs/extension-methods). -Use this method to get a object for a Windows Runtime asynchronous operation. objects simplify the coordination of asynchronous operations. +Use this method to get a object for a Windows Runtime asynchronous operation. objects simplify the coordination of asynchronous operations. ]]> @@ -502,11 +502,11 @@ Use this method to get a object for a Win ## Remarks > [!NOTE] -> In Visual Basic and C#, you can call this method as an instance method on any object of type . When you use instance method syntax to call this method, omit the first parameter. For more information, see [Extension Methods (Visual Basic)](/dotnet/visual-basic/programming-guide/language-features/procedures/extension-methods) or [Extension Methods (C# Programming Guide)](/dotnet/csharp/programming-guide/classes-and-structs/extension-methods). +> In Visual Basic and C#, you can call this method as an instance method on any object of type . When you use instance method syntax to call this method, omit the first parameter. For more information, see [Extension Methods (Visual Basic)](/dotnet/visual-basic/programming-guide/language-features/procedures/extension-methods) or [Extension Methods (C# Programming Guide)](/dotnet/csharp/programming-guide/classes-and-structs/extension-methods). -Use this method to get a object for a Windows Runtime asynchronous operation. objects simplify the coordination of asynchronous operations. +Use this method to get a object for a Windows Runtime asynchronous operation. objects simplify the coordination of asynchronous operations. -Calling this method overload is equivalent to calling the extension method overload and specifying `null` for the `progress` parameter. This is useful when you don't want to get progress reports from an action that reports progress. +Calling this method overload is equivalent to calling the extension method overload and specifying `null` for the `progress` parameter. This is useful when you don't want to get progress reports from an action that reports progress. ]]> @@ -550,9 +550,9 @@ Calling this method overload is equivalent to calling the [!NOTE] -> In Visual Basic and C#, you can call this method as an instance method on any object of type . When you use instance method syntax to call this method, omit the first parameter. For more information, see [Extension Methods (Visual Basic)](/dotnet/visual-basic/programming-guide/language-features/procedures/extension-methods) or [Extension Methods (C# Programming Guide)](/dotnet/csharp/programming-guide/classes-and-structs/extension-methods). +> In Visual Basic and C#, you can call this method as an instance method on any object of type . When you use instance method syntax to call this method, omit the first parameter. For more information, see [Extension Methods (Visual Basic)](/dotnet/visual-basic/programming-guide/language-features/procedures/extension-methods) or [Extension Methods (C# Programming Guide)](/dotnet/csharp/programming-guide/classes-and-structs/extension-methods). -Use this method to get a object for a Windows Runtime asynchronous operation. objects simplify the coordination of asynchronous operations. +Use this method to get a object for a Windows Runtime asynchronous operation. objects simplify the coordination of asynchronous operations. ]]> @@ -596,11 +596,11 @@ Use this method to get a object for a Win ## Remarks > [!NOTE] -> In Visual Basic and C#, you can call this method as an instance method on any object of type . When you use instance method syntax to call this method, omit the first parameter. For more information, see [Extension Methods (Visual Basic)](/dotnet/visual-basic/programming-guide/language-features/procedures/extension-methods) or [Extension Methods (C# Programming Guide)](/dotnet/csharp/programming-guide/classes-and-structs/extension-methods). +> In Visual Basic and C#, you can call this method as an instance method on any object of type . When you use instance method syntax to call this method, omit the first parameter. For more information, see [Extension Methods (Visual Basic)](/dotnet/visual-basic/programming-guide/language-features/procedures/extension-methods) or [Extension Methods (C# Programming Guide)](/dotnet/csharp/programming-guide/classes-and-structs/extension-methods). -Use this method to get a object for a Windows Runtime asynchronous operation. objects simplify the coordination of asynchronous operations. +Use this method to get a object for a Windows Runtime asynchronous operation. objects simplify the coordination of asynchronous operations. -Calling this method overload is equivalent to calling the extension method overload and specifying `null` for the `progress` parameter. This is useful when you don't want to get progress reports from an action that reports progress. +Calling this method overload is equivalent to calling the extension method overload and specifying `null` for the `progress` parameter. This is useful when you don't want to get progress reports from an action that reports progress. ]]> @@ -646,9 +646,9 @@ Calling this method overload is equivalent to calling the [!NOTE] -> In Visual Basic and C#, you can call this method as an instance method on any object of type . When you use instance method syntax to call this method, omit the first parameter. For more information, see [Extension Methods (Visual Basic)](/dotnet/visual-basic/programming-guide/language-features/procedures/extension-methods) or [Extension Methods (C# Programming Guide)](/dotnet/csharp/programming-guide/classes-and-structs/extension-methods). +> In Visual Basic and C#, you can call this method as an instance method on any object of type . When you use instance method syntax to call this method, omit the first parameter. For more information, see [Extension Methods (Visual Basic)](/dotnet/visual-basic/programming-guide/language-features/procedures/extension-methods) or [Extension Methods (C# Programming Guide)](/dotnet/csharp/programming-guide/classes-and-structs/extension-methods). -Use this method to get a object for a Windows Runtime asynchronous operation. objects simplify the coordination of asynchronous operations. +Use this method to get a object for a Windows Runtime asynchronous operation. objects simplify the coordination of asynchronous operations. ]]>
@@ -732,7 +732,7 @@ Use this method to get a object for a Win ## Remarks > [!NOTE] -> In Visual Basic and C#, you can call this method as an instance method on any object of type . When you use instance method syntax to call this method, omit the first parameter. For more information, see [Extension Methods (Visual Basic)](/dotnet/visual-basic/programming-guide/language-features/procedures/extension-methods) or [Extension Methods (C# Programming Guide)](/dotnet/csharp/programming-guide/classes-and-structs/extension-methods). +> In Visual Basic and C#, you can call this method as an instance method on any object of type . When you use instance method syntax to call this method, omit the first parameter. For more information, see [Extension Methods (Visual Basic)](/dotnet/visual-basic/programming-guide/language-features/procedures/extension-methods) or [Extension Methods (C# Programming Guide)](/dotnet/csharp/programming-guide/classes-and-structs/extension-methods). ]]>
@@ -822,7 +822,7 @@ Use this method to get a object for a Win ## Remarks > [!NOTE] -> In Visual Basic and C#, you can call this method as an instance method on any object of type . When you use instance method syntax to call this method, omit the first parameter. For more information, see [Extension Methods (Visual Basic)](/dotnet/visual-basic/programming-guide/language-features/procedures/extension-methods) or [Extension Methods (C# Programming Guide)](/dotnet/csharp/programming-guide/classes-and-structs/extension-methods). +> In Visual Basic and C#, you can call this method as an instance method on any object of type . When you use instance method syntax to call this method, omit the first parameter. For more information, see [Extension Methods (Visual Basic)](/dotnet/visual-basic/programming-guide/language-features/procedures/extension-methods) or [Extension Methods (C# Programming Guide)](/dotnet/csharp/programming-guide/classes-and-structs/extension-methods). ]]>
diff --git a/xml/System/_AppDomain.xml b/xml/System/_AppDomain.xml index c75293f4d27..0e8e69372ce 100644 --- a/xml/System/_AppDomain.xml +++ b/xml/System/_AppDomain.xml @@ -76,7 +76,7 @@ method. + See the method. ]]> @@ -220,7 +220,7 @@ method. + See the method. ]]> @@ -256,7 +256,7 @@ method. + See the method. ]]> @@ -302,7 +302,7 @@ method. + See the method. ]]> @@ -340,7 +340,7 @@ method overload. + See the method overload. The `activationAttributes` parameter is related to client-activated objects, a legacy technology. @@ -392,7 +392,7 @@ method overload. + See the method overload. The `activationAttributes` parameter is related to client-activated objects, a legacy technology. @@ -440,7 +440,7 @@ method overload. + See the method overload. ]]> @@ -478,7 +478,7 @@ method overload. + See the method overload. The `activationAttributes` parameter is related to client-activated objects, a legacy technology. @@ -530,7 +530,7 @@ method overload. + See the method overload. The `activationAttributes` parameter is related to client-activated objects, a legacy technology. @@ -578,7 +578,7 @@ method overload. + See the method overload. ]]> @@ -616,7 +616,7 @@ method overload. + See the method overload. ]]> @@ -654,7 +654,7 @@ method overload. + See the method overload. ]]> @@ -694,7 +694,7 @@ method overload. + See the method overload. ]]> @@ -736,7 +736,7 @@ method overload. + See the method overload. ]]> @@ -780,7 +780,7 @@ method overload. + See the method overload. ]]> @@ -824,7 +824,7 @@ method overload. + See the method overload. ]]> @@ -870,7 +870,7 @@ method overload. + See the method overload. ]]> @@ -919,7 +919,7 @@ method overload. + See the method overload. ]]> @@ -952,7 +952,7 @@ method. + See the method. ]]> @@ -1056,7 +1056,7 @@ method. + See the method. ]]> @@ -1130,7 +1130,7 @@ method overload. + See the method overload. ]]> @@ -1166,7 +1166,7 @@ method overload. + See the method overload. ]]> @@ -1204,7 +1204,7 @@ method overload. + See the method overload. ]]> @@ -1265,7 +1265,7 @@ method. + See the method. ]]> @@ -1299,7 +1299,7 @@ method. + See the method. ]]> @@ -1330,7 +1330,7 @@ method. + See the method. ]]> @@ -1409,7 +1409,7 @@ method. + See the method. ]]> @@ -1440,7 +1440,7 @@ method. + See the method. ]]> @@ -1549,7 +1549,7 @@ method. + See the method. ]]> @@ -1641,7 +1641,7 @@ method overload. + See the method overload. ]]> @@ -1675,7 +1675,7 @@ method overload. + See the method overload. ]]> @@ -1709,7 +1709,7 @@ method overload. + See the method overload. ]]> @@ -1774,7 +1774,7 @@ method overload. + See the method overload. ]]> @@ -1810,7 +1810,7 @@ method overload. + See the method overload. ]]> @@ -1988,7 +1988,7 @@ method. + See the method. ]]> @@ -2027,7 +2027,7 @@ method. + See the method. ]]> @@ -2068,7 +2068,7 @@ method. + See the method. ]]> @@ -2101,7 +2101,7 @@ method. + See the method. ]]> @@ -2140,7 +2140,7 @@ method. + See the method. ]]> @@ -2173,7 +2173,7 @@ method. + See the method. ]]> @@ -2235,7 +2235,7 @@ method. + See the method. ]]> @@ -2274,7 +2274,7 @@ event. + See the event. ]]> diff --git a/xml/ns-Microsoft.VisualBasic.Devices.xml b/xml/ns-Microsoft.VisualBasic.Devices.xml index 0bde2e78d4a..29826dd0381 100644 --- a/xml/ns-Microsoft.VisualBasic.Devices.xml +++ b/xml/ns-Microsoft.VisualBasic.Devices.xml @@ -13,7 +13,7 @@ - -- +- - diff --git a/xml/ns-System.AddIn.Contract.Automation.xml b/xml/ns-System.AddIn.Contract.Automation.xml index d5374bf2808..cfc9fc48e7d 100644 --- a/xml/ns-System.AddIn.Contract.Automation.xml +++ b/xml/ns-System.AddIn.Contract.Automation.xml @@ -7,7 +7,7 @@ ## Remarks Use the interfaces in the namespace to enable components to access type information for a remote object without having direct access to the of the remote object. The namespace defines reflection functionality for components that use the interfaces and structures in the , , and namespaces to communicate. The interfaces in these namespaces are also called contracts. All contracts derive from the interface. - When using contracts to manage the communication between components, you must implement the interface in a type to expose the type information to other components. Components can then access the members of the type by calling the method of the interface to get an . The other interfaces and structures in the namespace provide access to type information for delegates, properties, methods, events, and fields. + When using contracts to manage the communication between components, you must implement the interface in a type to expose the type information to other components. Components can then access the members of the type by calling the method of the interface to get an . The other interfaces and structures in the namespace provide access to type information for delegates, properties, methods, events, and fields. Components can use the contracts in the namespace to access type information for an object that is in a different process or application domain, or in the same process or application domain. diff --git a/xml/ns-System.AddIn.Contract.xml b/xml/ns-System.AddIn.Contract.xml index 5f00d13c3b3..1285a6f9fb4 100644 --- a/xml/ns-System.AddIn.Contract.xml +++ b/xml/ns-System.AddIn.Contract.xml @@ -7,7 +7,7 @@ ## Remarks The namespace defines a set of interfaces and structures that can be used by independently updated components, such as an application and an add-in, to communicate. Components can use the interfaces and structures in the namespace to communicate across process or application domain boundaries, or to communicate with other components in the same process or application domain. - The interfaces in the namespace are also called contracts. All contracts derive from the interface. The purpose that serves for components created using the .NET Framework is similar to the purpose that the `IUnknown` interface serves for components created using COM. To determine whether an object implements a particular contract, components use the method. + The interfaces in the namespace are also called contracts. All contracts derive from the interface. The purpose that serves for components created using the .NET Framework is similar to the purpose that the `IUnknown` interface serves for components created using COM. To determine whether an object implements a particular contract, components use the method. The and namespaces contain additional contracts that supplement the namespace. The namespace contains contracts that components use to access type information and invoke type members. The namespace contains contracts that define collections of and objects. diff --git a/xml/ns-System.Collections.Generic.xml b/xml/ns-System.Collections.Generic.xml index fcf29dbabe1..33753c8e7cc 100644 --- a/xml/ns-System.Collections.Generic.xml +++ b/xml/ns-System.Collections.Generic.xml @@ -5,7 +5,7 @@ is a generic version of ; it uses the generic structure for enumeration instead of . is a generic version of . There are generic and classes that correspond to the nongeneric versions. There are generic and nongeneric versions of . Both versions are hybrids of a dictionary and a list. The generic class is a pure dictionary and has no nongeneric counterpart. The generic class is a true linked list and has no nongeneric counterpart. + Many of the generic collection types are direct analogs of nongeneric types. is a generic version of ; it uses the generic structure for enumeration instead of . is a generic version of . There are generic and classes that correspond to the nongeneric versions. There are generic and nongeneric versions of . Both versions are hybrids of a dictionary and a list. The generic class is a pure dictionary and has no nongeneric counterpart. The generic class is a true linked list and has no nongeneric counterpart. ]]> diff --git a/xml/ns-System.Collections.Specialized.xml b/xml/ns-System.Collections.Specialized.xml index 9df5e631bc0..105d99cdd06 100644 --- a/xml/ns-System.Collections.Specialized.xml +++ b/xml/ns-System.Collections.Specialized.xml @@ -11,7 +11,7 @@ The class creates instances of case-insensitive collections. - Some collections transform. For example, the class starts as a and becomes a when it becomes large. The is a list but it also creates a lookup dictionary when the number of elements reaches a specified threshold. + Some collections transform. For example, the class starts as a and becomes a when it becomes large. The is a list but it also creates a lookup dictionary when the number of elements reaches a specified threshold. ]]> diff --git a/xml/ns-System.Configuration.Install.xml b/xml/ns-System.Configuration.Install.xml index 646c70e2699..31fd609416f 100644 --- a/xml/ns-System.Configuration.Install.xml +++ b/xml/ns-System.Configuration.Install.xml @@ -5,11 +5,11 @@ property, an installer contains a collection of other installers as children. As the installer is executed, it cycles through its children and calls , , , or . For an example of an object in the collection, see . + Through the property, an installer contains a collection of other installers as children. As the installer is executed, it cycles through its children and calls , , , or . For an example of an object in the collection, see . - The property contains information about the installation. For example, information about the location of the log file for the installation, the location of the file that saves information required by the method, and the command line that was entered when the installation executable was run. For an example of an installation executable, see [Installutil.exe (Installer Tool)](/dotnet/framework/tools/installutil-exe-installer-tool). + The property contains information about the installation. For example, information about the location of the log file for the installation, the location of the file that saves information required by the method, and the command line that was entered when the installation executable was run. For an example of an installation executable, see [Installutil.exe (Installer Tool)](/dotnet/framework/tools/installutil-exe-installer-tool). - The , , , and methods are not always called on the same instance of . For example, you might use an to install and commit an application, and then release the reference to that . Later, uninstalling the application creates a new reference to an , which means that the method is called on a different instance of . For this reason, do not save the state of a computer in an installer. Instead, use an that is preserved across calls and passed into the , , , and methods. + The , , , and methods are not always called on the same instance of . For example, you might use an to install and commit an application, and then release the reference to that . Later, uninstalling the application creates a new reference to an , which means that the method is called on a different instance of . For this reason, do not save the state of a computer in an installer. Instead, use an that is preserved across calls and passed into the , , , and methods. ]]> diff --git a/xml/ns-System.Data.xml b/xml/ns-System.Data.xml index 2721c210c59..253666d39ee 100644 --- a/xml/ns-System.Data.xml +++ b/xml/ns-System.Data.xml @@ -9,7 +9,7 @@ The centerpiece of the ADO.NET architecture is the class. Each can contain multiple objects, with each containing data from a single data source, such as SQL Server. - Each contains a --a collection of objects--that determines the schema of each . The property determines the type of data held by the . The and properties let you further guarantee data integrity. The property lets you construct calculated columns. + Each contains a --a collection of objects--that determines the schema of each . The property determines the type of data held by the . The and properties let you further guarantee data integrity. The property lets you construct calculated columns. If a participates in a parent/child relationship with another , the relationship is constructed by adding a to the of a object. When such a relation is added, a and a are both created automatically, depending on the parameter settings for the constructor. The guarantees that values that are contained in a column are unique. The determines what action will happen to the child row or column when a primary key value is changed or deleted. diff --git a/xml/ns-System.Device.Location.xml b/xml/ns-System.Device.Location.xml index 0e68e9222bc..f4599467062 100644 --- a/xml/ns-System.Device.Location.xml +++ b/xml/ns-System.Device.Location.xml @@ -5,7 +5,7 @@ class supplies location data that is based on latitude and longitude coordinates. The and types provide the ability to resolve from a coordinate location to a civic address. Additionally, the interface can be implemented to extend the types of location data that are supplied. + The class supplies location data that is based on latitude and longitude coordinates. The and types provide the ability to resolve from a coordinate location to a civic address. Additionally, the interface can be implemented to extend the types of location data that are supplied. In Windows 7, all the classes are fully functional if a location provider is installed and can determine the computer's location. On Windows 7 Starter Edition, the Default Location Provider that can be set in Control Panel is the only location provider that is supported. @@ -13,7 +13,7 @@ - All objects that have constructors can be created, but the property will always have the value . -- The location indicated by the property of will always be . +- The location indicated by the property of will always be . - No location events will be raised. diff --git a/xml/ns-System.Diagnostics.PerformanceData.xml b/xml/ns-System.Diagnostics.PerformanceData.xml index 285abf36d10..5b036aa2956 100644 --- a/xml/ns-System.Diagnostics.PerformanceData.xml +++ b/xml/ns-System.Diagnostics.PerformanceData.xml @@ -29,11 +29,11 @@ 3. Write your provider. The following steps show the calls made by a provider: - 1. Call the constructor to define the counter set. Call this method for each counter set defined in the manifest. + 1. Call the constructor to define the counter set. Call this method for each counter set defined in the manifest. - 2. For each counter set, call one of the methods to add the counters to the set. Call this method for each counter defined in the counter set. + 2. For each counter set, call one of the methods to add the counters to the set. Call this method for each counter defined in the counter set. - 3. Call the method to create an instance of the counter set (an instance contains the counter data). For single instance counter sets, call this method one time. For multiple instance counter sets, call this method for each instance for which you need to provide counter data (use a unique name for each instance). + 3. Call the method to create an instance of the counter set (an instance contains the counter data). For single instance counter sets, call this method one time. For multiple instance counter sets, call this method for each instance for which you need to provide counter data (use a unique name for each instance). 4. Use the property to access and set the counter data for the counter. diff --git a/xml/ns-System.Drawing.Printing.xml b/xml/ns-System.Drawing.Printing.xml index e2694aa3b89..69f1923de0d 100644 --- a/xml/ns-System.Drawing.Printing.xml +++ b/xml/ns-System.Drawing.Printing.xml @@ -5,14 +5,14 @@ class, set properties, such as and , that describe how to print, and call the method to actually print the document. Calling the method raises the event, which should be handled to perform the document layout for printing. + Typically, when you print from a Windows Forms application, you create a new instance of the class, set properties, such as and , that describe how to print, and call the method to actually print the document. Calling the method raises the event, which should be handled to perform the document layout for printing. - Use the property of the object obtained from the event to specify the output to print. If you are printing a text file, use to read one line at a time from the stream and call the method to draw the line in the graphics object. For more information about this process, see the and classes. You can view an example of printing a text document in the class overview topic. + Use the property of the object obtained from the event to specify the output to print. If you are printing a text file, use to read one line at a time from the stream and call the method to draw the line in the graphics object. For more information about this process, see the and classes. You can view an example of printing a text document in the class overview topic. > [!NOTE] -> The methods of the class are not supported for printing. Instead, use the methods of the class. +> The methods of the class are not supported for printing. Instead, use the methods of the class. - When implemented in a derived class, the controls how a is printed. The method invokes the print controller's , , , and methods, which in turn tell the printer how to print the document. For more information about printing dialog boxes, see and . + When implemented in a derived class, the controls how a is printed. The method invokes the print controller's , , , and methods, which in turn tell the printer how to print the document. For more information about printing dialog boxes, see and . The print-preview process uses a specialized print controller, dialog box, and control. For an example of such a print controller and dialog box, see , , and . diff --git a/xml/ns-System.IO.Packaging.xml b/xml/ns-System.IO.Packaging.xml index 6f16daf5812..6e299749fac 100644 --- a/xml/ns-System.IO.Packaging.xml +++ b/xml/ns-System.IO.Packaging.xml @@ -11,19 +11,19 @@ Like a file system, items contained in a are referenced in a hierarchical organization of folders and files. - Although is an abstract class, the derived class is used as default by the method. + Although is an abstract class, the derived class is used as default by the method. A ("part") is the abstract class that represents an object that is stored in a . A ("relationship") defines an association between a source or and a target object. A can be one of two types, each of which can be one of two forms: -- Package-level relationship (created by ) +- Package-level relationship (created by ) - Between a and a target part in the package. - Between a and a target resource outside the package. -- Part-level relationship (created by ) +- Part-level relationship (created by ) - Between a source and another target part in the package. diff --git a/xml/ns-System.Linq.xml b/xml/ns-System.Linq.xml index 67b57f4164a..7eca38490ea 100644 --- a/xml/ns-System.Linq.xml +++ b/xml/ns-System.Linq.xml @@ -7,9 +7,9 @@ ## Remarks The namespace is in the System.Core assembly (in System.Core.dll). - The class contains LINQ standard query operators that operate on objects that implement . + The class contains LINQ standard query operators that operate on objects that implement . - The class contains LINQ standard query operators that operate on objects that implement . + The class contains LINQ standard query operators that operate on objects that implement . For more information, see [LINQ to SQL](/dotnet/framework/data/adonet/sql/linq/). diff --git a/xml/ns-System.Messaging.xml b/xml/ns-System.Messaging.xml index 0a424527658..d5bf09f3565 100644 --- a/xml/ns-System.Messaging.xml +++ b/xml/ns-System.Messaging.xml @@ -7,21 +7,21 @@ ## Remarks Members of the class include the following methods for reading and writing messages to the queue: -- The method enables your application to write messages to the queue. Overloads of the method enable you to specify whether to send your message using a (which provides detailed control over the information you send) or any other managed object, including application-specific classes. The method also supports sending messages as part of a transaction. +- The method enables your application to write messages to the queue. Overloads of the method enable you to specify whether to send your message using a (which provides detailed control over the information you send) or any other managed object, including application-specific classes. The method also supports sending messages as part of a transaction. -- The , , and methods provide functionality for reading messages from a queue. Like the method, these methods provide overloads that support transactional queue processing. These methods also provide overloads with time-out. +- The , , and methods provide functionality for reading messages from a queue. Like the method, these methods provide overloads that support transactional queue processing. These methods also provide overloads with time-out. Out parameters that enable processing to continue if the queue is empty. Because these methods are examples of synchronous processing, they interrupt the current thread until a message is available, unless you specify a time-out. -- The method is similar to , but it does not cause a message to be removed from the queue when it is read. Because does not change the queue contents, there are no overloads to support transactional processing. However, because , like , reads messages synchronously from the queue, overloads of the method do support specifying a time-out in order to prevent the thread from waiting indefinitely. +- The method is similar to , but it does not cause a message to be removed from the queue when it is read. Because does not change the queue contents, there are no overloads to support transactional processing. However, because , like , reads messages synchronously from the queue, overloads of the method do support specifying a time-out in order to prevent the thread from waiting indefinitely. -- The , , , and methods provide ways to asynchronously read messages from the queue. They do not interrupt the current thread while waiting for a message to arrive in the queue. +- The , , , and methods provide ways to asynchronously read messages from the queue. They do not interrupt the current thread while waiting for a message to arrive in the queue. The following methods of the class provide functionality for retrieving lists of queues by specified criteria and determining if specific queues exist: -- enables the retrieval of the private queues on a computer. +- enables the retrieval of the private queues on a computer. -- , , and provide ways to retrieve public queues by common criteria. An overload of provides even finer detail for selecting queues based on a number of search criteria. +- , , and provide ways to retrieve public queues by common criteria. An overload of provides even finer detail for selecting queues based on a number of search criteria. Other methods of the class provide the following functionality: diff --git a/xml/ns-System.Printing.xml b/xml/ns-System.Printing.xml index 88cedc9ac12..616fe8a6e71 100644 --- a/xml/ns-System.Printing.xml +++ b/xml/ns-System.Printing.xml @@ -17,7 +17,7 @@ - The class, which instructs the printer how to process a print job. - Classes derived from the class each have a and a method. You must use these methods to ensure that instances of the classes are synchronized with the hardware or software components that they represent. + Classes derived from the class each have a and a method. You must use these methods to ensure that instances of the classes are synchronized with the hardware or software components that they represent. The namespace also includes many enumerations that describe printer capabilities, such as whether a printer can produce collated output, and that specify instructions to printers, such as the paper size to use for a print job. diff --git a/xml/ns-System.Resources.xml b/xml/ns-System.Resources.xml index 4eab126421a..8a032a9ed31 100644 --- a/xml/ns-System.Resources.xml +++ b/xml/ns-System.Resources.xml @@ -5,7 +5,7 @@ class allows the user to access and control resources stored in the main assembly or in resource satellite assemblies. Use the and methods to retrieve culture-specific objects and strings. + The class allows the user to access and control resources stored in the main assembly or in resource satellite assemblies. Use the and methods to retrieve culture-specific objects and strings. ]]> diff --git a/xml/ns-System.Runtime.Remoting.xml b/xml/ns-System.Runtime.Remoting.xml index 877edb721e8..48cf8045d87 100644 --- a/xml/ns-System.Runtime.Remoting.xml +++ b/xml/ns-System.Runtime.Remoting.xml @@ -5,14 +5,14 @@ class contains static methods for interfacing with configuration settings. The method allows developers to configure the remoting infrastructure through the use of XML formatted configuration files. The class also contains several methods for client-end and server-end registration of client and server activated objects that reside on the server. + The class contains static methods for interfacing with configuration settings. The method allows developers to configure the remoting infrastructure through the use of XML formatted configuration files. The class also contains several methods for client-end and server-end registration of client and server activated objects that reside on the server. - The class provides a number of methods to help in using and publishing remoted objects. The method provides the functionality for storing all the relevant information required to activate and communicate with a remote object in an instance of the class for later serialization and transmission to a remote location. The method reverses this process, creating a proxy for a remote object that can be used by an application without regard for any remoting subdivisions. + The class provides a number of methods to help in using and publishing remoted objects. The method provides the functionality for storing all the relevant information required to activate and communicate with a remote object in an instance of the class for later serialization and transmission to a remote location. The method reverses this process, creating a proxy for a remote object that can be used by an application without regard for any remoting subdivisions. - The class holds all the relevant information required to activate and communicate with a remote object. This class is a serializable representation of an object that is transmitted to a remote location using a channel, where it is unmarshaled (see ) and can be used to create a local proxy of the remoted object. + The class holds all the relevant information required to activate and communicate with a remote object. This class is a serializable representation of an object that is transmitted to a remote location using a channel, where it is unmarshaled (see ) and can be used to create a local proxy of the remoted object. > [!NOTE] -> Marshal-by-reference objects (MBRs) do not reside in memory forever. Instead, unless the type overrides to control its own lifetime policies, each MBR has a finite lifetime before the .NET Framework remoting system begins the process of deleting it and reclaiming the memory. For more information, see [Lifetime Leases](/previous-versions/dotnet/netframework-4.0/23bk23zc(v=vs.100)). +> Marshal-by-reference objects (MBRs) do not reside in memory forever. Instead, unless the type overrides to control its own lifetime policies, each MBR has a finite lifetime before the .NET Framework remoting system begins the process of deleting it and reclaiming the memory. For more information, see [Lifetime Leases](/previous-versions/dotnet/netframework-4.0/23bk23zc(v=vs.100)). ]]> diff --git a/xml/ns-System.Speech.AudioFormat.xml b/xml/ns-System.Speech.AudioFormat.xml index e55a25ca206..8350b29f148 100644 --- a/xml/ns-System.Speech.AudioFormat.xml +++ b/xml/ns-System.Speech.AudioFormat.xml @@ -5,7 +5,7 @@ to obtain information about specific characteristics of an audio format. These properties are read-only, except for , which you can use to set the block alignment of incoming audio. To get all the properties of the incoming audio format, use the method. + You can use the properties of to obtain information about specific characteristics of an audio format. These properties are read-only, except for , which you can use to set the block alignment of incoming audio. To get all the properties of the incoming audio format, use the method. Using the constructors on the class, you can specify any of the properties of the audio format when you initialize the object. diff --git a/xml/ns-System.Speech.Recognition.SrgsGrammar.xml b/xml/ns-System.Speech.Recognition.SrgsGrammar.xml index 2d307d4d493..f432b78ef10 100644 --- a/xml/ns-System.Speech.Recognition.SrgsGrammar.xml +++ b/xml/ns-System.Speech.Recognition.SrgsGrammar.xml @@ -5,9 +5,9 @@ instance and add instances of classes that represent SRGS elements. The , , , , , and classes represent elements defined in the SRGS specification. Some of the properties of the class represent attributes in the SRGS specification, such as , , , and . See [SRGS Grammar XML Reference](https://learn.microsoft.com/previous-versions/office/developer/speech-technologies/hh361653(v%3doffice.14)) for a reference to the elements and attributes of the SRGS specification as supported by System.Speech. + To create an SRGS grammar programmatically, you construct an empty instance and add instances of classes that represent SRGS elements. The , , , , , and classes represent elements defined in the SRGS specification. Some of the properties of the class represent attributes in the SRGS specification, such as , , , and . See [SRGS Grammar XML Reference](https://learn.microsoft.com/previous-versions/office/developer/speech-technologies/hh361653(v%3doffice.14)) for a reference to the elements and attributes of the SRGS specification as supported by System.Speech. - To add a grammar rule to a , use the method of the class. You can modify the text within an SRGS element using the property of a instance. + To add a grammar rule to a , use the method of the class. You can modify the text within an SRGS element using the property of a instance. With the class, you can optimize recognition of phrases in a grammar by specifying subsets of a complete phrase that will be allowed to constitute a match, and by selecting a matching mode from the enumeration. diff --git a/xml/ns-System.Speech.Synthesis.TtsEngine.xml b/xml/ns-System.Speech.Synthesis.TtsEngine.xml index 153639897c1..6bb56207619 100644 --- a/xml/ns-System.Speech.Synthesis.TtsEngine.xml +++ b/xml/ns-System.Speech.Synthesis.TtsEngine.xml @@ -17,7 +17,7 @@ A of synthetic speech engine implemented using technology can: -- Receive input, (see ,., , and ) +- Receive input, (see ,., , and ) - Queue events, and specify actions (see , , , ). diff --git a/xml/ns-System.Speech.Synthesis.xml b/xml/ns-System.Speech.Synthesis.xml index bc4f76c8d6a..390296e5f4a 100644 --- a/xml/ns-System.Speech.Synthesis.xml +++ b/xml/ns-System.Speech.Synthesis.xml @@ -7,7 +7,7 @@ ## Remarks **Initialize and Configure** - The class provides access to the functionality of a speech synthesis engine that is installed on the host computer. Installed speech synthesis engines are represented by a voice, for example Microsoft Anna. A instance initializes to the default voice. To configure a instance to use one of the other installed voices, call the or methods. To get information about which voices are installed, use the method. + The class provides access to the functionality of a speech synthesis engine that is installed on the host computer. Installed speech synthesis engines are represented by a voice, for example Microsoft Anna. A instance initializes to the default voice. To configure a instance to use one of the other installed voices, call the or methods. To get information about which voices are installed, use the method. You can route the output of the to a stream, a file, the default audio device, or to a null device by using one of the methods in the class whose name begins with "`SetOutputTo`". @@ -19,9 +19,9 @@ **Generate Speech** - To generate speech from a string or from a or object, use the or the methods. To generate speech from SSML markup, use the or the methods. See [Speech Synthesis Markup Language Reference](/previous-versions/ff394847(v=msdn.10)) for a guide to SSML markup. + To generate speech from a string or from a or object, use the or the methods. To generate speech from SSML markup, use the or the methods. See [Speech Synthesis Markup Language Reference](/previous-versions/ff394847(v=msdn.10)) for a guide to SSML markup. - You can guide the pronunciation of words by using the or methods, and by adding or removing lexicons for a instance using the and methods. + You can guide the pronunciation of words by using the or methods, and by adding or removing lexicons for a instance using the and methods. **Respond to Events** @@ -33,7 +33,7 @@ **Modify Voice Characteristics** - The class and and methods let you modify characteristics of a voice using , , and parameters. To modify characteristics of a voice such as culture, age, and gender, use one of the methods of the class or the methods of the class. + The class and and methods let you modify characteristics of a voice using , , and parameters. To modify characteristics of a voice such as culture, age, and gender, use one of the methods of the class or the methods of the class. See [Controlling Voice Attributes](https://learn.microsoft.com/previous-versions/office/developer/speech-technologies/hh362932(v%3doffice.14)) in the [System Speech Programming Guide for .NET Framework](https://learn.microsoft.com/previous-versions/office/developer/speech-technologies/hh361625(v%3doffice.14)) for more information. diff --git a/xml/ns-System.Text.xml b/xml/ns-System.Text.xml index 3c9575d3085..7872ab5b1a8 100644 --- a/xml/ns-System.Text.xml +++ b/xml/ns-System.Text.xml @@ -5,7 +5,7 @@ (UTF-16) encoding is used internally by .NET, and encoding is often used for storing character data to ensure portability across machines and cultures. + The encoding classes are primarily intended to convert between different encodings or code pages and a Unicode encoding. (UTF-16) encoding is used internally by .NET, and encoding is often used for storing character data to ensure portability across machines and cultures. The classes derived from enable you to choose a fallback strategy, which determines how characters that cannot be encoded into a sequence of bytes, or bytes that cannot be decoded into characters, are handled. You can choose one of the following: diff --git a/xml/ns-System.Web.ClientServices.Providers.xml b/xml/ns-System.Web.ClientServices.Providers.xml index 764c94fc176..21b82c935ed 100644 --- a/xml/ns-System.Web.ClientServices.Providers.xml +++ b/xml/ns-System.Web.ClientServices.Providers.xml @@ -7,7 +7,7 @@ ## Remarks The classes in the namespace include client application service providers that enable Windows-based applications to use the Microsoft Ajax authentication, roles, and profile services. You can enable these services and specify client service providers in your application configuration file, and then access the services through existing .NET membership, identity, and application settings infrastructures. The client service providers also support occasional connectivity by storing and retrieving user information in a local data cache when the application is offline. For more information, see [Client Application Services](/dotnet/framework/common-client-technologies/client-application-services). - To access the login service, you can use either Windows or Forms authentication by specifying the or in your application configuration. Windows authentication uses the identity supplied when a user logs in to the operating system. Forms authentication requires that you to retrieve login information from the user and pass it to the service. You can do this by specifying an implementation with your configuration. The method returns a object that contains user login information. You can populate this object, for example, by displaying a login dialog box in the method. + To access the login service, you can use either Windows or Forms authentication by specifying the or in your application configuration. Windows authentication uses the identity supplied when a user logs in to the operating system. Forms authentication requires that you to retrieve login information from the user and pass it to the service. You can do this by specifying an implementation with your configuration. The method returns a object that contains user login information. You can populate this object, for example, by displaying a login dialog box in the method. To access the roles and profile services, specify the and in your application configuration. diff --git a/xml/ns-System.Windows.Forms.VisualStyles.xml b/xml/ns-System.Windows.Forms.VisualStyles.xml index 2943fb5ac7c..977a2e1f3f8 100644 --- a/xml/ns-System.Windows.Forms.VisualStyles.xml +++ b/xml/ns-System.Windows.Forms.VisualStyles.xml @@ -13,7 +13,7 @@ - provides a set of `static` properties that provide information about the current visual style of the operating system. - The namespace also includes a set of enumerations. Some of these enumerations, such as and , provide state definitions for related visual style elements. Most of the other enumerations support methods that return information about a particular element. For example, the enumeration provides the possible argument values for the method. Finally, the enumeration provides values that define how visual styles are currently applied to the application. + The namespace also includes a set of enumerations. Some of these enumerations, such as and , provide state definitions for related visual style elements. Most of the other enumerations support methods that return information about a particular element. For example, the enumeration provides the possible argument values for the method. Finally, the enumeration provides values that define how visual styles are currently applied to the application. ]]> diff --git a/xml/ns-System.Windows.Xps.xml b/xml/ns-System.Windows.Xps.xml index 43f23b3dd1a..37e1ac03559 100644 --- a/xml/ns-System.Windows.Xps.xml +++ b/xml/ns-System.Windows.Xps.xml @@ -2,13 +2,13 @@ Provides classes that write XPS documents to a data store or print queue. - class provides the and methods that output XPS documents to a data store or print queue. Separate groups of write methods are provided for different content types including , , , , and . The methods enable you to also include a with the document, plus pass additional information to the handlers of the , , and events. - - For more information about XPS, see the [XML Paper Specification (XPS)](https://www.ecma-international.org/publications-and-standards/standards/ecma-388/). - + class provides the and methods that output XPS documents to a data store or print queue. Separate groups of write methods are provided for different content types including , , , , and . The methods enable you to also include a with the document, plus pass additional information to the handlers of the , , and events. + + For more information about XPS, see the [XML Paper Specification (XPS)](https://www.ecma-international.org/publications-and-standards/standards/ecma-388/). + ]]> diff --git a/xml/ns-System.Xml.Serialization.xml b/xml/ns-System.Xml.Serialization.xml index eca70b535ab..0d43e36fcd7 100644 --- a/xml/ns-System.Xml.Serialization.xml +++ b/xml/ns-System.Xml.Serialization.xml @@ -5,9 +5,9 @@ class. To use this class, use the constructor to create an instance of the class using the type of the object to serialize. Once an is created, create an instance of the object to serialize. You must also create an object to write the file to a document or stream, such as a , , or . You can then call the method to convert the object into an XML document. + The central class in the namespace is the class. To use this class, use the constructor to create an instance of the class using the type of the object to serialize. Once an is created, create an instance of the object to serialize. You must also create an object to write the file to a document or stream, such as a , , or . You can then call the method to convert the object into an XML document. - To deserialize an object from an XML document, create a suitable object to read the document or stream (again, a , , or ). Invoke the method while casting the resulting object to the type of the original object (that was serialized). + To deserialize an object from an XML document, create a suitable object to read the document or stream (again, a , , or ). Invoke the method while casting the resulting object to the type of the original object (that was serialized). To further control the serialization, the namespace contains several classes that can be applied to members of a class. For example, if a class contains a member that will be serialized as an XML element, you can apply the attribute to the member. When applying the attribute, you can specify details such as the actual XML element name using the property. For a complete list of all the attributes, see the class overview. diff --git a/xml/ns-System.Xml.xml b/xml/ns-System.Xml.xml index 44db732fdaa..8009faeb081 100644 --- a/xml/ns-System.Xml.xml +++ b/xml/ns-System.Xml.xml @@ -28,13 +28,13 @@ - We don't recommend mixing synchronous and asynchronous function calls, because you might forget to use the `await` keyword or use a synchronous API where an asynchronous one is necessary. -- Do not set the or flag to `true` if you don't intend to use an asynchronous method. +- Do not set the or flag to `true` if you don't intend to use an asynchronous method. - If you forget to specify the `await` keyword when you call an asynchronous method, the results are non-deterministic: You might receive the result you expected or an exception. -- When an object is reading a large text node, it might cache only a partial text value and return the text node, so retrieving the property might be blocked by an I/O operation. Use the method to get the text value in asynchronous mode, or use the method to read a large text block in chunks. +- When an object is reading a large text node, it might cache only a partial text value and return the text node, so retrieving the property might be blocked by an I/O operation. Use the method to get the text value in asynchronous mode, or use the method to read a large text block in chunks. -- When you use an object, call the method before calling to avoid blocking an I/O operation. +- When you use an object, call the method before calling to avoid blocking an I/O operation. ## Differences from the W3C specs @@ -175,7 +175,7 @@ - Writing XML documents and fragments from data sources to the file system, streams, a , or a . -- Loading documents into the Document Object Model (DOM) object if you are using an object and set to . +- Loading documents into the Document Object Model (DOM) object if you are using an object and set to . - Navigating the DOM object. @@ -191,7 +191,7 @@ - DOM operations such as querying, editing, moving sub-trees between documents, and saving DOM objects. - If you are concerned about denial of service issues or if you are dealing with untrusted sources, do not enable DTD processing. This is disabled by default on objects that the method creates. + If you are concerned about denial of service issues or if you are dealing with untrusted sources, do not enable DTD processing. This is disabled by default on objects that the method creates. > [!NOTE] > The allows DTD processing by default. Use the property to disable this feature. @@ -210,13 +210,13 @@ - XSLT scripting is disabled by default. XSLT scripting should be enabled only if you require script support and you are working in a fully trusted environment. -- The XSLT `document()` function is disabled by default. If you enable the `document()` function, restrict the resources that can be accessed by passing an object to the method. +- The XSLT `document()` function is disabled by default. If you enable the `document()` function, restrict the resources that can be accessed by passing an object to the method. -- Extension objects are enabled by default. If an object that contains extension objects is passed to the method, the extension objects are used. +- Extension objects are enabled by default. If an object that contains extension objects is passed to the method, the extension objects are used. - XSLT style sheets can include references to other files and embedded script blocks. A malicious user can exploit this by supplying you with data or style sheets that, when executed, can cause your system to process until the computer runs low on resources. -- XSLT apps that run in a mixed trust environment can result in style sheet spoofing. For example, a malicious user can load an object with a harmful style sheet and hand it off to another user who subsequently calls the method and executes the transformation. +- XSLT apps that run in a mixed trust environment can result in style sheet spoofing. For example, a malicious user can load an object with a harmful style sheet and hand it off to another user who subsequently calls the method and executes the transformation. These security issues can be mitigated by not enabling scripting or the `document()` function unless the style sheet comes from a trusted source, and by not accepting objects, XSLT style sheets, or XML source data from an untrusted source.